|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://brigade.tools/schemas/component-manifest-v1.schema.json", |
| 4 | + "title": "Brigade component manifest v1", |
| 5 | + "type": "object", |
| 6 | + "additionalProperties": false, |
| 7 | + "required": [ |
| 8 | + "schema_version", |
| 9 | + "brigade_version", |
| 10 | + "manifest_revision", |
| 11 | + "supported_platforms", |
| 12 | + "components" |
| 13 | + ], |
| 14 | + "properties": { |
| 15 | + "schema_version": {"const": 1}, |
| 16 | + "brigade_version": {"type": "string", "minLength": 1}, |
| 17 | + "manifest_revision": {"type": "string", "minLength": 1}, |
| 18 | + "supported_platforms": { |
| 19 | + "const": [ |
| 20 | + "linux-amd64", |
| 21 | + "linux-arm64", |
| 22 | + "darwin-amd64", |
| 23 | + "darwin-arm64", |
| 24 | + "windows-amd64" |
| 25 | + ] |
| 26 | + }, |
| 27 | + "components": { |
| 28 | + "type": "object", |
| 29 | + "required": ["graphtrail", "graphtrail-mcp", "miseledger", "sessionfind"], |
| 30 | + "properties": { |
| 31 | + "graphtrail": { |
| 32 | + "allOf": [ |
| 33 | + { |
| 34 | + "type": "object", |
| 35 | + "additionalProperties": false, |
| 36 | + "required": ["component_revision", "source", "executable", "assets"], |
| 37 | + "properties": { |
| 38 | + "component_revision": {"$ref": "#/$defs/graphtrail_component_revision"}, |
| 39 | + "executable": {"const": "graphtrail"}, |
| 40 | + "source": {}, |
| 41 | + "assets": {} |
| 42 | + } |
| 43 | + }, |
| 44 | + { |
| 45 | + "oneOf": [ |
| 46 | + { |
| 47 | + "properties": { |
| 48 | + "source": {"$ref": "#/$defs/unpublished_source"}, |
| 49 | + "assets": {"$ref": "#/$defs/empty_assets"} |
| 50 | + }, |
| 51 | + "required": ["source", "assets"] |
| 52 | + }, |
| 53 | + { |
| 54 | + "properties": { |
| 55 | + "source": {"$ref": "#/$defs/published_source"}, |
| 56 | + "assets": {"$ref": "#/$defs/published_assets"} |
| 57 | + }, |
| 58 | + "required": ["source", "assets"] |
| 59 | + } |
| 60 | + ] |
| 61 | + } |
| 62 | + ] |
| 63 | + }, |
| 64 | + "graphtrail-mcp": { |
| 65 | + "allOf": [ |
| 66 | + { |
| 67 | + "type": "object", |
| 68 | + "additionalProperties": false, |
| 69 | + "required": ["component_revision", "source", "executable", "assets"], |
| 70 | + "properties": { |
| 71 | + "component_revision": {"$ref": "#/$defs/graphtrail_component_revision"}, |
| 72 | + "executable": {"const": "graphtrail-mcp"}, |
| 73 | + "source": {}, |
| 74 | + "assets": {} |
| 75 | + } |
| 76 | + }, |
| 77 | + { |
| 78 | + "oneOf": [ |
| 79 | + { |
| 80 | + "properties": { |
| 81 | + "source": {"$ref": "#/$defs/unpublished_source"}, |
| 82 | + "assets": {"$ref": "#/$defs/empty_assets"} |
| 83 | + }, |
| 84 | + "required": ["source", "assets"] |
| 85 | + }, |
| 86 | + { |
| 87 | + "properties": { |
| 88 | + "source": {"$ref": "#/$defs/published_source"}, |
| 89 | + "assets": {"$ref": "#/$defs/published_assets"} |
| 90 | + }, |
| 91 | + "required": ["source", "assets"] |
| 92 | + } |
| 93 | + ] |
| 94 | + } |
| 95 | + ] |
| 96 | + }, |
| 97 | + "miseledger": { |
| 98 | + "allOf": [ |
| 99 | + {"$ref": "#/$defs/known_component"}, |
| 100 | + { |
| 101 | + "properties": { |
| 102 | + "executable": {"const": "miseledger"}, |
| 103 | + "assets": {"$ref": "#/$defs/published_assets"}, |
| 104 | + "source": {"$ref": "#/$defs/published_source"} |
| 105 | + } |
| 106 | + } |
| 107 | + ] |
| 108 | + }, |
| 109 | + "sessionfind": { |
| 110 | + "allOf": [ |
| 111 | + {"$ref": "#/$defs/known_component"}, |
| 112 | + { |
| 113 | + "properties": { |
| 114 | + "executable": {"const": "sessionfind"}, |
| 115 | + "assets": {"$ref": "#/$defs/published_assets"}, |
| 116 | + "source": {"$ref": "#/$defs/published_source"} |
| 117 | + } |
| 118 | + } |
| 119 | + ] |
| 120 | + } |
| 121 | + }, |
| 122 | + "additionalProperties": true |
| 123 | + } |
| 124 | + }, |
| 125 | + "$defs": { |
| 126 | + "known_component": { |
| 127 | + "type": "object", |
| 128 | + "additionalProperties": false, |
| 129 | + "required": ["component_revision", "source", "executable", "assets"], |
| 130 | + "properties": { |
| 131 | + "component_revision": {"type": "string", "minLength": 1}, |
| 132 | + "source": { |
| 133 | + "type": "object", |
| 134 | + "additionalProperties": false, |
| 135 | + "required": ["repository"], |
| 136 | + "properties": { |
| 137 | + "repository": {"type": "string", "pattern": "^[^/]+/[^/]+$"}, |
| 138 | + "release_tag": {"type": "string", "minLength": 1} |
| 139 | + } |
| 140 | + }, |
| 141 | + "executable": {"type": "string", "minLength": 1}, |
| 142 | + "assets": { |
| 143 | + "type": "object", |
| 144 | + "propertyNames": { |
| 145 | + "pattern": "^(linux|darwin|windows)-(amd64|arm64)$" |
| 146 | + }, |
| 147 | + "additionalProperties": {"$ref": "#/$defs/asset"} |
| 148 | + } |
| 149 | + } |
| 150 | + }, |
| 151 | + "graphtrail_component_revision": { |
| 152 | + "type": "string", |
| 153 | + "pattern": "^[0-9a-f]{40}$" |
| 154 | + }, |
| 155 | + "published_source": { |
| 156 | + "type": "object", |
| 157 | + "additionalProperties": false, |
| 158 | + "required": ["repository", "release_tag"], |
| 159 | + "properties": { |
| 160 | + "repository": {"type": "string", "pattern": "^[^/]+/[^/]+$"}, |
| 161 | + "release_tag": {"type": "string", "minLength": 1} |
| 162 | + } |
| 163 | + }, |
| 164 | + "unpublished_source": { |
| 165 | + "type": "object", |
| 166 | + "additionalProperties": false, |
| 167 | + "required": ["repository"], |
| 168 | + "properties": { |
| 169 | + "repository": {"type": "string", "pattern": "^[^/]+/[^/]+$"} |
| 170 | + } |
| 171 | + }, |
| 172 | + "empty_assets": { |
| 173 | + "type": "object", |
| 174 | + "additionalProperties": false, |
| 175 | + "maxProperties": 0 |
| 176 | + }, |
| 177 | + "published_assets": { |
| 178 | + "type": "object", |
| 179 | + "required": [ |
| 180 | + "linux-amd64", |
| 181 | + "linux-arm64", |
| 182 | + "darwin-amd64", |
| 183 | + "darwin-arm64", |
| 184 | + "windows-amd64" |
| 185 | + ], |
| 186 | + "properties": { |
| 187 | + "linux-amd64": {"$ref": "#/$defs/unix_asset"}, |
| 188 | + "linux-arm64": {"$ref": "#/$defs/unix_asset"}, |
| 189 | + "darwin-amd64": {"$ref": "#/$defs/unix_asset"}, |
| 190 | + "darwin-arm64": {"$ref": "#/$defs/unix_asset"}, |
| 191 | + "windows-amd64": {"$ref": "#/$defs/windows_asset"} |
| 192 | + }, |
| 193 | + "additionalProperties": false |
| 194 | + }, |
| 195 | + "asset": { |
| 196 | + "type": "object", |
| 197 | + "additionalProperties": false, |
| 198 | + "required": ["asset_name", "byte_size", "sha256", "download_url"], |
| 199 | + "properties": { |
| 200 | + "asset_name": {"type": "string", "minLength": 1, "pattern": "^[^/\\\\]+$"}, |
| 201 | + "byte_size": {"type": "integer", "minimum": 1}, |
| 202 | + "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, |
| 203 | + "download_url": { |
| 204 | + "type": "string", |
| 205 | + "pattern": "^https://[^?#]+/[^/?#]+$" |
| 206 | + } |
| 207 | + } |
| 208 | + }, |
| 209 | + "unix_asset": { |
| 210 | + "allOf": [ |
| 211 | + {"$ref": "#/$defs/asset"}, |
| 212 | + { |
| 213 | + "properties": { |
| 214 | + "asset_name": { |
| 215 | + "pattern": "^[a-z0-9-]+-(linux|darwin)-(amd64|arm64)$" |
| 216 | + } |
| 217 | + } |
| 218 | + } |
| 219 | + ] |
| 220 | + }, |
| 221 | + "windows_asset": { |
| 222 | + "allOf": [ |
| 223 | + {"$ref": "#/$defs/asset"}, |
| 224 | + { |
| 225 | + "properties": { |
| 226 | + "asset_name": { |
| 227 | + "pattern": "^[a-z0-9-]+-windows-amd64\\.exe$" |
| 228 | + } |
| 229 | + } |
| 230 | + } |
| 231 | + ] |
| 232 | + } |
| 233 | + } |
| 234 | +} |
0 commit comments