{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://velox.dev/schema/envelope.schema.json", "title": "Envelope", "description": "JSON-RPC 2.0 envelope as Velox uses it, plus the project's error codes. Every transport (UDS NDJSON, native-messaging length-prefix, loopback WebSocket) carries exactly these payloads; only the framing differs.", "$defs": { "Id": { "title": "Id", "description": "Request correlation id. Velox clients always send an integer; string ids are accepted for spec compliance. A notification has no id.", "type": ["integer", "string"] }, "Request": { "title": "Request", "type": "object", "additionalProperties": false, "required": ["jsonrpc", "method"], "properties": { "jsonrpc": { "const": "2.0" }, "id": { "$ref": "#/$defs/Id" }, "method": { "type": "string" }, "params": { "type": "object" } } }, "Response": { "title": "Response", "description": "Exactly one of result or error is present.", "type": "object", "additionalProperties": false, "required": ["jsonrpc", "id"], "properties": { "jsonrpc": { "const": "2.0" }, "id": { "$ref": "#/$defs/Id" }, "result": {}, "error": { "$ref": "#/$defs/Error" } } }, "Notification": { "title": "Notification", "description": "Server to client. No id, never answered.", "type": "object", "additionalProperties": false, "required": ["jsonrpc", "method", "params"], "properties": { "jsonrpc": { "const": "2.0" }, "method": { "type": "string" }, "params": { "type": "object" } } }, "Error": { "title": "Error", "type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": { "code": { "$ref": "https://velox.dev/schema/types/ErrorCode.schema.json" }, "message": { "type": "string" }, "data": { "type": ["object", "null"], "description": "Code-specific detail. -32013 carries data.httpStatus; -32011 carries data.path; -32014 carries data.retryAfterSec.", "properties": { "httpStatus": { "type": ["integer", "null"] }, "path": { "type": ["string", "null"] }, "retryAfterSec": { "type": ["integer", "null"] }, "taskId": { "type": ["string", "null"] }, "expected": { "type": ["string", "null"] }, "actual": { "type": ["string", "null"] } } } } } } }