{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://maf1.local/plugin-protocol-v1.schema.json", "title": "MAF1 plugin protocol v1", "description": "宿主写入插件 stdin 的 PluginRequest。stdout 必须是与 plugin.json outputs 字段对应的单个 JSON 对象。", "type": "object", "required": ["protocolVersion", "inputs"], "additionalProperties": false, "properties": { "protocolVersion": { "type": "integer", "const": 1 }, "inputs": { "type": "object", "description": "键名与 plugin.json inputs[].name 一致。", "additionalProperties": true }, "credentials": { "type": "object", "description": "键名与 plugin.json credentials[].name 一致。未声明的凭据不会出现。", "additionalProperties": { "$ref": "#/$defs/credentialPayload" } } }, "$defs": { "credentialPayload": { "type": "object", "required": ["id", "type"], "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "openai-compatible | llm | openweather | 其它自定义类型" }, "endpoint": { "type": ["string", "null"] }, "apiKey": { "type": ["string", "null"] }, "model": { "type": ["string", "null"] }, "extra": { "type": "object", "additionalProperties": { "type": "string" } } } } } }