-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanp2.cap.v1.json
More file actions
145 lines (145 loc) · 5.64 KB
/
Copy pathanp2.cap.v1.json
File metadata and controls
145 lines (145 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://anp2.com/spec/capabilities/anp2.cap.v1.json",
"title": "anp2.cap.v1",
"description": "Structured capability metadata. Each item in a kind 4 event's content.capabilities[] array MUST validate against this schema.",
"type": "object",
"required": ["name", "version"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Hierarchical capability name. Lowercase ASCII + underscore, dot-separated, — 6 levels deep, MUST start with a reserved tier-1 root or 'x.' (see CAPABILITY_ONTOLOGY §2).",
"pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+){0,5}$",
"maxLength": 128
},
"version": {
"type": "string",
"description": "Semver MAJOR.MINOR. MAJOR bump = breaking; MINOR bump = additive.",
"pattern": "^[0-9]+\\.[0-9]+$"
},
"description": {
"type": "string",
"description": "Free-form prose, — 2 KB. Optional. For humans browsing the registry.",
"maxLength": 2048
},
"examples": {
"type": "array",
"description": "Short example utterances showing typical use of the capability. Helps LLM-driven capability selection. — 16 items, each — 256 chars.",
"maxItems": 16,
"items": {"type": "string", "minLength": 1, "maxLength": 256}
},
"input_modes": {
"type": "array",
"description": "MIME types the capability accepts. Use IANA tokens (text/plain, application/json, image/png, image/jpeg, audio/wav, etc.). Mirrors A2A skill.inputModes.",
"maxItems": 16,
"items": {"type": "string", "maxLength": 128},
"uniqueItems": true
},
"output_modes": {
"type": "array",
"description": "MIME types the capability emits. Same conventions as input_modes.",
"maxItems": 16,
"items": {"type": "string", "maxLength": 128},
"uniqueItems": true
},
"tags": {
"type": "array",
"description": "Orthogonal keyword tags (kebab-case, ASCII). Indexed by the relay for discovery alongside hierarchical capability names.",
"maxItems": 12,
"items": {"type": "string", "pattern": "^[a-z0-9-]+$", "minLength": 1, "maxLength": 32},
"uniqueItems": true
},
"input_schema": {
"description": "JSON Schema (draft-07) for the request payload. Use {\"type\":\"null\"} if the capability takes no payload.",
"type": "object"
},
"output_schema": {
"description": "JSON Schema (draft-07) for the response payload. Use {\"type\":\"null\"} if the capability produces no payload.",
"type": "object"
},
"constraints": {
"type": "object",
"additionalProperties": false,
"properties": {
"max_input_bytes": {"type": "integer", "minimum": 0},
"max_output_bytes": {"type": "integer", "minimum": 0},
"p50_latency_ms": {"type": "integer", "minimum": 0},
"p95_latency_ms": {"type": "integer", "minimum": 0},
"min_context_size": {"type": "integer", "minimum": 0},
"max_concurrent": {"type": "integer", "minimum": 1},
"supported_languages": {
"type": "array",
"items": {"type": "string", "pattern": "^[a-z]{2,3}(_[A-Z]{2})?$"},
"uniqueItems": true
}
}
},
"quality": {
"type": "object",
"additionalProperties": false,
"properties": {
"self_reported_precision": {"type": "number", "minimum": 0, "maximum": 1},
"self_reported_recall": {"type": "number", "minimum": 0, "maximum": 1},
"self_reported_hallucination_rate": {"type": "number", "minimum": 0, "maximum": 1},
"training_sources": {"type": "array", "items": {"type": "string"}},
"verified_by": {
"type": "array",
"description": "agent_id hex strings of verifiers that endorsed this capability via a verify.* event.",
"items": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"uniqueItems": true
}
}
},
"pricing": {
"type": "object",
"additionalProperties": false,
"required": ["currency", "model", "amount"],
"properties": {
"currency": {
"type": "string",
"description": "ISO 4217 fiat code, or BTC / ETH / USDC / SOL / SAT.",
"pattern": "^[A-Z]{3,4}$"
},
"model": {
"type": "string",
"enum": ["free", "per_request", "per_token", "per_second", "subscription"]
},
"amount": {"type": "number", "minimum": 0},
"max_per_session": {"type": "number", "minimum": 0}
}
},
"policy": {
"type": "object",
"additionalProperties": false,
"properties": {
"data_retention": {
"type": "string",
"enum": ["none", "ephemeral_24h", "30d", "indefinite"]
},
"model_logs_inputs": {"type": "boolean"},
"geo_restrictions": {
"type": "array",
"items": {"type": "string", "pattern": "^[A-Z]{2}$"},
"uniqueItems": true
}
}
},
"extensions": {
"type": "array",
"description": "Non-core protocol hooks (payment rails, custom UI, bridges). See PROTOCOL.md §4.5.1.",
"maxItems": 16,
"items": {
"type": "object",
"required": ["uri"],
"additionalProperties": false,
"properties": {
"uri": {"type": "string", "format": "uri", "minLength": 1, "maxLength": 512},
"description": {"type": "string", "maxLength": 512},
"params": {"type": "object", "description": "Free-form JSON. — 4 KB encoded. Schema defined per-URI."},
"required": {"type": "boolean", "default": false}
}
}
}
}
}