feat: enforce strict FormatID typing and remove deprecated fields - #44
Merged
Conversation
## Breaking Changes ### Strict FormatID Typing - All format ID fields now use structured `FormatID` type with `agent_url` and `id` properties - No more plain string format IDs anywhere in the codebase - Affects: `format_id`, `format_ids`, `output_format_ids`, `formats_to_provide` ### Deprecated Field Removal Per AdCP spec v2.0.0 (adcontextprotocol/adcp#126): - `promoted_offering` replaced with `brand_manifest` in all requests - Removed support for deprecated `products` array in packages (use `product_id`) - Removed support for `video_completions` (use `completed_views`) ## Changes ### Type System - Updated `src/lib/types/adcp.ts`: - Import structured `FormatID` from generated types - Use `FormatID` in `CreativeFormat` and `CreativeFilters` - Update `TestRequest` to use `brand_manifest` instead of `promoted_offering` - Updated `src/lib/utils/index.ts`: - Convert hardcoded format IDs to structured `FormatID` objects - Removed stale `src/types/adcp.ts` file ### API & Server - Updated `src/server/server.ts`: - Replace `promoted_offering` with `brand_manifest` in all endpoints - Update API parameter types and request handling - Updated `src/adagents-manager.ts`: - Fix import path after removing stale types file ### UI - Updated `src/public/index.html`: - Replace all `promoted_offering` references with `brand_manifest` - Update JavaScript variable names ### Generated Types - Synced with AdCP spec v2.0.0 - All format ID fields now properly typed as `FormatID` - No post-processing hacks needed - clean type generation ## Testing ✅ Build passes with strict TypeScript checks ✅ All format IDs properly typed as structured objects ✅ No deprecated fields in outgoing requests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts by regenerating types from latest schemas. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Synced schemas with AdCP spec v2.0.0 - Auto-updated library version from 0.4.2 to 1.0.0 (major bump due to AdCP v2.0.0) - Regenerated types with latest schema changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Library version now matches AdCP spec version (2.0.0). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enforces strict
FormatIDtyping throughout the codebase and removes support for deprecated fields per AdCP spec v2.0.0.Breaking Changes
🔒 Strict FormatID Typing
All format ID fields now use the structured
FormatIDtype withagent_urlandidproperties. No more plain string format IDs.Before:
format_id: "banner_300x250"After:
Affected fields:
format_idformat_idsoutput_format_idsformats_to_provideformat_ids_to_provide🗑️ Deprecated Field Removal
Per AdCP PR #126:
promoted_offeringbrand_manifestproducts[](in packages)product_idvideo_completionscompleted_viewsChanges Made
Type System
FormatIDfrom generated typesCreativeFormatto useFormatIDCreativeFiltersto useFormatID | FormatID[]/src/types/adcp.tsfileFormatIDfrom main types indexAPI & Server
promoted_offeringwithbrand_manifestin all endpointsbuildToolArgs()to sendbrand_manifestUI
brand_manifestinstead ofpromoted_offeringpromotedOffering→brandManifestGenerated Types
FormatIDVerification
✅ Type Safety
✅ Schema Compliance
format_idfields use$ref: "/schemas/v1/core/format-id.json"✅ No Deprecated Fields Sent
Client now sends:
brand_manifest(notpromoted_offering)product_id(notproducts[])completed_views(notvideo_completions)Migration Guide
If you're using this client library:
Format IDs
Update any code that creates format IDs:
Test Requests
Update test request parameters:
Related
🤖 Generated with Claude Code