@adcp/client 4.20.0 → 4.22.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/AGENTS.md +278 -0
- package/README.md +96 -61
- package/bin/adcp.js +342 -4
- package/dist/lib/agents/index.generated.d.ts +9 -1
- package/dist/lib/agents/index.generated.d.ts.map +1 -1
- package/dist/lib/agents/index.generated.js +12 -0
- package/dist/lib/agents/index.generated.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +2 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +10 -1
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/discovery/property-crawler.d.ts +4 -0
- package/dist/lib/discovery/property-crawler.d.ts.map +1 -1
- package/dist/lib/discovery/property-crawler.js +10 -2
- package/dist/lib/discovery/property-crawler.js.map +1 -1
- package/dist/lib/index.d.ts +9 -9
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +13 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +8 -6
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +24 -11
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/registry/cursor-store.d.ts +19 -0
- package/dist/lib/registry/cursor-store.d.ts.map +1 -0
- package/dist/lib/registry/cursor-store.js +44 -0
- package/dist/lib/registry/cursor-store.js.map +1 -0
- package/dist/lib/registry/index.d.ts +21 -3
- package/dist/lib/registry/index.d.ts.map +1 -1
- package/dist/lib/registry/index.js +94 -1
- package/dist/lib/registry/index.js.map +1 -1
- package/dist/lib/registry/property-registry.d.ts +57 -0
- package/dist/lib/registry/property-registry.d.ts.map +1 -0
- package/dist/lib/registry/property-registry.js +92 -0
- package/dist/lib/registry/property-registry.js.map +1 -0
- package/dist/lib/registry/sync.d.ts +4 -0
- package/dist/lib/registry/sync.d.ts.map +1 -1
- package/dist/lib/registry/sync.js +14 -0
- package/dist/lib/registry/sync.js.map +1 -1
- package/dist/lib/registry/types.d.ts +35 -2
- package/dist/lib/registry/types.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.d.ts +349 -321
- package/dist/lib/registry/types.generated.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.js +1 -1
- package/dist/lib/server/index.d.ts +2 -0
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +3 -1
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/serve.d.ts +45 -0
- package/dist/lib/server/serve.d.ts.map +1 -0
- package/dist/lib/server/serve.js +86 -0
- package/dist/lib/server/serve.js.map +1 -0
- package/dist/lib/testing/agent-tester.d.ts +1 -1
- package/dist/lib/testing/agent-tester.d.ts.map +1 -1
- package/dist/lib/testing/agent-tester.js +10 -1
- package/dist/lib/testing/agent-tester.js.map +1 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +3 -0
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +158 -203
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/storyboard-tracks.d.ts +24 -0
- package/dist/lib/testing/compliance/storyboard-tracks.d.ts.map +1 -0
- package/dist/lib/testing/compliance/storyboard-tracks.js +157 -0
- package/dist/lib/testing/compliance/storyboard-tracks.js.map +1 -0
- package/dist/lib/testing/compliance/types.d.ts +1 -1
- package/dist/lib/testing/compliance/types.d.ts.map +1 -1
- package/dist/lib/testing/index.d.ts +2 -1
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js +26 -1
- package/dist/lib/testing/index.js.map +1 -1
- package/dist/lib/testing/orchestrator.d.ts +8 -0
- package/dist/lib/testing/orchestrator.d.ts.map +1 -1
- package/dist/lib/testing/orchestrator.js +11 -0
- package/dist/lib/testing/orchestrator.js.map +1 -1
- package/dist/lib/testing/scenarios/brand-rights.d.ts +23 -0
- package/dist/lib/testing/scenarios/brand-rights.d.ts.map +1 -0
- package/dist/lib/testing/scenarios/brand-rights.js +144 -0
- package/dist/lib/testing/scenarios/brand-rights.js.map +1 -0
- package/dist/lib/testing/scenarios/capabilities.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/capabilities.js +11 -2
- package/dist/lib/testing/scenarios/capabilities.js.map +1 -1
- package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/governance.js +5 -0
- package/dist/lib/testing/scenarios/governance.js.map +1 -1
- package/dist/lib/testing/scenarios/index.d.ts +2 -0
- package/dist/lib/testing/scenarios/index.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/index.js +10 -2
- package/dist/lib/testing/scenarios/index.js.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.js +22 -3
- package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.d.ts +22 -0
- package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -0
- package/dist/lib/testing/scenarios/trusted-match.js +128 -0
- package/dist/lib/testing/scenarios/trusted-match.js.map +1 -0
- package/dist/lib/testing/storyboard/context.d.ts +34 -0
- package/dist/lib/testing/storyboard/context.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/context.js +257 -0
- package/dist/lib/testing/storyboard/context.js.map +1 -0
- package/dist/lib/testing/storyboard/index.d.ts +15 -0
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/index.js +48 -0
- package/dist/lib/testing/storyboard/index.js.map +1 -0
- package/dist/lib/testing/storyboard/loader.d.ts +53 -0
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/loader.js +114 -0
- package/dist/lib/testing/storyboard/loader.js.map +1 -0
- package/dist/lib/testing/storyboard/path.d.ts +29 -0
- package/dist/lib/testing/storyboard/path.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/path.js +121 -0
- package/dist/lib/testing/storyboard/path.js.map +1 -0
- package/dist/lib/testing/storyboard/request-builder.d.ts +28 -0
- package/dist/lib/testing/storyboard/request-builder.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/request-builder.js +410 -0
- package/dist/lib/testing/storyboard/request-builder.js.map +1 -0
- package/dist/lib/testing/storyboard/runner.d.ts +24 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/runner.js +280 -0
- package/dist/lib/testing/storyboard/runner.js.map +1 -0
- package/dist/lib/testing/storyboard/task-map.d.ts +21 -0
- package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/task-map.js +84 -0
- package/dist/lib/testing/storyboard/task-map.js.map +1 -0
- package/dist/lib/testing/storyboard/types.d.ts +156 -0
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/types.js +10 -0
- package/dist/lib/testing/storyboard/types.js.map +1 -0
- package/dist/lib/testing/storyboard/validations.d.ts +17 -0
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/validations.js +166 -0
- package/dist/lib/testing/storyboard/validations.js.map +1 -0
- package/dist/lib/testing/types.d.ts +4 -1
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/types/core.generated.d.ts +36 -23
- 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 +1098 -770
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +163 -76
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +314 -24
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.d.ts +4 -1
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +25 -1
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/utils/response-schemas.d.ts.map +1 -1
- package/dist/lib/utils/response-schemas.js +34 -3
- package/dist/lib/utils/response-schemas.js.map +1 -1
- package/dist/lib/utils/validate-user-agent.d.ts +8 -0
- package/dist/lib/utils/validate-user-agent.d.ts.map +1 -0
- package/dist/lib/utils/validate-user-agent.js +15 -0
- package/dist/lib/utils/validate-user-agent.js.map +1 -0
- package/dist/lib/version.d.ts +9 -3
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +10 -4
- package/dist/lib/version.js.map +1 -1
- package/docs/README.md +42 -0
- package/docs/guides/BUILD-AN-AGENT.md +292 -0
- package/docs/llms.txt +634 -0
- package/examples/README.md +106 -0
- package/examples/adcp.config.json +30 -0
- package/examples/basic-a2a.ts +76 -0
- package/examples/basic-mcp.ts +50 -0
- package/examples/batch-preview-test.ts +266 -0
- package/examples/conversation-client.ts +291 -0
- package/examples/debug-preview-response.ts +73 -0
- package/examples/debug-preview-with-logging.ts +50 -0
- package/examples/easy-config-demo.ts +242 -0
- package/examples/env-config.ts +51 -0
- package/examples/error-compliant-server.ts +237 -0
- package/examples/generative-creative-demo.ts +205 -0
- package/examples/inspect-card-formats.ts +161 -0
- package/examples/logger-usage.ts +165 -0
- package/examples/oauth-cli-example.ts +154 -0
- package/examples/pr78-async-patterns-demo.ts +247 -0
- package/examples/signals-agent.ts +162 -0
- package/examples/simple-getting-started.ts +225 -0
- package/examples/simple-protocol-demo.ts +75 -0
- package/examples/test-helpers-demo.ts +239 -0
- package/examples/zod-validation-example.ts +126 -0
- package/package.json +12 -2
- package/skills/adcp/SKILL.md +13 -2
- package/storyboards/audience_sync.yaml +199 -0
- package/storyboards/behavioral_analysis.yaml +244 -0
- package/storyboards/brand_rights.yaml +131 -0
- package/storyboards/creative_ad_server.yaml +171 -0
- package/storyboards/creative_sales_agent.yaml +169 -0
- package/storyboards/creative_template.yaml +306 -0
- package/storyboards/deterministic_testing.yaml +925 -0
- package/storyboards/error_compliance.yaml +231 -0
- package/storyboards/governance_content_standards.yaml +213 -0
- package/storyboards/governance_property_lists.yaml +372 -0
- package/storyboards/media_buy_catalog_creative.yaml +457 -0
- package/storyboards/media_buy_governance_escalation.yaml +467 -0
- package/storyboards/media_buy_guaranteed_approval.yaml +396 -0
- package/storyboards/media_buy_non_guaranteed.yaml +288 -0
- package/storyboards/media_buy_proposal_mode.yaml +369 -0
- package/storyboards/media_buy_seller.yaml +560 -0
- package/storyboards/media_buy_state_machine.yaml +254 -0
- package/storyboards/schema.yaml +65 -0
- package/storyboards/schema_validation.yaml +166 -0
- package/storyboards/si_session.yaml +384 -0
- package/storyboards/signal_marketplace.yaml +283 -0
- package/storyboards/signal_owned.yaml +211 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared JSON path utilities for storyboard context and validations.
|
|
4
|
+
*
|
|
5
|
+
* Parses dot-notation paths with array indexing (e.g., "accounts[0].account_id")
|
|
6
|
+
* into segment arrays, and resolves/sets values at those paths.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.parsePath = parsePath;
|
|
10
|
+
exports.resolvePath = resolvePath;
|
|
11
|
+
exports.setPath = setPath;
|
|
12
|
+
/**
|
|
13
|
+
* Parse a path string into segments.
|
|
14
|
+
* "accounts[0].account_id" → ["accounts", 0, "account_id"]
|
|
15
|
+
*/
|
|
16
|
+
function parsePath(path) {
|
|
17
|
+
const segments = [];
|
|
18
|
+
const re = /([^.\[\]]+)|\[(\d+)\]/g;
|
|
19
|
+
let match;
|
|
20
|
+
while ((match = re.exec(path)) !== null) {
|
|
21
|
+
if (match[2] !== undefined) {
|
|
22
|
+
segments.push(parseInt(match[2], 10));
|
|
23
|
+
}
|
|
24
|
+
else if (match[1] !== undefined) {
|
|
25
|
+
segments.push(match[1]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return segments;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve a dot-path with array indexing against an object.
|
|
32
|
+
*
|
|
33
|
+
* Examples:
|
|
34
|
+
* "accounts[0].account_id" → obj.accounts[0].account_id
|
|
35
|
+
* "formats[0].format_id.id" → obj.formats[0].format_id.id
|
|
36
|
+
* "status" → obj.status
|
|
37
|
+
*/
|
|
38
|
+
function resolvePath(obj, path) {
|
|
39
|
+
if (obj === null || obj === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
const segments = parsePath(path);
|
|
42
|
+
let current = obj;
|
|
43
|
+
for (const segment of segments) {
|
|
44
|
+
if (current === null || current === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (typeof segment === 'number') {
|
|
47
|
+
if (!Array.isArray(current))
|
|
48
|
+
return undefined;
|
|
49
|
+
current = current[segment];
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (typeof current !== 'object')
|
|
53
|
+
return undefined;
|
|
54
|
+
current = current[segment];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return current;
|
|
58
|
+
}
|
|
59
|
+
const FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
60
|
+
function isPlainObject(value) {
|
|
61
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Set a value at a dot-path with array indexing.
|
|
65
|
+
* Creates intermediate objects/arrays as needed.
|
|
66
|
+
* Guards against prototype pollution.
|
|
67
|
+
*
|
|
68
|
+
* "media_buy_ids[0]" → obj.media_buy_ids[0] = value
|
|
69
|
+
*/
|
|
70
|
+
function setPath(obj, path, value) {
|
|
71
|
+
const segments = parsePath(path);
|
|
72
|
+
let current = obj;
|
|
73
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
74
|
+
const segment = segments[i];
|
|
75
|
+
const nextSegment = segments[i + 1];
|
|
76
|
+
if (typeof segment === 'number') {
|
|
77
|
+
if (!Array.isArray(current))
|
|
78
|
+
return;
|
|
79
|
+
if (current[segment] === undefined || current[segment] === null) {
|
|
80
|
+
current[segment] = typeof nextSegment === 'number' ? [] : {};
|
|
81
|
+
}
|
|
82
|
+
current = current[segment];
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (FORBIDDEN_KEYS.has(segment))
|
|
86
|
+
return;
|
|
87
|
+
if (!isPlainObject(current))
|
|
88
|
+
return;
|
|
89
|
+
if (!Object.prototype.hasOwnProperty.call(current, segment) || current[segment] == null) {
|
|
90
|
+
Object.defineProperty(current, segment, {
|
|
91
|
+
value: typeof nextSegment === 'number' ? [] : {},
|
|
92
|
+
writable: true,
|
|
93
|
+
enumerable: true,
|
|
94
|
+
configurable: true,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
current = current[segment];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const lastSegment = segments[segments.length - 1];
|
|
101
|
+
if (lastSegment === undefined)
|
|
102
|
+
return;
|
|
103
|
+
if (typeof lastSegment === 'number') {
|
|
104
|
+
if (Array.isArray(current)) {
|
|
105
|
+
current[lastSegment] = value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
if (FORBIDDEN_KEYS.has(lastSegment))
|
|
110
|
+
return;
|
|
111
|
+
if (!isPlainObject(current))
|
|
112
|
+
return;
|
|
113
|
+
Object.defineProperty(current, lastSegment, {
|
|
114
|
+
value,
|
|
115
|
+
writable: true,
|
|
116
|
+
enumerable: true,
|
|
117
|
+
configurable: true,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","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nB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request builder for storyboard steps.
|
|
3
|
+
*
|
|
4
|
+
* Builds valid requests from discovered context rather than using
|
|
5
|
+
* raw sample_request YAML payloads. Each task has a builder that
|
|
6
|
+
* constructs a minimal valid request from the accumulated context
|
|
7
|
+
* (discovered products, accounts, formats, etc.) and TestOptions.
|
|
8
|
+
*
|
|
9
|
+
* sample_request from YAML is used only as documentation and as a
|
|
10
|
+
* fallback when no builder exists for a task.
|
|
11
|
+
*/
|
|
12
|
+
import type { TestOptions } from '../types';
|
|
13
|
+
import type { StoryboardContext, StoryboardStep } from './types';
|
|
14
|
+
/**
|
|
15
|
+
* Build a request for a storyboard step.
|
|
16
|
+
*
|
|
17
|
+
* Priority:
|
|
18
|
+
* 1. User-provided --request override (from StoryboardRunOptions)
|
|
19
|
+
* 2. Request builder for the task (builds from context + options)
|
|
20
|
+
* 3. sample_request from YAML with context injection (fallback)
|
|
21
|
+
* 4. Empty object
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildRequest(step: StoryboardStep, context: StoryboardContext, options: TestOptions): Record<string, unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a request builder exists for a task.
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasRequestBuilder(taskName: string): boolean;
|
|
28
|
+
//# sourceMappingURL=request-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/storyboard/request-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAoYjE;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,WAAW,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Request builder for storyboard steps.
|
|
4
|
+
*
|
|
5
|
+
* Builds valid requests from discovered context rather than using
|
|
6
|
+
* raw sample_request YAML payloads. Each task has a builder that
|
|
7
|
+
* constructs a minimal valid request from the accumulated context
|
|
8
|
+
* (discovered products, accounts, formats, etc.) and TestOptions.
|
|
9
|
+
*
|
|
10
|
+
* sample_request from YAML is used only as documentation and as a
|
|
11
|
+
* fallback when no builder exists for a task.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.buildRequest = buildRequest;
|
|
15
|
+
exports.hasRequestBuilder = hasRequestBuilder;
|
|
16
|
+
const client_1 = require("../client");
|
|
17
|
+
const REQUEST_BUILDERS = {
|
|
18
|
+
// ── Account & Audience ─────────────────────────────────
|
|
19
|
+
sync_accounts(_step, _context, options) {
|
|
20
|
+
return {
|
|
21
|
+
accounts: [
|
|
22
|
+
{
|
|
23
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
24
|
+
operator: (0, client_1.resolveBrand)(options).domain,
|
|
25
|
+
billing: 'operator',
|
|
26
|
+
payment_terms: 'net_30',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
list_accounts(_step, _context, options) {
|
|
32
|
+
return {
|
|
33
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
sync_audiences(_step, context, options) {
|
|
37
|
+
return {
|
|
38
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
39
|
+
audiences: [
|
|
40
|
+
{
|
|
41
|
+
audience_id: `test-audience-${Date.now()}`,
|
|
42
|
+
name: 'E2E Test Audience',
|
|
43
|
+
identifiers: [
|
|
44
|
+
{
|
|
45
|
+
type: 'hashed_email',
|
|
46
|
+
value: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
// ── Product Discovery ──────────────────────────────────
|
|
54
|
+
get_products(step, context, options) {
|
|
55
|
+
// If the step is a "refine" step, build a refine request
|
|
56
|
+
if (step.sample_request?.buying_mode === 'refine' && context.products) {
|
|
57
|
+
return {
|
|
58
|
+
buying_mode: 'refine',
|
|
59
|
+
refine: [
|
|
60
|
+
{
|
|
61
|
+
scope: 'request',
|
|
62
|
+
ask: 'Only guaranteed packages with premium placement.',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
66
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
buying_mode: 'brief',
|
|
71
|
+
brief: options.brief || 'Show me all available advertising products across all channels',
|
|
72
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
// ── Media Buy ──────────────────────────────────────────
|
|
76
|
+
create_media_buy(_step, context, options) {
|
|
77
|
+
const product = selectProduct(context);
|
|
78
|
+
const pricingOption = selectPricingOption(product);
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
const startTime = new Date(now + 24 * 60 * 60 * 1000).toISOString();
|
|
81
|
+
const endTime = new Date(now + 8 * 24 * 60 * 60 * 1000).toISOString();
|
|
82
|
+
const pkg = {
|
|
83
|
+
product_id: product?.product_id ?? context.product_id ?? 'test-product',
|
|
84
|
+
budget: options.budget ?? Math.max(1000, pricingOption?.min_spend_per_package ?? 1000),
|
|
85
|
+
};
|
|
86
|
+
if (pricingOption?.pricing_option_id) {
|
|
87
|
+
pkg.pricing_option_id = pricingOption.pricing_option_id;
|
|
88
|
+
}
|
|
89
|
+
// Add bid_price for auction-based pricing
|
|
90
|
+
if (pricingOption?.pricing_model === 'auction' || pricingOption?.pricing_model === 'cpm') {
|
|
91
|
+
const floor = pricingOption?.floor_price ?? 5;
|
|
92
|
+
pkg.bid_price = Math.round(floor * 1.5 * 100) / 100;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
96
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
97
|
+
start_time: startTime,
|
|
98
|
+
end_time: endTime,
|
|
99
|
+
packages: [pkg],
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
update_media_buy(step, context, _options) {
|
|
103
|
+
const request = {
|
|
104
|
+
media_buy_id: context.media_buy_id ?? 'unknown',
|
|
105
|
+
};
|
|
106
|
+
// Detect the intent from sample_request or step ID
|
|
107
|
+
if (step.sample_request?.action) {
|
|
108
|
+
request.action = step.sample_request.action;
|
|
109
|
+
}
|
|
110
|
+
else if (step.id.includes('pause')) {
|
|
111
|
+
request.action = 'pause';
|
|
112
|
+
}
|
|
113
|
+
else if (step.id.includes('resume')) {
|
|
114
|
+
request.action = 'resume';
|
|
115
|
+
}
|
|
116
|
+
else if (step.id.includes('cancel')) {
|
|
117
|
+
request.action = 'cancel';
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// Default: update budget
|
|
121
|
+
request.packages = [
|
|
122
|
+
{
|
|
123
|
+
package_id: context.package_id,
|
|
124
|
+
budget: 2000,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
return request;
|
|
129
|
+
},
|
|
130
|
+
get_media_buys(_step, context, _options) {
|
|
131
|
+
return {
|
|
132
|
+
media_buy_ids: [context.media_buy_id ?? 'unknown'],
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
get_media_buy_delivery(_step, context, _options) {
|
|
136
|
+
return {
|
|
137
|
+
media_buy_ids: [context.media_buy_id ?? 'unknown'],
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
provide_performance_feedback(_step, context, _options) {
|
|
141
|
+
return {
|
|
142
|
+
media_buy_id: context.media_buy_id ?? 'unknown',
|
|
143
|
+
feedback: {
|
|
144
|
+
satisfaction: 'positive',
|
|
145
|
+
notes: 'E2E test feedback',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
// ── Creative ───────────────────────────────────────────
|
|
150
|
+
list_creative_formats() {
|
|
151
|
+
return {};
|
|
152
|
+
},
|
|
153
|
+
build_creative(_step, context, options) {
|
|
154
|
+
const format = selectFormat(context);
|
|
155
|
+
return {
|
|
156
|
+
target_format_id: format?.format_id ?? context.format_id ?? { agent_url: 'unknown', id: 'unknown' },
|
|
157
|
+
brand: (0, client_1.resolveBrand)(options),
|
|
158
|
+
message: 'Create a test advertisement for an e-commerce brand promoting a summer sale.',
|
|
159
|
+
quality: 'draft',
|
|
160
|
+
include_preview: true,
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
preview_creative(_step, context, _options) {
|
|
164
|
+
const format = selectFormat(context);
|
|
165
|
+
return {
|
|
166
|
+
request_type: 'single',
|
|
167
|
+
creative_manifest: {
|
|
168
|
+
format_id: format?.format_id ?? context.format_id ?? { agent_url: 'unknown', id: 'unknown' },
|
|
169
|
+
name: 'E2E Test Creative',
|
|
170
|
+
assets: {},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
sync_creatives(_step, context, options) {
|
|
175
|
+
const format = selectFormat(context);
|
|
176
|
+
const formatId = format?.format_id ?? context.format_id ?? { agent_url: 'unknown', id: 'unknown' };
|
|
177
|
+
// Build assets as a record (not array) — keyed by asset role
|
|
178
|
+
const assets = {
|
|
179
|
+
primary: {
|
|
180
|
+
url: 'https://test-assets.adcontextprotocol.org/acme-outdoor/hero-master.jpg',
|
|
181
|
+
width: 1200,
|
|
182
|
+
height: 628,
|
|
183
|
+
format: 'image/jpeg',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
return {
|
|
187
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
188
|
+
creatives: [
|
|
189
|
+
{
|
|
190
|
+
creative_id: `test-creative-${Date.now()}`,
|
|
191
|
+
name: 'E2E Test Creative',
|
|
192
|
+
format_id: formatId,
|
|
193
|
+
assets,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
list_creatives(_step, context, options) {
|
|
199
|
+
return {
|
|
200
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
// ── Signals ────────────────────────────────────────────
|
|
204
|
+
get_signals(_step, _context, options) {
|
|
205
|
+
return {
|
|
206
|
+
signal_spec: options.brief || 'Show me all available audience signals and segments',
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
activate_signal(_step, context, _options) {
|
|
210
|
+
const signal = selectSignal(context);
|
|
211
|
+
return {
|
|
212
|
+
signal_agent_segment_id: signal?.signal_agent_segment_id ?? context.signal_id ?? 'test-signal',
|
|
213
|
+
destinations: [
|
|
214
|
+
{ type: 'platform', platform: 'dv360', account: 'test-dv360-account' },
|
|
215
|
+
{ type: 'platform', platform: 'trade-desk', account: 'test-ttd-account' },
|
|
216
|
+
],
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
// ── Capabilities ───────────────────────────────────────
|
|
220
|
+
get_adcp_capabilities() {
|
|
221
|
+
return {};
|
|
222
|
+
},
|
|
223
|
+
// ── Governance ─────────────────────────────────────────
|
|
224
|
+
sync_governance(_step, context, options) {
|
|
225
|
+
return {
|
|
226
|
+
accounts: [
|
|
227
|
+
{
|
|
228
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
229
|
+
governance_agents: [
|
|
230
|
+
{
|
|
231
|
+
url: 'https://governance.test.example.com',
|
|
232
|
+
authentication: {
|
|
233
|
+
schemes: ['Bearer'],
|
|
234
|
+
credentials: 'test-governance-token',
|
|
235
|
+
},
|
|
236
|
+
categories: ['budget_authority', 'brand_policy'],
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
create_property_list(_step, _context, options) {
|
|
244
|
+
return {
|
|
245
|
+
name: options.property_list_name ?? `E2E Test List ${Date.now()}`,
|
|
246
|
+
description: 'Property list created by storyboard testing',
|
|
247
|
+
base_properties: {
|
|
248
|
+
include: [{ identifier_type: 'domain', identifier_value: 'test.example.com' }],
|
|
249
|
+
},
|
|
250
|
+
filters: {
|
|
251
|
+
garm_categories: { exclude: ['adult', 'arms'] },
|
|
252
|
+
},
|
|
253
|
+
brand_manifest: { name: (0, client_1.resolveBrand)(options).domain, url: `https://${(0, client_1.resolveBrand)(options).domain}` },
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
get_property_list(_step, context, _options) {
|
|
257
|
+
return {
|
|
258
|
+
list_id: context.property_list_id ?? 'unknown',
|
|
259
|
+
resolve: true,
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
update_property_list(_step, context, _options) {
|
|
263
|
+
return {
|
|
264
|
+
list_id: context.property_list_id ?? 'unknown',
|
|
265
|
+
description: 'Updated by storyboard testing',
|
|
266
|
+
base_properties: {
|
|
267
|
+
include: [
|
|
268
|
+
{ identifier_type: 'domain', identifier_value: 'test.example.com' },
|
|
269
|
+
{ identifier_type: 'domain', identifier_value: 'updated.example.com' },
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
},
|
|
274
|
+
list_property_lists() {
|
|
275
|
+
return {};
|
|
276
|
+
},
|
|
277
|
+
delete_property_list(_step, context, _options) {
|
|
278
|
+
return {
|
|
279
|
+
list_id: context.property_list_id ?? 'unknown',
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
list_content_standards() {
|
|
283
|
+
return {};
|
|
284
|
+
},
|
|
285
|
+
get_content_standards(_step, context, _options) {
|
|
286
|
+
return {
|
|
287
|
+
content_standards_id: context.content_standards_id ?? 'unknown',
|
|
288
|
+
};
|
|
289
|
+
},
|
|
290
|
+
sync_plans(_step, context, options) {
|
|
291
|
+
return {
|
|
292
|
+
account: context.account ?? (0, client_1.resolveAccount)(options),
|
|
293
|
+
plans: [
|
|
294
|
+
{
|
|
295
|
+
plan_id: `test-plan-${Date.now()}`,
|
|
296
|
+
name: 'E2E Test Plan',
|
|
297
|
+
budget: { total: options.budget ?? 10000, currency: 'USD' },
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
// ── Sponsored Intelligence ─────────────────────────────
|
|
303
|
+
si_get_offering(_step, _context, options) {
|
|
304
|
+
return {
|
|
305
|
+
offering_id: options.si_offering_id ?? 'e2e-test-offering',
|
|
306
|
+
context: options.si_context ?? 'E2E testing - checking SI offering availability',
|
|
307
|
+
identity: {
|
|
308
|
+
principal: (0, client_1.resolveAuthPrincipal)(options) ?? 'e2e-test-principal',
|
|
309
|
+
device_id: 'e2e-test-device',
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
},
|
|
313
|
+
si_initiate_session(_step, context, options) {
|
|
314
|
+
return {
|
|
315
|
+
offering_id: context.offering_id ?? options.si_offering_id ?? 'e2e-test-offering',
|
|
316
|
+
offering_token: context.offering_token,
|
|
317
|
+
identity: {
|
|
318
|
+
principal: (0, client_1.resolveAuthPrincipal)(options) ?? 'e2e-test-principal',
|
|
319
|
+
device_id: 'e2e-test-device',
|
|
320
|
+
},
|
|
321
|
+
context: options.si_context ?? 'E2E test session',
|
|
322
|
+
placement: 'e2e-test',
|
|
323
|
+
supported_capabilities: {
|
|
324
|
+
modalities: { conversational: true, rich_media: true },
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
si_send_message(_step, context, _options) {
|
|
329
|
+
return {
|
|
330
|
+
session_id: context.session_id ?? 'unknown',
|
|
331
|
+
message: 'Tell me more about this product.',
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
si_terminate_session(_step, context, _options) {
|
|
335
|
+
return {
|
|
336
|
+
session_id: context.session_id ?? 'unknown',
|
|
337
|
+
};
|
|
338
|
+
},
|
|
339
|
+
// ── Test Controller ────────────────────────────────────
|
|
340
|
+
comply_test_controller(step, context, _options) {
|
|
341
|
+
// The test controller request is highly step-specific.
|
|
342
|
+
// Use sample_request from YAML since it defines the exact scenario/state.
|
|
343
|
+
if (step.sample_request) {
|
|
344
|
+
return { ...step.sample_request };
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
scenario: context.controller_scenario ?? 'list_scenarios',
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Build a request for a storyboard step.
|
|
353
|
+
*
|
|
354
|
+
* Priority:
|
|
355
|
+
* 1. User-provided --request override (from StoryboardRunOptions)
|
|
356
|
+
* 2. Request builder for the task (builds from context + options)
|
|
357
|
+
* 3. sample_request from YAML with context injection (fallback)
|
|
358
|
+
* 4. Empty object
|
|
359
|
+
*/
|
|
360
|
+
function buildRequest(step, context, options) {
|
|
361
|
+
const builder = REQUEST_BUILDERS[step.task];
|
|
362
|
+
if (builder) {
|
|
363
|
+
return builder(step, context, options);
|
|
364
|
+
}
|
|
365
|
+
// No builder — fall through to sample_request (handled by runner)
|
|
366
|
+
return {};
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Check if a request builder exists for a task.
|
|
370
|
+
*/
|
|
371
|
+
function hasRequestBuilder(taskName) {
|
|
372
|
+
return taskName in REQUEST_BUILDERS;
|
|
373
|
+
}
|
|
374
|
+
// ────────────────────────────────────────────────────────────
|
|
375
|
+
// Selection helpers: pick the best item from discovered data
|
|
376
|
+
// ────────────────────────────────────────────────────────────
|
|
377
|
+
function selectProduct(context) {
|
|
378
|
+
const products = context.products;
|
|
379
|
+
if (!products?.length)
|
|
380
|
+
return undefined;
|
|
381
|
+
// Prefer products with guaranteed delivery and pricing options
|
|
382
|
+
const withPricing = products.filter(p => {
|
|
383
|
+
const opts = p.pricing_options;
|
|
384
|
+
return opts && opts.length > 0;
|
|
385
|
+
});
|
|
386
|
+
return withPricing[0] ?? products[0];
|
|
387
|
+
}
|
|
388
|
+
function selectPricingOption(product) {
|
|
389
|
+
if (!product)
|
|
390
|
+
return undefined;
|
|
391
|
+
const options = product.pricing_options;
|
|
392
|
+
if (!options?.length)
|
|
393
|
+
return undefined;
|
|
394
|
+
// Prefer fixed pricing (cpm, flat) over auction
|
|
395
|
+
const fixed = options.filter(o => o.pricing_model === 'cpm' || o.pricing_model === 'flat');
|
|
396
|
+
return fixed[0] ?? options[0];
|
|
397
|
+
}
|
|
398
|
+
function selectFormat(context) {
|
|
399
|
+
const formats = context.formats;
|
|
400
|
+
if (!formats?.length)
|
|
401
|
+
return undefined;
|
|
402
|
+
return formats[0];
|
|
403
|
+
}
|
|
404
|
+
function selectSignal(context) {
|
|
405
|
+
const signals = context.signals;
|
|
406
|
+
if (!signals?.length)
|
|
407
|
+
return undefined;
|
|
408
|
+
return signals[0];
|
|
409
|
+
}
|
|
410
|
+
//# sourceMappingURL=request-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-builder.js","sourceRoot":"","sources":["../../../../src/lib/testing/storyboard/request-builder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAiZH,oCAYC;AAKD,8CAEC;AAlaD,sCAA+E;AAU/E,MAAM,gBAAgB,GAAmC;IACvD,0DAA0D;IAE1D,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO;QACpC,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,IAAA,qBAAY,EAAC,OA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AC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,KAAK,IAAI,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,CAAC;IAC3F,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,YAAY,CAAC,OAA0B;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAqD,CAAC;IAC9E,IAAI,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,SAAS,YAAY,CAAC,OAA0B;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAqD,CAAC;IAC9E,IAAI,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storyboard execution engine.
|
|
3
|
+
*
|
|
4
|
+
* Two entry points:
|
|
5
|
+
* - runStoryboard(): run all phases/steps sequentially
|
|
6
|
+
* - runStoryboardStep(): run a single step (stateless, LLM-friendly)
|
|
7
|
+
*/
|
|
8
|
+
import type { Storyboard, StoryboardContext, StoryboardRunOptions, StoryboardResult, StoryboardStepResult, StoryboardStepPreview } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Run an entire storyboard against an agent.
|
|
11
|
+
*/
|
|
12
|
+
export declare function runStoryboard(agentUrl: string, storyboard: Storyboard, options?: StoryboardRunOptions): Promise<StoryboardResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Run a single storyboard step.
|
|
15
|
+
*
|
|
16
|
+
* This is the core primitive for stateless, LLM-friendly execution.
|
|
17
|
+
* Context is passed in and returned, enabling step-by-step orchestration.
|
|
18
|
+
*/
|
|
19
|
+
export declare function runStoryboardStep(agentUrl: string, storyboard: Storyboard, stepId: string, options?: StoryboardRunOptions): Promise<StoryboardStepResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a preview of the first step in a storyboard (for showing what will happen).
|
|
22
|
+
*/
|
|
23
|
+
export declare function getFirstStepPreview(storyboard: Storyboard, context?: StoryboardContext): StoryboardStepPreview | undefined;
|
|
24
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/storyboard/runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EACV,UAAU,EAEV,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAEhB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAMjB;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,gBAAgB,CAAC,CA8F3B;AAMD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CA2B/B;AA4JD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,iBAAsB,GAC9B,qBAAqB,GAAG,SAAS,CAgBnC"}
|