Skip to content

Commit 58e0d24

Browse files
bokelleyclaude
andauthored
feat: sync AdCP schema updates and simplify type architecture (#78)
* feat: sync AdCP schema updates and simplify type architecture - Sync 140 schemas from upstream (61 updated) including filter ref splits - Regenerate all Pydantic types with new schema structure - Add backward compatibility aliases for renamed types (e.g., Action → CreativeAction) - Export filter types (CreativeFilters, ProductFilters, SignalFilters) - Consolidate stable.py into types/__init__.py (eliminate redundant layer) - Update all imports from adcp.types.stable → adcp.types 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> * chore: sync provide-performance-feedback-request schema from upstream Schema updated with latest changes from adcontextprotocol.org 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> * fix: resolve ruff linter issues - Fix import ordering in adcp/__init__.py - Remove duplicate ReportingFrequency import - Add GeneratedTaskStatus to __all__ exports - Organize imports according to ruff standards 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> * fix: resolve TaskStatus import shadowing issue for mypy The core TaskStatus enum was shadowing GeneratedTaskStatus, causing mypy to see the wrong type when client.py tried to access GeneratedTaskStatus enum members. Changes: - Remove TaskStatus from adcp.types exports to avoid shadowing - Import GeneratedTaskStatus directly instead of aliasing - Update imports in client.py and __init__.py - Fix import ordering per ruff standards This resolves mypy errors about TaskStatus not having .completed, .submitted, etc. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 68077c7 commit 58e0d24

File tree

129 files changed

+2206
-1930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2206
-1930
lines changed

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PackageRequest = dict[str, Any]
1919

2020
**Stable Public API Layer - Import Architecture**
2121

22-
**CRITICAL**: Both `generated_poc/` and `_generated.py` are internal implementation. Source code must ONLY import from `stable.py` or `aliases.py`.
22+
**CRITICAL**: Both `generated_poc/` and `_generated.py` are internal implementation. Source code must ONLY import from `types/__init__.py` or `aliases.py`.
2323

2424
### Import Architecture
2525

@@ -30,17 +30,17 @@ generated_poc/*.py (internal, auto-generated from schemas)
3030
3131
_generated.py (internal consolidation, handles name collisions)
3232
33-
stable.py (public API for base types) + aliases.py (public API for discriminated unions)
33+
types/__init__.py (public API for base types) + aliases.py (public API for discriminated unions)
3434
35-
__init__.py (user-facing exports)
35+
adcp/__init__.py (user-facing convenience exports)
3636
```
3737

3838
### Import Rules for Source Code
3939

4040
**✅ CORRECT - Public API only:**
4141
```python
4242
# For base types (requests, responses, domain models)
43-
from adcp.types.stable import (
43+
from adcp.types import (
4444
GetProductsRequest,
4545
GetProductsResponse,
4646
Product,
@@ -83,18 +83,18 @@ from adcp.types._generated import CreateMediaBuyResponse1
8383
- Internal consolidation logic
8484
- Changes when collision handling evolves
8585

86-
3. **`stable.py` and `aliases.py`** provide:
86+
3. **`types/__init__.py` and `aliases.py`** provide:
8787
- Clean, semantic names
8888
- Stability guarantees within major versions
8989
- Explicit public API
9090

9191
### Special Cases
9292

93-
**Only `stable.py` and `aliases.py` may import from `_generated.py`:**
94-
- `stable.py`: Imports base types and re-exports with clean names
93+
**Only `types/__init__.py` and `aliases.py` may import from `_generated.py`:**
94+
- `types/__init__.py`: Imports base types and re-exports with clean names
9595
- `aliases.py`: Imports numbered discriminated union types and creates semantic aliases
9696

97-
**All other source files must import from `stable.py` or `aliases.py`.**
97+
**All other source files must import from `types/__init__.py` or `aliases.py`.**
9898

9999
**NEVER Modify Generated Files Directly**
100100

schemas/cache/.hashes.json

Lines changed: 61 additions & 27 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "/schemas/v1/enums/adcp-domain.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "AdCP protocol domains for task categorization",
5+
"enum": [
6+
"media-buy",
7+
"signals"
8+
],
9+
"title": "AdCP Domain",
10+
"type": "string"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "/schemas/v1/enums/auth-scheme.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Authentication schemes for push notification endpoints",
5+
"enum": [
6+
"Bearer",
7+
"HMAC-SHA256"
8+
],
9+
"title": "Authentication Scheme",
10+
"type": "string"
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$id": "/schemas/v1/enums/available-metric.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Standard delivery and performance metrics available for reporting",
5+
"enum": [
6+
"impressions",
7+
"spend",
8+
"clicks",
9+
"ctr",
10+
"video_completions",
11+
"completion_rate",
12+
"conversions",
13+
"viewability",
14+
"engagement_rate"
15+
],
16+
"title": "Available Metric",
17+
"type": "string"
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$id": "/schemas/v1/enums/co-branding-requirement.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Co-branding policy for creatives (retailer/publisher brand inclusion)",
5+
"enum": [
6+
"required",
7+
"optional",
8+
"none"
9+
],
10+
"title": "Co-Branding Requirement",
11+
"type": "string"
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$id": "/schemas/v1/enums/creative-action.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Action taken on a creative during sync operation",
5+
"enum": [
6+
"created",
7+
"updated",
8+
"unchanged",
9+
"failed",
10+
"deleted"
11+
],
12+
"title": "Creative Action",
13+
"type": "string"
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$id": "/schemas/v1/enums/creative-agent-capability.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Capabilities supported by creative agents for format handling",
5+
"enum": [
6+
"validation",
7+
"assembly",
8+
"generation",
9+
"preview"
10+
],
11+
"title": "Creative Agent Capability",
12+
"type": "string"
13+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"$id": "/schemas/v1/core/creative-filters.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"additionalProperties": false,
5+
"description": "Filter criteria for querying creative assets from the centralized library",
6+
"properties": {
7+
"assigned_to_package": {
8+
"description": "Filter creatives assigned to this specific package",
9+
"type": "string"
10+
},
11+
"assigned_to_packages": {
12+
"description": "Filter creatives assigned to any of these packages",
13+
"items": {
14+
"type": "string"
15+
},
16+
"type": "array"
17+
},
18+
"created_after": {
19+
"description": "Filter creatives created after this date (ISO 8601)",
20+
"format": "date-time",
21+
"type": "string"
22+
},
23+
"created_before": {
24+
"description": "Filter creatives created before this date (ISO 8601)",
25+
"format": "date-time",
26+
"type": "string"
27+
},
28+
"creative_ids": {
29+
"description": "Filter by specific creative IDs",
30+
"items": {
31+
"type": "string"
32+
},
33+
"maxItems": 100,
34+
"type": "array"
35+
},
36+
"format": {
37+
"description": "Filter by creative format type (e.g., video, audio, display)",
38+
"type": "string"
39+
},
40+
"formats": {
41+
"description": "Filter by multiple creative format types",
42+
"items": {
43+
"type": "string"
44+
},
45+
"type": "array"
46+
},
47+
"has_performance_data": {
48+
"description": "Filter creatives that have performance data when true",
49+
"type": "boolean"
50+
},
51+
"name_contains": {
52+
"description": "Filter by creative names containing this text (case-insensitive)",
53+
"type": "string"
54+
},
55+
"status": {
56+
"$ref": "/schemas/v1/enums/creative-status.json",
57+
"description": "Filter by creative approval status"
58+
},
59+
"statuses": {
60+
"description": "Filter by multiple creative statuses",
61+
"items": {
62+
"$ref": "/schemas/v1/enums/creative-status.json"
63+
},
64+
"type": "array"
65+
},
66+
"tags": {
67+
"description": "Filter by creative tags (all tags must match)",
68+
"items": {
69+
"type": "string"
70+
},
71+
"type": "array"
72+
},
73+
"tags_any": {
74+
"description": "Filter by creative tags (any tag must match)",
75+
"items": {
76+
"type": "string"
77+
},
78+
"type": "array"
79+
},
80+
"unassigned": {
81+
"description": "Filter for unassigned creatives when true, assigned creatives when false",
82+
"type": "boolean"
83+
},
84+
"updated_after": {
85+
"description": "Filter creatives last updated after this date (ISO 8601)",
86+
"format": "date-time",
87+
"type": "string"
88+
},
89+
"updated_before": {
90+
"description": "Filter creatives last updated before this date (ISO 8601)",
91+
"format": "date-time",
92+
"type": "string"
93+
}
94+
},
95+
"title": "Creative Filters",
96+
"type": "object"
97+
}

schemas/cache/1.0.0/creative-policy.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,12 @@
55
"description": "Creative requirements and restrictions for a product",
66
"properties": {
77
"co_branding": {
8-
"description": "Co-branding requirement",
9-
"enum": [
10-
"required",
11-
"optional",
12-
"none"
13-
],
14-
"type": "string"
8+
"$ref": "/schemas/v1/enums/co-branding-requirement.json",
9+
"description": "Co-branding requirement"
1510
},
1611
"landing_page": {
17-
"description": "Landing page requirements",
18-
"enum": [
19-
"any",
20-
"retailer_site_only",
21-
"must_include_retailer"
22-
],
23-
"type": "string"
12+
"$ref": "/schemas/v1/enums/landing-page-requirement.json",
13+
"description": "Landing page requirements"
2414
},
2515
"templates_available": {
2616
"description": "Whether creative templates are provided",

0 commit comments

Comments
 (0)