@adcp/client 3.14.1 → 3.16.0
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-registry.js +736 -0
- package/bin/adcp.js +38 -2
- package/dist/lib/core/SingleAgentClient.d.ts +0 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +1 -2
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +49 -20
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/registry/index.d.ts +97 -31
- package/dist/lib/registry/index.d.ts.map +1 -1
- package/dist/lib/registry/index.js +228 -61
- package/dist/lib/registry/index.js.map +1 -1
- package/dist/lib/registry/types.d.ts +41 -57
- package/dist/lib/registry/types.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.d.ts +1860 -0
- package/dist/lib/registry/types.generated.d.ts.map +1 -0
- package/dist/lib/registry/types.generated.js +8 -0
- package/dist/lib/registry/types.generated.js.map +1 -0
- package/dist/lib/registry/types.js +6 -0
- package/dist/lib/registry/types.js.map +1 -1
- package/dist/lib/types/core.generated.d.ts +91 -64
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +2 -2
- package/dist/lib/types/core.generated.js.map +1 -1
- package/dist/lib/types/schemas.generated.d.ts +334 -42
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +65 -29
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +178 -67
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/version.d.ts +5 -5
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +5 -5
- package/dist/lib/version.js.map +1 -1
- package/package.json +4 -2
|
@@ -1,46 +1,112 @@
|
|
|
1
|
-
import type { ResolvedBrand,
|
|
2
|
-
export type { ResolvedBrand, PropertyInfo, RegistryClientConfig } from './types';
|
|
1
|
+
import type { ResolvedBrand, ResolvedProperty, RegistryClientConfig, SaveBrandRequest, SaveBrandResponse, SavePropertyRequest, SavePropertyResponse, BrandRegistryItem, PropertyRegistryItem, ValidationResult, FederatedAgentWithDetails, FederatedPublisher, DomainLookupResult, ListOptions, ListAgentsOptions, CreateAdagentsRequest, PublisherPropertySelector } from './types';
|
|
2
|
+
export type { ResolvedBrand, ResolvedProperty, PropertyInfo, RegistryClientConfig, SaveBrandRequest, SaveBrandResponse, SavePropertyRequest, SavePropertyResponse, BrandRegistryItem, PropertyRegistryItem, ValidationResult, FederatedAgentWithDetails, FederatedPublisher, DomainLookupResult, ListOptions, ListAgentsOptions, ValidateAdagentsRequest, CreateAdagentsRequest, ValidateProductAuthorizationRequest, ExpandProductIdentifiersRequest, PublisherPropertySelector, } from './types';
|
|
3
|
+
export type { paths, operations, components, LocalizedName, PropertyIdentifier, RegistryError, AgentHealth, AgentStats, AgentCapabilities, PropertySummary, } from './types';
|
|
3
4
|
/**
|
|
4
|
-
* Client for
|
|
5
|
+
* Client for the AdCP Registry API.
|
|
6
|
+
*
|
|
7
|
+
* Covers brand resolution, property resolution, agent discovery,
|
|
8
|
+
* authorization lookups, validation tools, and search.
|
|
5
9
|
*
|
|
6
10
|
* @example
|
|
7
11
|
* ```ts
|
|
8
|
-
* const registry = new RegistryClient();
|
|
12
|
+
* const registry = new RegistryClient({ apiKey: 'sk_...' });
|
|
9
13
|
* const brand = await registry.lookupBrand('nike.com');
|
|
10
|
-
* const
|
|
14
|
+
* const agents = await registry.listAgents({ type: 'sales' });
|
|
15
|
+
* const results = await registry.search('nike');
|
|
11
16
|
* ```
|
|
12
17
|
*/
|
|
13
18
|
export declare class RegistryClient {
|
|
14
19
|
private readonly baseUrl;
|
|
20
|
+
private readonly apiKey;
|
|
15
21
|
constructor(config?: RegistryClientConfig);
|
|
16
|
-
/**
|
|
17
|
-
* Resolve a single domain to its canonical brand identity.
|
|
18
|
-
*
|
|
19
|
-
* @param domain - Domain to resolve (e.g. "nike.com")
|
|
20
|
-
* @returns The resolved brand, or null if not found
|
|
21
|
-
*/
|
|
22
|
+
/** Resolve a single domain to its canonical brand identity. */
|
|
22
23
|
lookupBrand(domain: string): Promise<ResolvedBrand | null>;
|
|
23
|
-
/**
|
|
24
|
-
* Bulk resolve domains to their canonical brand identities.
|
|
25
|
-
*
|
|
26
|
-
* @param domains - Array of domains to resolve (max 100)
|
|
27
|
-
* @returns Map of domain to resolved brand (null if not found)
|
|
28
|
-
*/
|
|
24
|
+
/** Bulk resolve domains to their canonical brand identities (max 100). */
|
|
29
25
|
lookupBrands(domains: string[]): Promise<Record<string, ResolvedBrand | null>>;
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
/** List brands in the registry with optional search and pagination. */
|
|
27
|
+
listBrands(options?: ListOptions): Promise<{
|
|
28
|
+
brands: BrandRegistryItem[];
|
|
29
|
+
stats: Record<string, unknown>;
|
|
30
|
+
}>;
|
|
31
|
+
/** Fetch raw brand.json data for a domain. */
|
|
32
|
+
getBrandJson(domain: string): Promise<Record<string, unknown> | null>;
|
|
33
|
+
/** Enrich a brand with Brandfetch data. */
|
|
34
|
+
enrichBrand(domain: string): Promise<Record<string, unknown>>;
|
|
35
|
+
/** Save or update a community brand. Requires authentication. */
|
|
36
|
+
saveBrand(brand: SaveBrandRequest): Promise<SaveBrandResponse>;
|
|
37
|
+
/** Resolve a single domain to its property information. */
|
|
38
|
+
lookupProperty(domain: string): Promise<ResolvedProperty | null>;
|
|
39
|
+
/** Bulk resolve domains to their property information (max 100). */
|
|
40
|
+
lookupProperties(domains: string[]): Promise<Record<string, ResolvedProperty | null>>;
|
|
41
|
+
/** List properties in the registry with optional search and pagination. */
|
|
42
|
+
listProperties(options?: ListOptions): Promise<{
|
|
43
|
+
properties: PropertyRegistryItem[];
|
|
44
|
+
stats: Record<string, unknown>;
|
|
45
|
+
}>;
|
|
46
|
+
/** Validate a domain's adagents.json file. */
|
|
47
|
+
validateProperty(domain: string): Promise<ValidationResult>;
|
|
48
|
+
/** Save or update a hosted property. Requires authentication. */
|
|
49
|
+
saveProperty(property: SavePropertyRequest): Promise<SavePropertyResponse>;
|
|
50
|
+
/** List registered agents with optional filtering. */
|
|
51
|
+
listAgents(options?: ListAgentsOptions): Promise<{
|
|
52
|
+
agents: FederatedAgentWithDetails[];
|
|
53
|
+
count: number;
|
|
54
|
+
sources: Record<string, unknown>;
|
|
55
|
+
}>;
|
|
56
|
+
/** List publishers in the registry. */
|
|
57
|
+
listPublishers(): Promise<{
|
|
58
|
+
publishers: FederatedPublisher[];
|
|
59
|
+
count: number;
|
|
60
|
+
sources: Record<string, unknown>;
|
|
61
|
+
}>;
|
|
62
|
+
/** Get aggregate registry statistics. */
|
|
63
|
+
getRegistryStats(): Promise<Record<string, unknown>>;
|
|
64
|
+
/** Look up agents authorized for a domain. */
|
|
65
|
+
lookupDomain(domain: string): Promise<DomainLookupResult>;
|
|
66
|
+
/** Look up agents by property identifier (type + value). */
|
|
67
|
+
lookupPropertyByIdentifier(type: string, value: string): Promise<Record<string, unknown>>;
|
|
68
|
+
/** Get domains associated with an agent. */
|
|
69
|
+
getAgentDomains(agentUrl: string): Promise<{
|
|
70
|
+
agent_url: string;
|
|
71
|
+
domains: string[];
|
|
72
|
+
count: number;
|
|
73
|
+
}>;
|
|
74
|
+
/** Check if an agent is authorized for a specific property identifier. */
|
|
75
|
+
validatePropertyAuthorization(agentUrl: string, identifierType: string, identifierValue: string): Promise<{
|
|
76
|
+
agent_url: string;
|
|
77
|
+
identifier_type: string;
|
|
78
|
+
identifier_value: string;
|
|
79
|
+
authorized: boolean;
|
|
80
|
+
checked_at: string;
|
|
81
|
+
}>;
|
|
82
|
+
/** Validate product authorization for an agent across publisher properties. */
|
|
83
|
+
validateProductAuthorization(agentUrl: string, publisherProperties: PublisherPropertySelector[]): Promise<Record<string, unknown>>;
|
|
84
|
+
/** Expand product identifiers for an agent across publisher properties. */
|
|
85
|
+
expandProductIdentifiers(agentUrl: string, publisherProperties: PublisherPropertySelector[]): Promise<Record<string, unknown>>;
|
|
86
|
+
/** Validate a domain's adagents.json compliance. */
|
|
87
|
+
validateAdagents(domain: string): Promise<Record<string, unknown>>;
|
|
88
|
+
/** Generate a valid adagents.json from an agent configuration. */
|
|
89
|
+
createAdagents(config: CreateAdagentsRequest): Promise<Record<string, unknown>>;
|
|
90
|
+
/** Search brands, publishers, and properties. */
|
|
91
|
+
search(query: string): Promise<{
|
|
92
|
+
brands: unknown[];
|
|
93
|
+
publishers: unknown[];
|
|
94
|
+
properties: unknown[];
|
|
95
|
+
}>;
|
|
96
|
+
/** Look up a manifest reference by domain. */
|
|
97
|
+
lookupManifestRef(domain: string, type?: string): Promise<Record<string, unknown>>;
|
|
98
|
+
/** Probe a live agent endpoint to discover its capabilities. */
|
|
99
|
+
discoverAgent(url: string): Promise<Record<string, unknown>>;
|
|
100
|
+
/** Get creative formats supported by an agent. */
|
|
101
|
+
getAgentFormats(url: string): Promise<Record<string, unknown>>;
|
|
102
|
+
/** Get products available from an agent. */
|
|
103
|
+
getAgentProducts(url: string): Promise<Record<string, unknown>>;
|
|
104
|
+
/** Validate a publisher domain's configuration. */
|
|
105
|
+
validatePublisher(domain: string): Promise<Record<string, unknown>>;
|
|
106
|
+
private get;
|
|
107
|
+
private post;
|
|
108
|
+
private getHeaders;
|
|
44
109
|
private parseJson;
|
|
110
|
+
private buildParams;
|
|
45
111
|
}
|
|
46
112
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAEjB,qBAAqB,EAGrB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,mCAAmC,EACnC,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEhC,MAAM,CAAC,EAAE,oBAAoB;IAOzC,+DAA+D;IACzD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAMhE,0EAA0E;IACpE,YAAY,CAAC,OAA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AC;YAO3D,GAAG;YAUH,IAAI;IAalB,OAAO,CAAC,UAAU;YAQJ,SAAS;IASvB,OAAO,CAAC,WAAW;CASpB"}
|
|
@@ -4,107 +4,261 @@ exports.RegistryClient = void 0;
|
|
|
4
4
|
const DEFAULT_BASE_URL = 'https://adcontextprotocol.org';
|
|
5
5
|
const MAX_BULK_DOMAINS = 100;
|
|
6
6
|
/**
|
|
7
|
-
* Client for
|
|
7
|
+
* Client for the AdCP Registry API.
|
|
8
|
+
*
|
|
9
|
+
* Covers brand resolution, property resolution, agent discovery,
|
|
10
|
+
* authorization lookups, validation tools, and search.
|
|
8
11
|
*
|
|
9
12
|
* @example
|
|
10
13
|
* ```ts
|
|
11
|
-
* const registry = new RegistryClient();
|
|
14
|
+
* const registry = new RegistryClient({ apiKey: 'sk_...' });
|
|
12
15
|
* const brand = await registry.lookupBrand('nike.com');
|
|
13
|
-
* const
|
|
16
|
+
* const agents = await registry.listAgents({ type: 'sales' });
|
|
17
|
+
* const results = await registry.search('nike');
|
|
14
18
|
* ```
|
|
15
19
|
*/
|
|
16
20
|
class RegistryClient {
|
|
17
21
|
baseUrl;
|
|
22
|
+
apiKey;
|
|
18
23
|
constructor(config) {
|
|
19
24
|
this.baseUrl = (config?.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
25
|
+
this.apiKey = config?.apiKey ?? process.env.ADCP_REGISTRY_API_KEY;
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* @param domain - Domain to resolve (e.g. "nike.com")
|
|
25
|
-
* @returns The resolved brand, or null if not found
|
|
26
|
-
*/
|
|
27
|
+
// ====== Brand Resolution ======
|
|
28
|
+
/** Resolve a single domain to its canonical brand identity. */
|
|
27
29
|
async lookupBrand(domain) {
|
|
28
30
|
if (!domain?.trim())
|
|
29
31
|
throw new Error('domain is required');
|
|
30
32
|
const url = `${this.baseUrl}/api/brands/resolve?domain=${encodeURIComponent(domain)}`;
|
|
31
|
-
|
|
32
|
-
if (res.status === 404)
|
|
33
|
-
return null;
|
|
34
|
-
if (!res.ok) {
|
|
35
|
-
const body = await res.text();
|
|
36
|
-
throw new Error(`Registry brand lookup failed (${res.status}): ${body}`);
|
|
37
|
-
}
|
|
38
|
-
return this.parseJson(res);
|
|
33
|
+
return this.get(url, { nullOn404: true });
|
|
39
34
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Bulk resolve domains to their canonical brand identities.
|
|
42
|
-
*
|
|
43
|
-
* @param domains - Array of domains to resolve (max 100)
|
|
44
|
-
* @returns Map of domain to resolved brand (null if not found)
|
|
45
|
-
*/
|
|
35
|
+
/** Bulk resolve domains to their canonical brand identities (max 100). */
|
|
46
36
|
async lookupBrands(domains) {
|
|
47
37
|
if (domains.length === 0)
|
|
48
38
|
return {};
|
|
49
39
|
if (domains.length > MAX_BULK_DOMAINS) {
|
|
50
40
|
throw new Error(`Cannot resolve more than ${MAX_BULK_DOMAINS} domains at once (got ${domains.length})`);
|
|
51
41
|
}
|
|
52
|
-
const
|
|
53
|
-
const res = await fetch(url, {
|
|
54
|
-
method: 'POST',
|
|
55
|
-
headers: { 'Content-Type': 'application/json' },
|
|
56
|
-
body: JSON.stringify({ domains }),
|
|
57
|
-
});
|
|
58
|
-
if (!res.ok) {
|
|
59
|
-
const body = await res.text();
|
|
60
|
-
throw new Error(`Registry bulk brand lookup failed (${res.status}): ${body}`);
|
|
61
|
-
}
|
|
62
|
-
const data = await this.parseJson(res);
|
|
42
|
+
const data = await this.post(`${this.baseUrl}/api/brands/resolve/bulk`, { domains });
|
|
63
43
|
return data.results;
|
|
64
44
|
}
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
45
|
+
/** List brands in the registry with optional search and pagination. */
|
|
46
|
+
async listBrands(options) {
|
|
47
|
+
const params = this.buildParams(options);
|
|
48
|
+
return this.get(`${this.baseUrl}/api/brands/registry${params}`);
|
|
49
|
+
}
|
|
50
|
+
/** Fetch raw brand.json data for a domain. */
|
|
51
|
+
async getBrandJson(domain) {
|
|
52
|
+
if (!domain?.trim())
|
|
53
|
+
throw new Error('domain is required');
|
|
54
|
+
const url = `${this.baseUrl}/api/brands/brand-json?domain=${encodeURIComponent(domain)}`;
|
|
55
|
+
return this.get(url, { nullOn404: true });
|
|
56
|
+
}
|
|
57
|
+
/** Enrich a brand with Brandfetch data. */
|
|
58
|
+
async enrichBrand(domain) {
|
|
59
|
+
if (!domain?.trim())
|
|
60
|
+
throw new Error('domain is required');
|
|
61
|
+
return this.get(`${this.baseUrl}/api/brands/enrich?domain=${encodeURIComponent(domain)}`);
|
|
62
|
+
}
|
|
63
|
+
/** Save or update a community brand. Requires authentication. */
|
|
64
|
+
async saveBrand(brand) {
|
|
65
|
+
if (!brand?.domain?.trim())
|
|
66
|
+
throw new Error('domain is required');
|
|
67
|
+
if (!brand?.brand_name?.trim())
|
|
68
|
+
throw new Error('brand_name is required');
|
|
69
|
+
if (!this.apiKey)
|
|
70
|
+
throw new Error('apiKey is required for save operations');
|
|
71
|
+
return this.post(`${this.baseUrl}/api/brands/save`, brand);
|
|
72
|
+
}
|
|
73
|
+
// ====== Property Resolution ======
|
|
74
|
+
/** Resolve a single domain to its property information. */
|
|
71
75
|
async lookupProperty(domain) {
|
|
72
76
|
if (!domain?.trim())
|
|
73
77
|
throw new Error('domain is required');
|
|
74
78
|
const url = `${this.baseUrl}/api/properties/resolve?domain=${encodeURIComponent(domain)}`;
|
|
75
|
-
|
|
76
|
-
if (res.status === 404)
|
|
77
|
-
return null;
|
|
78
|
-
if (!res.ok) {
|
|
79
|
-
const body = await res.text();
|
|
80
|
-
throw new Error(`Registry property lookup failed (${res.status}): ${body}`);
|
|
81
|
-
}
|
|
82
|
-
return this.parseJson(res);
|
|
79
|
+
return this.get(url, { nullOn404: true });
|
|
83
80
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Bulk resolve domains to their property information.
|
|
86
|
-
*
|
|
87
|
-
* @param domains - Array of publisher domains to resolve (max 100)
|
|
88
|
-
* @returns Map of domain to property info (null if not found)
|
|
89
|
-
*/
|
|
81
|
+
/** Bulk resolve domains to their property information (max 100). */
|
|
90
82
|
async lookupProperties(domains) {
|
|
91
83
|
if (domains.length === 0)
|
|
92
84
|
return {};
|
|
93
85
|
if (domains.length > MAX_BULK_DOMAINS) {
|
|
94
86
|
throw new Error(`Cannot resolve more than ${MAX_BULK_DOMAINS} domains at once (got ${domains.length})`);
|
|
95
87
|
}
|
|
96
|
-
const
|
|
88
|
+
const data = await this.post(`${this.baseUrl}/api/properties/resolve/bulk`, { domains });
|
|
89
|
+
return data.results;
|
|
90
|
+
}
|
|
91
|
+
/** List properties in the registry with optional search and pagination. */
|
|
92
|
+
async listProperties(options) {
|
|
93
|
+
const params = this.buildParams(options);
|
|
94
|
+
return this.get(`${this.baseUrl}/api/properties/registry${params}`);
|
|
95
|
+
}
|
|
96
|
+
/** Validate a domain's adagents.json file. */
|
|
97
|
+
async validateProperty(domain) {
|
|
98
|
+
if (!domain?.trim())
|
|
99
|
+
throw new Error('domain is required');
|
|
100
|
+
return this.get(`${this.baseUrl}/api/properties/validate?domain=${encodeURIComponent(domain)}`);
|
|
101
|
+
}
|
|
102
|
+
/** Save or update a hosted property. Requires authentication. */
|
|
103
|
+
async saveProperty(property) {
|
|
104
|
+
if (!property?.publisher_domain?.trim())
|
|
105
|
+
throw new Error('publisher_domain is required');
|
|
106
|
+
if (!property?.authorized_agents?.length)
|
|
107
|
+
throw new Error('authorized_agents is required');
|
|
108
|
+
if (!this.apiKey)
|
|
109
|
+
throw new Error('apiKey is required for save operations');
|
|
110
|
+
return this.post(`${this.baseUrl}/api/properties/save`, property);
|
|
111
|
+
}
|
|
112
|
+
// ====== Agent Discovery ======
|
|
113
|
+
/** List registered agents with optional filtering. */
|
|
114
|
+
async listAgents(options) {
|
|
115
|
+
const params = new URLSearchParams();
|
|
116
|
+
if (options?.type)
|
|
117
|
+
params.set('type', options.type);
|
|
118
|
+
if (options?.health)
|
|
119
|
+
params.set('health', 'true');
|
|
120
|
+
if (options?.capabilities)
|
|
121
|
+
params.set('capabilities', 'true');
|
|
122
|
+
if (options?.properties)
|
|
123
|
+
params.set('properties', 'true');
|
|
124
|
+
const qs = params.toString();
|
|
125
|
+
return this.get(`${this.baseUrl}/api/registry/agents${qs ? '?' + qs : ''}`);
|
|
126
|
+
}
|
|
127
|
+
/** List publishers in the registry. */
|
|
128
|
+
async listPublishers() {
|
|
129
|
+
return this.get(`${this.baseUrl}/api/registry/publishers`);
|
|
130
|
+
}
|
|
131
|
+
/** Get aggregate registry statistics. */
|
|
132
|
+
async getRegistryStats() {
|
|
133
|
+
return this.get(`${this.baseUrl}/api/registry/stats`);
|
|
134
|
+
}
|
|
135
|
+
// ====== Authorization Lookups ======
|
|
136
|
+
/** Look up agents authorized for a domain. */
|
|
137
|
+
async lookupDomain(domain) {
|
|
138
|
+
if (!domain?.trim())
|
|
139
|
+
throw new Error('domain is required');
|
|
140
|
+
return this.get(`${this.baseUrl}/api/registry/lookup/domain/${encodeURIComponent(domain)}`);
|
|
141
|
+
}
|
|
142
|
+
/** Look up agents by property identifier (type + value). */
|
|
143
|
+
async lookupPropertyByIdentifier(type, value) {
|
|
144
|
+
if (!type?.trim())
|
|
145
|
+
throw new Error('type is required');
|
|
146
|
+
if (!value?.trim())
|
|
147
|
+
throw new Error('value is required');
|
|
148
|
+
const params = `?type=${encodeURIComponent(type)}&value=${encodeURIComponent(value)}`;
|
|
149
|
+
return this.get(`${this.baseUrl}/api/registry/lookup/property${params}`);
|
|
150
|
+
}
|
|
151
|
+
/** Get domains associated with an agent. */
|
|
152
|
+
async getAgentDomains(agentUrl) {
|
|
153
|
+
if (!agentUrl?.trim())
|
|
154
|
+
throw new Error('agentUrl is required');
|
|
155
|
+
return this.get(`${this.baseUrl}/api/registry/lookup/agent/${encodeURIComponent(agentUrl)}/domains`);
|
|
156
|
+
}
|
|
157
|
+
/** Check if an agent is authorized for a specific property identifier. */
|
|
158
|
+
async validatePropertyAuthorization(agentUrl, identifierType, identifierValue) {
|
|
159
|
+
if (!agentUrl?.trim())
|
|
160
|
+
throw new Error('agentUrl is required');
|
|
161
|
+
const params = new URLSearchParams({
|
|
162
|
+
agent_url: agentUrl,
|
|
163
|
+
identifier_type: identifierType,
|
|
164
|
+
identifier_value: identifierValue,
|
|
165
|
+
});
|
|
166
|
+
return this.get(`${this.baseUrl}/api/registry/validate/property-authorization?${params}`);
|
|
167
|
+
}
|
|
168
|
+
/** Validate product authorization for an agent across publisher properties. */
|
|
169
|
+
async validateProductAuthorization(agentUrl, publisherProperties) {
|
|
170
|
+
return this.post(`${this.baseUrl}/api/registry/validate/product-authorization`, {
|
|
171
|
+
agent_url: agentUrl,
|
|
172
|
+
publisher_properties: publisherProperties,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/** Expand product identifiers for an agent across publisher properties. */
|
|
176
|
+
async expandProductIdentifiers(agentUrl, publisherProperties) {
|
|
177
|
+
return this.post(`${this.baseUrl}/api/registry/expand/product-identifiers`, {
|
|
178
|
+
agent_url: agentUrl,
|
|
179
|
+
publisher_properties: publisherProperties,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// ====== Adagents Tooling ======
|
|
183
|
+
/** Validate a domain's adagents.json compliance. */
|
|
184
|
+
async validateAdagents(domain) {
|
|
185
|
+
if (!domain?.trim())
|
|
186
|
+
throw new Error('domain is required');
|
|
187
|
+
return this.post(`${this.baseUrl}/api/adagents/validate`, { domain });
|
|
188
|
+
}
|
|
189
|
+
/** Generate a valid adagents.json from an agent configuration. */
|
|
190
|
+
async createAdagents(config) {
|
|
191
|
+
return this.post(`${this.baseUrl}/api/adagents/create`, config);
|
|
192
|
+
}
|
|
193
|
+
// ====== Search & Discovery ======
|
|
194
|
+
/** Search brands, publishers, and properties. */
|
|
195
|
+
async search(query) {
|
|
196
|
+
if (!query?.trim())
|
|
197
|
+
throw new Error('query is required');
|
|
198
|
+
return this.get(`${this.baseUrl}/api/search?q=${encodeURIComponent(query)}`);
|
|
199
|
+
}
|
|
200
|
+
/** Look up a manifest reference by domain. */
|
|
201
|
+
async lookupManifestRef(domain, type) {
|
|
202
|
+
if (!domain?.trim())
|
|
203
|
+
throw new Error('domain is required');
|
|
204
|
+
const params = new URLSearchParams({ domain });
|
|
205
|
+
if (type)
|
|
206
|
+
params.set('type', type);
|
|
207
|
+
return this.get(`${this.baseUrl}/api/manifest-refs/lookup?${params}`);
|
|
208
|
+
}
|
|
209
|
+
/** Probe a live agent endpoint to discover its capabilities. */
|
|
210
|
+
async discoverAgent(url) {
|
|
211
|
+
if (!url?.trim())
|
|
212
|
+
throw new Error('url is required');
|
|
213
|
+
return this.get(`${this.baseUrl}/api/public/discover-agent?url=${encodeURIComponent(url)}`);
|
|
214
|
+
}
|
|
215
|
+
/** Get creative formats supported by an agent. */
|
|
216
|
+
async getAgentFormats(url) {
|
|
217
|
+
if (!url?.trim())
|
|
218
|
+
throw new Error('url is required');
|
|
219
|
+
return this.get(`${this.baseUrl}/api/public/agent-formats?url=${encodeURIComponent(url)}`);
|
|
220
|
+
}
|
|
221
|
+
/** Get products available from an agent. */
|
|
222
|
+
async getAgentProducts(url) {
|
|
223
|
+
if (!url?.trim())
|
|
224
|
+
throw new Error('url is required');
|
|
225
|
+
return this.get(`${this.baseUrl}/api/public/agent-products?url=${encodeURIComponent(url)}`);
|
|
226
|
+
}
|
|
227
|
+
/** Validate a publisher domain's configuration. */
|
|
228
|
+
async validatePublisher(domain) {
|
|
229
|
+
if (!domain?.trim())
|
|
230
|
+
throw new Error('domain is required');
|
|
231
|
+
return this.get(`${this.baseUrl}/api/public/validate-publisher?domain=${encodeURIComponent(domain)}`);
|
|
232
|
+
}
|
|
233
|
+
// ====== Private helpers ======
|
|
234
|
+
async get(url, opts) {
|
|
235
|
+
const res = await fetch(url, { headers: this.getHeaders() });
|
|
236
|
+
if (opts?.nullOn404 && res.status === 404)
|
|
237
|
+
return null;
|
|
238
|
+
if (!res.ok) {
|
|
239
|
+
const body = await res.text();
|
|
240
|
+
throw new Error(`Registry request failed (${res.status}): ${body}`);
|
|
241
|
+
}
|
|
242
|
+
return this.parseJson(res);
|
|
243
|
+
}
|
|
244
|
+
async post(url, body) {
|
|
97
245
|
const res = await fetch(url, {
|
|
98
246
|
method: 'POST',
|
|
99
|
-
headers: { 'Content-Type': 'application/json' },
|
|
100
|
-
body: JSON.stringify(
|
|
247
|
+
headers: { ...this.getHeaders(), 'Content-Type': 'application/json' },
|
|
248
|
+
body: JSON.stringify(body),
|
|
101
249
|
});
|
|
102
250
|
if (!res.ok) {
|
|
103
|
-
const
|
|
104
|
-
throw new Error(`Registry
|
|
251
|
+
const text = await res.text();
|
|
252
|
+
throw new Error(`Registry request failed (${res.status}): ${text}`);
|
|
105
253
|
}
|
|
106
|
-
|
|
107
|
-
|
|
254
|
+
return this.parseJson(res);
|
|
255
|
+
}
|
|
256
|
+
getHeaders() {
|
|
257
|
+
const headers = {};
|
|
258
|
+
if (this.apiKey) {
|
|
259
|
+
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
260
|
+
}
|
|
261
|
+
return headers;
|
|
108
262
|
}
|
|
109
263
|
async parseJson(res) {
|
|
110
264
|
const text = await res.text();
|
|
@@ -115,6 +269,19 @@ class RegistryClient {
|
|
|
115
269
|
throw new Error(`Registry returned invalid JSON: ${text.slice(0, 200)}`);
|
|
116
270
|
}
|
|
117
271
|
}
|
|
272
|
+
buildParams(options) {
|
|
273
|
+
if (!options)
|
|
274
|
+
return '';
|
|
275
|
+
const params = new URLSearchParams();
|
|
276
|
+
if (options.search)
|
|
277
|
+
params.set('search', options.search);
|
|
278
|
+
if (options.limit != null)
|
|
279
|
+
params.set('limit', String(options.limit));
|
|
280
|
+
if (options.offset != null)
|
|
281
|
+
params.set('offset', String(options.offset));
|
|
282
|
+
const qs = params.toString();
|
|
283
|
+
return qs ? '?' + qs : '';
|
|
284
|
+
}
|
|
118
285
|
}
|
|
119
286
|
exports.RegistryClient = RegistryClient;
|
|
120
287
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/registry/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/registry/index.ts"],"names":[],"mappings":";;;AA8DA,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AACzD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AACH,MAAa,cAAc;IACR,OAAO,CAAS;IAChB,MAAM,CAAqB;IAE5C,YAAY,MAA6B;QACvC,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IACpE,CAAC;IAED,iCAAiC;IAEjC,+DAA+D;IAC/D,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,8BAA8B,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,YAAY,CAAC,OAAiB;QAClC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,MAAM,GAAG,gBAAgB,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,4BAA4B,gBAAgB,yB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1B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAEO,WAAW,CAAC,OAAqB;QACvC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACzE,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,CAAC;CACF;AAtSD,wCAsSC"}
|
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
canonical_id: string;
|
|
7
|
-
/** Canonical domain for this brand */
|
|
8
|
-
canonical_domain: string;
|
|
9
|
-
/** Human-readable brand name */
|
|
10
|
-
brand_name: string;
|
|
11
|
-
/** Localized name variants keyed by language code */
|
|
12
|
-
names?: Array<Record<string, string>>;
|
|
13
|
-
/** Brand architecture classification (Keller's theory) */
|
|
14
|
-
keller_type?: 'master' | 'sub_brand' | 'endorsed' | 'independent';
|
|
15
|
-
/** Parent brand canonical ID, if this is a sub-brand */
|
|
16
|
-
parent_brand?: string;
|
|
17
|
-
/** Corporate house domain that owns this brand */
|
|
18
|
-
house_domain?: string;
|
|
19
|
-
/** Corporate house name */
|
|
20
|
-
house_name?: string;
|
|
21
|
-
/** URL to the brand's AdCP agent */
|
|
22
|
-
brand_agent_url?: string;
|
|
23
|
-
/** Brand manifest data (logos, colors, etc.) */
|
|
24
|
-
brand_manifest?: Record<string, unknown>;
|
|
25
|
-
/** How this brand record was sourced */
|
|
26
|
-
source: 'brand_json' | 'community' | 'enriched';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A property (publisher) resolved from the AdCP registry via domain lookup.
|
|
30
|
-
*/
|
|
31
|
-
export interface PropertyInfo {
|
|
32
|
-
/** Publisher domain that owns this property */
|
|
33
|
-
publisher_domain: string;
|
|
34
|
-
/** How this property record was sourced */
|
|
35
|
-
source: 'hosted' | 'adagents_json';
|
|
36
|
-
/** Agents authorized to sell inventory on this property */
|
|
37
|
-
authorized_agents: Array<{
|
|
38
|
-
url: string;
|
|
39
|
-
}>;
|
|
40
|
-
/** Properties associated with this domain */
|
|
41
|
-
properties: Array<{
|
|
42
|
-
id: string;
|
|
43
|
-
type: string;
|
|
44
|
-
name: string;
|
|
45
|
-
identifiers: Array<{
|
|
46
|
-
type: string;
|
|
47
|
-
value: string;
|
|
48
|
-
include_subdomains?: boolean;
|
|
49
|
-
}>;
|
|
50
|
-
tags?: string[];
|
|
51
|
-
}>;
|
|
52
|
-
/** Publisher contact information */
|
|
53
|
-
contact?: Record<string, unknown>;
|
|
54
|
-
/** Whether domain ownership has been verified */
|
|
55
|
-
verified: boolean;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Configuration for the registry client.
|
|
2
|
+
* AdCP Registry Types
|
|
3
|
+
*
|
|
4
|
+
* Generated types are in types.generated.ts (from OpenAPI spec).
|
|
5
|
+
* This file re-exports them with ergonomic names and adds client-specific types.
|
|
59
6
|
*/
|
|
7
|
+
export type { ResolvedBrand, LocalizedName, BrandRegistryItem, ResolvedProperty, PropertyIdentifier, PropertyRegistryItem, ValidationResult, RegistryError, PublisherPropertySelector, FederatedAgentWithDetails, AgentHealth, AgentStats, AgentCapabilities, PropertySummary, FederatedPublisher, DomainLookupResult, } from './types.generated';
|
|
8
|
+
export type { paths, operations, components } from './types.generated';
|
|
9
|
+
import type { operations } from './types.generated';
|
|
10
|
+
/** Request body for POST /api/brands/save */
|
|
11
|
+
export type SaveBrandRequest = NonNullable<operations['saveBrand']['requestBody']>['content']['application/json'];
|
|
12
|
+
/** Response from POST /api/brands/save (200) */
|
|
13
|
+
export type SaveBrandResponse = operations['saveBrand']['responses']['200']['content']['application/json'];
|
|
14
|
+
/** Request body for POST /api/properties/save */
|
|
15
|
+
export type SavePropertyRequest = NonNullable<operations['saveProperty']['requestBody']>['content']['application/json'];
|
|
16
|
+
/** Response from POST /api/properties/save (200) */
|
|
17
|
+
export type SavePropertyResponse = operations['saveProperty']['responses']['200']['content']['application/json'];
|
|
18
|
+
/** Request body for POST /api/adagents/validate */
|
|
19
|
+
export type ValidateAdagentsRequest = NonNullable<operations['validateAdagents']['requestBody']>['content']['application/json'];
|
|
20
|
+
/** Request body for POST /api/adagents/create */
|
|
21
|
+
export type CreateAdagentsRequest = NonNullable<operations['createAdagents']['requestBody']>['content']['application/json'];
|
|
22
|
+
/** Request body for POST /api/registry/validate/product-authorization */
|
|
23
|
+
export type ValidateProductAuthorizationRequest = NonNullable<operations['validateProductAuthorization']['requestBody']>['content']['application/json'];
|
|
24
|
+
/** Request body for POST /api/registry/expand/product-identifiers */
|
|
25
|
+
export type ExpandProductIdentifiersRequest = NonNullable<operations['expandProductIdentifiers']['requestBody']>['content']['application/json'];
|
|
26
|
+
/** @deprecated Use ResolvedProperty instead */
|
|
27
|
+
export type PropertyInfo = import('./types.generated').ResolvedProperty;
|
|
28
|
+
/** Configuration for the registry client. */
|
|
60
29
|
export interface RegistryClientConfig {
|
|
61
30
|
/** Base URL of the AdCP registry. Defaults to https://adcontextprotocol.org */
|
|
62
31
|
baseUrl?: string;
|
|
32
|
+
/** API key for authenticated registry access. Falls back to ADCP_REGISTRY_API_KEY env var. */
|
|
33
|
+
apiKey?: string;
|
|
34
|
+
}
|
|
35
|
+
/** Options for list/search endpoints with pagination. */
|
|
36
|
+
export interface ListOptions {
|
|
37
|
+
search?: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
offset?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Options for listing agents with filtering. */
|
|
42
|
+
export interface ListAgentsOptions {
|
|
43
|
+
type?: 'creative' | 'signals' | 'sales' | 'governance' | 'si';
|
|
44
|
+
health?: boolean;
|
|
45
|
+
capabilities?: boolean;
|
|
46
|
+
properties?: boolean;
|
|
63
47
|
}
|
|
64
48
|
//# sourceMappingURL=types.d.ts.map
|