@adcp/client 3.11.0 → 3.11.2
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/bin/adcp.js +32 -1
- package/dist/lib/auth/index.d.ts +4 -0
- package/dist/lib/auth/index.d.ts.map +1 -1
- package/dist/lib/auth/index.js +5 -0
- package/dist/lib/auth/index.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +9 -0
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +73 -20
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/errors/index.d.ts +63 -0
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +82 -1
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +6 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +82 -57
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/types/core.generated.d.ts +129 -5
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/schemas.generated.d.ts +535 -27
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +114 -30
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +385 -90
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/types/tools.generated.js.map +1 -1
- package/package.json +2 -2
package/dist/lib/errors/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Custom error classes for ADCP client library
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ConfigurationError = exports.InvalidContextError = exports.MissingInputHandlerError = exports.ValidationError = exports.ProtocolError = exports.UnsupportedTaskError = exports.AgentNotFoundError = exports.TaskAbortedError = exports.DeferredTaskError = exports.MaxClarificationError = exports.TaskTimeoutError = exports.ADCPError = void 0;
|
|
4
|
+
exports.AuthenticationRequiredError = exports.ConfigurationError = exports.InvalidContextError = exports.MissingInputHandlerError = exports.ValidationError = exports.ProtocolError = exports.UnsupportedTaskError = exports.AgentNotFoundError = exports.TaskAbortedError = exports.DeferredTaskError = exports.MaxClarificationError = exports.TaskTimeoutError = exports.ADCPError = void 0;
|
|
5
|
+
exports.is401Error = is401Error;
|
|
5
6
|
exports.isADCPError = isADCPError;
|
|
6
7
|
exports.isErrorOfType = isErrorOfType;
|
|
7
8
|
exports.extractErrorInfo = extractErrorInfo;
|
|
@@ -174,6 +175,86 @@ class ConfigurationError extends ADCPError {
|
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
exports.ConfigurationError = ConfigurationError;
|
|
178
|
+
/**
|
|
179
|
+
* Error thrown when authentication is required to access an MCP endpoint
|
|
180
|
+
*
|
|
181
|
+
* This error is thrown during MCP endpoint discovery when the server returns
|
|
182
|
+
* a 401 Unauthorized response. If the server supports OAuth, the error includes
|
|
183
|
+
* the OAuth metadata to help clients initiate the authentication flow.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* try {
|
|
188
|
+
* await client.getProducts({ brief: 'test' });
|
|
189
|
+
* } catch (error) {
|
|
190
|
+
* if (error instanceof AuthenticationRequiredError) {
|
|
191
|
+
* if (error.oauthMetadata) {
|
|
192
|
+
* // Redirect user to OAuth flow
|
|
193
|
+
* const authUrl = error.oauthMetadata.authorization_endpoint;
|
|
194
|
+
* console.log(`Please authenticate at: ${authUrl}`);
|
|
195
|
+
* } else {
|
|
196
|
+
* console.log('Authentication required but OAuth not available');
|
|
197
|
+
* }
|
|
198
|
+
* }
|
|
199
|
+
* }
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
class AuthenticationRequiredError extends ADCPError {
|
|
203
|
+
agentUrl;
|
|
204
|
+
oauthMetadata;
|
|
205
|
+
code = 'AUTHENTICATION_REQUIRED';
|
|
206
|
+
constructor(agentUrl, oauthMetadata, message) {
|
|
207
|
+
const defaultMessage = oauthMetadata
|
|
208
|
+
? `Authentication required for ${agentUrl}. OAuth available at: ${oauthMetadata.authorization_endpoint}`
|
|
209
|
+
: `Authentication required for ${agentUrl}. No OAuth metadata available - provide auth_token in agent config.`;
|
|
210
|
+
super(message || defaultMessage);
|
|
211
|
+
this.agentUrl = agentUrl;
|
|
212
|
+
this.oauthMetadata = oauthMetadata;
|
|
213
|
+
this.details = { agentUrl, oauthMetadata };
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Check if OAuth authentication is available
|
|
217
|
+
*/
|
|
218
|
+
get hasOAuth() {
|
|
219
|
+
return this.oauthMetadata !== undefined;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get the authorization URL if OAuth is available
|
|
223
|
+
*/
|
|
224
|
+
get authorizationUrl() {
|
|
225
|
+
return this.oauthMetadata?.authorization_endpoint;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.AuthenticationRequiredError = AuthenticationRequiredError;
|
|
229
|
+
/**
|
|
230
|
+
* Check if an error indicates a 401 Unauthorized response
|
|
231
|
+
*
|
|
232
|
+
* This helper centralizes the fragile logic of detecting 401 errors from
|
|
233
|
+
* various sources (HTTP status codes, error messages, wrapped errors).
|
|
234
|
+
* Used during endpoint discovery to detect authentication requirements.
|
|
235
|
+
*
|
|
236
|
+
* @param error - The error to check
|
|
237
|
+
* @param got401Flag - Optional flag that was set by tracking HTTP responses
|
|
238
|
+
* @returns true if the error appears to be a 401 authentication error
|
|
239
|
+
*/
|
|
240
|
+
function is401Error(error, got401Flag = false) {
|
|
241
|
+
if (got401Flag) {
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
if (!error) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
// Check for status property (common in HTTP errors)
|
|
248
|
+
const errorObj = error;
|
|
249
|
+
const status = errorObj?.status || errorObj?.response?.status || errorObj?.cause?.status;
|
|
250
|
+
if (status === 401) {
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
// Fall back to string matching in error message
|
|
254
|
+
// This is fragile but necessary since different SDKs format errors differently
|
|
255
|
+
const message = errorObj?.message || '';
|
|
256
|
+
return message.includes('401') || message.includes('Unauthorized');
|
|
257
|
+
}
|
|
177
258
|
/**
|
|
178
259
|
* Type guard to check if an error is an ADCP error
|
|
179
260
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/errors/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/errors/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AA+P/C,gCAoBC;AAKD,kCAEC;AAKD,sCAEC;AAKD,4CAyBC;AA7TD;;GAEG;AACH,MAAsB,SAAU,SAAQ,KAAK;IAKlC;IAFT,YACE,OAAe,EACR,OAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAAM;QAGpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAVD,8BAUC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,SAAS;IAI3B;IACA;IAJT,IAAI,GAAG,cAAc,CAAC;IAE/B,YACkB,MAAc,EACd,OAAe;QAE/B,KAAK,CAAC,QAAQ,MAAM,oBAAoB,OAAO,IAAI,CAAC,CAAC;QAHrC,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAQ;IAGjC,CAAC;CACF;AATD,4CASC;AAED;;GAEG;AACH,MAAa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AC;IACJ,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;KACvB,CAAC;AACJ,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export * from './handlers/types';
|
|
|
19
19
|
export type { Storage, BatchStorage, PatternStorage, AgentCapabilities, ConversationState, DeferredTaskState, StorageConfig, StorageFactory, StorageMiddleware, } from './storage/interfaces';
|
|
20
20
|
export { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from './storage/MemoryStorage';
|
|
21
21
|
export { ADCPError, TaskTimeoutError, MaxClarificationError, DeferredTaskError, TaskAbortedError, AgentNotFoundError, UnsupportedTaskError, ProtocolError, ValidationError as ADCPValidationError, // Rename to avoid conflict
|
|
22
|
-
MissingInputHandlerError, InvalidContextError, ConfigurationError, isADCPError, isErrorOfType, extractErrorInfo, } from './errors';
|
|
22
|
+
MissingInputHandlerError, InvalidContextError, ConfigurationError, AuthenticationRequiredError, isADCPError, isErrorOfType, extractErrorInfo, is401Error, } from './errors';
|
|
23
|
+
export type { OAuthMetadataInfo } from './errors';
|
|
23
24
|
export { InputRequiredError } from './core/TaskExecutor';
|
|
24
25
|
export * from './types';
|
|
25
26
|
export type { GetProductsRequest, GetProductsResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, CreatePropertyListRequest, CreatePropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, PropertyList, PropertyListFilters, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CreateContentStandardsRequest, CreateContentStandardsResponse, UpdateContentStandardsRequest, UpdateContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, ContentStandards, Artifact, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SICapabilities, SIIdentity, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, Format, Product, Proposal, ProductAllocation, PackageRequest, CreativeAsset, CreativePolicy, BrandManifest, BrandManifestReference, Account, ListAccountsRequest, ListAccountsResponse, } from './types/tools.generated';
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACjG,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,YAAY,GACb,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC/G,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,KAAK,m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0B,EAC1B,uBAAuB,EACvB,8BAA8B,EAE9B,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,EAE1B,eAAe,EACf,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,kBAAkB,EAClB,sBAAsB,EAEtB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,UAAU,6BAAuB,CAAC;AAK/C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAE7E;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,oBAAoB,CAE9D;AAID,OAAO,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAC7B,aAAa,GACd,MAAM,iBAAiB,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -16,10 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.creativeAgent = exports.TEST_AGENT_NO_AUTH_A2A_CONFIG = exports.TEST_AGENT_NO_AUTH_MCP_CONFIG = exports.testAgentNoAuthA2A = exports.testAgentNoAuth = exports.TEST_AGENT_A2A_CONFIG = exports.TEST_AGENT_MCP_CONFIG = exports.TEST_AGENT_TOKEN = exports.createTestAgent = exports.testAgentClient = exports.testAgentA2A = exports.testAgent = exports.AdCPClient = exports.defaultSISessionManager = exports.SIErrorCodes = exports.AISISessionManager = exports.SISessionManager = exports.defaultProposalManager = exports.ProposalErrorCodes = exports.AIProposalManager = exports.ProposalManager = exports.defaultPropertyListAdapter = exports.isPropertyListError = exports.PropertyListErrorCodes = exports.PropertyListAdapter = exports.defaultContentStandardsAdapter = void 0;
|
|
19
|
+
exports.validateAdCPResponse = exports.validateAgentUrl = exports.createAuthenticatedFetch = exports.createMCPAuthHeaders = exports.createAdCPHeaders = exports.getAuthToken = exports.InputRequiredError = exports.is401Error = exports.extractErrorInfo = exports.isErrorOfType = exports.isADCPError = exports.AuthenticationRequiredError = exports.ConfigurationError = exports.InvalidContextError = exports.MissingInputHandlerError = exports.ADCPValidationError = exports.ProtocolError = exports.UnsupportedTaskError = exports.AgentNotFoundError = exports.TaskAbortedError = exports.DeferredTaskError = exports.MaxClarificationError = exports.TaskTimeoutError = exports.ADCPError = exports.createMemoryStorageConfig = exports.createMemoryStorage = exports.MemoryStorage = exports.createAsyncHandler = exports.AsyncHandler = exports.createOperationId = exports.responseValidator = exports.ResponseValidator = exports.ADCP_STATUS = exports.responseParser = exports.ProtocolResponseParser = exports.TaskExecutor = exports.STANDARD_CREATIVE_AGENTS = exports.createCreativeAgentClient = exports.CreativeAgentClient = exports.ConfigurationManager = exports.createADCPMultiAgentClient = exports.ADCPMultiAgentClient = exports.AgentClient = exports.UnsupportedFeatureError = exports.createSingleAgentClient = exports.SingleAgentClient = exports.PropertyCrawler = exports.resetPropertyIndex = exports.getPropertyIndex = exports.PropertyIndex = void 0;
|
|
20
|
+
exports.isMultiRenderFormat = exports.getCompanionRenders = exports.getPrimaryRender = exports.getFormatRenders = exports.normalizeFormatsResponse = exports.normalizeFormatRenders = exports.getCreativeAssignments = exports.getCreativeIds = exports.usesV3CreativeAssignments = exports.usesV2CreativeIds = exports.normalizeMediaBuyResponse = exports.normalizePackageResponse = exports.adaptUpdateMediaBuyRequestForV2 = exports.adaptCreateMediaBuyRequestForV2 = exports.adaptPackageRequestForV2 = exports.PROTOCOL_TOOLS = exports.CREATIVE_TOOLS = exports.GOVERNANCE_TOOLS = exports.SIGNALS_TOOLS = exports.MEDIA_BUY_TOOLS = exports.supportsContentStandards = exports.supportsPropertyListFiltering = exports.supportsProtocol = exports.supportsV3 = exports.parseCapabilitiesResponse = exports.buildSyntheticCapabilities = exports.hasAssets = exports.getAssetCount = exports.usesDeprecatedAssetsField = exports.getRepeatableGroups = exports.getIndividualAssets = exports.getOptionalAssets = exports.getRequiredAssets = exports.getFormatAssets = exports.detectProtocolWithTimeout = exports.detectProtocol = exports.STANDARD_FORMATS = exports.MAX_CONCURRENT = exports.REQUEST_TIMEOUT = exports.isAdcpSuccess = exports.isAdcpError = exports.unwrapProtocolResponse = exports.getStandardFormats = exports.createA2AClient = exports.createMCPClient = exports.callA2ATool = exports.callMCPTool = exports.ProtocolClient = exports.handleAdCPResponse = exports.getExpectedSchema = void 0;
|
|
21
|
+
exports.ContentStandardsAdapter = exports.AgentCollection = exports.Agent = exports.VERSION_INFO = exports.COMPATIBLE_ADCP_VERSIONS = exports.LIBRARY_VERSION = exports.ADCP_VERSION = exports.getCompatibleVersions = exports.isCompatibleWith = exports.getLibraryVersion = exports.getAdcpVersion = exports.isSyncCreativesFailed = exports.isSyncCreativesSubmitted = exports.isSyncCreativesInputRequired = exports.isSyncCreativesWorking = exports.isSyncCreativesCompleted = exports.isUpdateMediaBuyFailed = exports.isUpdateMediaBuySubmitted = exports.isUpdateMediaBuyInputRequired = exports.isUpdateMediaBuyWorking = exports.isUpdateMediaBuyCompleted = exports.isCreateMediaBuyFailed = exports.isCreateMediaBuySubmitted = exports.isCreateMediaBuyInputRequired = exports.isCreateMediaBuyWorking = exports.isCreateMediaBuyCompleted = exports.isGetProductsFailed = exports.isGetProductsSubmitted = exports.isGetProductsInputRequired = exports.isGetProductsWorking = exports.isGetProductsCompleted = exports.isStatusRejected = exports.isStatusFailed = exports.isStatusSubmitted = exports.isStatusInputRequired = exports.isStatusWorking = exports.isStatusCompleted = exports.getPreviewHtml = exports.getPreviewUrl = exports.getPrimaryPreviewRender = exports.getRenderRole = exports.getRenderId = exports.usesV3RenderFields = exports.usesV2RenderFields = exports.normalizePreviewCreativeResponse = exports.normalizePreview = exports.normalizePreviewRender = exports.getFormatDimensions = exports.usesV3Renders = exports.usesV2Dimensions = void 0;
|
|
22
|
+
exports.creativeAgent = exports.TEST_AGENT_NO_AUTH_A2A_CONFIG = exports.TEST_AGENT_NO_AUTH_MCP_CONFIG = exports.testAgentNoAuthA2A = exports.testAgentNoAuth = exports.TEST_AGENT_A2A_CONFIG = exports.TEST_AGENT_MCP_CONFIG = exports.TEST_AGENT_TOKEN = exports.createTestAgent = exports.testAgentClient = exports.testAgentA2A = exports.testAgent = exports.AdCPClient = exports.defaultSISessionManager = exports.SIErrorCodes = exports.AISISessionManager = exports.SISessionManager = exports.defaultProposalManager = exports.ProposalErrorCodes = exports.AIProposalManager = exports.ProposalManager = exports.defaultPropertyListAdapter = exports.isPropertyListError = exports.PropertyListErrorCodes = exports.PropertyListAdapter = exports.defaultContentStandardsAdapter = exports.isContentStandardsError = exports.ContentStandardsErrorCodes = void 0;
|
|
23
23
|
exports.createAdCPClient = createAdCPClient;
|
|
24
24
|
exports.createAdCPClientFromEnv = createAdCPClientFromEnv;
|
|
25
25
|
// ====== PROPERTY DISCOVERY (AdCP v2.2.0) ======
|
|
@@ -80,9 +80,11 @@ Object.defineProperty(exports, "ADCPValidationError", { enumerable: true, get: f
|
|
|
80
80
|
Object.defineProperty(exports, "MissingInputHandlerError", { enumerable: true, get: function () { return errors_1.MissingInputHandlerError; } });
|
|
81
81
|
Object.defineProperty(exports, "InvalidContextError", { enumerable: true, get: function () { return errors_1.InvalidContextError; } });
|
|
82
82
|
Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: function () { return errors_1.ConfigurationError; } });
|
|
83
|
+
Object.defineProperty(exports, "AuthenticationRequiredError", { enumerable: true, get: function () { return errors_1.AuthenticationRequiredError; } });
|
|
83
84
|
Object.defineProperty(exports, "isADCPError", { enumerable: true, get: function () { return errors_1.isADCPError; } });
|
|
84
85
|
Object.defineProperty(exports, "isErrorOfType", { enumerable: true, get: function () { return errors_1.isErrorOfType; } });
|
|
85
86
|
Object.defineProperty(exports, "extractErrorInfo", { enumerable: true, get: function () { return errors_1.extractErrorInfo; } });
|
|
87
|
+
Object.defineProperty(exports, "is401Error", { enumerable: true, get: function () { return errors_1.is401Error; } });
|
|
86
88
|
var TaskExecutor_2 = require("./core/TaskExecutor");
|
|
87
89
|
Object.defineProperty(exports, "InputRequiredError", { enumerable: true, get: function () { return TaskExecutor_2.InputRequiredError; } });
|
|
88
90
|
// ====== CORE TYPES ======
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,sEAAsE;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,sEAAsE;;;;;;;;;;;;;;;;;;;;AA4ZtE,4CAEC;AAMD,0DAEC;AApaD,iDAAiD;AACjD,6DAMoC;AALlC,+GAAA,aAAa,OAAA;AACb,kHAAA,gBAAgB,OAAA;AAChB,oHAAA,kBAAkB,OAAA;AAIpB,iEAAiG;AAAxF,mHAAA,eAAe,OAAA;AASxB,gDAAgD;AAChD,4DAA4D;AAC5D,8DAA+G;AAAtG,sHAAA,iBAAiB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAE5E,kDAA8F;AAArF,0GAAA,WAAW,OAAA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AAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,sHAAA,0BAA0B,OAAA;AAC1B,sBAAsB;AACtB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AAGjB,8GAAA,kBAAkB,OAAA;AAClB,kHAAA,sBAAsB,OAAA;AACtB,kCAAkC;AAClC,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAGlB,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAMzB,sEAAmE;AAEnE;;;GAGG;AACU,QAAA,UAAU,GAAG,2CAAoB,CAAC;AAE/C,qEAAqE;AACrE,sDAAsD;AAEtD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,MAAsB;IACrD,OAAO,IAAI,kBAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,SAAgB,uBAAuB;IACrC,OAAO,2CAAoB,CAAC,OAAO,EAAE,CAAC;AACxC,CAAC;AAED,6BAA6B;AAC7B,mFAAmF;AACnF,yCAayB;AAZvB,kGAAA,SAAS,OAAA;AACT,qGAAA,YAAY,OAAA;AACZ,wGAAA,eAAe,OAAA;AACf,wGAAA,eAAe,OAAA;AACf,yGAAA,gBAAgB,OAAA;AAChB,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,wGAAA,eAAe,OAAA;AACf,2GAAA,kBAAkB,OAAA;AAClB,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,sGAAA,aAAa,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../../src/lib/protocols/a2a.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../../src/lib/protocols/a2a.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAQvE,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,GAAE,GAAG,EAAO,EACrB,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,OAAO,CAAC,GAAG,CAAC,CAwJd"}
|
|
@@ -4,10 +4,14 @@ exports.callA2ATool = callA2ATool;
|
|
|
4
4
|
// Official A2A client implementation - NO FALLBACKS
|
|
5
5
|
const clientModule = require('@a2a-js/sdk/client');
|
|
6
6
|
const A2AClient = clientModule.A2AClient;
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
const discovery_1 = require("../auth/oauth/discovery");
|
|
7
9
|
if (!A2AClient) {
|
|
8
10
|
throw new Error('A2A SDK client is required. Please install @a2a-js/sdk');
|
|
9
11
|
}
|
|
10
12
|
async function callA2ATool(agentUrl, toolName, parameters, authToken, debugLogs = [], pushNotificationConfig) {
|
|
13
|
+
// Track 401 errors for better error messaging
|
|
14
|
+
let got401 = false;
|
|
11
15
|
// Create authenticated fetch that wraps native fetch
|
|
12
16
|
// This ensures ALL requests (including agent card fetching) include auth headers
|
|
13
17
|
const fetchImpl = async (url, options) => {
|
|
@@ -43,10 +47,15 @@ async function callA2ATool(agentUrl, toolName, parameters, authToken, debugLogs
|
|
|
43
47
|
hasAuth: !!authToken,
|
|
44
48
|
headers: authToken ? { ...headers, Authorization: 'Bearer ***', 'x-adcp-auth': '***' } : headers,
|
|
45
49
|
});
|
|
46
|
-
|
|
50
|
+
const response = await fetch(url, {
|
|
47
51
|
...options,
|
|
48
52
|
headers,
|
|
49
53
|
});
|
|
54
|
+
// Track 401 errors
|
|
55
|
+
if (response.status === 401) {
|
|
56
|
+
got401 = true;
|
|
57
|
+
}
|
|
58
|
+
return response;
|
|
50
59
|
};
|
|
51
60
|
// Create A2A client using the recommended fromCardUrl method
|
|
52
61
|
// Ensure the URL points to the agent card endpoint
|
|
@@ -58,65 +67,81 @@ async function callA2ATool(agentUrl, toolName, parameters, authToken, debugLogs
|
|
|
58
67
|
message: `A2A: Creating client for ${cardUrl}`,
|
|
59
68
|
timestamp: new Date().toISOString(),
|
|
60
69
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
try {
|
|
71
|
+
const a2aClient = await A2AClient.fromCardUrl(cardUrl, {
|
|
72
|
+
fetchImpl,
|
|
73
|
+
});
|
|
74
|
+
// Build request payload following A2A JSON-RPC spec
|
|
75
|
+
// Per A2A SDK: pushNotificationConfig goes in params.configuration (camelCase)
|
|
76
|
+
// Schema: https://adcontextprotocol.org/schemas/v1/core/push-notification-config.json
|
|
77
|
+
const requestPayload = {
|
|
78
|
+
message: {
|
|
79
|
+
messageId: `msg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
80
|
+
role: 'user',
|
|
81
|
+
kind: 'message', // Required by A2A spec
|
|
82
|
+
parts: [
|
|
83
|
+
{
|
|
84
|
+
kind: 'data', // A2A spec uses "kind", not "type"
|
|
85
|
+
data: {
|
|
86
|
+
skill: toolName,
|
|
87
|
+
parameters: parameters,
|
|
88
|
+
},
|
|
78
89
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
// Add pushNotificationConfig in configuration object (A2A JSON-RPC spec)
|
|
84
|
-
if (pushNotificationConfig) {
|
|
85
|
-
requestPayload.configuration = {
|
|
86
|
-
pushNotificationConfig: pushNotificationConfig,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
87
92
|
};
|
|
93
|
+
// Add pushNotificationConfig in configuration object (A2A JSON-RPC spec)
|
|
94
|
+
if (pushNotificationConfig) {
|
|
95
|
+
requestPayload.configuration = {
|
|
96
|
+
pushNotificationConfig: pushNotificationConfig,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// Add debug log for A2A call
|
|
100
|
+
const payloadSize = JSON.stringify(requestPayload).length;
|
|
101
|
+
debugLogs.push({
|
|
102
|
+
type: 'info',
|
|
103
|
+
message: `A2A: Calling skill ${toolName} with parameters: ${JSON.stringify(parameters)}. Payload size: ${payloadSize} bytes`,
|
|
104
|
+
timestamp: new Date().toISOString(),
|
|
105
|
+
payloadSize,
|
|
106
|
+
actualPayload: requestPayload,
|
|
107
|
+
});
|
|
108
|
+
// Send message using A2A protocol
|
|
109
|
+
debugLogs.push({
|
|
110
|
+
type: 'info',
|
|
111
|
+
message: `A2A: Sending message via sendMessage()`,
|
|
112
|
+
timestamp: new Date().toISOString(),
|
|
113
|
+
skill: toolName,
|
|
114
|
+
});
|
|
115
|
+
const messageResponse = await a2aClient.sendMessage(requestPayload);
|
|
116
|
+
// Add debug log for A2A response
|
|
117
|
+
debugLogs.push({
|
|
118
|
+
type: messageResponse?.error ? 'error' : 'success',
|
|
119
|
+
message: `A2A: Response received (${messageResponse?.error ? 'error' : 'success'})`,
|
|
120
|
+
timestamp: new Date().toISOString(),
|
|
121
|
+
response: messageResponse,
|
|
122
|
+
skill: toolName,
|
|
123
|
+
});
|
|
124
|
+
// Check for JSON-RPC error in response
|
|
125
|
+
if (messageResponse?.error || messageResponse?.result?.error) {
|
|
126
|
+
const errorObj = messageResponse.error || messageResponse.result?.error;
|
|
127
|
+
const errorMessage = errorObj.message || JSON.stringify(errorObj);
|
|
128
|
+
throw new Error(`A2A agent returned error: ${errorMessage}`);
|
|
129
|
+
}
|
|
130
|
+
return messageResponse;
|
|
88
131
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
timestamp: new Date().toISOString(),
|
|
103
|
-
skill: toolName,
|
|
104
|
-
});
|
|
105
|
-
const messageResponse = await a2aClient.sendMessage(requestPayload);
|
|
106
|
-
// Add debug log for A2A response
|
|
107
|
-
debugLogs.push({
|
|
108
|
-
type: messageResponse?.error ? 'error' : 'success',
|
|
109
|
-
message: `A2A: Response received (${messageResponse?.error ? 'error' : 'success'})`,
|
|
110
|
-
timestamp: new Date().toISOString(),
|
|
111
|
-
response: messageResponse,
|
|
112
|
-
skill: toolName,
|
|
113
|
-
});
|
|
114
|
-
// Check for JSON-RPC error in response
|
|
115
|
-
if (messageResponse?.error || messageResponse?.result?.error) {
|
|
116
|
-
const errorObj = messageResponse.error || messageResponse.result?.error;
|
|
117
|
-
const errorMessage = errorObj.message || JSON.stringify(errorObj);
|
|
118
|
-
throw new Error(`A2A agent returned error: ${errorMessage}`);
|
|
132
|
+
catch (error) {
|
|
133
|
+
// If we got a 401, throw AuthenticationRequiredError with OAuth metadata
|
|
134
|
+
if ((0, errors_1.is401Error)(error, got401)) {
|
|
135
|
+
debugLogs.push({
|
|
136
|
+
type: 'error',
|
|
137
|
+
message: `A2A: Authentication required for ${agentUrl}`,
|
|
138
|
+
timestamp: new Date().toISOString(),
|
|
139
|
+
});
|
|
140
|
+
const oauthMetadata = await (0, discovery_1.discoverOAuthMetadata)(agentUrl);
|
|
141
|
+
throw new errors_1.AuthenticationRequiredError(agentUrl, oauthMetadata || undefined);
|
|
142
|
+
}
|
|
143
|
+
// Re-throw other errors
|
|
144
|
+
throw error;
|
|
119
145
|
}
|
|
120
|
-
return messageResponse;
|
|
121
146
|
}
|
|
122
147
|
//# sourceMappingURL=a2a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a.js","sourceRoot":"","sources":["../../../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A,iCAAqB,EAAC,QAAQ,CAAC,CAAC;YAC5D,MAAM,IAAI,oCAA2B,CAAC,QAAQ,EAAE,aAAa,IAAI,SAAS,CAAC,CAAC;QAC9E,CAAC;QAED,wBAAwB;QACxB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -14,6 +14,14 @@ export type MetroAreaSystem = 'nielsen_dma' | 'uk_itl1' | 'uk_itl2' | 'eurostat_
|
|
|
14
14
|
* Postal code system (e.g., 'us_zip', 'gb_outward'). System name encodes country and precision.
|
|
15
15
|
*/
|
|
16
16
|
export type PostalCodeSystem = 'us_zip' | 'us_zip_plus_four' | 'gb_outward' | 'gb_full' | 'ca_fsa' | 'ca_full' | 'de_plz' | 'fr_code_postal' | 'au_postcode';
|
|
17
|
+
/**
|
|
18
|
+
* Methods for verifying user age for compliance. Does not include 'inferred' as it is not accepted for regulatory compliance.
|
|
19
|
+
*/
|
|
20
|
+
export type AgeVerificationMethod = 'facial_age_estimation' | 'id_document' | 'digital_id' | 'credit_card' | 'world_id';
|
|
21
|
+
/**
|
|
22
|
+
* Operating system platforms for device targeting. Browser values from Sec-CH-UA-Platform standard, extended for CTV.
|
|
23
|
+
*/
|
|
24
|
+
export type DevicePlatform = 'ios' | 'android' | 'windows' | 'macos' | 'linux' | 'chromeos' | 'tvos' | 'tizen' | 'webos' | 'fire_os' | 'roku_os' | 'unknown';
|
|
17
25
|
/**
|
|
18
26
|
* Represents a purchased advertising campaign
|
|
19
27
|
*/
|
|
@@ -151,7 +159,7 @@ export interface Package {
|
|
|
151
159
|
[k: string]: unknown | undefined;
|
|
152
160
|
}
|
|
153
161
|
/**
|
|
154
|
-
* Optional
|
|
162
|
+
* Optional restriction overlays for media buys. Most targeting should be expressed in the brief and handled by the publisher. These fields are for functional restrictions: geographic (RCT testing, regulatory compliance), age verification (alcohol, gambling), device platform (app compatibility), and language (localization).
|
|
155
163
|
*/
|
|
156
164
|
export interface TargetingOverlay {
|
|
157
165
|
/**
|
|
@@ -196,6 +204,35 @@ export interface TargetingOverlay {
|
|
|
196
204
|
axe_exclude_segment?: string;
|
|
197
205
|
frequency_cap?: FrequencyCap;
|
|
198
206
|
property_list?: PropertyListReference;
|
|
207
|
+
/**
|
|
208
|
+
* Age restriction for compliance. Use for legal requirements (alcohol, gambling), not audience targeting.
|
|
209
|
+
*/
|
|
210
|
+
age_restriction?: {
|
|
211
|
+
/**
|
|
212
|
+
* Minimum age required
|
|
213
|
+
*/
|
|
214
|
+
min: number;
|
|
215
|
+
/**
|
|
216
|
+
* Whether verified age (not inferred) is required for compliance
|
|
217
|
+
*/
|
|
218
|
+
verification_required?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Accepted verification methods. If omitted, any method the platform supports is acceptable.
|
|
221
|
+
*/
|
|
222
|
+
accepted_methods?: AgeVerificationMethod[];
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Restrict to specific platforms. Use for technical compatibility (app only works on iOS). Values from Sec-CH-UA-Platform standard, extended for CTV.
|
|
226
|
+
*
|
|
227
|
+
* @minItems 1
|
|
228
|
+
*/
|
|
229
|
+
device_platform?: [DevicePlatform, ...DevicePlatform[]];
|
|
230
|
+
/**
|
|
231
|
+
* Restrict to users with specific language preferences. ISO 639-1 codes (e.g., 'en', 'es', 'fr').
|
|
232
|
+
*
|
|
233
|
+
* @minItems 1
|
|
234
|
+
*/
|
|
235
|
+
language?: [string, ...string[]];
|
|
199
236
|
[k: string]: unknown | undefined;
|
|
200
237
|
}
|
|
201
238
|
/**
|
|
@@ -761,7 +798,7 @@ export interface BrandManifest {
|
|
|
761
798
|
*/
|
|
762
799
|
name: string;
|
|
763
800
|
/**
|
|
764
|
-
* Brand logo assets with
|
|
801
|
+
* Brand logo assets with structured fields for orientation, background compatibility, and variant type. Use the orientation, background, and variant enum fields for reliable filtering by creative agents.
|
|
765
802
|
*/
|
|
766
803
|
logos?: {
|
|
767
804
|
/**
|
|
@@ -769,9 +806,25 @@ export interface BrandManifest {
|
|
|
769
806
|
*/
|
|
770
807
|
url: string;
|
|
771
808
|
/**
|
|
772
|
-
*
|
|
809
|
+
* Logo aspect ratio orientation. square: ~1:1, horizontal: wide, vertical: tall, stacked: vertically arranged elements
|
|
810
|
+
*/
|
|
811
|
+
orientation?: 'square' | 'horizontal' | 'vertical' | 'stacked';
|
|
812
|
+
/**
|
|
813
|
+
* Background compatibility. dark-bg: use on dark backgrounds, light-bg: use on light backgrounds, transparent-bg: has transparent background
|
|
814
|
+
*/
|
|
815
|
+
background?: 'dark-bg' | 'light-bg' | 'transparent-bg';
|
|
816
|
+
/**
|
|
817
|
+
* Logo variant type. primary: main logo, secondary: alternative, icon: symbol only, wordmark: text only, full-lockup: complete logo
|
|
818
|
+
*/
|
|
819
|
+
variant?: 'primary' | 'secondary' | 'icon' | 'wordmark' | 'full-lockup';
|
|
820
|
+
/**
|
|
821
|
+
* Additional semantic tags for custom categorization beyond the standard orientation, background, and variant fields.
|
|
773
822
|
*/
|
|
774
823
|
tags?: string[];
|
|
824
|
+
/**
|
|
825
|
+
* Human-readable description of when to use this logo variant (e.g., 'Primary logo for use on light backgrounds', 'Icon-only variant for small formats')
|
|
826
|
+
*/
|
|
827
|
+
usage?: string;
|
|
775
828
|
/**
|
|
776
829
|
* Logo width in pixels
|
|
777
830
|
*/
|
|
@@ -824,9 +877,26 @@ export interface BrandManifest {
|
|
|
824
877
|
font_urls?: string[];
|
|
825
878
|
};
|
|
826
879
|
/**
|
|
827
|
-
* Brand voice and messaging tone
|
|
880
|
+
* Brand voice and messaging tone guidelines for creative agents.
|
|
828
881
|
*/
|
|
829
|
-
tone?:
|
|
882
|
+
tone?: {
|
|
883
|
+
/**
|
|
884
|
+
* High-level voice descriptor (e.g., 'warm and inviting', 'professional and trustworthy')
|
|
885
|
+
*/
|
|
886
|
+
voice?: string;
|
|
887
|
+
/**
|
|
888
|
+
* Personality traits that characterize the brand voice
|
|
889
|
+
*/
|
|
890
|
+
attributes?: string[];
|
|
891
|
+
/**
|
|
892
|
+
* Specific guidance for copy generation - what TO do
|
|
893
|
+
*/
|
|
894
|
+
dos?: string[];
|
|
895
|
+
/**
|
|
896
|
+
* Guardrails to avoid brand violations - what NOT to do
|
|
897
|
+
*/
|
|
898
|
+
donts?: string[];
|
|
899
|
+
};
|
|
830
900
|
/**
|
|
831
901
|
* Brand voice configuration for audio/conversational experiences
|
|
832
902
|
*/
|
|
@@ -1194,6 +1264,52 @@ export type CoBrandingRequirement = 'required' | 'optional' | 'none';
|
|
|
1194
1264
|
* Landing page requirements
|
|
1195
1265
|
*/
|
|
1196
1266
|
export type LandingPageRequirement = 'any' | 'retailer_site_only' | 'must_include_retailer';
|
|
1267
|
+
/**
|
|
1268
|
+
* Selects signals from a data provider's adagents.json catalog. Used for product definitions and agent authorization. Supports three selection patterns: all signals, specific IDs, or by tags.
|
|
1269
|
+
*/
|
|
1270
|
+
export type DataProviderSignalSelector = {
|
|
1271
|
+
/**
|
|
1272
|
+
* Domain where data provider's adagents.json is hosted (e.g., 'polk.com')
|
|
1273
|
+
*/
|
|
1274
|
+
data_provider_domain: string;
|
|
1275
|
+
/**
|
|
1276
|
+
* Discriminator indicating all signals from this data provider are included
|
|
1277
|
+
*/
|
|
1278
|
+
selection_type: 'all';
|
|
1279
|
+
[k: string]: unknown | undefined;
|
|
1280
|
+
} | {
|
|
1281
|
+
/**
|
|
1282
|
+
* Domain where data provider's adagents.json is hosted (e.g., 'polk.com')
|
|
1283
|
+
*/
|
|
1284
|
+
data_provider_domain: string;
|
|
1285
|
+
/**
|
|
1286
|
+
* Discriminator indicating selection by specific signal IDs
|
|
1287
|
+
*/
|
|
1288
|
+
selection_type: 'by_id';
|
|
1289
|
+
/**
|
|
1290
|
+
* Specific signal IDs from the data provider's catalog
|
|
1291
|
+
*
|
|
1292
|
+
* @minItems 1
|
|
1293
|
+
*/
|
|
1294
|
+
signal_ids: [string, ...string[]];
|
|
1295
|
+
[k: string]: unknown | undefined;
|
|
1296
|
+
} | {
|
|
1297
|
+
/**
|
|
1298
|
+
* Domain where data provider's adagents.json is hosted (e.g., 'polk.com')
|
|
1299
|
+
*/
|
|
1300
|
+
data_provider_domain: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* Discriminator indicating selection by signal tags
|
|
1303
|
+
*/
|
|
1304
|
+
selection_type: 'by_tag';
|
|
1305
|
+
/**
|
|
1306
|
+
* Signal tags from the data provider's catalog. Selector covers all signals with these tags
|
|
1307
|
+
*
|
|
1308
|
+
* @minItems 1
|
|
1309
|
+
*/
|
|
1310
|
+
signal_tags: [string, ...string[]];
|
|
1311
|
+
[k: string]: unknown | undefined;
|
|
1312
|
+
};
|
|
1197
1313
|
/**
|
|
1198
1314
|
* Represents available advertising inventory
|
|
1199
1315
|
*/
|
|
@@ -1255,6 +1371,14 @@ export interface Product {
|
|
|
1255
1371
|
* Whether buyers can filter this product to a subset of its publisher_properties. When false (default), the product is 'all or nothing' - buyers must accept all properties or the product is excluded from property_list filtering results.
|
|
1256
1372
|
*/
|
|
1257
1373
|
property_targeting_allowed?: boolean;
|
|
1374
|
+
/**
|
|
1375
|
+
* Data provider signals available for this product. Buyers fetch signal definitions from each data provider's adagents.json and can verify agent authorization.
|
|
1376
|
+
*/
|
|
1377
|
+
data_provider_signals?: DataProviderSignalSelector[];
|
|
1378
|
+
/**
|
|
1379
|
+
* Whether buyers can filter this product to a subset of its data_provider_signals. When false (default), the product includes all listed signals as a bundle. When true, buyers can target specific signals.
|
|
1380
|
+
*/
|
|
1381
|
+
signal_targeting_allowed?: boolean;
|
|
1258
1382
|
/**
|
|
1259
1383
|
* Explanation of why this product matches the brief (only included when brief is provided)
|
|
1260
1384
|
*/
|