{
  "actions": {
    "actions": [
      {
        "execution": "client_handler_required",
        "payload": "target: application-relative path",
        "type": "navigation.open"
      },
      {
        "execution": "client_handler_required",
        "payload": "text: plain text",
        "type": "text.insert"
      },
      {
        "execution": "client_handler_required",
        "payload": "target: registered media identifier",
        "type": "media.play"
      },
      {
        "execution": "client_handler_required",
        "payload": "target: registered media identifier",
        "type": "media.pause"
      },
      {
        "execution": "client_handler_required",
        "payload": "target: registered scene identifier",
        "type": "scene.focus"
      },
      {
        "execution": "client_handler_required",
        "payload": "target: registered workflow identifier; parameters: string map",
        "type": "workflow.trigger"
      }
    ],
    "version": "v1"
  },
  "capabilities": {
    "capabilities": [
      {
        "acquisition": "client_transcript",
        "apiAvailable": true,
        "note": "Product stage supplied by founder; this API resolves supplied transcripts, not audio.",
        "productStage": "production",
        "sense": "voice"
      },
      {
        "acquisition": "client_gesture",
        "apiAvailable": true,
        "note": "Product stage supplied by founder; this API resolves supplied gesture identifiers, not camera frames.",
        "productStage": "beta",
        "sense": "motion"
      },
      {
        "acquisition": "unavailable",
        "apiAvailable": false,
        "note": "Active university R&D reported by founder; no sensing API available.",
        "productStage": "research",
        "sense": "smell"
      },
      {
        "acquisition": "unavailable",
        "apiAvailable": false,
        "note": "No sensing API available.",
        "productStage": "roadmap",
        "sense": "taste"
      },
      {
        "acquisition": "unavailable",
        "apiAvailable": false,
        "note": "No sensing API available.",
        "productStage": "roadmap",
        "sense": "view"
      },
      {
        "acquisition": "unavailable",
        "apiAvailable": false,
        "note": "No sensing API available.",
        "productStage": "roadmap",
        "sense": "touch"
      }
    ],
    "version": "v1"
  },
  "openapi": {
    "components": {
      "schemas": {
        "Accepted": {
          "properties": {
            "status": {
              "type": "string"
            }
          },
          "required": [
            "status"
          ],
          "type": "object"
        },
        "Action": {
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "target": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "navigation.open"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "target",
                "type"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "text": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "text.insert"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "text",
                "type"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "target": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "media.play"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "target",
                "type"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "target": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "media.pause"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "target",
                "type"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "target": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "scene.focus"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "target",
                "type"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "parameters": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "propertyNames": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "target": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "workflow.trigger"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "target",
                "type"
              ],
              "type": "object"
            }
          ]
        },
        "ActionDefinition": {
          "properties": {
            "execution": {
              "type": "string"
            },
            "payload": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "payload",
            "execution"
          ],
          "type": "object"
        },
        "Actions": {
          "properties": {
            "actions": {
              "items": {
                "$ref": "#/components/schemas/ActionDefinition"
              },
              "type": "array"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "version",
            "actions"
          ],
          "type": "object"
        },
        "ApiError": {
          "properties": {
            "error": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          },
          "required": [
            "error"
          ],
          "type": "object"
        },
        "Capabilities": {
          "properties": {
            "capabilities": {
              "items": {
                "$ref": "#/components/schemas/Capability"
              },
              "type": "array"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "version",
            "capabilities"
          ],
          "type": "object"
        },
        "Capability": {
          "properties": {
            "acquisition": {
              "type": "string"
            },
            "apiAvailable": {
              "type": "boolean"
            },
            "note": {
              "type": "string"
            },
            "productStage": {
              "type": "string"
            },
            "sense": {
              "type": "string"
            }
          },
          "required": [
            "sense",
            "productStage",
            "apiAvailable",
            "acquisition",
            "note"
          ],
          "type": "object"
        },
        "ContactApiError": {
          "properties": {
            "error": {
              "type": "string"
            }
          },
          "required": [
            "error"
          ],
          "type": "object"
        },
        "ErrorDetail": {
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "Input": {
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "confidence": {
                  "format": "double",
                  "maximum": 1,
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "sense": {
                  "enum": [
                    "voice"
                  ],
                  "type": "string"
                },
                "transcript": {
                  "type": "string"
                }
              },
              "required": [
                "transcript",
                "sense"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "confidence": {
                  "format": "double",
                  "maximum": 1,
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "gesture": {
                  "type": "string"
                },
                "sense": {
                  "enum": [
                    "motion"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "gesture",
                "sense"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "sense": {
                  "enum": [
                    "smell"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "sense"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "sense": {
                  "enum": [
                    "taste"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "sense"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "sense": {
                  "enum": [
                    "view"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "sense"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "sense": {
                  "enum": [
                    "touch"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "sense"
              ],
              "type": "object"
            }
          ]
        },
        "InquiryRequest": {
          "additionalProperties": false,
          "properties": {
            "capitalRange": {
              "type": [
                "string",
                "null"
              ]
            },
            "consent": {
              "type": "boolean"
            },
            "email": {
              "type": "string"
            },
            "kind": {
              "type": "string"
            },
            "language": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "organization": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "email",
            "kind",
            "language",
            "consent"
          ],
          "type": "object"
        },
        "Intent": {
          "properties": {
            "action": {
              "$ref": "#/components/schemas/Action"
            },
            "ruleId": {
              "type": "string"
            }
          },
          "required": [
            "ruleId",
            "action"
          ],
          "type": "object"
        },
        "ResolveRequest": {
          "additionalProperties": false,
          "properties": {
            "input": {
              "$ref": "#/components/schemas/Input"
            },
            "rules": {
              "items": {
                "$ref": "#/components/schemas/Rule"
              },
              "maxItems": 32,
              "type": "array"
            }
          },
          "required": [
            "input",
            "rules"
          ],
          "type": "object"
        },
        "ResolveResponse": {
          "properties": {
            "execution": {
              "type": "string"
            },
            "intents": {
              "items": {
                "$ref": "#/components/schemas/Intent"
              },
              "type": "array"
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "status",
            "intents",
            "execution"
          ],
          "type": "object"
        },
        "Rule": {
          "additionalProperties": false,
          "properties": {
            "action": {
              "$ref": "#/components/schemas/Action"
            },
            "enabled": {
              "type": "boolean"
            },
            "id": {
              "type": "string"
            },
            "match": {
              "type": "string"
            },
            "minConfidence": {
              "format": "double",
              "maximum": 1,
              "minimum": 0,
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "match",
            "action"
          ],
          "type": "object"
        },
        "SignupRequest": {
          "additionalProperties": false,
          "properties": {
            "consent": {
              "type": "boolean"
            },
            "email": {
              "type": "string"
            },
            "language": {
              "type": "string"
            }
          },
          "required": [
            "email",
            "language",
            "consent"
          ],
          "type": "object"
        },
        "Template": {
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "request": {
              "$ref": "#/components/schemas/ResolveRequest"
            }
          },
          "required": [
            "id",
            "name",
            "request"
          ],
          "type": "object"
        },
        "Templates": {
          "properties": {
            "templates": {
              "items": {
                "$ref": "#/components/schemas/Template"
              },
              "type": "array"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "version",
            "templates"
          ],
          "type": "object"
        },
        "ValidationResponse": {
          "properties": {
            "valid": {
              "type": "boolean"
            }
          },
          "required": [
            "valid"
          ],
          "type": "object"
        }
      }
    },
    "info": {
      "title": "EnterSense API",
      "version": "0.1.0"
    },
    "openapi": "3.1.0",
    "paths": {
      "/api/health": {
        "get": {
          "operationId": "health",
          "responses": {
            "200": {
              "description": "D1 available"
            },
            "503": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/inquiries": {
        "post": {
          "operationId": "contact",
          "requestBody": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryRequest"
                }
              }
            },
            "required": true
          },
          "responses": {
            "202": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Accepted"
                  }
                }
              },
              "description": ""
            },
            "400": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "403": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "413": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "415": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "429": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "503": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/newsletter": {
        "post": {
          "operationId": "newsletter",
          "requestBody": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupRequest"
                }
              }
            },
            "required": true
          },
          "responses": {
            "202": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Accepted"
                  }
                }
              },
              "description": ""
            },
            "400": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "403": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "413": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "415": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "429": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            },
            "503": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ContactApiError"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/openapi.json": {
        "get": {
          "operationId": "openapi",
          "responses": {
            "200": {
              "description": "OpenAPI derived from the registered handlers"
            }
          },
          "tags": []
        }
      },
      "/api/v1/actions": {
        "get": {
          "operationId": "get_actions",
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Actions"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/v1/capabilities": {
        "get": {
          "operationId": "get_capabilities",
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Capabilities"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/v1/resolve": {
        "post": {
          "operationId": "post_resolve",
          "requestBody": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveRequest"
                }
              }
            },
            "required": true
          },
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ResolveResponse"
                  }
                }
              },
              "description": ""
            },
            "400": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "413": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "415": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "422": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "429": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "503": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/v1/templates": {
        "get": {
          "operationId": "get_templates",
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Templates"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      },
      "/api/v1/validate": {
        "post": {
          "operationId": "post_validate",
          "requestBody": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveRequest"
                }
              }
            },
            "required": true
          },
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ValidationResponse"
                  }
                }
              },
              "description": ""
            },
            "400": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "413": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "415": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "422": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "429": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            },
            "503": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ApiError"
                  }
                }
              },
              "description": ""
            }
          },
          "tags": []
        }
      }
    }
  },
  "templates": {
    "templates": [
      {
        "id": "voice-home",
        "name": "Voice opens home",
        "request": {
          "input": {
            "confidence": null,
            "sense": "voice",
            "transcript": "open home"
          },
          "rules": [
            {
              "action": {
                "target": "/",
                "type": "navigation.open"
              },
              "enabled": true,
              "id": "home",
              "match": "open home",
              "minConfidence": null
            }
          ]
        }
      },
      {
        "id": "motion-focus",
        "name": "Swipe focuses movement",
        "request": {
          "input": {
            "confidence": null,
            "gesture": "swipe_left",
            "sense": "motion"
          },
          "rules": [
            {
              "action": {
                "target": "move",
                "type": "scene.focus"
              },
              "enabled": true,
              "id": "movement",
              "match": "swipe_left",
              "minConfidence": null
            }
          ]
        }
      }
    ],
    "version": "v1"
  }
}
