@adcp/client 4.8.0 → 4.10.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.js +346 -0
- package/dist/lib/adapters/governance-adapter.d.ts +88 -0
- package/dist/lib/adapters/governance-adapter.d.ts.map +1 -0
- package/dist/lib/adapters/governance-adapter.js +96 -0
- package/dist/lib/adapters/governance-adapter.js.map +1 -0
- package/dist/lib/adapters/index.d.ts +1 -0
- package/dist/lib/adapters/index.d.ts.map +1 -1
- package/dist/lib/adapters/index.js +7 -1
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/agents/index.generated.d.ts +33 -1
- package/dist/lib/agents/index.generated.d.ts.map +1 -1
- package/dist/lib/agents/index.generated.js +48 -0
- package/dist/lib/agents/index.generated.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts +92 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AgentClient.js +237 -0
- package/dist/lib/core/AgentClient.js.map +1 -1
- package/dist/lib/core/AsyncHandler.d.ts +19 -2
- package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
- package/dist/lib/core/AsyncHandler.js.map +1 -1
- package/dist/lib/core/ConversationTypes.d.ts +8 -2
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/GovernanceMiddleware.d.ts +86 -0
- package/dist/lib/core/GovernanceMiddleware.d.ts.map +1 -0
- package/dist/lib/core/GovernanceMiddleware.js +289 -0
- package/dist/lib/core/GovernanceMiddleware.js.map +1 -0
- package/dist/lib/core/GovernanceTypes.d.ts +118 -0
- package/dist/lib/core/GovernanceTypes.d.ts.map +1 -0
- package/dist/lib/core/GovernanceTypes.js +69 -0
- package/dist/lib/core/GovernanceTypes.js.map +1 -0
- package/dist/lib/core/SingleAgentClient.d.ts +103 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +151 -0
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts +10 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +95 -10
- package/dist/lib/core/TaskExecutor.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 +22 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/observability/index.d.ts +8 -0
- package/dist/lib/observability/index.d.ts.map +1 -0
- package/dist/lib/observability/index.js +17 -0
- package/dist/lib/observability/index.js.map +1 -0
- package/dist/lib/observability/tracing.d.ts +42 -0
- package/dist/lib/observability/tracing.d.ts.map +1 -0
- package/dist/lib/observability/tracing.js +126 -0
- package/dist/lib/observability/tracing.js.map +1 -0
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +16 -1
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +37 -29
- 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 +21 -1
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/registry/types.generated.d.ts +754 -5
- package/dist/lib/registry/types.generated.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.js +1 -1
- 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 +36 -11
- package/dist/lib/testing/agent-tester.js.map +1 -1
- package/dist/lib/testing/client.d.ts +6 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +36 -19
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/compliance/briefs.d.ts +12 -0
- package/dist/lib/testing/compliance/briefs.d.ts.map +1 -0
- package/dist/lib/testing/compliance/briefs.js +157 -0
- package/dist/lib/testing/compliance/briefs.js.map +1 -0
- package/dist/lib/testing/compliance/comply.d.ts +26 -0
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -0
- package/dist/lib/testing/compliance/comply.js +540 -0
- package/dist/lib/testing/compliance/comply.js.map +1 -0
- package/dist/lib/testing/compliance/convince.d.ts +27 -0
- package/dist/lib/testing/compliance/convince.d.ts.map +1 -0
- package/dist/lib/testing/compliance/convince.js +418 -0
- package/dist/lib/testing/compliance/convince.js.map +1 -0
- package/dist/lib/testing/compliance/index.d.ts +13 -0
- package/dist/lib/testing/compliance/index.d.ts.map +1 -0
- package/dist/lib/testing/compliance/index.js +22 -0
- package/dist/lib/testing/compliance/index.js.map +1 -0
- package/dist/lib/testing/compliance/types.d.ts +123 -0
- package/dist/lib/testing/compliance/types.d.ts.map +1 -0
- package/dist/lib/testing/compliance/types.js +9 -0
- package/dist/lib/testing/compliance/types.js.map +1 -0
- package/dist/lib/testing/index.d.ts +1 -0
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js +15 -1
- package/dist/lib/testing/index.js.map +1 -1
- package/dist/lib/testing/orchestrator.d.ts +0 -2
- package/dist/lib/testing/orchestrator.d.ts.map +1 -1
- package/dist/lib/testing/orchestrator.js +14 -3
- package/dist/lib/testing/orchestrator.js.map +1 -1
- package/dist/lib/testing/scenarios/capabilities.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/capabilities.js +70 -9
- package/dist/lib/testing/scenarios/capabilities.js.map +1 -1
- package/dist/lib/testing/scenarios/creative.d.ts +14 -0
- package/dist/lib/testing/scenarios/creative.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/creative.js +261 -55
- package/dist/lib/testing/scenarios/creative.js.map +1 -1
- package/dist/lib/testing/scenarios/discovery.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/discovery.js +7 -5
- package/dist/lib/testing/scenarios/discovery.js.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.js +90 -112
- package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
- package/dist/lib/testing/scenarios/governance.d.ts +48 -0
- package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/governance.js +725 -39
- package/dist/lib/testing/scenarios/governance.js.map +1 -1
- package/dist/lib/testing/scenarios/index.d.ts +3 -3
- package/dist/lib/testing/scenarios/index.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/index.js +8 -1
- package/dist/lib/testing/scenarios/index.js.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.d.ts +14 -5
- package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.js +358 -63
- package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js +26 -22
- package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
- package/dist/lib/testing/scenarios/signals.d.ts +4 -8
- package/dist/lib/testing/scenarios/signals.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/signals.js +17 -59
- package/dist/lib/testing/scenarios/signals.js.map +1 -1
- package/dist/lib/testing/scenarios/sponsored-intelligence.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/sponsored-intelligence.js +23 -19
- package/dist/lib/testing/scenarios/sponsored-intelligence.js.map +1 -1
- package/dist/lib/testing/types.d.ts +3 -2
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/types/core.generated.d.ts +629 -5
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/schemas.generated.d.ts +13059 -11101
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +573 -107
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +1827 -360
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.d.ts +17 -2
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +26 -2
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Convince Engine — AI-Assessed Merchandising Quality
|
|
4
|
+
*
|
|
5
|
+
* Runs sample briefs against an agent's get_products endpoint
|
|
6
|
+
* and uses an LLM to evaluate the quality of responses.
|
|
7
|
+
*
|
|
8
|
+
* comply → "Your agent works"
|
|
9
|
+
* convince → "Your agent sells"
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.convince = convince;
|
|
13
|
+
exports.formatConvinceResults = formatConvinceResults;
|
|
14
|
+
exports.formatConvinceResultsJSON = formatConvinceResultsJSON;
|
|
15
|
+
const client_1 = require("../client");
|
|
16
|
+
const briefs_1 = require("./briefs");
|
|
17
|
+
const EVALUATION_PROMPT = `You are an expert ad tech buyer evaluating a sales agent's product catalog response.
|
|
18
|
+
|
|
19
|
+
A buyer sent a brief to a sales agent requesting advertising products. Below is the brief and the agent's response. Evaluate the response across these dimensions:
|
|
20
|
+
|
|
21
|
+
1. **relevance** — Do the returned products match the brief's audience, format, and objective?
|
|
22
|
+
2. **specificity** — Are products tailored to this brief or generic inventory?
|
|
23
|
+
3. **completeness** — Are the fields populated that buyers use to decide? (audience, targeting, pricing, descriptions)
|
|
24
|
+
4. **pricing** — Is the pricing model appropriate for the brief's goals and budget?
|
|
25
|
+
5. **merchandising** — Would a buyer pick this over a competitor's response? Are product names compelling vs internal codes?
|
|
26
|
+
|
|
27
|
+
Rate each dimension as "strong", "moderate", or "weak" with a specific observation (not generic).
|
|
28
|
+
|
|
29
|
+
Then provide:
|
|
30
|
+
- A 2-3 sentence summary of the overall quality
|
|
31
|
+
- Top 3 specific, actionable improvements (not generic advice)
|
|
32
|
+
|
|
33
|
+
IMPORTANT: Be specific. Reference actual product names, field values, and counts from the response. Do not give generic advice like "add more targeting" — say "3 of 5 products have no audience fields; add demographic or interest targeting to the Premium Display product."
|
|
34
|
+
|
|
35
|
+
Respond in this exact JSON format:
|
|
36
|
+
{
|
|
37
|
+
"dimensions": [
|
|
38
|
+
{"dimension": "relevance", "rating": "strong|moderate|weak", "observation": "..."},
|
|
39
|
+
{"dimension": "specificity", "rating": "strong|moderate|weak", "observation": "..."},
|
|
40
|
+
{"dimension": "completeness", "rating": "strong|moderate|weak", "observation": "..."},
|
|
41
|
+
{"dimension": "pricing", "rating": "strong|moderate|weak", "observation": "..."},
|
|
42
|
+
{"dimension": "merchandising", "rating": "strong|moderate|weak", "observation": "..."}
|
|
43
|
+
],
|
|
44
|
+
"summary": "...",
|
|
45
|
+
"top_actions": ["...", "...", "..."]
|
|
46
|
+
}`;
|
|
47
|
+
/**
|
|
48
|
+
* Call an LLM to evaluate a product response against a brief.
|
|
49
|
+
*/
|
|
50
|
+
async function evaluateWithLLM(brief, products, options) {
|
|
51
|
+
const userMessage = `## Brief
|
|
52
|
+
**Name:** ${brief.name}
|
|
53
|
+
**Vertical:** ${brief.vertical}
|
|
54
|
+
**Budget:** ${brief.budget_context || 'Not specified'}
|
|
55
|
+
**Expected Channels:** ${brief.expected_channels?.join(', ') || 'Any'}
|
|
56
|
+
|
|
57
|
+
${brief.brief}
|
|
58
|
+
|
|
59
|
+
## Evaluation Hints
|
|
60
|
+
${brief.evaluation_hints}
|
|
61
|
+
|
|
62
|
+
## Agent Response
|
|
63
|
+
Products returned: ${products.length}
|
|
64
|
+
|
|
65
|
+
\`\`\`json
|
|
66
|
+
${JSON.stringify(products, null, 2).slice(0, 8000)}
|
|
67
|
+
\`\`\``;
|
|
68
|
+
let responseText;
|
|
69
|
+
if (options.anthropic_api_key) {
|
|
70
|
+
responseText = await callAnthropic(EVALUATION_PROMPT, userMessage, options.anthropic_api_key, options.model);
|
|
71
|
+
}
|
|
72
|
+
else if (options.gemini_api_key) {
|
|
73
|
+
responseText = await callGemini(EVALUATION_PROMPT, userMessage, options.gemini_api_key, options.model);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw new Error('No LLM API key provided. Set --anthropic-key or --gemini-key');
|
|
77
|
+
}
|
|
78
|
+
return parseEvaluation(responseText);
|
|
79
|
+
}
|
|
80
|
+
async function callAnthropic(system, user, apiKey, model) {
|
|
81
|
+
const response = await fetch('https://api.anthropic.com/v1/messages', {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'application/json',
|
|
85
|
+
'x-api-key': apiKey,
|
|
86
|
+
'anthropic-version': '2023-06-01',
|
|
87
|
+
},
|
|
88
|
+
body: JSON.stringify({
|
|
89
|
+
model: model || 'claude-sonnet-4-20250514',
|
|
90
|
+
max_tokens: 2000,
|
|
91
|
+
system,
|
|
92
|
+
messages: [{ role: 'user', content: user }],
|
|
93
|
+
}),
|
|
94
|
+
});
|
|
95
|
+
if (!response.ok) {
|
|
96
|
+
const body = await response.text();
|
|
97
|
+
throw new Error(`Anthropic API error ${response.status}: ${body}`);
|
|
98
|
+
}
|
|
99
|
+
const data = (await response.json());
|
|
100
|
+
return data.content[0].text;
|
|
101
|
+
}
|
|
102
|
+
async function callGemini(system, user, apiKey, model) {
|
|
103
|
+
const geminiModel = model || 'gemini-2.0-flash';
|
|
104
|
+
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${geminiModel}:generateContent?key=${apiKey}`, {
|
|
105
|
+
method: 'POST',
|
|
106
|
+
headers: { 'Content-Type': 'application/json' },
|
|
107
|
+
body: JSON.stringify({
|
|
108
|
+
systemInstruction: { parts: [{ text: system }] },
|
|
109
|
+
contents: [{ parts: [{ text: user }] }],
|
|
110
|
+
generationConfig: { responseMimeType: 'application/json' },
|
|
111
|
+
}),
|
|
112
|
+
});
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
const body = await response.text();
|
|
115
|
+
throw new Error(`Gemini API error ${response.status}: ${body}`);
|
|
116
|
+
}
|
|
117
|
+
const data = (await response.json());
|
|
118
|
+
return data.candidates[0].content.parts[0].text;
|
|
119
|
+
}
|
|
120
|
+
function parseEvaluation(text) {
|
|
121
|
+
// Extract JSON from the response (handle markdown code blocks)
|
|
122
|
+
const jsonMatch = text.match(/\{[\s\S]*\}/);
|
|
123
|
+
if (!jsonMatch) {
|
|
124
|
+
throw new Error('Could not parse LLM evaluation response as JSON');
|
|
125
|
+
}
|
|
126
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
127
|
+
const validDimensions = ['relevance', 'specificity', 'completeness', 'pricing', 'merchandising'];
|
|
128
|
+
const validRatings = ['strong', 'moderate', 'weak'];
|
|
129
|
+
const dimensions = (parsed.dimensions || [])
|
|
130
|
+
.filter(d => validDimensions.includes(d.dimension) && validRatings.includes(d.rating))
|
|
131
|
+
.map(d => ({
|
|
132
|
+
dimension: d.dimension,
|
|
133
|
+
rating: d.rating,
|
|
134
|
+
observation: d.observation || '',
|
|
135
|
+
}));
|
|
136
|
+
return {
|
|
137
|
+
dimensions,
|
|
138
|
+
summary: parsed.summary || 'No summary provided',
|
|
139
|
+
top_actions: parsed.top_actions || [],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Run convince assessment against an agent.
|
|
144
|
+
* Sends sample briefs, evaluates product responses with AI.
|
|
145
|
+
*/
|
|
146
|
+
async function convince(agentUrl, options = {}) {
|
|
147
|
+
const start = Date.now();
|
|
148
|
+
if (!options.anthropic_api_key && !options.gemini_api_key) {
|
|
149
|
+
const anthropicKey = process.env.ANTHROPIC_API_KEY;
|
|
150
|
+
const geminiKey = process.env.GEMINI_API_KEY;
|
|
151
|
+
if (anthropicKey)
|
|
152
|
+
options.anthropic_api_key = anthropicKey;
|
|
153
|
+
else if (geminiKey)
|
|
154
|
+
options.gemini_api_key = geminiKey;
|
|
155
|
+
else
|
|
156
|
+
throw new Error('No LLM API key. Set ANTHROPIC_API_KEY or GEMINI_API_KEY environment variable.');
|
|
157
|
+
}
|
|
158
|
+
const effectiveOptions = {
|
|
159
|
+
...options,
|
|
160
|
+
dry_run: options.dry_run !== false,
|
|
161
|
+
test_session_id: options.test_session_id || `convince-${Date.now()}`,
|
|
162
|
+
};
|
|
163
|
+
// Discover agent
|
|
164
|
+
const client = (0, client_1.createTestClient)(agentUrl, effectiveOptions.protocol ?? 'mcp', effectiveOptions);
|
|
165
|
+
const { profile, step: profileStep } = await (0, client_1.discoverAgentProfile)(client);
|
|
166
|
+
if (!profileStep.passed) {
|
|
167
|
+
return {
|
|
168
|
+
agent_url: agentUrl,
|
|
169
|
+
agent_profile: profile,
|
|
170
|
+
assessments: [],
|
|
171
|
+
patterns: [],
|
|
172
|
+
overall_summary: 'Agent unreachable — cannot assess merchandising quality',
|
|
173
|
+
tested_at: new Date().toISOString(),
|
|
174
|
+
total_duration_ms: Date.now() - start,
|
|
175
|
+
evaluator: options.anthropic_api_key ? 'anthropic' : 'gemini',
|
|
176
|
+
dry_run: effectiveOptions.dry_run !== false,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (!profile.tools.includes('get_products')) {
|
|
180
|
+
return {
|
|
181
|
+
agent_url: agentUrl,
|
|
182
|
+
agent_profile: profile,
|
|
183
|
+
assessments: [],
|
|
184
|
+
patterns: [],
|
|
185
|
+
overall_summary: 'Agent does not support get_products — nothing to assess for merchandising quality',
|
|
186
|
+
tested_at: new Date().toISOString(),
|
|
187
|
+
total_duration_ms: Date.now() - start,
|
|
188
|
+
evaluator: options.anthropic_api_key ? 'anthropic' : 'gemini',
|
|
189
|
+
dry_run: effectiveOptions.dry_run !== false,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
// Select briefs to run
|
|
193
|
+
const briefs = options.brief_ids ? briefs_1.SAMPLE_BRIEFS.filter(b => options.brief_ids.includes(b.id)) : briefs_1.SAMPLE_BRIEFS;
|
|
194
|
+
const assessments = [];
|
|
195
|
+
for (const brief of briefs) {
|
|
196
|
+
try {
|
|
197
|
+
// Call get_products with the sample brief
|
|
198
|
+
const result = (await client.getProducts({
|
|
199
|
+
buying_mode: 'brief',
|
|
200
|
+
brief: brief.brief,
|
|
201
|
+
brand: (0, client_1.resolveBrand)(effectiveOptions),
|
|
202
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- bypasses strict request typing
|
|
203
|
+
}));
|
|
204
|
+
const products = result?.success ? (result.data?.products ?? []) : [];
|
|
205
|
+
if (!result?.success) {
|
|
206
|
+
assessments.push({
|
|
207
|
+
brief,
|
|
208
|
+
products_returned: 0,
|
|
209
|
+
dimensions: [],
|
|
210
|
+
summary: `Agent returned error: ${result?.error || 'unknown error'}`,
|
|
211
|
+
top_actions: ['Fix the error returned by get_products before assessing merchandising quality'],
|
|
212
|
+
raw_response: result?.data,
|
|
213
|
+
});
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
// Evaluate with LLM
|
|
217
|
+
const evaluation = await evaluateWithLLM(brief, products, options);
|
|
218
|
+
assessments.push({
|
|
219
|
+
brief,
|
|
220
|
+
products_returned: products.length,
|
|
221
|
+
dimensions: evaluation.dimensions,
|
|
222
|
+
summary: evaluation.summary,
|
|
223
|
+
top_actions: evaluation.top_actions,
|
|
224
|
+
raw_response: products,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
assessments.push({
|
|
229
|
+
brief,
|
|
230
|
+
products_returned: 0,
|
|
231
|
+
dimensions: [],
|
|
232
|
+
summary: `Error evaluating: ${error instanceof Error ? error.message : String(error)}`,
|
|
233
|
+
top_actions: [],
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Detect cross-brief patterns
|
|
238
|
+
const patterns = detectPatterns(assessments);
|
|
239
|
+
// Generate overall summary
|
|
240
|
+
const overall_summary = generateOverallSummary(assessments, patterns, profile);
|
|
241
|
+
return {
|
|
242
|
+
agent_url: agentUrl,
|
|
243
|
+
agent_profile: profile,
|
|
244
|
+
assessments,
|
|
245
|
+
patterns,
|
|
246
|
+
overall_summary,
|
|
247
|
+
tested_at: new Date().toISOString(),
|
|
248
|
+
total_duration_ms: Date.now() - start,
|
|
249
|
+
evaluator: options.anthropic_api_key ? 'anthropic' : 'gemini',
|
|
250
|
+
dry_run: effectiveOptions.dry_run !== false,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function detectPatterns(assessments) {
|
|
254
|
+
const patterns = [];
|
|
255
|
+
// Count ratings across all assessments
|
|
256
|
+
const ratingCounts = {
|
|
257
|
+
relevance: { strong: 0, moderate: 0, weak: 0 },
|
|
258
|
+
specificity: { strong: 0, moderate: 0, weak: 0 },
|
|
259
|
+
completeness: { strong: 0, moderate: 0, weak: 0 },
|
|
260
|
+
pricing: { strong: 0, moderate: 0, weak: 0 },
|
|
261
|
+
merchandising: { strong: 0, moderate: 0, weak: 0 },
|
|
262
|
+
};
|
|
263
|
+
for (const assessment of assessments) {
|
|
264
|
+
for (const dim of assessment.dimensions) {
|
|
265
|
+
if (ratingCounts[dim.dimension]) {
|
|
266
|
+
ratingCounts[dim.dimension][dim.rating]++;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const total = assessments.filter(a => a.dimensions.length > 0).length;
|
|
271
|
+
if (total === 0)
|
|
272
|
+
return patterns;
|
|
273
|
+
// Find consistently weak dimensions
|
|
274
|
+
for (const [dim, counts] of Object.entries(ratingCounts)) {
|
|
275
|
+
if (counts.weak >= total * 0.6) {
|
|
276
|
+
patterns.push({
|
|
277
|
+
pattern: `${dim} is consistently weak`,
|
|
278
|
+
frequency: `Weak in ${counts.weak} of ${total} briefs`,
|
|
279
|
+
impact: getImpactDescription(dim),
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
else if (counts.strong >= total * 0.6) {
|
|
283
|
+
patterns.push({
|
|
284
|
+
pattern: `${dim} is a strength`,
|
|
285
|
+
frequency: `Strong in ${counts.strong} of ${total} briefs`,
|
|
286
|
+
impact: `This is competitive advantage — maintain and highlight it.`,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// Check for zero-product responses
|
|
291
|
+
const emptyResponses = assessments.filter(a => a.products_returned === 0).length;
|
|
292
|
+
if (emptyResponses > 0) {
|
|
293
|
+
patterns.push({
|
|
294
|
+
pattern: 'Empty responses to valid briefs',
|
|
295
|
+
frequency: `${emptyResponses} of ${assessments.length} briefs returned 0 products`,
|
|
296
|
+
impact: 'Buyers will move to another agent immediately if they get no products. This is the most impactful issue to fix.',
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
// Check for identical product counts (might indicate static catalog)
|
|
300
|
+
const counts = assessments.map(a => a.products_returned).filter(c => c > 0);
|
|
301
|
+
const uniqueCounts = new Set(counts);
|
|
302
|
+
if (counts.length > 2 && uniqueCounts.size === 1) {
|
|
303
|
+
patterns.push({
|
|
304
|
+
pattern: 'Same number of products returned for every brief',
|
|
305
|
+
frequency: `Always ${counts[0]} products across ${counts.length} different briefs`,
|
|
306
|
+
impact: 'Suggests a static catalog rather than brief-responsive product selection. Buyers expect curated results.',
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
return patterns;
|
|
310
|
+
}
|
|
311
|
+
function getImpactDescription(dimension) {
|
|
312
|
+
switch (dimension) {
|
|
313
|
+
case 'relevance':
|
|
314
|
+
return "Buyers filter on relevance first. Irrelevant products mean you're not even in consideration.";
|
|
315
|
+
case 'specificity':
|
|
316
|
+
return 'Generic products lose to tailored ones. Buyers want to see you understand their brief.';
|
|
317
|
+
case 'completeness':
|
|
318
|
+
return 'Missing fields force buyers to guess. They will pick the agent that gives them complete information.';
|
|
319
|
+
case 'pricing':
|
|
320
|
+
return 'Wrong pricing model signals misalignment. Performance briefs need CPC/CPA, awareness needs CPM.';
|
|
321
|
+
case 'merchandising':
|
|
322
|
+
return 'Product names and descriptions are your first impression. Internal codes vs compelling names is the difference.';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function generateOverallSummary(assessments, patterns, profile) {
|
|
326
|
+
const withDimensions = assessments.filter(a => a.dimensions.length > 0);
|
|
327
|
+
if (withDimensions.length === 0) {
|
|
328
|
+
return 'Could not assess merchandising quality — no successful product responses to evaluate.';
|
|
329
|
+
}
|
|
330
|
+
// Count overall ratings
|
|
331
|
+
let strong = 0;
|
|
332
|
+
let moderate = 0;
|
|
333
|
+
let weak = 0;
|
|
334
|
+
for (const a of withDimensions) {
|
|
335
|
+
for (const d of a.dimensions) {
|
|
336
|
+
if (d.rating === 'strong')
|
|
337
|
+
strong++;
|
|
338
|
+
else if (d.rating === 'moderate')
|
|
339
|
+
moderate++;
|
|
340
|
+
else
|
|
341
|
+
weak++;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const total = strong + moderate + weak;
|
|
345
|
+
const strongPct = Math.round((strong / total) * 100);
|
|
346
|
+
const weakPct = Math.round((weak / total) * 100);
|
|
347
|
+
let summary = `Assessed ${withDimensions.length} brief(s) against ${profile.name}. `;
|
|
348
|
+
if (weakPct > 50) {
|
|
349
|
+
summary += `Merchandising quality needs work: ${weakPct}% of dimension scores were weak. `;
|
|
350
|
+
}
|
|
351
|
+
else if (strongPct > 50) {
|
|
352
|
+
summary += `Strong merchandising: ${strongPct}% of dimension scores were strong. `;
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
summary += `Mixed results: ${strongPct}% strong, ${weakPct}% weak across all dimensions. `;
|
|
356
|
+
}
|
|
357
|
+
// Add top pattern
|
|
358
|
+
const weakPatterns = patterns.filter(p => p.pattern.includes('weak') || p.pattern.includes('Empty'));
|
|
359
|
+
if (weakPatterns.length > 0) {
|
|
360
|
+
summary += `Key issue: ${weakPatterns[0].pattern.toLowerCase()}.`;
|
|
361
|
+
}
|
|
362
|
+
return summary;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Format convince results for terminal display.
|
|
366
|
+
*/
|
|
367
|
+
function formatConvinceResults(result) {
|
|
368
|
+
let output = '';
|
|
369
|
+
output += `\n🎯 AdCP Convince Report\n`;
|
|
370
|
+
output += `${'─'.repeat(50)}\n`;
|
|
371
|
+
output += `Agent: ${result.agent_url}\n`;
|
|
372
|
+
output += `Name: ${result.agent_profile.name}\n`;
|
|
373
|
+
output += `Evaluator: ${result.evaluator}\n`;
|
|
374
|
+
output += `Duration: ${(result.total_duration_ms / 1000).toFixed(1)}s\n\n`;
|
|
375
|
+
output += `${result.overall_summary}\n\n`;
|
|
376
|
+
// Per-brief results
|
|
377
|
+
for (const assessment of result.assessments) {
|
|
378
|
+
output += `${'─'.repeat(50)}\n`;
|
|
379
|
+
output += `📋 ${assessment.brief.name}\n`;
|
|
380
|
+
output += ` ${assessment.brief.vertical} | ${assessment.brief.budget_context || 'No budget'}\n`;
|
|
381
|
+
output += ` Products returned: ${assessment.products_returned}\n\n`;
|
|
382
|
+
if (assessment.dimensions.length === 0) {
|
|
383
|
+
output += ` ${assessment.summary}\n\n`;
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
// Dimension scores
|
|
387
|
+
for (const dim of assessment.dimensions) {
|
|
388
|
+
const icon = dim.rating === 'strong' ? '🟢' : dim.rating === 'moderate' ? '🟡' : '🔴';
|
|
389
|
+
output += ` ${icon} ${dim.dimension}: ${dim.observation}\n`;
|
|
390
|
+
}
|
|
391
|
+
output += `\n ${assessment.summary}\n`;
|
|
392
|
+
if (assessment.top_actions.length > 0) {
|
|
393
|
+
output += `\n Actions:\n`;
|
|
394
|
+
for (const action of assessment.top_actions) {
|
|
395
|
+
output += ` → ${action}\n`;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
output += '\n';
|
|
399
|
+
}
|
|
400
|
+
// Cross-brief patterns
|
|
401
|
+
if (result.patterns.length > 0) {
|
|
402
|
+
output += `${'─'.repeat(50)}\n`;
|
|
403
|
+
output += `Cross-Brief Patterns\n\n`;
|
|
404
|
+
for (const pattern of result.patterns) {
|
|
405
|
+
output += ` ${pattern.pattern}\n`;
|
|
406
|
+
output += ` ${pattern.frequency}\n`;
|
|
407
|
+
output += ` Impact: ${pattern.impact}\n\n`;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return output;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Format convince results as JSON.
|
|
414
|
+
*/
|
|
415
|
+
function formatConvinceResultsJSON(result) {
|
|
416
|
+
return JSON.stringify(result, null, 2);
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=convince.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convince.js","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/convince.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAmLH,4BAqHC;AAkID,sDAqDC;AAKD,8DAEC;AApeD,sCAAiF;AAGjF,qCAAyC;AAYzC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BxB,CAAC;AAEH;;GAEG;AACH,KAAK,UAAU,eAAe,CAC5B,KAAkB,EAClB,QAAmB,EACnB,OAAwB;IAExB,MAAM,WAAW,GAAG;YACV,KAAK,CAAC,IAAI;gBACN,KAAK,CAAC,QAAQ;cAChB,KAAK,CAAC,cAAc,IAAI,eAAe;yBAC5B,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK;;EAEnE,KAAK,CAAC,KAAK;;;EAGX,KAAK,CAAC,gBAAgB;;;qBAGH,QAAQ,CAAC,MAAM;;;EAGlC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;OAC3C,CAAC;IAEN,IAAI,YAAoB,CAAC;IAEzB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC9B,YAAY,GAAG,MAAM,aAAa,CAAC,iBAAiB,EAAE,W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AQ,UAAU,CAAC,OAAO,IAAI,CAAC;QAEzC,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,iBAAiB,CAAC;YAC5B,KAAK,MAAM,MAAM,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC5C,MAAM,IAAI,QAAQ,MAAM,IAAI,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,uBAAuB;IACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAChC,MAAM,IAAI,0BAA0B,CAAC;QACrC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,MAAM,OAAO,CAAC,OAAO,IAAI,CAAC;YACpC,MAAM,IAAI,MAAM,OAAO,CAAC,SAAS,IAAI,CAAC;YACtC,MAAM,IAAI,cAAc,OAAO,CAAC,MAAM,MAAM,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,MAAsB;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdCP Compliance & Convince Assessment
|
|
3
|
+
*
|
|
4
|
+
* comply → "Your agent works" (deterministic, per-track)
|
|
5
|
+
* convince → "Your agent sells" (AI-assessed, per-brief)
|
|
6
|
+
*/
|
|
7
|
+
export { comply, formatComplianceResults, formatComplianceResultsJSON } from './comply';
|
|
8
|
+
export type { ComplyOptions } from './comply';
|
|
9
|
+
export { convince, formatConvinceResults, formatConvinceResultsJSON } from './convince';
|
|
10
|
+
export type { FullConvinceOptions } from './convince';
|
|
11
|
+
export { SAMPLE_BRIEFS, getBriefById, getBriefsByVertical } from './briefs';
|
|
12
|
+
export type { ComplianceTrack, TrackResult, TrackStatus, ComplianceResult, ComplianceSummary, AdvisoryObservation, ObservationCategory, ObservationSeverity, SampleBrief, ConvinceDimension, ConvinceRating, DimensionScore, ScenarioAssessment, ConvinceResult, ConvincePattern, ConvinceOptions, } from './types';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACxF,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACxF,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE5E,YAAY,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AdCP Compliance & Convince Assessment
|
|
4
|
+
*
|
|
5
|
+
* comply → "Your agent works" (deterministic, per-track)
|
|
6
|
+
* convince → "Your agent sells" (AI-assessed, per-brief)
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.getBriefsByVertical = exports.getBriefById = exports.SAMPLE_BRIEFS = exports.formatConvinceResultsJSON = exports.formatConvinceResults = exports.convince = exports.formatComplianceResultsJSON = exports.formatComplianceResults = exports.comply = void 0;
|
|
10
|
+
var comply_1 = require("./comply");
|
|
11
|
+
Object.defineProperty(exports, "comply", { enumerable: true, get: function () { return comply_1.comply; } });
|
|
12
|
+
Object.defineProperty(exports, "formatComplianceResults", { enumerable: true, get: function () { return comply_1.formatComplianceResults; } });
|
|
13
|
+
Object.defineProperty(exports, "formatComplianceResultsJSON", { enumerable: true, get: function () { return comply_1.formatComplianceResultsJSON; } });
|
|
14
|
+
var convince_1 = require("./convince");
|
|
15
|
+
Object.defineProperty(exports, "convince", { enumerable: true, get: function () { return convince_1.convince; } });
|
|
16
|
+
Object.defineProperty(exports, "formatConvinceResults", { enumerable: true, get: function () { return convince_1.formatConvinceResults; } });
|
|
17
|
+
Object.defineProperty(exports, "formatConvinceResultsJSON", { enumerable: true, get: function () { return convince_1.formatConvinceResultsJSON; } });
|
|
18
|
+
var briefs_1 = require("./briefs");
|
|
19
|
+
Object.defineProperty(exports, "SAMPLE_BRIEFS", { enumerable: true, get: function () { return briefs_1.SAMPLE_BRIEFS; } });
|
|
20
|
+
Object.defineProperty(exports, "getBriefById", { enumerable: true, get: function () { return briefs_1.getBriefById; } });
|
|
21
|
+
Object.defineProperty(exports, "getBriefsByVertical", { enumerable: true, get: function () { return briefs_1.getBriefsByVertical; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAwF;AAA/E,gGAAA,MAAM,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AAAE,qHAAA,2BAA2B,OAAA;AAGrE,uCAAwF;AAA/E,oGAAA,QAAQ,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAAE,qHAAA,yBAAyB,OAAA;AAGnE,mCAA4E;AAAnE,uGAAA,aAAa,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,6GAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for AdCP Agent Compliance Assessment
|
|
3
|
+
*
|
|
4
|
+
* comply → "Your agent works" (deterministic, pass/fail)
|
|
5
|
+
* convince → "Your agent sells" (AI-assessed, advisory)
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentProfile, TestResult, TestScenario } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Capability tracks are independent areas of protocol compliance.
|
|
10
|
+
* An agent can be strong in creative but skip media buy — tracks
|
|
11
|
+
* are assessed independently, not as linear levels.
|
|
12
|
+
*/
|
|
13
|
+
export type ComplianceTrack = 'core' | 'products' | 'media_buy' | 'creative' | 'reporting' | 'governance' | 'signals' | 'si' | 'audiences';
|
|
14
|
+
export type TrackStatus = 'pass' | 'fail' | 'skip' | 'partial';
|
|
15
|
+
export interface TrackResult {
|
|
16
|
+
track: ComplianceTrack;
|
|
17
|
+
status: TrackStatus;
|
|
18
|
+
/** Human-readable label for this track */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Scenarios that were run for this track */
|
|
21
|
+
scenarios: TestResult[];
|
|
22
|
+
/** Scenarios skipped (agent doesn't support required tools) */
|
|
23
|
+
skipped_scenarios: TestScenario[];
|
|
24
|
+
/** Advisory observations collected during this track */
|
|
25
|
+
observations: AdvisoryObservation[];
|
|
26
|
+
/** Total time for this track */
|
|
27
|
+
duration_ms: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ComplianceResult {
|
|
30
|
+
agent_url: string;
|
|
31
|
+
agent_profile: AgentProfile;
|
|
32
|
+
/** Per-track results — every applicable track is run */
|
|
33
|
+
tracks: TrackResult[];
|
|
34
|
+
/** Quick summary: how many tracks pass/fail/skip */
|
|
35
|
+
summary: ComplianceSummary;
|
|
36
|
+
/** Advisory observations across all tracks */
|
|
37
|
+
observations: AdvisoryObservation[];
|
|
38
|
+
tested_at: string;
|
|
39
|
+
total_duration_ms: number;
|
|
40
|
+
dry_run: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ComplianceSummary {
|
|
43
|
+
tracks_passed: number;
|
|
44
|
+
tracks_failed: number;
|
|
45
|
+
tracks_skipped: number;
|
|
46
|
+
tracks_partial: number;
|
|
47
|
+
/** One-line status */
|
|
48
|
+
headline: string;
|
|
49
|
+
}
|
|
50
|
+
export type ObservationCategory = 'completeness' | 'quality' | 'performance' | 'best_practice' | 'merchandising' | 'pricing' | 'relevance' | 'auth';
|
|
51
|
+
export type ObservationSeverity = 'info' | 'suggestion' | 'warning' | 'error';
|
|
52
|
+
export interface AdvisoryObservation {
|
|
53
|
+
category: ObservationCategory;
|
|
54
|
+
severity: ObservationSeverity;
|
|
55
|
+
track?: ComplianceTrack;
|
|
56
|
+
message: string;
|
|
57
|
+
/** Concrete data backing this observation */
|
|
58
|
+
evidence?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export interface SampleBrief {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
vertical: string;
|
|
64
|
+
brief: string;
|
|
65
|
+
/** What a strong response looks like — guides AI evaluation */
|
|
66
|
+
evaluation_hints: string;
|
|
67
|
+
/** Budget context for the AI evaluator */
|
|
68
|
+
budget_context?: string;
|
|
69
|
+
/** Expected channels */
|
|
70
|
+
expected_channels?: string[];
|
|
71
|
+
}
|
|
72
|
+
export type ConvinceDimension = 'relevance' | 'specificity' | 'completeness' | 'pricing' | 'merchandising';
|
|
73
|
+
export type ConvinceRating = 'strong' | 'moderate' | 'weak';
|
|
74
|
+
export interface DimensionScore {
|
|
75
|
+
dimension: ConvinceDimension;
|
|
76
|
+
rating: ConvinceRating;
|
|
77
|
+
observation: string;
|
|
78
|
+
evidence?: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
export interface ScenarioAssessment {
|
|
81
|
+
brief: SampleBrief;
|
|
82
|
+
/** Raw products returned by the agent */
|
|
83
|
+
products_returned: number;
|
|
84
|
+
/** Per-dimension AI evaluation */
|
|
85
|
+
dimensions: DimensionScore[];
|
|
86
|
+
/** LLM-generated narrative summary */
|
|
87
|
+
summary: string;
|
|
88
|
+
/** Top 3 actionable improvements */
|
|
89
|
+
top_actions: string[];
|
|
90
|
+
/** Raw agent response for reference */
|
|
91
|
+
raw_response?: unknown;
|
|
92
|
+
}
|
|
93
|
+
export interface ConvinceResult {
|
|
94
|
+
agent_url: string;
|
|
95
|
+
agent_profile: AgentProfile;
|
|
96
|
+
/** Per-brief assessments */
|
|
97
|
+
assessments: ScenarioAssessment[];
|
|
98
|
+
/** Aggregated patterns across all briefs */
|
|
99
|
+
patterns: ConvincePattern[];
|
|
100
|
+
/** Overall narrative */
|
|
101
|
+
overall_summary: string;
|
|
102
|
+
tested_at: string;
|
|
103
|
+
total_duration_ms: number;
|
|
104
|
+
/** Which LLM provider was used */
|
|
105
|
+
evaluator: string;
|
|
106
|
+
dry_run: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface ConvincePattern {
|
|
109
|
+
pattern: string;
|
|
110
|
+
frequency: string;
|
|
111
|
+
impact: string;
|
|
112
|
+
}
|
|
113
|
+
export interface ConvinceOptions {
|
|
114
|
+
/** Anthropic API key */
|
|
115
|
+
anthropic_api_key?: string;
|
|
116
|
+
/** Google Gemini API key */
|
|
117
|
+
gemini_api_key?: string;
|
|
118
|
+
/** Which briefs to run (default: all) */
|
|
119
|
+
brief_ids?: string[];
|
|
120
|
+
/** Model to use (default: auto-select based on available key) */
|
|
121
|
+
model?: string;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/types.ts"],"names":[],"mapp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AAE,CAAC;IAC7B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,YAAY,CAAC;IAC5B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,4CAA4C;IAC5C,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,wBAAwB;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for AdCP Agent Compliance Assessment
|
|
4
|
+
*
|
|
5
|
+
* comply → "Your agent works" (deterministic, pass/fail)
|
|
6
|
+
* convince → "Your agent sells" (AI-assessed, advisory)
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, } from './test-helpers';
|
|
2
2
|
export { testAgent as runAgentTests, formatTestResults, formatTestResultsJSON, formatTestResultsSummary, setAgentTesterLogger, getLogger, createTestClient, runStep, testHealthCheck, testDiscovery, testCreateMediaBuy, testFullSalesFlow, testCreativeSync, testCreativeInline, testCreativeFlow, testSignalsFlow, testErrorHandling, testValidation, testPricingEdgeCases, testTemporalValidation, testBehaviorAnalysis, testResponseConsistency, testGovernancePropertyLists, testGovernanceContentStandards, testPropertyListFilters, testSISessionLifecycle, testSIAvailability, testSIHandoff, testCapabilityDiscovery, testSyncAudiences, resolveAccountForAudiences, testSchemaCompliance, hasGovernanceTools, hasSITools, likelySupportsV3, testAllScenarios, getApplicableScenarios, SCENARIO_REQUIREMENTS, DEFAULT_SCENARIOS, formatSuiteResults, formatSuiteResultsJSON, type TestScenario, type TestOptions, type OrchestratorOptions, type TestResult, type SuiteResult, type TestStepResult, type AgentProfile, type TaskResult, type Logger, } from './agent-tester';
|
|
3
|
+
export { comply, formatComplianceResults, formatComplianceResultsJSON, convince, formatConvinceResults, formatConvinceResultsJSON, SAMPLE_BRIEFS, getBriefById, getBriefsByVertical, type ComplyOptions, type FullConvinceOptions, type ComplianceTrack, type TrackResult, type TrackStatus, type ComplianceResult, type ComplianceSummary, type AdvisoryObservation, type SampleBrief, type ConvinceDimension, type ConvinceRating, type DimensionScore, type ScenarioAssessment, type ConvinceResult, type ConvincePattern, type ConvinceOptions, } from './compliance';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAE7B,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,OAAO,EAEP,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EAEvB,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EAEpB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAEhB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EAEtB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,GACZ,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,e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