@adcp/sdk 12.0.1 → 12.0.3

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.
Files changed (52) hide show
  1. package/dist/lib/index.d.mts +2 -2
  2. package/dist/lib/index.d.ts +2 -2
  3. package/dist/lib/index.d.ts.map +1 -1
  4. package/dist/lib/index.js +2 -0
  5. package/dist/lib/index.js.map +1 -1
  6. package/dist/lib/index.mjs +3 -1
  7. package/dist/lib/index.mjs.map +1 -1
  8. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  9. package/dist/lib/server/adcp-server.d.ts.map +1 -1
  10. package/dist/lib/server/adcp-server.js +18 -0
  11. package/dist/lib/server/adcp-server.js.map +1 -1
  12. package/dist/lib/server/adcp-server.mjs +15 -0
  13. package/dist/lib/server/adcp-server.mjs.map +1 -1
  14. package/dist/lib/server/create-adcp-server.d.mts +24 -0
  15. package/dist/lib/server/create-adcp-server.d.ts +24 -0
  16. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  17. package/dist/lib/server/create-adcp-server.js +24 -2
  18. package/dist/lib/server/create-adcp-server.js.map +1 -1
  19. package/dist/lib/server/create-adcp-server.mjs +29 -2
  20. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  21. package/dist/lib/server/index.d.mts +3 -1
  22. package/dist/lib/server/index.d.ts +3 -1
  23. package/dist/lib/server/index.d.ts.map +1 -1
  24. package/dist/lib/server/index.js +3 -0
  25. package/dist/lib/server/index.js.map +1 -1
  26. package/dist/lib/server/index.mjs +2 -0
  27. package/dist/lib/server/index.mjs.map +1 -1
  28. package/dist/lib/server/legacy/v5/index.d.mts +1 -1
  29. package/dist/lib/server/legacy/v5/index.d.ts +1 -1
  30. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  31. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  32. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  33. package/dist/lib/server/mcp-app.d.mts +57 -0
  34. package/dist/lib/server/mcp-app.d.ts +58 -0
  35. package/dist/lib/server/mcp-app.d.ts.map +1 -0
  36. package/dist/lib/server/mcp-app.js +110 -0
  37. package/dist/lib/server/mcp-app.js.map +1 -0
  38. package/dist/lib/server/mcp-app.mjs +83 -0
  39. package/dist/lib/server/mcp-app.mjs.map +1 -0
  40. package/dist/lib/server/mcp-modern-server.d.ts.map +1 -1
  41. package/dist/lib/server/mcp-modern-server.js +23 -1
  42. package/dist/lib/server/mcp-modern-server.js.map +1 -1
  43. package/dist/lib/server/mcp-modern-server.mjs +24 -1
  44. package/dist/lib/server/mcp-modern-server.mjs.map +1 -1
  45. package/dist/lib/version.d.mts +3 -3
  46. package/dist/lib/version.d.ts +3 -3
  47. package/dist/lib/version.js +3 -3
  48. package/dist/lib/version.js.map +1 -1
  49. package/dist/lib/version.mjs +3 -3
  50. package/dist/lib/version.mjs.map +1 -1
  51. package/docs/guides/BUILD-AN-AGENT.md +70 -0
  52. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/index.ts"],"sourcesContent":["// AdCP Client Library - Main Exports\n// A comprehensive type-safe client library for the AdContext Protocol\n\n// ====== REGISTRY LOOKUPS ======\nexport {\n RegistryClient,\n RegistrySync,\n PropertyRegistry,\n InMemoryCursorStore,\n FileCursorStore,\n buildCommunityMirrorAdagents,\n} from './registry';\nexport type {\n RegistrySyncConfig,\n RegistrySyncState,\n RegistrySyncTransport,\n RegistrySyncEvents,\n AgentFilter,\n RegistrySyncProperty,\n CursorStore,\n PropertyRegistryConfig,\n FeedStreamQuery,\n FeedStreamMessage,\n FeedHeartbeat,\n FeedStreamErrorData,\n OpenFeedStreamOptions,\n FeedFreshness,\n} from './registry';\nexport {\n openFeedStream,\n parseSseStream,\n sanitizeStreamText,\n DEFAULT_MAX_SSE_FRAME_BYTES,\n FeedStreamError,\n FeedStreamUnsupportedError,\n FeedStreamCursorExpiredError,\n FeedStreamHttpError,\n FeedStreamParseError,\n} from './registry';\nexport type {\n ResolvedBrand,\n BrandHierarchyResolution,\n BrandHierarchyBulkResolution,\n ResolveBrandHierarchyOptions,\n ResolvedProperty as ResolvedRegistryProperty,\n PropertyInfo,\n RegistryClientConfig,\n SaveBrandRequest,\n SaveBrandResponse,\n BrandLogoReviewStatus,\n ApprovedBrandLogoAsset,\n PendingBrandLogoAsset,\n ReviewedBrandLogoAsset,\n BrandLogoAsset,\n ListBrandLogosOptions,\n ListBrandLogosResponse,\n SaveBrandLogoInput,\n SaveBrandLogoResponse,\n UploadBrandLogoInput,\n UploadBrandLogoResponse,\n SavePropertyIdentity,\n RegistryPropertyIdentity,\n SavePropertyRequest,\n SavePropertyResponse,\n ResolveIdentifiersRequest,\n ResolveIdentifiersResponse,\n FileCatalogDisputeRequest,\n FileCatalogDisputeResponse,\n GetCatalogDisputeResponse,\n BrandRegistryItem,\n PropertyRegistryItem,\n ValidationResult as RegistryValidationResult,\n FederatedAgentWithDetails,\n FederatedPublisher,\n DomainLookupResult,\n ListBrandsOptions,\n ListBrandsResponse,\n GetBrandJsonResponse,\n ListOptions,\n ListAgentsOptions,\n ListAgentsResponse,\n ListPublishersResponse,\n ValidateAdagentsRequest,\n ValidateAdagentsResponse,\n CreateAdagentsRequest,\n CreateAdagentsResponse,\n AdagentsAuthorizedAgent,\n AdagentsCatalogFormat,\n AdagentsPlacementDefinition,\n AdagentsPlacementFormatReference,\n AdagentsPlacementFormatOption,\n AdagentsPlacementTag,\n CreatedAdagentsJson,\n CommunityMirrorAdagentsConfig,\n CreateCommunityMirrorAdagentsConfig,\n CommunityMirrorAdagentsCatalog,\n PublishCommunityMirrorAdagentsResponse,\n CommunityMirrorAdagentsSummary,\n ListCommunityMirrorAdagentsResponse,\n GetCommunityMirrorAdagentsResponse,\n PublishCommunityMirrorAdagentsRequest,\n PublishCommunityMirrorAdagentsError,\n DeleteCommunityMirrorAdagentsResponse,\n PublisherPropertySelector,\n CompanySearchResult,\n FindCompanyResult,\n ManagerRevalidationRequest,\n ManagerRevalidationResponse,\n ListPoliciesQuery,\n ListPoliciesResponse,\n ResolvePolicyQuery,\n ResolvePolicyResponse,\n ResolvePoliciesBulkRequest,\n ResolvePoliciesBulkResponse,\n GetPolicyHistoryQuery,\n GetPolicyHistoryResponse,\n SavePolicyRequest,\n SavePolicyResponse,\n GetBrandHistoryQuery,\n GetBrandHistoryResponse,\n GetPropertyHistoryQuery,\n GetPropertyHistoryResponse,\n RegistryFeedEvent,\n AgentEventPayload,\n PropertyEventPayload,\n CollectionEventPayload,\n AuthorizationEventPayload,\n PublisherEventPayload,\n BrandEventPayload,\n CatalogBrowseResponse,\n CatalogBrowseEntry,\n CatalogSyncResponse,\n CatalogSyncEntry,\n AgentCompliance,\n AgentComplianceDetail,\n StoryboardStatus,\n OperatorLookupResult,\n PublisherLookupResult,\n ComplianceChangedPayload,\n GetAgentStoryboardStatusResponse,\n GetAgentStoryboardStatusBulkResponse,\n} from './registry';\n\n// ====== BRAND JSON HELPERS ======\nexport {\n COMMON_LOGO_SLOTS,\n applyBrandAssetMappings,\n checkLogoSlotCoverage,\n extractBrandWebsiteAliasDomains,\n extractBrandWebsiteAliases,\n selectLogoForSlot,\n updateBrandJsonFromMappings,\n validateBrandAssetMappings,\n} from './brand';\nexport type {\n AppliedBrandAssetMapping,\n ApplyBrandAssetMappingsOptions,\n ApplyBrandAssetMappingsResult,\n BrandAssetCandidate,\n BrandAssetCropBox,\n BrandAssetExtractionMethod,\n BrandAssetMapping,\n BrandAssetMappingIssue,\n BrandAssetMappingTarget,\n BrandAssetMappingValidationResult,\n BrandAssetReviewStatus,\n BrandWebsiteAlias,\n BrandWebsiteAliasRelationship,\n BrandWebsiteAliasSource,\n BrandJsonRecord,\n BrandLogoBackground,\n BrandLogoOrientation,\n BrandLogoProposal,\n BrandLogoVariant,\n ExtractBrandWebsiteAliasesOptions,\n LogoSelectionOptions,\n LogoSlotCoverage,\n LogoSlotCoverageOptions,\n ResolveBrandAssetUrl,\n SkippedBrandAssetMapping,\n UpdateBrandJsonFromMappingsOptions,\n UpdateBrandJsonFromMappingsResult,\n} from './brand';\n\n// ====== PROPERTY DISCOVERY (AdCP v2.2.0) ======\nexport {\n PropertyIndex,\n getPropertyIndex,\n resetPropertyIndex,\n type PropertyMatch,\n type AgentAuthorization,\n} from './discovery/property-index';\nexport {\n PropertyCrawler,\n type AgentInfo,\n type CrawlResult,\n type PropertyCrawlerConfig,\n} from './discovery/property-crawler';\nexport {\n NetworkConsistencyChecker,\n type NetworkConsistencyCheckerConfig,\n type NetworkCheckReport,\n type CheckSummary,\n type CheckProgress,\n type OrphanedPointer,\n type StalePointer,\n type MissingPointer,\n type SchemaError,\n type AgentHealthResult,\n type DomainDetail,\n type DomainStatus,\n} from './discovery/network-consistency-checker';\nexport type {\n Property,\n PropertyIdentifier,\n PropertyIdentifierType,\n PropertyType,\n AdAgentsJson,\n AuthorizedAgent,\n AuthorizationType,\n // Aliased: the registry types also export a `PublisherPropertySelector`\n // (registry-flat shape with no `selection_type` discriminator). The\n // adagents.json schema's variant is a discriminated union, so we\n // expose it under a distinct name to avoid clobbering the registry\n // type that's been part of the public API longer.\n PublisherPropertySelector as AdAgentsPublisherPropertySelector,\n SinglePublisherPropertySelector,\n CompactPublisherPropertySelector,\n} from './discovery/types';\nexport {\n parsePublisherPropertySelector,\n expandPublisherPropertySelector,\n expandPublisherPropertySelectors,\n isCompactPublisherPropertySelector,\n publisherDomainsCoveredBySelectors,\n PublisherPropertySelectorParseError,\n type PublisherPropertySelectorError,\n} from './discovery/publisher-property-selector';\nexport {\n resolveAgentProperties,\n listAgentPropertyMap,\n getAllProperties,\n canonicalizeAgentUrl,\n type ResolvedAgentScope,\n type ResolveUnresolvableReason,\n} from './discovery/resolve-agent-properties';\nexport {\n resolveInlinePublisherProperties,\n resolveSingularInline,\n detectInlineFederatedDivergence,\n type InlineResolutionResult,\n type InlineFederatedDivergence,\n} from './discovery/inline-publisher-properties';\nexport {\n fetchAgentAuthorizationsFromDirectory,\n type AgentAuthorizationsIterator,\n type FetchAgentAuthorizationsOptions,\n type DirectoryLookupPage,\n type DirectoryPublisherEntry,\n type DirectoryDiscoveryMethod,\n type DirectoryPublisherStatus,\n} from './discovery/agent-directory';\nexport {\n validateAdAgents,\n parseManagerDomain,\n type DiscoveryMethod,\n type AdAgentsValidationResult,\n type ValidateAdAgentsOptions,\n} from './discovery/validate-adagents';\n\n// ====== CORE CONVERSATION-AWARE CLIENTS ======\n// New conversation-aware clients with input handler pattern\nexport {\n SingleAgentClient,\n WebhookDispatchError,\n createSingleAgentClient,\n UnsupportedFeatureError,\n} from './core/SingleAgentClient';\nexport type {\n ClientProductPropertyPolicy,\n SingleAgentClientConfig,\n VerifyAndParseWebhookOptions,\n WebhookParseErrorCode,\n WebhookParseFailure,\n WebhookParseResult,\n WebhookParseSuccess,\n} from './core/SingleAgentClient';\nexport {\n AgentClient,\n type TaskResponseTypeMap,\n type AdcpTaskName,\n type InProcessAgentClientConfig,\n} from './core/AgentClient';\nexport { ADCPMultiAgentClient, createADCPMultiAgentClient } from './core/ADCPMultiAgentClient';\nexport { ConfigurationManager } from './core/ConfigurationManager';\nexport {\n CreativeAgentClient,\n createCreativeAgentClient,\n STANDARD_CREATIVE_AGENTS,\n type CreativeFormat,\n type CreativeAgentClientConfig,\n} from './core/CreativeAgentClient';\nexport { TaskExecutor } from './core/TaskExecutor';\nexport { match, attachMatch } from './core/match';\nexport type { MatchHandlers, PartialMatchHandlers } from './core/match';\nexport { ProtocolResponseParser, responseParser, ADCP_STATUS, type ADCPStatus } from './core/ProtocolResponseParser';\nexport {\n ResponseValidator,\n responseValidator,\n type ValidationResult,\n type ValidationOptions,\n} from './core/ResponseValidator';\n// ====== CONVERSATION TYPES ======\nexport type {\n Message,\n InputRequest,\n InputHandler,\n InputHandlerResponse,\n ConversationContext,\n TaskOptions,\n WebhookToolPredicate,\n WebhookUrlTemplate,\n TaskResult,\n TaskResultCompleted,\n TaskResultIntermediate,\n TaskResultFailure,\n TaskResultMetadata,\n TaskState,\n TaskStatus,\n ConversationConfig,\n AdcpErrorInfo,\n AdcpValidationIssue,\n} from './core/ConversationTypes';\n\n// ====== GOVERNANCE ======\n// Buyer-side: GovernanceConfig + GovernanceMiddleware handle check → execute → report automatically.\n// Seller-side: GovernanceAdapter runs committed checks before executing media buys.\n// Types: GovernanceCheckResult, GovernanceOutcome are attached to TaskResult when governance is active.\n\n// Buyer-side middleware types\nexport type {\n GovernanceConfig,\n CampaignGovernanceConfig,\n GovernanceCheckResult,\n GovernanceOutcome,\n GovernanceFinding,\n GovernanceCondition,\n GovernanceEscalation,\n} from './core/GovernanceTypes';\nexport { GovernanceMiddleware } from './core/GovernanceMiddleware';\nexport type { GovernanceDebugEntry } from './core/GovernanceMiddleware';\n\n// ====== GOVERNANCE PLAN HELPERS ======\n// Invariants the schema encodes via if/then / oneOf that generated types\n// typically drop: budget reallocation autonomy and regulated-vertical\n// human review under GDPR Art 22 / EU AI Act Annex III.\nexport {\n buildHumanReviewPlan,\n buildHumanOverride,\n validateGovernancePlan,\n REGULATED_HUMAN_REVIEW_CATEGORIES,\n ANNEX_III_POLICY_IDS,\n} from './governance';\n\n// ====== NETWORKING / SSRF GUARDS ======\n// Public so adopters can converge on the SDK's DNS-pinning and address\n// classification behavior instead of copying partial guards. Use\n// `ssrfSafeFetch` as the security boundary; address classifiers are advisory\n// helpers and do not protect raw fetches from DNS rebinding.\nexport {\n ssrfSafeFetch,\n decodeBodyAsJsonOrText,\n SSRF_TRANSIENT_CODES,\n SsrfRefusedError,\n isPrivateIp,\n isAlwaysBlocked,\n isLikelyPrivateUrl,\n type SsrfRefusedCode,\n type SsrfFetchOptions,\n type SsrfFetchResult,\n} from './net';\n\n// ====== CANONICAL REFERENCE RESOLUTION ======\n// Safe, structured resolver for AdCP 3.1 `format_schema` and\n// `platform_extensions` URI+SHA-256 references.\nexport {\n createCanonicalReferenceCache,\n createCanonicalReferenceResolver,\n canonicalReferenceCacheKey,\n resolveCanonicalReference,\n resolveFormatSchemaReference,\n resolvePlatformExtensionsReference,\n type CanonicalReference,\n type CanonicalReferenceCache,\n type CanonicalReferenceError,\n type CanonicalReferenceErrorCode,\n type CanonicalReferenceFailureResult,\n type CanonicalReferenceKind,\n type CanonicalReferenceResolveOptions,\n type CanonicalReferenceResolvedResult,\n type CanonicalReferenceResolver,\n type CanonicalReferenceResolverOptions,\n type CanonicalReferenceResult,\n type CanonicalReferenceStatus,\n type ExternalRefDigestMap,\n type FormatSchemaReferenceResolvedResult,\n type FormatSchemaReferenceResult,\n type PlatformExtensionsReferenceResult,\n} from './canonical-references';\nexport type {\n BuildHumanReviewPlanInput,\n BuildHumanOverrideInput,\n DataSubjectContestation,\n GovernancePlan,\n GovernanceValidationIssue,\n HumanOverride,\n PlanBudget,\n ReallocationAutonomy,\n} from './governance';\n\n// ====== TASK EVENT TYPES ======\nexport type {\n BaseTaskEvent,\n ProtocolRequestEvent,\n ProtocolResponseEvent,\n TaskStatusEvent,\n ObjectEvent,\n TaskEvent,\n TaskEventCallbacks,\n} from './core/TaskEventTypes';\nexport { createOperationId } from './core/TaskEventTypes';\n\n// ====== ASYNC HANDLER ======\nexport type {\n AsyncHandlerConfig,\n WebhookMetadata,\n Activity,\n NotificationMetadata,\n MediaBuyDeliveryNotification,\n CreateMediaBuyStatusChangeHandler,\n UpdateMediaBuyStatusChangeHandler,\n SyncCreativesStatusChangeHandler,\n GetProductsStatusChangeHandler,\n} from './core/AsyncHandler';\nexport { AsyncHandler, createAsyncHandler } from './core/AsyncHandler';\n\n// ====== WHOLESALE FEED WEBHOOKS ======\nexport {\n normalizeWholesaleFeedWebhookNotification,\n parseWholesaleFeedWebhookNotification,\n WholesaleFeedWebhookNotificationError,\n} from './wholesale-feed-sync/webhook-notification';\nexport type {\n NormalizedWholesaleFeedWebhookNotification,\n WholesaleFeedWebhookAffectedEntityType,\n WholesaleFeedWebhookCacheScope,\n WholesaleFeedWebhookNotificationErrorCode,\n WholesaleFeedWebhookNotificationErrorDetails,\n WholesaleFeedWebhookNotificationType,\n} from './wholesale-feed-sync/webhook-notification';\n\n// ====== INPUT HANDLERS ======\nexport * from './handlers/types';\n\n// ====== STORAGE INTERFACES ======\nexport type {\n Storage,\n BatchStorage,\n PatternStorage,\n AgentCapabilities,\n ConversationState,\n DeferredTaskState,\n StorageConfig,\n StorageFactory,\n StorageMiddleware,\n} from './storage/interfaces';\nexport { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from './storage/MemoryStorage';\n\n// ====== ERROR CLASSES ======\nexport {\n ADCPError,\n TaskTimeoutError,\n MaxClarificationError,\n DeferredTaskError,\n TaskAbortedError,\n AgentNotFoundError,\n UnsupportedTaskError,\n ProtocolError,\n ValidationError as ADCPValidationError, // Rename to avoid conflict\n MissingInputHandlerError,\n InvalidContextError,\n ConfigurationError,\n AuthenticationRequiredError,\n FeatureUnsupportedError,\n ProtocolFeatureUnsupportedError,\n SDK_ERROR_TO_PROTOCOL_ERROR_CODE,\n VersionUnsupportedError,\n IdempotencyConflictError,\n IdempotencyExpiredError,\n ResponseTooLargeError,\n ActionNotAllowedError,\n adcpErrorToTypedError,\n getClientPreflightAdcpError,\n isADCPError,\n isErrorOfType,\n extractErrorInfo,\n is401Error,\n mapSdkErrorCodeToProtocolErrorCode,\n} from './errors';\nexport type {\n OAuthMetadataInfo,\n ClientPreflightAdcpErrorInfo,\n ClientPreflightAdcpErrorRecovery,\n FeatureUnsupportedErrorOptions,\n ProtocolFeatureUnsupportedErrorOptions,\n ActionNotAllowedErrorDetails,\n ActionNotAllowedReasonValue,\n ActionNotAllowedAttemptedAction,\n ActionNotAllowedAvailableAction,\n ActionNotAllowedRecovery,\n} from './errors';\n\n// ====== MEDIA BUY ACTIONS (AdCP 3.1 / RFC #4480) ======\n// Wire-shape action types are generated; helper result/context types live in\n// the media-buy helper module.\nexport type {\n ActionNotAllowedDetails,\n ActionNotAllowedReason,\n AvailableActionsResult,\n AvailableActionsSource,\n DecomposedUpdateMediaBuy,\n DecomposedUpdateMediaBuyMutation,\n LegacyCoarseAction,\n MediaBuyActionContext,\n MediaBuyActionMode,\n MediaBuyAvailableAction,\n MediaBuyMutationDirection,\n MediaBuyMutationScope,\n MediaBuyValidAction,\n ModeMismatchRecovery,\n PreflightAllowed,\n PreflightDenial,\n PreflightDenied,\n BuyerPropertyPolicy,\n NormalizedPolicyDomain,\n ProductPolicyProductLike,\n ProductPropertyPolicyDiagnostic,\n ProductPropertyPolicyDiagnosticCode,\n ProductPropertyPolicyDiagnosticSeverity,\n ProductPropertyPolicyMode,\n ProductPropertyPolicySelectorBehavior,\n ProductPropertyPolicyValidationResult,\n PreflightResult,\n ResolvedAction,\n SLAWindow,\n SlaWindow,\n ValidateProductsAgainstPropertyPolicyOptions,\n UpdateFieldEntry,\n UpdateMediaBuyRequestLike,\n} from './media-buy';\nexport {\n ACTIONS_BY_FIELD,\n LEGACY_COARSE_ACTIONS,\n UPDATE_FIELDS_BY_ACTION,\n canAddPackages,\n canCancel,\n canDecreaseBudget,\n canExtendFlight,\n canIncreaseBudget,\n canPause,\n canReallocateBudget,\n canRemoveCreative,\n canRemovePackages,\n canReplaceCreative,\n canResume,\n canShortenFlight,\n canUpdateCreativeAssignments,\n canUpdateFlightDates,\n canUpdateFrequencyCaps,\n canUpdatePacing,\n canUpdateTargeting,\n decomposeUpdateMediaBuy,\n findAvailableAction,\n getActionForMutation,\n getAvailableActions,\n getRollupParent,\n ProductPropertyPolicyError,\n normalizeDomainForPropertyPolicy,\n preflightUpdateMediaBuy,\n recoveryForModeMismatch,\n validateProductsAgainstPropertyPolicy,\n} from './media-buy';\nexport { InputRequiredError } from './core/TaskExecutor';\n\n// ====== IDEMPOTENCY ======\nexport {\n generateIdempotencyKey,\n isMutatingTask,\n isValidIdempotencyKey,\n useIdempotencyKey,\n redactIdempotencyKey,\n IDEMPOTENCY_KEY_PATTERN,\n MUTATING_TASKS,\n} from './utils/idempotency';\nexport type { IdempotencyCapabilities } from './utils/capabilities';\nexport type { MutatingRequestInput } from './utils/idempotency';\nexport { canonicalize, canonicalJsonSha256 } from './utils/jcs';\nexport { rollupOptimizationMetricsFromProducts } from './utils/capability-rollups';\n\n// ====== CORE TYPES ======\nexport * from './types';\n\n// ====== TOOL TYPES ======\n// Request and response types for each AdCP tool.\n//\n// Naming convention:\n// {ToolName}Request -- parameters for a tool call (e.g., CreateMediaBuyRequest)\n// {ToolName}Response -- return value; often a union of {ToolName}Success | {ToolName}Error\n//\n// Nested domain types within requests use a Request suffix when the shape\n// differs from the response version:\n// PackageRequest -- creation-shaped (required: buyer_ref, product_id, budget, pricing_option_id)\n// Package -- response-shaped from core.generated (has package_id, most fields optional)\n//\n// Platform implementors: use Request types to type incoming tool calls,\n// Response types to shape your return values.\n// Runtime Zod schemas live at `@adcp/sdk/schemas` to keep ordinary root\n// imports from loading the generated schema declaration bundle.\nexport type {\n // Media Buy Domain\n GetProductsRequest,\n GetProductsResponse,\n ListCreativeFormatsRequest,\n ListCreativeFormatsResponse,\n CreateMediaBuyRequest,\n CreateMediaBuyResponse,\n CreateMediaBuySuccess,\n CreateMediaBuyError,\n CreateMediaBuySubmitted,\n UpdateMediaBuyRequest,\n UpdateMediaBuyResponse,\n UpdateMediaBuySuccess,\n UpdateMediaBuyError,\n SyncCreativesRequest,\n SyncCreativesResponse,\n SyncCreativesSuccess,\n SyncCreativesError,\n SyncCreativesSubmitted,\n SyncAudiencesRequest,\n SyncAudiencesResponse,\n SyncAudiencesSuccess,\n SyncAudiencesError,\n ListCreativesRequest,\n ListCreativesResponse,\n CreativeFilters,\n GetMediaBuyDeliveryRequest,\n GetMediaBuyDeliveryResponse,\n ProvidePerformanceFeedbackRequest,\n ProvidePerformanceFeedbackResponse,\n ProvidePerformanceFeedbackSuccess,\n ProvidePerformanceFeedbackError,\n // Signals Domain\n GetSignalsRequest,\n GetSignalsResponse,\n ActivateSignalRequest,\n ActivateSignalResponse,\n ActivateSignalSuccess,\n ActivateSignalError,\n CpmPricing,\n PercentOfMediaPricing,\n FlatFeePricing,\n PerUnitPricing,\n CustomPricing,\n VendorPricing,\n VendorPricingOption,\n // Pricing variants for products (publisher rate cards in get_products etc.)\n // PricingOption + CPAPricingOption are exported below near the other tool types.\n CPMPricingOption,\n VCPMPricingOption,\n CPCPricingOption,\n CPCVPricingOption,\n CPVPricingOption,\n CPPPricingOption,\n FlatRatePricingOption,\n TimeBasedPricingOption,\n // Governance Domain - Property Lists\n CreatePropertyListRequest,\n CreatePropertyListResponse,\n UpdatePropertyListRequest,\n UpdatePropertyListResponse,\n GetPropertyListRequest,\n GetPropertyListResponse,\n ListPropertyListsRequest,\n ListPropertyListsResponse,\n DeletePropertyListRequest,\n DeletePropertyListResponse,\n PropertyList,\n PropertyListFilters,\n // Governance Domain - Content Standards\n ListContentStandardsRequest,\n ListContentStandardsResponse,\n GetContentStandardsRequest,\n GetContentStandardsResponse,\n CreateContentStandardsRequest,\n CreateContentStandardsResponse,\n UpdateContentStandardsRequest,\n UpdateContentStandardsResponse,\n UpdateContentStandardsSuccess,\n UpdateContentStandardsError,\n CalibrateContentRequest,\n CalibrateContentResponse,\n ValidateContentDeliveryRequest,\n ValidateContentDeliveryResponse,\n ContentStandards,\n Artifact,\n // Governance Domain - Campaign Governance\n SyncPlansRequest,\n SyncPlansResponse,\n SyncGovernanceRequest,\n SyncGovernanceResponse,\n SyncGovernanceSuccess,\n SyncGovernanceError,\n CheckGovernanceRequest,\n CheckGovernanceResponse,\n ReportPlanOutcomeRequest,\n ReportPlanOutcomeResponse,\n GetPlanAuditLogsRequest,\n GetPlanAuditLogsResponse,\n // Governance Domain - Types & Enums\n PlannedDelivery,\n GovernancePhase,\n EscalationSeverity,\n PolicyEnforcementLevel,\n OutcomeType,\n // Governance Domain - Creative Features\n GetCreativeFeaturesRequest,\n GetCreativeFeaturesResponse,\n // Sponsored Intelligence Domain\n SIGetOfferingRequest,\n SIGetOfferingResponse,\n SIInitiateSessionRequest,\n SIInitiateSessionResponse,\n SISendMessageRequest,\n SISendMessageResponse,\n SITerminateSessionRequest,\n SITerminateSessionResponse,\n SICapabilities,\n SIIdentity,\n // Protocol Domain\n GetAdCPCapabilitiesRequest,\n GetAdCPCapabilitiesResponse,\n // Event Tracking Domain\n SyncEventSourcesRequest,\n SyncEventSourcesResponse,\n SyncEventSourcesSuccess,\n SyncEventSourcesError,\n LogEventRequest,\n LogEventResponse,\n LogEventSuccess,\n LogEventError,\n // Enums\n CanceledBy,\n // Core data structures used within requests and responses\n Format,\n Product,\n Proposal,\n ProductAllocation,\n PackageRequest, // Creation params for packages — not Package (response-shaped, from core.generated)\n CreativeAsset,\n CreativePolicy,\n BrandReference,\n BrandID,\n AccountReference,\n CPAPricingOption,\n EventType,\n ActionSource,\n OptimizationGoal,\n ReachUnit,\n TargetingOverlay,\n // 3.1.0-beta.2 renamed `OutcomeMeasurement` → `OutcomeMeasurementDeprecated`\n // to signal the surface is on the 4.0 removal track. Re-export under both\n // names so adopters' existing `import { OutcomeMeasurement }` keeps working.\n OutcomeMeasurementDeprecated,\n OutcomeMeasurementDeprecated as OutcomeMeasurement,\n Duration,\n DeviceType,\n DigitalSourceType,\n FrequencyCap,\n GeographicBreakdownSupport,\n // Catalog Domain\n Catalog,\n CatalogType,\n FeedFormat,\n UpdateFrequency,\n ContentIDType,\n CatalogFieldMapping,\n SyncCatalogsRequest,\n SyncCatalogsResponse,\n SyncCatalogsSuccess,\n SyncCatalogsError,\n // Format Assets\n Overlay,\n Placement,\n // Creative Agent Domain\n CreativeManifest,\n CreativeVariable,\n BuildCreativeRequest,\n BuildCreativeResponse,\n BuildCreativeSuccess,\n BuildCreativeMultiSuccess,\n BuildCreativeError,\n PreviewCreativeRequest,\n PreviewCreativeResponse,\n GetMediaBuysRequest,\n GetMediaBuysResponse,\n ImageAsset,\n VideoAsset,\n AudioAsset,\n TextAsset,\n URLAsset,\n HTMLAsset,\n VASTAsset,\n DAASTAsset,\n JavaScriptAsset,\n WebhookAsset,\n CSSAsset,\n MarkdownAsset,\n CatalogAsset,\n BriefAsset,\n ReferenceAsset,\n Provenance,\n PreviewOutputFormat,\n DisclosurePosition,\n // Event Tracking\n EventCustomData,\n // Creative Delivery Domain\n GetCreativeDeliveryRequest,\n GetCreativeDeliveryResponse,\n // Account Domain\n Account,\n ListAccountsRequest,\n ListAccountsResponse,\n SyncAccountsRequest,\n SyncAccountsResponse,\n SyncAccountsSuccess,\n SyncAccountsError,\n GetAccountFinancialsRequest,\n GetAccountFinancialsResponse,\n GetAccountFinancialsSuccess,\n GetAccountFinancialsError,\n // Pagination\n PaginationRequest,\n PaginationResponse,\n // Nested domain types used as fields within request/response objects\n PackageUpdate,\n Package,\n Destination,\n SignalFilters,\n PricingOption,\n PriceGuidance,\n} from './types/tools.generated';\nexport type {\n AccountStatus,\n CreativeStatus,\n DelegationAuthority,\n CatalogAction,\n CatalogItemStatus,\n MediaBuyStatus,\n // CreativeBrief is its own top-level schema (creative-brief.json) — emitted\n // in core.generated, no longer transitively pulled into tools.generated now\n // that BriefAsset merges its allOf[$ref] base inline.\n CreativeBrief,\n} from './types/core.generated';\n\n// ====== WELL-KNOWN FILE TYPES ======\n// brand.json / adagents.json shapes inferred from the canonical Zod schemas.\n// Re-exported explicitly here (in addition to the transitive `export * from\n// './types'` above) so the top-level public API contract is visible at the\n// main barrel and not dependent on the sub-barrel's wildcard re-export.\n// Source of truth: schemas/cache/{version}/{brand,adagents}.json — regenerate\n// with `npm run generate-wellknown-schemas` when the spec bumps.\nexport type { BrandJson, AdagentsJson } from './types/wellknown-schemas.generated';\nexport { BrandJsonSchema, AdagentsJsonSchema } from './types/wellknown-schemas.generated';\n\n// ====== ERROR CODES ======\n// Standard error code vocabulary for programmatic error handling\nexport type { Error as TaskErrorDetail } from './types/core.generated';\nexport { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery } from './types/error-codes';\nexport type { StandardErrorCode, ErrorRecovery } from './types/error-codes';\n\n// ====== SERVER-SIDE HELPERS ======\n// Helpers for building AdCP-compliant MCP servers\nexport {\n adcpError,\n capabilitiesResponse,\n productsResponse,\n mediaBuyResponse,\n deliveryResponse,\n listAccountsResponse,\n listCreativeFormatsResponse,\n updateMediaBuyResponse,\n getMediaBuysResponse,\n performanceFeedbackResponse,\n buildCreativeResponse,\n buildCreativeMultiResponse,\n previewCreativeResponse,\n creativeDeliveryResponse,\n listCreativesResponse,\n listPropertyListsResponse,\n listCollectionListsResponse,\n listContentStandardsResponse,\n getPlanAuditLogsResponse,\n syncCreativesResponse,\n getSignalsResponse,\n activateSignalResponse,\n cancelMediaBuyResponse,\n acquireRightsResponse,\n acquireRightsAcquired,\n acquireRightsPendingApproval,\n acquireRightsRejected,\n syncAccountsResponse,\n syncGovernanceResponse,\n reportUsageResponse,\n validActionsForStatus,\n MEDIA_BUY_TRANSITIONS,\n CREATIVE_ASSET_TRANSITIONS,\n isLegalMediaBuyTransition,\n isLegalCreativeTransition,\n assertMediaBuyTransition,\n assertCreativeTransition,\n getAccountMode,\n isSandboxOrMockAccount,\n assertSandboxAccount,\n taskToolResponse,\n registerAdcpTaskTool,\n createTaskCapableServer,\n InMemoryTaskStore,\n isTerminal,\n serve,\n UnknownHostError,\n hostname,\n resolveHost,\n verifyIntrospection,\n registerTestController,\n handleTestControllerRequest,\n TestControllerError,\n toMcpResponse,\n TOOL_INPUT_SHAPE,\n CONTROLLER_SCENARIOS,\n DISCOVERY_ARM_SCENARIOS,\n SEED_SCENARIOS,\n SESSION_ENTRY_CAP,\n enforceMapCap,\n createSeedFixtureCache,\n PostgresTaskStore,\n cleanupExpiredTasks,\n getMcpTasksMigration,\n MCP_TASKS_MIGRATION,\n ADCP_PRE_TRANSPORT,\n checkGovernance,\n governanceDeniedError,\n DEFAULT_REPORTING_CAPABILITIES,\n InMemoryStateStore,\n PostgresStateStore,\n getAdcpStateMigration,\n ADCP_STATE_MIGRATION,\n StateError,\n PatchConflictError,\n SESSION_KEY_FIELD,\n createSessionedStore,\n scopedStore,\n patchWithRetry,\n isPutIfMatchConflict,\n requireSessionKey,\n structuredSerialize,\n structuredDeserialize,\n createIdempotencyStore,\n memoryBackend,\n pgBackend,\n getIdempotencyMigration,\n IDEMPOTENCY_MIGRATION,\n cleanupExpiredIdempotency,\n redisBackend,\n createLazyBackend,\n hashPayload,\n getServeRequestContext,\n ADCP_SERVE_REQUEST_CONTEXT,\n createA2AAdapter,\n A2AInvocationError,\n} from './server';\nexport type {\n AdcpErrorOptions,\n AdcpErrorResponse,\n McpToolResponse,\n ValidAction,\n CancelMediaBuyInput,\n AdcpTaskToolConfig,\n TaskStore,\n TaskMessageQueue,\n CreateTaskOptions,\n ToolTaskHandler,\n CreateTaskRequestHandlerExtra,\n TaskRequestHandlerExtra,\n CreateTaskResult,\n GetTaskResult,\n Task,\n ServeContext,\n ServeOptions,\n PgQueryable,\n PostgresTaskStoreOptions,\n TestControllerStore,\n TestControllerStoreFactory,\n TestControllerStoreOrFactory,\n ControllerScenario,\n SeedScenario,\n SeedFixtureCache,\n SessionContext,\n OnInstructionsError,\n MaybePromise,\n AdcpServerConfig,\n AdcpToolMap,\n AdcpServerToolName,\n AdcpCapabilitiesConfig,\n AdcpCustomToolConfig,\n AdcpLogger,\n HandlerContext,\n MediaBuyHandlers,\n SignalsHandlers,\n CreativeHandlers,\n GovernanceHandlers,\n AccountHandlers,\n EventTrackingHandlers,\n SponsoredIntelligenceHandlers,\n SignedRequestsConfig,\n AdcpPreTransport,\n AdcpServer,\n AdcpServerTransport,\n AdcpTestRequest,\n AdcpTestToolsCallRequest,\n AdcpTestResponse,\n CheckGovernanceOptions,\n GovernanceCallResult,\n GovernanceApproved,\n GovernanceDenied,\n GovernanceConditions,\n AdcpStateStore,\n ListOptions as StateListOptions,\n ListResult as StateListResult,\n PostgresStateStoreOptions,\n InMemoryStateStoreOptions,\n VersionedDocument,\n PutIfMatchResult,\n PatchWithRetryOptions,\n StateErrorCode,\n SessionKeyContext,\n IdempotencyStore,\n IdempotencyStoreConfig,\n IdempotencyBackend,\n IdempotencyCacheEntry,\n IdempotencyCheckResult,\n MemoryBackendOptions,\n PgBackendOptions,\n RedisBackendOptions,\n RedisBackendClient,\n RedisLikeClient,\n LazyBackendFactory,\n LazyBackendOptions,\n A2AAdapter,\n A2AAdapterOptions,\n A2AAgentCardOverrides,\n A2AMountOptions,\n ExpressAppLike,\n AccountMode,\n RequireCacheScopeWhenProducts,\n ServerPayload,\n ListCreativeFormatsPayload,\n ListCreativeFormatsResponsePayload,\n ListCreativeFormatsServerPayload,\n SyncCreativesPayload,\n SyncCreativesSuccessPayload,\n SyncCreativesErrorPayload,\n} from './server';\n\n// ====== ERROR HANDLING & RETRY ======\nexport { isRetryable, getRetryDelay } from './utils/retry';\nexport { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy';\nexport type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy';\n\n// Public API: use these for programmatic error handling\nexport {\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './utils/error-extraction';\n\n// Internal: transport-level extraction (used by SDK internals; prefer result.adcpError instead)\nexport { extractAdcpErrorFromMcp, extractAdcpErrorFromTransport } from './utils/error-extraction';\nexport type { ExtractedAdcpError } from './utils/error-extraction';\nexport { extractVersionUnsupportedDetails } from './utils/error-extraction';\nexport type { VersionUnsupportedDetails } from './utils/error-extraction';\n\n// ====== BACKWARDS COMPATIBILITY ======\n// Deprecated types from past protocol migrations\nexport type {\n BrandManifest,\n BrandManifestReference,\n AssetContentType,\n PromotedProducts,\n PromotedOfferings,\n Measurement,\n} from './types/compat';\nexport { brandManifestToBrandReference, promotedProductsToCatalog, promotedOfferingsToCatalog } from './types/compat';\n\n// Request parameter normalization (deprecated field auto-conversion)\nexport { normalizeRequestParams, normalizePackageParams } from './utils/request-normalizer';\n\n// get_products response cache-scope helpers\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './utils/get-products-cache-scope';\n\n// ====== ENUM VALUE ARRAYS ======\n// `${TypeName}Values` const arrays for every named string-literal union in\n// the spec. Consumers can enumerate or validate against these without\n// duplicating literal lists from the Zod unions.\nexport * from './types/enums.generated';\n\n// `${ParentSchema}_${PropertyName}Values` const arrays for inline\n// anonymous unions inside named schemas — e.g.\n// `ImageAssetRequirements_FormatsValues`,\n// `VideoAssetRequirements_ContainersValues`. Companion to enums.generated;\n// see scripts/generate-inline-enum-arrays.ts for naming + scoping rules.\nexport * from './types/inline-enums.generated';\n\n// PreviewCreativeRequestSchema is now a flat z.object() with request_type discriminant.\n// The old variant exports (PreviewCreativeSingleRequestSchema, etc.) are no longer needed —\n// use PreviewCreativeRequestSchema.shape directly with server.registerTool().\n\n// ====== AUTHENTICATION ======\n// Auth utilities for custom integrations\nexport { getAuthToken, createAdCPHeaders, createMCPAuthHeaders, createAuthenticatedFetch } from './auth';\n\n// OAuth diagnostics utilities (see src/lib/auth/oauth/diagnostics.ts)\nexport {\n parseWWWAuthenticate,\n decodeAccessTokenClaims,\n validateTokenAudience,\n type WWWAuthenticateChallenge,\n type DecodedJWTHeader,\n type DecodedJWTClaims,\n type DecodedAccessToken,\n type TokenAudienceResult,\n InvalidTokenError,\n InsufficientScopeError,\n} from './auth/oauth';\n\n// End-to-end OAuth handshake diagnosis — powers `adcp diagnose-auth`\nexport {\n runAuthDiagnosis,\n AUTH_DIAGNOSIS_SCHEMA_VERSION,\n type DiagnoseOptions,\n type HttpCapture as DiagnosisHttpCapture,\n type DiagnosisStep,\n type Hypothesis as DiagnosisHypothesis,\n type HypothesisVerdict as DiagnosisHypothesisVerdict,\n type AuthDiagnosisReport,\n} from './auth/oauth';\n\n// Zero-config OAuth: actionable error + discovery + file storage + per-agent binding\nexport {\n NeedsAuthorizationError,\n discoverAuthorizationRequirements,\n createFileOAuthStorage,\n bindAgentStorage,\n getAgentStorage,\n unbindAgentStorage,\n type AuthorizationRequirements,\n type DiscoverAuthorizationOptions,\n type FileOAuthStorageOptions,\n} from './auth/oauth';\n\n// OAuth 2.0 client credentials (RFC 6749 §4.4) — machine-to-machine token\n// exchange used by programmatic CC consumers and by the CLI's `--save-auth\n// --oauth-token-url ...` flow. The library call path pre-refreshes before\n// every request automatically when `AgentConfig.oauth_client_credentials`\n// is set; these symbols are exposed for consumers that need explicit\n// control (building custom AgentConfigs, testing, or implementing\n// server-side `save_agent` endpoints like Addie's).\nexport {\n exchangeClientCredentials,\n ensureClientCredentialsTokens,\n ClientCredentialsExchangeError,\n MissingEnvSecretError,\n resolveSecret,\n isEnvSecretReference,\n toEnvSecretReference,\n extractEnvSecretName,\n type ExchangeClientCredentialsOptions,\n type EnsureClientCredentialsOptions,\n type AgentOAuthClientCredentials,\n} from './auth/oauth';\n\n// ====== VALIDATION ======\n// Schema validation for requests/responses\nexport { validateAgentUrl, validateAdCPResponse, getExpectedSchema, handleAdCPResponse } from './validation';\n\n// ====== PROTOCOL CLIENTS ======\n// Low-level protocol clients for MCP and A2A (primarily for testing)\nexport {\n ProtocolClient,\n callMCPTool,\n callA2ATool,\n createMCPClient,\n createA2AClient,\n closeMCPConnections,\n closeOAuthConnections,\n bundleSupportsAdcpVersionField,\n sanitizeTransportHeaders,\n sanitizeTransportUrl,\n} from './protocols';\nexport { toReleasePrecisionWire, validateAdcpVersionWire } from './validation/schema-loader';\nexport type {\n CallToolOptions,\n TransportActivity,\n TransportActivityContext,\n TransportActivityHandler,\n TransportOptions,\n} from './protocols';\n\n// ====== WIRE VERSION HELPERS (NAMESPACE) ======\n// Grouped re-exports of the three AdCP `adcp_version` envelope helpers\n// (spec PR adcontextprotocol/adcp#3493). Prefer this surface over the\n// individual top-level exports — the namespace stays stable as helpers\n// are added (a fourth helper drops in here without churning the barrel).\n// The top-level exports are kept for back-compat and aren't deprecated.\nimport { bundleSupportsAdcpVersionField as _isSupported } from './protocols';\nimport { toReleasePrecisionWire as _normalize, validateAdcpVersionWire as _validate } from './validation/schema-loader';\nexport const wireVersion = {\n isSupported: _isSupported,\n normalize: _normalize,\n validate: _validate,\n} as const;\n\n// ====== RESPONSE UTILITIES ======\n// Public utilities for working with AdCP responses\nexport {\n getStandardFormats,\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n getAuthoritativeMediaBuyStatus,\n isMediaBuyStatus,\n resolveTaskState,\n} from './utils';\nexport type { EffectiveTaskState, ResolvedTaskState, ResolveTaskStateOptions } from './utils';\nexport { injectLegacyEnvelopeStatus } from './utils/envelope-status-compat';\nexport { extractResult, type ToolCallResultLike } from './utils';\nexport { REQUEST_TIMEOUT, MAX_CONCURRENT, STANDARD_FORMATS } from './utils';\nexport {\n batchPreviewProducts,\n batchPreviewFormats,\n clearPreviewCache,\n type PreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './utils';\nexport { detectProtocol, detectProtocolWithTimeout } from './utils';\nexport { A2A_CARD_PATHS, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath } from './utils';\n\n// ====== PRICING UTILITIES ======\n// Pricing adapter for v2/v3 compatibility and CPA detection\nexport { isCPAPricing } from './utils';\n\n// ====== PAGINATION UTILITIES ======\n// Auto-pagination helpers for cursor-based AdCP endpoints\nexport { paginate, paginatePages, type PaginateOptions } from './utils';\n\n// ====== FORMAT ASSET UTILITIES ======\n// Access to format assets (v3 `assets` field)\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n} from './utils/format-assets';\n\n// ====== CREATIVE ASSET BUILDERS ======\n// Typed factories that inject the `asset_type` discriminator.\n// `imageAsset({ url, width, height })` returns a valid `ImageAsset`\n// without repeating `asset_type: 'image'` at every call site.\n// Prefer the named exports; use `Asset.image({...})` when constructing\n// several asset types together (assets-by-role manifests).\nexport {\n Asset,\n imageAsset,\n videoAsset,\n audioAsset,\n textAsset,\n urlAsset,\n htmlAsset,\n javascriptAsset,\n cssAsset,\n markdownAsset,\n webhookAsset,\n} from './utils/asset-builders';\n\n// ====== FORMAT ASSET SLOT BUILDERS ======\n// Typed factories for the slot definitions inside `Format.assets[]` — what a\n// seller/publisher declares it accepts. Each builder injects the `item_type`\n// and `asset_type` discriminators, and the `requirements` object is strictly\n// typed per asset_type: misnamed fields (`file_types` vs `formats`) and wrong\n// units (`min_duration_seconds` vs `min_duration_ms`) fail type-check.\n// Use `repeatableGroup({...})` (or `FormatAsset.group(...)`) to wrap assets\n// that repeat — that's the correct home for `min_count` / `max_count`.\nexport {\n FormatAsset,\n imageAssetSlot,\n videoAssetSlot,\n audioAssetSlot,\n textAssetSlot,\n markdownAssetSlot,\n htmlAssetSlot,\n cssAssetSlot,\n javascriptAssetSlot,\n vastAssetSlot,\n daastAssetSlot,\n urlAssetSlot,\n webhookAssetSlot,\n briefAssetSlot,\n catalogAssetSlot,\n repeatableGroup,\n imageGroupAsset,\n videoGroupAsset,\n audioGroupAsset,\n textGroupAsset,\n markdownGroupAsset,\n htmlGroupAsset,\n cssGroupAsset,\n javascriptGroupAsset,\n vastGroupAsset,\n daastGroupAsset,\n urlGroupAsset,\n webhookGroupAsset,\n} from './utils/format-asset-slot-builders';\n\n// ====== PREVIEW RENDER BUILDERS ======\n// Typed factories that inject the `output_format` discriminator on\n// `PreviewRender` objects. `urlRender({ render_id, preview_url, role })`\n// returns a valid url-variant render without repeating\n// `output_format: 'url'` at every call site. Matrix runs consistently\n// saw this drift: Claude emitted renders that omitted the discriminator\n// or its required sibling field.\nexport { Render, urlRender, htmlRender, bothRender } from './utils/render-builders';\n\n// ====== FORMAT RENDER BUILDERS ======\n// Typed factories for `Format.renders[]` entries on format declarations.\n// The item schema's `oneOf` forces a render to satisfy exactly one branch —\n// either `dimensions` (display/video) OR `parameters_from_format_id: true`\n// (audio, template formats). A render with only `{ role }` fails validation.\n// Audio specifically cannot use `{ role, duration_seconds }` — duration is\n// not a recognized `renders[]` field and wouldn't satisfy the oneOf anyway.\n// Use `parameterizedRender({ role })` (or the alias `templateRender`) so\n// format_id parameters carry duration.\n//\n// `FormatRender` below is the grouped namespace (value export). The v3\n// structural interface by the same name is re-exported from\n// `utils/format-renders` further down — TypeScript keeps type and value\n// namespaces separate, so both are available under the single import.\nexport {\n FormatRender,\n displayRender,\n parameterizedRender,\n templateRender,\n type DimensionsRender,\n type ParameterizedRender,\n type RenderItem,\n} from './utils/format-render-builders';\n\n// ====== CANONICAL CREATIVE FORMAT MIGRATION HELPERS ======\n// Author `Product.format_options[]`, v1 `format_id` references, and product\n// cards from one obvious namespace while migrating away from local Format.type\n// and product_card.format_id conventions.\nexport {\n CanonicalFormat,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './v2/projection';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForCapability,\n canonicalDeclarationFromBareId,\n resolveCanonicalFormatKind,\n CapabilityIdsLookupError,\n type BareFormatIdResolveOptions,\n type CanonicalOnlyProduct,\n type CapabilityIdsLookupErrorCode,\n type PackageFormatRefs,\n type ProjectionDiagnostic,\n type V1FormatId,\n type V1Product,\n type V2AugmentedProduct,\n type V2Product,\n type V2ProductFormatDeclaration,\n} from './v2/projection';\n\n// ====== ACTIVATION KEY BUILDERS ======\n// Typed factories that inject the `type` discriminator on `ActivationKey`.\n// SHAPE-GOTCHAS §1 — `key`/`value` flatten on the activation key itself.\nexport { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders';\n\n// ====== SIGNAL ID BUILDERS AND ACCESSORS ======\n// Typed factories that inject the `source` discriminator on `SignalID`.\n// Used in `signal_ids` filter arrays and as the `signal_id` provenance\n// field on every `Signal` returned by `get_signals`. SHAPE-GOTCHAS §2.\n// To read fields from a received `SignalID`, use `getSignalId` (segment id)\n// and `getSignalIssuer` (data_provider_domain or agent_url).\nexport { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders';\nexport {\n buildActivateSignalRequest,\n getSignalActivationId,\n getSignalPricingOptionIds,\n normalizeDiscoveredSignal,\n} from './utils/signal-discovery-helpers';\nexport type {\n BuildActivateSignalRequestOptions,\n DiscoveredSignal,\n NormalizedDiscoveredSignal,\n} from './utils/signal-discovery-helpers';\n\n// ====== BUILD CREATIVE RETURN BUILDERS ======\n// Typed factories for the four return shapes accepted by the framework\n// from `build_creative` handlers. `.single` / `.multi` emit bare manifests\n// the framework auto-wraps; `.singleEnveloped` / `.multiEnveloped` emit\n// the shaped envelope when the handler needs to attach `sandbox` /\n// `expires_at` / `preview`. SHAPE-GOTCHAS §5.\nexport {\n buildCreativeReturn,\n singleBuildCreativeReturn,\n multiBuildCreativeReturn,\n singleEnvelopedBuildCreativeReturn,\n multiEnvelopedBuildCreativeReturn,\n} from './utils/build-creative-return-builders';\n\n// ====== PREVIEW CREATIVE BUILDERS ======\n// Typed factories that inject the `response_type` discriminator on\n// `PreviewCreativeResponse`. Three-way oneOf — `single | batch | variant`.\n// Pair with `urlRender` / `htmlRender` / `bothRender` for the per-render\n// `output_format`. SHAPE-GOTCHAS §4.\nexport {\n previewCreative,\n singlePreviewCreativeResponse,\n batchPreviewCreativeResponse,\n variantPreviewCreativeResponse,\n} from './utils/preview-creative-builders';\n\n// ====== MEDIA BUY DELIVERY NOTIFICATION BUILDERS ======\n// Typed factories that inject the `notification_type` discriminator on\n// `GetMediaBuyDeliveryResponse` for webhook deliveries. Five variants:\n// `scheduled` / `final` / `delayed` / `adjusted` / `window_update`.\nexport {\n mediaBuyDeliveryNotification,\n scheduledMediaBuyDeliveryNotification,\n finalMediaBuyDeliveryNotification,\n delayedMediaBuyDeliveryNotification,\n adjustedMediaBuyDeliveryNotification,\n windowUpdateMediaBuyDeliveryNotification,\n} from './utils/media-buy-delivery-notification-builders';\n\n// ====== V3.0 COMPATIBILITY UTILITIES ======\n// Capabilities detection, version negotiation, and v3 enforcement.\n// See also:\n// - `VersionUnsupportedError` in errors — thrown by requireV3()/requireV3ForMutations\n// - `SyncCreativesItemSchema` in validation — per-item sync_creatives validator\n// - `ADCP_MAJOR_VERSION` / `COMPATIBLE_ADCP_VERSIONS` in version information\n// - `SingleAgentClient#requireV3()` / `AgentClient#requireV3()` — runtime gate\nexport {\n buildSyntheticCapabilities,\n buildSyntheticV3Capabilities,\n parseCapabilitiesResponse,\n supportsV3,\n supportsProtocol,\n supportsPropertyListFiltering,\n supportsContentStandards,\n supportsSyncCreatives,\n requiresOperatorAuth,\n requiresAccountForProducts,\n supportsSandbox,\n supportsExperimentalFeature,\n resolveFeature,\n listDeclaredFeatures,\n MEDIA_BUY_TOOLS,\n SIGNALS_TOOLS,\n GOVERNANCE_TOOLS,\n CREATIVE_TOOLS,\n EVENT_TRACKING_TOOLS,\n ACCOUNT_TOOLS,\n PROTOCOL_TOOLS,\n BRAND_RIGHTS_TOOLS,\n TASK_FEATURE_MAP,\n} from './utils/capabilities';\nexport type {\n AdcpCapabilities,\n AdcpMajorVersion,\n AdcpProtocol,\n AccountCapabilities,\n MediaBuyFeatures,\n ToolInfo,\n FeatureName,\n} from './utils/capabilities';\n\n// Buyer-side creative delivery helpers\nexport { inlineCreativesForPackages } from './utils/creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n} from './utils/creative-delivery';\n\n// Creative assignment adapter (v2 creative_ids ↔ v3 creative_assignments)\nexport {\n adaptPackageRequestForV2,\n adaptCreateMediaBuyRequestForV2,\n adaptUpdateMediaBuyRequestForV2,\n normalizePackageResponse,\n normalizeMediaBuyResponse,\n usesV2CreativeIds,\n usesV3CreativeAssignments,\n getCreativeIds,\n getCreativeAssignments,\n} from './utils/creative-adapter';\nexport type { CreativeAssignment } from './utils/creative-adapter';\n\n// Format renders normalizer (v2 dimensions ↔ v3 renders)\nexport {\n normalizeFormatRenders,\n normalizeFormatsResponse,\n getFormatRenders,\n getPrimaryRender,\n getCompanionRenders,\n isMultiRenderFormat,\n usesV2Dimensions,\n usesV3Renders,\n getFormatDimensions,\n} from './utils/format-renders';\n// FormatRender (the v3 structural interface) was renamed to FormatRenderEntry\n// so the `FormatRender` name at the barrel becomes the factory namespace\n// exported from `./utils/format-render-builders` above. The deprecated type\n// alias `FormatRender = FormatRenderEntry` still lives in `utils/format-renders`\n// for callers importing the sub-module directly; it's not re-exported here.\nexport type { FormatRenderEntry, RenderDimensions } from './utils/format-renders';\n\n// Preview response normalizer (v2 output_id ↔ v3 render_id)\nexport {\n normalizePreviewRender,\n normalizePreview,\n normalizePreviewCreativeResponse,\n usesV2RenderFields,\n usesV3RenderFields,\n getRenderId,\n getRenderRole,\n getPrimaryPreviewRender,\n getPreviewUrl,\n getPreviewHtml,\n} from './utils/preview-normalizer';\nexport type { PreviewRenderV3 } from './utils/preview-normalizer';\n\n// ====== TYPE GUARD UTILITIES ======\n// Type guards for automatic TypeScript type narrowing in webhook handlers\nexport {\n // Generic status checks\n isStatusCompleted,\n isStatusWorking,\n isStatusInputRequired,\n isStatusSubmitted,\n isStatusFailed,\n isStatusRejected,\n // GetProducts type guards\n isGetProductsCompleted,\n isGetProductsWorking,\n isGetProductsInputRequired,\n isGetProductsSubmitted,\n isGetProductsFailed,\n // CreateMediaBuy type guards\n isCreateMediaBuyCompleted,\n isCreateMediaBuyWorking,\n isCreateMediaBuyInputRequired,\n isCreateMediaBuySubmitted,\n isCreateMediaBuyFailed,\n // UpdateMediaBuy type guards\n isUpdateMediaBuyCompleted,\n isUpdateMediaBuyWorking,\n isUpdateMediaBuyInputRequired,\n isUpdateMediaBuySubmitted,\n isUpdateMediaBuyFailed,\n // SyncCreatives type guards\n isSyncCreativesCompleted,\n isSyncCreativesWorking,\n isSyncCreativesInputRequired,\n isSyncCreativesSubmitted,\n isSyncCreativesFailed,\n} from './utils/typeGuards';\n\n// ====== VERSION INFORMATION ======\nexport {\n getAdcpVersion,\n getLibraryVersion,\n isCompatibleWith,\n getCompatibleVersions,\n parseAdcpMajorVersion,\n ADCP_VERSION,\n ADCP_MAJOR_VERSION,\n LIBRARY_VERSION,\n COMPATIBLE_ADCP_VERSIONS,\n VERSION_INFO,\n} from './version';\nexport type { AdcpVersion } from './version';\nexport { resolveAdcpVersion } from './utils/adcp-version-config';\n\n// ====== OBSERVABILITY ======\n// OpenTelemetry tracing utilities (no-op if @opentelemetry/api not installed)\nexport {\n getTracer,\n isTracingEnabled,\n injectTraceHeaders,\n withSpan,\n addSpanAttributes,\n recordSpanException,\n} from './observability';\n\n// ====== AGENT CLASSES ======\n// Primary agent interface - returns raw AdCP responses\nexport { Agent, AgentCollection } from './agents/index.generated';\n\n// ====== SERVER-SIDE ADAPTERS ======\n// Adapters for building AdCP servers with customizable business logic\nexport {\n // Content Standards\n ContentStandardsAdapter,\n type IContentStandardsAdapter,\n type ContentEvaluationResult,\n ContentStandardsErrorCodes,\n isContentStandardsError,\n defaultContentStandardsAdapter,\n // Property Lists\n PropertyListAdapter,\n type IPropertyListAdapter,\n type ResolvedProperty,\n PropertyListErrorCodes,\n isPropertyListError,\n defaultPropertyListAdapter,\n // Sponsored Intelligence Sessions\n SISessionManager,\n AISISessionManager,\n type ISISessionManager,\n type SISession,\n SIErrorCodes,\n defaultSISessionManager,\n // Governance (seller-side committed checks)\n GovernanceAdapter,\n defaultGovernanceAdapter,\n type IGovernanceAdapter,\n type GovernanceAdapterConfig,\n type GovernanceAdapterErrorCode,\n type CommittedCheckRequest,\n GovernanceAdapterErrorCodes,\n isGovernanceAdapterError,\n // Implicit Account Store (resolution: 'implicit') — Shape A reference adapter\n InMemoryImplicitAccountStore,\n defaultImplicitKeyFn,\n type ImplicitAccountStoreOptions,\n // OAuth pass-through resolver — Shape B accounts.resolve factory\n createOAuthPassthroughResolver,\n type OAuthPassthroughResolverOptions,\n // Roster-backed AccountStore — Shape C factory for publisher-curated explicit platforms\n createRosterAccountStore,\n type RosterAccountStoreOptions,\n // Derived AccountStore — Shape D factory for single-tenant `resolution: 'derived'` agents\n createDerivedAccountStore,\n type DerivedAccountStoreOptions,\n} from './adapters';\n\n// ====== BACKWARD COMPATIBILITY & ENVIRONMENT LOADING ======\n\nimport type { AgentConfig } from './types';\nimport { ADCPMultiAgentClient } from './core/ADCPMultiAgentClient';\n\n/**\n * Legacy AdCPClient alias for backward compatibility\n * @deprecated Use ADCPMultiAgentClient instead for new code\n */\nexport const AdCPClient = ADCPMultiAgentClient;\n\n// Legacy configuration manager maintained for backward compatibility\n// The enhanced ConfigurationManager is exported above\n\n/**\n * Legacy createAdCPClient function for backward compatibility\n * @deprecated Use new ADCPMultiAgentClient constructor instead\n */\nexport function createAdCPClient(agents?: AgentConfig[]): ADCPMultiAgentClient {\n return new AdCPClient(agents);\n}\n\n/**\n * Load agents from environment and create multi-agent client\n * @deprecated Use ADCPMultiAgentClient.fromEnv() instead\n */\nexport function createAdCPClientFromEnv(): ADCPMultiAgentClient {\n return ADCPMultiAgentClient.fromEnv();\n}\n\n// ====== SUBSTITUTION OBSERVER / ENCODER ======\n// Primitives backing the `substitution-observer-runner` test-kit contract.\n// Runners (conformance graders) import the observer side; sales/retail-\n// media agents implementing the #2620 catalog-item macro encoding rule\n// import `SubstitutionEncoder`. Re-exported here for discoverability;\n// the full surface is also available via `@adcp/sdk/substitution`.\nexport {\n SubstitutionObserver,\n SubstitutionEncoder,\n PreviewFetchError,\n MacroInRawValueError,\n CATALOG_MACRO_VECTORS,\n getCatalogMacroVector,\n extractTrackerUrls,\n matchBindings,\n assertRfc3986Safe,\n assertUnreservedOnly,\n assertNoNestedExpansion,\n assertSchemePreserved,\n DEFAULT_MACRO_PROHIBITED_PATTERN,\n enforceSsrfPolicy,\n enforceSsrfPolicyResolved,\n DEFAULT_SSRF_POLICY,\n encodeUnreserved,\n equalUnderHexCasePolicy,\n isUnreservedOnly,\n divergenceOffset,\n translateUniversalMacros,\n} from './substitution';\nexport type {\n ObserverFetchOptions,\n ObserverDispatcher,\n CatalogMacroVectorName,\n AssertionOptions as SubstitutionAssertionOptions,\n AssertionResult as SubstitutionAssertionResult,\n BindingMatch,\n CatalogBinding,\n CatalogMacroVector,\n PolicyResult as SubstitutionPolicyResult,\n SsrfPolicy,\n TrackerUrlRecord,\n MacroMapping,\n TranslateResult,\n} from './substitution';\n\n// ====== TEST HELPERS ======\n// Re-export test helpers for convenience (also available via @adcp/sdk/testing)\nexport {\n testAgent,\n testAgentA2A,\n testAgentClient,\n createTestAgent,\n TEST_AGENT_TOKEN,\n TEST_AGENT_MCP_CONFIG,\n TEST_AGENT_A2A_CONFIG,\n testAgentNoAuth,\n testAgentNoAuthA2A,\n TEST_AGENT_NO_AUTH_MCP_CONFIG,\n TEST_AGENT_NO_AUTH_A2A_CONFIG,\n creativeAgent,\n testBrandRightsFlow,\n hasBrandRightsTools,\n expectControllerError,\n expectControllerSuccess,\n RateLimitTripObserver,\n RATE_LIMIT_TRIP_CONTRACT,\n RATE_LIMIT_TRIP_DEFAULT_REPLAY_MAX_WAIT_SECONDS,\n RATE_LIMIT_TRIP_MAX_ATTEMPTS_MAX,\n RATE_LIMIT_TRIP_MAX_ATTEMPTS_MIN,\n validateRateLimitTripSpec,\n} from './testing/index';\nexport type {\n ControllerErrorWithDetail,\n TestClient,\n RateLimitTripSpec,\n RateLimitTripClient,\n RateLimitTripFailureCode,\n RateLimitTripObservation,\n RateLimitTripObserverOptions,\n RateLimitTripResponseSnapshot,\n RateLimitTripStructuredResult,\n RateLimitTripTaskOptions,\n} from './testing/index';\n"],"mappings":"AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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tC;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAmBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["ADCPMultiAgentClient"]}
1
+ {"version":3,"sources":["../../src/lib/index.ts"],"sourcesContent":["// AdCP Client Library - Main Exports\n// A comprehensive type-safe client library for the AdContext Protocol\n\n// ====== REGISTRY LOOKUPS ======\nexport {\n RegistryClient,\n RegistrySync,\n PropertyRegistry,\n InMemoryCursorStore,\n FileCursorStore,\n buildCommunityMirrorAdagents,\n} from './registry';\nexport type {\n RegistrySyncConfig,\n RegistrySyncState,\n RegistrySyncTransport,\n RegistrySyncEvents,\n AgentFilter,\n RegistrySyncProperty,\n CursorStore,\n PropertyRegistryConfig,\n FeedStreamQuery,\n FeedStreamMessage,\n FeedHeartbeat,\n FeedStreamErrorData,\n OpenFeedStreamOptions,\n FeedFreshness,\n} from './registry';\nexport {\n openFeedStream,\n parseSseStream,\n sanitizeStreamText,\n DEFAULT_MAX_SSE_FRAME_BYTES,\n FeedStreamError,\n FeedStreamUnsupportedError,\n FeedStreamCursorExpiredError,\n FeedStreamHttpError,\n FeedStreamParseError,\n} from './registry';\nexport type {\n ResolvedBrand,\n BrandHierarchyResolution,\n BrandHierarchyBulkResolution,\n ResolveBrandHierarchyOptions,\n ResolvedProperty as ResolvedRegistryProperty,\n PropertyInfo,\n RegistryClientConfig,\n SaveBrandRequest,\n SaveBrandResponse,\n BrandLogoReviewStatus,\n ApprovedBrandLogoAsset,\n PendingBrandLogoAsset,\n ReviewedBrandLogoAsset,\n BrandLogoAsset,\n ListBrandLogosOptions,\n ListBrandLogosResponse,\n SaveBrandLogoInput,\n SaveBrandLogoResponse,\n UploadBrandLogoInput,\n UploadBrandLogoResponse,\n SavePropertyIdentity,\n RegistryPropertyIdentity,\n SavePropertyRequest,\n SavePropertyResponse,\n ResolveIdentifiersRequest,\n ResolveIdentifiersResponse,\n FileCatalogDisputeRequest,\n FileCatalogDisputeResponse,\n GetCatalogDisputeResponse,\n BrandRegistryItem,\n PropertyRegistryItem,\n ValidationResult as RegistryValidationResult,\n FederatedAgentWithDetails,\n FederatedPublisher,\n DomainLookupResult,\n ListBrandsOptions,\n ListBrandsResponse,\n GetBrandJsonResponse,\n ListOptions,\n ListAgentsOptions,\n ListAgentsResponse,\n ListPublishersResponse,\n ValidateAdagentsRequest,\n ValidateAdagentsResponse,\n CreateAdagentsRequest,\n CreateAdagentsResponse,\n AdagentsAuthorizedAgent,\n AdagentsCatalogFormat,\n AdagentsPlacementDefinition,\n AdagentsPlacementFormatReference,\n AdagentsPlacementFormatOption,\n AdagentsPlacementTag,\n CreatedAdagentsJson,\n CommunityMirrorAdagentsConfig,\n CreateCommunityMirrorAdagentsConfig,\n CommunityMirrorAdagentsCatalog,\n PublishCommunityMirrorAdagentsResponse,\n CommunityMirrorAdagentsSummary,\n ListCommunityMirrorAdagentsResponse,\n GetCommunityMirrorAdagentsResponse,\n PublishCommunityMirrorAdagentsRequest,\n PublishCommunityMirrorAdagentsError,\n DeleteCommunityMirrorAdagentsResponse,\n PublisherPropertySelector,\n CompanySearchResult,\n FindCompanyResult,\n ManagerRevalidationRequest,\n ManagerRevalidationResponse,\n ListPoliciesQuery,\n ListPoliciesResponse,\n ResolvePolicyQuery,\n ResolvePolicyResponse,\n ResolvePoliciesBulkRequest,\n ResolvePoliciesBulkResponse,\n GetPolicyHistoryQuery,\n GetPolicyHistoryResponse,\n SavePolicyRequest,\n SavePolicyResponse,\n GetBrandHistoryQuery,\n GetBrandHistoryResponse,\n GetPropertyHistoryQuery,\n GetPropertyHistoryResponse,\n RegistryFeedEvent,\n AgentEventPayload,\n PropertyEventPayload,\n CollectionEventPayload,\n AuthorizationEventPayload,\n PublisherEventPayload,\n BrandEventPayload,\n CatalogBrowseResponse,\n CatalogBrowseEntry,\n CatalogSyncResponse,\n CatalogSyncEntry,\n AgentCompliance,\n AgentComplianceDetail,\n StoryboardStatus,\n OperatorLookupResult,\n PublisherLookupResult,\n ComplianceChangedPayload,\n GetAgentStoryboardStatusResponse,\n GetAgentStoryboardStatusBulkResponse,\n} from './registry';\n\n// ====== BRAND JSON HELPERS ======\nexport {\n COMMON_LOGO_SLOTS,\n applyBrandAssetMappings,\n checkLogoSlotCoverage,\n extractBrandWebsiteAliasDomains,\n extractBrandWebsiteAliases,\n selectLogoForSlot,\n updateBrandJsonFromMappings,\n validateBrandAssetMappings,\n} from './brand';\nexport type {\n AppliedBrandAssetMapping,\n ApplyBrandAssetMappingsOptions,\n ApplyBrandAssetMappingsResult,\n BrandAssetCandidate,\n BrandAssetCropBox,\n BrandAssetExtractionMethod,\n BrandAssetMapping,\n BrandAssetMappingIssue,\n BrandAssetMappingTarget,\n BrandAssetMappingValidationResult,\n BrandAssetReviewStatus,\n BrandWebsiteAlias,\n BrandWebsiteAliasRelationship,\n BrandWebsiteAliasSource,\n BrandJsonRecord,\n BrandLogoBackground,\n BrandLogoOrientation,\n BrandLogoProposal,\n BrandLogoVariant,\n ExtractBrandWebsiteAliasesOptions,\n LogoSelectionOptions,\n LogoSlotCoverage,\n LogoSlotCoverageOptions,\n ResolveBrandAssetUrl,\n SkippedBrandAssetMapping,\n UpdateBrandJsonFromMappingsOptions,\n UpdateBrandJsonFromMappingsResult,\n} from './brand';\n\n// ====== PROPERTY DISCOVERY (AdCP v2.2.0) ======\nexport {\n PropertyIndex,\n getPropertyIndex,\n resetPropertyIndex,\n type PropertyMatch,\n type AgentAuthorization,\n} from './discovery/property-index';\nexport {\n PropertyCrawler,\n type AgentInfo,\n type CrawlResult,\n type PropertyCrawlerConfig,\n} from './discovery/property-crawler';\nexport {\n NetworkConsistencyChecker,\n type NetworkConsistencyCheckerConfig,\n type NetworkCheckReport,\n type CheckSummary,\n type CheckProgress,\n type OrphanedPointer,\n type StalePointer,\n type MissingPointer,\n type SchemaError,\n type AgentHealthResult,\n type DomainDetail,\n type DomainStatus,\n} from './discovery/network-consistency-checker';\nexport type {\n Property,\n PropertyIdentifier,\n PropertyIdentifierType,\n PropertyType,\n AdAgentsJson,\n AuthorizedAgent,\n AuthorizationType,\n // Aliased: the registry types also export a `PublisherPropertySelector`\n // (registry-flat shape with no `selection_type` discriminator). The\n // adagents.json schema's variant is a discriminated union, so we\n // expose it under a distinct name to avoid clobbering the registry\n // type that's been part of the public API longer.\n PublisherPropertySelector as AdAgentsPublisherPropertySelector,\n SinglePublisherPropertySelector,\n CompactPublisherPropertySelector,\n} from './discovery/types';\nexport {\n parsePublisherPropertySelector,\n expandPublisherPropertySelector,\n expandPublisherPropertySelectors,\n isCompactPublisherPropertySelector,\n publisherDomainsCoveredBySelectors,\n PublisherPropertySelectorParseError,\n type PublisherPropertySelectorError,\n} from './discovery/publisher-property-selector';\nexport {\n resolveAgentProperties,\n listAgentPropertyMap,\n getAllProperties,\n canonicalizeAgentUrl,\n type ResolvedAgentScope,\n type ResolveUnresolvableReason,\n} from './discovery/resolve-agent-properties';\nexport {\n resolveInlinePublisherProperties,\n resolveSingularInline,\n detectInlineFederatedDivergence,\n type InlineResolutionResult,\n type InlineFederatedDivergence,\n} from './discovery/inline-publisher-properties';\nexport {\n fetchAgentAuthorizationsFromDirectory,\n type AgentAuthorizationsIterator,\n type FetchAgentAuthorizationsOptions,\n type DirectoryLookupPage,\n type DirectoryPublisherEntry,\n type DirectoryDiscoveryMethod,\n type DirectoryPublisherStatus,\n} from './discovery/agent-directory';\nexport {\n validateAdAgents,\n parseManagerDomain,\n type DiscoveryMethod,\n type AdAgentsValidationResult,\n type ValidateAdAgentsOptions,\n} from './discovery/validate-adagents';\n\n// ====== CORE CONVERSATION-AWARE CLIENTS ======\n// New conversation-aware clients with input handler pattern\nexport {\n SingleAgentClient,\n WebhookDispatchError,\n createSingleAgentClient,\n UnsupportedFeatureError,\n} from './core/SingleAgentClient';\nexport type {\n ClientProductPropertyPolicy,\n SingleAgentClientConfig,\n VerifyAndParseWebhookOptions,\n WebhookParseErrorCode,\n WebhookParseFailure,\n WebhookParseResult,\n WebhookParseSuccess,\n} from './core/SingleAgentClient';\nexport {\n AgentClient,\n type TaskResponseTypeMap,\n type AdcpTaskName,\n type InProcessAgentClientConfig,\n} from './core/AgentClient';\nexport { ADCPMultiAgentClient, createADCPMultiAgentClient } from './core/ADCPMultiAgentClient';\nexport { ConfigurationManager } from './core/ConfigurationManager';\nexport {\n CreativeAgentClient,\n createCreativeAgentClient,\n STANDARD_CREATIVE_AGENTS,\n type CreativeFormat,\n type CreativeAgentClientConfig,\n} from './core/CreativeAgentClient';\nexport { TaskExecutor } from './core/TaskExecutor';\nexport { match, attachMatch } from './core/match';\nexport type { MatchHandlers, PartialMatchHandlers } from './core/match';\nexport { ProtocolResponseParser, responseParser, ADCP_STATUS, type ADCPStatus } from './core/ProtocolResponseParser';\nexport {\n ResponseValidator,\n responseValidator,\n type ValidationResult,\n type ValidationOptions,\n} from './core/ResponseValidator';\n// ====== CONVERSATION TYPES ======\nexport type {\n Message,\n InputRequest,\n InputHandler,\n InputHandlerResponse,\n ConversationContext,\n TaskOptions,\n WebhookToolPredicate,\n WebhookUrlTemplate,\n TaskResult,\n TaskResultCompleted,\n TaskResultIntermediate,\n TaskResultFailure,\n TaskResultMetadata,\n TaskState,\n TaskStatus,\n ConversationConfig,\n AdcpErrorInfo,\n AdcpValidationIssue,\n} from './core/ConversationTypes';\n\n// ====== GOVERNANCE ======\n// Buyer-side: GovernanceConfig + GovernanceMiddleware handle check → execute → report automatically.\n// Seller-side: GovernanceAdapter runs committed checks before executing media buys.\n// Types: GovernanceCheckResult, GovernanceOutcome are attached to TaskResult when governance is active.\n\n// Buyer-side middleware types\nexport type {\n GovernanceConfig,\n CampaignGovernanceConfig,\n GovernanceCheckResult,\n GovernanceOutcome,\n GovernanceFinding,\n GovernanceCondition,\n GovernanceEscalation,\n} from './core/GovernanceTypes';\nexport { GovernanceMiddleware } from './core/GovernanceMiddleware';\nexport type { GovernanceDebugEntry } from './core/GovernanceMiddleware';\n\n// ====== GOVERNANCE PLAN HELPERS ======\n// Invariants the schema encodes via if/then / oneOf that generated types\n// typically drop: budget reallocation autonomy and regulated-vertical\n// human review under GDPR Art 22 / EU AI Act Annex III.\nexport {\n buildHumanReviewPlan,\n buildHumanOverride,\n validateGovernancePlan,\n REGULATED_HUMAN_REVIEW_CATEGORIES,\n ANNEX_III_POLICY_IDS,\n} from './governance';\n\n// ====== NETWORKING / SSRF GUARDS ======\n// Public so adopters can converge on the SDK's DNS-pinning and address\n// classification behavior instead of copying partial guards. Use\n// `ssrfSafeFetch` as the security boundary; address classifiers are advisory\n// helpers and do not protect raw fetches from DNS rebinding.\nexport {\n ssrfSafeFetch,\n decodeBodyAsJsonOrText,\n SSRF_TRANSIENT_CODES,\n SsrfRefusedError,\n isPrivateIp,\n isAlwaysBlocked,\n isLikelyPrivateUrl,\n type SsrfRefusedCode,\n type SsrfFetchOptions,\n type SsrfFetchResult,\n} from './net';\n\n// ====== CANONICAL REFERENCE RESOLUTION ======\n// Safe, structured resolver for AdCP 3.1 `format_schema` and\n// `platform_extensions` URI+SHA-256 references.\nexport {\n createCanonicalReferenceCache,\n createCanonicalReferenceResolver,\n canonicalReferenceCacheKey,\n resolveCanonicalReference,\n resolveFormatSchemaReference,\n resolvePlatformExtensionsReference,\n type CanonicalReference,\n type CanonicalReferenceCache,\n type CanonicalReferenceError,\n type CanonicalReferenceErrorCode,\n type CanonicalReferenceFailureResult,\n type CanonicalReferenceKind,\n type CanonicalReferenceResolveOptions,\n type CanonicalReferenceResolvedResult,\n type CanonicalReferenceResolver,\n type CanonicalReferenceResolverOptions,\n type CanonicalReferenceResult,\n type CanonicalReferenceStatus,\n type ExternalRefDigestMap,\n type FormatSchemaReferenceResolvedResult,\n type FormatSchemaReferenceResult,\n type PlatformExtensionsReferenceResult,\n} from './canonical-references';\nexport type {\n BuildHumanReviewPlanInput,\n BuildHumanOverrideInput,\n DataSubjectContestation,\n GovernancePlan,\n GovernanceValidationIssue,\n HumanOverride,\n PlanBudget,\n ReallocationAutonomy,\n} from './governance';\n\n// ====== TASK EVENT TYPES ======\nexport type {\n BaseTaskEvent,\n ProtocolRequestEvent,\n ProtocolResponseEvent,\n TaskStatusEvent,\n ObjectEvent,\n TaskEvent,\n TaskEventCallbacks,\n} from './core/TaskEventTypes';\nexport { createOperationId } from './core/TaskEventTypes';\n\n// ====== ASYNC HANDLER ======\nexport type {\n AsyncHandlerConfig,\n WebhookMetadata,\n Activity,\n NotificationMetadata,\n MediaBuyDeliveryNotification,\n CreateMediaBuyStatusChangeHandler,\n UpdateMediaBuyStatusChangeHandler,\n SyncCreativesStatusChangeHandler,\n GetProductsStatusChangeHandler,\n} from './core/AsyncHandler';\nexport { AsyncHandler, createAsyncHandler } from './core/AsyncHandler';\n\n// ====== WHOLESALE FEED WEBHOOKS ======\nexport {\n normalizeWholesaleFeedWebhookNotification,\n parseWholesaleFeedWebhookNotification,\n WholesaleFeedWebhookNotificationError,\n} from './wholesale-feed-sync/webhook-notification';\nexport type {\n NormalizedWholesaleFeedWebhookNotification,\n WholesaleFeedWebhookAffectedEntityType,\n WholesaleFeedWebhookCacheScope,\n WholesaleFeedWebhookNotificationErrorCode,\n WholesaleFeedWebhookNotificationErrorDetails,\n WholesaleFeedWebhookNotificationType,\n} from './wholesale-feed-sync/webhook-notification';\n\n// ====== INPUT HANDLERS ======\nexport * from './handlers/types';\n\n// ====== STORAGE INTERFACES ======\nexport type {\n Storage,\n BatchStorage,\n PatternStorage,\n AgentCapabilities,\n ConversationState,\n DeferredTaskState,\n StorageConfig,\n StorageFactory,\n StorageMiddleware,\n} from './storage/interfaces';\nexport { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from './storage/MemoryStorage';\n\n// ====== ERROR CLASSES ======\nexport {\n ADCPError,\n TaskTimeoutError,\n MaxClarificationError,\n DeferredTaskError,\n TaskAbortedError,\n AgentNotFoundError,\n UnsupportedTaskError,\n ProtocolError,\n ValidationError as ADCPValidationError, // Rename to avoid conflict\n MissingInputHandlerError,\n InvalidContextError,\n ConfigurationError,\n AuthenticationRequiredError,\n FeatureUnsupportedError,\n ProtocolFeatureUnsupportedError,\n SDK_ERROR_TO_PROTOCOL_ERROR_CODE,\n VersionUnsupportedError,\n IdempotencyConflictError,\n IdempotencyExpiredError,\n ResponseTooLargeError,\n ActionNotAllowedError,\n adcpErrorToTypedError,\n getClientPreflightAdcpError,\n isADCPError,\n isErrorOfType,\n extractErrorInfo,\n is401Error,\n mapSdkErrorCodeToProtocolErrorCode,\n} from './errors';\nexport type {\n OAuthMetadataInfo,\n ClientPreflightAdcpErrorInfo,\n ClientPreflightAdcpErrorRecovery,\n FeatureUnsupportedErrorOptions,\n ProtocolFeatureUnsupportedErrorOptions,\n ActionNotAllowedErrorDetails,\n ActionNotAllowedReasonValue,\n ActionNotAllowedAttemptedAction,\n ActionNotAllowedAvailableAction,\n ActionNotAllowedRecovery,\n} from './errors';\n\n// ====== MEDIA BUY ACTIONS (AdCP 3.1 / RFC #4480) ======\n// Wire-shape action types are generated; helper result/context types live in\n// the media-buy helper module.\nexport type {\n ActionNotAllowedDetails,\n ActionNotAllowedReason,\n AvailableActionsResult,\n AvailableActionsSource,\n DecomposedUpdateMediaBuy,\n DecomposedUpdateMediaBuyMutation,\n LegacyCoarseAction,\n MediaBuyActionContext,\n MediaBuyActionMode,\n MediaBuyAvailableAction,\n MediaBuyMutationDirection,\n MediaBuyMutationScope,\n MediaBuyValidAction,\n ModeMismatchRecovery,\n PreflightAllowed,\n PreflightDenial,\n PreflightDenied,\n BuyerPropertyPolicy,\n NormalizedPolicyDomain,\n ProductPolicyProductLike,\n ProductPropertyPolicyDiagnostic,\n ProductPropertyPolicyDiagnosticCode,\n ProductPropertyPolicyDiagnosticSeverity,\n ProductPropertyPolicyMode,\n ProductPropertyPolicySelectorBehavior,\n ProductPropertyPolicyValidationResult,\n PreflightResult,\n ResolvedAction,\n SLAWindow,\n SlaWindow,\n ValidateProductsAgainstPropertyPolicyOptions,\n UpdateFieldEntry,\n UpdateMediaBuyRequestLike,\n} from './media-buy';\nexport {\n ACTIONS_BY_FIELD,\n LEGACY_COARSE_ACTIONS,\n UPDATE_FIELDS_BY_ACTION,\n canAddPackages,\n canCancel,\n canDecreaseBudget,\n canExtendFlight,\n canIncreaseBudget,\n canPause,\n canReallocateBudget,\n canRemoveCreative,\n canRemovePackages,\n canReplaceCreative,\n canResume,\n canShortenFlight,\n canUpdateCreativeAssignments,\n canUpdateFlightDates,\n canUpdateFrequencyCaps,\n canUpdatePacing,\n canUpdateTargeting,\n decomposeUpdateMediaBuy,\n findAvailableAction,\n getActionForMutation,\n getAvailableActions,\n getRollupParent,\n ProductPropertyPolicyError,\n normalizeDomainForPropertyPolicy,\n preflightUpdateMediaBuy,\n recoveryForModeMismatch,\n validateProductsAgainstPropertyPolicy,\n} from './media-buy';\nexport { InputRequiredError } from './core/TaskExecutor';\n\n// ====== IDEMPOTENCY ======\nexport {\n generateIdempotencyKey,\n isMutatingTask,\n isValidIdempotencyKey,\n useIdempotencyKey,\n redactIdempotencyKey,\n IDEMPOTENCY_KEY_PATTERN,\n MUTATING_TASKS,\n} from './utils/idempotency';\nexport type { IdempotencyCapabilities } from './utils/capabilities';\nexport type { MutatingRequestInput } from './utils/idempotency';\nexport { canonicalize, canonicalJsonSha256 } from './utils/jcs';\nexport { rollupOptimizationMetricsFromProducts } from './utils/capability-rollups';\n\n// ====== CORE TYPES ======\nexport * from './types';\n\n// ====== TOOL TYPES ======\n// Request and response types for each AdCP tool.\n//\n// Naming convention:\n// {ToolName}Request -- parameters for a tool call (e.g., CreateMediaBuyRequest)\n// {ToolName}Response -- return value; often a union of {ToolName}Success | {ToolName}Error\n//\n// Nested domain types within requests use a Request suffix when the shape\n// differs from the response version:\n// PackageRequest -- creation-shaped (required: buyer_ref, product_id, budget, pricing_option_id)\n// Package -- response-shaped from core.generated (has package_id, most fields optional)\n//\n// Platform implementors: use Request types to type incoming tool calls,\n// Response types to shape your return values.\n// Runtime Zod schemas live at `@adcp/sdk/schemas` to keep ordinary root\n// imports from loading the generated schema declaration bundle.\nexport type {\n // Media Buy Domain\n GetProductsRequest,\n GetProductsResponse,\n ListCreativeFormatsRequest,\n ListCreativeFormatsResponse,\n CreateMediaBuyRequest,\n CreateMediaBuyResponse,\n CreateMediaBuySuccess,\n CreateMediaBuyError,\n CreateMediaBuySubmitted,\n UpdateMediaBuyRequest,\n UpdateMediaBuyResponse,\n UpdateMediaBuySuccess,\n UpdateMediaBuyError,\n SyncCreativesRequest,\n SyncCreativesResponse,\n SyncCreativesSuccess,\n SyncCreativesError,\n SyncCreativesSubmitted,\n SyncAudiencesRequest,\n SyncAudiencesResponse,\n SyncAudiencesSuccess,\n SyncAudiencesError,\n ListCreativesRequest,\n ListCreativesResponse,\n CreativeFilters,\n GetMediaBuyDeliveryRequest,\n GetMediaBuyDeliveryResponse,\n ProvidePerformanceFeedbackRequest,\n ProvidePerformanceFeedbackResponse,\n ProvidePerformanceFeedbackSuccess,\n ProvidePerformanceFeedbackError,\n // Signals Domain\n GetSignalsRequest,\n GetSignalsResponse,\n ActivateSignalRequest,\n ActivateSignalResponse,\n ActivateSignalSuccess,\n ActivateSignalError,\n CpmPricing,\n PercentOfMediaPricing,\n FlatFeePricing,\n PerUnitPricing,\n CustomPricing,\n VendorPricing,\n VendorPricingOption,\n // Pricing variants for products (publisher rate cards in get_products etc.)\n // PricingOption + CPAPricingOption are exported below near the other tool types.\n CPMPricingOption,\n VCPMPricingOption,\n CPCPricingOption,\n CPCVPricingOption,\n CPVPricingOption,\n CPPPricingOption,\n FlatRatePricingOption,\n TimeBasedPricingOption,\n // Governance Domain - Property Lists\n CreatePropertyListRequest,\n CreatePropertyListResponse,\n UpdatePropertyListRequest,\n UpdatePropertyListResponse,\n GetPropertyListRequest,\n GetPropertyListResponse,\n ListPropertyListsRequest,\n ListPropertyListsResponse,\n DeletePropertyListRequest,\n DeletePropertyListResponse,\n PropertyList,\n PropertyListFilters,\n // Governance Domain - Content Standards\n ListContentStandardsRequest,\n ListContentStandardsResponse,\n GetContentStandardsRequest,\n GetContentStandardsResponse,\n CreateContentStandardsRequest,\n CreateContentStandardsResponse,\n UpdateContentStandardsRequest,\n UpdateContentStandardsResponse,\n UpdateContentStandardsSuccess,\n UpdateContentStandardsError,\n CalibrateContentRequest,\n CalibrateContentResponse,\n ValidateContentDeliveryRequest,\n ValidateContentDeliveryResponse,\n ContentStandards,\n Artifact,\n // Governance Domain - Campaign Governance\n SyncPlansRequest,\n SyncPlansResponse,\n SyncGovernanceRequest,\n SyncGovernanceResponse,\n SyncGovernanceSuccess,\n SyncGovernanceError,\n CheckGovernanceRequest,\n CheckGovernanceResponse,\n ReportPlanOutcomeRequest,\n ReportPlanOutcomeResponse,\n GetPlanAuditLogsRequest,\n GetPlanAuditLogsResponse,\n // Governance Domain - Types & Enums\n PlannedDelivery,\n GovernancePhase,\n EscalationSeverity,\n PolicyEnforcementLevel,\n OutcomeType,\n // Governance Domain - Creative Features\n GetCreativeFeaturesRequest,\n GetCreativeFeaturesResponse,\n // Sponsored Intelligence Domain\n SIGetOfferingRequest,\n SIGetOfferingResponse,\n SIInitiateSessionRequest,\n SIInitiateSessionResponse,\n SISendMessageRequest,\n SISendMessageResponse,\n SITerminateSessionRequest,\n SITerminateSessionResponse,\n SICapabilities,\n SIIdentity,\n // Protocol Domain\n GetAdCPCapabilitiesRequest,\n GetAdCPCapabilitiesResponse,\n // Event Tracking Domain\n SyncEventSourcesRequest,\n SyncEventSourcesResponse,\n SyncEventSourcesSuccess,\n SyncEventSourcesError,\n LogEventRequest,\n LogEventResponse,\n LogEventSuccess,\n LogEventError,\n // Enums\n CanceledBy,\n // Core data structures used within requests and responses\n Format,\n Product,\n Proposal,\n ProductAllocation,\n PackageRequest, // Creation params for packages — not Package (response-shaped, from core.generated)\n CreativeAsset,\n CreativePolicy,\n BrandReference,\n BrandID,\n AccountReference,\n CPAPricingOption,\n EventType,\n ActionSource,\n OptimizationGoal,\n ReachUnit,\n TargetingOverlay,\n // 3.1.0-beta.2 renamed `OutcomeMeasurement` → `OutcomeMeasurementDeprecated`\n // to signal the surface is on the 4.0 removal track. Re-export under both\n // names so adopters' existing `import { OutcomeMeasurement }` keeps working.\n OutcomeMeasurementDeprecated,\n OutcomeMeasurementDeprecated as OutcomeMeasurement,\n Duration,\n DeviceType,\n DigitalSourceType,\n FrequencyCap,\n GeographicBreakdownSupport,\n // Catalog Domain\n Catalog,\n CatalogType,\n FeedFormat,\n UpdateFrequency,\n ContentIDType,\n CatalogFieldMapping,\n SyncCatalogsRequest,\n SyncCatalogsResponse,\n SyncCatalogsSuccess,\n SyncCatalogsError,\n // Format Assets\n Overlay,\n Placement,\n // Creative Agent Domain\n CreativeManifest,\n CreativeVariable,\n BuildCreativeRequest,\n BuildCreativeResponse,\n BuildCreativeSuccess,\n BuildCreativeMultiSuccess,\n BuildCreativeError,\n PreviewCreativeRequest,\n PreviewCreativeResponse,\n GetMediaBuysRequest,\n GetMediaBuysResponse,\n ImageAsset,\n VideoAsset,\n AudioAsset,\n TextAsset,\n URLAsset,\n HTMLAsset,\n VASTAsset,\n DAASTAsset,\n JavaScriptAsset,\n WebhookAsset,\n CSSAsset,\n MarkdownAsset,\n CatalogAsset,\n BriefAsset,\n ReferenceAsset,\n Provenance,\n PreviewOutputFormat,\n DisclosurePosition,\n // Event Tracking\n EventCustomData,\n // Creative Delivery Domain\n GetCreativeDeliveryRequest,\n GetCreativeDeliveryResponse,\n // Account Domain\n Account,\n ListAccountsRequest,\n ListAccountsResponse,\n SyncAccountsRequest,\n SyncAccountsResponse,\n SyncAccountsSuccess,\n SyncAccountsError,\n GetAccountFinancialsRequest,\n GetAccountFinancialsResponse,\n GetAccountFinancialsSuccess,\n GetAccountFinancialsError,\n // Pagination\n PaginationRequest,\n PaginationResponse,\n // Nested domain types used as fields within request/response objects\n PackageUpdate,\n Package,\n Destination,\n SignalFilters,\n PricingOption,\n PriceGuidance,\n} from './types/tools.generated';\nexport type {\n AccountStatus,\n CreativeStatus,\n DelegationAuthority,\n CatalogAction,\n CatalogItemStatus,\n MediaBuyStatus,\n // CreativeBrief is its own top-level schema (creative-brief.json) — emitted\n // in core.generated, no longer transitively pulled into tools.generated now\n // that BriefAsset merges its allOf[$ref] base inline.\n CreativeBrief,\n} from './types/core.generated';\n\n// ====== WELL-KNOWN FILE TYPES ======\n// brand.json / adagents.json shapes inferred from the canonical Zod schemas.\n// Re-exported explicitly here (in addition to the transitive `export * from\n// './types'` above) so the top-level public API contract is visible at the\n// main barrel and not dependent on the sub-barrel's wildcard re-export.\n// Source of truth: schemas/cache/{version}/{brand,adagents}.json — regenerate\n// with `npm run generate-wellknown-schemas` when the spec bumps.\nexport type { BrandJson, AdagentsJson } from './types/wellknown-schemas.generated';\nexport { BrandJsonSchema, AdagentsJsonSchema } from './types/wellknown-schemas.generated';\n\n// ====== ERROR CODES ======\n// Standard error code vocabulary for programmatic error handling\nexport type { Error as TaskErrorDetail } from './types/core.generated';\nexport { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery } from './types/error-codes';\nexport type { StandardErrorCode, ErrorRecovery } from './types/error-codes';\n\n// ====== SERVER-SIDE HELPERS ======\n// Helpers for building AdCP-compliant MCP servers\nexport {\n adcpError,\n capabilitiesResponse,\n productsResponse,\n mediaBuyResponse,\n deliveryResponse,\n listAccountsResponse,\n listCreativeFormatsResponse,\n updateMediaBuyResponse,\n getMediaBuysResponse,\n performanceFeedbackResponse,\n buildCreativeResponse,\n buildCreativeMultiResponse,\n previewCreativeResponse,\n creativeDeliveryResponse,\n listCreativesResponse,\n listPropertyListsResponse,\n listCollectionListsResponse,\n listContentStandardsResponse,\n getPlanAuditLogsResponse,\n syncCreativesResponse,\n getSignalsResponse,\n activateSignalResponse,\n cancelMediaBuyResponse,\n acquireRightsResponse,\n acquireRightsAcquired,\n acquireRightsPendingApproval,\n acquireRightsRejected,\n syncAccountsResponse,\n syncGovernanceResponse,\n reportUsageResponse,\n validActionsForStatus,\n MEDIA_BUY_TRANSITIONS,\n CREATIVE_ASSET_TRANSITIONS,\n isLegalMediaBuyTransition,\n isLegalCreativeTransition,\n assertMediaBuyTransition,\n assertCreativeTransition,\n getAccountMode,\n isSandboxOrMockAccount,\n assertSandboxAccount,\n taskToolResponse,\n registerAdcpTaskTool,\n createTaskCapableServer,\n InMemoryTaskStore,\n isTerminal,\n serve,\n UnknownHostError,\n hostname,\n resolveHost,\n verifyIntrospection,\n registerTestController,\n handleTestControllerRequest,\n TestControllerError,\n toMcpResponse,\n TOOL_INPUT_SHAPE,\n CONTROLLER_SCENARIOS,\n DISCOVERY_ARM_SCENARIOS,\n SEED_SCENARIOS,\n SESSION_ENTRY_CAP,\n enforceMapCap,\n createSeedFixtureCache,\n PostgresTaskStore,\n cleanupExpiredTasks,\n getMcpTasksMigration,\n MCP_TASKS_MIGRATION,\n ADCP_PRE_TRANSPORT,\n checkGovernance,\n governanceDeniedError,\n DEFAULT_REPORTING_CAPABILITIES,\n InMemoryStateStore,\n PostgresStateStore,\n getAdcpStateMigration,\n ADCP_STATE_MIGRATION,\n StateError,\n PatchConflictError,\n SESSION_KEY_FIELD,\n createSessionedStore,\n scopedStore,\n patchWithRetry,\n isPutIfMatchConflict,\n requireSessionKey,\n structuredSerialize,\n structuredDeserialize,\n createIdempotencyStore,\n memoryBackend,\n pgBackend,\n getIdempotencyMigration,\n IDEMPOTENCY_MIGRATION,\n cleanupExpiredIdempotency,\n redisBackend,\n createLazyBackend,\n hashPayload,\n getServeRequestContext,\n ADCP_SERVE_REQUEST_CONTEXT,\n createA2AAdapter,\n A2AInvocationError,\n MCP_APP_RESOURCE_MIME_TYPE,\n} from './server';\nexport type {\n AdcpErrorOptions,\n AdcpErrorResponse,\n McpToolResponse,\n ValidAction,\n CancelMediaBuyInput,\n AdcpTaskToolConfig,\n TaskStore,\n TaskMessageQueue,\n CreateTaskOptions,\n ToolTaskHandler,\n CreateTaskRequestHandlerExtra,\n TaskRequestHandlerExtra,\n CreateTaskResult,\n GetTaskResult,\n Task,\n ServeContext,\n ServeOptions,\n PgQueryable,\n PostgresTaskStoreOptions,\n TestControllerStore,\n TestControllerStoreFactory,\n TestControllerStoreOrFactory,\n ControllerScenario,\n SeedScenario,\n SeedFixtureCache,\n SessionContext,\n OnInstructionsError,\n MaybePromise,\n AdcpServerConfig,\n AdcpToolMap,\n AdcpServerToolName,\n AdcpCapabilitiesConfig,\n AdcpCustomToolConfig,\n McpAppUiMeta,\n McpAppMeta,\n AdcpMcpResourceDefinition,\n McpAppResourceCsp,\n McpAppResourcePermissions,\n McpAppResourceUiMeta,\n McpAppResourceMeta,\n McpAppResourceReadContext,\n AdcpLogger,\n HandlerContext,\n MediaBuyHandlers,\n SignalsHandlers,\n CreativeHandlers,\n GovernanceHandlers,\n AccountHandlers,\n EventTrackingHandlers,\n SponsoredIntelligenceHandlers,\n SignedRequestsConfig,\n AdcpPreTransport,\n AdcpServer,\n AdcpServerTransport,\n AdcpTestRequest,\n AdcpTestToolsCallRequest,\n AdcpTestResponse,\n CheckGovernanceOptions,\n GovernanceCallResult,\n GovernanceApproved,\n GovernanceDenied,\n GovernanceConditions,\n AdcpStateStore,\n ListOptions as StateListOptions,\n ListResult as StateListResult,\n PostgresStateStoreOptions,\n InMemoryStateStoreOptions,\n VersionedDocument,\n PutIfMatchResult,\n PatchWithRetryOptions,\n StateErrorCode,\n SessionKeyContext,\n IdempotencyStore,\n IdempotencyStoreConfig,\n IdempotencyBackend,\n IdempotencyCacheEntry,\n IdempotencyCheckResult,\n MemoryBackendOptions,\n PgBackendOptions,\n RedisBackendOptions,\n RedisBackendClient,\n RedisLikeClient,\n LazyBackendFactory,\n LazyBackendOptions,\n A2AAdapter,\n A2AAdapterOptions,\n A2AAgentCardOverrides,\n A2AMountOptions,\n ExpressAppLike,\n AccountMode,\n RequireCacheScopeWhenProducts,\n ServerPayload,\n ListCreativeFormatsPayload,\n ListCreativeFormatsResponsePayload,\n ListCreativeFormatsServerPayload,\n SyncCreativesPayload,\n SyncCreativesSuccessPayload,\n SyncCreativesErrorPayload,\n} from './server';\n\n// ====== ERROR HANDLING & RETRY ======\nexport { isRetryable, getRetryDelay } from './utils/retry';\nexport { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy';\nexport type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy';\n\n// Public API: use these for programmatic error handling\nexport {\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './utils/error-extraction';\n\n// Internal: transport-level extraction (used by SDK internals; prefer result.adcpError instead)\nexport { extractAdcpErrorFromMcp, extractAdcpErrorFromTransport } from './utils/error-extraction';\nexport type { ExtractedAdcpError } from './utils/error-extraction';\nexport { extractVersionUnsupportedDetails } from './utils/error-extraction';\nexport type { VersionUnsupportedDetails } from './utils/error-extraction';\n\n// ====== BACKWARDS COMPATIBILITY ======\n// Deprecated types from past protocol migrations\nexport type {\n BrandManifest,\n BrandManifestReference,\n AssetContentType,\n PromotedProducts,\n PromotedOfferings,\n Measurement,\n} from './types/compat';\nexport { brandManifestToBrandReference, promotedProductsToCatalog, promotedOfferingsToCatalog } from './types/compat';\n\n// Request parameter normalization (deprecated field auto-conversion)\nexport { normalizeRequestParams, normalizePackageParams } from './utils/request-normalizer';\n\n// get_products response cache-scope helpers\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './utils/get-products-cache-scope';\n\n// ====== ENUM VALUE ARRAYS ======\n// `${TypeName}Values` const arrays for every named string-literal union in\n// the spec. Consumers can enumerate or validate against these without\n// duplicating literal lists from the Zod unions.\nexport * from './types/enums.generated';\n\n// `${ParentSchema}_${PropertyName}Values` const arrays for inline\n// anonymous unions inside named schemas — e.g.\n// `ImageAssetRequirements_FormatsValues`,\n// `VideoAssetRequirements_ContainersValues`. Companion to enums.generated;\n// see scripts/generate-inline-enum-arrays.ts for naming + scoping rules.\nexport * from './types/inline-enums.generated';\n\n// PreviewCreativeRequestSchema is now a flat z.object() with request_type discriminant.\n// The old variant exports (PreviewCreativeSingleRequestSchema, etc.) are no longer needed —\n// use PreviewCreativeRequestSchema.shape directly with server.registerTool().\n\n// ====== AUTHENTICATION ======\n// Auth utilities for custom integrations\nexport { getAuthToken, createAdCPHeaders, createMCPAuthHeaders, createAuthenticatedFetch } from './auth';\n\n// OAuth diagnostics utilities (see src/lib/auth/oauth/diagnostics.ts)\nexport {\n parseWWWAuthenticate,\n decodeAccessTokenClaims,\n validateTokenAudience,\n type WWWAuthenticateChallenge,\n type DecodedJWTHeader,\n type DecodedJWTClaims,\n type DecodedAccessToken,\n type TokenAudienceResult,\n InvalidTokenError,\n InsufficientScopeError,\n} from './auth/oauth';\n\n// End-to-end OAuth handshake diagnosis — powers `adcp diagnose-auth`\nexport {\n runAuthDiagnosis,\n AUTH_DIAGNOSIS_SCHEMA_VERSION,\n type DiagnoseOptions,\n type HttpCapture as DiagnosisHttpCapture,\n type DiagnosisStep,\n type Hypothesis as DiagnosisHypothesis,\n type HypothesisVerdict as DiagnosisHypothesisVerdict,\n type AuthDiagnosisReport,\n} from './auth/oauth';\n\n// Zero-config OAuth: actionable error + discovery + file storage + per-agent binding\nexport {\n NeedsAuthorizationError,\n discoverAuthorizationRequirements,\n createFileOAuthStorage,\n bindAgentStorage,\n getAgentStorage,\n unbindAgentStorage,\n type AuthorizationRequirements,\n type DiscoverAuthorizationOptions,\n type FileOAuthStorageOptions,\n} from './auth/oauth';\n\n// OAuth 2.0 client credentials (RFC 6749 §4.4) — machine-to-machine token\n// exchange used by programmatic CC consumers and by the CLI's `--save-auth\n// --oauth-token-url ...` flow. The library call path pre-refreshes before\n// every request automatically when `AgentConfig.oauth_client_credentials`\n// is set; these symbols are exposed for consumers that need explicit\n// control (building custom AgentConfigs, testing, or implementing\n// server-side `save_agent` endpoints like Addie's).\nexport {\n exchangeClientCredentials,\n ensureClientCredentialsTokens,\n ClientCredentialsExchangeError,\n MissingEnvSecretError,\n resolveSecret,\n isEnvSecretReference,\n toEnvSecretReference,\n extractEnvSecretName,\n type ExchangeClientCredentialsOptions,\n type EnsureClientCredentialsOptions,\n type AgentOAuthClientCredentials,\n} from './auth/oauth';\n\n// ====== VALIDATION ======\n// Schema validation for requests/responses\nexport { validateAgentUrl, validateAdCPResponse, getExpectedSchema, handleAdCPResponse } from './validation';\n\n// ====== PROTOCOL CLIENTS ======\n// Low-level protocol clients for MCP and A2A (primarily for testing)\nexport {\n ProtocolClient,\n callMCPTool,\n callA2ATool,\n createMCPClient,\n createA2AClient,\n closeMCPConnections,\n closeOAuthConnections,\n bundleSupportsAdcpVersionField,\n sanitizeTransportHeaders,\n sanitizeTransportUrl,\n} from './protocols';\nexport { toReleasePrecisionWire, validateAdcpVersionWire } from './validation/schema-loader';\nexport type {\n CallToolOptions,\n TransportActivity,\n TransportActivityContext,\n TransportActivityHandler,\n TransportOptions,\n} from './protocols';\n\n// ====== WIRE VERSION HELPERS (NAMESPACE) ======\n// Grouped re-exports of the three AdCP `adcp_version` envelope helpers\n// (spec PR adcontextprotocol/adcp#3493). Prefer this surface over the\n// individual top-level exports — the namespace stays stable as helpers\n// are added (a fourth helper drops in here without churning the barrel).\n// The top-level exports are kept for back-compat and aren't deprecated.\nimport { bundleSupportsAdcpVersionField as _isSupported } from './protocols';\nimport { toReleasePrecisionWire as _normalize, validateAdcpVersionWire as _validate } from './validation/schema-loader';\nexport const wireVersion = {\n isSupported: _isSupported,\n normalize: _normalize,\n validate: _validate,\n} as const;\n\n// ====== RESPONSE UTILITIES ======\n// Public utilities for working with AdCP responses\nexport {\n getStandardFormats,\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n getAuthoritativeMediaBuyStatus,\n isMediaBuyStatus,\n resolveTaskState,\n} from './utils';\nexport type { EffectiveTaskState, ResolvedTaskState, ResolveTaskStateOptions } from './utils';\nexport { injectLegacyEnvelopeStatus } from './utils/envelope-status-compat';\nexport { extractResult, type ToolCallResultLike } from './utils';\nexport { REQUEST_TIMEOUT, MAX_CONCURRENT, STANDARD_FORMATS } from './utils';\nexport {\n batchPreviewProducts,\n batchPreviewFormats,\n clearPreviewCache,\n type PreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './utils';\nexport { detectProtocol, detectProtocolWithTimeout } from './utils';\nexport { A2A_CARD_PATHS, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath } from './utils';\n\n// ====== PRICING UTILITIES ======\n// Pricing adapter for v2/v3 compatibility and CPA detection\nexport { isCPAPricing } from './utils';\n\n// ====== PAGINATION UTILITIES ======\n// Auto-pagination helpers for cursor-based AdCP endpoints\nexport { paginate, paginatePages, type PaginateOptions } from './utils';\n\n// ====== FORMAT ASSET UTILITIES ======\n// Access to format assets (v3 `assets` field)\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n} from './utils/format-assets';\n\n// ====== CREATIVE ASSET BUILDERS ======\n// Typed factories that inject the `asset_type` discriminator.\n// `imageAsset({ url, width, height })` returns a valid `ImageAsset`\n// without repeating `asset_type: 'image'` at every call site.\n// Prefer the named exports; use `Asset.image({...})` when constructing\n// several asset types together (assets-by-role manifests).\nexport {\n Asset,\n imageAsset,\n videoAsset,\n audioAsset,\n textAsset,\n urlAsset,\n htmlAsset,\n javascriptAsset,\n cssAsset,\n markdownAsset,\n webhookAsset,\n} from './utils/asset-builders';\n\n// ====== FORMAT ASSET SLOT BUILDERS ======\n// Typed factories for the slot definitions inside `Format.assets[]` — what a\n// seller/publisher declares it accepts. Each builder injects the `item_type`\n// and `asset_type` discriminators, and the `requirements` object is strictly\n// typed per asset_type: misnamed fields (`file_types` vs `formats`) and wrong\n// units (`min_duration_seconds` vs `min_duration_ms`) fail type-check.\n// Use `repeatableGroup({...})` (or `FormatAsset.group(...)`) to wrap assets\n// that repeat — that's the correct home for `min_count` / `max_count`.\nexport {\n FormatAsset,\n imageAssetSlot,\n videoAssetSlot,\n audioAssetSlot,\n textAssetSlot,\n markdownAssetSlot,\n htmlAssetSlot,\n cssAssetSlot,\n javascriptAssetSlot,\n vastAssetSlot,\n daastAssetSlot,\n urlAssetSlot,\n webhookAssetSlot,\n briefAssetSlot,\n catalogAssetSlot,\n repeatableGroup,\n imageGroupAsset,\n videoGroupAsset,\n audioGroupAsset,\n textGroupAsset,\n markdownGroupAsset,\n htmlGroupAsset,\n cssGroupAsset,\n javascriptGroupAsset,\n vastGroupAsset,\n daastGroupAsset,\n urlGroupAsset,\n webhookGroupAsset,\n} from './utils/format-asset-slot-builders';\n\n// ====== PREVIEW RENDER BUILDERS ======\n// Typed factories that inject the `output_format` discriminator on\n// `PreviewRender` objects. `urlRender({ render_id, preview_url, role })`\n// returns a valid url-variant render without repeating\n// `output_format: 'url'` at every call site. Matrix runs consistently\n// saw this drift: Claude emitted renders that omitted the discriminator\n// or its required sibling field.\nexport { Render, urlRender, htmlRender, bothRender } from './utils/render-builders';\n\n// ====== FORMAT RENDER BUILDERS ======\n// Typed factories for `Format.renders[]` entries on format declarations.\n// The item schema's `oneOf` forces a render to satisfy exactly one branch —\n// either `dimensions` (display/video) OR `parameters_from_format_id: true`\n// (audio, template formats). A render with only `{ role }` fails validation.\n// Audio specifically cannot use `{ role, duration_seconds }` — duration is\n// not a recognized `renders[]` field and wouldn't satisfy the oneOf anyway.\n// Use `parameterizedRender({ role })` (or the alias `templateRender`) so\n// format_id parameters carry duration.\n//\n// `FormatRender` below is the grouped namespace (value export). The v3\n// structural interface by the same name is re-exported from\n// `utils/format-renders` further down — TypeScript keeps type and value\n// namespaces separate, so both are available under the single import.\nexport {\n FormatRender,\n displayRender,\n parameterizedRender,\n templateRender,\n type DimensionsRender,\n type ParameterizedRender,\n type RenderItem,\n} from './utils/format-render-builders';\n\n// ====== CANONICAL CREATIVE FORMAT MIGRATION HELPERS ======\n// Author `Product.format_options[]`, v1 `format_id` references, and product\n// cards from one obvious namespace while migrating away from local Format.type\n// and product_card.format_id conventions.\nexport {\n CanonicalFormat,\n type CanonicalFormatDeclaration,\n type CanonicalFormatDeclarationFields,\n type CanonicalFormatKind,\n type CanonicalFormatParams,\n type FormatReferenceInput,\n type ProductCardDetailedFields,\n type ProductCardFields,\n} from './v2/projection';\n\nexport {\n augmentProductWithFormatOptions,\n withFormatOptions,\n toCanonicalOnlyProduct,\n toCanonicalOnlyResponse,\n packageRefsForCapabilities,\n legacyFormatIdsFromOptions,\n tryLegacyFormatIdsFromOptions,\n legacyFormatIdsForCapability,\n canonicalDeclarationFromBareId,\n resolveCanonicalFormatKind,\n CapabilityIdsLookupError,\n type BareFormatIdResolveOptions,\n type CanonicalOnlyProduct,\n type CapabilityIdsLookupErrorCode,\n type PackageFormatRefs,\n type ProjectionDiagnostic,\n type V1FormatId,\n type V1Product,\n type V2AugmentedProduct,\n type V2Product,\n type V2ProductFormatDeclaration,\n} from './v2/projection';\n\n// ====== ACTIVATION KEY BUILDERS ======\n// Typed factories that inject the `type` discriminator on `ActivationKey`.\n// SHAPE-GOTCHAS §1 — `key`/`value` flatten on the activation key itself.\nexport { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders';\n\n// ====== SIGNAL ID BUILDERS AND ACCESSORS ======\n// Typed factories that inject the `source` discriminator on `SignalID`.\n// Used in `signal_ids` filter arrays and as the `signal_id` provenance\n// field on every `Signal` returned by `get_signals`. SHAPE-GOTCHAS §2.\n// To read fields from a received `SignalID`, use `getSignalId` (segment id)\n// and `getSignalIssuer` (data_provider_domain or agent_url).\nexport { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders';\nexport {\n buildActivateSignalRequest,\n getSignalActivationId,\n getSignalPricingOptionIds,\n normalizeDiscoveredSignal,\n} from './utils/signal-discovery-helpers';\nexport type {\n BuildActivateSignalRequestOptions,\n DiscoveredSignal,\n NormalizedDiscoveredSignal,\n} from './utils/signal-discovery-helpers';\n\n// ====== BUILD CREATIVE RETURN BUILDERS ======\n// Typed factories for the four return shapes accepted by the framework\n// from `build_creative` handlers. `.single` / `.multi` emit bare manifests\n// the framework auto-wraps; `.singleEnveloped` / `.multiEnveloped` emit\n// the shaped envelope when the handler needs to attach `sandbox` /\n// `expires_at` / `preview`. SHAPE-GOTCHAS §5.\nexport {\n buildCreativeReturn,\n singleBuildCreativeReturn,\n multiBuildCreativeReturn,\n singleEnvelopedBuildCreativeReturn,\n multiEnvelopedBuildCreativeReturn,\n} from './utils/build-creative-return-builders';\n\n// ====== PREVIEW CREATIVE BUILDERS ======\n// Typed factories that inject the `response_type` discriminator on\n// `PreviewCreativeResponse`. Three-way oneOf — `single | batch | variant`.\n// Pair with `urlRender` / `htmlRender` / `bothRender` for the per-render\n// `output_format`. SHAPE-GOTCHAS §4.\nexport {\n previewCreative,\n singlePreviewCreativeResponse,\n batchPreviewCreativeResponse,\n variantPreviewCreativeResponse,\n} from './utils/preview-creative-builders';\n\n// ====== MEDIA BUY DELIVERY NOTIFICATION BUILDERS ======\n// Typed factories that inject the `notification_type` discriminator on\n// `GetMediaBuyDeliveryResponse` for webhook deliveries. Five variants:\n// `scheduled` / `final` / `delayed` / `adjusted` / `window_update`.\nexport {\n mediaBuyDeliveryNotification,\n scheduledMediaBuyDeliveryNotification,\n finalMediaBuyDeliveryNotification,\n delayedMediaBuyDeliveryNotification,\n adjustedMediaBuyDeliveryNotification,\n windowUpdateMediaBuyDeliveryNotification,\n} from './utils/media-buy-delivery-notification-builders';\n\n// ====== V3.0 COMPATIBILITY UTILITIES ======\n// Capabilities detection, version negotiation, and v3 enforcement.\n// See also:\n// - `VersionUnsupportedError` in errors — thrown by requireV3()/requireV3ForMutations\n// - `SyncCreativesItemSchema` in validation — per-item sync_creatives validator\n// - `ADCP_MAJOR_VERSION` / `COMPATIBLE_ADCP_VERSIONS` in version information\n// - `SingleAgentClient#requireV3()` / `AgentClient#requireV3()` — runtime gate\nexport {\n buildSyntheticCapabilities,\n buildSyntheticV3Capabilities,\n parseCapabilitiesResponse,\n supportsV3,\n supportsProtocol,\n supportsPropertyListFiltering,\n supportsContentStandards,\n supportsSyncCreatives,\n requiresOperatorAuth,\n requiresAccountForProducts,\n supportsSandbox,\n supportsExperimentalFeature,\n resolveFeature,\n listDeclaredFeatures,\n MEDIA_BUY_TOOLS,\n SIGNALS_TOOLS,\n GOVERNANCE_TOOLS,\n CREATIVE_TOOLS,\n EVENT_TRACKING_TOOLS,\n ACCOUNT_TOOLS,\n PROTOCOL_TOOLS,\n BRAND_RIGHTS_TOOLS,\n TASK_FEATURE_MAP,\n} from './utils/capabilities';\nexport type {\n AdcpCapabilities,\n AdcpMajorVersion,\n AdcpProtocol,\n AccountCapabilities,\n MediaBuyFeatures,\n ToolInfo,\n FeatureName,\n} from './utils/capabilities';\n\n// Buyer-side creative delivery helpers\nexport { inlineCreativesForPackages } from './utils/creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n} from './utils/creative-delivery';\n\n// Creative assignment adapter (v2 creative_ids ↔ v3 creative_assignments)\nexport {\n adaptPackageRequestForV2,\n adaptCreateMediaBuyRequestForV2,\n adaptUpdateMediaBuyRequestForV2,\n normalizePackageResponse,\n normalizeMediaBuyResponse,\n usesV2CreativeIds,\n usesV3CreativeAssignments,\n getCreativeIds,\n getCreativeAssignments,\n} from './utils/creative-adapter';\nexport type { CreativeAssignment } from './utils/creative-adapter';\n\n// Format renders normalizer (v2 dimensions ↔ v3 renders)\nexport {\n normalizeFormatRenders,\n normalizeFormatsResponse,\n getFormatRenders,\n getPrimaryRender,\n getCompanionRenders,\n isMultiRenderFormat,\n usesV2Dimensions,\n usesV3Renders,\n getFormatDimensions,\n} from './utils/format-renders';\n// FormatRender (the v3 structural interface) was renamed to FormatRenderEntry\n// so the `FormatRender` name at the barrel becomes the factory namespace\n// exported from `./utils/format-render-builders` above. The deprecated type\n// alias `FormatRender = FormatRenderEntry` still lives in `utils/format-renders`\n// for callers importing the sub-module directly; it's not re-exported here.\nexport type { FormatRenderEntry, RenderDimensions } from './utils/format-renders';\n\n// Preview response normalizer (v2 output_id ↔ v3 render_id)\nexport {\n normalizePreviewRender,\n normalizePreview,\n normalizePreviewCreativeResponse,\n usesV2RenderFields,\n usesV3RenderFields,\n getRenderId,\n getRenderRole,\n getPrimaryPreviewRender,\n getPreviewUrl,\n getPreviewHtml,\n} from './utils/preview-normalizer';\nexport type { PreviewRenderV3 } from './utils/preview-normalizer';\n\n// ====== TYPE GUARD UTILITIES ======\n// Type guards for automatic TypeScript type narrowing in webhook handlers\nexport {\n // Generic status checks\n isStatusCompleted,\n isStatusWorking,\n isStatusInputRequired,\n isStatusSubmitted,\n isStatusFailed,\n isStatusRejected,\n // GetProducts type guards\n isGetProductsCompleted,\n isGetProductsWorking,\n isGetProductsInputRequired,\n isGetProductsSubmitted,\n isGetProductsFailed,\n // CreateMediaBuy type guards\n isCreateMediaBuyCompleted,\n isCreateMediaBuyWorking,\n isCreateMediaBuyInputRequired,\n isCreateMediaBuySubmitted,\n isCreateMediaBuyFailed,\n // UpdateMediaBuy type guards\n isUpdateMediaBuyCompleted,\n isUpdateMediaBuyWorking,\n isUpdateMediaBuyInputRequired,\n isUpdateMediaBuySubmitted,\n isUpdateMediaBuyFailed,\n // SyncCreatives type guards\n isSyncCreativesCompleted,\n isSyncCreativesWorking,\n isSyncCreativesInputRequired,\n isSyncCreativesSubmitted,\n isSyncCreativesFailed,\n} from './utils/typeGuards';\n\n// ====== VERSION INFORMATION ======\nexport {\n getAdcpVersion,\n getLibraryVersion,\n isCompatibleWith,\n getCompatibleVersions,\n parseAdcpMajorVersion,\n ADCP_VERSION,\n ADCP_MAJOR_VERSION,\n LIBRARY_VERSION,\n COMPATIBLE_ADCP_VERSIONS,\n VERSION_INFO,\n} from './version';\nexport type { AdcpVersion } from './version';\nexport { resolveAdcpVersion } from './utils/adcp-version-config';\n\n// ====== OBSERVABILITY ======\n// OpenTelemetry tracing utilities (no-op if @opentelemetry/api not installed)\nexport {\n getTracer,\n isTracingEnabled,\n injectTraceHeaders,\n withSpan,\n addSpanAttributes,\n recordSpanException,\n} from './observability';\n\n// ====== AGENT CLASSES ======\n// Primary agent interface - returns raw AdCP responses\nexport { Agent, AgentCollection } from './agents/index.generated';\n\n// ====== SERVER-SIDE ADAPTERS ======\n// Adapters for building AdCP servers with customizable business logic\nexport {\n // Content Standards\n ContentStandardsAdapter,\n type IContentStandardsAdapter,\n type ContentEvaluationResult,\n ContentStandardsErrorCodes,\n isContentStandardsError,\n defaultContentStandardsAdapter,\n // Property Lists\n PropertyListAdapter,\n type IPropertyListAdapter,\n type ResolvedProperty,\n PropertyListErrorCodes,\n isPropertyListError,\n defaultPropertyListAdapter,\n // Sponsored Intelligence Sessions\n SISessionManager,\n AISISessionManager,\n type ISISessionManager,\n type SISession,\n SIErrorCodes,\n defaultSISessionManager,\n // Governance (seller-side committed checks)\n GovernanceAdapter,\n defaultGovernanceAdapter,\n type IGovernanceAdapter,\n type GovernanceAdapterConfig,\n type GovernanceAdapterErrorCode,\n type CommittedCheckRequest,\n GovernanceAdapterErrorCodes,\n isGovernanceAdapterError,\n // Implicit Account Store (resolution: 'implicit') — Shape A reference adapter\n InMemoryImplicitAccountStore,\n defaultImplicitKeyFn,\n type ImplicitAccountStoreOptions,\n // OAuth pass-through resolver — Shape B accounts.resolve factory\n createOAuthPassthroughResolver,\n type OAuthPassthroughResolverOptions,\n // Roster-backed AccountStore — Shape C factory for publisher-curated explicit platforms\n createRosterAccountStore,\n type RosterAccountStoreOptions,\n // Derived AccountStore — Shape D factory for single-tenant `resolution: 'derived'` agents\n createDerivedAccountStore,\n type DerivedAccountStoreOptions,\n} from './adapters';\n\n// ====== BACKWARD COMPATIBILITY & ENVIRONMENT LOADING ======\n\nimport type { AgentConfig } from './types';\nimport { ADCPMultiAgentClient } from './core/ADCPMultiAgentClient';\n\n/**\n * Legacy AdCPClient alias for backward compatibility\n * @deprecated Use ADCPMultiAgentClient instead for new code\n */\nexport const AdCPClient = ADCPMultiAgentClient;\n\n// Legacy configuration manager maintained for backward compatibility\n// The enhanced ConfigurationManager is exported above\n\n/**\n * Legacy createAdCPClient function for backward compatibility\n * @deprecated Use new ADCPMultiAgentClient constructor instead\n */\nexport function createAdCPClient(agents?: AgentConfig[]): ADCPMultiAgentClient {\n return new AdCPClient(agents);\n}\n\n/**\n * Load agents from environment and create multi-agent client\n * @deprecated Use ADCPMultiAgentClient.fromEnv() instead\n */\nexport function createAdCPClientFromEnv(): ADCPMultiAgentClient {\n return ADCPMultiAgentClient.fromEnv();\n}\n\n// ====== SUBSTITUTION OBSERVER / ENCODER ======\n// Primitives backing the `substitution-observer-runner` test-kit contract.\n// Runners (conformance graders) import the observer side; sales/retail-\n// media agents implementing the #2620 catalog-item macro encoding rule\n// import `SubstitutionEncoder`. Re-exported here for discoverability;\n// the full surface is also available via `@adcp/sdk/substitution`.\nexport {\n SubstitutionObserver,\n SubstitutionEncoder,\n PreviewFetchError,\n MacroInRawValueError,\n CATALOG_MACRO_VECTORS,\n getCatalogMacroVector,\n extractTrackerUrls,\n matchBindings,\n assertRfc3986Safe,\n assertUnreservedOnly,\n assertNoNestedExpansion,\n assertSchemePreserved,\n DEFAULT_MACRO_PROHIBITED_PATTERN,\n enforceSsrfPolicy,\n enforceSsrfPolicyResolved,\n DEFAULT_SSRF_POLICY,\n encodeUnreserved,\n equalUnderHexCasePolicy,\n isUnreservedOnly,\n divergenceOffset,\n translateUniversalMacros,\n} from './substitution';\nexport type {\n ObserverFetchOptions,\n ObserverDispatcher,\n CatalogMacroVectorName,\n AssertionOptions as SubstitutionAssertionOptions,\n AssertionResult as SubstitutionAssertionResult,\n BindingMatch,\n CatalogBinding,\n CatalogMacroVector,\n PolicyResult as SubstitutionPolicyResult,\n SsrfPolicy,\n TrackerUrlRecord,\n MacroMapping,\n TranslateResult,\n} from './substitution';\n\n// ====== TEST HELPERS ======\n// Re-export test helpers for convenience (also available via @adcp/sdk/testing)\nexport {\n testAgent,\n testAgentA2A,\n testAgentClient,\n createTestAgent,\n TEST_AGENT_TOKEN,\n TEST_AGENT_MCP_CONFIG,\n TEST_AGENT_A2A_CONFIG,\n testAgentNoAuth,\n testAgentNoAuthA2A,\n TEST_AGENT_NO_AUTH_MCP_CONFIG,\n TEST_AGENT_NO_AUTH_A2A_CONFIG,\n creativeAgent,\n testBrandRightsFlow,\n hasBrandRightsTools,\n expectControllerError,\n expectControllerSuccess,\n RateLimitTripObserver,\n RATE_LIMIT_TRIP_CONTRACT,\n RATE_LIMIT_TRIP_DEFAULT_REPLAY_MAX_WAIT_SECONDS,\n RATE_LIMIT_TRIP_MAX_ATTEMPTS_MAX,\n RATE_LIMIT_TRIP_MAX_ATTEMPTS_MIN,\n validateRateLimitTripSpec,\n} from './testing/index';\nexport type {\n ControllerErrorWithDetail,\n TestClient,\n RateLimitTripSpec,\n RateLimitTripClient,\n RateLimitTripFailureCode,\n RateLimitTripObservation,\n RateLimitTripObserverOptions,\n RateLimitTripResponseSnapshot,\n RateLimitTripStructuredResult,\n RateLimitTripTaskOptions,\n} from './testing/index';\n"],"mappings":"AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;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O,IAAI,WAAW,MAAM;AAC9B;AAMO,SAAS,0BAAgD;AAC9D,SAAOA,sBAAqB,QAAQ;AACtC;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAmBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["ADCPMultiAgentClient"]}
@@ -4,5 +4,5 @@
4
4
  "source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
5
5
  "source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
6
6
  "upstream_adcp_version": "2.5.3",
7
- "synced_at": "2026-07-17T16:17:07.912Z"
7
+ "synced_at": "2026-07-19T01:37:04.433Z"
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adcp-server.d.ts","sourceRoot":"","sources":["../../../src/lib/server/adcp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,mBAAmB;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,IAAI,CAAC,OAA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E,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,8CAA8C;IAC9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,mBAAmB,CAAC,OAAO,EAAE,wBAAwB,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAChH,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEzG;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAE7D;;;;;;;;;;OAUG;IACH,cAAc,IAAI,MAAM,CAAC;CAC1B"}
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var adcp_server_exports = {};
20
20
  __export(adcp_server_exports, {
21
21
  ADCP_CAPABILITIES: () => ADCP_CAPABILITIES,
22
+ ADCP_MCP_APP_RESOURCES: () => ADCP_MCP_APP_RESOURCES,
22
23
  ADCP_SDK_SERVER: () => ADCP_SDK_SERVER,
23
24
  ADCP_SERVER_BRAND: () => ADCP_SERVER_BRAND,
24
25
  ADCP_STATE_STORE: () => ADCP_STATE_STORE,
@@ -28,8 +29,10 @@ __export(adcp_server_exports, {
28
29
  getSdkServerInstructions: () => getSdkServerInstructions,
29
30
  isAdcpServer: () => isAdcpServer,
30
31
  isRegisteredToolVisible: () => isRegisteredToolVisible,
32
+ listMcpAppResources: () => listMcpAppResources,
31
33
  listRegisteredToolDefinitions: () => listRegisteredToolDefinitions,
32
34
  listRegisteredToolNames: () => listRegisteredToolNames,
35
+ setMcpAppResources: () => setMcpAppResources,
33
36
  setSdkServerInstructions: () => setSdkServerInstructions,
34
37
  setToolVisibilityResolver: () => setToolVisibilityResolver,
35
38
  wrapInitializeHandler: () => wrapInitializeHandler,
@@ -44,6 +47,7 @@ const ADCP_SDK_SERVER = /* @__PURE__ */ Symbol.for("@adcp/client.sdkServer");
44
47
  const ADCP_STATE_STORE = /* @__PURE__ */ Symbol.for("@adcp/client.stateStore");
45
48
  const ADCP_CAPABILITIES = /* @__PURE__ */ Symbol.for("@adcp/client.capabilities");
46
49
  const ADCP_TOOL_VISIBILITY = /* @__PURE__ */ Symbol.for("@adcp/client.toolVisibility");
50
+ const ADCP_MCP_APP_RESOURCES = /* @__PURE__ */ Symbol.for("@adcp/client.mcpAppResources");
47
51
  function getSdkServer(server) {
48
52
  const candidate = server[ADCP_SDK_SERVER];
49
53
  return candidate;
@@ -51,6 +55,17 @@ function getSdkServer(server) {
51
55
  function setToolVisibilityResolver(server, resolver) {
52
56
  server[ADCP_TOOL_VISIBILITY] = resolver;
53
57
  }
58
+ function setMcpAppResources(server, resources) {
59
+ Object.defineProperty(server, ADCP_MCP_APP_RESOURCES, {
60
+ value: resources,
61
+ enumerable: false,
62
+ configurable: false,
63
+ writable: false
64
+ });
65
+ }
66
+ function listMcpAppResources(server) {
67
+ return server[ADCP_MCP_APP_RESOURCES] ?? [];
68
+ }
54
69
  async function isRegisteredToolVisible(server, options) {
55
70
  const resolver = server[ADCP_TOOL_VISIBILITY];
56
71
  return resolver ? resolver(options) : true;
@@ -186,6 +201,7 @@ function wrapMcpServer(inner, compliance, adcpVersion = import_version.ADCP_VERS
186
201
  // Annotate the CommonJS export names for ESM import in node:
187
202
  0 && (module.exports = {
188
203
  ADCP_CAPABILITIES,
204
+ ADCP_MCP_APP_RESOURCES,
189
205
  ADCP_SDK_SERVER,
190
206
  ADCP_SERVER_BRAND,
191
207
  ADCP_STATE_STORE,
@@ -195,8 +211,10 @@ function wrapMcpServer(inner, compliance, adcpVersion = import_version.ADCP_VERS
195
211
  getSdkServerInstructions,
196
212
  isAdcpServer,
197
213
  isRegisteredToolVisible,
214
+ listMcpAppResources,
198
215
  listRegisteredToolDefinitions,
199
216
  listRegisteredToolNames,
217
+ setMcpAppResources,
200
218
  setSdkServerInstructions,
201
219
  setToolVisibilityResolver,
202
220
  wrapInitializeHandler,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/server/adcp-server.ts"],"sourcesContent":["/**\n * Opaque AdCP server handle.\n *\n * `createAdcpServer()` returns a value typed as `AdcpServer` rather than the\n * underlying `@modelcontextprotocol/sdk` `McpServer`. Two reasons:\n *\n * 1. **Dual-package hazard.** Re-exporting the SDK's `McpServer` type from\n * our public API forces downstream consumers through a specific SDK\n * resolution path (ESM or CJS). When a TypeScript ESM consumer\n * imports `@adcp/sdk` (CJS) and separately imports the SDK (ESM),\n * the two `McpServer` types are structurally identical but distinct\n * — the SDK's private `_serverInfo` field breaks assignment\n * compatibility between them. Owning the type on our side\n * eliminates the hazard: `AdcpServer` resolves the same way for\n * every consumer because it comes from a single package.\n *\n * 2. **Test ergonomics.** Downstream test harnesses have been reaching\n * into `(server as any)._requestHandlers` and\n * `server.server._requestHandlers` to dispatch tool calls in-process.\n * `dispatchTestRequest()` moves that private-field access into a\n * single encapsulated helper so consumers don't have to repeat it.\n *\n * To register additional tools or resources, configure them through\n * `createAdcpServer()`'s domain-grouped handler config. The opaque\n * surface intentionally doesn't expose `registerTool()` — keeping it off the\n * public API lets the framework own tool registration conventions\n * (idempotency, governance, validation, response shape).\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport type { McpToolResponse } from './responses';\nimport { ADCP_VERSION } from '../version';\n\n/**\n * Structural shape of an MCP transport the server can connect to.\n *\n * Matches `@modelcontextprotocol/sdk/shared/transport.js` Transport without\n * importing it — keeping the SDK type off our public API surface.\n * `StreamableHTTPServerTransport`, `StdioServerTransport`, and\n * `InMemoryTransport` from the SDK all satisfy this shape.\n *\n * `message` / callback parameters are typed with `any` (not `unknown`) so\n * SDK-specific transports with narrower message types (JSONRPCMessage) are\n * assignable bi-directionally without forcing downstream consumers to\n * widen their own transport types.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AdcpServerTransport {\n start(): Promise<void>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n send(message: any, options?: any): Promise<void>;\n close(): Promise<void>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onmessage?: (message: any, extra?: any) => void;\n onclose?: () => void;\n onerror?: (error: Error) => void;\n sessionId?: string;\n setProtocolVersion?: (version: string) => void;\n}\n\n/**\n * Request envelope accepted by `AdcpServer.dispatchTestRequest()`.\n *\n * Mirrors the JSON-RPC method/params shape so tests can target the same\n * methods the transport would — `tools/call`, `tools/list`, etc.\n */\nexport interface AdcpTestRequest {\n method: string;\n params?: Record<string, unknown>;\n}\n\n/**\n * Typed variant of {@link AdcpTestRequest} for `tools/call`. Used by the\n * `dispatchTestRequest` overload that returns a typed `CallToolResult`.\n */\nexport interface AdcpTestToolsCallRequest {\n method: 'tools/call';\n params: { name: string; arguments?: Record<string, unknown> };\n}\n\n/**\n * Response returned by `AdcpServer.dispatchTestRequest()`.\n *\n * The shape depends on the `method` — for `tools/call` this is the\n * `CallToolResult` (content + structuredContent + optional isError);\n * for other methods it's the method-specific result. Left as `unknown`\n * so callers narrow with type guards or schema validation relevant to\n * the specific method they're dispatching.\n */\nexport type AdcpTestResponse = unknown;\n\n/**\n * Auth principal visible to handlers and `resolveAccount`. Mirrors the\n * shape `serve()` produces from its `authenticate` hook, and what the\n * A2A adapter's `authenticate` callback should return.\n */\nexport interface AdcpAuthInfo {\n token: string;\n clientId: string;\n scopes: string[];\n expiresAt?: number;\n extra?: Record<string, unknown>;\n}\n\n/**\n * Optional per-call overrides for `dispatchTestRequest()`. Lets tests\n * simulate transport-level state — most importantly the `authInfo` that\n * `serve()` populates from its `authenticate` hook — without spinning up\n * a real HTTP transport.\n */\nexport interface AdcpTestRequestExtras {\n authInfo?: AdcpAuthInfo;\n sessionId?: string;\n}\n\n/**\n * Arguments accepted by `AdcpServer.invoke()`. A transport adapter (MCP\n * `serve()`, `createA2AAdapter()`, etc.) authenticates the incoming\n * request, maps it to one of the registered AdCP tool names, then calls\n * this surface to run the framework pipeline (idempotency, account\n * resolution, validation, governance, response-union narrowing).\n */\nexport interface AdcpInvokeOptions {\n /** AdCP tool name (`get_products`, `create_media_buy`, ...). */\n toolName: string;\n /** Tool arguments as received from the transport, pre-schema-validation. */\n args: Record<string, unknown>;\n /**\n * Auth principal the transport produced from its `authenticate` hook.\n * Handlers and `resolveAccount` see it as `ctx.authInfo`. Transports\n * MUST verify the principal before calling `invoke()` — `invoke()`\n * does NOT re-check the token.\n */\n authInfo?: AdcpAuthInfo;\n /** Abort signal for cancellation; defaults to a fresh controller. */\n signal?: AbortSignal;\n}\n\n/**\n * Test-harness hooks attached to every `AdcpServer`. Namespaced under\n * `compliance` so production code paths don't accidentally reach for\n * them — `reset()` drops cached state and is intended for storyboard\n * runners that exercise many scenarios in one process.\n */\nexport interface AdcpServerComplianceApi {\n /**\n * Drop session state and the idempotency cache so subsequent\n * storyboards don't inherit plans, media buys, or cached replies from\n * earlier runs. Conformance storyboards share brand domains across\n * test kits — without this hook, a $10K governance plan seeded by\n * `media_buy_seller/governance_denied` would intercept a $50K buy in\n * `sales_guaranteed`.\n *\n * Refuses to run by default unless BOTH guardrails hold:\n * - `NODE_ENV !== 'production'` (opt out with `allowProduction: true`)\n * - The configured stores are the in-memory SDK defaults\n * (`InMemoryStateStore` + memory idempotency backend). Opt out\n * with `force: true` when you've wired a disposable test\n * Postgres cluster and know the flush is safe.\n *\n * The two flags are independent on purpose: `force` lets you flush\n * a non-memory store you've verified is a test DB, WITHOUT also\n * opening the door to running against a production `NODE_ENV`.\n * Same the other way: `allowProduction` lets you run in a prod-\n * labeled CI environment against memory stores, without bypassing\n * the store-shape safety check.\n */\n reset(options?: { force?: boolean; allowProduction?: boolean }): Promise<void>;\n}\n\n/**\n * Phantom brand for {@link AdcpServer}. Makes the type nominal — a plain\n * object that has the same methods structurally cannot be assigned to\n * `AdcpServer` because it lacks this symbol-keyed property. Closes the\n * door on `(plainObject as AdcpServer).registerTool(...)` patterns that\n * tried to reach for an MCP-SDK method the framework intentionally\n * doesn't expose.\n *\n * The brand is `never`-typed and never set on the runtime object, so\n * `Object.getOwnPropertySymbols(server)` won't expose it — only the\n * wrapper produced by `createAdcpServer()` carries the type-level\n * signature, via the `as AdcpServerInternal` cast in `wrapMcpServer()`.\n *\n * Must be a real (non-`declare`) const so the d.ts emit retains it. An\n * `export declare const X: unique symbol` in a `.ts` source file does\n * not survive emit — the binding gets dropped from the published d.ts\n * while consumers (the public `AdcpServer` interface) keep referencing\n * it, which produces `TS2304: Cannot find name 'ADCP_SERVER_BRAND'` on\n * any adopter `tsc --noEmit` against `@adcp/sdk/server` (issue #1236).\n */\nexport const ADCP_SERVER_BRAND: unique symbol = Symbol('ADCP_SERVER_BRAND');\n\n/**\n * Opaque handle returned by `createAdcpServer()`.\n *\n * Pass to `serve()` to mount on an HTTP transport, or use\n * `dispatchTestRequest()` from a test harness to exercise handlers\n * in-process without opening a socket.\n */\nexport interface AdcpServer {\n /**\n * Phantom brand — type-level only, never present at runtime. See\n * {@link ADCP_SERVER_BRAND}. Tagged `never` so `(x as AdcpServer)`\n * casts from structurally-similar objects fail; a real `AdcpServer`\n * is only obtainable via `createAdcpServer()`.\n */\n readonly [ADCP_SERVER_BRAND]?: never;\n\n /**\n * Connect the server to an MCP transport.\n *\n * Takes ownership of the transport — any callbacks previously\n * registered on it are replaced. Matches the semantics of the SDK's\n * `McpServer.connect()`.\n */\n connect(transport: AdcpServerTransport): Promise<void>;\n\n /** Close the server and release resources. */\n close(): Promise<void>;\n\n /**\n * Test-harness hooks — see {@link AdcpServerComplianceApi}. Not\n * intended for production call sites; production code paths should\n * use `close()` to release resources.\n */\n readonly compliance: AdcpServerComplianceApi;\n\n /**\n * Invoke a registered handler in-process and return its response.\n *\n * Bypasses the transport layer — no sockets, no JSON-RPC framing.\n * Intended for test harnesses only; production callers should go\n * through a transport so protocol invariants (request ID linking,\n * task progress, notifications) are enforced.\n *\n * Throws when no handler is registered for the requested method,\n * or when a `tools/call` request targets an unknown tool. Arguments\n * default to `{}` when `params.arguments` is omitted — a validation\n * error from the tool's input schema (not from dispatch) is the\n * expected failure mode for a missing required field.\n *\n * **Never mount this behind an HTTP route.** `extras.authInfo` is\n * written directly onto the MCP handler's `extra` without any check\n * against `serve({ authenticate })` — exposing it externally lets a\n * caller impersonate any principal. This API is for in-process test\n * harnesses and storyboard runners only.\n *\n * @example\n * ```typescript\n * const result = await server.dispatchTestRequest({\n * method: 'tools/call',\n * params: {\n * name: 'get_products',\n * arguments: { brief: 'premium sports inventory' },\n * },\n * });\n * ```\n */\n dispatchTestRequest(request: AdcpTestToolsCallRequest, extras?: AdcpTestRequestExtras): Promise<CallToolResult>;\n dispatchTestRequest(request: AdcpTestRequest, extras?: AdcpTestRequestExtras): Promise<AdcpTestResponse>;\n\n /**\n * Production-safe tool invocation surface for transport adapters.\n *\n * Runs the full framework pipeline against a registered tool:\n * request schema validation → account resolution → idempotency →\n * handler dispatch → response narrowing → response validation.\n * Returns the same `McpToolResponse` envelope the MCP transport\n * observes — a transport adapter layers its own protocol framing on\n * top (JSON-RPC result for MCP, A2A `Task` artifact for A2A, etc.).\n *\n * **Auth is the caller's responsibility.** `invoke()` forwards the\n * provided `authInfo` verbatim to handlers and `resolveAccount`\n * without re-verifying. Mount it only behind a transport that has\n * already authenticated the principal (e.g. `serve({ authenticate })`\n * for MCP, `createA2AAdapter({ authenticate })` for A2A). Do not call\n * it directly from an HTTP handler — that path skips auth.\n *\n * For in-process tests that want to synthesize an `authInfo` without\n * running a transport, reach for {@link dispatchTestRequest} instead\n * — it takes the same principal shape but is explicitly marked\n * test-only in its docstring.\n *\n * Throws when `toolName` is not registered; schema errors round-trip\n * as structured `VALIDATION_ERROR` envelopes inside the return value.\n */\n invoke(options: AdcpInvokeOptions): Promise<McpToolResponse>;\n\n /**\n * Returns the AdCP protocol version this server is configured to speak.\n *\n * Defaults to {@link ADCP_VERSION} (the GA version the SDK ships against)\n * unless overridden via `createAdcpServer({ adcpVersion })`. This is the\n * protocol version, **not** the publisher's app version (`config.version`).\n *\n * Plumbing surface — Stage 2 of the multi-version refactor exposes the\n * configured value but does not yet vary validator/schema selection by\n * version. Wire-shape adapters key off this getter in subsequent stages.\n */\n getAdcpVersion(): string;\n}\n\n/**\n * Symbol-keyed accessor for the underlying SDK `McpServer`. Used by\n * `serve()` to reach through the opaque wrapper when SDK-specific\n * operations are needed. Not part of the public API — typed on a\n * separate internal interface so downstream consumers can't discover\n * it through the `AdcpServer` type.\n *\n * @internal\n */\nexport const ADCP_SDK_SERVER: unique symbol = Symbol.for('@adcp/client.sdkServer');\n\n/**\n * Symbol-keyed accessor for the state store backing an `AdcpServer`.\n * Test harnesses and helpers like\n * `@adcp/sdk/compliance-fixtures`'s `seedComplianceFixtures` need\n * to reach the store without widening the public `AdcpServer`\n * interface (handlers already get `ctx.store`; production code paths\n * don't need a second accessor).\n *\n * @internal\n */\nexport const ADCP_STATE_STORE: unique symbol = Symbol.for('@adcp/client.stateStore');\n\n/**\n * Symbol-keyed accessor for the capabilities object `createAdcpServer`\n * assembles and the auto-wired `get_adcp_capabilities` handler reads from.\n * Mutating this object mutates what subsequent capability-discovery calls\n * return — `registerTestController` uses this to add a\n * `compliance_testing` capability block after registration so the server\n * advertises its controller scenarios even though `registerTestController`\n * runs after `createAdcpServer`.\n *\n * @internal\n */\nexport const ADCP_CAPABILITIES: unique symbol = Symbol.for('@adcp/client.capabilities');\n\n/** Per-request tool visibility policy consumed by transport adapters. @internal */\nexport const ADCP_TOOL_VISIBILITY: unique symbol = Symbol.for('@adcp/client.toolVisibility');\n\n/** @internal */\nexport type AdcpToolVisibilityResolver = (options: {\n toolName: string;\n authInfo?: AdcpAuthInfo;\n input?: Readonly<Record<string, unknown>>;\n}) => boolean | Promise<boolean>;\n\n/** @internal */\nexport interface AdcpServerInternal extends AdcpServer {\n readonly [ADCP_SDK_SERVER]: McpServer;\n [ADCP_TOOL_VISIBILITY]?: AdcpToolVisibilityResolver;\n}\n\n/**\n * Return the underlying `McpServer` for a wrapped `AdcpServer`, or\n * `undefined` if the value is not an `AdcpServer` produced by\n * `createAdcpServer()`.\n *\n * @internal\n */\nexport function getSdkServer(server: AdcpServer | McpServer): McpServer | undefined {\n const candidate = (server as unknown as Partial<AdcpServerInternal>)[ADCP_SDK_SERVER];\n return candidate;\n}\n\n/** Attach a transport-independent per-request tool visibility policy. @internal */\nexport function setToolVisibilityResolver(server: AdcpServer, resolver: AdcpToolVisibilityResolver): void {\n (server as AdcpServerInternal)[ADCP_TOOL_VISIBILITY] = resolver;\n}\n\n/** Resolve whether a registered tool may be exposed to this request. @internal */\nexport async function isRegisteredToolVisible(\n server: AdcpServer,\n options: Parameters<AdcpToolVisibilityResolver>[0]\n): Promise<boolean> {\n const resolver = (server as AdcpServerInternal)[ADCP_TOOL_VISIBILITY];\n return resolver ? resolver(options) : true;\n}\n\n/**\n * True when `value` is an `AdcpServer` produced by `createAdcpServer()`.\n *\n * @internal\n */\nexport function isAdcpServer(value: unknown): value is AdcpServerInternal {\n return (\n value != null &&\n typeof value === 'object' &&\n ADCP_SDK_SERVER in (value as Record<PropertyKey, unknown>) &&\n typeof (value as AdcpServer).dispatchTestRequest === 'function'\n );\n}\n\n// ---------------------------------------------------------------------------\n// Private-field access — centralized\n// ---------------------------------------------------------------------------\n//\n// The MCP SDK marks `_requestHandlers` and `_registeredTools` as private.\n// Dispatching a request in-process from a test needs them. Doing it once\n// here means downstream harnesses don't each repeat the (server as any)\n// dance, which is the whole point of exposing `dispatchTestRequest()`.\n//\n// If/when the SDK ships a public in-process dispatch API, swap these two\n// helpers for that API. The AdcpServer surface stays the same.\n\ninterface RegisteredTool {\n title?: string;\n description?: string;\n inputSchema?: unknown;\n outputSchema?: unknown;\n annotations?: unknown;\n _meta?: Record<string, unknown>;\n enabled?: boolean;\n handler: (args: unknown, extra: unknown) => unknown | Promise<unknown>;\n}\n\ninterface McpServerPrivates {\n _registeredTools?: Record<string, RegisteredTool | undefined>;\n server?: {\n _requestHandlers?: Map<\n string,\n (request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>\n >;\n _serverInfo?: { name: string; version: string; [key: string]: unknown };\n _instructions?: string;\n };\n}\n\n/** Tool metadata needed to mirror the registered AdCP surface into another official MCP transport. @internal */\nexport interface RegisteredToolDefinition {\n name: string;\n title?: string;\n description?: string;\n inputSchema?: unknown;\n outputSchema?: unknown;\n annotations?: unknown;\n _meta?: Record<string, unknown>;\n}\n\n/** @internal */\ntype McpRequestHandler = (request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>;\n\n/**\n * Write the instructions string onto the low-level SDK server backing\n * `mcpServer`. Called by the async-function-form instructions hook to\n * inject the resolved string just before the MCP `initialize` response.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function setSdkServerInstructions(mcpServer: McpServer, value: string | undefined): void {\n const priv = mcpServer as unknown as McpServerPrivates;\n if (priv.server) {\n priv.server._instructions = value;\n }\n}\n\n/**\n * Wrap the `initialize` request handler on `mcpServer` so that `wrapper`\n * runs (and can await async work) before the original handler responds.\n * The wrapper receives the original handler as its first argument and must\n * call it to complete the handshake.\n *\n * The wrapper is invoked once per MCP `initialize` call on this server\n * instance. Under `serve({ reuseAgent: false })` the server is created\n * fresh per request, so the wrapper fires once per session. Under\n * `reuseAgent: true` the `ADCP_INSTRUCTIONS_FN` check in `serve.ts`\n * blocks the combination before the wrapper can be called a second time.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapInitializeHandler(\n mcpServer: McpServer,\n wrapper: (\n origHandler: McpRequestHandler,\n req: { method: string; params?: unknown },\n extra: unknown\n ) => unknown | Promise<unknown>\n): void {\n const priv = mcpServer as unknown as McpServerPrivates;\n const handlers = priv.server?._requestHandlers;\n if (!handlers) return;\n const orig = handlers.get('initialize');\n if (!orig) return;\n handlers.set('initialize', (req, extra) => wrapper(orig, req, extra));\n}\n\nfunction getRegisteredTool(server: McpServer, name: string): RegisteredTool | undefined {\n return (server as unknown as McpServerPrivates)._registeredTools?.[name];\n}\n\n/**\n * Wrap a registered MCP tool handler without changing the tool definition\n * advertised by the SDK server.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapRegisteredToolHandler(\n server: McpServer,\n name: string,\n wrapper: (orig: RegisteredTool['handler'], args: unknown, extra: unknown) => unknown | Promise<unknown>\n): boolean {\n const tool = getRegisteredTool(server, name);\n if (!tool) return false;\n const orig = tool.handler;\n tool.handler = (args, extra) => wrapper(orig, args, extra);\n return true;\n}\n\n/**\n * Enumerate the tool names registered on the underlying SDK server.\n * Used by transport adapters that need to derive discovery metadata\n * (agent cards, capability listings) from the registered surface\n * without reaching into private SDK fields at every call site.\n *\n * @internal\n */\nexport function listRegisteredToolNames(server: McpServer): string[] {\n const registered = (server as unknown as McpServerPrivates)._registeredTools ?? {};\n return Object.keys(registered);\n}\n\n/**\n * Return enabled registered-tool metadata for the modern MCP server adapter.\n * Handler functions stay private; the adapter dispatches through\n * {@link AdcpServer.invoke} so the framework pipeline remains authoritative.\n *\n * @internal\n */\nexport function listRegisteredToolDefinitions(server: McpServer): RegisteredToolDefinition[] {\n const registered = (server as unknown as McpServerPrivates)._registeredTools ?? {};\n return Object.entries(registered).flatMap(([name, tool]) => {\n if (!tool || tool.enabled === false) return [];\n return [\n {\n name,\n ...(tool.title !== undefined && { title: tool.title }),\n ...(tool.description !== undefined && { description: tool.description }),\n ...(tool.inputSchema !== undefined && { inputSchema: tool.inputSchema }),\n ...(tool.outputSchema !== undefined && { outputSchema: tool.outputSchema }),\n ...(tool.annotations !== undefined && { annotations: tool.annotations }),\n ...(tool._meta !== undefined && { _meta: tool._meta }),\n },\n ];\n });\n}\n\n/** Return the SDK server identity advertised during MCP discovery. @internal */\nexport function getSdkServerInfo(server: McpServer): { name: string; version: string; [key: string]: unknown } {\n return (\n (server as unknown as McpServerPrivates).server?._serverInfo ?? {\n name: 'AdCP Server',\n version: 'unknown',\n }\n );\n}\n\n/** Return static or already-resolved server instructions. @internal */\nexport function getSdkServerInstructions(server: McpServer): string | undefined {\n return (server as unknown as McpServerPrivates).server?._instructions;\n}\n\nfunction getRequestHandler(\n server: McpServer,\n method: string\n): ((request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>) | undefined {\n return (server as unknown as McpServerPrivates).server?._requestHandlers?.get(method);\n}\n\n/**\n * Wrap an SDK request handler such as `tools/list` while preserving the\n * original handler's request/extra contract.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapSdkRequestHandler(\n server: McpServer,\n method: string,\n wrapper: (\n orig: McpRequestHandler,\n req: { method: string; params?: unknown },\n extra: unknown\n ) => unknown | Promise<unknown>\n): boolean {\n const handlers = (server as unknown as McpServerPrivates).server?._requestHandlers;\n const orig = handlers?.get(method);\n if (!handlers || !orig) return false;\n handlers.set(method, (req, extra) => wrapper(orig, req, extra));\n return true;\n}\n\n/**\n * Wrap an SDK `McpServer` into the opaque `AdcpServer` handle returned by\n * `createAdcpServer()`. Consumers should prefer `createAdcpServer()` and\n * treat this as an internal utility; it's exported for framework code\n * that needs to produce an `AdcpServer` around a hand-built server.\n *\n * Idempotent — passing an already-wrapped `AdcpServer` returns it\n * unchanged rather than nesting wrappers (which would leave\n * `ADCP_SDK_SERVER` pointing at the outer wrapper instead of the SDK\n * handle and break `getSdkServer()` round-trips).\n *\n * @internal\n */\nexport function wrapMcpServer(\n inner: McpServer | AdcpServerInternal,\n compliance?: AdcpServerComplianceApi,\n adcpVersion: string = ADCP_VERSION\n): AdcpServerInternal {\n if (isAdcpServer(inner)) return inner;\n const mcp = inner as McpServer;\n const resolvedCompliance: AdcpServerComplianceApi = compliance ?? {\n async reset() {\n throw new Error(\n 'AdcpServer.compliance.reset: no-op handle returned by `wrapMcpServer` without a compliance implementation. ' +\n 'Use `createAdcpServer()` to get a server whose `compliance.reset()` flushes the state and idempotency stores.'\n );\n },\n };\n const dispatch = async (request: AdcpTestRequest, extras?: AdcpTestRequestExtras): Promise<AdcpTestResponse> => {\n const extra: { signal: AbortSignal; authInfo?: AdcpTestRequestExtras['authInfo']; sessionId?: string } = {\n signal: new AbortController().signal,\n };\n if (extras?.authInfo) extra.authInfo = extras.authInfo;\n if (extras?.sessionId) extra.sessionId = extras.sessionId;\n\n if (request.method === 'tools/call') {\n const params = (request.params ?? {}) as { name?: string; arguments?: Record<string, unknown> };\n if (typeof params.name !== 'string') {\n throw new Error(\"dispatchTestRequest: 'tools/call' requires params.name (string)\");\n }\n const tool = getRegisteredTool(mcp, params.name);\n if (!tool) {\n throw new Error(`dispatchTestRequest: tool \"${params.name}\" is not registered`);\n }\n return tool.handler(params.arguments ?? {}, extra);\n }\n\n const handler = getRequestHandler(mcp, request.method);\n if (!handler) {\n throw new Error(`dispatchTestRequest: no handler registered for method \"${request.method}\"`);\n }\n return handler({ method: request.method, params: request.params ?? {} }, extra);\n };\n const invoke = async (options: AdcpInvokeOptions): Promise<McpToolResponse> => {\n const tool = getRegisteredTool(mcp, options.toolName);\n if (!tool) {\n throw new Error(`AdcpServer.invoke: tool \"${options.toolName}\" is not registered`);\n }\n const extra: { signal: AbortSignal; authInfo?: AdcpAuthInfo } = {\n signal: options.signal ?? new AbortController().signal,\n };\n if (options.authInfo) extra.authInfo = options.authInfo;\n return (await tool.handler(options.args, extra)) as McpToolResponse;\n };\n const wrapper: AdcpServerInternal = {\n [ADCP_SDK_SERVER]: mcp,\n connect(transport) {\n // The SDK's Transport interface is structurally compatible with\n // AdcpServerTransport — the cast is boundary-crossing, not lossy.\n return mcp.connect(transport as unknown as Parameters<McpServer['connect']>[0]);\n },\n close() {\n return mcp.close();\n },\n compliance: resolvedCompliance,\n // Satisfies both overloads (typed tools/call + generic fallback) — the\n // runtime dispatcher is a single function that narrows by method.\n dispatchTestRequest: dispatch as AdcpServerInternal['dispatchTestRequest'],\n invoke,\n getAdcpVersion: () => adcpVersion,\n };\n return wrapper;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCA,qBAA6B;AA+JtB,MAAM,oBAAmC,uBAAO,mBAAmB;AAyHnE,MAAM,kBAAiC,uBAAO,IAAI,wBAAwB;AAY1E,MAAM,mBAAkC,uBAAO,IAAI,yBAAyB;AAa5E,MAAM,oBAAmC,uBAAO,IAAI,2BAA2B;AAG/E,MAAM,uBAAsC,uBAAO,IAAI,6BAA6B;AAsBpF,SAAS,aAAa,QAAuD;AAClF,QAAM,YAAa,OAAkD,eAAe;AACpF,SAAO;AACT;AAGO,SAAS,0BAA0B,QAAoB,UAA4C;AACxG,EAAC,OAA8B,oBAAoB,IAAI;AACzD;AAGA,eAAsB,wBACpB,QACA,SACkB;AAClB,QAAM,WAAY,OAA8B,oBAAoB;AACpE,SAAO,WAAW,SAAS,OAAO,IAAI;AACxC;AAOO,SAAS,aAAa,OAA6C;AACxE,SACE,SAAS,QACT,OAAO,UAAU,YACjB,mBAAoB,SACpB,OAAQ,MAAqB,wBAAwB;AAEzD;AA2DO,SAAS,yBAAyB,WAAsB,OAAiC;AAC9F,QAAM,OAAO;AACb,MAAI,KAAK,QAAQ;AACf,SAAK,OAAO,gBAAgB;AAAA,EAC9B;AACF;AAiBO,SAAS,sBACd,WACA,SAKM;AACN,QAAM,OAAO;AACb,QAAM,WAAW,KAAK,QAAQ;AAC9B,MAAI,CAAC,SAAU;AACf,QAAM,OAAO,SAAS,IAAI,YAAY;AACtC,MAAI,CAAC,KAAM;AACX,WAA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AAM,GAAG;AAAA,IAC7F;AACA,WAAO,QAAQ,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,UAAU,CAAC,EAAE,GAAG,KAAK;AAAA,EAChF;AACA,QAAM,SAAS,OAAO,YAAyD;AAC7E,UAAM,OAAO,kBAAkB,KAAK,QAAQ,QAAQ;AACpD,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,MAAM,4BAA4B,QAAQ,QAAQ,qBAAqB;AAAA,IACnF;AACA,UAAM,QAA0D;AAAA,MAC9D,QAAQ,QAAQ,UAAU,IAAI,gBAAgB,EAAE;AAAA,IAClD;AACA,QAAI,QAAQ,SAAU,OAAM,WAAW,QAAQ;AAC/C,WAAQ,MAAM,KAAK,QAAQ,QAAQ,MAAM,KAAK;AAAA,EAChD;AACA,QAAM,UAA8B;AAAA,IAClC,CAAC,eAAe,GAAG;AAAA,IACnB,QAAQ,WAAW;AAGjB,aAAO,IAAI,QAAQ,SAA2D;AAAA,IAChF;AAAA,IACA,QAAQ;AACN,aAAO,IAAI,MAAM;AAAA,IACnB;AAAA,IACA,YAAY;AAAA;AAAA;AAAA,IAGZ,qBAAqB;AAAA,IACrB;AAAA,IACA,gBAAgB,MAAM;AAAA,EACxB;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/server/adcp-server.ts"],"sourcesContent":["/**\n * Opaque AdCP server handle.\n *\n * `createAdcpServer()` returns a value typed as `AdcpServer` rather than the\n * underlying `@modelcontextprotocol/sdk` `McpServer`. Two reasons:\n *\n * 1. **Dual-package hazard.** Re-exporting the SDK's `McpServer` type from\n * our public API forces downstream consumers through a specific SDK\n * resolution path (ESM or CJS). When a TypeScript ESM consumer\n * imports `@adcp/sdk` (CJS) and separately imports the SDK (ESM),\n * the two `McpServer` types are structurally identical but distinct\n * — the SDK's private `_serverInfo` field breaks assignment\n * compatibility between them. Owning the type on our side\n * eliminates the hazard: `AdcpServer` resolves the same way for\n * every consumer because it comes from a single package.\n *\n * 2. **Test ergonomics.** Downstream test harnesses have been reaching\n * into `(server as any)._requestHandlers` and\n * `server.server._requestHandlers` to dispatch tool calls in-process.\n * `dispatchTestRequest()` moves that private-field access into a\n * single encapsulated helper so consumers don't have to repeat it.\n *\n * To register additional tools or resources, configure them through\n * `createAdcpServer()`'s domain-grouped handler config. The opaque\n * surface intentionally doesn't expose `registerTool()` — keeping it off the\n * public API lets the framework own tool registration conventions\n * (idempotency, governance, validation, response shape).\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport type { McpToolResponse } from './responses';\nimport type { AdcpMcpResourceDefinition } from './mcp-app';\nimport { ADCP_VERSION } from '../version';\n\n/**\n * Structural shape of an MCP transport the server can connect to.\n *\n * Matches `@modelcontextprotocol/sdk/shared/transport.js` Transport without\n * importing it — keeping the SDK type off our public API surface.\n * `StreamableHTTPServerTransport`, `StdioServerTransport`, and\n * `InMemoryTransport` from the SDK all satisfy this shape.\n *\n * `message` / callback parameters are typed with `any` (not `unknown`) so\n * SDK-specific transports with narrower message types (JSONRPCMessage) are\n * assignable bi-directionally without forcing downstream consumers to\n * widen their own transport types.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AdcpServerTransport {\n start(): Promise<void>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n send(message: any, options?: any): Promise<void>;\n close(): Promise<void>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onmessage?: (message: any, extra?: any) => void;\n onclose?: () => void;\n onerror?: (error: Error) => void;\n sessionId?: string;\n setProtocolVersion?: (version: string) => void;\n}\n\n/**\n * Request envelope accepted by `AdcpServer.dispatchTestRequest()`.\n *\n * Mirrors the JSON-RPC method/params shape so tests can target the same\n * methods the transport would — `tools/call`, `tools/list`, etc.\n */\nexport interface AdcpTestRequest {\n method: string;\n params?: Record<string, unknown>;\n}\n\n/**\n * Typed variant of {@link AdcpTestRequest} for `tools/call`. Used by the\n * `dispatchTestRequest` overload that returns a typed `CallToolResult`.\n */\nexport interface AdcpTestToolsCallRequest {\n method: 'tools/call';\n params: { name: string; arguments?: Record<string, unknown> };\n}\n\n/**\n * Response returned by `AdcpServer.dispatchTestRequest()`.\n *\n * The shape depends on the `method` — for `tools/call` this is the\n * `CallToolResult` (content + structuredContent + optional isError);\n * for other methods it's the method-specific result. Left as `unknown`\n * so callers narrow with type guards or schema validation relevant to\n * the specific method they're dispatching.\n */\nexport type AdcpTestResponse = unknown;\n\n/**\n * Auth principal visible to handlers and `resolveAccount`. Mirrors the\n * shape `serve()` produces from its `authenticate` hook, and what the\n * A2A adapter's `authenticate` callback should return.\n */\nexport interface AdcpAuthInfo {\n token: string;\n clientId: string;\n scopes: string[];\n expiresAt?: number;\n extra?: Record<string, unknown>;\n}\n\n/**\n * Optional per-call overrides for `dispatchTestRequest()`. Lets tests\n * simulate transport-level state — most importantly the `authInfo` that\n * `serve()` populates from its `authenticate` hook — without spinning up\n * a real HTTP transport.\n */\nexport interface AdcpTestRequestExtras {\n authInfo?: AdcpAuthInfo;\n sessionId?: string;\n}\n\n/**\n * Arguments accepted by `AdcpServer.invoke()`. A transport adapter (MCP\n * `serve()`, `createA2AAdapter()`, etc.) authenticates the incoming\n * request, maps it to one of the registered AdCP tool names, then calls\n * this surface to run the framework pipeline (idempotency, account\n * resolution, validation, governance, response-union narrowing).\n */\nexport interface AdcpInvokeOptions {\n /** AdCP tool name (`get_products`, `create_media_buy`, ...). */\n toolName: string;\n /** Tool arguments as received from the transport, pre-schema-validation. */\n args: Record<string, unknown>;\n /**\n * Auth principal the transport produced from its `authenticate` hook.\n * Handlers and `resolveAccount` see it as `ctx.authInfo`. Transports\n * MUST verify the principal before calling `invoke()` — `invoke()`\n * does NOT re-check the token.\n */\n authInfo?: AdcpAuthInfo;\n /** Abort signal for cancellation; defaults to a fresh controller. */\n signal?: AbortSignal;\n}\n\n/**\n * Test-harness hooks attached to every `AdcpServer`. Namespaced under\n * `compliance` so production code paths don't accidentally reach for\n * them — `reset()` drops cached state and is intended for storyboard\n * runners that exercise many scenarios in one process.\n */\nexport interface AdcpServerComplianceApi {\n /**\n * Drop session state and the idempotency cache so subsequent\n * storyboards don't inherit plans, media buys, or cached replies from\n * earlier runs. Conformance storyboards share brand domains across\n * test kits — without this hook, a $10K governance plan seeded by\n * `media_buy_seller/governance_denied` would intercept a $50K buy in\n * `sales_guaranteed`.\n *\n * Refuses to run by default unless BOTH guardrails hold:\n * - `NODE_ENV !== 'production'` (opt out with `allowProduction: true`)\n * - The configured stores are the in-memory SDK defaults\n * (`InMemoryStateStore` + memory idempotency backend). Opt out\n * with `force: true` when you've wired a disposable test\n * Postgres cluster and know the flush is safe.\n *\n * The two flags are independent on purpose: `force` lets you flush\n * a non-memory store you've verified is a test DB, WITHOUT also\n * opening the door to running against a production `NODE_ENV`.\n * Same the other way: `allowProduction` lets you run in a prod-\n * labeled CI environment against memory stores, without bypassing\n * the store-shape safety check.\n */\n reset(options?: { force?: boolean; allowProduction?: boolean }): Promise<void>;\n}\n\n/**\n * Phantom brand for {@link AdcpServer}. Makes the type nominal — a plain\n * object that has the same methods structurally cannot be assigned to\n * `AdcpServer` because it lacks this symbol-keyed property. Closes the\n * door on `(plainObject as AdcpServer).registerTool(...)` patterns that\n * tried to reach for an MCP-SDK method the framework intentionally\n * doesn't expose.\n *\n * The brand is `never`-typed and never set on the runtime object, so\n * `Object.getOwnPropertySymbols(server)` won't expose it — only the\n * wrapper produced by `createAdcpServer()` carries the type-level\n * signature, via the `as AdcpServerInternal` cast in `wrapMcpServer()`.\n *\n * Must be a real (non-`declare`) const so the d.ts emit retains it. An\n * `export declare const X: unique symbol` in a `.ts` source file does\n * not survive emit — the binding gets dropped from the published d.ts\n * while consumers (the public `AdcpServer` interface) keep referencing\n * it, which produces `TS2304: Cannot find name 'ADCP_SERVER_BRAND'` on\n * any adopter `tsc --noEmit` against `@adcp/sdk/server` (issue #1236).\n */\nexport const ADCP_SERVER_BRAND: unique symbol = Symbol('ADCP_SERVER_BRAND');\n\n/**\n * Opaque handle returned by `createAdcpServer()`.\n *\n * Pass to `serve()` to mount on an HTTP transport, or use\n * `dispatchTestRequest()` from a test harness to exercise handlers\n * in-process without opening a socket.\n */\nexport interface AdcpServer {\n /**\n * Phantom brand — type-level only, never present at runtime. See\n * {@link ADCP_SERVER_BRAND}. Tagged `never` so `(x as AdcpServer)`\n * casts from structurally-similar objects fail; a real `AdcpServer`\n * is only obtainable via `createAdcpServer()`.\n */\n readonly [ADCP_SERVER_BRAND]?: never;\n\n /**\n * Connect the server to an MCP transport.\n *\n * Takes ownership of the transport — any callbacks previously\n * registered on it are replaced. Matches the semantics of the SDK's\n * `McpServer.connect()`.\n */\n connect(transport: AdcpServerTransport): Promise<void>;\n\n /** Close the server and release resources. */\n close(): Promise<void>;\n\n /**\n * Test-harness hooks — see {@link AdcpServerComplianceApi}. Not\n * intended for production call sites; production code paths should\n * use `close()` to release resources.\n */\n readonly compliance: AdcpServerComplianceApi;\n\n /**\n * Invoke a registered handler in-process and return its response.\n *\n * Bypasses the transport layer — no sockets, no JSON-RPC framing.\n * Intended for test harnesses only; production callers should go\n * through a transport so protocol invariants (request ID linking,\n * task progress, notifications) are enforced.\n *\n * Throws when no handler is registered for the requested method,\n * or when a `tools/call` request targets an unknown tool. Arguments\n * default to `{}` when `params.arguments` is omitted — a validation\n * error from the tool's input schema (not from dispatch) is the\n * expected failure mode for a missing required field.\n *\n * **Never mount this behind an HTTP route.** `extras.authInfo` is\n * written directly onto the MCP handler's `extra` without any check\n * against `serve({ authenticate })` — exposing it externally lets a\n * caller impersonate any principal. This API is for in-process test\n * harnesses and storyboard runners only.\n *\n * @example\n * ```typescript\n * const result = await server.dispatchTestRequest({\n * method: 'tools/call',\n * params: {\n * name: 'get_products',\n * arguments: { brief: 'premium sports inventory' },\n * },\n * });\n * ```\n */\n dispatchTestRequest(request: AdcpTestToolsCallRequest, extras?: AdcpTestRequestExtras): Promise<CallToolResult>;\n dispatchTestRequest(request: AdcpTestRequest, extras?: AdcpTestRequestExtras): Promise<AdcpTestResponse>;\n\n /**\n * Production-safe tool invocation surface for transport adapters.\n *\n * Runs the full framework pipeline against a registered tool:\n * request schema validation → account resolution → idempotency →\n * handler dispatch → response narrowing → response validation.\n * Returns the same `McpToolResponse` envelope the MCP transport\n * observes — a transport adapter layers its own protocol framing on\n * top (JSON-RPC result for MCP, A2A `Task` artifact for A2A, etc.).\n *\n * **Auth is the caller's responsibility.** `invoke()` forwards the\n * provided `authInfo` verbatim to handlers and `resolveAccount`\n * without re-verifying. Mount it only behind a transport that has\n * already authenticated the principal (e.g. `serve({ authenticate })`\n * for MCP, `createA2AAdapter({ authenticate })` for A2A). Do not call\n * it directly from an HTTP handler — that path skips auth.\n *\n * For in-process tests that want to synthesize an `authInfo` without\n * running a transport, reach for {@link dispatchTestRequest} instead\n * — it takes the same principal shape but is explicitly marked\n * test-only in its docstring.\n *\n * Throws when `toolName` is not registered; schema errors round-trip\n * as structured `VALIDATION_ERROR` envelopes inside the return value.\n */\n invoke(options: AdcpInvokeOptions): Promise<McpToolResponse>;\n\n /**\n * Returns the AdCP protocol version this server is configured to speak.\n *\n * Defaults to {@link ADCP_VERSION} (the GA version the SDK ships against)\n * unless overridden via `createAdcpServer({ adcpVersion })`. This is the\n * protocol version, **not** the publisher's app version (`config.version`).\n *\n * Plumbing surface — Stage 2 of the multi-version refactor exposes the\n * configured value but does not yet vary validator/schema selection by\n * version. Wire-shape adapters key off this getter in subsequent stages.\n */\n getAdcpVersion(): string;\n}\n\n/**\n * Symbol-keyed accessor for the underlying SDK `McpServer`. Used by\n * `serve()` to reach through the opaque wrapper when SDK-specific\n * operations are needed. Not part of the public API — typed on a\n * separate internal interface so downstream consumers can't discover\n * it through the `AdcpServer` type.\n *\n * @internal\n */\nexport const ADCP_SDK_SERVER: unique symbol = Symbol.for('@adcp/client.sdkServer');\n\n/**\n * Symbol-keyed accessor for the state store backing an `AdcpServer`.\n * Test harnesses and helpers like\n * `@adcp/sdk/compliance-fixtures`'s `seedComplianceFixtures` need\n * to reach the store without widening the public `AdcpServer`\n * interface (handlers already get `ctx.store`; production code paths\n * don't need a second accessor).\n *\n * @internal\n */\nexport const ADCP_STATE_STORE: unique symbol = Symbol.for('@adcp/client.stateStore');\n\n/**\n * Symbol-keyed accessor for the capabilities object `createAdcpServer`\n * assembles and the auto-wired `get_adcp_capabilities` handler reads from.\n * Mutating this object mutates what subsequent capability-discovery calls\n * return — `registerTestController` uses this to add a\n * `compliance_testing` capability block after registration so the server\n * advertises its controller scenarios even though `registerTestController`\n * runs after `createAdcpServer`.\n *\n * @internal\n */\nexport const ADCP_CAPABILITIES: unique symbol = Symbol.for('@adcp/client.capabilities');\n\n/** Per-request tool visibility policy consumed by transport adapters. @internal */\nexport const ADCP_TOOL_VISIBILITY: unique symbol = Symbol.for('@adcp/client.toolVisibility');\n\n/** Configured MCP App resources mirrored into modern per-request servers. @internal */\nexport const ADCP_MCP_APP_RESOURCES: unique symbol = Symbol.for('@adcp/client.mcpAppResources');\n\n/** @internal */\nexport type AdcpToolVisibilityResolver = (options: {\n toolName: string;\n authInfo?: AdcpAuthInfo;\n input?: Readonly<Record<string, unknown>>;\n}) => boolean | Promise<boolean>;\n\n/** @internal */\nexport interface AdcpServerInternal extends AdcpServer {\n readonly [ADCP_SDK_SERVER]: McpServer;\n [ADCP_TOOL_VISIBILITY]?: AdcpToolVisibilityResolver;\n [ADCP_MCP_APP_RESOURCES]?: readonly AdcpMcpResourceDefinition[];\n}\n\n/**\n * Return the underlying `McpServer` for a wrapped `AdcpServer`, or\n * `undefined` if the value is not an `AdcpServer` produced by\n * `createAdcpServer()`.\n *\n * @internal\n */\nexport function getSdkServer(server: AdcpServer | McpServer): McpServer | undefined {\n const candidate = (server as unknown as Partial<AdcpServerInternal>)[ADCP_SDK_SERVER];\n return candidate;\n}\n\n/** Attach a transport-independent per-request tool visibility policy. @internal */\nexport function setToolVisibilityResolver(server: AdcpServer, resolver: AdcpToolVisibilityResolver): void {\n (server as AdcpServerInternal)[ADCP_TOOL_VISIBILITY] = resolver;\n}\n\n/** Attach validated resource definitions for transport adapters. @internal */\nexport function setMcpAppResources(server: AdcpServer, resources: readonly AdcpMcpResourceDefinition[]): void {\n Object.defineProperty(server, ADCP_MCP_APP_RESOURCES, {\n value: resources,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n}\n\n/** Read validated resource definitions for transport adapters. @internal */\nexport function listMcpAppResources(server: AdcpServer): readonly AdcpMcpResourceDefinition[] {\n return (server as AdcpServerInternal)[ADCP_MCP_APP_RESOURCES] ?? [];\n}\n\n/** Resolve whether a registered tool may be exposed to this request. @internal */\nexport async function isRegisteredToolVisible(\n server: AdcpServer,\n options: Parameters<AdcpToolVisibilityResolver>[0]\n): Promise<boolean> {\n const resolver = (server as AdcpServerInternal)[ADCP_TOOL_VISIBILITY];\n return resolver ? resolver(options) : true;\n}\n\n/**\n * True when `value` is an `AdcpServer` produced by `createAdcpServer()`.\n *\n * @internal\n */\nexport function isAdcpServer(value: unknown): value is AdcpServerInternal {\n return (\n value != null &&\n typeof value === 'object' &&\n ADCP_SDK_SERVER in (value as Record<PropertyKey, unknown>) &&\n typeof (value as AdcpServer).dispatchTestRequest === 'function'\n );\n}\n\n// ---------------------------------------------------------------------------\n// Private-field access — centralized\n// ---------------------------------------------------------------------------\n//\n// The MCP SDK marks `_requestHandlers` and `_registeredTools` as private.\n// Dispatching a request in-process from a test needs them. Doing it once\n// here means downstream harnesses don't each repeat the (server as any)\n// dance, which is the whole point of exposing `dispatchTestRequest()`.\n//\n// If/when the SDK ships a public in-process dispatch API, swap these two\n// helpers for that API. The AdcpServer surface stays the same.\n\ninterface RegisteredTool {\n title?: string;\n description?: string;\n inputSchema?: unknown;\n outputSchema?: unknown;\n annotations?: unknown;\n _meta?: Record<string, unknown>;\n enabled?: boolean;\n handler: (args: unknown, extra: unknown) => unknown | Promise<unknown>;\n}\n\ninterface McpServerPrivates {\n _registeredTools?: Record<string, RegisteredTool | undefined>;\n server?: {\n _requestHandlers?: Map<\n string,\n (request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>\n >;\n _serverInfo?: { name: string; version: string; [key: string]: unknown };\n _instructions?: string;\n };\n}\n\n/** Tool metadata needed to mirror the registered AdCP surface into another official MCP transport. @internal */\nexport interface RegisteredToolDefinition {\n name: string;\n title?: string;\n description?: string;\n inputSchema?: unknown;\n outputSchema?: unknown;\n annotations?: unknown;\n _meta?: Record<string, unknown>;\n}\n\n/** @internal */\ntype McpRequestHandler = (request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>;\n\n/**\n * Write the instructions string onto the low-level SDK server backing\n * `mcpServer`. Called by the async-function-form instructions hook to\n * inject the resolved string just before the MCP `initialize` response.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function setSdkServerInstructions(mcpServer: McpServer, value: string | undefined): void {\n const priv = mcpServer as unknown as McpServerPrivates;\n if (priv.server) {\n priv.server._instructions = value;\n }\n}\n\n/**\n * Wrap the `initialize` request handler on `mcpServer` so that `wrapper`\n * runs (and can await async work) before the original handler responds.\n * The wrapper receives the original handler as its first argument and must\n * call it to complete the handshake.\n *\n * The wrapper is invoked once per MCP `initialize` call on this server\n * instance. Under `serve({ reuseAgent: false })` the server is created\n * fresh per request, so the wrapper fires once per session. Under\n * `reuseAgent: true` the `ADCP_INSTRUCTIONS_FN` check in `serve.ts`\n * blocks the combination before the wrapper can be called a second time.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapInitializeHandler(\n mcpServer: McpServer,\n wrapper: (\n origHandler: McpRequestHandler,\n req: { method: string; params?: unknown },\n extra: unknown\n ) => unknown | Promise<unknown>\n): void {\n const priv = mcpServer as unknown as McpServerPrivates;\n const handlers = priv.server?._requestHandlers;\n if (!handlers) return;\n const orig = handlers.get('initialize');\n if (!orig) return;\n handlers.set('initialize', (req, extra) => wrapper(orig, req, extra));\n}\n\nfunction getRegisteredTool(server: McpServer, name: string): RegisteredTool | undefined {\n return (server as unknown as McpServerPrivates)._registeredTools?.[name];\n}\n\n/**\n * Wrap a registered MCP tool handler without changing the tool definition\n * advertised by the SDK server.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapRegisteredToolHandler(\n server: McpServer,\n name: string,\n wrapper: (orig: RegisteredTool['handler'], args: unknown, extra: unknown) => unknown | Promise<unknown>\n): boolean {\n const tool = getRegisteredTool(server, name);\n if (!tool) return false;\n const orig = tool.handler;\n tool.handler = (args, extra) => wrapper(orig, args, extra);\n return true;\n}\n\n/**\n * Enumerate the tool names registered on the underlying SDK server.\n * Used by transport adapters that need to derive discovery metadata\n * (agent cards, capability listings) from the registered surface\n * without reaching into private SDK fields at every call site.\n *\n * @internal\n */\nexport function listRegisteredToolNames(server: McpServer): string[] {\n const registered = (server as unknown as McpServerPrivates)._registeredTools ?? {};\n return Object.keys(registered);\n}\n\n/**\n * Return enabled registered-tool metadata for the modern MCP server adapter.\n * Handler functions stay private; the adapter dispatches through\n * {@link AdcpServer.invoke} so the framework pipeline remains authoritative.\n *\n * @internal\n */\nexport function listRegisteredToolDefinitions(server: McpServer): RegisteredToolDefinition[] {\n const registered = (server as unknown as McpServerPrivates)._registeredTools ?? {};\n return Object.entries(registered).flatMap(([name, tool]) => {\n if (!tool || tool.enabled === false) return [];\n return [\n {\n name,\n ...(tool.title !== undefined && { title: tool.title }),\n ...(tool.description !== undefined && { description: tool.description }),\n ...(tool.inputSchema !== undefined && { inputSchema: tool.inputSchema }),\n ...(tool.outputSchema !== undefined && { outputSchema: tool.outputSchema }),\n ...(tool.annotations !== undefined && { annotations: tool.annotations }),\n ...(tool._meta !== undefined && { _meta: tool._meta }),\n },\n ];\n });\n}\n\n/** Return the SDK server identity advertised during MCP discovery. @internal */\nexport function getSdkServerInfo(server: McpServer): { name: string; version: string; [key: string]: unknown } {\n return (\n (server as unknown as McpServerPrivates).server?._serverInfo ?? {\n name: 'AdCP Server',\n version: 'unknown',\n }\n );\n}\n\n/** Return static or already-resolved server instructions. @internal */\nexport function getSdkServerInstructions(server: McpServer): string | undefined {\n return (server as unknown as McpServerPrivates).server?._instructions;\n}\n\nfunction getRequestHandler(\n server: McpServer,\n method: string\n): ((request: { method: string; params?: unknown }, extra: unknown) => unknown | Promise<unknown>) | undefined {\n return (server as unknown as McpServerPrivates).server?._requestHandlers?.get(method);\n}\n\n/**\n * Wrap an SDK request handler such as `tools/list` while preserving the\n * original handler's request/extra contract.\n *\n * @internal\n * @remarks Pokes an SDK private field — see the \"Private-field access\" note above.\n */\nexport function wrapSdkRequestHandler(\n server: McpServer,\n method: string,\n wrapper: (\n orig: McpRequestHandler,\n req: { method: string; params?: unknown },\n extra: unknown\n ) => unknown | Promise<unknown>\n): boolean {\n const handlers = (server as unknown as McpServerPrivates).server?._requestHandlers;\n const orig = handlers?.get(method);\n if (!handlers || !orig) return false;\n handlers.set(method, (req, extra) => wrapper(orig, req, extra));\n return true;\n}\n\n/**\n * Wrap an SDK `McpServer` into the opaque `AdcpServer` handle returned by\n * `createAdcpServer()`. Consumers should prefer `createAdcpServer()` and\n * treat this as an internal utility; it's exported for framework code\n * that needs to produce an `AdcpServer` around a hand-built server.\n *\n * Idempotent — passing an already-wrapped `AdcpServer` returns it\n * unchanged rather than nesting wrappers (which would leave\n * `ADCP_SDK_SERVER` pointing at the outer wrapper instead of the SDK\n * handle and break `getSdkServer()` round-trips).\n *\n * @internal\n */\nexport function wrapMcpServer(\n inner: McpServer | AdcpServerInternal,\n compliance?: AdcpServerComplianceApi,\n adcpVersion: string = ADCP_VERSION\n): AdcpServerInternal {\n if (isAdcpServer(inner)) return inner;\n const mcp = inner as McpServer;\n const resolvedCompliance: AdcpServerComplianceApi = compliance ?? {\n async reset() {\n throw new Error(\n 'AdcpServer.compliance.reset: no-op handle returned by `wrapMcpServer` without a compliance implementation. ' +\n 'Use `createAdcpServer()` to get a server whose `compliance.reset()` flushes the state and idempotency stores.'\n );\n },\n };\n const dispatch = async (request: AdcpTestRequest, extras?: AdcpTestRequestExtras): Promise<AdcpTestResponse> => {\n const extra: { signal: AbortSignal; authInfo?: AdcpTestRequestExtras['authInfo']; sessionId?: string } = {\n signal: new AbortController().signal,\n };\n if (extras?.authInfo) extra.authInfo = extras.authInfo;\n if (extras?.sessionId) extra.sessionId = extras.sessionId;\n\n if (request.method === 'tools/call') {\n const params = (request.params ?? {}) as { name?: string; arguments?: Record<string, unknown> };\n if (typeof params.name !== 'string') {\n throw new Error(\"dispatchTestRequest: 'tools/call' requires params.name (string)\");\n }\n const tool = getRegisteredTool(mcp, params.name);\n if (!tool) {\n throw new Error(`dispatchTestRequest: tool \"${params.name}\" is not registered`);\n }\n return tool.handler(params.arguments ?? {}, extra);\n }\n\n const handler = getRequestHandler(mcp, request.method);\n if (!handler) {\n throw new Error(`dispatchTestRequest: no handler registered for method \"${request.method}\"`);\n }\n return handler({ method: request.method, params: request.params ?? {} }, extra);\n };\n const invoke = async (options: AdcpInvokeOptions): Promise<McpToolResponse> => {\n const tool = getRegisteredTool(mcp, options.toolName);\n if (!tool) {\n throw new Error(`AdcpServer.invoke: tool \"${options.toolName}\" is not registered`);\n }\n const extra: { signal: AbortSignal; authInfo?: AdcpAuthInfo } = {\n signal: options.signal ?? new AbortController().signal,\n };\n if (options.authInfo) extra.authInfo = options.authInfo;\n return (await tool.handler(options.args, extra)) as McpToolResponse;\n };\n const wrapper: AdcpServerInternal = {\n [ADCP_SDK_SERVER]: mcp,\n connect(transport) {\n // The SDK's Transport interface is structurally compatible with\n // AdcpServerTransport — the cast is boundary-crossing, not lossy.\n return mcp.connect(transport as unknown as Parameters<McpServer['connect']>[0]);\n },\n close() {\n return mcp.close();\n },\n compliance: resolvedCompliance,\n // Satisfies both overloads (typed tools/call + generic fallback) — the\n // runtime dispatcher is a single function that narrows by method.\n dispatchTestRequest: dispatch as AdcpServerInternal['dispatchTestRequest'],\n invoke,\n getAdcpVersion: () => adc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