|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://schemas.logicsrc.com/agentad-ad.schema.json", |
| 4 | + "title": "AgentAd Ad", |
| 5 | + "description": "A single advertising unit served to CLI tools and AI agents. Ads MUST be disclosed and SHOULD carry a machine-readable payload so agents can reason about them.", |
| 6 | + "type": "object", |
| 7 | + "required": ["type", "version", "id", "advertiser_did", "format", "title", "url", "disclosure"], |
| 8 | + "additionalProperties": false, |
| 9 | + "properties": { |
| 10 | + "type": { "const": "agentad.ad" }, |
| 11 | + "version": { "type": "string", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$" }, |
| 12 | + "id": { "$ref": "#/$defs/id" }, |
| 13 | + "campaign_id": { "$ref": "#/$defs/id" }, |
| 14 | + "advertiser_did": { "$ref": "#/$defs/did" }, |
| 15 | + "format": { |
| 16 | + "type": "string", |
| 17 | + "enum": ["text", "markdown", "ansi", "banner", "json"], |
| 18 | + "description": "Render format. 'json' is the agent-native structured format; 'ansi'/'banner' target human CLI surfaces." |
| 19 | + }, |
| 20 | + "title": { "type": "string", "minLength": 1, "maxLength": 120 }, |
| 21 | + "body": { "type": "string", "maxLength": 2000 }, |
| 22 | + "url": { "type": "string", "format": "uri" }, |
| 23 | + "cta": { "type": "string", "maxLength": 60, "description": "Call to action label, e.g. 'Install' or 'Read docs'." }, |
| 24 | + "disclosure": { |
| 25 | + "type": "object", |
| 26 | + "description": "Transparency contract. Every ad is labeled as sponsored so humans and agents can distinguish it from organic output.", |
| 27 | + "required": ["sponsored", "label"], |
| 28 | + "additionalProperties": false, |
| 29 | + "properties": { |
| 30 | + "sponsored": { "const": true }, |
| 31 | + "label": { "type": "string", "minLength": 1, "maxLength": 40, "default": "Sponsored" }, |
| 32 | + "advertiser_name": { "type": "string", "maxLength": 120 } |
| 33 | + } |
| 34 | + }, |
| 35 | + "machine_readable": { |
| 36 | + "type": "object", |
| 37 | + "description": "Optional structured payload an agent can parse instead of (or alongside) the rendered text.", |
| 38 | + "additionalProperties": true |
| 39 | + }, |
| 40 | + "targeting": { "$ref": "#/$defs/targeting" }, |
| 41 | + "media": { |
| 42 | + "type": "object", |
| 43 | + "additionalProperties": false, |
| 44 | + "properties": { |
| 45 | + "ansi_art": { "type": "string", "description": "Pre-rendered ANSI/ASCII art for banner format." }, |
| 46 | + "icon": { "type": "string", "format": "uri" } |
| 47 | + } |
| 48 | + }, |
| 49 | + "pricing": { |
| 50 | + "type": "object", |
| 51 | + "additionalProperties": false, |
| 52 | + "properties": { |
| 53 | + "model": { "type": "string", "enum": ["cpm", "cpc", "cpa", "flat"] }, |
| 54 | + "bid": { "type": "number", "minimum": 0 }, |
| 55 | + "currency": { "type": "string", "minLength": 2, "maxLength": 12 } |
| 56 | + } |
| 57 | + }, |
| 58 | + "expires_at": { "type": "string", "format": "date-time" } |
| 59 | + }, |
| 60 | + "$defs": { |
| 61 | + "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "minLength": 1, "maxLength": 64 }, |
| 62 | + "did": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]*\\.[a-z0-9][a-z0-9._-]*$" }, |
| 63 | + "targeting": { |
| 64 | + "type": "object", |
| 65 | + "additionalProperties": false, |
| 66 | + "properties": { |
| 67 | + "surfaces": { |
| 68 | + "type": "array", |
| 69 | + "items": { "type": "string", "enum": ["cli", "tui", "agent", "ci"] }, |
| 70 | + "uniqueItems": true |
| 71 | + }, |
| 72 | + "keywords": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, |
| 73 | + "tools": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true, "description": "Host CLI/agent identifiers to target, e.g. 'claude-code', 'gh'." }, |
| 74 | + "languages": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, |
| 75 | + "exclude_keywords": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | +} |
0 commit comments