{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aidenid.com/for-agents/schemas/skills.schema.json",
  "type": "object",
  "properties": {
    "schema": {
      "const": "aidenid.agent-skills/1"
    },
    "version": {
      "const": 1
    },
    "locale": {
      "const": "en"
    },
    "generatorVersion": {
      "type": "string",
      "minLength": 1
    },
    "source": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "format": "uri"
        },
        "contractVersion": {
          "type": "string",
          "minLength": 1
        },
        "sourceHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "catalog": {
          "type": "string",
          "format": "uri"
        },
        "catalogHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "required": [
        "contract",
        "contractVersion",
        "sourceHash",
        "catalog",
        "catalogHash"
      ],
      "additionalProperties": false
    },
    "notice": {
      "type": "string",
      "minLength": 1
    },
    "effects": {
      "type": "object",
      "properties": {
        "scope": {
          "const": "demo-store-operations"
        },
        "simulated": {
          "const": true
        },
        "moneyMoved": {
          "const": false
        },
        "fulfillment": {
          "const": "none"
        },
        "persistedOrder": {
          "const": false
        }
      },
      "required": [
        "scope",
        "simulated",
        "moneyMoved",
        "fulfillment",
        "persistedOrder"
      ],
      "additionalProperties": false
    },
    "capabilities": {
      "type": "array",
      "minItems": 7,
      "maxItems": 7,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "enum": [
              "read",
              "browse_products",
              "buy",
              "assisted_checkout",
              "install",
              "contact",
              "view_traffic"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "guideUrl": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "enum": [
              "GET",
              "POST",
              "MAILTO"
            ]
          },
          "prerequisites": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "enum": [
                    "current_catalog",
                    "shopping_goal",
                    "json_client",
                    "simulation_authorization",
                    "matching_preview",
                    "routing_choice",
                    "form_client",
                    "returned_context",
                    "install_intake",
                    "email_client",
                    "send_authorization",
                    "human_admission"
                  ]
                },
                "when": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "id",
                "when"
              ],
              "additionalProperties": false
            }
          },
          "returns": {
            "type": "string",
            "minLength": 1
          },
          "operationIds": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "enum": [
                "catalog",
                "add_to_cart",
                "checkout_preview",
                "place_order"
              ]
            }
          },
          "sourceUrls": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "url",
          "guideUrl",
          "method",
          "prerequisites",
          "returns",
          "operationIds",
          "sourceUrls"
        ],
        "additionalProperties": false
      }
    },
    "prerequisites": {
      "type": "array",
      "minItems": 12,
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "enum": [
              "current_catalog",
              "shopping_goal",
              "json_client",
              "simulation_authorization",
              "matching_preview",
              "routing_choice",
              "form_client",
              "returned_context",
              "install_intake",
              "email_client",
              "send_authorization",
              "human_admission"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "edges": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "enum": [
              "read",
              "browse_products",
              "buy",
              "assisted_checkout",
              "install",
              "contact",
              "view_traffic"
            ]
          },
          "to": {
            "enum": [
              "current_catalog",
              "shopping_goal",
              "json_client",
              "simulation_authorization",
              "matching_preview",
              "routing_choice",
              "form_client",
              "returned_context",
              "install_intake",
              "email_client",
              "send_authorization",
              "human_admission"
            ]
          },
          "relation": {
            "const": "requires"
          },
          "when": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "from",
          "to",
          "relation",
          "when"
        ],
        "additionalProperties": false
      }
    },
    "operations": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "enum": [
              "catalog",
              "add_to_cart",
              "checkout_preview",
              "place_order"
            ]
          },
          "dependsOn": {
            "type": "array",
            "items": {
              "enum": [
                "catalog",
                "add_to_cart",
                "checkout_preview",
                "place_order"
              ]
            },
            "uniqueItems": true
          },
          "contract": {
            "type": "object",
            "required": [
              "capability",
              "version",
              "title",
              "purpose",
              "operationKind",
              "inputSchema",
              "outputSchema",
              "errorSchema",
              "errors",
              "http",
              "runtimeGuards",
              "scope",
              "sideEffects",
              "requiresConfirmation",
              "confirmation",
              "semantics"
            ],
            "properties": {
              "capability": {
                "enum": [
                  "catalog",
                  "add_to_cart",
                  "checkout_preview",
                  "place_order"
                ]
              },
              "version": {
                "type": "string",
                "pattern": "^[a-z_]+@2\\.0\\.0$"
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "purpose": {
                "type": "string",
                "minLength": 1
              },
              "operationKind": {
                "enum": [
                  "read",
                  "action"
                ]
              },
              "inputSchema": {
                "type": "object",
                "required": [
                  "$schema",
                  "type",
                  "properties",
                  "required",
                  "additionalProperties"
                ]
              },
              "outputSchema": {
                "type": "object",
                "required": [
                  "$schema",
                  "type",
                  "properties",
                  "required",
                  "additionalProperties"
                ]
              },
              "errorSchema": {
                "type": "object",
                "required": [
                  "$schema",
                  "type",
                  "properties",
                  "required",
                  "additionalProperties"
                ]
              },
              "errors": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "minimum": 400,
                      "maximum": 599
                    },
                    "code": {
                      "type": "string",
                      "minLength": 1
                    },
                    "condition": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "status",
                    "code",
                    "condition"
                  ],
                  "additionalProperties": false
                }
              },
              "http": {
                "type": "object",
                "required": [
                  "method",
                  "path",
                  "queryParameters",
                  "requestBody",
                  "successStatus"
                ],
                "properties": {
                  "method": {
                    "enum": [
                      "GET",
                      "POST"
                    ]
                  },
                  "path": {
                    "enum": [
                      "/api/demo/store",
                      "/api/demo/execute"
                    ]
                  },
                  "queryParameters": {
                    "const": false
                  },
                  "successStatus": {
                    "const": 200
                  }
                }
              },
              "runtimeGuards": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "scope": {
                "const": "read"
              },
              "sideEffects": {
                "enum": [
                  "none",
                  "simulated"
                ]
              },
              "requiresConfirmation": {
                "type": "boolean"
              },
              "confirmation": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "semantics": {
                "type": "object",
                "required": [
                  "physicalEffects",
                  "persistence",
                  "payment",
                  "fulfillment"
                ],
                "properties": {
                  "physicalEffects": {
                    "const": "none"
                  },
                  "persistence": {
                    "const": "none"
                  },
                  "payment": {
                    "const": "none"
                  },
                  "fulfillment": {
                    "const": "none"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "dependsOn",
          "contract"
        ],
        "additionalProperties": false
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "browse": {
          "type": "string",
          "format": "uri"
        },
        "buy": {
          "type": "string",
          "format": "uri"
        },
        "catalog": {
          "type": "string",
          "format": "uri"
        },
        "contract": {
          "type": "string",
          "format": "uri"
        },
        "assistedShopping": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "browse",
        "buy",
        "catalog",
        "contract",
        "assistedShopping"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schema",
    "version",
    "locale",
    "generatorVersion",
    "source",
    "notice",
    "effects",
    "capabilities",
    "prerequisites",
    "edges",
    "operations",
    "links"
  ],
  "additionalProperties": false
}
