agent-json-validate 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/schema.json ADDED
@@ -0,0 +1,587 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentjson.org/schema/v1.1/agent.json",
4
+ "title": "agent.json",
5
+ "description": "Capability manifest for the agent internet. Declares what a service offers to AI agents, how to interact with it, and where to send payments.",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "origin",
10
+ "payout_address"
11
+ ],
12
+ "additionalProperties": false,
13
+ "patternProperties": {
14
+ "^x-": {}
15
+ },
16
+ "properties": {
17
+ "version": {
18
+ "type": "string",
19
+ "enum": ["1.0", "1.1"],
20
+ "description": "Manifest schema version."
21
+ },
22
+ "origin": {
23
+ "type": "string",
24
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$",
25
+ "description": "The domain this manifest represents. Must match the domain serving the file.",
26
+ "examples": [
27
+ "example.com",
28
+ "shop.example.com"
29
+ ]
30
+ },
31
+ "payout_address": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "description": "Wallet address for receiving payments. Currently USDC on Base L2.",
35
+ "examples": [
36
+ "0x0000000000000000000000000000000000000000"
37
+ ]
38
+ },
39
+ "display_name": {
40
+ "type": "string",
41
+ "maxLength": 100,
42
+ "description": "Human-readable service name."
43
+ },
44
+ "description": {
45
+ "type": "string",
46
+ "maxLength": 500,
47
+ "description": "Brief description of the service. Used for semantic discovery."
48
+ },
49
+ "extensions": {
50
+ "$ref": "#/$defs/Extensions",
51
+ "description": "Vendor-specific extension namespaces. Runtimes should ignore unknown namespaces."
52
+ },
53
+ "identity": {
54
+ "$ref": "#/$defs/Identity"
55
+ },
56
+ "intents": {
57
+ "type": "array",
58
+ "items": {
59
+ "$ref": "#/$defs/Intent"
60
+ },
61
+ "description": "Array of capabilities the service offers to agents."
62
+ },
63
+ "bounty": {
64
+ "$ref": "#/$defs/Bounty",
65
+ "description": "Default bounty the provider pays runtimes per intent completion. Acts as an advertisement to incentivize agent routing. Can be overridden per-intent."
66
+ },
67
+ "incentive": {
68
+ "$ref": "#/$defs/Incentive",
69
+ "description": "Default suggested incentive the provider requests from runtimes per intent completion. Runtimes decide independently whether to honor this. Can be overridden per-intent."
70
+ },
71
+ "x402": {
72
+ "$ref": "#/$defs/X402Root",
73
+ "description": "x402 payment discovery metadata. Declares that this provider supports x402 (HTTP 402) payment negotiation. Enables agents to discover payment capabilities before making a request."
74
+ }
75
+ },
76
+ "$defs": {
77
+ "Identity": {
78
+ "type": "object",
79
+ "description": "Provider identity metadata. Signing and verification behavior are not standardized in v1.0.",
80
+ "additionalProperties": false,
81
+ "patternProperties": {
82
+ "^x-": {}
83
+ },
84
+ "properties": {
85
+ "did": {
86
+ "type": "string",
87
+ "pattern": "^did:[a-z]+:.+$",
88
+ "description": "Decentralized Identifier.",
89
+ "examples": [
90
+ "did:web:example.com"
91
+ ]
92
+ },
93
+ "public_key": {
94
+ "type": "string",
95
+ "description": "Base64url-encoded public key material advertised by the provider."
96
+ }
97
+ }
98
+ },
99
+ "Intent": {
100
+ "type": "object",
101
+ "required": [
102
+ "name",
103
+ "description"
104
+ ],
105
+ "additionalProperties": false,
106
+ "patternProperties": {
107
+ "^x-": {}
108
+ },
109
+ "description": "A single capability the service offers to agents.",
110
+ "properties": {
111
+ "name": {
112
+ "type": "string",
113
+ "pattern": "^[a-z][a-z0-9_]*$",
114
+ "maxLength": 64,
115
+ "description": "Machine-readable identifier. Must be snake_case, unique within the manifest.",
116
+ "examples": [
117
+ "search_products",
118
+ "add_to_cart",
119
+ "complete_purchase",
120
+ "tip_checkout"
121
+ ]
122
+ },
123
+ "description": {
124
+ "type": "string",
125
+ "minLength": 10,
126
+ "maxLength": 500,
127
+ "description": "Natural-language description of the capability. Used for semantic matching — be specific."
128
+ },
129
+ "extensions": {
130
+ "$ref": "#/$defs/Extensions",
131
+ "description": "Vendor-specific extension namespaces for this intent. Runtimes should ignore unknown namespaces."
132
+ },
133
+ "endpoint": {
134
+ "type": "string",
135
+ "description": "API endpoint URL for direct execution. Absolute URL or path relative to origin. When present, the runtime calls this endpoint directly instead of web automation.",
136
+ "examples": [
137
+ "/api/checkout/tip",
138
+ "https://api.example.com/v1/search"
139
+ ]
140
+ },
141
+ "method": {
142
+ "type": "string",
143
+ "enum": [
144
+ "GET",
145
+ "POST",
146
+ "PUT",
147
+ "DELETE"
148
+ ],
149
+ "default": "POST",
150
+ "description": "HTTP method for the endpoint. Required when endpoint is present."
151
+ },
152
+ "parameters": {
153
+ "type": "object",
154
+ "additionalProperties": {
155
+ "$ref": "#/$defs/Parameter"
156
+ },
157
+ "description": "Map of parameter names to parameter definitions. For GET: query params. For POST/PUT: JSON body."
158
+ },
159
+ "returns": {
160
+ "$ref": "#/$defs/Returns",
161
+ "description": "Description of the response shape. Helps agents understand what to expect."
162
+ },
163
+ "price": {
164
+ "$ref": "#/$defs/Price",
165
+ "description": "What the provider charges to access this intent. When present, the runtime must arrange payment before or during execution."
166
+ },
167
+ "bounty": {
168
+ "$ref": "#/$defs/Bounty",
169
+ "description": "Per-intent bounty override. What the provider pays the runtime for completing this intent. Takes priority over manifest-level bounty."
170
+ },
171
+ "incentive": {
172
+ "$ref": "#/$defs/Incentive",
173
+ "description": "Per-intent incentive override. Suggested amount the provider requests the runtime pay for fulfilling this intent. Takes priority over manifest-level incentive."
174
+ },
175
+ "x402": {
176
+ "$ref": "#/$defs/X402Intent",
177
+ "description": "Per-intent x402 payment metadata. Overrides or extends root-level x402 configuration for this intent."
178
+ }
179
+ },
180
+ "allOf": [
181
+ {
182
+ "if": {
183
+ "required": [
184
+ "endpoint"
185
+ ]
186
+ },
187
+ "then": {
188
+ "required": [
189
+ "method"
190
+ ]
191
+ }
192
+ }
193
+ ]
194
+ },
195
+ "Extensions": {
196
+ "type": "object",
197
+ "description": "Open object for vendor-specific extension namespaces, e.g. `extensions.air`.",
198
+ "additionalProperties": true
199
+ },
200
+ "Returns": {
201
+ "type": "object",
202
+ "additionalProperties": false,
203
+ "patternProperties": {
204
+ "^x-": {}
205
+ },
206
+ "description": "Description of what an intent returns.",
207
+ "properties": {
208
+ "type": {
209
+ "type": "string",
210
+ "enum": [
211
+ "object",
212
+ "array",
213
+ "string"
214
+ ],
215
+ "description": "Top-level response type."
216
+ },
217
+ "description": {
218
+ "type": "string",
219
+ "maxLength": 200,
220
+ "description": "Human-readable description of the response."
221
+ },
222
+ "properties": {
223
+ "type": "object",
224
+ "additionalProperties": {
225
+ "type": "object",
226
+ "properties": {
227
+ "type": {
228
+ "type": "string"
229
+ },
230
+ "description": {
231
+ "type": "string"
232
+ }
233
+ }
234
+ },
235
+ "description": "For object type: map of property names to type and description."
236
+ }
237
+ }
238
+ },
239
+ "Parameter": {
240
+ "type": "object",
241
+ "required": [
242
+ "type"
243
+ ],
244
+ "additionalProperties": false,
245
+ "patternProperties": {
246
+ "^x-": {}
247
+ },
248
+ "description": "An input parameter for an intent.",
249
+ "properties": {
250
+ "type": {
251
+ "type": "string",
252
+ "enum": [
253
+ "string",
254
+ "integer",
255
+ "number",
256
+ "boolean",
257
+ "array",
258
+ "object"
259
+ ],
260
+ "description": "Data type of the parameter."
261
+ },
262
+ "required": {
263
+ "type": "boolean",
264
+ "default": false,
265
+ "description": "Whether this parameter is required."
266
+ },
267
+ "description": {
268
+ "type": "string",
269
+ "maxLength": 200,
270
+ "description": "Human-readable description of the parameter."
271
+ },
272
+ "enum": {
273
+ "type": "array",
274
+ "minItems": 1,
275
+ "description": "Exhaustive list of allowed values."
276
+ },
277
+ "default": {
278
+ "description": "Default value when not provided by the agent."
279
+ }
280
+ }
281
+ },
282
+ "Price": {
283
+ "type": "object",
284
+ "required": [
285
+ "amount",
286
+ "currency"
287
+ ],
288
+ "additionalProperties": false,
289
+ "patternProperties": {
290
+ "^x-": {}
291
+ },
292
+ "description": "What the provider charges to access an intent.",
293
+ "properties": {
294
+ "amount": {
295
+ "type": "number",
296
+ "minimum": 0,
297
+ "description": "Cost per call (or per unit) in the specified currency."
298
+ },
299
+ "currency": {
300
+ "type": "string",
301
+ "enum": [
302
+ "USD",
303
+ "USDC"
304
+ ],
305
+ "description": "Pricing currency. USD for fiat, USDC for on-chain."
306
+ },
307
+ "model": {
308
+ "type": "string",
309
+ "enum": [
310
+ "per_call",
311
+ "per_unit",
312
+ "flat"
313
+ ],
314
+ "default": "per_call",
315
+ "description": "Pricing model. per_call (default), per_unit (amount × parameter value), or flat (one-time)."
316
+ },
317
+ "unit_param": {
318
+ "type": "string",
319
+ "description": "For per_unit model: which parameter determines the unit count."
320
+ },
321
+ "free_tier": {
322
+ "type": "integer",
323
+ "minimum": 0,
324
+ "description": "Number of free calls before pricing applies."
325
+ },
326
+ "network": {
327
+ "oneOf": [
328
+ {
329
+ "type": "string"
330
+ },
331
+ {
332
+ "type": "array",
333
+ "items": {
334
+ "type": "string"
335
+ },
336
+ "minItems": 1
337
+ }
338
+ ],
339
+ "description": "Settlement network(s) for on-chain currencies. A single string or array of strings. Examples: \"base\", \"ethereum\", \"arbitrum\", \"optimism\", \"polygon\". Omit for fiat currencies.",
340
+ "examples": [
341
+ "base",
342
+ ["base", "arbitrum", "optimism"]
343
+ ]
344
+ }
345
+ }
346
+ },
347
+ "X402Root": {
348
+ "type": "object",
349
+ "required": [
350
+ "supported"
351
+ ],
352
+ "additionalProperties": false,
353
+ "patternProperties": {
354
+ "^x-": {}
355
+ },
356
+ "description": "Root-level x402 payment discovery metadata. Declares that this provider supports x402 (HTTP 402) payment negotiation. Use flat fields (network, asset, contract, facilitator) for single-network providers, or the networks array for multi-network support. If networks is present, flat network/asset/contract/facilitator fields are ignored.",
357
+ "properties": {
358
+ "supported": {
359
+ "type": "boolean",
360
+ "description": "Whether the provider accepts x402 payment proofs."
361
+ },
362
+ "network": {
363
+ "type": "string",
364
+ "description": "Settlement network for single-network providers. Ignored when networks array is present. Examples: \"base\", \"ethereum\"."
365
+ },
366
+ "asset": {
367
+ "type": "string",
368
+ "description": "Payment asset for single-network providers. Ignored when networks array is present. Examples: \"USDC\", \"ETH\"."
369
+ },
370
+ "contract": {
371
+ "type": "string",
372
+ "description": "Token contract address for ERC-20 assets. Required for non-native assets in single-network mode. Ignored when networks array is present."
373
+ },
374
+ "facilitator": {
375
+ "type": "string",
376
+ "format": "uri",
377
+ "description": "URL of the x402 facilitator service for payment verification. Used in single-network mode. Ignored when networks array is present."
378
+ },
379
+ "recipient": {
380
+ "type": "string",
381
+ "description": "Recipient address for x402 payments. Defaults to the manifest's payout_address if omitted."
382
+ },
383
+ "networks": {
384
+ "type": "array",
385
+ "items": {
386
+ "$ref": "#/$defs/X402NetworkConfig"
387
+ },
388
+ "minItems": 1,
389
+ "description": "Multi-network x402 configuration. Each entry declares settlement details for one blockchain network. When present, flat fields (network, asset, contract, facilitator) are ignored."
390
+ }
391
+ }
392
+ },
393
+ "X402NetworkConfig": {
394
+ "type": "object",
395
+ "required": [
396
+ "network",
397
+ "asset"
398
+ ],
399
+ "additionalProperties": false,
400
+ "patternProperties": {
401
+ "^x-": {}
402
+ },
403
+ "description": "x402 settlement configuration for a single blockchain network.",
404
+ "properties": {
405
+ "network": {
406
+ "type": "string",
407
+ "description": "Blockchain network identifier. Examples: \"base\", \"ethereum\", \"arbitrum\", \"optimism\", \"polygon\"."
408
+ },
409
+ "asset": {
410
+ "type": "string",
411
+ "description": "Payment asset accepted on this network. Examples: \"USDC\", \"ETH\"."
412
+ },
413
+ "contract": {
414
+ "type": "string",
415
+ "description": "Token contract address for ERC-20 assets on this network. Required for non-native assets."
416
+ },
417
+ "facilitator": {
418
+ "type": "string",
419
+ "format": "uri",
420
+ "description": "URL of the x402 facilitator service for payment verification on this network."
421
+ }
422
+ }
423
+ },
424
+ "X402Intent": {
425
+ "type": "object",
426
+ "additionalProperties": false,
427
+ "patternProperties": {
428
+ "^x-": {}
429
+ },
430
+ "description": "Per-intent x402 payment metadata. Overrides or extends root-level x402 configuration for this specific intent.",
431
+ "properties": {
432
+ "supported": {
433
+ "type": "boolean",
434
+ "description": "Override the root-level supported flag for this intent."
435
+ },
436
+ "direct_price": {
437
+ "type": "number",
438
+ "minimum": 0,
439
+ "description": "Price per request when paying directly via x402 (no session ticket). Applies to all networks unless overridden by network_pricing."
440
+ },
441
+ "ticket_price": {
442
+ "type": "number",
443
+ "minimum": 0,
444
+ "description": "Discounted price per request when using a prepaid session ticket. Applies to all networks unless overridden by network_pricing."
445
+ },
446
+ "description": {
447
+ "type": "string",
448
+ "description": "Human-readable explanation of x402 pricing for this intent."
449
+ },
450
+ "network_pricing": {
451
+ "type": "array",
452
+ "items": {
453
+ "$ref": "#/$defs/X402NetworkPricing"
454
+ },
455
+ "minItems": 1,
456
+ "description": "Per-network price overrides. Only needed when costs genuinely differ across chains. Entries override the top-level direct_price/ticket_price for the specified network."
457
+ }
458
+ }
459
+ },
460
+ "X402NetworkPricing": {
461
+ "type": "object",
462
+ "required": [
463
+ "network"
464
+ ],
465
+ "additionalProperties": false,
466
+ "patternProperties": {
467
+ "^x-": {}
468
+ },
469
+ "description": "Per-network x402 pricing override for an intent.",
470
+ "properties": {
471
+ "network": {
472
+ "type": "string",
473
+ "description": "Blockchain network this pricing applies to. Must match a network declared in the root x402 configuration."
474
+ },
475
+ "direct_price": {
476
+ "type": "number",
477
+ "minimum": 0,
478
+ "description": "Network-specific price per request when paying directly via x402."
479
+ },
480
+ "ticket_price": {
481
+ "type": "number",
482
+ "minimum": 0,
483
+ "description": "Network-specific discounted price per request when using a prepaid session ticket."
484
+ }
485
+ }
486
+ },
487
+ "Bounty": {
488
+ "type": "object",
489
+ "required": [
490
+ "type",
491
+ "rate",
492
+ "currency"
493
+ ],
494
+ "additionalProperties": false,
495
+ "patternProperties": {
496
+ "^x-": {}
497
+ },
498
+ "description": "What the provider pays the runtime per successful intent completion. Acts as an advertisement to incentivize agent traffic routing.",
499
+ "properties": {
500
+ "type": {
501
+ "type": "string",
502
+ "enum": [
503
+ "cpa"
504
+ ],
505
+ "description": "Bounty model. Currently only 'cpa' (cost per action)."
506
+ },
507
+ "rate": {
508
+ "type": "number",
509
+ "minimum": 0,
510
+ "description": "Amount the provider pays per successful completion."
511
+ },
512
+ "currency": {
513
+ "type": "string",
514
+ "enum": [
515
+ "USDC"
516
+ ],
517
+ "description": "Payment currency."
518
+ },
519
+ "splits": {
520
+ "$ref": "#/$defs/Splits"
521
+ }
522
+ }
523
+ },
524
+ "Incentive": {
525
+ "type": "object",
526
+ "required": [
527
+ "type",
528
+ "rate",
529
+ "currency"
530
+ ],
531
+ "additionalProperties": false,
532
+ "patternProperties": {
533
+ "^x-": {}
534
+ },
535
+ "description": "Suggested amount the provider requests runtimes pay per successful intent fulfillment. Purely opt-in — runtimes decide independently whether and how much to honor.",
536
+ "properties": {
537
+ "type": {
538
+ "type": "string",
539
+ "enum": [
540
+ "cpa"
541
+ ],
542
+ "description": "Incentive model. Currently only 'cpa' (cost per action)."
543
+ },
544
+ "rate": {
545
+ "type": "number",
546
+ "minimum": 0,
547
+ "description": "Suggested incentive amount per successful fulfillment."
548
+ },
549
+ "currency": {
550
+ "type": "string",
551
+ "enum": [
552
+ "USDC"
553
+ ],
554
+ "description": "Incentive currency."
555
+ }
556
+ }
557
+ },
558
+ "Splits": {
559
+ "type": "object",
560
+ "additionalProperties": false,
561
+ "patternProperties": {
562
+ "^x-": {}
563
+ },
564
+ "description": "Distribution of the bounty payout among runtime parties. All values must sum to 1.0.",
565
+ "properties": {
566
+ "orchestrator": {
567
+ "type": "number",
568
+ "minimum": 0,
569
+ "maximum": 1,
570
+ "description": "Executing agent's share of the bounty."
571
+ },
572
+ "platform": {
573
+ "type": "number",
574
+ "minimum": 0,
575
+ "maximum": 1,
576
+ "description": "Protocol or marketplace fee."
577
+ },
578
+ "referrer": {
579
+ "type": "number",
580
+ "minimum": 0,
581
+ "maximum": 1,
582
+ "description": "Referring agent or discovery layer share."
583
+ }
584
+ }
585
+ }
586
+ }
587
+ }