@adcp/sdk 17.0.0-beta.21 → 17.0.0-beta.22
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.
- package/README.md +26 -2
- package/dist/lib/client/core.d.mts +4 -0
- package/dist/lib/client/core.d.ts +4 -0
- package/dist/lib/client/core.js +13 -0
- package/dist/lib/client/core.mjs +12 -0
- package/dist/lib/conformance/property-lists.d.mts +1 -1
- package/dist/lib/conformance/property-lists.d.ts +1 -1
- package/dist/lib/conformance/property-lists.js +1 -1
- package/dist/lib/conformance/property-lists.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +10 -1
- package/dist/lib/core/SingleAgentClient.d.ts +10 -1
- package/dist/lib/core/SingleAgentClient.js +56 -7
- package/dist/lib/core/SingleAgentClient.mjs +61 -7
- package/dist/lib/core/targeting-helpers.d.mts +123 -0
- package/dist/lib/core/targeting-helpers.d.ts +123 -0
- package/dist/lib/core/targeting-helpers.js +412 -0
- package/dist/lib/core/targeting-helpers.mjs +370 -0
- package/dist/lib/entrypoints/client-account-changes.d.mts +5 -0
- package/dist/lib/entrypoints/client-account-changes.d.ts +5 -0
- package/dist/lib/entrypoints/client-account-changes.js +28 -0
- package/dist/lib/entrypoints/client-account-changes.mjs +4 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.mts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.ts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.js +37 -0
- package/dist/lib/entrypoints/client-webhook-stores.mjs +16 -0
- package/dist/lib/entrypoints/discovery.d.mts +9 -0
- package/dist/lib/entrypoints/discovery.d.ts +9 -0
- package/dist/lib/entrypoints/discovery.js +72 -0
- package/dist/lib/entrypoints/discovery.mjs +56 -0
- package/dist/lib/entrypoints/errors.d.mts +11 -0
- package/dist/lib/entrypoints/errors.d.ts +11 -0
- package/dist/lib/entrypoints/errors.js +159 -0
- package/dist/lib/entrypoints/errors.mjs +132 -0
- package/dist/lib/entrypoints/media-buy.d.mts +5 -0
- package/dist/lib/entrypoints/media-buy.d.ts +5 -0
- package/dist/lib/entrypoints/media-buy.js +119 -0
- package/dist/lib/entrypoints/media-buy.mjs +100 -0
- package/dist/lib/entrypoints/registry.d.mts +5 -0
- package/dist/lib/entrypoints/registry.d.ts +5 -0
- package/dist/lib/entrypoints/registry.js +61 -0
- package/dist/lib/entrypoints/registry.mjs +40 -0
- package/dist/lib/entrypoints/utils.d.mts +7 -0
- package/dist/lib/entrypoints/utils.d.ts +7 -0
- package/dist/lib/entrypoints/utils.js +100 -0
- package/dist/lib/entrypoints/utils.mjs +72 -0
- package/dist/lib/entrypoints/version.d.mts +3 -0
- package/dist/lib/entrypoints/version.d.ts +3 -0
- package/dist/lib/entrypoints/version.js +57 -0
- package/dist/lib/entrypoints/version.mjs +36 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/media-buy/action-contracts.js +3 -3
- package/dist/lib/media-buy/action-contracts.mjs +1 -1
- package/dist/lib/media-buy/creative-start-policy.d.mts +19 -0
- package/dist/lib/media-buy/creative-start-policy.d.ts +19 -0
- package/dist/lib/media-buy/creative-start-policy.js +59 -0
- package/dist/lib/media-buy/creative-start-policy.mjs +31 -0
- package/dist/lib/media-buy/valid-actions.d.mts +47 -0
- package/dist/lib/media-buy/valid-actions.d.ts +47 -0
- package/dist/lib/media-buy/valid-actions.js +42 -0
- package/dist/lib/media-buy/valid-actions.mjs +18 -0
- package/dist/lib/net/pin-and-bind-fetch.d.mts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.d.ts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.js +209 -0
- package/dist/lib/net/pin-and-bind-fetch.mjs +183 -0
- package/dist/lib/registry/types.generated.d.ts +18 -2
- package/dist/lib/reporting/ledger/index.d.mts +1 -0
- package/dist/lib/reporting/ledger/index.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.js +3 -1
- package/dist/lib/reporting/ledger/index.mjs +1 -0
- package/dist/lib/reporting/ledger/instant.d.mts +5 -0
- package/dist/lib/reporting/ledger/instant.d.ts +5 -0
- package/dist/lib/reporting/ledger/instant.js +10 -0
- package/dist/lib/reporting/ledger/instant.mjs +9 -0
- package/dist/lib/reporting/ledger/issue-events.d.mts +333 -0
- package/dist/lib/reporting/ledger/issue-events.d.ts +333 -0
- package/dist/lib/reporting/ledger/issue-events.js +310 -0
- package/dist/lib/reporting/ledger/issue-events.mjs +282 -0
- package/dist/lib/reporting/service/index.d.mts +36 -1
- package/dist/lib/reporting/service/index.d.ts +36 -1
- package/dist/lib/reporting/service/index.js +51 -1
- package/dist/lib/reporting/service/index.mjs +52 -2
- package/dist/lib/reporting/service/scheduler-support.d.mts +1 -1
- package/dist/lib/reporting/service/scheduler-support.d.ts +1 -1
- package/dist/lib/reporting/service/scheduler-support.js +1 -1
- package/dist/lib/reporting/service/scheduler-support.mjs +1 -1
- package/dist/lib/server/capabilities-release-projection.d.mts +43 -0
- package/dist/lib/server/capabilities-release-projection.d.ts +43 -0
- package/dist/lib/server/capabilities-release-projection.js +128 -0
- package/dist/lib/server/capabilities-release-projection.mjs +112 -0
- package/dist/lib/server/create-adcp-server.d.mts +29 -5
- package/dist/lib/server/create-adcp-server.d.ts +29 -5
- package/dist/lib/server/create-adcp-server.js +95 -22
- package/dist/lib/server/create-adcp-server.mjs +106 -21
- package/dist/lib/server/decisioning/capabilities.d.mts +27 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +27 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +99 -27
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +103 -27
- package/dist/lib/server/declared-input-schema.d.mts +108 -0
- package/dist/lib/server/declared-input-schema.d.ts +108 -0
- package/dist/lib/server/declared-input-schema.js +167 -0
- package/dist/lib/server/declared-input-schema.mjs +137 -0
- package/dist/lib/server/envelope-allowlist.d.mts +1 -105
- package/dist/lib/server/envelope-allowlist.d.ts +1 -105
- package/dist/lib/server/envelope-allowlist.js +3 -79
- package/dist/lib/server/envelope-allowlist.mjs +1 -71
- package/dist/lib/server/errors.d.mts +1 -186
- package/dist/lib/server/errors.d.ts +1 -186
- package/dist/lib/server/errors.js +3 -98
- package/dist/lib/server/errors.mjs +1 -94
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/mcp-modern-server.js +21 -4
- package/dist/lib/server/mcp-modern-server.mjs +21 -4
- package/dist/lib/server/media-buy-action-resolver.d.mts +7 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +7 -0
- package/dist/lib/server/media-buy-action-resolver.js +10 -1
- package/dist/lib/server/media-buy-action-resolver.mjs +10 -1
- package/dist/lib/server/media-buy-helpers.d.mts +1 -47
- package/dist/lib/server/media-buy-helpers.d.ts +1 -47
- package/dist/lib/server/media-buy-helpers.js +3 -23
- package/dist/lib/server/media-buy-helpers.mjs +1 -18
- package/dist/lib/server/pick-safe-details.d.mts +1 -89
- package/dist/lib/server/pick-safe-details.d.ts +1 -89
- package/dist/lib/server/pick-safe-details.js +3 -61
- package/dist/lib/server/pick-safe-details.mjs +1 -56
- package/dist/lib/server/pin-and-bind-fetch.d.mts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.d.ts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.js +3 -190
- package/dist/lib/server/pin-and-bind-fetch.mjs +1 -183
- package/dist/lib/server/targeting-helpers.d.mts +1 -123
- package/dist/lib/server/targeting-helpers.d.ts +1 -123
- package/dist/lib/server/targeting-helpers.js +3 -393
- package/dist/lib/server/targeting-helpers.mjs +1 -370
- package/dist/lib/server/test-controller.js +7 -3
- package/dist/lib/server/test-controller.mjs +7 -3
- package/dist/lib/storage/memory-ledger.js +219 -1
- package/dist/lib/storage/memory-ledger.mjs +223 -1
- package/dist/lib/testing/compliance/storyboard-tracks.js +0 -4
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +0 -4
- package/dist/lib/testing/comply-controller.js +7 -2
- package/dist/lib/testing/comply-controller.mjs +7 -2
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.js +31 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +30 -0
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +2 -1
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +12 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +12 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -2
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +7 -2
- package/dist/lib/testing/storyboard/runner.js +2 -2
- package/dist/lib/testing/storyboard/runner.mjs +2 -2
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/utils/adcp-error-response.d.mts +196 -0
- package/dist/lib/utils/adcp-error-response.d.ts +196 -0
- package/dist/lib/utils/adcp-error-response.js +118 -0
- package/dist/lib/utils/adcp-error-response.mjs +95 -0
- package/dist/lib/utils/buyer-retry-policy.js +2 -2
- package/dist/lib/utils/buyer-retry-policy.mjs +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.js +6 -2
- package/dist/lib/utils/capabilities.mjs +6 -2
- package/dist/lib/utils/envelope-allowlist.d.mts +105 -0
- package/dist/lib/utils/envelope-allowlist.d.ts +105 -0
- package/dist/lib/utils/envelope-allowlist.js +98 -0
- package/dist/lib/utils/envelope-allowlist.mjs +71 -0
- package/dist/lib/utils/pick-safe-details.d.mts +89 -0
- package/dist/lib/utils/pick-safe-details.d.ts +89 -0
- package/dist/lib/utils/pick-safe-details.js +80 -0
- package/dist/lib/utils/pick-safe-details.mjs +56 -0
- package/dist/lib/v2/projection/augment-response.d.mts +4 -0
- package/dist/lib/v2/projection/augment-response.d.ts +4 -0
- package/dist/lib/v2/projection/creative-delivery.d.mts +20 -3
- package/dist/lib/v2/projection/creative-delivery.d.ts +20 -3
- package/dist/lib/v2/projection/creative-delivery.js +20 -4
- package/dist/lib/v2/projection/creative-delivery.mjs +19 -4
- package/dist/lib/v2/projection/index.d.mts +2 -2
- package/dist/lib/v2/projection/index.d.ts +2 -2
- package/dist/lib/v2/projection/index.js +4 -0
- package/dist/lib/v2/projection/index.mjs +5 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.js +14 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +12 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +11 -0
- package/dist/lib/v2/projection/legacy-routes.d.ts +11 -0
- package/dist/lib/v2/projection/legacy-routes.js +2 -1
- package/dist/lib/v2/projection/legacy-routes.mjs +7 -2
- package/dist/lib/v2/projection/v1-to-v2.d.mts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.js +18 -11
- package/dist/lib/v2/projection/v1-to-v2.mjs +19 -11
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/CREATIVE-DELIVERY.md +12 -0
- package/docs/guides/REPORTING-LEDGER.md +121 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +1 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +149 -0
- package/docs/migration-reporting-storage-package.md +10 -0
- package/package.json +106 -1
package/README.md
CHANGED
|
@@ -81,17 +81,41 @@ const health = EventSourceHealthSchema.parse(rawHealth);
|
|
|
81
81
|
|
|
82
82
|
The browser entry also exports `GetProductsRequestSchema` and `LegacyGetProductsRequestSchema`, `BiddingPolicySchema`, `CanonicalBudgetAllocationSchema`, and the strict `SyncCreatives*` validators, with the same validation behavior as the Node entry. It has no Node built-ins in its import graph (runtime or type declarations). JSON Schema loading and tool registration helpers remain available from `@adcp/sdk/schemas`. The generated schemas still initialize together, so importing one schema can retain the full generated module in a browser bundle; per-schema tree-shaking is tracked in [#3178](https://github.com/adcontextprotocol/adcp-client/issues/3178).
|
|
83
83
|
|
|
84
|
-
### Focused client runtime (`@adcp/sdk/client/core`)
|
|
84
|
+
### Focused client runtime (`@adcp/sdk/client/core` and friends)
|
|
85
85
|
|
|
86
86
|
Applications that only call AdCP agents can avoid evaluating the SDK's server,
|
|
87
87
|
compliance, testing, and unrelated protocol surfaces:
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
import { ADCPMultiAgentClient, InMemoryWebhookRegistrationStore } from '@adcp/sdk/client/core';
|
|
91
|
+
import { AuthenticationRequiredError, decideRetry } from '@adcp/sdk/errors';
|
|
92
|
+
import { ADCP_VERSION } from '@adcp/sdk/version';
|
|
91
93
|
```
|
|
92
94
|
|
|
95
|
+
The package root still loads the server and testing helpers, because it
|
|
96
|
+
re-exports them. These subpaths don't:
|
|
97
|
+
|
|
98
|
+
| Subpath | What it carries |
|
|
99
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
100
|
+
| `@adcp/sdk/client/core` | The clients (`ADCPMultiAgentClient`, `AgentClient`, `SingleAgentClient`, `CreativeAgentClient`), the in-memory webhook-registration store, `createInMemoryAgentDiscoveryCache`, `ADCP_STATUS`, `InputRequiredError` |
|
|
101
|
+
| `@adcp/sdk/client/account-changes` | The account change feed: `streamAccountChanges`, `restoreAccountChangeCursor`, `buildAccountChangeSubscriptionRequest`, change-recorded wake-up parsing |
|
|
102
|
+
| `@adcp/sdk/client/webhook-stores` | Durable webhook-registration stores: `pgWebhookRegistrationStore`, `cleanupExpiredWebhookRegistrations`, `redisWebhookRegistrationStore` |
|
|
103
|
+
| `@adcp/sdk/errors` | Typed errors (`AuthenticationRequiredError`, `IdempotencyConflictError`, `ADCPValidationError`, ...), `adcpErrorToTypedError`, `isErrorOfType`, `STANDARD_ERROR_CODES`, `extractAdcpErrorInfo`, `decideRetry` |
|
|
104
|
+
| `@adcp/sdk/version` | `ADCP_VERSION`, `LIBRARY_VERSION`, `COMPATIBLE_ADCP_VERSIONS`, `parseAdcpMajorVersion`, `resolveAdcpVersion` |
|
|
105
|
+
| `@adcp/sdk/registry` | `RegistryClient`, `RegistrySync`, `PropertyRegistry`, the feed-stream reader and `sanitizeStreamText` |
|
|
106
|
+
| `@adcp/sdk/utils` | `canonicalize`, `canonicalJsonSha256`, `unwrapProtocolResponse`, media-buy status helpers, `parseCapabilitiesResponse` and the `*_TOOLS` lists, `brandManifestToBrandReference` |
|
|
107
|
+
| `@adcp/sdk/discovery` | `validateAdAgents`, `resolveAgentProperties`, `canonicalizeAgentUrl`, the publisher property selector helpers, `PropertyIndex` |
|
|
108
|
+
| `@adcp/sdk/media-buy` | `preflightUpdateMediaBuy`, the `can*` checks, `getAvailableActions`, `MediaBuyLifecycleCoordinator` |
|
|
109
|
+
|
|
110
|
+
Every name on these subpaths is the same export as on the package root: the
|
|
111
|
+
same class (so `instanceof` agrees across entry points) and the same type. Some
|
|
112
|
+
root type names are aliases: the root's `CreateMediaBuyRequest`, `Product` and
|
|
113
|
+
`PackageRequest` are the canonical types from `@adcp/sdk/v2/projection`, while
|
|
114
|
+
`@adcp/sdk/types` exports different shapes under those names. The subpaths
|
|
115
|
+
above never re-export a root name with a different meaning.
|
|
116
|
+
|
|
93
117
|
The existing `@adcp/sdk/client` path remains an alias of the package root for
|
|
94
|
-
compatibility. Use
|
|
118
|
+
compatibility. Use the subpaths when cold import and test-worker startup time
|
|
95
119
|
matter.
|
|
96
120
|
|
|
97
121
|
For application monorepos, keep `skipLibCheck: true` unless you are intentionally auditing SDK declarations. If a package only needs request/response types for a few tools, prefer the per-tool slices over importing generated types through the root package or the broad `@adcp/sdk/types` barrel.
|
|
@@ -4,6 +4,10 @@ export { ADCPMultiAgentClient, createADCPMultiAgentClient, type MultiAgentWebhoo
|
|
|
4
4
|
export { CreativeAgentClient, createCreativeAgentClient, STANDARD_CREATIVE_AGENTS, type CreativeAgentClientConfig, type CreativeAgentListTaskOptions, type LegacyCreativeFormat, } from '../core/CreativeAgentClient.mjs';
|
|
5
5
|
export { ConfigurationManager } from '../core/ConfigurationManager.mjs';
|
|
6
6
|
export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStoreOptions, type WebhookAuthenticationMode, type WebhookRegistration, type WebhookRegistrationStore, } from '../core/webhook-registration.mjs';
|
|
7
|
+
export { createInMemoryAgentDiscoveryCache } from '../core/agent-discovery-cache.mjs';
|
|
8
|
+
export type { AgentDiscoveryCache, AgentDiscoveryCacheConfig, AgentDiscoveryEntry, InMemoryAgentDiscoveryCache, InMemoryAgentDiscoveryCacheOptions, } from '../core/agent-discovery-cache.mjs';
|
|
9
|
+
export { ADCP_STATUS, type ADCPStatus } from '../core/ProtocolResponseParser.mjs';
|
|
10
|
+
export { InputRequiredError, DeferredSettlementOwnershipError, DirectContinuationRecoveryError, type DirectContinuationRecoveryFailure, } from '../core/TaskExecutor.mjs';
|
|
7
11
|
export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes.mjs';
|
|
8
12
|
export type { AgentConfig } from '../types/adcp.mjs';
|
|
9
13
|
export type { ResolveAccountOptions, ResolveAccountResult, ListedAccount } from '../core/account-resolution.mjs';
|
|
@@ -4,6 +4,10 @@ export { ADCPMultiAgentClient, createADCPMultiAgentClient, type MultiAgentWebhoo
|
|
|
4
4
|
export { CreativeAgentClient, createCreativeAgentClient, STANDARD_CREATIVE_AGENTS, type CreativeAgentClientConfig, type CreativeAgentListTaskOptions, type LegacyCreativeFormat, } from '../core/CreativeAgentClient';
|
|
5
5
|
export { ConfigurationManager } from '../core/ConfigurationManager';
|
|
6
6
|
export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStoreOptions, type WebhookAuthenticationMode, type WebhookRegistration, type WebhookRegistrationStore, } from '../core/webhook-registration';
|
|
7
|
+
export { createInMemoryAgentDiscoveryCache } from '../core/agent-discovery-cache';
|
|
8
|
+
export type { AgentDiscoveryCache, AgentDiscoveryCacheConfig, AgentDiscoveryEntry, InMemoryAgentDiscoveryCache, InMemoryAgentDiscoveryCacheOptions, } from '../core/agent-discovery-cache';
|
|
9
|
+
export { ADCP_STATUS, type ADCPStatus } from '../core/ProtocolResponseParser';
|
|
10
|
+
export { InputRequiredError, DeferredSettlementOwnershipError, DirectContinuationRecoveryError, type DirectContinuationRecoveryFailure, } from '../core/TaskExecutor';
|
|
7
11
|
export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes';
|
|
8
12
|
export type { AgentConfig } from '../types/adcp';
|
|
9
13
|
export type { ResolveAccountOptions, ResolveAccountResult, ListedAccount } from '../core/account-resolution';
|
package/dist/lib/client/core.js
CHANGED
|
@@ -19,17 +19,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var core_exports = {};
|
|
20
20
|
__export(core_exports, {
|
|
21
21
|
ADCPMultiAgentClient: () => import_ADCPMultiAgentClient.ADCPMultiAgentClient,
|
|
22
|
+
ADCP_STATUS: () => import_ProtocolResponseParser.ADCP_STATUS,
|
|
22
23
|
AgentClient: () => import_AgentClient.AgentClient,
|
|
23
24
|
CapabilityPreflightError: () => import_AgentClient.CapabilityPreflightError,
|
|
24
25
|
ConfigurationManager: () => import_ConfigurationManager.ConfigurationManager,
|
|
25
26
|
CreativeAgentClient: () => import_CreativeAgentClient.CreativeAgentClient,
|
|
27
|
+
DeferredSettlementOwnershipError: () => import_TaskExecutor.DeferredSettlementOwnershipError,
|
|
28
|
+
DirectContinuationRecoveryError: () => import_TaskExecutor.DirectContinuationRecoveryError,
|
|
26
29
|
InMemoryWebhookRegistrationStore: () => import_webhook_registration.InMemoryWebhookRegistrationStore,
|
|
30
|
+
InputRequiredError: () => import_TaskExecutor.InputRequiredError,
|
|
27
31
|
STANDARD_CREATIVE_AGENTS: () => import_CreativeAgentClient.STANDARD_CREATIVE_AGENTS,
|
|
28
32
|
SingleAgentClient: () => import_SingleAgentClient.SingleAgentClient,
|
|
29
33
|
UnsupportedFeatureError: () => import_SingleAgentClient.UnsupportedFeatureError,
|
|
30
34
|
WebhookDispatchError: () => import_SingleAgentClient.WebhookDispatchError,
|
|
31
35
|
createADCPMultiAgentClient: () => import_ADCPMultiAgentClient.createADCPMultiAgentClient,
|
|
32
36
|
createCreativeAgentClient: () => import_CreativeAgentClient.createCreativeAgentClient,
|
|
37
|
+
createInMemoryAgentDiscoveryCache: () => import_agent_discovery_cache.createInMemoryAgentDiscoveryCache,
|
|
33
38
|
createSingleAgentClient: () => import_SingleAgentClient.createSingleAgentClient
|
|
34
39
|
});
|
|
35
40
|
module.exports = __toCommonJS(core_exports);
|
|
@@ -39,19 +44,27 @@ var import_ADCPMultiAgentClient = require('../core/ADCPMultiAgentClient.js');
|
|
|
39
44
|
var import_CreativeAgentClient = require('../core/CreativeAgentClient.js');
|
|
40
45
|
var import_ConfigurationManager = require('../core/ConfigurationManager.js');
|
|
41
46
|
var import_webhook_registration = require('../core/webhook-registration.js');
|
|
47
|
+
var import_agent_discovery_cache = require('../core/agent-discovery-cache.js');
|
|
48
|
+
var import_ProtocolResponseParser = require('../core/ProtocolResponseParser.js');
|
|
49
|
+
var import_TaskExecutor = require('../core/TaskExecutor.js');
|
|
42
50
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
51
|
0 && (module.exports = {
|
|
44
52
|
ADCPMultiAgentClient,
|
|
53
|
+
ADCP_STATUS,
|
|
45
54
|
AgentClient,
|
|
46
55
|
CapabilityPreflightError,
|
|
47
56
|
ConfigurationManager,
|
|
48
57
|
CreativeAgentClient,
|
|
58
|
+
DeferredSettlementOwnershipError,
|
|
59
|
+
DirectContinuationRecoveryError,
|
|
49
60
|
InMemoryWebhookRegistrationStore,
|
|
61
|
+
InputRequiredError,
|
|
50
62
|
STANDARD_CREATIVE_AGENTS,
|
|
51
63
|
SingleAgentClient,
|
|
52
64
|
UnsupportedFeatureError,
|
|
53
65
|
WebhookDispatchError,
|
|
54
66
|
createADCPMultiAgentClient,
|
|
55
67
|
createCreativeAgentClient,
|
|
68
|
+
createInMemoryAgentDiscoveryCache,
|
|
56
69
|
createSingleAgentClient
|
|
57
70
|
});
|
package/dist/lib/client/core.mjs
CHANGED
|
@@ -21,18 +21,30 @@ import { ConfigurationManager } from "../core/ConfigurationManager.mjs";
|
|
|
21
21
|
import {
|
|
22
22
|
InMemoryWebhookRegistrationStore
|
|
23
23
|
} from "../core/webhook-registration.mjs";
|
|
24
|
+
import { createInMemoryAgentDiscoveryCache } from "../core/agent-discovery-cache.mjs";
|
|
25
|
+
import { ADCP_STATUS } from "../core/ProtocolResponseParser.mjs";
|
|
26
|
+
import {
|
|
27
|
+
InputRequiredError,
|
|
28
|
+
DeferredSettlementOwnershipError,
|
|
29
|
+
DirectContinuationRecoveryError
|
|
30
|
+
} from "../core/TaskExecutor.mjs";
|
|
24
31
|
export {
|
|
25
32
|
ADCPMultiAgentClient,
|
|
33
|
+
ADCP_STATUS,
|
|
26
34
|
AgentClient,
|
|
27
35
|
CapabilityPreflightError,
|
|
28
36
|
ConfigurationManager,
|
|
29
37
|
CreativeAgentClient,
|
|
38
|
+
DeferredSettlementOwnershipError,
|
|
39
|
+
DirectContinuationRecoveryError,
|
|
30
40
|
InMemoryWebhookRegistrationStore,
|
|
41
|
+
InputRequiredError,
|
|
31
42
|
STANDARD_CREATIVE_AGENTS,
|
|
32
43
|
SingleAgentClient,
|
|
33
44
|
UnsupportedFeatureError,
|
|
34
45
|
WebhookDispatchError,
|
|
35
46
|
createADCPMultiAgentClient,
|
|
36
47
|
createCreativeAgentClient,
|
|
48
|
+
createInMemoryAgentDiscoveryCache,
|
|
37
49
|
createSingleAgentClient
|
|
38
50
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropertyListReference } from '../types/tools.generated.mjs';
|
|
2
|
-
import { type ResolveListOptions } from '../
|
|
2
|
+
import { type ResolveListOptions } from '../core/targeting-helpers.mjs';
|
|
3
3
|
export interface PropertyListConformanceReport {
|
|
4
4
|
totalRuns: number;
|
|
5
5
|
totalFailures: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropertyListReference } from '../types/tools.generated';
|
|
2
|
-
import { type ResolveListOptions } from '../
|
|
2
|
+
import { type ResolveListOptions } from '../core/targeting-helpers';
|
|
3
3
|
export interface PropertyListConformanceReport {
|
|
4
4
|
totalRuns: number;
|
|
5
5
|
totalFailures: number;
|
|
@@ -21,7 +21,7 @@ __export(property_lists_exports, {
|
|
|
21
21
|
runPropertyListConformance: () => runPropertyListConformance
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(property_lists_exports);
|
|
24
|
-
var import_targeting_helpers = require('../
|
|
24
|
+
var import_targeting_helpers = require('../core/targeting-helpers.js');
|
|
25
25
|
async function runPropertyListConformance(references, options = {}) {
|
|
26
26
|
const results = [];
|
|
27
27
|
for (const [index, reference] of references.entries()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolvePropertyList } from "../
|
|
1
|
+
import { resolvePropertyList } from "../core/targeting-helpers.mjs";
|
|
2
2
|
async function runPropertyListConformance(references, options = {}) {
|
|
3
3
|
const results = [];
|
|
4
4
|
for (const [index, reference] of references.entries()) {
|
|
@@ -24,7 +24,7 @@ import { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage } fr
|
|
|
24
24
|
import type { ProductCache } from './product-cache.mjs';
|
|
25
25
|
import { type ResolveAccountOptions, type ResolveAccountResult } from './account-resolution.mjs';
|
|
26
26
|
import { type BuyerPropertyPolicy, type ProductPolicyResolvedProperty, type ProductPropertyPolicyMode } from '../media-buy/property-policy.mjs';
|
|
27
|
-
import { type ResolveListOptions } from '
|
|
27
|
+
import { type ResolveListOptions } from './targeting-helpers.mjs';
|
|
28
28
|
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery.mjs';
|
|
29
29
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2.mjs';
|
|
30
30
|
import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot.mjs';
|
|
@@ -1983,6 +1983,15 @@ export declare class SingleAgentClient {
|
|
|
1983
1983
|
* reaches here.
|
|
1984
1984
|
*/
|
|
1985
1985
|
private suppressPre31DiscoveryWebhook;
|
|
1986
|
+
/**
|
|
1987
|
+
* AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
|
|
1988
|
+
* true` on `control_media_buy` to a seller that does not declare
|
|
1989
|
+
* `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
|
|
1990
|
+
* discovery is authoritative; with synthetic or missing capabilities the
|
|
1991
|
+
* request is sent and the seller decides. `false`, omission and calls below
|
|
1992
|
+
* 3.3 are unaffected. The vocabulary matches the seller's own refusal.
|
|
1993
|
+
*/
|
|
1994
|
+
private assertCreativeStartPolicyDeclared;
|
|
1986
1995
|
/**
|
|
1987
1996
|
* Reject shape-changing 3.1 requests after seller capability discovery.
|
|
1988
1997
|
* This second gate covers a modern client talking to a 3.0 seller on the
|
|
@@ -24,7 +24,7 @@ import { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage } fr
|
|
|
24
24
|
import type { ProductCache } from './product-cache';
|
|
25
25
|
import { type ResolveAccountOptions, type ResolveAccountResult } from './account-resolution';
|
|
26
26
|
import { type BuyerPropertyPolicy, type ProductPolicyResolvedProperty, type ProductPropertyPolicyMode } from '../media-buy/property-policy';
|
|
27
|
-
import { type ResolveListOptions } from '
|
|
27
|
+
import { type ResolveListOptions } from './targeting-helpers';
|
|
28
28
|
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery';
|
|
29
29
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2';
|
|
30
30
|
import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot';
|
|
@@ -1983,6 +1983,15 @@ export declare class SingleAgentClient {
|
|
|
1983
1983
|
* reaches here.
|
|
1984
1984
|
*/
|
|
1985
1985
|
private suppressPre31DiscoveryWebhook;
|
|
1986
|
+
/**
|
|
1987
|
+
* AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
|
|
1988
|
+
* true` on `control_media_buy` to a seller that does not declare
|
|
1989
|
+
* `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
|
|
1990
|
+
* discovery is authoritative; with synthetic or missing capabilities the
|
|
1991
|
+
* request is sent and the seller decides. `false`, omission and calls below
|
|
1992
|
+
* 3.3 are unaffected. The vocabulary matches the seller's own refusal.
|
|
1993
|
+
*/
|
|
1994
|
+
private assertCreativeStartPolicyDeclared;
|
|
1986
1995
|
/**
|
|
1987
1996
|
* Reject shape-changing 3.1 requests after seller capability discovery.
|
|
1988
1997
|
* This second gate covers a modern client talking to a 3.0 seller on the
|
|
@@ -50,6 +50,7 @@ var import_adcp = require('../types/adcp.js');
|
|
|
50
50
|
var import_version = require('../version.js');
|
|
51
51
|
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
52
52
|
var import_reporting_version = require('../media-buy/reporting-version.js');
|
|
53
|
+
var import_creative_start_policy = require('../media-buy/creative-start-policy.js');
|
|
53
54
|
var import_version2 = require('../adapters/version/index.js');
|
|
54
55
|
var import_schema_loader2 = require('../validation/schema-loader.js');
|
|
55
56
|
var import_idempotency = require('../utils/idempotency.js');
|
|
@@ -90,7 +91,7 @@ var import_global_async_local_storage = require('../utils/global-async-local-sto
|
|
|
90
91
|
var import_validate_user_agent = require('../utils/validate-user-agent.js');
|
|
91
92
|
var import_webhook_url = require('./webhook-url.js');
|
|
92
93
|
var import_property_policy = require('../media-buy/property-policy.js');
|
|
93
|
-
var import_targeting_helpers = require('
|
|
94
|
+
var import_targeting_helpers = require('./targeting-helpers.js');
|
|
94
95
|
var import_creative_delivery = require('../v2/projection/creative-delivery.js');
|
|
95
96
|
var import_legacy_routes = require('../v2/projection/legacy-routes.js');
|
|
96
97
|
var import_catalog_snapshot = require('../v2/projection/catalog-snapshot.js');
|
|
@@ -3742,6 +3743,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3742
3743
|
serverVersion,
|
|
3743
3744
|
negotiatedRelease
|
|
3744
3745
|
);
|
|
3746
|
+
this.assertCreativeStartPolicyDeclared(
|
|
3747
|
+
taskType,
|
|
3748
|
+
normalizedParams,
|
|
3749
|
+
capabilityDiscoveryContext.capabilities,
|
|
3750
|
+
negotiatedRelease?.version ?? options?.wireAdcpVersion ?? this.getWireAdcpVersion()
|
|
3751
|
+
);
|
|
3745
3752
|
const { options: webhookOptions, driftLog: webhookDriftLog } = this.suppressPre31DiscoveryWebhook(
|
|
3746
3753
|
taskType,
|
|
3747
3754
|
options,
|
|
@@ -5547,11 +5554,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5547
5554
|
if (hasCreativeFormatData) {
|
|
5548
5555
|
this.validateBeforeCreativeCapabilityProbe("create_media_buy", params, taskOptions);
|
|
5549
5556
|
}
|
|
5557
|
+
const wireRelease = {};
|
|
5550
5558
|
const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
|
|
5551
5559
|
"create_media_buy",
|
|
5552
5560
|
taskOptions,
|
|
5553
5561
|
true,
|
|
5554
|
-
() => this.productOptionsSupportCanonicalWire("create_media_buy", params, [], options)
|
|
5562
|
+
() => this.productOptionsSupportCanonicalWire("create_media_buy", params, [], options),
|
|
5563
|
+
wireRelease
|
|
5555
5564
|
) : "canonical";
|
|
5556
5565
|
const wireParams = params;
|
|
5557
5566
|
const result = await this.executeAndHandle(
|
|
@@ -5564,7 +5573,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5564
5573
|
"create_media_buy",
|
|
5565
5574
|
effectiveLegacyFormatConverter,
|
|
5566
5575
|
effectiveCanonicalFormatLegacyResolver,
|
|
5567
|
-
creativeFormatProjection?.legacyFormatDefinitions
|
|
5576
|
+
creativeFormatProjection?.legacyFormatDefinitions,
|
|
5577
|
+
wireRelease.formatOptionRefs === true
|
|
5568
5578
|
),
|
|
5569
5579
|
"create_media_buy",
|
|
5570
5580
|
wireMode,
|
|
@@ -5650,11 +5660,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5650
5660
|
if (hasCreativeFormatData) {
|
|
5651
5661
|
this.validateBeforeCreativeCapabilityProbe("update_media_buy", params, taskOptions);
|
|
5652
5662
|
}
|
|
5663
|
+
const wireRelease = {};
|
|
5653
5664
|
const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
|
|
5654
5665
|
"update_media_buy",
|
|
5655
5666
|
taskOptions,
|
|
5656
5667
|
true,
|
|
5657
|
-
() => this.productOptionsSupportCanonicalWire("update_media_buy", params, [], options)
|
|
5668
|
+
() => this.productOptionsSupportCanonicalWire("update_media_buy", params, [], options),
|
|
5669
|
+
wireRelease
|
|
5658
5670
|
) : "canonical";
|
|
5659
5671
|
const result = await this.executeAndHandle(
|
|
5660
5672
|
"update_media_buy",
|
|
@@ -5666,7 +5678,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5666
5678
|
"update_media_buy",
|
|
5667
5679
|
effectiveLegacyFormatConverter,
|
|
5668
5680
|
effectiveCanonicalFormatLegacyResolver,
|
|
5669
|
-
creativeFormatProjection?.legacyFormatDefinitions
|
|
5681
|
+
creativeFormatProjection?.legacyFormatDefinitions,
|
|
5682
|
+
wireRelease.formatOptionRefs === true
|
|
5670
5683
|
),
|
|
5671
5684
|
"update_media_buy",
|
|
5672
5685
|
wireMode,
|
|
@@ -5822,7 +5835,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5822
5835
|
async resolveCreativeFormatWireMode(taskType, options) {
|
|
5823
5836
|
return this.resolveCreativeWireMode(taskType, options, true);
|
|
5824
5837
|
}
|
|
5825
|
-
async resolveCreativeWireMode(taskType, options, canRediscover, matchingProductOptions) {
|
|
5838
|
+
async resolveCreativeWireMode(taskType, options, canRediscover, matchingProductOptions, releaseContext) {
|
|
5826
5839
|
const discoveryContext = {};
|
|
5827
5840
|
const capabilities = await this.getCapabilities({
|
|
5828
5841
|
...options,
|
|
@@ -5832,6 +5845,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5832
5845
|
const toolSchemas = discoveryContext.toolSchemas ?? (usesScopedFetch ? void 0 : this.cachedToolSchemas);
|
|
5833
5846
|
const wireRelease = this.config.wireAdcpVersion ?? this.resolvedAdcpVersion;
|
|
5834
5847
|
const declared = (0, import_creative_delivery.resolveCreativeFormatWireMode)(capabilities, wireRelease);
|
|
5848
|
+
if (releaseContext) {
|
|
5849
|
+
releaseContext.formatOptionRefs = (0, import_creative_delivery.releaseCarriesPackageFormatOptionRefs)(capabilities, wireRelease);
|
|
5850
|
+
}
|
|
5835
5851
|
const document = toolSchemas && toolInputSchemasByProperties.get(toolSchemas)?.get(taskType);
|
|
5836
5852
|
const { creativeSchemaSupport } = await import("./creative-schema-support.js");
|
|
5837
5853
|
(0, import_abort2.throwIfAborted)(options?.signal);
|
|
@@ -5850,7 +5866,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5850
5866
|
if (resolved === "unknown" && canonicalRequiredByBuyerPin) {
|
|
5851
5867
|
if (canRediscover && !usesScopedFetch && this.normalizedAgent.protocol === "mcp" && this.capabilitiesFromSharedCache && toolSchemas?.has(taskType) && !toolInputSchemasByProperties.has(toolSchemas)) {
|
|
5852
5868
|
await this.invalidateDiscoveryCache(options);
|
|
5853
|
-
return this.resolveCreativeWireMode(taskType, options, false, matchingProductOptions);
|
|
5869
|
+
return this.resolveCreativeWireMode(taskType, options, false, matchingProductOptions, releaseContext);
|
|
5854
5870
|
}
|
|
5855
5871
|
throw new import_creative_delivery.CreativeFormatCapabilityError(
|
|
5856
5872
|
`Cannot prove which AdCP release the seller serves for ${taskType}; a 3.2+ client will not guess a legacy creative wire shape`
|
|
@@ -7338,6 +7354,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
7338
7354
|
serverVersion,
|
|
7339
7355
|
negotiatedRelease
|
|
7340
7356
|
);
|
|
7357
|
+
this.assertCreativeStartPolicyDeclared(
|
|
7358
|
+
taskName,
|
|
7359
|
+
normalizedParams,
|
|
7360
|
+
capabilityDiscoveryContext.capabilities,
|
|
7361
|
+
negotiatedRelease?.version ?? options?.wireAdcpVersion ?? this.getWireAdcpVersion()
|
|
7362
|
+
);
|
|
7341
7363
|
const { options: webhookOptions, driftLog: webhookDriftLog } = this.suppressPre31DiscoveryWebhook(
|
|
7342
7364
|
taskName,
|
|
7343
7365
|
options,
|
|
@@ -9079,6 +9101,33 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
9079
9101
|
}
|
|
9080
9102
|
};
|
|
9081
9103
|
}
|
|
9104
|
+
/**
|
|
9105
|
+
* AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
|
|
9106
|
+
* true` on `control_media_buy` to a seller that does not declare
|
|
9107
|
+
* `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
|
|
9108
|
+
* discovery is authoritative; with synthetic or missing capabilities the
|
|
9109
|
+
* request is sent and the seller decides. `false`, omission and calls below
|
|
9110
|
+
* 3.3 are unaffected. The vocabulary matches the seller's own refusal.
|
|
9111
|
+
*/
|
|
9112
|
+
assertCreativeStartPolicyDeclared(taskName, params, capabilities, targetVersion) {
|
|
9113
|
+
if (taskName !== "control_media_buy") return;
|
|
9114
|
+
const fields = (0, import_creative_start_policy.creativeStartPolicyOptInFields)(params);
|
|
9115
|
+
if (fields.length === 0 || capabilities?._synthetic !== false) return;
|
|
9116
|
+
if (!(0, import_adcp_version_config.isAdcpVersionAtLeast)(targetVersion, "3.3.0-beta.0")) return;
|
|
9117
|
+
if ((0, import_capabilities.resolveFeature)(capabilities, "creative_start_policy")) return;
|
|
9118
|
+
const suggestion = `Omit ${import_creative_start_policy.CREATIVE_START_POLICY_FIELD} or send false; check ${import_creative_start_policy.CREATIVE_START_POLICY_FEATURE} in get_adcp_capabilities before opting in.`;
|
|
9119
|
+
throw new import_errors.ProtocolFeatureUnsupportedError(
|
|
9120
|
+
["creative_start_policy"],
|
|
9121
|
+
(0, import_capabilities.listDeclaredFeatures)(capabilities),
|
|
9122
|
+
this.agent.agent_uri,
|
|
9123
|
+
{
|
|
9124
|
+
message: `${taskName} ${fields.join(", ")}: true ${fields.length === 1 ? "requires" : "require"} ${import_creative_start_policy.CREATIVE_START_POLICY_FEATURE}, which this seller does not declare. No request was sent. ${suggestion}`,
|
|
9125
|
+
field: fields[0],
|
|
9126
|
+
suggestion,
|
|
9127
|
+
details: { feature: import_creative_start_policy.CREATIVE_START_POLICY_FEATURE, fields }
|
|
9128
|
+
}
|
|
9129
|
+
);
|
|
9130
|
+
}
|
|
9082
9131
|
/**
|
|
9083
9132
|
* Reject shape-changing 3.1 requests after seller capability discovery.
|
|
9084
9133
|
* This second gate covers a modern client talking to a 3.0 seller on the
|
|
@@ -49,6 +49,11 @@ import {
|
|
|
49
49
|
resolveAdcpVersion
|
|
50
50
|
} from "../utils/adcp-version-config.mjs";
|
|
51
51
|
import { beta6ReportingRequestIssue } from "../media-buy/reporting-version.mjs";
|
|
52
|
+
import {
|
|
53
|
+
CREATIVE_START_POLICY_FEATURE,
|
|
54
|
+
CREATIVE_START_POLICY_FIELD,
|
|
55
|
+
creativeStartPolicyOptInFields
|
|
56
|
+
} from "../media-buy/creative-start-policy.mjs";
|
|
52
57
|
import {
|
|
53
58
|
convertRequest,
|
|
54
59
|
convertResponse,
|
|
@@ -204,7 +209,7 @@ import {
|
|
|
204
209
|
isSupportedPropertyIdentifierType,
|
|
205
210
|
normalizeDomainForPropertyPolicy
|
|
206
211
|
} from "../media-buy/property-policy.mjs";
|
|
207
|
-
import { resolvePropertyList } from "
|
|
212
|
+
import { resolvePropertyList } from "./targeting-helpers.mjs";
|
|
208
213
|
import {
|
|
209
214
|
CreativeFormatCapabilityError,
|
|
210
215
|
CreativeFormatProjectionError,
|
|
@@ -216,6 +221,7 @@ import {
|
|
|
216
221
|
syncCreativeAssignmentTargets,
|
|
217
222
|
projectUndeclaredFormatOptionSelectors,
|
|
218
223
|
resolveCreativeFormatWireMode,
|
|
224
|
+
releaseCarriesPackageFormatOptionRefs,
|
|
219
225
|
stripLegacyCreativeIdentity
|
|
220
226
|
} from "../v2/projection/creative-delivery.mjs";
|
|
221
227
|
import {
|
|
@@ -3861,6 +3867,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3861
3867
|
serverVersion,
|
|
3862
3868
|
negotiatedRelease
|
|
3863
3869
|
);
|
|
3870
|
+
this.assertCreativeStartPolicyDeclared(
|
|
3871
|
+
taskType,
|
|
3872
|
+
normalizedParams,
|
|
3873
|
+
capabilityDiscoveryContext.capabilities,
|
|
3874
|
+
negotiatedRelease?.version ?? options?.wireAdcpVersion ?? this.getWireAdcpVersion()
|
|
3875
|
+
);
|
|
3864
3876
|
const { options: webhookOptions, driftLog: webhookDriftLog } = this.suppressPre31DiscoveryWebhook(
|
|
3865
3877
|
taskType,
|
|
3866
3878
|
options,
|
|
@@ -5666,11 +5678,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5666
5678
|
if (hasCreativeFormatData) {
|
|
5667
5679
|
this.validateBeforeCreativeCapabilityProbe("create_media_buy", params, taskOptions);
|
|
5668
5680
|
}
|
|
5681
|
+
const wireRelease = {};
|
|
5669
5682
|
const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
|
|
5670
5683
|
"create_media_buy",
|
|
5671
5684
|
taskOptions,
|
|
5672
5685
|
true,
|
|
5673
|
-
() => this.productOptionsSupportCanonicalWire("create_media_buy", params, [], options)
|
|
5686
|
+
() => this.productOptionsSupportCanonicalWire("create_media_buy", params, [], options),
|
|
5687
|
+
wireRelease
|
|
5674
5688
|
) : "canonical";
|
|
5675
5689
|
const wireParams = params;
|
|
5676
5690
|
const result = await this.executeAndHandle(
|
|
@@ -5683,7 +5697,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5683
5697
|
"create_media_buy",
|
|
5684
5698
|
effectiveLegacyFormatConverter,
|
|
5685
5699
|
effectiveCanonicalFormatLegacyResolver,
|
|
5686
|
-
creativeFormatProjection?.legacyFormatDefinitions
|
|
5700
|
+
creativeFormatProjection?.legacyFormatDefinitions,
|
|
5701
|
+
wireRelease.formatOptionRefs === true
|
|
5687
5702
|
),
|
|
5688
5703
|
"create_media_buy",
|
|
5689
5704
|
wireMode,
|
|
@@ -5769,11 +5784,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5769
5784
|
if (hasCreativeFormatData) {
|
|
5770
5785
|
this.validateBeforeCreativeCapabilityProbe("update_media_buy", params, taskOptions);
|
|
5771
5786
|
}
|
|
5787
|
+
const wireRelease = {};
|
|
5772
5788
|
const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
|
|
5773
5789
|
"update_media_buy",
|
|
5774
5790
|
taskOptions,
|
|
5775
5791
|
true,
|
|
5776
|
-
() => this.productOptionsSupportCanonicalWire("update_media_buy", params, [], options)
|
|
5792
|
+
() => this.productOptionsSupportCanonicalWire("update_media_buy", params, [], options),
|
|
5793
|
+
wireRelease
|
|
5777
5794
|
) : "canonical";
|
|
5778
5795
|
const result = await this.executeAndHandle(
|
|
5779
5796
|
"update_media_buy",
|
|
@@ -5785,7 +5802,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5785
5802
|
"update_media_buy",
|
|
5786
5803
|
effectiveLegacyFormatConverter,
|
|
5787
5804
|
effectiveCanonicalFormatLegacyResolver,
|
|
5788
|
-
creativeFormatProjection?.legacyFormatDefinitions
|
|
5805
|
+
creativeFormatProjection?.legacyFormatDefinitions,
|
|
5806
|
+
wireRelease.formatOptionRefs === true
|
|
5789
5807
|
),
|
|
5790
5808
|
"update_media_buy",
|
|
5791
5809
|
wireMode,
|
|
@@ -5941,7 +5959,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5941
5959
|
async resolveCreativeFormatWireMode(taskType, options) {
|
|
5942
5960
|
return this.resolveCreativeWireMode(taskType, options, true);
|
|
5943
5961
|
}
|
|
5944
|
-
async resolveCreativeWireMode(taskType, options, canRediscover, matchingProductOptions) {
|
|
5962
|
+
async resolveCreativeWireMode(taskType, options, canRediscover, matchingProductOptions, releaseContext) {
|
|
5945
5963
|
const discoveryContext = {};
|
|
5946
5964
|
const capabilities = await this.getCapabilities({
|
|
5947
5965
|
...options,
|
|
@@ -5951,6 +5969,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5951
5969
|
const toolSchemas = discoveryContext.toolSchemas ?? (usesScopedFetch ? void 0 : this.cachedToolSchemas);
|
|
5952
5970
|
const wireRelease = this.config.wireAdcpVersion ?? this.resolvedAdcpVersion;
|
|
5953
5971
|
const declared = resolveCreativeFormatWireMode(capabilities, wireRelease);
|
|
5972
|
+
if (releaseContext) {
|
|
5973
|
+
releaseContext.formatOptionRefs = releaseCarriesPackageFormatOptionRefs(capabilities, wireRelease);
|
|
5974
|
+
}
|
|
5954
5975
|
const document = toolSchemas && toolInputSchemasByProperties.get(toolSchemas)?.get(taskType);
|
|
5955
5976
|
const { creativeSchemaSupport } = await import("./creative-schema-support.mjs");
|
|
5956
5977
|
throwIfAborted(options?.signal);
|
|
@@ -5969,7 +5990,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5969
5990
|
if (resolved === "unknown" && canonicalRequiredByBuyerPin) {
|
|
5970
5991
|
if (canRediscover && !usesScopedFetch && this.normalizedAgent.protocol === "mcp" && this.capabilitiesFromSharedCache && toolSchemas?.has(taskType) && !toolInputSchemasByProperties.has(toolSchemas)) {
|
|
5971
5992
|
await this.invalidateDiscoveryCache(options);
|
|
5972
|
-
return this.resolveCreativeWireMode(taskType, options, false, matchingProductOptions);
|
|
5993
|
+
return this.resolveCreativeWireMode(taskType, options, false, matchingProductOptions, releaseContext);
|
|
5973
5994
|
}
|
|
5974
5995
|
throw new CreativeFormatCapabilityError(
|
|
5975
5996
|
`Cannot prove which AdCP release the seller serves for ${taskType}; a 3.2+ client will not guess a legacy creative wire shape`
|
|
@@ -7457,6 +7478,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
7457
7478
|
serverVersion,
|
|
7458
7479
|
negotiatedRelease
|
|
7459
7480
|
);
|
|
7481
|
+
this.assertCreativeStartPolicyDeclared(
|
|
7482
|
+
taskName,
|
|
7483
|
+
normalizedParams,
|
|
7484
|
+
capabilityDiscoveryContext.capabilities,
|
|
7485
|
+
negotiatedRelease?.version ?? options?.wireAdcpVersion ?? this.getWireAdcpVersion()
|
|
7486
|
+
);
|
|
7460
7487
|
const { options: webhookOptions, driftLog: webhookDriftLog } = this.suppressPre31DiscoveryWebhook(
|
|
7461
7488
|
taskName,
|
|
7462
7489
|
options,
|
|
@@ -9198,6 +9225,33 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
9198
9225
|
}
|
|
9199
9226
|
};
|
|
9200
9227
|
}
|
|
9228
|
+
/**
|
|
9229
|
+
* AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
|
|
9230
|
+
* true` on `control_media_buy` to a seller that does not declare
|
|
9231
|
+
* `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
|
|
9232
|
+
* discovery is authoritative; with synthetic or missing capabilities the
|
|
9233
|
+
* request is sent and the seller decides. `false`, omission and calls below
|
|
9234
|
+
* 3.3 are unaffected. The vocabulary matches the seller's own refusal.
|
|
9235
|
+
*/
|
|
9236
|
+
assertCreativeStartPolicyDeclared(taskName, params, capabilities, targetVersion) {
|
|
9237
|
+
if (taskName !== "control_media_buy") return;
|
|
9238
|
+
const fields = creativeStartPolicyOptInFields(params);
|
|
9239
|
+
if (fields.length === 0 || capabilities?._synthetic !== false) return;
|
|
9240
|
+
if (!isAdcpVersionAtLeast(targetVersion, "3.3.0-beta.0")) return;
|
|
9241
|
+
if (resolveFeature(capabilities, "creative_start_policy")) return;
|
|
9242
|
+
const suggestion = `Omit ${CREATIVE_START_POLICY_FIELD} or send false; check ${CREATIVE_START_POLICY_FEATURE} in get_adcp_capabilities before opting in.`;
|
|
9243
|
+
throw new ProtocolFeatureUnsupportedError(
|
|
9244
|
+
["creative_start_policy"],
|
|
9245
|
+
listDeclaredFeatures(capabilities),
|
|
9246
|
+
this.agent.agent_uri,
|
|
9247
|
+
{
|
|
9248
|
+
message: `${taskName} ${fields.join(", ")}: true ${fields.length === 1 ? "requires" : "require"} ${CREATIVE_START_POLICY_FEATURE}, which this seller does not declare. No request was sent. ${suggestion}`,
|
|
9249
|
+
field: fields[0],
|
|
9250
|
+
suggestion,
|
|
9251
|
+
details: { feature: CREATIVE_START_POLICY_FEATURE, fields }
|
|
9252
|
+
}
|
|
9253
|
+
);
|
|
9254
|
+
}
|
|
9201
9255
|
/**
|
|
9202
9256
|
* Reject shape-changing 3.1 requests after seller capability discovery.
|
|
9203
9257
|
* This second gate covers a modern client talking to a 3.0 seller on the
|