Commit dfec179
feat: add V3 protocol support (Governance, Content Standards, SI, CLI) (#117)
* feat: add V3 protocol support (Governance, Content Standards, SI, CLI)
Add comprehensive V3 ADCP protocol support including:
Server Framework:
- Add GovernanceHandler for property list management
- Add ContentStandardsHandler for content calibration
- Add SponsoredIntelligenceHandler for conversational AI sponsorship
- Add governance method stubs to all protocol handlers
- Add MCP tool definitions for all V3 operations
Client:
- Add typed client methods for all V3 operations
- Export all V3 types from adcp.types
Protocol Adapters:
- Add governance methods to protocol base class
- Add governance implementations to MCP and A2A adapters
CLI:
- Add all V3 operations to command-line client:
- Protocol Discovery: get_adcp_capabilities
- Content Standards: 7 operations
- Sponsored Intelligence: 4 operations
- Governance: 5 operations
Types:
- Sync schemas with ADCP 2.6+ spec
- Generate types for V3 domains
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: resolve ruff linting errors
- Fix import block sorting (I001) across multiple files
- Remove unused import ContentStandards from content_standards.py
- Update Callable import to collections.abc in mcp_tools.py
- Fix line length (E501) in server/base.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: sync with ADCP 2.6 schema changes
- Sync schemas from upstream adcontextprotocol.org
- Consolidate pricing options (CpmAuction/CpmFixed -> CpmPricingOption, VcpmAuction/VcpmFixed -> VcpmPricingOption)
- Consolidate PreviewRender (UrlPreviewRender/HtmlPreviewRender/BothPreviewRender -> unified PreviewRender)
- Update type exports and aliases for backwards compatibility
- Fix preview_cache.py to work with unified PreviewRender (no longer RootModel)
- Update tests to reflect schema changes
BREAKING CHANGE: CpmAuctionPricingOption, CpmFixedRatePricingOption, VcpmAuctionPricingOption, VcpmFixedRatePricingOption have been consolidated into CpmPricingOption and VcpmPricingOption respectively.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: resolve ruff import sorting error in _ergonomic.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: sync schemas with upstream and fix type generation
- Fix generate_types.py to convert absolute /schemas/latest/ $ref paths
to relative paths for proper schema resolution
- Sync all schemas from upstream (ADCP package 2.6)
- PreviewRender is now a discriminated union by output_format:
- PreviewRender1 (output_format='url') with preview_url
- PreviewRender2 (output_format='html') with preview_html
- PreviewRender3 (output_format='both') with both
- Update aliases: UrlPreviewRender, HtmlPreviewRender, BothPreviewRender
now point to their respective variant types
- Fix preview_cache.py to access RootModel.root for PreviewRender
- Update tests for discriminated union types
This fixes the "Validate schemas are up-to-date" CI failure.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: support authoritative_location redirects in fetch_adagents
- Implements authoritative_location redirect following per AdCP spec
- When adagents.json contains authoritative_location instead of
authorized_agents, fetches the referenced URL for actual data
- Includes loop detection and max depth limit (5) for security
- Validates HTTPS requirement for authoritative_location URLs
- Tests for happy path, HTTPS validation, loop detection, max depth
Cherry-picked from PR #118 (bokelley/issue-114)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address PR review feedback for V3 migration
Handler Method Signatures:
- Refactored GovernanceHandler, ContentStandardsHandler, and
SponsoredIntelligenceHandler to fix Liskov Substitution Principle violation
- Public methods now accept params: dict[str, Any] matching base class
- Added Pydantic validation with proper error responses
- Abstract handle_* methods accept typed requests for type safety
CLI Dispatch Table:
- Replaced mutable global TOOL_DISPATCH with cached _get_dispatch_table()
- Fails fast with clear error message if types can't be imported
- Eliminates late import error surprises
Version Interop Tests:
- Added test_version_interop.py to verify V3/V2 compatibility
- Tests V3-only tools are in dispatch table
- Tests V2 core tools remain available
- Tests base handler returns 'not supported' for unimplemented V3 methods
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: rename summary() to model_summary() to avoid field collision
The generated POC types have `summary` fields that conflicted with
the AdCPBaseModel.summary() method, causing mypy errors. Renamed
to model_summary() to follow Pydantic's naming convention
(model_dump, model_dump_json, etc.) and avoid the collision.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add tests documenting version negotiation design
Version negotiation is intentionally delegated to consumers. The SDK
provides primitives (get_adcp_capabilities, TaskResult wrapping), not
policy. Added TestVersionNegotiationDesign class with tests that serve
as executable documentation for:
- TaskResult error wrapping pattern
- Capabilities response structure
- Recommended version detection pattern
- Recommended feature detection pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update pricing option examples to current schema format
Updated test fixtures and documentation examples from deprecated format:
{"model": "cpm_fixed_rate", "is_fixed": true, "cpm": 5.50}
To current unified CpmPricingOption schema format:
{
"pricing_model": "cpm",
"pricing_option_id": "po-1",
"currency": "USD",
"fixed_price": 5.50
}
The old format used separate types with is_fixed discriminator.
The new schema uses optional fixed_price/floor_price fields to
distinguish fixed vs auction pricing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: upgrade to ADCP 3.0.0-beta.1 schemas
- Update ADCP_VERSION from 'latest' to '3.0.0-beta.1'
- Sync schemas from https://adcontextprotocol.org/schemas/3.0.0-beta.1/
- Update generate_types.py to handle versioned schema paths
(previously only handled /schemas/latest/, now handles /schemas/<version>/)
- Regenerate Pydantic models from new schemas
- All 518 tests pass
- mypy passes with no issues
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* style: fix import sorting in _ergonomic.py
Reorder imports to satisfy ruff I001 (isort) rules.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci: skip schema sync for pre-release versions
Pre-release schema versions (alpha, beta, rc) may not be publicly
accessible from CI environments. Skip the download/sync steps for
these versions and rely on committed schemas instead.
Validation steps (syntax check, import test, code generation tests)
still run to ensure the committed schemas work correctly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5eca428 commit dfec179
471 files changed
Lines changed: 16076 additions & 3914 deletions
File tree
- .github/workflows
- docs
- examples
- schemas/cache
- content-standards
- core
- assets
- creative
- asset-types
- enums
- extensions
- media-buy
- pricing-options
- property
- protocols
- protocol
- signals
- sponsored-intelligence
- scripts
- src/adcp
- protocols
- server
- types
- generated_poc
- content_standards
- core
- assets
- creative
- enums
- extensions
- media_buy
- pricing_options
- property
- protocols
- protocol
- signals
- sponsored_intelligence
- utils
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
109 | 123 | | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
| 128 | + | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| 132 | + | |
116 | 133 | | |
117 | 134 | | |
118 | 135 | | |
| |||
132 | 149 | | |
133 | 150 | | |
134 | 151 | | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
185 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
| |||
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
210 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
| |||
412 | 422 | | |
413 | 423 | | |
414 | 424 | | |
415 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
416 | 433 | | |
417 | 434 | | |
418 | 435 | | |
| |||
510 | 527 | | |
511 | 528 | | |
512 | 529 | | |
513 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
514 | 538 | | |
515 | 539 | | |
516 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
| |||
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
224 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
225 | 233 | | |
226 | 234 | | |
227 | 235 | | |
| |||
410 | 418 | | |
411 | 419 | | |
412 | 420 | | |
413 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
414 | 427 | | |
415 | 428 | | |
416 | 429 | | |
| |||
440 | 453 | | |
441 | 454 | | |
442 | 455 | | |
443 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
444 | 462 | | |
445 | 463 | | |
446 | 464 | | |
| |||
0 commit comments