@adcp/sdk 5.24.0 → 5.25.1
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/dist/lib/conformance/runners.d.ts.map +1 -1
- package/dist/lib/conformance/runners.js +13 -1
- package/dist/lib/conformance/runners.js.map +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +22 -7
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +4 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +9 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protocols/index.d.ts +11 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +91 -18
- 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 +45 -3
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/server/create-adcp-server.d.ts +13 -0
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +183 -2
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/testing/orchestrator.d.ts.map +1 -1
- package/dist/lib/testing/orchestrator.js +7 -4
- package/dist/lib/testing/orchestrator.js.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js +131 -97
- package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +80 -4
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/types/adcp.d.ts.map +1 -1
- package/dist/lib/types/adcp.js +1 -0
- package/dist/lib/types/adcp.js.map +1 -1
- package/dist/lib/utils/capabilities.d.ts +20 -1
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +13 -0
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/utils/error-extraction.d.ts +30 -0
- package/dist/lib/utils/error-extraction.d.ts.map +1 -1
- package/dist/lib/utils/error-extraction.js +61 -0
- package/dist/lib/utils/error-extraction.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/lib/testing/orchestrator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/lib/testing/orchestrator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA6KH,wDAGC;AAiBD,4CA2DC;AAKD,gDA0CC;AAKD,wDAEC;AAhTD,iDAA2C;AAC3C,qCAA2G;AAG3G;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAA4C;IAC5E,oBAAoB;IACpB,YAAY,EAAE,EAAE;IAChB,SAAS,EAAE,EAAE;IACb,oBAAoB,EAAE,EAAE;IAExB,gCAAgC;IAChC,gBAAgB,EAAE,CAAC,cAAc,EAAE,kBAAkB,CAAC;IACtD,eAAe,EAAE,CAAC,cAAc,EAAE,kBAAkB,CAAC;IACrD,cAAc,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,CAAC;IAC9E,eAAe,EAAE,CAAC,cAAc,EAAE,kBAAkB,CAAC;IACrD,kBAAkB,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;IAC5F,mBAAmB,EAAE,CAAC,cAAc,EAAE,kBAAkB,CAAC;IACzD,aAAa,EAAE,CAAC,gBAAgB,CAAC;IAEjC,wBAAwB;IACxB,kBAAkB,EAAE,CAAC,cAAc,CAAC;IACpC,cAAc,EA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C,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-compliance.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/schema-compliance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"schema-compliance.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/schema-compliance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AA0BtF,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CAmP9D"}
|
|
@@ -43,119 +43,153 @@ async function testSchemaCompliance(agentUrl, options) {
|
|
|
43
43
|
if (!profileStep.passed) {
|
|
44
44
|
return { steps, profile };
|
|
45
45
|
}
|
|
46
|
-
if (!profile.tools.includes('get_products')) {
|
|
46
|
+
if (!profile.tools.includes('get_products') && !profile.tools.includes('get_signals')) {
|
|
47
|
+
// Path A: no supported discovery tool — skip field-shape checks gracefully
|
|
47
48
|
steps.push({
|
|
48
49
|
step: 'Schema compliance check support',
|
|
49
|
-
passed:
|
|
50
|
+
passed: true,
|
|
50
51
|
duration_ms: 0,
|
|
51
|
-
|
|
52
|
+
details: 'Agent does not advertise get_products or get_signals — discovery field-shape checks skipped',
|
|
53
|
+
warnings: ['Schema compliance: no supported discovery tool (get_products, get_signals) found; checks skipped'],
|
|
52
54
|
});
|
|
53
|
-
|
|
55
|
+
// Fall through to list_creative_formats check below
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
steps.push((0, client_1.validateResponseSchema)('get_products', data));
|
|
72
|
-
if (products.length === 0) {
|
|
57
|
+
else if (profile.tools.includes('get_signals') && !profile.tools.includes('get_products')) {
|
|
58
|
+
// Path B: signals agent — validate GetSignalsResponse schema and field semantics
|
|
59
|
+
const { result: signalsResult, step: signalsStep } = await (0, client_1.runStep)('Get signals (schema compliance)', 'get_signals', async () => client.getSignals({
|
|
60
|
+
signal_spec: options.brief || 'Schema compliance test — retrieve all available signals',
|
|
61
|
+
}));
|
|
62
|
+
if (!signalsResult?.success || !signalsResult?.data) {
|
|
63
|
+
signalsStep.passed = false;
|
|
64
|
+
signalsStep.error = signalsResult?.error || 'get_signals returned no data';
|
|
65
|
+
steps.push(signalsStep);
|
|
66
|
+
return { steps, profile };
|
|
67
|
+
}
|
|
68
|
+
steps.push(signalsStep);
|
|
69
|
+
const signalsData = signalsResult.data;
|
|
70
|
+
// Zod schema validation covers required-field presence (signal_agent_segment_id, name, signal_type).
|
|
71
|
+
steps.push((0, client_1.validateResponseSchema)('get_signals', signalsData));
|
|
72
|
+
const signals = signalsData.signals ?? [];
|
|
73
73
|
steps.push({
|
|
74
|
-
step: '
|
|
74
|
+
step: 'Validate signal required fields',
|
|
75
75
|
passed: true,
|
|
76
76
|
duration_ms: 0,
|
|
77
|
-
details:
|
|
78
|
-
|
|
77
|
+
details: signals.length === 0
|
|
78
|
+
? 'Agent returned no signals — field-shape checks skipped'
|
|
79
|
+
: `${signals.length} signal(s) validated via schema check (signal_agent_segment_id, name, signal_type)`,
|
|
80
|
+
warnings: signals.length === 0
|
|
81
|
+
? ['No signals returned; cannot validate signal_agent_segment_id, name, signal_type fields']
|
|
82
|
+
: undefined,
|
|
79
83
|
});
|
|
80
|
-
|
|
84
|
+
// Fall through to list_creative_formats check below
|
|
81
85
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
else {
|
|
87
|
+
// Path C: get_products present — existing product catalog checks
|
|
88
|
+
const { result: productsResult, step: productsStep } = await (0, client_1.runStep)('Get products (schema compliance)', 'get_products', async () => client.getProducts({
|
|
89
|
+
buying_mode: 'brief',
|
|
90
|
+
brief: options.brief || 'Schema compliance test — retrieve all available products',
|
|
91
|
+
brand: options.brand,
|
|
92
|
+
}));
|
|
93
|
+
if (!productsResult?.success || !productsResult?.data) {
|
|
94
|
+
productsStep.passed = false;
|
|
95
|
+
productsStep.error = productsResult?.error || 'get_products returned no data';
|
|
96
|
+
steps.push(productsStep);
|
|
97
|
+
return { steps, profile };
|
|
91
98
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// probes fields that may not exist on the generated PricingOption union
|
|
117
|
-
const raw = option;
|
|
118
|
-
// Check for deprecated fixed_rate field
|
|
119
|
-
if ('fixed_rate' in raw) {
|
|
120
|
-
pricingIssues.push(`pricing_option ${optionId} uses deprecated "fixed_rate" — should be "fixed_price"`);
|
|
121
|
-
}
|
|
122
|
-
if ('fixed_price' in raw) {
|
|
123
|
-
fixedPriceFound = true;
|
|
124
|
-
pricingChecked.push(optionId);
|
|
125
|
-
}
|
|
126
|
-
// Check for floor_price inside price_guidance (deprecated location)
|
|
127
|
-
const pg = raw.price_guidance;
|
|
128
|
-
if (pg && 'floor' in pg) {
|
|
129
|
-
pricingIssues.push(`pricing_option ${optionId} has "floor" inside price_guidance — should be top-level "floor_price"`);
|
|
99
|
+
steps.push(productsStep);
|
|
100
|
+
const data = productsResult.data;
|
|
101
|
+
const products = data.products || [];
|
|
102
|
+
// --- Zod schema validation (catches missing required fields + invalid enum values) ---
|
|
103
|
+
steps.push((0, client_1.validateResponseSchema)('get_products', data));
|
|
104
|
+
if (products.length === 0) {
|
|
105
|
+
steps.push({
|
|
106
|
+
step: 'Schema compliance: no products to validate',
|
|
107
|
+
passed: true,
|
|
108
|
+
duration_ms: 0,
|
|
109
|
+
details: 'Agent returned no products — schema compliance checks skipped',
|
|
110
|
+
warnings: ['No products returned; cannot validate channel, pricing, or format field schemas'],
|
|
111
|
+
});
|
|
112
|
+
return { steps, profile };
|
|
113
|
+
}
|
|
114
|
+
// --- Channel enum validation (hard fail) ---
|
|
115
|
+
const invalidChannels = [];
|
|
116
|
+
const allChannels = new Set();
|
|
117
|
+
for (const product of products) {
|
|
118
|
+
for (const channel of product.channels || []) {
|
|
119
|
+
allChannels.add(channel);
|
|
120
|
+
if (!V3_CHANNELS.has(channel)) {
|
|
121
|
+
invalidChannels.push(`"${channel}" in product ${product.product_id}`);
|
|
122
|
+
}
|
|
130
123
|
}
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
}
|
|
125
|
+
steps.push({
|
|
126
|
+
step: 'Validate channel enum values',
|
|
127
|
+
passed: invalidChannels.length === 0,
|
|
128
|
+
duration_ms: 0,
|
|
129
|
+
details: invalidChannels.length === 0
|
|
130
|
+
? `All ${allChannels.size} channel value(s) are valid v3 channels: ${Array.from(allChannels).join(', ')}`
|
|
131
|
+
: `Invalid channel values detected (not in v3 taxonomy): ${invalidChannels.join('; ')}`,
|
|
132
|
+
error: invalidChannels.length > 0
|
|
133
|
+
? `Channel enum violations: ${invalidChannels.join('; ')}. Valid channels: ${Array.from(V3_CHANNELS).join(', ')}`
|
|
134
|
+
: undefined,
|
|
135
|
+
response_preview: JSON.stringify({
|
|
136
|
+
channels_found: Array.from(allChannels),
|
|
137
|
+
invalid_channels: invalidChannels,
|
|
138
|
+
}, null, 2),
|
|
139
|
+
});
|
|
140
|
+
// --- Pricing field name validation (warn, not fail) ---
|
|
141
|
+
const pricingIssues = [];
|
|
142
|
+
const pricingChecked = [];
|
|
143
|
+
let fixedPriceFound = false;
|
|
144
|
+
for (const product of products) {
|
|
145
|
+
for (const option of product.pricing_options || []) {
|
|
146
|
+
const optionId = option.pricing_option_id || '(unknown)';
|
|
147
|
+
// Cast to Record for deprecated-field checks — compliance testing intentionally
|
|
148
|
+
// probes fields that may not exist on the generated PricingOption union
|
|
149
|
+
const raw = option;
|
|
150
|
+
// Check for deprecated fixed_rate field
|
|
151
|
+
if ('fixed_rate' in raw) {
|
|
152
|
+
pricingIssues.push(`pricing_option ${optionId} uses deprecated "fixed_rate" — should be "fixed_price"`);
|
|
153
|
+
}
|
|
154
|
+
if ('fixed_price' in raw) {
|
|
155
|
+
fixedPriceFound = true;
|
|
156
|
+
pricingChecked.push(optionId);
|
|
157
|
+
}
|
|
158
|
+
// Check for floor_price inside price_guidance (deprecated location)
|
|
159
|
+
const pg = raw.price_guidance;
|
|
160
|
+
if (pg && 'floor' in pg) {
|
|
161
|
+
pricingIssues.push(`pricing_option ${optionId} has "floor" inside price_guidance — should be top-level "floor_price"`);
|
|
162
|
+
}
|
|
163
|
+
if ('floor_price' in raw) {
|
|
164
|
+
pricingChecked.push(`${optionId} (floor_price)`);
|
|
165
|
+
}
|
|
133
166
|
}
|
|
134
167
|
}
|
|
168
|
+
const pricingPassed = pricingIssues.length === 0;
|
|
169
|
+
const pricingDetails = pricingIssues.length > 0
|
|
170
|
+
? `Pricing field issues: ${pricingIssues.join('; ')}`
|
|
171
|
+
: fixedPriceFound
|
|
172
|
+
? `Pricing fields valid (checked ${pricingChecked.length} option(s))`
|
|
173
|
+
: 'No fixed-price products found to validate (agent may be auction-only — cannot confirm field names)';
|
|
174
|
+
steps.push({
|
|
175
|
+
step: 'Validate pricing field names',
|
|
176
|
+
passed: pricingPassed,
|
|
177
|
+
duration_ms: 0,
|
|
178
|
+
details: pricingDetails,
|
|
179
|
+
error: pricingIssues.length > 0 ? pricingIssues.join('; ') : undefined,
|
|
180
|
+
warnings: !fixedPriceFound && pricingIssues.length === 0
|
|
181
|
+
? [
|
|
182
|
+
'No fixed-price products found. If agent supports fixed pricing, verify it uses "fixed_price" (not "fixed_rate") and "floor_price" at the pricing option level (not inside price_guidance).',
|
|
183
|
+
]
|
|
184
|
+
: undefined,
|
|
185
|
+
response_preview: JSON.stringify({
|
|
186
|
+
issues: pricingIssues,
|
|
187
|
+
options_checked: pricingChecked,
|
|
188
|
+
}, null, 2),
|
|
189
|
+
});
|
|
135
190
|
}
|
|
136
|
-
const pricingPassed = pricingIssues.length === 0;
|
|
137
|
-
const pricingDetails = pricingIssues.length > 0
|
|
138
|
-
? `Pricing field issues: ${pricingIssues.join('; ')}`
|
|
139
|
-
: fixedPriceFound
|
|
140
|
-
? `Pricing fields valid (checked ${pricingChecked.length} option(s))`
|
|
141
|
-
: 'No fixed-price products found to validate (agent may be auction-only — cannot confirm field names)';
|
|
142
|
-
steps.push({
|
|
143
|
-
step: 'Validate pricing field names',
|
|
144
|
-
passed: pricingPassed,
|
|
145
|
-
duration_ms: 0,
|
|
146
|
-
details: pricingDetails,
|
|
147
|
-
error: pricingIssues.length > 0 ? pricingIssues.join('; ') : undefined,
|
|
148
|
-
warnings: !fixedPriceFound && pricingIssues.length === 0
|
|
149
|
-
? [
|
|
150
|
-
'No fixed-price products found. If agent supports fixed pricing, verify it uses "fixed_price" (not "fixed_rate") and "floor_price" at the pricing option level (not inside price_guidance).',
|
|
151
|
-
]
|
|
152
|
-
: undefined,
|
|
153
|
-
response_preview: JSON.stringify({
|
|
154
|
-
issues: pricingIssues,
|
|
155
|
-
options_checked: pricingChecked,
|
|
156
|
-
}, null, 2),
|
|
157
|
-
});
|
|
158
191
|
// --- Format assets structure (optional: list_creative_formats) ---
|
|
192
|
+
// Runs for all agent types that advertise list_creative_formats, regardless of discovery path
|
|
159
193
|
if (profile.tools.includes('list_creative_formats')) {
|
|
160
194
|
const { result: formatsResult, step: formatsStep } = await (0, client_1.runStep)('Get creative formats (check assets structure)', 'list_creative_formats', async () => client.listCreativeFormats({}));
|
|
161
195
|
if (formatsResult?.success && formatsResult?.data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-compliance.js","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/schema-compliance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;
|
|
1
|
+
{"version":3,"file":"schema-compliance.js","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/schema-compliance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAmCH,oDAsPC;AA/QD,sCAAqG;AAErG,oCAAoC;AACpC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,SAAS;IACT,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,WAAW;IACX,OAAO;IACP,iBAAiB;IACjB,SAAS;IACT,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,WAAW;IACX,mBAAmB;CACpB,CAAC,CAAC;AAEI,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,OAAoB;IAEpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,0BAAiB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEpD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,6BAAoB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnF,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAExB,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,EAAE,KAAK,E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C,MAAM,EAAE,qBAAqB,EAAE,GAC9B,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAC,CA0B9G;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,uBAAuB,CA4BlG;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,CAiE/B;AAs7BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwCzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,cAAc,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AA8OD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,iBAAsB,GAC9B,qBAAqB,GAAG,SAAS,CAgBnC"}
|
|
@@ -383,6 +383,63 @@ function buildCapabilityUnsupportedResult(agentUrls, storyboard, detail) {
|
|
|
383
383
|
},
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* Build a minimal StoryboardResult for a storyboard skipped because the agent
|
|
388
|
+
* does not advertise any of the tools listed in `required_tools`. The result
|
|
389
|
+
* carries `skip_reason: 'missing_tool'` and `overall_passed: true` so CLI
|
|
390
|
+
* reports and JUnit consumers render it as a skip, not a failure.
|
|
391
|
+
*
|
|
392
|
+
* `missing_tool` (not `not_applicable`) is the correct canonical reason here:
|
|
393
|
+
* the agent declared a compatible protocol/specialism but lacks the specific
|
|
394
|
+
* tools this storyboard exercises — distinct from a protocol/version mismatch.
|
|
395
|
+
*/
|
|
396
|
+
function buildRequiredToolsMissingResult(agentUrls, storyboard, detail) {
|
|
397
|
+
return {
|
|
398
|
+
storyboard_id: storyboard.id,
|
|
399
|
+
storyboard_title: storyboard.title,
|
|
400
|
+
agent_url: agentUrls[0],
|
|
401
|
+
overall_passed: true,
|
|
402
|
+
phases: [
|
|
403
|
+
{
|
|
404
|
+
phase_id: 'missing_tool',
|
|
405
|
+
phase_title: 'Skipped — required tools not advertised',
|
|
406
|
+
passed: true,
|
|
407
|
+
duration_ms: 0,
|
|
408
|
+
steps: [
|
|
409
|
+
{
|
|
410
|
+
storyboard_id: storyboard.id,
|
|
411
|
+
step_id: 'missing_tool',
|
|
412
|
+
phase_id: 'missing_tool',
|
|
413
|
+
title: `Skipped — ${detail}`,
|
|
414
|
+
task: '',
|
|
415
|
+
passed: true,
|
|
416
|
+
skipped: true,
|
|
417
|
+
skip_reason: 'missing_tool',
|
|
418
|
+
skip: { reason: 'missing_tool', detail },
|
|
419
|
+
duration_ms: 0,
|
|
420
|
+
validations: [],
|
|
421
|
+
context: {},
|
|
422
|
+
extraction: { path: 'none' },
|
|
423
|
+
},
|
|
424
|
+
],
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
context: {},
|
|
428
|
+
total_duration_ms: 0,
|
|
429
|
+
passed_count: 0,
|
|
430
|
+
failed_count: 0,
|
|
431
|
+
skipped_count: 1,
|
|
432
|
+
tested_at: new Date().toISOString(),
|
|
433
|
+
strict_validation_summary: {
|
|
434
|
+
observable: false,
|
|
435
|
+
checked: 0,
|
|
436
|
+
passed: 0,
|
|
437
|
+
failed: 0,
|
|
438
|
+
strict_only_failures: 0,
|
|
439
|
+
lenient_also_failed: 0,
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
}
|
|
386
443
|
/**
|
|
387
444
|
* Execute a single pass of the storyboard against the supplied replica URLs
|
|
388
445
|
* using round-robin dispatch starting at `dispatchOffset`. Called directly
|
|
@@ -439,6 +496,25 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
439
496
|
}
|
|
440
497
|
}
|
|
441
498
|
}
|
|
499
|
+
// Enforce required_tools pre-flight gate: if the storyboard declares tools
|
|
500
|
+
// that make it applicable (at least one must be present) and the agent
|
|
501
|
+
// advertises none of them, skip the whole storyboard instead of producing
|
|
502
|
+
// misleading per-step failures.
|
|
503
|
+
//
|
|
504
|
+
// Gate condition: `options.agentTools` is falsy when the caller set
|
|
505
|
+
// `options._client` without also supplying `agentTools`. In that case the
|
|
506
|
+
// gate is a no-op — the caller accepted responsibility for tool compatibility
|
|
507
|
+
// by reusing an external client. The comply() path always populates
|
|
508
|
+
// `agentTools` before calling runStoryboard(), so the gate is always active
|
|
509
|
+
// in the standard runner flow.
|
|
510
|
+
if (storyboard.required_tools?.length && options.agentTools) {
|
|
511
|
+
const hasAnyRequired = storyboard.required_tools.some(t => options.agentTools.includes(t));
|
|
512
|
+
if (!hasAnyRequired) {
|
|
513
|
+
if (!options._client)
|
|
514
|
+
await (0, protocols_1.closeConnections)(options.protocol);
|
|
515
|
+
return buildRequiredToolsMissingResult(agentUrls, storyboard, `agent does not advertise any of [${storyboard.required_tools.join(', ')}]`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
442
518
|
let context = { ...options.context };
|
|
443
519
|
if (options.context)
|
|
444
520
|
(0, context_1.forwardAliasCache)(options.context, context);
|
|
@@ -862,10 +938,10 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
862
938
|
// Overall pass requires (a) no required-phase failures AND (b) at least one
|
|
863
939
|
// required phase actually passed with at least one non-skipped step AND
|
|
864
940
|
// (c) no assertion failures. Without (b) a storyboard where every phase is
|
|
865
|
-
// marked optional and every required phase's steps are skipped
|
|
866
|
-
//
|
|
867
|
-
// assertions gating — a run with all validations green but a
|
|
868
|
-
// invariant broken is not conformant.
|
|
941
|
+
// marked optional and every required phase's steps are individually skipped
|
|
942
|
+
// (e.g. all steps have requires_tool and none matched) would pass vacuously.
|
|
943
|
+
// (c) makes assertions gating — a run with all validations green but a
|
|
944
|
+
// cross-step invariant broken is not conformant.
|
|
869
945
|
// When no phases had executable steps the storyboard result is a skip, not a
|
|
870
946
|
// failure. The index-aligned guard below would hit storyboard.phases[0] ===
|
|
871
947
|
// undefined for an empty-phases storyboard and force requiredPhasesPassed to
|