adcp 2.11.1__tar.gz → 2.12.0__tar.gz
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.
- adcp-2.12.0/ADCP_VERSION +1 -0
- adcp-2.12.0/MANIFEST.in +4 -0
- {adcp-2.11.1/src/adcp.egg-info → adcp-2.12.0}/PKG-INFO +1 -1
- {adcp-2.11.1 → adcp-2.12.0}/pyproject.toml +8 -1
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/__init__.py +23 -3
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/__main__.py +31 -3
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/client.py +16 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/protocols/a2a.py +178 -25
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/protocols/base.py +23 -4
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/protocols/mcp.py +44 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/types/__init__.py +2 -26
- adcp-2.12.0/src/adcp/types/_generated.py +237 -0
- adcp-2.12.0/src/adcp/types/generated_poc/adagents.py +411 -0
- adcp-2.12.0/src/adcp/types/generated_poc/core/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/activation_key.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/core/assets/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/audio_asset.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/css_asset.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/daast_asset.py +4 -4
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/html_asset.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/core/assets/image_asset.py +19 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/javascript_asset.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/text_asset.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/url_asset.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/vast_asset.py +4 -4
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/video_asset.py +7 -11
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core/assets}/webhook_asset.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/brand_manifest.py +3 -3
- adcp-2.12.0/src/adcp/types/generated_poc/core/context.py +15 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/creative_asset.py +25 -6
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/creative_assignment.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/creative_filters.py +12 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/creative_manifest.py +13 -6
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/creative_policy.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/delivery_metrics.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/deployment.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/destination.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/core/dimensions.py +18 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/error.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/core/ext.py +15 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/format.py +85 -54
- adcp-2.12.0/src/adcp/types/generated_poc/core/format_id.py +50 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/frequency_cap.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/measurement.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/media_buy.py +6 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/package.py +13 -6
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/performance_feedback.py +4 -4
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/placement.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/product.py +16 -6
- adcp-2.12.0/src/adcp/types/generated_poc/core/product_filters.py +97 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/promoted_offerings.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/promoted_products.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/property.py +5 -4
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/property_id.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/property_tag.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/protocol_envelope.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/publisher_property_selector.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/push_notification_config.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/reporting_capabilities.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/response.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/signal_filters.py +3 -3
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/sub_asset.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/targeting.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/core}/webhook_payload.py +4 -4
- adcp-2.12.0/src/adcp/types/generated_poc/creative/__init__.py +3 -0
- adcp-2.12.0/src/adcp/types/generated_poc/creative/list_creative_formats_request.py +88 -0
- adcp-2.12.0/src/adcp/types/generated_poc/creative/list_creative_formats_response.py +55 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/creative}/preview_creative_request.py +13 -18
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/creative}/preview_creative_response.py +8 -14
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/creative}/preview_render.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/enums/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/adcp_domain.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/asset_content_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/auth_scheme.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/available_metric.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/channels.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/co_branding_requirement.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/creative_action.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/creative_agent_capability.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/creative_sort_field.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/creative_status.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/daast_tracking_event.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/daast_version.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/delivery_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/dimension_unit.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/feed_format.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/feedback_source.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/format_category.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/enums/format_id_parameter.py +12 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/frequency_cap_scope.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/history_entry_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/http_method.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/identifier_types.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/javascript_module_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/landing_page_requirement.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/markdown_flavor.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/media_buy_status.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/metric_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/notification_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/pacing.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/preview_output_format.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/pricing_model.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/property_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/publisher_identifier_types.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/reporting_frequency.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/signal_catalog_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/sort_direction.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/standard_format_ids.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/task_status.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/task_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/update_frequency.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/url_asset_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/validation_mode.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/vast_tracking_event.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/vast_version.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/webhook_response_type.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/enums}/webhook_security_method.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/media_buy/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/build_creative_request.py +9 -11
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/build_creative_response.py +11 -17
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/create_media_buy_request.py +9 -11
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/create_media_buy_response.py +11 -16
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/get_media_buy_delivery_request.py +8 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/get_media_buy_delivery_response.py +27 -12
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/get_products_request.py +9 -11
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/get_products_response.py +9 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_authorized_properties_request.py +8 -9
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_authorized_properties_response.py +9 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_creative_formats_request.py +9 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_creative_formats_response.py +10 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_creatives_request.py +9 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/list_creatives_response.py +14 -15
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/package_request.py +7 -5
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/provide_performance_feedback_request.py +11 -17
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/provide_performance_feedback_response.py +10 -16
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/sync_creatives_request.py +14 -15
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/sync_creatives_response.py +11 -16
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/update_media_buy_request.py +63 -28
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/media_buy}/update_media_buy_response.py +11 -16
- adcp-2.12.0/src/adcp/types/generated_poc/pricing_options/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpc_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpcv_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpm_auction_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpm_fixed_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpp_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/cpv_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/flat_rate_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/vcpm_auction_option.py +2 -2
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/pricing_options}/vcpm_fixed_option.py +2 -2
- adcp-2.12.0/src/adcp/types/generated_poc/protocols/__init__.py +3 -0
- adcp-2.12.0/src/adcp/types/generated_poc/protocols/adcp_extension.py +37 -0
- adcp-2.12.0/src/adcp/types/generated_poc/signals/__init__.py +3 -0
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/signals}/activate_signal_request.py +8 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/signals}/activate_signal_response.py +10 -16
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/signals}/get_signals_request.py +9 -10
- {adcp-2.11.1/src/adcp/types/generated_poc → adcp-2.12.0/src/adcp/types/generated_poc/signals}/get_signals_response.py +9 -10
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/utils/preview_cache.py +15 -3
- {adcp-2.11.1 → adcp-2.12.0/src/adcp.egg-info}/PKG-INFO +1 -1
- adcp-2.12.0/src/adcp.egg-info/SOURCES.txt +193 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_cli.py +1 -2
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_discriminated_unions.py +11 -9
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_format_id_validation.py +1 -1
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_preview_html.py +21 -3
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_protocols.py +375 -10
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_type_aliases.py +3 -2
- adcp-2.11.1/src/adcp/types/_generated.py +0 -216
- adcp-2.11.1/src/adcp/types/generated_poc/adagents.py +0 -215
- adcp-2.11.1/src/adcp/types/generated_poc/format_id.py +0 -29
- adcp-2.11.1/src/adcp/types/generated_poc/image_asset.py +0 -23
- adcp-2.11.1/src/adcp/types/generated_poc/markdown_asset.py +0 -39
- adcp-2.11.1/src/adcp/types/generated_poc/package_status.py +0 -14
- adcp-2.11.1/src/adcp/types/generated_poc/product_filters.py +0 -36
- adcp-2.11.1/src/adcp/types/generated_poc/tasks_get_request.py +0 -29
- adcp-2.11.1/src/adcp/types/generated_poc/tasks_get_response.py +0 -112
- adcp-2.11.1/src/adcp/types/generated_poc/tasks_list_request.py +0 -115
- adcp-2.11.1/src/adcp/types/generated_poc/tasks_list_response.py +0 -122
- adcp-2.11.1/src/adcp.egg-info/SOURCES.txt +0 -182
- {adcp-2.11.1 → adcp-2.12.0}/LICENSE +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/README.md +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/setup.cfg +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/adagents.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/config.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/exceptions.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/protocols/__init__.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/py.typed +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/simple.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/testing/__init__.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/testing/test_helpers.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/types/aliases.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/types/base.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/types/core.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/types/generated_poc/__init__.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/utils/__init__.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/utils/operation_id.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/utils/response_parser.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp/validation.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp.egg-info/dependency_links.txt +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp.egg-info/entry_points.txt +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp.egg-info/requires.txt +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/src/adcp.egg-info/top_level.txt +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_adagents.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_client.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_code_generation.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_helpers.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_public_api.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_response_parser.py +0 -0
- {adcp-2.11.1 → adcp-2.12.0}/tests/test_simple_api.py +0 -0
adcp-2.12.0/ADCP_VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.5.0
|
adcp-2.12.0/MANIFEST.in
ADDED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "adcp"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.12.0"
|
|
8
8
|
description = "Official Python client for the Ad Context Protocol (AdCP)"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "AdCP Community", email = "maintainers@adcontextprotocol.org"}
|
|
@@ -63,6 +63,13 @@ where = ["src"]
|
|
|
63
63
|
[tool.setuptools.package-data]
|
|
64
64
|
adcp = ["py.typed"]
|
|
65
65
|
|
|
66
|
+
# Include ADCP_VERSION file in package
|
|
67
|
+
[tool.setuptools]
|
|
68
|
+
include-package-data = true
|
|
69
|
+
|
|
70
|
+
[tool.setuptools.data-files]
|
|
71
|
+
"." = ["ADCP_VERSION"]
|
|
72
|
+
|
|
66
73
|
[tool.black]
|
|
67
74
|
line-length = 100
|
|
68
75
|
target-version = ["py310", "py311", "py312"]
|
|
@@ -105,7 +105,6 @@ from adcp.types import (
|
|
|
105
105
|
MediaBuyStatus,
|
|
106
106
|
Package,
|
|
107
107
|
PackageRequest,
|
|
108
|
-
PackageStatus,
|
|
109
108
|
PreviewCreativeRequest,
|
|
110
109
|
PreviewCreativeResponse,
|
|
111
110
|
PriceGuidance,
|
|
@@ -180,9 +179,31 @@ from adcp.validation import (
|
|
|
180
179
|
validate_publisher_properties_item,
|
|
181
180
|
)
|
|
182
181
|
|
|
183
|
-
__version__ = "2.
|
|
182
|
+
__version__ = "2.12.0"
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def get_adcp_version() -> str:
|
|
186
|
+
"""
|
|
187
|
+
Get the target AdCP specification version this SDK is built for.
|
|
188
|
+
|
|
189
|
+
This version determines which AdCP schemas are used for type generation
|
|
190
|
+
and validation. The SDK is designed to work with this specific version
|
|
191
|
+
of the AdCP specification.
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
AdCP specification version (e.g., "v1", "v2")
|
|
195
|
+
"""
|
|
196
|
+
from pathlib import Path
|
|
197
|
+
|
|
198
|
+
# Read from ADCP_VERSION file at project root
|
|
199
|
+
version_file = Path(__file__).parent.parent.parent / "ADCP_VERSION"
|
|
200
|
+
if version_file.exists():
|
|
201
|
+
return version_file.read_text().strip()
|
|
202
|
+
return "v1" # Fallback
|
|
184
203
|
|
|
185
204
|
__all__ = [
|
|
205
|
+
# Version functions
|
|
206
|
+
"get_adcp_version",
|
|
186
207
|
# Client classes
|
|
187
208
|
"ADCPClient",
|
|
188
209
|
"ADCPMultiAgentClient",
|
|
@@ -240,7 +261,6 @@ __all__ = [
|
|
|
240
261
|
# Status enums (for control flow)
|
|
241
262
|
"CreativeStatus",
|
|
242
263
|
"MediaBuyStatus",
|
|
243
|
-
"PackageStatus",
|
|
244
264
|
"PricingModel",
|
|
245
265
|
# Pricing-related types
|
|
246
266
|
"CpcPricingOption",
|
|
@@ -83,9 +83,10 @@ async def execute_tool(
|
|
|
83
83
|
|
|
84
84
|
# Tool dispatch mapping - single source of truth for ADCP methods
|
|
85
85
|
# Types are filled at runtime to avoid circular imports
|
|
86
|
-
# Special case: list_tools
|
|
86
|
+
# Special case: list_tools and get_info take no parameters (None means no request type)
|
|
87
87
|
TOOL_DISPATCH: dict[str, tuple[str, type | None]] = {
|
|
88
88
|
"list_tools": ("list_tools", None), # Protocol introspection - no request type
|
|
89
|
+
"get_info": ("get_info", None), # Agent info - no request type
|
|
89
90
|
"get_products": ("get_products", None),
|
|
90
91
|
"list_creative_formats": ("list_creative_formats", None),
|
|
91
92
|
"preview_creative": ("preview_creative", None),
|
|
@@ -162,7 +163,8 @@ async def _dispatch_tool(client: ADCPClient, tool_name: str, payload: dict[str,
|
|
|
162
163
|
method_name, request_type = TOOL_DISPATCH[tool_name]
|
|
163
164
|
method = getattr(client, method_name)
|
|
164
165
|
|
|
165
|
-
# Special case: list_tools
|
|
166
|
+
# Special case: list_tools and get_info take no parameters and return
|
|
167
|
+
# data directly, not TaskResult
|
|
166
168
|
if tool_name == "list_tools":
|
|
167
169
|
try:
|
|
168
170
|
tools = await method()
|
|
@@ -178,7 +180,22 @@ async def _dispatch_tool(client: ADCPClient, tool_name: str, payload: dict[str,
|
|
|
178
180
|
error=f"Failed to list tools: {e}",
|
|
179
181
|
)
|
|
180
182
|
|
|
181
|
-
|
|
183
|
+
if tool_name == "get_info":
|
|
184
|
+
try:
|
|
185
|
+
info = await method()
|
|
186
|
+
return TaskResult(
|
|
187
|
+
status=TaskStatus.COMPLETED,
|
|
188
|
+
data=info,
|
|
189
|
+
success=True,
|
|
190
|
+
)
|
|
191
|
+
except Exception as e:
|
|
192
|
+
return TaskResult(
|
|
193
|
+
status=TaskStatus.FAILED,
|
|
194
|
+
success=False,
|
|
195
|
+
error=f"Failed to get agent info: {e}",
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
# Type guard - request_type should be initialized by this point for methods that need it
|
|
182
199
|
if request_type is None:
|
|
183
200
|
return TaskResult(
|
|
184
201
|
status=TaskStatus.FAILED,
|
|
@@ -323,6 +340,7 @@ def main() -> None:
|
|
|
323
340
|
parser.add_argument("--list-agents", action="store_true", help="List saved agents")
|
|
324
341
|
parser.add_argument("--remove-agent", metavar="ALIAS", help="Remove saved agent")
|
|
325
342
|
parser.add_argument("--show-config", action="store_true", help="Show config file location")
|
|
343
|
+
parser.add_argument("--version", action="store_true", help="Show SDK and AdCP version")
|
|
326
344
|
|
|
327
345
|
# Execution options
|
|
328
346
|
parser.add_argument("--protocol", choices=["mcp", "a2a"], help="Force protocol type")
|
|
@@ -348,19 +366,29 @@ def main() -> None:
|
|
|
348
366
|
args.list_agents,
|
|
349
367
|
args.remove_agent,
|
|
350
368
|
args.show_config,
|
|
369
|
+
args.version,
|
|
351
370
|
]
|
|
352
371
|
)
|
|
353
372
|
):
|
|
354
373
|
parser.print_help()
|
|
355
374
|
print("\nExamples:")
|
|
375
|
+
print(" adcp --version")
|
|
356
376
|
print(" adcp --save-auth myagent https://agent.example.com mcp")
|
|
357
377
|
print(" adcp --list-agents")
|
|
378
|
+
print(" adcp myagent get_info")
|
|
358
379
|
print(" adcp myagent list_tools")
|
|
359
380
|
print(' adcp myagent get_products \'{"brief":"TV ads"}\'')
|
|
360
381
|
print(" adcp https://agent.example.com list_tools")
|
|
361
382
|
sys.exit(0)
|
|
362
383
|
|
|
363
384
|
# Handle configuration commands
|
|
385
|
+
if args.version:
|
|
386
|
+
from adcp import __version__, get_adcp_version
|
|
387
|
+
|
|
388
|
+
print(f"AdCP Python SDK: v{__version__}")
|
|
389
|
+
print(f"Target AdCP Spec: {get_adcp_version()}")
|
|
390
|
+
sys.exit(0)
|
|
391
|
+
|
|
364
392
|
if args.save_auth:
|
|
365
393
|
url = args.agent if args.agent else None
|
|
366
394
|
protocol = args.tool if args.tool else None
|
|
@@ -781,6 +781,22 @@ class ADCPClient:
|
|
|
781
781
|
"""
|
|
782
782
|
return await self.adapter.list_tools()
|
|
783
783
|
|
|
784
|
+
async def get_info(self) -> dict[str, Any]:
|
|
785
|
+
"""
|
|
786
|
+
Get agent information including AdCP extension metadata.
|
|
787
|
+
|
|
788
|
+
Returns agent card information including:
|
|
789
|
+
- Agent name, description, version
|
|
790
|
+
- Protocol type (mcp or a2a)
|
|
791
|
+
- AdCP version (from extensions.adcp.adcp_version)
|
|
792
|
+
- Supported protocols (from extensions.adcp.protocols_supported)
|
|
793
|
+
- Available tools/skills
|
|
794
|
+
|
|
795
|
+
Returns:
|
|
796
|
+
Dictionary with agent metadata
|
|
797
|
+
"""
|
|
798
|
+
return await self.adapter.get_agent_info()
|
|
799
|
+
|
|
784
800
|
async def close(self) -> None:
|
|
785
801
|
"""Close the adapter and clean up resources."""
|
|
786
802
|
if hasattr(self.adapter, "close"):
|
|
@@ -127,35 +127,51 @@ class A2AAdapter(ProtocolAdapter):
|
|
|
127
127
|
duration_ms=duration_ms,
|
|
128
128
|
)
|
|
129
129
|
|
|
130
|
-
# Parse A2A response format
|
|
130
|
+
# Parse A2A response format per canonical spec
|
|
131
131
|
# A2A tasks have lifecycle: submitted, working, completed, failed, input-required
|
|
132
|
-
task_status = data.get("
|
|
132
|
+
task_status = data.get("status")
|
|
133
133
|
|
|
134
|
-
if task_status
|
|
135
|
-
# Extract the result from the
|
|
134
|
+
if task_status == "completed":
|
|
135
|
+
# Extract the result from the artifacts array
|
|
136
136
|
result_data = self._extract_result(data)
|
|
137
137
|
|
|
138
|
+
# Check for task-level errors in the payload
|
|
139
|
+
errors = result_data.get("errors", []) if isinstance(result_data, dict) else []
|
|
140
|
+
has_errors = bool(errors)
|
|
141
|
+
|
|
138
142
|
return TaskResult[Any](
|
|
139
143
|
status=TaskStatus.COMPLETED,
|
|
140
144
|
data=result_data,
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
message=self._extract_text_part(data),
|
|
146
|
+
success=not has_errors,
|
|
147
|
+
metadata={
|
|
148
|
+
"task_id": data.get("taskId"),
|
|
149
|
+
"context_id": data.get("contextId"),
|
|
150
|
+
},
|
|
143
151
|
debug_info=debug_info,
|
|
144
152
|
)
|
|
145
153
|
elif task_status == "failed":
|
|
154
|
+
# Protocol-level failure - extract error message from TextPart
|
|
155
|
+
error_msg = self._extract_text_part(data) or "Task failed"
|
|
146
156
|
return TaskResult[Any](
|
|
147
157
|
status=TaskStatus.FAILED,
|
|
148
|
-
error=
|
|
158
|
+
error=error_msg,
|
|
149
159
|
success=False,
|
|
150
160
|
debug_info=debug_info,
|
|
151
161
|
)
|
|
152
162
|
else:
|
|
153
|
-
# Handle
|
|
163
|
+
# Handle all interim states (submitted, working, pending, input-required)
|
|
164
|
+
# These don't need to have structured AdCP content - only completed responses do
|
|
154
165
|
return TaskResult[Any](
|
|
155
166
|
status=TaskStatus.SUBMITTED,
|
|
156
|
-
data=
|
|
167
|
+
data=None, # Interim responses may not have structured AdCP content
|
|
168
|
+
message=self._extract_text_part(data),
|
|
157
169
|
success=True,
|
|
158
|
-
metadata={
|
|
170
|
+
metadata={
|
|
171
|
+
"task_id": data.get("taskId"),
|
|
172
|
+
"context_id": data.get("contextId"),
|
|
173
|
+
"status": task_status, # submitted, working, pending, input-required, etc.
|
|
174
|
+
},
|
|
159
175
|
debug_info=debug_info,
|
|
160
176
|
)
|
|
161
177
|
|
|
@@ -182,27 +198,79 @@ class A2AAdapter(ProtocolAdapter):
|
|
|
182
198
|
return f"Execute tool: {tool_name}\nParameters: {json.dumps(params, indent=2)}"
|
|
183
199
|
|
|
184
200
|
def _extract_result(self, response_data: dict[str, Any]) -> Any:
|
|
185
|
-
"""
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
201
|
+
"""
|
|
202
|
+
Extract result data from A2A response following canonical format.
|
|
203
|
+
|
|
204
|
+
Per A2A response spec:
|
|
205
|
+
- Responses MUST include at least one DataPart (kind: "data")
|
|
206
|
+
- When multiple DataParts exist in an artifact, the last one is authoritative
|
|
207
|
+
- When multiple artifacts exist, use the last one (most recent in streaming)
|
|
208
|
+
- DataParts contain structured AdCP payload
|
|
209
|
+
"""
|
|
210
|
+
artifacts = response_data.get("artifacts", [])
|
|
211
|
+
|
|
212
|
+
if not artifacts:
|
|
213
|
+
logger.warning("A2A response missing required artifacts array")
|
|
214
|
+
return response_data
|
|
215
|
+
|
|
216
|
+
# Use last artifact (most recent in streaming scenarios)
|
|
217
|
+
# A2A spec doesn't define artifact.status, so we simply take the last one
|
|
218
|
+
target_artifact = artifacts[-1]
|
|
219
|
+
|
|
220
|
+
parts = target_artifact.get("parts", [])
|
|
189
221
|
|
|
190
222
|
if not parts:
|
|
223
|
+
logger.warning("A2A response artifact has no parts")
|
|
224
|
+
return response_data
|
|
225
|
+
|
|
226
|
+
# Find all DataParts (kind: "data")
|
|
227
|
+
data_parts = [p for p in parts if p.get("kind") == "data"]
|
|
228
|
+
|
|
229
|
+
if not data_parts:
|
|
230
|
+
logger.warning("A2A response missing required DataPart (kind: 'data')")
|
|
191
231
|
return response_data
|
|
192
232
|
|
|
193
|
-
#
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
233
|
+
# Use last DataPart as authoritative (handles streaming scenarios within an artifact)
|
|
234
|
+
last_data_part = data_parts[-1]
|
|
235
|
+
data = last_data_part.get("data", {})
|
|
236
|
+
|
|
237
|
+
# Some A2A implementations (e.g., ADK) wrap the response in {"response": {...}}
|
|
238
|
+
# Unwrap it to get the actual AdCP payload if present
|
|
239
|
+
# ADK is inconsistent - some DataParts have the wrapper, others don't
|
|
240
|
+
if isinstance(data, dict) and "response" in data:
|
|
241
|
+
# If response is the only key, unwrap completely
|
|
242
|
+
if len(data) == 1:
|
|
243
|
+
return data["response"]
|
|
244
|
+
# If there are other keys alongside response, prefer the wrapped content
|
|
245
|
+
# but keep it flexible for edge cases
|
|
246
|
+
return data["response"]
|
|
247
|
+
|
|
248
|
+
return data
|
|
249
|
+
|
|
250
|
+
def _extract_text_part(self, response_data: dict[str, Any]) -> str | None:
|
|
251
|
+
"""
|
|
252
|
+
Extract human-readable message from TextPart if present.
|
|
253
|
+
|
|
254
|
+
Uses last artifact (same logic as _extract_result).
|
|
255
|
+
"""
|
|
256
|
+
artifacts = response_data.get("artifacts", [])
|
|
257
|
+
|
|
258
|
+
if not artifacts:
|
|
259
|
+
return None
|
|
260
|
+
|
|
261
|
+
# Use last artifact (most recent in streaming scenarios)
|
|
262
|
+
# A2A spec doesn't define artifact.status, so we simply take the last one
|
|
263
|
+
target_artifact = artifacts[-1]
|
|
200
264
|
|
|
201
|
-
|
|
202
|
-
except (json.JSONDecodeError, ValueError):
|
|
203
|
-
return text
|
|
265
|
+
parts = target_artifact.get("parts", [])
|
|
204
266
|
|
|
205
|
-
|
|
267
|
+
# Find TextPart (kind: "text")
|
|
268
|
+
for part in parts:
|
|
269
|
+
if part.get("kind") == "text":
|
|
270
|
+
text = part.get("text")
|
|
271
|
+
return str(text) if text is not None else None
|
|
272
|
+
|
|
273
|
+
return None
|
|
206
274
|
|
|
207
275
|
# ========================================================================
|
|
208
276
|
# ADCP Protocol Methods
|
|
@@ -329,3 +397,88 @@ class A2AAdapter(ProtocolAdapter):
|
|
|
329
397
|
agent_id=self.agent_config.id,
|
|
330
398
|
agent_uri=self.agent_config.agent_uri,
|
|
331
399
|
) from e
|
|
400
|
+
|
|
401
|
+
async def get_agent_info(self) -> dict[str, Any]:
|
|
402
|
+
"""
|
|
403
|
+
Get agent information including AdCP extension metadata from A2A agent card.
|
|
404
|
+
|
|
405
|
+
Fetches the agent card from /.well-known/agent.json and extracts:
|
|
406
|
+
- Basic agent info (name, description, version)
|
|
407
|
+
- AdCP extension (extensions.adcp.adcp_version, extensions.adcp.protocols_supported)
|
|
408
|
+
- Available skills/tools
|
|
409
|
+
|
|
410
|
+
Returns:
|
|
411
|
+
Dictionary with agent metadata
|
|
412
|
+
"""
|
|
413
|
+
client = await self._get_client()
|
|
414
|
+
|
|
415
|
+
headers = {"Content-Type": "application/json"}
|
|
416
|
+
|
|
417
|
+
if self.agent_config.auth_token:
|
|
418
|
+
if self.agent_config.auth_type == "bearer":
|
|
419
|
+
headers[self.agent_config.auth_header] = f"Bearer {self.agent_config.auth_token}"
|
|
420
|
+
else:
|
|
421
|
+
headers[self.agent_config.auth_header] = self.agent_config.auth_token
|
|
422
|
+
|
|
423
|
+
url = f"{self.agent_config.agent_uri}/.well-known/agent.json"
|
|
424
|
+
|
|
425
|
+
logger.debug(f"Fetching A2A agent info for {self.agent_config.id} from {url}")
|
|
426
|
+
|
|
427
|
+
try:
|
|
428
|
+
response = await client.get(url, headers=headers, timeout=self.agent_config.timeout)
|
|
429
|
+
response.raise_for_status()
|
|
430
|
+
|
|
431
|
+
agent_card = response.json()
|
|
432
|
+
|
|
433
|
+
# Extract basic info
|
|
434
|
+
info: dict[str, Any] = {
|
|
435
|
+
"name": agent_card.get("name"),
|
|
436
|
+
"description": agent_card.get("description"),
|
|
437
|
+
"version": agent_card.get("version"),
|
|
438
|
+
"protocol": "a2a",
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
# Extract skills/tools
|
|
442
|
+
skills = agent_card.get("skills", [])
|
|
443
|
+
tool_names = [skill.get("name") for skill in skills if skill.get("name")]
|
|
444
|
+
if tool_names:
|
|
445
|
+
info["tools"] = tool_names
|
|
446
|
+
|
|
447
|
+
# Extract AdCP extension metadata
|
|
448
|
+
extensions = agent_card.get("extensions", {})
|
|
449
|
+
adcp_ext = extensions.get("adcp", {})
|
|
450
|
+
|
|
451
|
+
if adcp_ext:
|
|
452
|
+
info["adcp_version"] = adcp_ext.get("adcp_version")
|
|
453
|
+
info["protocols_supported"] = adcp_ext.get("protocols_supported")
|
|
454
|
+
|
|
455
|
+
logger.info(f"Retrieved agent info for {self.agent_config.id}")
|
|
456
|
+
return info
|
|
457
|
+
|
|
458
|
+
except httpx.HTTPStatusError as e:
|
|
459
|
+
status_code = e.response.status_code
|
|
460
|
+
if status_code in (401, 403):
|
|
461
|
+
raise ADCPAuthenticationError(
|
|
462
|
+
f"Authentication failed: HTTP {status_code}",
|
|
463
|
+
agent_id=self.agent_config.id,
|
|
464
|
+
agent_uri=self.agent_config.agent_uri,
|
|
465
|
+
) from e
|
|
466
|
+
else:
|
|
467
|
+
raise ADCPConnectionError(
|
|
468
|
+
f"Failed to fetch agent card: HTTP {status_code}",
|
|
469
|
+
agent_id=self.agent_config.id,
|
|
470
|
+
agent_uri=self.agent_config.agent_uri,
|
|
471
|
+
) from e
|
|
472
|
+
except httpx.TimeoutException as e:
|
|
473
|
+
raise ADCPTimeoutError(
|
|
474
|
+
f"Timeout fetching agent card: {e}",
|
|
475
|
+
agent_id=self.agent_config.id,
|
|
476
|
+
agent_uri=self.agent_config.agent_uri,
|
|
477
|
+
timeout=self.agent_config.timeout,
|
|
478
|
+
) from e
|
|
479
|
+
except httpx.HTTPError as e:
|
|
480
|
+
raise ADCPConnectionError(
|
|
481
|
+
f"Failed to fetch agent card: {e}",
|
|
482
|
+
agent_id=self.agent_config.id,
|
|
483
|
+
agent_uri=self.agent_config.agent_uri,
|
|
484
|
+
) from e
|
|
@@ -46,15 +46,18 @@ class ProtocolAdapter(ABC):
|
|
|
46
46
|
Returns:
|
|
47
47
|
Typed TaskResult
|
|
48
48
|
"""
|
|
49
|
-
# Handle failed results or
|
|
49
|
+
# Handle failed results or interim states without data
|
|
50
|
+
# For A2A: interim states (submitted/working) have data=None but success=True
|
|
51
|
+
# For MCP: completed tasks always have data, missing data indicates failure
|
|
50
52
|
if not raw_result.success or raw_result.data is None:
|
|
51
|
-
#
|
|
53
|
+
# If already marked as unsuccessful, preserve that
|
|
54
|
+
# If successful but no data (A2A interim state), preserve success=True
|
|
52
55
|
return TaskResult[T](
|
|
53
56
|
status=raw_result.status,
|
|
54
57
|
data=None,
|
|
55
58
|
message=raw_result.message,
|
|
56
|
-
success=
|
|
57
|
-
error=raw_result.error
|
|
59
|
+
success=raw_result.success, # Preserve original success state
|
|
60
|
+
error=raw_result.error, # Only use error if one was set
|
|
58
61
|
metadata=raw_result.metadata,
|
|
59
62
|
debug_info=raw_result.debug_info,
|
|
60
63
|
)
|
|
@@ -161,6 +164,22 @@ class ProtocolAdapter(ABC):
|
|
|
161
164
|
"""
|
|
162
165
|
pass
|
|
163
166
|
|
|
167
|
+
@abstractmethod
|
|
168
|
+
async def get_agent_info(self) -> dict[str, Any]:
|
|
169
|
+
"""
|
|
170
|
+
Get agent information including AdCP extension metadata.
|
|
171
|
+
|
|
172
|
+
Returns agent card information including:
|
|
173
|
+
- Agent name, description, version
|
|
174
|
+
- AdCP version (from extensions.adcp.adcp_version)
|
|
175
|
+
- Supported protocols (from extensions.adcp.protocols_supported)
|
|
176
|
+
- Available tools/skills
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
Dictionary with agent metadata including AdCP extension fields
|
|
180
|
+
"""
|
|
181
|
+
pass
|
|
182
|
+
|
|
164
183
|
@abstractmethod
|
|
165
184
|
async def close(self) -> None:
|
|
166
185
|
"""
|
|
@@ -391,6 +391,50 @@ class MCPAdapter(ProtocolAdapter):
|
|
|
391
391
|
result = await session.list_tools()
|
|
392
392
|
return [tool.name for tool in result.tools]
|
|
393
393
|
|
|
394
|
+
async def get_agent_info(self) -> dict[str, Any]:
|
|
395
|
+
"""
|
|
396
|
+
Get agent information including AdCP extension metadata from MCP server.
|
|
397
|
+
|
|
398
|
+
MCP servers may expose metadata through:
|
|
399
|
+
- Server capabilities exposed during initialization
|
|
400
|
+
- extensions.adcp in server info (if supported)
|
|
401
|
+
- Tool list
|
|
402
|
+
|
|
403
|
+
Returns:
|
|
404
|
+
Dictionary with agent metadata
|
|
405
|
+
"""
|
|
406
|
+
session = await self._get_session()
|
|
407
|
+
|
|
408
|
+
# Extract basic MCP server info
|
|
409
|
+
info: dict[str, Any] = {
|
|
410
|
+
"name": getattr(session, "server_name", None),
|
|
411
|
+
"version": getattr(session, "server_version", None),
|
|
412
|
+
"protocol": "mcp",
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
# Get available tools
|
|
416
|
+
try:
|
|
417
|
+
tools_result = await session.list_tools()
|
|
418
|
+
tool_names = [tool.name for tool in tools_result.tools]
|
|
419
|
+
if tool_names:
|
|
420
|
+
info["tools"] = tool_names
|
|
421
|
+
except Exception as e:
|
|
422
|
+
logger.warning(f"Failed to list tools for {self.agent_config.id}: {e}")
|
|
423
|
+
|
|
424
|
+
# Try to extract AdCP extension metadata from server capabilities
|
|
425
|
+
# MCP servers may expose this in their initialization response
|
|
426
|
+
if hasattr(session, "_server_capabilities"):
|
|
427
|
+
capabilities = session._server_capabilities
|
|
428
|
+
if isinstance(capabilities, dict):
|
|
429
|
+
extensions = capabilities.get("extensions", {})
|
|
430
|
+
adcp_ext = extensions.get("adcp", {})
|
|
431
|
+
if adcp_ext:
|
|
432
|
+
info["adcp_version"] = adcp_ext.get("adcp_version")
|
|
433
|
+
info["protocols_supported"] = adcp_ext.get("protocols_supported")
|
|
434
|
+
|
|
435
|
+
logger.info(f"Retrieved agent info for {self.agent_config.id}")
|
|
436
|
+
return info
|
|
437
|
+
|
|
394
438
|
async def close(self) -> None:
|
|
395
439
|
"""Close the MCP session and clean up resources."""
|
|
396
440
|
await self._cleanup_failed_connection("during close")
|
|
@@ -69,17 +69,13 @@ from adcp.types._generated import (
|
|
|
69
69
|
DeliveryMeasurement,
|
|
70
70
|
DeliveryMetrics,
|
|
71
71
|
DeliveryType,
|
|
72
|
-
Details,
|
|
73
72
|
DimensionUnit,
|
|
74
73
|
Disclaimer,
|
|
75
|
-
Domain,
|
|
76
|
-
DomainBreakdown,
|
|
77
74
|
DoohMetrics,
|
|
78
75
|
Embedding,
|
|
79
76
|
Error,
|
|
80
77
|
FeedbackSource,
|
|
81
78
|
FieldModel,
|
|
82
|
-
Filters,
|
|
83
79
|
FlatRatePricingOption,
|
|
84
80
|
Fonts,
|
|
85
81
|
Format,
|
|
@@ -87,6 +83,7 @@ from adcp.types._generated import (
|
|
|
87
83
|
FormatCardDetailed,
|
|
88
84
|
FormatCategory,
|
|
89
85
|
FormatId,
|
|
86
|
+
FormatIdParameter,
|
|
90
87
|
FrequencyCap,
|
|
91
88
|
FrequencyCapScope,
|
|
92
89
|
GeoCountryAnyOfItem,
|
|
@@ -96,7 +93,6 @@ from adcp.types._generated import (
|
|
|
96
93
|
GetProductsResponse,
|
|
97
94
|
GetSignalsRequest,
|
|
98
95
|
GetSignalsResponse,
|
|
99
|
-
HistoryItem,
|
|
100
96
|
HtmlAsset,
|
|
101
97
|
HttpMethod,
|
|
102
98
|
Identifier,
|
|
@@ -112,7 +108,6 @@ from adcp.types._generated import (
|
|
|
112
108
|
ListCreativesRequest,
|
|
113
109
|
ListCreativesResponse,
|
|
114
110
|
Logo,
|
|
115
|
-
MarkdownAsset,
|
|
116
111
|
MarkdownFlavor,
|
|
117
112
|
Measurement,
|
|
118
113
|
MeasurementPeriod,
|
|
@@ -126,7 +121,6 @@ from adcp.types._generated import (
|
|
|
126
121
|
Pacing,
|
|
127
122
|
PackageRequest,
|
|
128
123
|
Packages,
|
|
129
|
-
PackageStatus,
|
|
130
124
|
Pagination,
|
|
131
125
|
Parameters,
|
|
132
126
|
Performance,
|
|
@@ -161,7 +155,6 @@ from adcp.types._generated import (
|
|
|
161
155
|
PushNotificationConfig,
|
|
162
156
|
QuartileData,
|
|
163
157
|
QuerySummary,
|
|
164
|
-
Render,
|
|
165
158
|
ReportingCapabilities,
|
|
166
159
|
ReportingFrequency,
|
|
167
160
|
ReportingPeriod,
|
|
@@ -184,11 +177,6 @@ from adcp.types._generated import (
|
|
|
184
177
|
SyncCreativesResponse,
|
|
185
178
|
Tags,
|
|
186
179
|
TargetingOverlay,
|
|
187
|
-
Task,
|
|
188
|
-
TasksGetRequest,
|
|
189
|
-
TasksGetResponse,
|
|
190
|
-
TasksListRequest,
|
|
191
|
-
TasksListResponse,
|
|
192
180
|
TaskType,
|
|
193
181
|
TextAsset,
|
|
194
182
|
Totals,
|
|
@@ -322,16 +310,12 @@ __all__ = [
|
|
|
322
310
|
"CreateMediaBuyRequest",
|
|
323
311
|
"CreateMediaBuyResponse",
|
|
324
312
|
"DailyBreakdownItem",
|
|
325
|
-
"Details",
|
|
326
|
-
"Domain",
|
|
327
|
-
"DomainBreakdown",
|
|
328
313
|
"GetMediaBuyDeliveryRequest",
|
|
329
314
|
"GetMediaBuyDeliveryResponse",
|
|
330
315
|
"GetProductsRequest",
|
|
331
316
|
"GetProductsResponse",
|
|
332
317
|
"GetSignalsRequest",
|
|
333
318
|
"GetSignalsResponse",
|
|
334
|
-
"HistoryItem",
|
|
335
319
|
"ListAuthorizedPropertiesRequest",
|
|
336
320
|
"ListAuthorizedPropertiesResponse",
|
|
337
321
|
"ListCreativeFormatsRequest",
|
|
@@ -351,11 +335,6 @@ __all__ = [
|
|
|
351
335
|
"StatusSummary",
|
|
352
336
|
"SyncCreativesRequest",
|
|
353
337
|
"SyncCreativesResponse",
|
|
354
|
-
"Task",
|
|
355
|
-
"TasksGetRequest",
|
|
356
|
-
"TasksGetResponse",
|
|
357
|
-
"TasksListRequest",
|
|
358
|
-
"TasksListResponse",
|
|
359
338
|
"Totals",
|
|
360
339
|
"UpdateMediaBuyRequest",
|
|
361
340
|
"UpdateMediaBuyResponse",
|
|
@@ -387,12 +366,12 @@ __all__ = [
|
|
|
387
366
|
"Embedding",
|
|
388
367
|
"Error",
|
|
389
368
|
"FeedFormat",
|
|
390
|
-
"Filters",
|
|
391
369
|
"Fonts",
|
|
392
370
|
"Format",
|
|
393
371
|
"FormatCard",
|
|
394
372
|
"FormatCardDetailed",
|
|
395
373
|
"FormatId",
|
|
374
|
+
"FormatIdParameter",
|
|
396
375
|
"Identifier",
|
|
397
376
|
"Input",
|
|
398
377
|
"LandingPageRequirement",
|
|
@@ -419,7 +398,6 @@ __all__ = [
|
|
|
419
398
|
"PromotedProducts",
|
|
420
399
|
"Property",
|
|
421
400
|
"QuartileData",
|
|
422
|
-
"Render",
|
|
423
401
|
"Request",
|
|
424
402
|
"Response",
|
|
425
403
|
"Results",
|
|
@@ -462,7 +440,6 @@ __all__ = [
|
|
|
462
440
|
"NotificationType",
|
|
463
441
|
"PreviewOutputFormat",
|
|
464
442
|
"Pacing",
|
|
465
|
-
"PackageStatus",
|
|
466
443
|
"Pagination",
|
|
467
444
|
"PricingModel",
|
|
468
445
|
"PrimaryCountry",
|
|
@@ -503,7 +480,6 @@ __all__ = [
|
|
|
503
480
|
"HtmlAsset",
|
|
504
481
|
"ImageAsset",
|
|
505
482
|
"JavascriptAsset",
|
|
506
|
-
"MarkdownAsset",
|
|
507
483
|
"TextAsset",
|
|
508
484
|
"UrlAsset",
|
|
509
485
|
"VideoAsset",
|