|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "https://pactspec.dev/schema/v1.json", |
| 4 | + "title": "PactSpec v1", |
| 5 | + "description": "Machine-readable capability declaration for AI agents. Defines what an agent does, how to call it, what it costs, and how to test it. See https://pactspec.dev/spec for documentation.", |
| 6 | + "type": "object", |
| 7 | + "required": [ |
| 8 | + "specVersion", |
| 9 | + "id", |
| 10 | + "name", |
| 11 | + "version", |
| 12 | + "provider", |
| 13 | + "endpoint", |
| 14 | + "skills" |
| 15 | + ], |
| 16 | + "properties": { |
| 17 | + "specVersion": { |
| 18 | + "type": "string", |
| 19 | + "const": "1.0.0", |
| 20 | + "description": "PactSpec schema version. Always \"1.0.0\" for v1 specs." |
| 21 | + }, |
| 22 | + "id": { |
| 23 | + "type": "string", |
| 24 | + "pattern": "^urn:pactspec:[a-z0-9-]+:[a-z0-9-]+$", |
| 25 | + "description": "Unique URN identifier, e.g. urn:pactspec:acme:invoice-processor" |
| 26 | + }, |
| 27 | + "name": { |
| 28 | + "type": "string", |
| 29 | + "minLength": 1, |
| 30 | + "maxLength": 100, |
| 31 | + "description": "Human-readable agent name." |
| 32 | + }, |
| 33 | + "version": { |
| 34 | + "type": "string", |
| 35 | + "pattern": "^\\d+\\.\\d+\\.\\d+$", |
| 36 | + "description": "Semantic version of this agent, e.g. \"1.2.0\"." |
| 37 | + }, |
| 38 | + "description": { |
| 39 | + "type": "string", |
| 40 | + "maxLength": 500, |
| 41 | + "description": "What this agent does." |
| 42 | + }, |
| 43 | + "provider": { |
| 44 | + "type": "object", |
| 45 | + "description": "Who operates this agent.", |
| 46 | + "required": ["name"], |
| 47 | + "properties": { |
| 48 | + "name": { |
| 49 | + "type": "string", |
| 50 | + "description": "Organization or individual name." |
| 51 | + }, |
| 52 | + "url": { |
| 53 | + "type": "string", |
| 54 | + "format": "uri", |
| 55 | + "description": "Provider's website." |
| 56 | + }, |
| 57 | + "contact": { |
| 58 | + "type": "string", |
| 59 | + "format": "email", |
| 60 | + "description": "Contact email." |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + "endpoint": { |
| 65 | + "type": "object", |
| 66 | + "description": "Where to call this agent.", |
| 67 | + "required": ["url"], |
| 68 | + "properties": { |
| 69 | + "url": { |
| 70 | + "type": "string", |
| 71 | + "format": "uri", |
| 72 | + "description": "Agent endpoint URL." |
| 73 | + }, |
| 74 | + "auth": { |
| 75 | + "type": "object", |
| 76 | + "description": "Authentication configuration.", |
| 77 | + "properties": { |
| 78 | + "type": { |
| 79 | + "type": "string", |
| 80 | + "enum": ["none", "bearer", "x-agent-id", "header"], |
| 81 | + "description": "Authentication method." |
| 82 | + }, |
| 83 | + "header": { |
| 84 | + "type": "string", |
| 85 | + "description": "Custom header name when type is \"header\"." |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + }, |
| 91 | + "skills": { |
| 92 | + "type": "array", |
| 93 | + "minItems": 1, |
| 94 | + "description": "Capabilities this agent provides. Each skill has typed input/output schemas.", |
| 95 | + "items": { |
| 96 | + "type": "object", |
| 97 | + "required": [ |
| 98 | + "id", |
| 99 | + "name", |
| 100 | + "description", |
| 101 | + "inputSchema", |
| 102 | + "outputSchema" |
| 103 | + ], |
| 104 | + "properties": { |
| 105 | + "id": { |
| 106 | + "type": "string", |
| 107 | + "pattern": "^[a-z0-9-]+$", |
| 108 | + "description": "Skill identifier (lowercase, hyphens allowed)." |
| 109 | + }, |
| 110 | + "name": { |
| 111 | + "type": "string", |
| 112 | + "description": "Human-readable skill name." |
| 113 | + }, |
| 114 | + "description": { |
| 115 | + "type": "string", |
| 116 | + "description": "What this skill does." |
| 117 | + }, |
| 118 | + "tags": { |
| 119 | + "type": "array", |
| 120 | + "items": { "type": "string" }, |
| 121 | + "description": "Searchable tags." |
| 122 | + }, |
| 123 | + "inputSchema": { |
| 124 | + "type": "object", |
| 125 | + "description": "JSON Schema for the skill's input." |
| 126 | + }, |
| 127 | + "outputSchema": { |
| 128 | + "type": "object", |
| 129 | + "description": "JSON Schema for the skill's output." |
| 130 | + }, |
| 131 | + "examples": { |
| 132 | + "type": "array", |
| 133 | + "description": "Example input/output pairs.", |
| 134 | + "items": { |
| 135 | + "type": "object", |
| 136 | + "required": ["input", "expectedOutput"], |
| 137 | + "properties": { |
| 138 | + "description": { "type": "string" }, |
| 139 | + "input": { "description": "Example input value." }, |
| 140 | + "expectedOutput": { |
| 141 | + "description": "Expected output for the example input." |
| 142 | + } |
| 143 | + } |
| 144 | + } |
| 145 | + }, |
| 146 | + "pricing": { |
| 147 | + "type": "object", |
| 148 | + "description": "What this skill costs per invocation.", |
| 149 | + "required": ["model", "amount", "currency"], |
| 150 | + "properties": { |
| 151 | + "model": { |
| 152 | + "type": "string", |
| 153 | + "enum": ["per-invocation", "per-token", "per-second", "free"], |
| 154 | + "description": "Billing model." |
| 155 | + }, |
| 156 | + "amount": { |
| 157 | + "type": "number", |
| 158 | + "minimum": 0, |
| 159 | + "description": "Price per unit." |
| 160 | + }, |
| 161 | + "currency": { |
| 162 | + "type": "string", |
| 163 | + "enum": ["USD", "USDC", "SOL"], |
| 164 | + "description": "Currency." |
| 165 | + }, |
| 166 | + "protocol": { |
| 167 | + "type": "string", |
| 168 | + "enum": ["x402", "stripe", "none"], |
| 169 | + "description": "Payment protocol." |
| 170 | + } |
| 171 | + } |
| 172 | + }, |
| 173 | + "testSuite": { |
| 174 | + "type": "object", |
| 175 | + "description": "URL to a test suite that can be run against the live endpoint.", |
| 176 | + "required": ["url"], |
| 177 | + "properties": { |
| 178 | + "url": { |
| 179 | + "type": "string", |
| 180 | + "format": "uri", |
| 181 | + "description": "Test suite URL." |
| 182 | + }, |
| 183 | + "type": { |
| 184 | + "type": "string", |
| 185 | + "enum": ["http-roundtrip", "json-schema-validation"], |
| 186 | + "description": "Test format." |
| 187 | + } |
| 188 | + } |
| 189 | + } |
| 190 | + } |
| 191 | + } |
| 192 | + }, |
| 193 | + "tags": { |
| 194 | + "type": "array", |
| 195 | + "items": { "type": "string" }, |
| 196 | + "description": "Searchable tags for the agent." |
| 197 | + }, |
| 198 | + "license": { "type": "string", "description": "SPDX license identifier." }, |
| 199 | + "links": { |
| 200 | + "type": "object", |
| 201 | + "description": "Related links.", |
| 202 | + "properties": { |
| 203 | + "documentation": { |
| 204 | + "type": "string", |
| 205 | + "format": "uri", |
| 206 | + "description": "Documentation URL." |
| 207 | + }, |
| 208 | + "repository": { |
| 209 | + "type": "string", |
| 210 | + "format": "uri", |
| 211 | + "description": "Source code repository." |
| 212 | + } |
| 213 | + } |
| 214 | + }, |
| 215 | + "delegation": { |
| 216 | + "type": "object", |
| 217 | + "description": "If this agent wraps another agent.", |
| 218 | + "properties": { |
| 219 | + "delegatedFrom": { |
| 220 | + "type": "string", |
| 221 | + "description": "Spec ID of the upstream agent being wrapped." |
| 222 | + }, |
| 223 | + "terms": { |
| 224 | + "type": "string", |
| 225 | + "format": "uri", |
| 226 | + "description": "URL to delegation agreement." |
| 227 | + } |
| 228 | + } |
| 229 | + }, |
| 230 | + "interop": { |
| 231 | + "type": "object", |
| 232 | + "description": "Interoperability with other protocols.", |
| 233 | + "properties": { |
| 234 | + "mcp": { |
| 235 | + "type": "object", |
| 236 | + "properties": { |
| 237 | + "serverUrl": { |
| 238 | + "type": "string", |
| 239 | + "format": "uri", |
| 240 | + "description": "MCP server endpoint." |
| 241 | + }, |
| 242 | + "tools": { |
| 243 | + "type": "array", |
| 244 | + "items": { "type": "string" }, |
| 245 | + "description": "MCP tool names." |
| 246 | + } |
| 247 | + } |
| 248 | + }, |
| 249 | + "openapi": { |
| 250 | + "type": "object", |
| 251 | + "properties": { |
| 252 | + "specUrl": { |
| 253 | + "type": "string", |
| 254 | + "format": "uri", |
| 255 | + "description": "OpenAPI spec URL." |
| 256 | + } |
| 257 | + } |
| 258 | + }, |
| 259 | + "acp": { |
| 260 | + "type": "object", |
| 261 | + "properties": { |
| 262 | + "supported": { |
| 263 | + "type": "boolean", |
| 264 | + "description": "Whether ACP sessions are supported." |
| 265 | + }, |
| 266 | + "sessionTypes": { |
| 267 | + "type": "array", |
| 268 | + "items": { "type": "string" }, |
| 269 | + "description": "Supported session types." |
| 270 | + } |
| 271 | + } |
| 272 | + } |
| 273 | + } |
| 274 | + } |
| 275 | + } |
| 276 | +} |
0 commit comments