{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "A WebAssembly function registered on AT Protocol",
"key": "any",
"record": {
"properties": {
"allowedHosts": {
"description": "For host-v1: list of AT URIs the function may read from",
"items": {
"type": "string"
},
"type": "array"
},
"code": {
"accept": [
"application/wasm"
],
"description": "Compiled WebAssembly binary",
"type": "blob"
},
"description": {
"description": "Optional description of what the function does",
"maxLength": 2048,
"type": "string"
},
"entrypoint": {
"const": "run",
"description": "WASM export name to call (always 'run')",
"type": "string"
},
"inputEncoding": {
"const": "application/json",
"description": "Input encoding (always application/json)",
"type": "string"
},
"inputSchema": {
"description": "Optional JSON Schema for input validation",
"type": "unknown"
},
"maxDurationMs": {
"default": 100,
"description": "Execution timeout in milliseconds",
"maximum": 5000,
"minimum": 1,
"type": "integer"
},
"maxMemoryMb": {
"default": 32,
"description": "Memory limit in megabytes",
"maximum": 256,
"minimum": 1,
"type": "integer"
},
"mode": {
"description": "Execution mode",
"knownValues": [
"pure-v1",
"host-v1",
"component-v1"
],
"type": "string"
},
"name": {
"description": "Human-readable function name",
"maxLength": 128,
"type": "string"
},
"outputEncoding": {
"const": "application/json",
"description": "Output encoding (always application/json)",
"type": "string"
},
"outputSchema": {
"description": "Optional JSON Schema for output description",
"type": "unknown"
},
"public": {
"default": true,
"description": "Whether this function is publicly invocable",
"type": "boolean"
},
"version": {
"description": "Semver string",
"maxLength": 32,
"type": "string"
}
},
"required": [
"name",
"version",
"mode",
"code",
"entrypoint",
"inputEncoding",
"outputEncoding"
],
"type": "object"
},
"type": "record"
}
},
"id": "at.functions.metadata",
"lexicon": 1
}