@adcp/client 4.0.2 → 4.2.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/.claude-plugin/plugin.json +12 -0
- package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
- package/dist/lib/adapters/content-standards-adapter.js +2 -0
- package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +0 -7
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +3 -45
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +6 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +12 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/types/adcp.d.ts +2 -5
- package/dist/lib/types/adcp.d.ts.map +1 -1
- package/dist/lib/types/compat.d.ts +3 -0
- package/dist/lib/types/compat.d.ts.map +1 -1
- package/dist/lib/types/compat.js.map +1 -1
- package/dist/lib/types/core.generated.d.ts +616 -233
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/error-codes.d.ts +32 -0
- package/dist/lib/types/error-codes.d.ts.map +1 -0
- package/dist/lib/types/error-codes.js +114 -0
- package/dist/lib/types/error-codes.js.map +1 -0
- package/dist/lib/types/index.d.ts +1 -1
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/schemas.generated.d.ts +26019 -11997
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +467 -420
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +1005 -1003
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/utils/creative-adapter.d.ts +1 -1
- package/dist/lib/utils/creative-adapter.js +2 -2
- package/dist/lib/utils/creative-adapter.js.map +1 -1
- package/dist/lib/utils/deprecation.d.ts +11 -0
- package/dist/lib/utils/deprecation.d.ts.map +1 -0
- package/dist/lib/utils/deprecation.js +23 -0
- package/dist/lib/utils/deprecation.js.map +1 -0
- package/dist/lib/utils/request-normalizer.d.ts +23 -0
- package/dist/lib/utils/request-normalizer.d.ts.map +1 -0
- package/dist/lib/utils/request-normalizer.js +119 -0
- package/dist/lib/utils/request-normalizer.js.map +1 -0
- package/package.json +3 -1
- package/skills/adcp/SKILL.md +230 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Deprecation warning utility for backward-compat shims.
|
|
4
|
+
*
|
|
5
|
+
* Each key is warned once per process lifetime to avoid log spam.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.warnOnce = warnOnce;
|
|
9
|
+
exports.resetWarnings = resetWarnings;
|
|
10
|
+
const warned = new Set();
|
|
11
|
+
function warnOnce(key, message) {
|
|
12
|
+
if (!warned.has(key)) {
|
|
13
|
+
warned.add(key);
|
|
14
|
+
console.warn(`[@adcp/client] DEPRECATED: ${message}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reset all deprecation warnings. Only useful in tests.
|
|
19
|
+
*/
|
|
20
|
+
function resetWarnings() {
|
|
21
|
+
warned.clear();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=deprecation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.js","sourceRoot":"","sources":["../../../src/lib/utils/deprecation.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAIH,4BAKC;AAKD,sCAEC;AAdD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAgB,QAAQ,CAAC,GAAW,EAAE,OAAe;IACnD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa;IAC3B,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request parameter normalization for backward compatibility.
|
|
3
|
+
*
|
|
4
|
+
* Converts deprecated field names and shapes so callers written against
|
|
5
|
+
* earlier schema versions keep working. Each conversion emits a one-time
|
|
6
|
+
* deprecation warning via warnOnce().
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Normalize a single package's params for backward compatibility.
|
|
10
|
+
*
|
|
11
|
+
* Handles:
|
|
12
|
+
* - optimization_goal (scalar) → optimization_goals (array)
|
|
13
|
+
* - catalog (scalar object) → catalogs (array)
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizePackageParams(pkg: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* Normalize request params for backward compatibility.
|
|
18
|
+
*
|
|
19
|
+
* Infers missing fields that can be derived from deprecated params so callers
|
|
20
|
+
* written against older schema versions keep working.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeRequestParams(taskType: string, params: any): any;
|
|
23
|
+
//# sourceMappingURL=request-normalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-normalizer.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/request-normalizer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAuBpD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAqFzE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Request parameter normalization for backward compatibility.
|
|
4
|
+
*
|
|
5
|
+
* Converts deprecated field names and shapes so callers written against
|
|
6
|
+
* earlier schema versions keep working. Each conversion emits a one-time
|
|
7
|
+
* deprecation warning via warnOnce().
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.normalizePackageParams = normalizePackageParams;
|
|
11
|
+
exports.normalizeRequestParams = normalizeRequestParams;
|
|
12
|
+
const compat_1 = require("../types/compat");
|
|
13
|
+
const deprecation_1 = require("./deprecation");
|
|
14
|
+
/**
|
|
15
|
+
* Normalize a single package's params for backward compatibility.
|
|
16
|
+
*
|
|
17
|
+
* Handles:
|
|
18
|
+
* - optimization_goal (scalar) → optimization_goals (array)
|
|
19
|
+
* - catalog (scalar object) → catalogs (array)
|
|
20
|
+
*/
|
|
21
|
+
function normalizePackageParams(pkg) {
|
|
22
|
+
if (!pkg || typeof pkg !== 'object')
|
|
23
|
+
return pkg;
|
|
24
|
+
const normalized = { ...pkg };
|
|
25
|
+
// optimization_goal (scalar) → optimization_goals (array)
|
|
26
|
+
if (normalized.optimization_goal && !normalized.optimization_goals?.length) {
|
|
27
|
+
(0, deprecation_1.warnOnce)('optimization_goal', 'PackageRequest.optimization_goal is deprecated. Use optimization_goals (array) instead.');
|
|
28
|
+
normalized.optimization_goals = [normalized.optimization_goal];
|
|
29
|
+
}
|
|
30
|
+
delete normalized.optimization_goal;
|
|
31
|
+
// catalog (scalar) → catalogs (array)
|
|
32
|
+
if (normalized.catalog && !normalized.catalogs?.length) {
|
|
33
|
+
(0, deprecation_1.warnOnce)('catalog', 'PackageRequest.catalog is deprecated. Use catalogs (array) instead.');
|
|
34
|
+
normalized.catalogs = [normalized.catalog];
|
|
35
|
+
}
|
|
36
|
+
delete normalized.catalog;
|
|
37
|
+
return normalized;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalize request params for backward compatibility.
|
|
41
|
+
*
|
|
42
|
+
* Infers missing fields that can be derived from deprecated params so callers
|
|
43
|
+
* written against older schema versions keep working.
|
|
44
|
+
*/
|
|
45
|
+
function normalizeRequestParams(taskType, params) {
|
|
46
|
+
if (!params) {
|
|
47
|
+
return params;
|
|
48
|
+
}
|
|
49
|
+
let normalized = { ...params };
|
|
50
|
+
// ── Universal shims (all tools) ──
|
|
51
|
+
// Always delete deprecated fields, even when the new field already exists,
|
|
52
|
+
// to prevent Zod strict validation failures on unknown keys.
|
|
53
|
+
// account_id (bare string) → account: { account_id }
|
|
54
|
+
if (typeof normalized.account_id === 'string' && !normalized.account) {
|
|
55
|
+
(0, deprecation_1.warnOnce)('account_id', 'account_id is deprecated. Use account: { account_id } instead.');
|
|
56
|
+
normalized.account = { account_id: normalized.account_id };
|
|
57
|
+
}
|
|
58
|
+
delete normalized.account_id;
|
|
59
|
+
// campaign_ref → buyer_campaign_ref
|
|
60
|
+
if (normalized.campaign_ref && !normalized.buyer_campaign_ref) {
|
|
61
|
+
(0, deprecation_1.warnOnce)('campaign_ref', 'campaign_ref is deprecated. Use buyer_campaign_ref instead.');
|
|
62
|
+
normalized.buyer_campaign_ref = normalized.campaign_ref;
|
|
63
|
+
}
|
|
64
|
+
delete normalized.campaign_ref;
|
|
65
|
+
// ── brand_manifest → brand (get_products, create_media_buy) ──
|
|
66
|
+
// update_media_buy has no brand field in either v2 or v3 — excluded deliberately.
|
|
67
|
+
// brand takes precedence if both are supplied.
|
|
68
|
+
if (taskType === 'get_products' || taskType === 'create_media_buy') {
|
|
69
|
+
if (normalized.brand_manifest && !normalized.brand) {
|
|
70
|
+
const brand = (0, compat_1.brandManifestToBrandReference)(normalized.brand_manifest);
|
|
71
|
+
if (brand) {
|
|
72
|
+
normalized.brand = brand;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
delete normalized.brand_manifest;
|
|
76
|
+
}
|
|
77
|
+
// ── Package normalization (create_media_buy, update_media_buy) ──
|
|
78
|
+
if ((taskType === 'create_media_buy' || taskType === 'update_media_buy') && Array.isArray(normalized.packages)) {
|
|
79
|
+
normalized.packages = normalized.packages.map(normalizePackageParams);
|
|
80
|
+
}
|
|
81
|
+
// ── activate_signal: deployments → destinations ──
|
|
82
|
+
if (taskType === 'activate_signal') {
|
|
83
|
+
if (normalized.deployments && !normalized.destinations) {
|
|
84
|
+
(0, deprecation_1.warnOnce)('deployments', 'deployments is deprecated. Use destinations instead.');
|
|
85
|
+
normalized.destinations = normalized.deployments;
|
|
86
|
+
}
|
|
87
|
+
delete normalized.deployments;
|
|
88
|
+
}
|
|
89
|
+
// ── get_signals: deliver_to → destinations ──
|
|
90
|
+
if (taskType === 'get_signals') {
|
|
91
|
+
if (normalized.deliver_to && !normalized.destinations) {
|
|
92
|
+
(0, deprecation_1.warnOnce)('deliver_to', 'deliver_to is deprecated. Use destinations and countries instead.');
|
|
93
|
+
normalized.destinations = normalized.deliver_to;
|
|
94
|
+
}
|
|
95
|
+
delete normalized.deliver_to;
|
|
96
|
+
}
|
|
97
|
+
// ── get_products-specific normalization ──
|
|
98
|
+
if (taskType === 'get_products') {
|
|
99
|
+
// Infer buying_mode from brief presence if not supplied
|
|
100
|
+
if (!normalized.buying_mode) {
|
|
101
|
+
normalized.buying_mode = normalized.brief ? 'brief' : 'wholesale';
|
|
102
|
+
}
|
|
103
|
+
// Strip removed v2 fields that would fail strict validation
|
|
104
|
+
for (const removed of ['feedback', 'product_ids', 'proposal_id']) {
|
|
105
|
+
if (removed in normalized) {
|
|
106
|
+
(0, deprecation_1.warnOnce)(`get_products.${removed}`, `GetProductsRequest.${removed} has been removed in v3.`);
|
|
107
|
+
delete normalized[removed];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Convert legacy product_selectors (v3 beta / v2 era) → catalog so strict validation passes.
|
|
111
|
+
// catalog takes precedence if both are supplied.
|
|
112
|
+
if (normalized.product_selectors && !normalized.catalog) {
|
|
113
|
+
normalized.catalog = (0, compat_1.promotedProductsToCatalog)(normalized.product_selectors);
|
|
114
|
+
}
|
|
115
|
+
delete normalized.product_selectors;
|
|
116
|
+
}
|
|
117
|
+
return normalized;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=request-normalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-normalizer.js","sourceRoot":"","sources":["../../../src/lib/utils/request-normalizer.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAYH,wDAuBC;AAQD,wDAqFC;AA9HD,4CAA2F;AAC3F,+CAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAC,GAAQ;IAC7C,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IAEhD,MAAM,UAAU,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAE9B,0DAA0D;IAC1D,IAAI,UAAU,CAAC,iBAAiB,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC3E,IAAA,sBAAQ,EACN,mBAAmB,EACnB,yFAAyF,CAC1F,CAAC;QACF,UAAU,CAAC,kBAAkB,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,UAAU,CAAC,iBAAiB,CAAC;IAEpC,sCAAsC;IACtC,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACvD,IAAA,sBAAQ,EAAC,SAAS,EAAE,qEAAqE,CAAC,CAAC;QAC3F,UAAU,CAAC,QAAQ,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,UAAU,CAAC,OAAO,CAAC;IAE1B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,Q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CAAC,CAAC;gBAC7F,OAAQ,UAAkB,CAAC,OAAO,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QAED,6FAA6F;QAC7F,iDAAiD;QACjD,IAAI,UAAU,CAAC,iBAAiB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACxD,UAAU,CAAC,OAAO,GAAG,IAAA,kCAAyB,EAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,UAAU,CAAC,iBAAiB,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adcp/client",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "AdCP client library with protocol support for MCP and A2A, includes testing framework",
|
|
5
5
|
"main": "dist/lib/index.js",
|
|
6
6
|
"types": "dist/lib/index.d.ts",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"files": [
|
|
37
37
|
"dist/lib/**/*",
|
|
38
38
|
"bin/**/*.js",
|
|
39
|
+
"skills/**/*",
|
|
40
|
+
".claude-plugin/**/*",
|
|
39
41
|
"README.md",
|
|
40
42
|
"LICENSE"
|
|
41
43
|
],
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adcp
|
|
3
|
+
description: Interact with AdCP (Ad Context Protocol) advertising agents over MCP or A2A protocols. Use when the user wants to call AdCP tools (get_products, create_media_buy, sync_creatives, etc.), discover an agent's capabilities, run protocol compliance tests, look up brands or properties in the AdCP registry, manage saved agent aliases, or debug agent responses. NOT for general HTTP/REST API calls. Requires @adcp/client (npm).
|
|
4
|
+
argument-hint: "<agent> [tool] [payload] | test <agent> [scenario] | registry <command>"
|
|
5
|
+
allowed-tools: Bash, Read
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AdCP CLI
|
|
9
|
+
|
|
10
|
+
Use `adcp` (or `npx @adcp/client`) to interact with AdCP advertising agents, run compliance tests, and query the AdCP registry.
|
|
11
|
+
|
|
12
|
+
## Quick start — zero config
|
|
13
|
+
|
|
14
|
+
Built-in test agents work immediately with no setup:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Try AdCP right now
|
|
18
|
+
adcp test-mcp # List tools on the MCP test agent
|
|
19
|
+
adcp test-mcp get_products '{"brief":"coffee brands"}' # Call a tool
|
|
20
|
+
adcp test-a2a get_products '{"brief":"coffee brands"}' # Same thing over A2A
|
|
21
|
+
|
|
22
|
+
# Run compliance tests
|
|
23
|
+
adcp test test-mcp discovery # Test tool discovery
|
|
24
|
+
adcp test test-mcp full_sales_flow # Full media buy lifecycle
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Built-in aliases (no setup needed):
|
|
28
|
+
- `test-mcp` — Public test agent via MCP (pre-authenticated)
|
|
29
|
+
- `test-a2a` — Public test agent via A2A (pre-authenticated)
|
|
30
|
+
- `test-no-auth` — MCP without auth (demonstrates auth errors)
|
|
31
|
+
- `test-a2a-no-auth` — A2A without auth
|
|
32
|
+
- `creative` — Official creative agent (MCP, requires `--auth` or `ADCP_AUTH_TOKEN`)
|
|
33
|
+
|
|
34
|
+
## Calling agent tools
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
adcp <alias|url> [tool-name] [payload] [options]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Discover tools (omit tool name)
|
|
41
|
+
```bash
|
|
42
|
+
adcp https://agent.example.com
|
|
43
|
+
adcp my-alias
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Call a tool
|
|
47
|
+
```bash
|
|
48
|
+
adcp https://agent.example.com get_products '{"brief":"coffee brands"}'
|
|
49
|
+
adcp https://agent.example.com create_media_buy @payload.json
|
|
50
|
+
echo '{"brief":"travel"}' | adcp https://agent.example.com get_products -
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Authentication (priority order)
|
|
54
|
+
```bash
|
|
55
|
+
adcp my-alias get_products '{}' # 1. Saved config
|
|
56
|
+
adcp https://agent.example.com get_products '{}' --auth $TOKEN # 2. Flag
|
|
57
|
+
export ADCP_AUTH_TOKEN=your-token && adcp https://agent.example.com get_products '{}' # 3. Env
|
|
58
|
+
adcp https://agent.example.com/mcp --oauth # 4. OAuth (MCP only)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Output modes
|
|
62
|
+
```bash
|
|
63
|
+
adcp test-mcp get_products '{"brief":"test"}' # Pretty print (default)
|
|
64
|
+
adcp test-mcp get_products '{"brief":"test"}' --json # Raw JSON for scripting
|
|
65
|
+
adcp test-mcp get_products '{"brief":"test"}' --debug # Connection diagnostics
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Force protocol (default is auto-detect)
|
|
69
|
+
```bash
|
|
70
|
+
adcp https://agent.example.com get_products '{}' --protocol mcp
|
|
71
|
+
adcp https://agent.example.com get_products '{}' --protocol a2a
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Test runner
|
|
75
|
+
|
|
76
|
+
Run protocol compliance tests against any AdCP agent. 19 built-in scenarios.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
adcp test <agent> [scenario] [options]
|
|
80
|
+
adcp test --list-scenarios
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Scenarios (run `adcp test --list-scenarios` for all 19 with descriptions)
|
|
84
|
+
| Scenario | What it tests |
|
|
85
|
+
|----------|---------------|
|
|
86
|
+
| `health_check` | Basic connectivity |
|
|
87
|
+
| `discovery` | get_products, list_creative_formats, list_authorized_properties |
|
|
88
|
+
| `create_media_buy` | Discovery + create a media buy (dry-run by default) |
|
|
89
|
+
| `full_sales_flow` | Full lifecycle: discovery, create, update, delivery |
|
|
90
|
+
| `creative_flow` | Creative agent: list_formats, build, preview |
|
|
91
|
+
| `signals_flow` | Signals: get_signals, activate |
|
|
92
|
+
| `validation` | Schema validation (invalid inputs should be rejected) |
|
|
93
|
+
| `error_handling` | Verify proper error responses |
|
|
94
|
+
| `pricing_edge_cases` | Auction vs fixed pricing, min spend, bid_price |
|
|
95
|
+
| `behavior_analysis` | Auth, brief relevance, filtering behavior |
|
|
96
|
+
| `capability_discovery` | v3: get_adcp_capabilities |
|
|
97
|
+
| `governance_property_lists` | v3: property list CRUD |
|
|
98
|
+
| `governance_content_standards` | v3: content standards listing and calibration |
|
|
99
|
+
| `si_session_lifecycle` | v3: structured interaction sessions |
|
|
100
|
+
|
|
101
|
+
### Examples
|
|
102
|
+
```bash
|
|
103
|
+
adcp test test-mcp discovery # Quick check
|
|
104
|
+
adcp test test-mcp full_sales_flow --json # CI-friendly JSON output
|
|
105
|
+
adcp test https://my-agent.com validation --protocol mcp
|
|
106
|
+
adcp test my-alias create_media_buy --no-dry-run # Real operations (careful!)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Test options
|
|
110
|
+
- `--json` — Machine-readable output for CI
|
|
111
|
+
- `--debug` — Verbose logging
|
|
112
|
+
- `--protocol mcp|a2a` — Force protocol
|
|
113
|
+
- `--no-dry-run` — Execute real operations (default is dry-run)
|
|
114
|
+
- `--brief "text"` — Custom brief for product discovery tests
|
|
115
|
+
|
|
116
|
+
## Registry
|
|
117
|
+
|
|
118
|
+
Look up brands, properties, agents, and publishers in the AdCP registry.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
adcp registry <command> [args] [options]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Lookups
|
|
125
|
+
```bash
|
|
126
|
+
adcp registry brand nike.com
|
|
127
|
+
adcp registry brands nike.com adidas.com --json
|
|
128
|
+
adcp registry property nytimes.com
|
|
129
|
+
adcp registry enrich-brand nike.com
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Discovery and validation
|
|
133
|
+
```bash
|
|
134
|
+
adcp registry discover https://agent.example.com
|
|
135
|
+
adcp registry validate nytimes.com
|
|
136
|
+
adcp registry validate-publisher nytimes.com
|
|
137
|
+
adcp registry lookup nytimes.com
|
|
138
|
+
adcp registry check-auth https://agent.com domain nytimes.com
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Listing and search
|
|
142
|
+
```bash
|
|
143
|
+
adcp registry agents --type sales --health
|
|
144
|
+
adcp registry search nike --json
|
|
145
|
+
adcp registry publishers
|
|
146
|
+
adcp registry stats
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Save operations (requires --auth or ADCP_REGISTRY_API_KEY)
|
|
150
|
+
```bash
|
|
151
|
+
adcp registry save-brand acme.com "Acme Corp" --auth $KEY
|
|
152
|
+
adcp registry save-property example.com https://agent.com --auth $KEY
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Agent management
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
adcp --save-auth prod https://prod-agent.com # Interactive setup
|
|
159
|
+
adcp --save-auth prod https://agent.com --auth $TOKEN # With token
|
|
160
|
+
adcp --save-auth prod https://agent.com --no-auth # No auth
|
|
161
|
+
adcp --save-auth prod https://agent.com/mcp --oauth # OAuth (MCP only)
|
|
162
|
+
adcp --list-agents
|
|
163
|
+
adcp --remove-agent prod
|
|
164
|
+
adcp --show-config
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Config stored at `~/.adcp/config.json`.
|
|
168
|
+
|
|
169
|
+
## Async/webhook support
|
|
170
|
+
|
|
171
|
+
For long-running operations (e.g. create_media_buy with human-in-the-loop approval):
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
adcp https://agent.example.com create_media_buy @payload.json --auth $TOKEN --wait
|
|
175
|
+
adcp http://localhost:3000/mcp create_media_buy @payload.json --wait --local
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- `--wait` — Start webhook listener, wait for async response
|
|
179
|
+
- `--local` — Local webhook without ngrok (for localhost agents)
|
|
180
|
+
- `--timeout MS` — Webhook timeout (default: 300000 = 5 min)
|
|
181
|
+
|
|
182
|
+
Remote `--wait` requires ngrok: `brew install ngrok`
|
|
183
|
+
|
|
184
|
+
## Exit codes
|
|
185
|
+
|
|
186
|
+
- `0` — Success
|
|
187
|
+
- `1` — Network or JSON error
|
|
188
|
+
- `2` — Invalid arguments
|
|
189
|
+
- `3` — Agent error (auth failure, task failed, webhook timeout)
|
|
190
|
+
|
|
191
|
+
## Task: $ARGUMENTS
|
|
192
|
+
|
|
193
|
+
### Step 1: Check installation
|
|
194
|
+
```bash
|
|
195
|
+
which adcp 2>/dev/null && echo "installed" || echo "use npx @adcp/client"
|
|
196
|
+
```
|
|
197
|
+
If not installed, prefix all commands with `npx @adcp/client`. Requires Node.js 18+.
|
|
198
|
+
|
|
199
|
+
### Step 2: Route the request
|
|
200
|
+
|
|
201
|
+
- **"try AdCP" / "show me how it works" / no specific agent** — Use built-in `test-mcp`
|
|
202
|
+
- **"what tools" / "discover" / "list tools"** — `adcp <agent>` with no tool name
|
|
203
|
+
- **"test" / "run tests" / "compliance" / "validate agent"** — `adcp test <agent> [scenario]`
|
|
204
|
+
- **"brand" / "property" / "registry" / "look up" / "validate domain"** — `adcp registry <command>`
|
|
205
|
+
- **Specific tool name mentioned** — `adcp <agent> <tool> '<payload>'`
|
|
206
|
+
- **"compare protocols"** — Run same call with `--protocol mcp` then `--protocol a2a`, diff results
|
|
207
|
+
|
|
208
|
+
### Step 3: Handle authentication
|
|
209
|
+
|
|
210
|
+
1. Built-in aliases `test-mcp` and `test-a2a` have auth included — use for demos
|
|
211
|
+
2. `creative` alias has no auth bundled — user must provide `--auth` or `ADCP_AUTH_TOKEN`
|
|
212
|
+
3. Saved aliases may have auth — check with `adcp --list-agents`
|
|
213
|
+
4. `--auth $TOKEN` flag or `ADCP_AUTH_TOKEN` env var
|
|
214
|
+
5. `--oauth` for MCP agents using OAuth (opens browser, saves tokens to alias)
|
|
215
|
+
6. If no auth and agent requires it, ask the user
|
|
216
|
+
|
|
217
|
+
### Step 4: Choose output format
|
|
218
|
+
|
|
219
|
+
- Default (pretty print) for exploration and debugging
|
|
220
|
+
- `--json` when piping, parsing, or running in CI
|
|
221
|
+
- `--debug` when troubleshooting connection or protocol issues
|
|
222
|
+
|
|
223
|
+
### Step 5: Run and interpret
|
|
224
|
+
|
|
225
|
+
- Run the command
|
|
226
|
+
- Exit code 1: network/parsing error — suggest `--debug`
|
|
227
|
+
- Exit code 2: bad arguments — check syntax
|
|
228
|
+
- Exit code 3: agent error — check auth token, try `--debug`, verify agent is reachable
|
|
229
|
+
- Empty results are valid — do not fabricate data
|
|
230
|
+
- For `--json` output, parse and summarize the key fields for the user
|