{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.endpoint-manifest.schema.json",
  "title": "LocalEndpoint Endpoint Manifest",
  "description": "Declares a local endpoint for offline validation and evidence export without exposing secrets or enabling public probing.",
  "type": "object",
  "required": [
    "manifestVersion",
    "endpointName",
    "ownerWorkspaceLabel",
    "transport",
    "healthCheck",
    "allowedOperations",
    "deniedOperations",
    "inputConstraints",
    "outputContract",
    "resourceCostEstimate",
    "evidenceExportPolicy",
    "privacyClassification",
    "createdUtc",
    "updatedUtc"
  ],
  "properties": {
    "manifestVersion": {
      "type": "string",
      "const": "1.0"
    },
    "endpointName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "ownerWorkspaceLabel": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "type": "string",
      "maxLength": 1000
    },
    "transport": {
      "type": "string",
      "enum": [
        "http",
        "stdio",
        "webhook",
        "file",
        "socket",
        "custom"
      ]
    },
    "localAddress": {
      "type": "string",
      "description": "Local address label such as http://127.0.0.1:8080/health. Do not include secrets.",
      "maxLength": 400
    },
    "commandMetadata": {
      "type": "object",
      "description": "Command descriptor metadata for stdio/custom transports. Must not include secrets.",
      "required": [
        "commandLabel",
        "argumentsShape"
      ],
      "properties": {
        "commandLabel": {
          "type": "string"
        },
        "argumentsShape": {
          "type": "string"
        },
        "workingDirectoryPolicy": {
          "type": "string"
        },
        "secretRequired": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "healthCheck": {
      "type": "object",
      "required": [
        "kind",
        "expectedStatus",
        "timeoutMs"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "http-status",
            "process-exit",
            "file-exists",
            "socket-open",
            "manual"
          ]
        },
        "pathOrCommand": {
          "type": "string"
        },
        "expectedStatus": {
          "type": "string"
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 60000
        }
      },
      "additionalProperties": false
    },
    "allowedOperations": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "deniedOperations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "inputConstraints": {
      "type": "object",
      "required": [
        "maxBytes",
        "allowedContentTypes",
        "requiresHumanReviewFor"
      ],
      "properties": {
        "maxBytes": {
          "type": "integer",
          "minimum": 0
        },
        "allowedContentTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "requiresHumanReviewFor": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "outputContract": {
      "type": "object",
      "required": [
        "shape",
        "maxBytes",
        "redactionRequired"
      ],
      "properties": {
        "shape": {
          "type": "string"
        },
        "maxBytes": {
          "type": "integer",
          "minimum": 0
        },
        "redactionRequired": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "resourceCostEstimate": {
      "type": "object",
      "required": [
        "cpu",
        "memoryMb",
        "diskMb",
        "network",
        "maintenanceNotes"
      ],
      "properties": {
        "cpu": {
          "type": "string"
        },
        "memoryMb": {
          "type": "integer",
          "minimum": 0
        },
        "diskMb": {
          "type": "integer",
          "minimum": 0
        },
        "network": {
          "type": "string",
          "enum": [
            "none",
            "loopback-only",
            "private-lan",
            "internet-required"
          ]
        },
        "maintenanceNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "evidenceExportPolicy": {
      "type": "object",
      "required": [
        "exportAllowed",
        "redactionRequired",
        "rawLogsAllowed",
        "hashArtifacts"
      ],
      "properties": {
        "exportAllowed": {
          "type": "boolean"
        },
        "redactionRequired": {
          "type": "boolean"
        },
        "rawLogsAllowed": {
          "type": "boolean"
        },
        "hashArtifacts": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "privacyClassification": {
      "type": "string",
      "enum": [
        "public-safe",
        "internal-redacted",
        "private-local-only",
        "secret-do-not-export"
      ]
    },
    "createdUtc": {
      "type": "string",
      "format": "date-time"
    },
    "updatedUtc": {
      "type": "string",
      "format": "date-time"
    },
    "nonClaims": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
