{
  "version": "1.1.0",
  "source": {"tool": "figma", "fileId": "sample-ai-native-alias-predicate"},
  "nodes": [
    {"id": "scr_login", "type": "screen", "name": "Login", "role": "container", "children": ["cnt_form"]},
    {
      "id": "cnt_form",
      "type": "container",
      "name": "Form",
      "parentId": "scr_login",
      "children": ["cmp_email", "cmp_submit"]
    },
    {"id": "cmp_email", "type": "component", "name": "Input/Email", "role": "input", "parentId": "cnt_form"},
    {"id": "cmp_submit", "type": "component", "name": "Button/Continue", "role": "button", "parentId": "cnt_form"}
  ],
  "extensions": {
    "ai_native": {
      "version": "1.1.0",
      "intent": {
        "cmp_email": "collect email",
        "cmp_submit": "submit the form"
      },
      "scopeAliases": {
        "primarySubmit": {"kind": "byRole", "role": "button", "within": "scr_login", "index": 0}
      },
      "state": {
        "form": {"initial": {"email": "test@example.com"}},
        "session": {"initial": {"allowSubmit": true, "clicked": false}}
      },
      "dataBindings": [
        {"component": "cmp_email", "property": "value", "direction": "inout", "source": {"kind": "state", "store": "form", "pointer": "/email"}}
      ],
      "actions": {
        "act_mark_clicked": {
          "type": "setState",
          "target": "scr_login",
          "payload": {"store": "session", "pointer": "/clicked", "mode": "replace", "patch": true}
        }
      },
      "eventHandlers": [
        {
          "id": "eh_submit",
          "on": "click",
          "scope": "primarySubmit",
          "when": {
            "all": [
              {"matches": [{"ref": "/state/form/email"}, ".+@.+"]},
              {"ref": "/state/session/allowSubmit"}
            ]
          },
          "do": ["act_mark_clicked"]
        }
      ]
    }
  }
}
