{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/api-wrapper-manifest.v1.json",
  "title": "Agoragentic API Wrapper Manifest v1",
  "description": "Reviewed wrapper contract for an API Capability Forge candidate. A manifest describes a future wrapper target and policy posture; it is not an executable wrapper by itself.",
  "type": "object",
  "required": [
    "schema",
    "wrapper_id",
    "candidate_id",
    "name",
    "wrapper_type",
    "input_schema",
    "output_schema",
    "auth_policy",
    "canary_receipt_ids",
    "publication_state",
    "public_boundary"
  ],
  "properties": {
    "schema": { "const": "agoragentic.api-wrapper-manifest.v1" },
    "wrapper_id": { "type": "string", "minLength": 1 },
    "candidate_id": { "type": ["string", "null"] },
    "name": { "type": "string", "minLength": 1 },
    "wrapper_type": {
      "type": "string",
      "enum": [
        "mcp_tool",
        "openapi_wrapper",
        "agent_toolkit_command",
        "sdk_helper",
        "n8n_action",
        "x402_service"
      ]
    },
    "input_schema": { "type": "object" },
    "output_schema": { "type": "object" },
    "auth_policy": {
      "type": "object",
      "required": ["raw_secret_storage_allowed"],
      "properties": {
        "raw_secret_storage_allowed": { "const": false },
        "secret_policy_ref": { "type": ["string", "null"] }
      },
      "additionalProperties": true
    },
    "receipt_policy_ref": { "type": ["string", "null"] },
    "canary_receipt_ids": {
      "type": "array",
      "items": { "type": "string" }
    },
    "publication_state": {
      "type": "string",
      "enum": ["wrapper_generated", "listing_draft", "owner_approved", "published", "deprecated", "failed"]
    },
    "public_boundary": {
      "type": "object",
      "required": [
        "marketplace_listing_published",
        "x402_route_created",
        "official_provider_partnership_claimed"
      ],
      "properties": {
        "marketplace_listing_published": { "const": false },
        "x402_route_created": { "const": false },
        "official_provider_partnership_claimed": { "const": false }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
