{
  "version": "1.1.0",
  "source": {"tool": "figma", "fileId": "sample-ai-native-debounce-emit"},
  "nodes": [
    {"id": "scr_debounce", "type": "screen", "name": "Debounce", "role": "container", "children": ["cmp_fire"]},
    {"id": "cmp_fire", "type": "component", "name": "Button/Fire", "role": "button", "parentId": "scr_debounce"}
  ],
  "extensions": {
    "ai_native": {
      "version": "1.1.0",
      "state": {
        "session": {"initial": {"x": 0}}
      },
      "capabilities": {
        "util.add1": {
          "description": "Add 1 to the provided x",
          "input": {
            "type": "object",
            "required": ["x"],
            "properties": {"x": {"type": "number"}}
          },
          "output": {"type": "number"},
          "fixtures": [
            {"id": "x0", "args": {"x": 0}, "result": 1}
          ]
        }
      },
      "actions": {
        "act_emit_tick": {
          "type": "emit",
          "target": "scr_debounce",
          "payload": {"event": "tick", "detail": {"source": "act_emit_tick"}}
        },
        "act_add1": {
          "type": "invoke",
          "target": "util.add1",
          "payload": {
            "fixtureId": "x0",
            "argsFromState": {"store": "session", "pointer": ""},
            "bindResultTo": {"store": "session", "pointer": "/x"}
          }
        }
      },
      "eventHandlers": [
        {
          "id": "eh_fire",
          "on": "click",
          "scope": "cmp_fire",
          "do": ["act_emit_tick", "act_emit_tick"]
        },
        {
          "id": "eh_tick",
          "on": "event",
          "scope": "scr_debounce",
          "event": "tick",
          "debounceMs": 1000,
          "do": ["act_add1"]
        }
      ]
    }
  }
}
