{
  "$schema": "https://farmslot.io/schemas/action-manifest-v1.schema.json",
  "actions": {
    "command": {
      "description": "Run a shell command from the project root.",
      "examples": [
        {
          "action": "command",
          "cmd": "pwd",
          "intent": "Prepare the project state needed for this proof.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "cmd": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "cwd": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          },
          "allow_failure": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "wait": {
      "description": "Base wait action.",
      "examples": [
        {
          "action": "wait",
          "duration_ms": 1,
          "intent": "Allow the requested asynchronous state to settle.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "duration_ms": {
            "type": "integer"
          },
          "ms": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      }
    },
    "assert_file": {
      "description": "Assert that a project file exists and optionally contains text.",
      "examples": [
        {
          "action": "assert_file",
          "path": "reports/result.txt",
          "contains": "ok",
          "intent": "Confirm the requested project file state.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "contains": {
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "additionalProperties": false
      }
    },
    "assert_json": {
      "description": "Assert a JSON file value with a JSONPath-style selector.",
      "examples": [
        {
          "action": "assert_json",
          "path": "reports/result.json",
          "assert": {
            "path": "$.status",
            "operator": "eq",
            "value": "ok"
          },
          "intent": "Confirm the recorded data satisfies the requested condition.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "assert": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "operator": {
                "type": "string"
              },
              "value": {
                "type": [
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "object",
                  "array"
                ],
                "items": {
                  "type": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "object"
                  ]
                }
              },
              "all": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "any": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "none": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "path",
          "assert"
        ],
        "additionalProperties": false
      }
    },
    "assert_exit_code": {
      "description": "Assert the exit code captured from a command node output.",
      "examples": [
        {
          "action": "assert_exit_code",
          "source": "run-tests",
          "expected": 0,
          "intent": "Confirm the project command completed with the expected result.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "expected": {
            "type": "number"
          }
        },
        "additionalProperties": false
      }
    },
    "assert_output": {
      "description": "Assert stdout or stderr captured from a command node output.",
      "examples": [
        {
          "action": "assert_output",
          "source": "run-tests",
          "stream": "stdout",
          "contains": "PASS",
          "intent": "Confirm the recorded output satisfies the requested condition.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "stream": {
            "type": "string"
          },
          "contains": {
            "type": "string"
          },
          "match": {
            "type": "string"
          },
          "assert": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "operator": {
                "type": "string"
              },
              "value": {
                "type": [
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "object",
                  "array"
                ],
                "items": {
                  "type": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "object"
                  ]
                }
              },
              "all": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "any": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "none": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    },
    "watch_logs": {
      "description": "Base log assertion/capture action.",
      "examples": [
        {
          "action": "watch_logs",
          "path": "logs/app.log",
          "intent": "Observe the runtime behavior needed for this proof.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "contains": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "run",
              "file"
            ]
          }
        },
        "required": [
          "path"
        ],
        "additionalProperties": false
      }
    },
    "index_artifacts": {
      "description": "Index extra recipe-authored artifacts that already exist on disk. Do not use after ui.screenshot; screenshots are registered by the runner.",
      "examples": [
        {
          "action": "index_artifacts",
          "artifacts": [
            {
              "path": "reports/result.json",
              "type": "report",
              "category": "validation",
              "label": "Validation report"
            }
          ],
          "intent": "Preserve generated evidence in the review package.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "artifacts": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "object"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "nodeId": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "proofTarget": {
                  "type": "string"
                },
                "covers": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        },
        "required": [
          "artifacts"
        ],
        "additionalProperties": false
      }
    },
    "end": {
      "description": "Base terminal action.",
      "examples": [
        {
          "action": "end",
          "status": "pass"
        }
      ]
    },
    "call": {
      "description": "Invoke a named recipe by ref and run its steps inline.",
      "examples": [
        {
          "action": "call",
          "ref": "mydev.open_perps_setup",
          "intent": "Run a personal Perps setup recipe",
          "next": "done"
        }
      ]
    },
    "switch": {
      "description": "Choose a graph branch when one resolved string equals another.",
      "examples": [
        {
          "action": "switch",
          "value": "{{params.mode}}",
          "equals": "background_resume",
          "cases": {
            "match": "background"
          },
          "default": "warm",
          "intent": "Choose the graph path matching the observed state."
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "equals": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "equals"
        ],
        "additionalProperties": false
      },
      "result_cases": [
        "match"
      ]
    },
    "ui.navigate": {
      "description": "Navigate by semantic page intent when available; the adapter uses the current visible UI or a verified route. Raw url/hash/path values must be verified against the current app first.",
      "schema": {
        "type": "object",
        "properties": {
          "page": {
            "type": "string",
            "enum": [
              "back",
              "home",
              "network",
              "perps",
              "perps-market-list",
              "perps-market",
              "perps-activity",
              "swap"
            ]
          },
          "market": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "add_if_missing": {
            "type": "boolean",
            "default": true
          },
          "url": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "route": {
            "type": "string"
          },
          "screen": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "timeout_ms": {
            "type": "number",
            "default": 20000,
            "description": "Maximum time to discover and verify the requested page intent."
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.navigate",
          "page": "perps",
          "intent": "Open the requested application surface.",
          "next": "done"
        },
        {
          "action": "ui.navigate",
          "page": "perps-market",
          "market": "ETH",
          "intent": "Open the requested application surface.",
          "next": "done"
        },
        {
          "action": "ui.navigate",
          "hash": "#/perps-home",
          "intent": "Open the requested application surface.",
          "next": "done"
        }
      ]
    },
    "ui.press": {
      "description": "Press/tap/click a UI target through the platform adapter.",
      "examples": [
        {
          "action": "ui.press",
          "intent": "Activate the requested visible control.",
          "text": "Perps",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "testID": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          },
          "settle": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "ui.key_press": {
      "description": "Send a trusted keyboard press to the currently focused UI element through the UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          },
          "settle": {
            "type": "boolean"
          }
        },
        "required": [
          "key"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.key_press",
          "key": "Enter",
          "intent": "Continue the requested keyboard interaction.",
          "next": "done"
        }
      ]
    },
    "ui.set_input": {
      "description": "Set text on an extension DOM input through the CDP UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "testID": {
            "type": "string"
          },
          "value": {
            "type": [
              "string",
              "number"
            ],
            "description": "Text or a typed numeric recipe parameter; numbers are entered as their decimal text."
          },
          "text": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          },
          "settle": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.set_input",
          "selector": "[data-testid=multichain-account-list-search] input",
          "value": "Account",
          "intent": "Provide the requested value in the visible form.",
          "next": "done"
        }
      ]
    },
    "ui.scroll": {
      "description": "Scroll through the UI through the Farmslot base platform adapter. Supports deltas and scroll_into_view for selector/test-id proof positioning.",
      "examples": [
        {
          "action": "ui.scroll",
          "delta_y": 300,
          "intent": "Expose the requested content for visible review.",
          "next": "done"
        },
        {
          "action": "ui.scroll",
          "selector": "[data-testid=\"example\"]",
          "scroll_into_view": true,
          "intent": "Expose the requested content for visible review.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "testID": {
            "type": "string"
          },
          "delta_x": {
            "type": "number"
          },
          "delta_y": {
            "type": "number"
          },
          "deltaX": {
            "type": "number"
          },
          "deltaY": {
            "type": "number"
          },
          "offset": {
            "type": "number"
          },
          "scroll_into_view": {
            "type": "boolean"
          },
          "into_view": {
            "type": "boolean"
          },
          "animated": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "number"
          },
          "settle": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "ui.swipe": {
      "description": "Swipe from a test-id target or screen coordinates in one cardinal direction through the shared browser UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "target": {
            "type": [
              "string",
              "object"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "left",
              "right"
            ]
          },
          "distance": {
            "type": "number",
            "minimum": 1
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          },
          "settle": {
            "type": "boolean"
          }
        },
        "required": [
          "target",
          "direction",
          "distance",
          "duration_ms"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.swipe",
          "target": "example-scrollable",
          "direction": "up",
          "distance": 240,
          "duration_ms": 300,
          "intent": "Swipe the requested visible surface.",
          "next": "done"
        }
      ]
    },
    "ui.pan": {
      "description": "Pan through a continuous pointer path from a test-id target or screen coordinates through the shared browser UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "target": {
            "type": [
              "string",
              "object"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "path": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "additionalProperties": false
            }
          },
          "delta": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          },
          "settle": {
            "type": "boolean"
          }
        },
        "required": [
          "target",
          "duration_ms"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.pan",
          "target": "example-surface",
          "path": [
            {
              "x": 40,
              "y": 10
            },
            {
              "x": 80,
              "y": 20
            }
          ],
          "duration_ms": 400,
          "intent": "Pan through the requested pointer path.",
          "next": "done"
        }
      ]
    },
    "ui.drag": {
      "description": "Drag a test-id target or screen coordinate through the shared browser UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "target": {
            "type": [
              "string",
              "object"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "path": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "additionalProperties": false
            }
          },
          "delta": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          },
          "settle": {
            "type": "boolean"
          }
        },
        "required": [
          "target",
          "duration_ms"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.drag",
          "target": "example-slider",
          "delta": {
            "x": 120,
            "y": 0
          },
          "duration_ms": 500,
          "intent": "Drag the requested control to a new value.",
          "next": "done"
        }
      ]
    },
    "ui.long_press": {
      "description": "Hold a test-id target or screen coordinate through the shared browser UI transport.",
      "schema": {
        "type": "object",
        "properties": {
          "target": {
            "type": [
              "string",
              "object"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ],
            "additionalProperties": false
          },
          "hold_ms": {
            "type": "integer",
            "minimum": 1
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          },
          "settle": {
            "type": "boolean"
          }
        },
        "required": [
          "target",
          "hold_ms"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.long_press",
          "target": "example-control",
          "hold_ms": 700,
          "intent": "Hold the requested visible control.",
          "next": "done"
        }
      ]
    },
    "ui.wait_for": {
      "description": "Wait for a UI condition through the Extension CDP adapter.",
      "schema": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "testID": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "text_match": {
            "type": "string"
          },
          "textMatch": {
            "type": "string"
          },
          "expected": {
            "type": "string"
          },
          "visible": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.wait_for",
          "text": "Perps",
          "intent": "Confirm the requested application state is visible.",
          "next": "done"
        },
        {
          "action": "ui.wait_for",
          "selector": "[data-testid=example]",
          "visible": false,
          "timeout_ms": 2000,
          "intent": "Confirm the requested application state is visible.",
          "next": "done"
        }
      ]
    },
    "ui.locators": {
      "description": "List ranked, copy-pasteable ui.press targets from the current ui.visible observation. Prefer high-confidence test IDs when updating durable recipe source after exploratory interaction.",
      "execution_capabilities": [
        "host-read-export"
      ],
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.locators",
          "intent": "Find stable targets for durable recipe authoring.",
          "next": "done"
        }
      ]
    },
    "ui.screenshot": {
      "description": "Capture registered visual evidence through capture-helper, bounded Chrome-native capture, or an explicitly labeled computed-style DOM raster fallback. Always read the resulting PNG; artifact metadata records the provider.",
      "examples": [
        {
          "action": "ui.screenshot",
          "path": "screenshots/example.png",
          "intent": "Preserve the visible application state as review evidence.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      }
    },
    "ui.capture_surface": {
      "description": "Capture the complete current browser page as one registered PNG while leaving ui.screenshot viewport-only.",
      "schema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "ui.capture_surface",
          "path": "screenshots/full-page.png",
          "intent": "Preserve the complete page context for human review.",
          "next": "done"
        }
      ]
    },
    "app.network_capture": {
      "description": "Capture redacted HTTP requests between named Recipe Protocol v1 nodes through the adapter's persistent Network observer.",
      "examples": [
        {
          "action": "app.network_capture",
          "phase": "start",
          "id": "perps-home",
          "url_includes": ["api.hyperliquid.xyz/info"],
          "methods": ["POST"],
          "body_json_fields": ["type", "req.coin", "dex"],
          "intent": "Start the redacted request window",
          "next": "exercise-flow"
        },
        {
          "action": "app.network_capture",
          "phase": "end",
          "id": "perps-home",
          "artifact_path": "network/perps-home.json",
          "intent": "End and index the redacted request window",
          "next": "assert-network"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "phase": { "type": "string", "enum": ["start", "end"] },
          "id": { "type": "string" },
          "url_includes": {
            "type": "array",
            "items": { "type": "string" }
          },
          "methods": {
            "type": "array",
            "items": { "type": "string" }
          },
          "body_json_fields": {
            "type": "array",
            "items": { "type": "string" }
          },
          "max_requests": { "type": "integer" },
          "max_duration_ms": { "type": "integer" },
          "artifact_path": { "type": "string" }
        },
        "required": ["phase", "id"],
        "additionalProperties": false
      },
      "execution_capabilities": []
    },
    "app.network_assert": {
      "description": "Assert a previously indexed app.network_capture summary without hiding its diagnostics on failure.",
      "examples": [
        {
          "action": "app.network_assert",
          "id": "perps-home",
          "artifact_path": "network/perps-home.json",
          "required_status": "complete",
          "required_min_requests": 1,
          "required_types": ["allMids"],
          "forbidden_types": ["candleSnapshot"],
          "intent": "Assert the indexed request summary",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "artifact_path": { "type": "string" },
          "required_status": {
            "type": "string",
            "enum": ["complete", "partial", "unavailable"]
          },
          "required_min_requests": { "type": "integer" },
          "required_max_requests": { "type": "integer" },
          "required_types": {
            "type": "array",
            "items": { "type": "string" }
          },
          "forbidden_types": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id"],
        "additionalProperties": false
      },
      "execution_capabilities": []
    },
    "app.performance_capture": {
      "description": "Capture bounded CDP renderer frame metrics and separately labelled JavaScript work across Recipe Protocol v1 node boundaries.",
      "examples": [
        {
          "action": "app.performance_capture",
          "phase": "start",
          "id": "homepage-scroll",
          "max_duration_ms": 300000,
          "intent": "Start the bounded UI smoothness window",
          "next": "exercise-flow"
        },
        {
          "action": "app.performance_capture",
          "phase": "end",
          "id": "homepage-scroll",
          "artifact_path": "performance/homepage-scroll.json",
          "html_path": "performance/homepage-scroll.html",
          "intent": "End and index the UI smoothness window",
          "next": "assert-performance"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "phase": {
            "type": "string",
            "enum": ["start", "end"]
          },
          "id": { "type": "string" },
          "max_duration_ms": {
            "type": "integer",
            "minimum": 1,
            "description": "Maximum accepted at runtime: 3600000 ms."
          },
          "artifact_path": { "type": "string" },
          "html_path": { "type": "string" }
        },
        "required": ["phase", "id"],
        "additionalProperties": false
      },
      "execution_capabilities": ["host-read-export"]
    },
    "app.performance_assert": {
      "description": "Assert a previously indexed app.performance_capture summary without hiding unavailable or partial source coverage.",
      "examples": [
        {
          "action": "app.performance_assert",
          "id": "homepage-scroll",
          "artifact_path": "performance/homepage-scroll.json",
          "required_status": ["complete", "partial"],
          "minimum_frame_count": 1,
          "require_native_ui_when_supported": true,
          "required_node_ids": ["scroll-homepage"],
          "intent": "Assert the indexed UI smoothness summary",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "artifact_path": { "type": "string" },
          "required_status": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["complete", "partial", "unavailable"]
            }
          },
          "minimum_frame_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Minimum MetaMask renderer frame count. JavaScript task count cannot satisfy this assertion."
          },
          "require_native_ui_when_supported": { "type": "boolean" },
          "required_node_ids": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id"],
        "additionalProperties": false
      },
      "execution_capabilities": ["host-read-export"]
    },
    "app.status": {
      "description": "Report the adapter's static status — platform, project root, resolved checkout shape, and headless compatibility mode (no live route or account).",
      "examples": [
        {
          "action": "app.status",
          "intent": "Record the resolved application state before continuing.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    "app.hud": {
      "description": "Display minimal human-readable recipe progress. The intent must explain the current agent goal; debug metadata and grouping labels are hidden unless explicitly opted in.",
      "examples": [
        {
          "action": "app.hud",
          "status": "running",
          "intent": "Show the current goal to the supervising human.",
          "progress": {
            "current": 12,
            "total": 19
          },
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "clear": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "pass",
              "fail"
            ]
          },
          "node_id": {
            "type": "string"
          },
          "nodeId": {
            "type": "string"
          },
          "phase": {
            "type": "string"
          },
          "action_name": {
            "type": "string"
          },
          "recipe_action": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "display": {
            "type": "object"
          },
          "progress": {
            "type": "object"
          }
        },
        "additionalProperties": false
      }
    },
    "cdp.target": {
      "description": "Probe the platform debug transport — Chrome CDP for extension, the React Native debug bridge for mobile — and report whether it is reachable.",
      "examples": [
        {
          "action": "cdp.target",
          "cdp_port": 9323,
          "required": true,
          "intent": "Confirm the requested application target is available.",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "cdp_port": {
            "type": "number"
          },
          "metro_port": {
            "type": "number"
          },
          "watcher_port": {
            "type": "number"
          },
          "probe_timeout_ms": {
            "type": "number"
          },
          "cdp_timeout_ms": {
            "type": "number"
          },
          "timeout_ms": {
            "type": "number"
          },
          "require_reachable": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "metamask.wallet.fixture_status": {
      "description": "Report the on-disk wallet fixture status (accounts and password presence) without launching or mutating the app.",
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.fixture_status",
          "intent": "Check wallet fixture status",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.wallet.validate_import": {
      "description": "Validate wallet recovery credentials and derive the expected primary address without launching or mutating the app.",
      "schema": {
        "type": "object",
        "properties": {
          "credential_source": {
            "type": "string",
            "enum": [
              "auto",
              "environment",
              "fixture"
            ]
          },
          "srp_env": {
            "type": "string"
          },
          "password_env": {
            "type": "string"
          },
          "metametrics": {
            "type": "boolean"
          },
          "interests": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.validate_import",
          "credential_source": "auto",
          "intent": "Validate recovery credentials before resetting a wallet",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.wallet.setup": {
      "description": "Import the wallet fixture accounts and password so the app starts from a known signed-in state.",
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.setup",
          "intent": "Prepare the wallet fixture for recipe execution",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.import": {
      "description": "Make the wallet ready through visible onboarding or prove and select the derived account in an existing visible session when method=ui.",
      "schema": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "auto",
              "profile",
              "ui"
            ]
          },
          "credential_source": {
            "type": "string",
            "enum": [
              "auto",
              "environment",
              "fixture"
            ]
          },
          "srp_env": {
            "type": "string"
          },
          "password_env": {
            "type": "string"
          },
          "metametrics": {
            "type": "boolean",
            "default": false,
            "description": "Enable MetaMetrics during visible onboarding."
          },
          "biometrics": {
            "type": "boolean",
            "default": false,
            "description": "Mobile-only biometric onboarding preference; ignored on Extension."
          },
          "notifications": {
            "type": "boolean",
            "default": false,
            "description": "Mobile-only push notification onboarding preference; ignored on Extension."
          },
          "skip_wallet_tour": {
            "type": "boolean",
            "default": true,
            "description": "Mobile-only wallet-home tour preference; ignored on Extension."
          },
          "interests": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "swap_tokens",
                "trade_perpetuals",
                "prediction_markets",
                "send_receive_crypto",
                "earn_and_spend",
                "use_other_crypto_apps"
              ]
            },
            "default": [],
            "description": "Mobile-only onboarding interests; ignored when empty on Extension."
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.import",
          "method": "auto",
          "intent": "Use an existing fixture profile or import through onboarding",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.reset": {
      "description": "Delete the current wallet through the visible client reset flow and reach fresh onboarding.",
      "schema": {
        "type": "object",
        "properties": {
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.reset",
          "intent": "Reset the wallet through visible UI before importing it again",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.ensure_unlocked": {
      "description": "Unlock the wallet with the fixture password when it is currently locked.",
      "schema": {
        "type": "object",
        "properties": {
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.ensure_unlocked",
          "intent": "Ensure the wallet is unlocked before proof steps",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.select_account": {
      "description": "extension action to select a wallet account by address, id, or display name.",
      "schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "EVM address of the account to select."
          },
          "id": {
            "type": "string",
            "description": "Internal account id to select."
          },
          "name": {
            "type": "string",
            "description": "Display name of the account to select."
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.select_account",
          "address": "0x8dc623e964475d4d669da601fd15ea9125469003",
          "intent": "Select the requested wallet account",
          "next": "done"
        },
        {
          "action": "metamask.wallet.select_account",
          "name": "dev1",
          "intent": "Select the requested wallet account",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.list_accounts": {
      "description": "List redacted wallet accounts and identify the selected account without mutating the app.",
      "schema": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "default": "named",
            "enum": [
              "selected",
              "named",
              "evm",
              "all"
            ],
            "description": "Account scope. Defaults to named human-visible accounts; use selected for the active account, evm for EVM accounts, or all for the full inventory."
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.list_accounts",
          "intent": "Discover the available wallet accounts",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.wallet.read_state": {
      "description": "Read the redacted wallet state (selected account, route, and device) from the running app.",
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.read_state",
          "intent": "Read wallet state needed for the proof",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.performance.measure_navigation_memory": {
      "description": "Measure retained DOM nodes and listeners across repeated Extension navigation after forced garbage collection, using least-squares slopes and separate declared bounds.",
      "schema": {
        "type": "object",
        "properties": {
          "screen_hash": {
            "type": "string"
          },
          "screen_test_id": {
            "type": "string"
          },
          "return_hash": {
            "type": "string",
            "default": "#/"
          },
          "cycles": {
            "type": "integer",
            "minimum": 2,
            "default": 8
          },
          "max_nodes_per_cycle": {
            "type": "number",
            "default": 2
          },
          "max_listeners_per_cycle": {
            "type": "number",
            "default": 4
          },
          "settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 1500
          },
          "gc_settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 300
          },
          "screen_timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 15000
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 400000
          }
        },
        "required": [
          "screen_hash",
          "screen_test_id"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.performance.measure_navigation_memory",
          "screen_hash": "#/settings",
          "screen_test_id": "settings-tab-bar-grouped",
          "return_hash": "#/",
          "cycles": 8,
          "max_nodes_per_cycle": 2,
          "max_listeners_per_cycle": 4,
          "intent": "Measure post-GC retained-memory slopes across repeated navigation.",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.performance.measure_detached_dom": {
      "description": "Compare retained detached-DOM counts before and after repeated Extension navigation, with forced garbage collection before each heap snapshot.",
      "schema": {
        "type": "object",
        "properties": {
          "screen_hash": {
            "type": "string"
          },
          "screen_test_id": {
            "type": "string"
          },
          "return_hash": {
            "type": "string",
            "default": "#/"
          },
          "cycles": {
            "type": "integer",
            "minimum": 2,
            "default": 5
          },
          "max_detached_growth": {
            "type": "number",
            "default": 50
          },
          "settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 1500
          },
          "gc_settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 300
          },
          "screen_timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 15000
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 400000
          }
        },
        "required": [
          "screen_hash",
          "screen_test_id"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.performance.measure_detached_dom",
          "screen_hash": "#/settings",
          "screen_test_id": "settings-tab-bar-grouped",
          "return_hash": "#/",
          "cycles": 5,
          "max_detached_growth": 50,
          "intent": "Measure detached DOM retained after navigation and forced garbage collection.",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.performance.compare_idle_navigation_memory": {
      "description": "Compare equal-duration idle and navigating Extension arms to isolate navigation-attributable listener growth after forced garbage collection.",
      "schema": {
        "type": "object",
        "properties": {
          "screen_hash": {
            "type": "string"
          },
          "screen_test_id": {
            "type": "string"
          },
          "return_hash": {
            "type": "string",
            "default": "#/"
          },
          "rounds": {
            "type": "integer",
            "minimum": 2,
            "default": 8
          },
          "round_duration_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 10000
          },
          "max_attributable_listeners_per_cycle": {
            "type": "number",
            "default": 2
          },
          "settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 1500
          },
          "gc_settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 300
          },
          "screen_timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 15000
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 400000
          }
        },
        "required": [
          "screen_hash",
          "screen_test_id"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.performance.compare_idle_navigation_memory",
          "screen_hash": "#/settings",
          "screen_test_id": "settings-tab-bar-grouped",
          "return_hash": "#/",
          "rounds": 8,
          "round_duration_ms": 10000,
          "max_attributable_listeners_per_cycle": 2,
          "intent": "Separate navigation-attributable listener growth from equal-duration idle growth.",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.assets.read_visible_state": {
      "description": "Read and assert bounded visible wallet assets from an untouched Extension runtime without product background hooks.",
      "schema": {
        "type": "object",
        "properties": {
          "minimum_asset_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "minimum_price_change_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "minimum_without_price_change_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "require_symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "require_fiat": {
            "type": "boolean",
            "default": false
          },
          "require_price_change_styling": {
            "type": "boolean",
            "default": false
          },
          "max_items": {
            "type": "integer",
            "minimum": 1,
            "default": 100
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.read_visible_state",
          "minimum_asset_count": 2,
          "require_symbols": [
            "USDC",
            "BNB"
          ],
          "require_fiat": true,
          "require_price_change_styling": true,
          "minimum_price_change_count": 1,
          "minimum_without_price_change_count": 1,
          "intent": "Assert live wallet assets through visible UI",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.assets.open_details": {
      "description": "Open one visible Extension asset by symbol.",
      "schema": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "symbol"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.open_details",
          "symbol": "ETH",
          "intent": "Open the funded ETH details",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.read_details": {
      "description": "Read and assert the current Extension asset details page through visible UI.",
      "schema": {
        "type": "object",
        "properties": {
          "expected_symbol": {
            "type": "string"
          },
          "require_chart": {
            "type": "boolean",
            "default": false
          },
          "require_market_cap": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.read_details",
          "expected_symbol": "ETH",
          "require_chart": true,
          "require_market_cap": true,
          "intent": "Prove the current asset details render live market data",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.assets.verify_sorting": {
      "description": "Select both visible Extension asset sort modes, assert their row order, and restore declining balance.",
      "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.verify_sorting",
          "intent": "Verify A-Z and fiat high-low asset sorting",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.set_token_visibility": {
      "description": "Enable or disable one searched Extension token through Manage tokens and verify the home list state.",
      "schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "visible": {
            "type": "boolean"
          },
          "require_unchanged": {
            "type": "boolean",
            "default": false
          },
          "require_change": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 45000
          }
        },
        "required": [
          "query",
          "visible"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.set_token_visibility",
          "query": "DAI",
          "visible": true,
          "intent": "Import DAI through live token search",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.wallet.lock": {
      "description": "Lock the Extension wallet through the visible global menu and prove the unlock page appears.",
      "schema": {
        "type": "object",
        "properties": {
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 15000
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.wallet.lock",
          "intent": "Lock the wallet through visible UI",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.import_custom_token": {
      "description": "Import one ERC-20 on a selected Extension network through the custom-token form and verify its row.",
      "schema": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "address": {
            "type": "string"
          },
          "expected_symbol": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "required": [
          "network",
          "chain_id",
          "address",
          "expected_symbol"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.import_custom_token",
          "network": "Polygon",
          "chain_id": 137,
          "address": "0xc2132D05D31c914a87C6611C10748AaCbC5327aE",
          "expected_symbol": "USDT",
          "decimals": 6,
          "intent": "Import Polygon USDT by contract address",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.prepare_send": {
      "description": "Prepare a wallet-initiated EVM asset send through visible UI without advancing to confirmation.",
      "schema": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "max": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "symbol",
          "recipient"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.prepare_send",
          "symbol": "USDC",
          "recipient": "0x5993d2153f080470bfe765ae81f4fa5fa2080916",
          "amount": "0.01",
          "intent": "Prepare a tiny own-account USDC send",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.review_send": {
      "description": "Advance a prepared Extension send to confirmation and prove its visible network fee.",
      "schema": {
        "type": "object",
        "properties": {
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.review_send",
          "intent": "Review the prepared send and its fee",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.set_custom_gas": {
      "description": "Set a custom EVM gas limit on the current Extension send confirmation through visible controls.",
      "schema": {
        "type": "object",
        "properties": {
          "gas_limit": {
            "type": [
              "string",
              "number"
            ]
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "gas_limit"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.set_custom_gas",
          "gas_limit": 70000,
          "intent": "Apply a custom gas limit to the reviewed send",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.assets.select_network_scope": {
      "description": "Select the all-networks Extension asset scope through the visible network filter.",
      "schema": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "all"
            ],
            "default": "all"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.assets.select_network_scope",
          "scope": "all",
          "intent": "Show assets across all enabled networks",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.networks.read_visible_state": {
      "description": "Read one selected Extension network and prove its visible balance rows remain stable across a bounded settle window.",
      "schema": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "settle_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "minimum_asset_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "minimum_price_change_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "minimum_without_price_change_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "require_symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "require_fiat": {
            "type": "boolean",
            "default": false
          },
          "require_price_change_styling": {
            "type": "boolean",
            "default": false
          },
          "max_items": {
            "type": "integer",
            "minimum": 1,
            "default": 100
          }
        },
        "required": [
          "network"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.networks.read_visible_state",
          "network": "HyperEVM",
          "chain_id": 999,
          "require_symbols": [
            "HYPE"
          ],
          "settle_ms": 30000,
          "intent": "Assert the selected custom-network balance remains visible",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.networks.add_custom": {
      "description": "Add or select one custom Extension network through visible network management controls.",
      "schema": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "rpc_url": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "symbol": {
            "type": "string"
          },
          "explorer_url": {
            "type": "string"
          },
          "require_absent": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "required": [
          "network",
          "rpc_url",
          "chain_id",
          "symbol"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.networks.add_custom",
          "network": "PulseChain",
          "rpc_url": "https://rpc.pulsechain.com",
          "chain_id": 369,
          "symbol": "PLS",
          "explorer_url": "https://scan.pulsechain.com",
          "require_absent": true,
          "intent": "Add and select PulseChain",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.networks.add_chainlist": {
      "description": "Add or select one Extension network from the visible ChainList search results.",
      "schema": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "symbol": {
            "type": "string"
          },
          "require_absent": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "required": [
          "network",
          "chain_id",
          "symbol"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.networks.add_chainlist",
          "network": "XDC Network",
          "query": "XDC",
          "chain_id": 50,
          "symbol": "XDC",
          "require_absent": true,
          "intent": "Add and select XDC Network from the exact ChainList result",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.networks.remove_custom": {
      "description": "Remove one custom Extension network through visible network management controls.",
      "schema": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 1
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "network",
          "chain_id"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.networks.remove_custom",
          "network": "PulseChain",
          "chain_id": 369,
          "intent": "Remove PulseChain after validation",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.swap_bridge.read_visible_state": {
      "description": "Read and assert the visible Swap surface from an untouched Extension runtime without product background hooks.",
      "schema": {
        "type": "object",
        "properties": {
          "source_symbol": {
            "type": "string"
          },
          "destination_symbol": {
            "type": "string"
          },
          "require_amount_inputs": {
            "type": "boolean",
            "default": true
          },
          "require_settings": {
            "type": "boolean",
            "default": false
          },
          "require_quote": {
            "type": "boolean",
            "default": false
          },
          "expected_slippage": {
            "type": "number",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.swap_bridge.read_visible_state",
          "require_amount_inputs": true,
          "require_settings": true,
          "intent": "Assert the visible Swap surface",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.swap_bridge.select_assets": {
      "description": "Select exact Swap source and destination assets through the visible asset pickers.",
      "schema": {
        "type": "object",
        "properties": {
          "source_symbol": {
            "type": "string"
          },
          "destination_symbol": {
            "type": "string"
          },
          "source_chain": {
            "type": "string"
          },
          "destination_chain": {
            "type": "string"
          },
          "source_query": {
            "type": "string"
          },
          "destination_query": {
            "type": "string"
          },
          "source_asset_id": {
            "type": "string"
          },
          "destination_asset_id": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "required": [
          "source_symbol",
          "destination_symbol",
          "source_chain",
          "destination_chain"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.swap_bridge.select_assets",
          "source_symbol": "ETH",
          "destination_symbol": "WETH",
          "source_chain": "eip155:1",
          "destination_chain": "eip155:1",
          "intent": "Select the funded Swap pair",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.swap_bridge.set_amount": {
      "description": "Enter a positive Swap amount through visible UI and wait for a quote or explicit no-route state.",
      "schema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 1E-8
          },
          "wait_for_quote": {
            "type": "boolean",
            "default": true
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "required": [
          "amount"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.swap_bridge.set_amount",
          "amount": 0.0001,
          "intent": "Enter a capped Swap amount and wait for the quote",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.swap_bridge.set_slippage": {
      "description": "Set a custom Swap slippage percentage through the visible transaction settings.",
      "schema": {
        "type": "object",
        "properties": {
          "percent": {
            "type": "number",
            "minimum": 0.01
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "percent"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.swap_bridge.set_slippage",
          "percent": 3,
          "intent": "Set the release checklist custom slippage value",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.swap_bridge.set_max_amount": {
      "description": "Use the visible Swap Max control and wait for the derived live quote.",
      "schema": {
        "type": "object",
        "properties": {
          "wait_for_quote": {
            "type": "boolean",
            "default": true
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 60000
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.swap_bridge.set_max_amount",
          "wait_for_quote": true,
          "intent": "Use the available token balance for the return Swap",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.read_visible_state": {
      "description": "Read and assert bounded visible Perps UI state from an untouched Extension runtime without product background hooks.",
      "schema": {
        "type": "object",
        "properties": {
          "surface": {
            "type": "string",
            "enum": [
              "auto",
              "home",
              "market-list",
              "market-details",
              "order-entry",
              "activity",
              "funds"
            ],
            "default": "auto"
          },
          "market": {
            "type": "string",
            "description": "Optional market that must be present in the visible state."
          },
          "direction": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit"
            ]
          },
          "amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "percent": {
            "type": [
              "string",
              "number"
            ]
          },
          "leverage": {
            "type": [
              "string",
              "number"
            ]
          },
          "auto_close": {
            "type": "boolean"
          },
          "submit_enabled": {
            "type": "boolean"
          },
          "require_validation_text": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20
          },
          "minimum_market_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "maximum_market_count": {
            "type": "integer",
            "minimum": 0,
            "default": 200
          },
          "minimum_position_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "maximum_position_count": {
            "type": "integer",
            "minimum": 0,
            "default": 200
          },
          "minimum_order_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "maximum_order_count": {
            "type": "integer",
            "minimum": 0,
            "default": 200
          },
          "minimum_activity_count": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "require_no_horizontal_overflow": {
            "type": "boolean",
            "default": false
          },
          "require_no_control_overlap": {
            "type": "boolean",
            "default": false
          },
          "forbid_test_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          "require_test_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          "require_features": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "activity",
                "balance",
                "chart",
                "long-short",
                "market-list",
                "order-entry",
                "price",
                "price-change",
                "stats"
              ]
            },
            "maxItems": 9
          },
          "include_offscreen": {
            "type": "boolean",
            "default": true
          },
          "max_items": {
            "type": "integer",
            "minimum": 1,
            "default": 100
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_visible_state",
          "surface": "home",
          "minimum_market_count": 1,
          "require_features": [
            "balance",
            "market-list"
          ],
          "require_test_ids": [
            "perps-balance-dropdown-balance"
          ],
          "intent": "Assert the live Perps home surface through visible UI",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.search_markets": {
      "description": "Enter a Perps market query through the visible search field and prove visible results are returned.",
      "schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.search_markets",
          "query": "Bitcoin",
          "intent": "Filter the visible Perps market list",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.select_market_filter": {
      "description": "Select and assert a live Perps market category through trusted visible UI controls.",
      "schema": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "string",
            "enum": [
              "all",
              "crypto",
              "stocks",
              "pre-ipo",
              "index",
              "etf",
              "commodities",
              "forex",
              "new"
            ]
          },
          "minimum_market_count": {
            "type": "integer",
            "minimum": 0,
            "default": 1
          },
          "maximum_market_count": {
            "type": "integer",
            "minimum": 0,
            "default": 200
          },
          "max_items": {
            "type": "integer",
            "minimum": 1,
            "default": 100
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 10000
          }
        },
        "required": [
          "filter"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.select_market_filter",
          "filter": "crypto",
          "minimum_market_count": 1,
          "intent": "Prove the Crypto market category through visible UI",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.close_visible_position": {
      "description": "Close all or part of one live Perps position through semantic visible controls.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "confirm_live": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "funding_side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "funding_amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "provider": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "funding_position_size": {
            "type": "string",
            "description": "Exact visible position size required for a close-only cleanup."
          },
          "leverage": {
            "type": "integer",
            "minimum": 1
          },
          "cleanup_only": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Use a fresh exact close-only authorization and current visible balance baseline."
          },
          "identity_rounding_tolerance_base_units": {
            "type": "string",
            "default": "10000",
            "description": "Maximum visible USD rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
          },
          "balance_reconciliation_tolerance_base_units": {
            "type": "string",
            "description": "Maximum final-versus-preorder balance delta in six-decimal USDC base units; default/cap 1000000."
          },
          "amount": {
            "type": [
              "string",
              "number"
            ],
            "description": "Optional USD amount for a partial close; omit to close the full position."
          }
        },
        "required": [
          "market",
          "confirm_live",
          "funding_side",
          "funding_amount",
          "provider",
          "network",
          "leverage"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.close_visible_position",
          "market": "BTC",
          "confirm_live": true,
          "funding_side": "long",
          "funding_amount": "10",
          "provider": "hyperliquid",
          "network": "mainnet",
          "leverage": 3,
          "identity_rounding_tolerance_base_units": "10000",
          "intent": "Close the visible BTC position after the live release check",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation",
        "external-mutation"
      ]
    },
    "metamask.perps.compare_provider_market": {
      "description": "Compare one visible Perps market with the live Hyperliquid production response.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "endpoint": {
            "type": "string",
            "enum": [
              "https://api.hyperliquid.xyz/info"
            ]
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "market"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.compare_provider_market",
          "market": "BTC",
          "intent": "Compare the visible BTC market with the live production provider",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.read_eligibility": {
      "description": "Read the current Extension Perps eligibility and live MetaMask geolocation without changing either.",
      "schema": {
        "type": "object",
        "properties": {
          "timeout_ms": {
            "type": "integer",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_eligibility",
          "intent": "Record the current release eligibility boundary",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.set_market_favorite": {
      "description": "Converge one live Perps market favorite to the requested state through its semantic visible control.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "favorite": {
            "type": "boolean"
          },
          "require_unchanged": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "market",
          "favorite"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.set_market_favorite",
          "market": "BTC",
          "favorite": true,
          "intent": "Ensure BTC appears in the Perps watchlist",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.select_activity_filter": {
      "description": "Select and read one live Perps activity category through semantic visible controls.",
      "schema": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "string",
            "enum": [
              "trades",
              "orders",
              "funding",
              "deposits"
            ]
          }
        },
        "required": [
          "filter"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.select_activity_filter",
          "filter": "trades",
          "intent": "Show only Perps trade activity",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.open_balance_action": {
      "description": "Open Add funds or Withdraw from the live Perps balance dropdown in one trusted UI session.",
      "schema": {
        "type": "object",
        "properties": {
          "balance_action": {
            "type": "string",
            "enum": [
              "add-funds",
              "withdraw"
            ]
          }
        },
        "required": [
          "balance_action"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.open_balance_action",
          "balance_action": "withdraw",
          "intent": "Open the Perps withdraw flow",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.open_position_action": {
      "description": "Open a position-management flow from a live Perps position through visible controls in one trusted UI session.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "position_action": {
            "type": "string",
            "enum": [
              "add-exposure",
              "reduce-exposure",
              "reverse",
              "add-margin",
              "remove-margin",
              "auto-close"
            ]
          }
        },
        "required": [
          "market",
          "position_action"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.open_position_action",
          "market": "BTC",
          "position_action": "add-margin",
          "intent": "Open Add margin for the BTC position",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.edit_margin": {
      "description": "Add or remove isolated margin from a live Perps position through visible controls and prove the reconciled position values.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "margin_action": {
            "type": "string",
            "enum": [
              "add",
              "remove"
            ],
            "default": "add"
          },
          "amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "funding_side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "funding_amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "funding_position_size": {
            "type": "string",
            "description": "Exact stable visible position size identity."
          },
          "provider": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "leverage": {
            "type": "integer",
            "minimum": 1
          },
          "balance_reconciliation_tolerance_base_units": {
            "type": "string",
            "default": "1000000"
          },
          "confirm_live": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "required": [
          "market",
          "amount",
          "funding_side",
          "funding_amount",
          "funding_position_size",
          "provider",
          "network",
          "leverage",
          "confirm_live"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.edit_margin",
          "market": "BTC",
          "margin_action": "add",
          "amount": 1,
          "funding_side": "long",
          "funding_amount": 10,
          "funding_position_size": "0.00016 BTC",
          "provider": "hyperliquid",
          "network": "mainnet",
          "leverage": 1,
          "confirm_live": true,
          "intent": "Add one USDC of margin to the BTC position",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation",
        "external-mutation"
      ]
    },
    "metamask.perps.update_position_tpsl": {
      "description": "Update take-profit and stop-loss for a live Extension Perps position through visible controls and prove the reconciled position row.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "take_profit_price": {
            "type": [
              "string",
              "number"
            ]
          },
          "stop_loss_price": {
            "type": [
              "string",
              "number"
            ]
          },
          "funding_side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "funding_amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "funding_position_size": {
            "type": "string",
            "description": "Exact stable visible position size identity."
          },
          "provider": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "leverage": {
            "type": "integer",
            "minimum": 1
          },
          "confirm_live": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "required": [
          "market",
          "take_profit_price",
          "stop_loss_price",
          "funding_side",
          "funding_amount",
          "funding_position_size",
          "provider",
          "network",
          "leverage",
          "confirm_live"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.update_position_tpsl",
          "market": "BTC",
          "take_profit_price": 65000,
          "stop_loss_price": 55000,
          "funding_side": "long",
          "funding_amount": 10,
          "funding_position_size": "0.00016 BTC",
          "provider": "hyperliquid",
          "network": "mainnet",
          "leverage": 1,
          "confirm_live": true,
          "intent": "Update BTC position auto-close prices",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation",
        "external-mutation"
      ]
    },
    "metamask.settings.set_basic_functionality": {
      "description": "Converge the Extension Basic Functionality privacy setting through its visible toggle and confirmation modal.",
      "schema": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.settings.set_basic_functionality",
          "enabled": false,
          "intent": "Turn Basic Functionality off through Privacy settings",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.perps.read_funds_confirmation": {
      "description": "Read the loaded Perps deposit or withdraw confirmation without submitting it.",
      "schema": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "deposit",
              "withdraw"
            ]
          },
          "require_no_horizontal_overflow": {
            "type": "boolean",
            "default": false
          },
          "require_preview_fields": {
            "type": "boolean",
            "default": false
          },
          "expected_submit_enabled": {
            "type": "boolean"
          },
          "expected_submit_label": {
            "type": "string"
          },
          "expected_amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "expected_amount_symbol": {
            "type": "string"
          },
          "expected_pay_token_amount_visible": {
            "type": "boolean"
          },
          "expected_pay_token": {
            "type": "string"
          },
          "expected_receive_token": {
            "type": "string"
          },
          "expected_visible_network": {
            "type": "string"
          },
          "expected_percentage_controls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10
          },
          "require_visible_text": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20
          }
        },
        "required": [
          "mode"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_funds_confirmation",
          "mode": "withdraw",
          "intent": "Read the Perps withdraw fee and receive context",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.assert_visible_consistency": {
      "description": "Assert bounded rendered Perps market or price changes, or recent-to-full activity containment, through visible Extension UI.",
      "schema": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "market-stream",
              "watchlist-stream",
              "activity-containment",
              "price-stream"
            ]
          },
          "surface": {
            "type": "string",
            "enum": [
              "home",
              "market-list",
              "market-details",
              "order-entry"
            ]
          },
          "market": {
            "type": "string"
          },
          "sample_count": {
            "type": "integer",
            "minimum": 2,
            "default": 3
          },
          "sample_interval_ms": {
            "type": "integer",
            "minimum": 100,
            "default": 1000
          },
          "minimum_changed_count": {
            "type": "integer",
            "minimum": 0,
            "default": 1
          },
          "minimum_recent_activity_count": {
            "type": "integer",
            "minimum": 0,
            "default": 1
          },
          "require_unique_ids": {
            "type": "boolean",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 30000
          },
          "max_items": {
            "type": "integer",
            "minimum": 1,
            "default": 100
          }
        },
        "required": [
          "mode"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.assert_visible_consistency",
          "mode": "market-stream",
          "sample_count": 3,
          "minimum_changed_count": 1,
          "intent": "Prove rendered Perps market rows change over a bounded sample",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export",
        "app-mutation"
      ]
    },
    "metamask.perps.read_snapshot": {
      "description": "Read a bounded, redacted source-dev snapshot of Extension Perps state through the optional product background hook.",
      "schema": {
        "type": "object",
        "properties": {
          "include": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "account",
                "markets",
                "positions",
                "orders",
                "history",
                "watchlist"
              ]
            },
            "minItems": 1,
            "default": [
              "account",
              "markets",
              "positions",
              "orders",
              "history",
              "watchlist"
            ],
            "description": "Sections to request. Every requested section must be available or the action fails."
          },
          "market": {
            "type": "string",
            "description": "Optional single market filter."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "description": "Optional market filters applied to market-scoped sections."
          },
          "history": {
            "type": "object",
            "properties": {
              "start_time_ms": {
                "type": "integer",
                "minimum": 0,
                "description": "Inclusive history start time in Unix milliseconds. Defaults to 30 days before end_time_ms."
              },
              "end_time_ms": {
                "type": "integer",
                "minimum": 0,
                "description": "Inclusive history end time in Unix milliseconds. Defaults to the current time."
              },
              "account_id": {
                "type": "string",
                "description": "Optional CAIP account ID passed to the product history API; the value is not returned."
              },
              "limit": {
                "type": "integer",
                "minimum": 1,
                "default": 100,
                "description": "Maximum history items returned after product filtering."
              }
            },
            "additionalProperties": false
          },
          "sampling": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 1,
                "default": 1
              },
              "interval_ms": {
                "type": "integer",
                "minimum": 100,
                "default": 1000
              }
            },
            "additionalProperties": false
          },
          "expect": {
            "type": "object",
            "properties": {
              "minimum_changed_market_count": {
                "type": "integer",
                "minimum": 0,
                "default": 0
              },
              "minimum_history_count": {
                "type": "integer",
                "minimum": 0,
                "default": 0
              },
              "require_activity_history_agreement": {
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false
          },
          "max_items_per_section": {
            "type": "integer",
            "minimum": 1,
            "default": 100,
            "description": "Maximum normalized items returned for each requested list section."
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1000,
            "default": 20000,
            "description": "Per-request background API timeout."
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_snapshot",
          "include": [
            "account",
            "markets",
            "positions",
            "orders"
          ],
          "markets": [
            "BTC",
            "ETH"
          ],
          "intent": "Read the bounded Perps state needed for release validation",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.read_positions": {
      "description": "extension Read live Perps positions; without a selector, return all live positions.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Optional position/order side filter."
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_positions",
          "market": "BTC",
          "intent": "Read Perps positions needed for the proof",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.perps.read_orders": {
      "description": "extension Read live Perps open orders; without a selector, return all live orders.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Optional position/order side filter."
          },
          "timeout_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.read_orders",
          "market": "BTC",
          "intent": "Read Perps open orders needed for the proof",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.perps.close_orders": {
      "description": "extension Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Cancel selected live Perps open orders. Use selector/mode params to cancel matching symbols or all orders.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Optional position/order side filter."
          },
          "timeout_ms": {
            "type": "number"
          },
          "confirm_live": {
            "type": "boolean",
            "description": "Required when cancellation uses visible controls against the live provider."
          },
          "amount": {
            "type": [
              "string",
              "number"
            ]
          },
          "leverage": {
            "type": "integer",
            "minimum": 1
          },
          "provider": {
            "type": "string",
            "description": "Exact Perps provider required before background cancellation dispatch."
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ],
            "description": "Exact Perps network required before background cancellation dispatch; the action never toggles it."
          },
          "limit_price": {
            "type": [
              "string",
              "number"
            ]
          },
          "order_id": {
            "type": "string",
            "description": "Exact product order ID required for receipt-bound background cancellation."
          },
          "offset_pct": {
            "type": "number"
          },
          "identity_rounding_tolerance_base_units": {
            "type": "string",
            "default": "10000",
            "description": "Maximum visible notional/price rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
          }
        },
        "required": [
          "market",
          "side",
          "amount",
          "leverage",
          "provider",
          "network",
          "limit_price",
          "confirm_live"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.close_orders",
          "market": "BTC",
          "side": "long",
          "amount": "10",
          "leverage": 3,
          "provider": "hyperliquid",
          "network": "testnet",
          "limit_price": "100000",
          "identity_rounding_tolerance_base_units": "10000",
          "confirm_live": true,
          "intent": "Cancel the exact trusted BTC limit order",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation",
        "external-mutation"
      ]
    },
    "metamask.perps.place_order": {
      "description": "extension Place a Perps order through a supported app/API path. Default to testnet; mainnet order placement requires an explicit user request.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Required order direction."
          },
          "timeout_ms": {
            "type": "number"
          },
          "amount": {
            "type": [
              "string",
              "number"
            ],
            "description": "USD amount/notional alias."
          },
          "notional": {
            "type": [
              "string",
              "number"
            ],
            "description": "USD notional alias."
          },
          "size": {
            "type": "string",
            "description": "Base asset size when supported."
          },
          "leverage": {
            "type": "number",
            "default": 1
          },
          "provider": {
            "type": "string",
            "description": "Exact Perps provider required before background dispatch."
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ],
            "description": "Exact Perps network required before background dispatch; the action never toggles it."
          },
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit"
            ],
            "default": "market"
          },
          "position_mode": {
            "type": "string",
            "enum": [
              "new",
              "modify"
            ],
            "default": "new"
          },
          "submit_attempts": {
            "type": "integer",
            "enum": [
              1,
              2
            ],
            "default": 1,
            "description": "Dispatch one or two immediate trusted-pointer submissions; two asserts exactly one new limit order."
          },
          "limit_price": {
            "type": [
              "string",
              "number"
            ]
          },
          "offset_pct": {
            "type": "number",
            "description": "Limit price offset from the current market price when limit_price is omitted."
          },
          "confirm_live": {
            "type": "boolean",
            "description": "Required when submission uses visible controls against the live provider."
          },
          "identity_rounding_tolerance_base_units": {
            "type": "string",
            "default": "10000",
            "description": "Maximum visible amount/price rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.place_order",
          "market": "BTC",
          "side": "long",
          "notional": "10",
          "leverage": 1,
          "identity_rounding_tolerance_base_units": "10000",
          "intent": "Place the requested Perps order",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation",
        "external-mutation"
      ]
    },
    "metamask.perps.assert_positions": {
      "description": "extension Assert live Perps positions are present or absent for an explicit market selection or mode=all.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Optional position/order side filter."
          },
          "timeout_ms": {
            "type": "number"
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "absent",
              "closed",
              "open",
              "present"
            ],
            "description": "Desired/expected selected collection state."
          }
        },
        "required": [
          "state"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.assert_positions",
          "state": "open",
          "market": "BTC",
          "intent": "Assert the expected Perps position state",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.perps.assert_orders": {
      "description": "extension Assert live Perps open orders are present or absent for an explicit market selection or mode=all.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Optional position/order side filter."
          },
          "timeout_ms": {
            "type": "number"
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "absent",
              "closed",
              "open",
              "present"
            ],
            "description": "Desired/expected selected collection state."
          }
        },
        "required": [
          "state"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.assert_orders",
          "state": "none",
          "market": "BTC",
          "intent": "Assert the expected Perps open order state",
          "next": "done"
        }
      ],
      "execution_capabilities": []
    },
    "metamask.perps.ensure_positions": {
      "description": "Read and assert the selected Extension Perps position state without creating or closing a position. Use an explicitly funded leaf action for any transition.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Required when state=open/present; otherwise filters selected positions."
          },
          "timeout_ms": {
            "type": "number"
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "absent",
              "closed",
              "open",
              "present"
            ],
            "description": "Desired/expected selected collection state."
          }
        },
        "required": [
          "state"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.ensure_positions",
          "state": "none",
          "market": "BTC",
          "intent": "Assert that no matching Perps position exists",
          "next": "done"
        },
        {
          "action": "metamask.perps.ensure_positions",
          "state": "none",
          "mode": "all",
          "intent": "Assert that no Perps position exists",
          "next": "done"
        },
        {
          "action": "metamask.perps.ensure_positions",
          "market": "ETH",
          "side": "long",
          "state": "open",
          "intent": "Assert that the matching ETH long position already exists",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.ensure_orders": {
      "description": "Read and assert the selected Extension Perps order state without creating or canceling an order. Use an explicitly funded leaf action for any transition.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string",
            "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
          },
          "symbol": {
            "type": "string",
            "description": "Alias for market."
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit list of market symbols."
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alias for markets."
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ],
            "description": "matching selects requested symbols; all selects every live item returned by the product."
          },
          "selector": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              }
            },
            "additionalProperties": false
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Required when state=open/present; otherwise filters selected orders."
          },
          "timeout_ms": {
            "type": "number"
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "absent",
              "closed",
              "open",
              "present"
            ],
            "description": "Desired/expected selected collection state."
          }
        },
        "required": [
          "state"
        ],
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.ensure_orders",
          "state": "none",
          "mode": "all",
          "intent": "Assert that no Perps order exists",
          "next": "done"
        },
        {
          "action": "metamask.perps.ensure_orders",
          "market": "ETH",
          "side": "short",
          "state": "open",
          "intent": "Assert that the matching ETH short order already exists",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "host-read-export"
      ]
    },
    "metamask.perps.teardown_state": {
      "description": "Observe and assert the requested final Extension Perps order and position state, then optionally navigate. This action never closes or cancels financial state.",
      "schema": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "symbols": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "page": {
            "description": "Final page target; false skips navigation for teardown.",
            "type": [
              "string",
              "boolean"
            ],
            "enum": [
              "home",
              "perps",
              "perps_home",
              "market",
              "market_details",
              "trade",
              "order",
              false
            ]
          },
          "positions": {
            "type": [
              "object",
              "boolean"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "none",
                  "closed",
                  "absent",
                  "open",
                  "present"
                ]
              },
              "timeout_ms": {
                "type": "number"
              }
            },
            "additionalProperties": false
          },
          "orders": {
            "type": [
              "object",
              "boolean"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "matching",
                  "all"
                ]
              },
              "market": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "symbols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "none",
                  "closed",
                  "absent",
                  "open",
                  "present"
                ]
              },
              "timeout_ms": {
                "type": "number"
              }
            },
            "additionalProperties": false
          },
          "timeout_ms": {
            "type": "number"
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "matching",
              "all"
            ]
          }
        },
        "additionalProperties": false
      },
      "examples": [
        {
          "action": "metamask.perps.teardown_state",
          "market": "BTC",
          "positions": {
            "state": "none"
          },
          "orders": {
            "state": "none"
          },
          "page": "home",
          "intent": "Assert the final BTC Perps state and return home",
          "next": "done"
        },
        {
          "action": "metamask.perps.teardown_state",
          "market": "BTC",
          "intent": "Assert that no matching BTC position or order exists",
          "next": "done"
        }
      ],
      "execution_capabilities": [
        "app-mutation"
      ]
    },
    "metamask.deeplink.open": {
      "description": "Open an HTTPS deeplink through real browser ingress so the Extension owns parsing, verification, and destination navigation.",
      "execution_capabilities": [
        "app-mutation"
      ],
      "examples": [
        {
          "action": "metamask.deeplink.open",
          "url": "https://link.metamask.io/home",
          "intent": "Open the deeplink through external browser navigation",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Absolute HTTPS deeplink URL."
          },
          "timeout_ms": {
            "type": "number",
            "description": "Maximum time for the external navigation. Default 15000."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      }
    },
    "metamask.analytics.start_capture": {
      "description": "extension Start capturing MetaMetrics events at the Segment transport and return a cursor to bracket later reads.",
      "execution_capabilities": [
        "arbitrary-code"
      ],
      "examples": [
        {
          "action": "metamask.analytics.start_capture",
          "intent": "Begin capturing analytics before driving the flow",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "port": {
            "type": "integer",
            "description": "Collector port. Defaults to cdp_port + 1000, else 9090. The client build must point its Segment host here (extension SEGMENT_HOST, mobile SEGMENT_PROXY_URL)."
          },
          "cdp_port": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      }
    },
    "metamask.analytics.read_events": {
      "description": "extension Read MetaMetrics events captured since a cursor, as [{ event, properties, ts }].",
      "execution_capabilities": [
        "host-read-export"
      ],
      "examples": [
        {
          "action": "metamask.analytics.read_events",
          "since": 0,
          "intent": "Inspect which analytics events the flow emitted",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "since": {
            "type": "number",
            "description": "Cursor (epoch ms) from start_capture. Omit to read everything captured."
          },
          "event": {
            "type": "string",
            "description": "Optional exact event-name filter."
          }
        },
        "additionalProperties": false
      }
    },
    "metamask.analytics.assert_events": {
      "description": "extension Assert MetaMetrics event names, property values and counts. Counts are the point: an exact count catches a double emit that a presence check cannot.",
      "execution_capabilities": [
        "host-read-export"
      ],
      "examples": [
        {
          "action": "metamask.analytics.assert_events",
          "expect": [
            {
              "event": "Perp Order Cancel Transaction",
              "count": 1
            }
          ],
          "intent": "Assert the cancel event was emitted exactly once",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "since": {
            "type": "number",
            "description": "Cursor from start_capture; brackets the assertion to this flow."
          },
          "exact": {
            "type": "boolean",
            "description": "When true, any captured event not named in expect is a failure."
          },
          "timeout_ms": {
            "type": "number",
            "description": "How long to wait for the lower bounds to be met. Default 15000."
          },
          "settle_ms": {
            "type": "number",
            "description": "Extra wait after the bounds are met, before judging. Default 1500. Required to catch a duplicate that arrives after the expected event."
          },
          "expect": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event": {
                  "type": "string",
                  "description": "Exact event name."
                },
                "count": {
                  "type": "integer",
                  "description": "Exact number of matching events. Mutually exclusive with min/max."
                },
                "min": {
                  "type": "integer",
                  "description": "Lower bound on matching events. Default 1."
                },
                "max": {
                  "type": "integer",
                  "description": "Upper bound on matching events."
                },
                "properties": {
                  "type": "object",
                  "description": "Subset match on event properties; values may be exact or use $exists, $type, and $gt predicates."
                }
              },
              "required": [
                "event"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "expect"
        ],
        "additionalProperties": false
      }
    },
    "metamask.analytics.set_consent": {
      "description": "extension Set MetaMetrics consent flags so events actually reach the Segment transport. Wallet fixtures set neither, so capture yields nothing without this.",
      "execution_capabilities": [
        "app-mutation"
      ],
      "examples": [
        {
          "action": "metamask.analytics.set_consent",
          "intent": "Opt in before capturing analytics",
          "next": "done"
        }
      ],
      "schema": {
        "type": "object",
        "properties": {
          "participate": {
            "type": "boolean",
            "description": "MetaMetrics optedIn state. Default true."
          },
          "marketing": {
            "type": "boolean",
            "description": "dataCollectionForMarketing. Default true. Required for utm_* properties to survive."
          },
          "timeout_ms": {
            "type": "number",
            "description": "Maximum time to navigate to Settings and apply each consent toggle. Default 15000."
          }
        },
        "additionalProperties": false
      }
    }
  },
  "observers": [
    {
      "ref": "ui.screen",
      "default_for": [
        "metamask.deeplink.open",
        "ui.navigate",
        "ui.press",
        "ui.key_press",
        "ui.set_input",
        "ui.scroll",
        "ui.swipe",
        "ui.pan",
        "ui.drag",
        "ui.long_press",
        "ui.wait_for",
        "ui.screenshot",
        "ui.capture_surface"
      ]
    },
    {
      "ref": "ui.visible",
      "default_for": [
        "metamask.deeplink.open",
        "ui.navigate",
        "ui.press",
        "ui.key_press",
        "ui.set_input",
        "ui.scroll",
        "ui.swipe",
        "ui.pan",
        "ui.drag",
        "ui.long_press",
        "ui.wait_for",
        "ui.screenshot",
        "ui.capture_surface"
      ]
    }
  ]
}
