@adcp/sdk 13.0.4 → 13.1.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/bin/adcp-grade.js +4 -3
- package/bin/adcp.js +18 -0
- package/dist/lib/conformance/invariants/uniformError.d.ts.map +1 -1
- package/dist/lib/conformance/invariants/uniformError.js +21 -0
- package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
- package/dist/lib/conformance/invariants/uniformError.mjs +22 -1
- package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
- package/dist/lib/core/AgentClient.d.mts +1 -1
- package/dist/lib/core/AgentClient.d.ts +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AgentClient.js +1 -1
- package/dist/lib/core/AgentClient.js.map +1 -1
- package/dist/lib/core/AgentClient.mjs +1 -1
- package/dist/lib/core/AgentClient.mjs.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +88 -48
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +88 -48
- package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +8 -4
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/core/TaskExecutor.mjs +8 -4
- package/dist/lib/core/TaskExecutor.mjs.map +1 -1
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/net/agent-transport-fetch.d.mts +15 -0
- package/dist/lib/net/agent-transport-fetch.d.ts +15 -0
- package/dist/lib/net/agent-transport-fetch.d.ts.map +1 -1
- package/dist/lib/net/agent-transport-fetch.js +37 -2
- package/dist/lib/net/agent-transport-fetch.js.map +1 -1
- package/dist/lib/net/agent-transport-fetch.mjs +37 -2
- package/dist/lib/net/agent-transport-fetch.mjs.map +1 -1
- package/dist/lib/net/credential-headers.d.mts +1 -0
- package/dist/lib/net/credential-headers.d.ts +2 -0
- package/dist/lib/net/credential-headers.d.ts.map +1 -0
- package/dist/lib/net/credential-headers.js +34 -0
- package/dist/lib/net/credential-headers.js.map +1 -0
- package/dist/lib/net/credential-headers.mjs +10 -0
- package/dist/lib/net/credential-headers.mjs.map +1 -0
- package/dist/lib/protocols/a2a-native-v1.d.mts +18 -0
- package/dist/lib/protocols/a2a-native-v1.d.ts +19 -0
- package/dist/lib/protocols/a2a-native-v1.d.ts.map +1 -0
- package/dist/lib/protocols/a2a-native-v1.js +183 -0
- package/dist/lib/protocols/a2a-native-v1.js.map +1 -0
- package/dist/lib/protocols/a2a-native-v1.mjs +167 -0
- package/dist/lib/protocols/a2a-native-v1.mjs.map +1 -0
- package/dist/lib/protocols/a2a-push-notification.d.mts +13 -0
- package/dist/lib/protocols/a2a-push-notification.d.ts +14 -0
- package/dist/lib/protocols/a2a-push-notification.d.ts.map +1 -0
- package/dist/lib/protocols/a2a-push-notification.js +42 -0
- package/dist/lib/protocols/a2a-push-notification.js.map +1 -0
- package/dist/lib/protocols/a2a-push-notification.mjs +23 -0
- package/dist/lib/protocols/a2a-push-notification.mjs.map +1 -0
- package/dist/lib/protocols/a2a.d.mts +15 -5
- package/dist/lib/protocols/a2a.d.ts +15 -5
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +102 -13
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/a2a.mjs +90 -12
- package/dist/lib/protocols/a2a.mjs.map +1 -1
- package/dist/lib/protocols/index.d.mts +3 -0
- package/dist/lib/protocols/index.d.ts +3 -0
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +18 -6
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/index.mjs +18 -6
- package/dist/lib/protocols/index.mjs.map +1 -1
- package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-modern.js +3 -1
- package/dist/lib/protocols/mcp-modern.js.map +1 -1
- package/dist/lib/protocols/mcp-modern.mjs +3 -1
- package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
- package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-tasks.js +2 -1
- package/dist/lib/protocols/mcp-tasks.js.map +1 -1
- package/dist/lib/protocols/mcp-tasks.mjs +2 -1
- package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
- package/dist/lib/protocols/mcp.d.mts +8 -5
- package/dist/lib/protocols/mcp.d.ts +8 -5
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +12 -4
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/protocols/mcp.mjs +12 -4
- package/dist/lib/protocols/mcp.mjs.map +1 -1
- package/dist/lib/protocols/rawResponseCapture.d.mts +9 -1
- package/dist/lib/protocols/rawResponseCapture.d.ts +9 -1
- package/dist/lib/protocols/rawResponseCapture.d.ts.map +1 -1
- package/dist/lib/protocols/rawResponseCapture.js +153 -10
- package/dist/lib/protocols/rawResponseCapture.js.map +1 -1
- package/dist/lib/protocols/rawResponseCapture.mjs +153 -10
- package/dist/lib/protocols/rawResponseCapture.mjs.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/signing/agent-fetch.d.mts +3 -1
- package/dist/lib/signing/agent-fetch.d.ts +3 -1
- package/dist/lib/signing/agent-fetch.d.ts.map +1 -1
- package/dist/lib/signing/agent-fetch.js +4 -2
- package/dist/lib/signing/agent-fetch.js.map +1 -1
- package/dist/lib/signing/agent-fetch.mjs +4 -2
- package/dist/lib/signing/agent-fetch.mjs.map +1 -1
- package/dist/lib/signing/protocol-methods.d.mts +24 -0
- package/dist/lib/signing/protocol-methods.d.ts +25 -0
- package/dist/lib/signing/protocol-methods.d.ts.map +1 -0
- package/dist/lib/signing/protocol-methods.js +51 -0
- package/dist/lib/signing/protocol-methods.js.map +1 -0
- package/dist/lib/signing/protocol-methods.mjs +25 -0
- package/dist/lib/signing/protocol-methods.mjs.map +1 -0
- package/dist/lib/signing/types.d.mts +2 -0
- package/dist/lib/signing/types.d.ts +2 -0
- package/dist/lib/signing/types.d.ts.map +1 -1
- package/dist/lib/signing/types.js.map +1 -1
- package/dist/lib/signing/types.mjs.map +1 -1
- package/dist/lib/signing/verifier.d.ts.map +1 -1
- package/dist/lib/signing/verifier.js +6 -2
- package/dist/lib/signing/verifier.js.map +1 -1
- package/dist/lib/signing/verifier.mjs +6 -2
- package/dist/lib/signing/verifier.mjs.map +1 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +4 -1
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/client.mjs +4 -1
- package/dist/lib/testing/client.mjs.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +3 -0
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/comply.mjs +3 -0
- package/dist/lib/testing/compliance/comply.mjs.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.d.mts +3 -1
- package/dist/lib/testing/storyboard/agent-routing.d.ts +3 -1
- package/dist/lib/testing/storyboard/agent-routing.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.js +5 -2
- package/dist/lib/testing/storyboard/agent-routing.js.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.mjs +4 -2
- package/dist/lib/testing/storyboard/agent-routing.mjs.map +1 -1
- package/dist/lib/testing/storyboard/compliance.d.mts +1 -1
- package/dist/lib/testing/storyboard/compliance.d.ts +1 -1
- package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/compliance.js +4 -1
- package/dist/lib/testing/storyboard/compliance.js.map +1 -1
- package/dist/lib/testing/storyboard/compliance.mjs +4 -1
- package/dist/lib/testing/storyboard/compliance.mjs.map +1 -1
- package/dist/lib/testing/storyboard/native-a2a-compliance.d.mts +7 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.d.ts +8 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.js +45 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.js.map +1 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.mjs +21 -0
- package/dist/lib/testing/storyboard/native-a2a-compliance.mjs.map +1 -0
- package/dist/lib/testing/storyboard/probes.d.mts +2 -0
- package/dist/lib/testing/storyboard/probes.d.ts +2 -0
- package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/probes.js +3 -2
- package/dist/lib/testing/storyboard/probes.js.map +1 -1
- package/dist/lib/testing/storyboard/probes.mjs +3 -2
- package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.d.mts +31 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.d.ts +32 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.js +279 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.js.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.mjs +244 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.mjs.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/builder.d.mts +4 -1
- package/dist/lib/testing/storyboard/request-signing/builder.d.ts +4 -1
- package/dist/lib/testing/storyboard/request-signing/builder.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/builder.js +19 -0
- package/dist/lib/testing/storyboard/request-signing/builder.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +19 -0
- package/dist/lib/testing/storyboard/request-signing/builder.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +5 -6
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +5 -6
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +82 -13
- package/dist/lib/testing/storyboard/request-signing/grader.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +86 -13
- package/dist/lib/testing/storyboard/request-signing/grader.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/index.d.mts +1 -0
- package/dist/lib/testing/storyboard/request-signing/index.d.ts +1 -0
- package/dist/lib/testing/storyboard/request-signing/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/index.js +7 -0
- package/dist/lib/testing/storyboard/request-signing/index.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/index.mjs +8 -0
- package/dist/lib/testing/storyboard/request-signing/index.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.mts +2 -2
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts +2 -2
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +6 -5
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +6 -5
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +1 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +1 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/types.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/types.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +1 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +1 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.mts +28 -1
- package/dist/lib/testing/storyboard/runner.d.ts +28 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +251 -55
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +255 -60
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/types.d.mts +4 -2
- package/dist/lib/testing/storyboard/types.d.ts +4 -2
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js +1 -0
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/types.mjs +1 -0
- package/dist/lib/testing/storyboard/types.mjs.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +97 -22
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.mjs +98 -22
- package/dist/lib/testing/storyboard/validations.mjs.map +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +1 -1
- package/docs/llms.txt +5 -3
- package/package.json +2 -1
|
@@ -30,9 +30,12 @@ __export(runner_exports, {
|
|
|
30
30
|
evaluateCapabilityPredicate: () => evaluateCapabilityPredicate,
|
|
31
31
|
getFirstStepPreview: () => getFirstStepPreview,
|
|
32
32
|
listStrictOnlyFailures: () => listStrictOnlyFailures,
|
|
33
|
+
normalizeCapturedA2AResult: () => normalizeCapturedA2AResult,
|
|
34
|
+
parseLastA2aMessageSendCapture: () => parseLastA2aMessageSendCapture,
|
|
33
35
|
resolveCapabilityPath: () => resolveCapabilityPath,
|
|
34
36
|
runStoryboard: () => runStoryboard,
|
|
35
37
|
runStoryboardStep: () => runStoryboardStep,
|
|
38
|
+
selectLastA2aSkillCapture: () => selectLastA2aSkillCapture,
|
|
36
39
|
summarizeStrictValidation: () => summarizeStrictValidation
|
|
37
40
|
});
|
|
38
41
|
module.exports = __toCommonJS(runner_exports);
|
|
@@ -67,6 +70,7 @@ var import_capabilities_types = require('../../signing/agent-resolver/capabiliti
|
|
|
67
70
|
var import_test_kit = require('./test-kit.js');
|
|
68
71
|
var import_loader = require('./loader.js');
|
|
69
72
|
var import_provenance = require('./provenance.js');
|
|
73
|
+
var import_native_a2a_compliance = require('./native-a2a-compliance.js');
|
|
70
74
|
var import_probe_dispatch = require('./request-signing/probe-dispatch.js');
|
|
71
75
|
var import_webhook_receiver = require('./webhook-receiver.js');
|
|
72
76
|
var import_webhook_assertions = require('./webhook-assertions.js');
|
|
@@ -160,6 +164,7 @@ function selectionForProbeSkip(reason, detail) {
|
|
|
160
164
|
return { reason: "explicit_scope_excluded", detail };
|
|
161
165
|
case "not_in_only_vectors":
|
|
162
166
|
case "mcp_mode_flattens_url_edges":
|
|
167
|
+
case "transport_flattens_url_edges":
|
|
163
168
|
case "capability_profile_mismatch":
|
|
164
169
|
case "transport_ungradable":
|
|
165
170
|
return { reason: "profile_excluded", detail };
|
|
@@ -591,12 +596,37 @@ function filterResponseHeaders(headers) {
|
|
|
591
596
|
}
|
|
592
597
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
593
598
|
}
|
|
599
|
+
function httpProbeResultFromCapture(capture) {
|
|
600
|
+
if (capture.bodyTruncated) {
|
|
601
|
+
return {
|
|
602
|
+
url: capture.url,
|
|
603
|
+
status: capture.status,
|
|
604
|
+
headers: Object.fromEntries(Object.entries(capture.headers).map(([name, value]) => [name.toLowerCase(), value])),
|
|
605
|
+
body: null,
|
|
606
|
+
error: capture.bodyCaptureError ?? "Raw response capture was incomplete; storyboard validators cannot grade a partial response body"
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
const contentType = Object.entries(capture.headers).find(([name]) => name.toLowerCase() === "content-type")?.[1];
|
|
610
|
+
let body = capture.body;
|
|
611
|
+
if (contentType?.toLowerCase().includes("json") || /^[\s]*[{[]/.test(capture.body)) {
|
|
612
|
+
try {
|
|
613
|
+
body = JSON.parse(capture.body);
|
|
614
|
+
} catch {
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return {
|
|
618
|
+
url: capture.url,
|
|
619
|
+
status: capture.status,
|
|
620
|
+
headers: Object.fromEntries(Object.entries(capture.headers).map(([name, value]) => [name.toLowerCase(), value])),
|
|
621
|
+
body
|
|
622
|
+
};
|
|
623
|
+
}
|
|
594
624
|
async function runStoryboard(agentUrlOrUrls, storyboard, options = {}) {
|
|
595
625
|
return (0, import_protocols.withMCPConnectionScope)(
|
|
596
626
|
async () => {
|
|
597
627
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
598
628
|
options = (0, import_test_kit.resolveDeclaredTestKit)(storyboard, options);
|
|
599
|
-
options =
|
|
629
|
+
options = (0, import_native_a2a_compliance.applyNativeA2AComplianceTransportOptions)(options);
|
|
600
630
|
const schemaRoot = getRunSchemaRoot(options);
|
|
601
631
|
if (schemaRoot) {
|
|
602
632
|
return await (0, import_schema_loader.withExternalSchemaRoot)(
|
|
@@ -1640,7 +1670,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1640
1670
|
}
|
|
1641
1671
|
}
|
|
1642
1672
|
}
|
|
1643
|
-
const buildExecutionState = (agentUrl = agentUrls[0], agentProfile = profile) => ({
|
|
1673
|
+
const buildExecutionState = (agentUrl = agentUrls[0], agentProfile = profile, effectiveOptions = options) => ({
|
|
1644
1674
|
contributions,
|
|
1645
1675
|
priorStepResults,
|
|
1646
1676
|
priorProbes,
|
|
@@ -1652,6 +1682,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1652
1682
|
stepRequestStarts,
|
|
1653
1683
|
responseDerivedNotApplicableContextKeys,
|
|
1654
1684
|
agentProfile,
|
|
1685
|
+
effectiveOptions,
|
|
1655
1686
|
agentLibraryVersion: agentProfile?.library_version,
|
|
1656
1687
|
storyboardRequiresRequestSigner: allRequires.includes("request_signer"),
|
|
1657
1688
|
storyboardRequiresPublisherAuthRunner: storyboard.requires?.includes("trusted_match_publisher_auth_runner") === true,
|
|
@@ -1890,7 +1921,11 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1890
1921
|
phasePassed = false;
|
|
1891
1922
|
continue;
|
|
1892
1923
|
}
|
|
1893
|
-
const stepExecutionState = buildExecutionState(
|
|
1924
|
+
const stepExecutionState = buildExecutionState(
|
|
1925
|
+
assignment.agentUrl,
|
|
1926
|
+
assignment.profile,
|
|
1927
|
+
assignment.effectiveOptions ?? options
|
|
1928
|
+
);
|
|
1894
1929
|
const rawResult = await executeStep(
|
|
1895
1930
|
assignment.client,
|
|
1896
1931
|
step,
|
|
@@ -2427,6 +2462,7 @@ async function runStoryboardStep(agentUrl, storyboard, stepId, options = {}) {
|
|
|
2427
2462
|
(0, import_loader.validateStoryboardShape)(storyboard);
|
|
2428
2463
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
2429
2464
|
options = (0, import_test_kit.resolveDeclaredTestKit)(storyboard, options);
|
|
2465
|
+
options = (0, import_native_a2a_compliance.applyNativeA2AComplianceTransportOptions)(options);
|
|
2430
2466
|
const schemaRoot = getRunSchemaRoot(options);
|
|
2431
2467
|
if (schemaRoot) {
|
|
2432
2468
|
return await (0, import_schema_loader.withExternalSchemaRoot)(
|
|
@@ -2551,14 +2587,21 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2551
2587
|
stepRequestStarts: /* @__PURE__ */ new Map(),
|
|
2552
2588
|
responseDerivedNotApplicableContextKeys: /* @__PURE__ */ new Map()
|
|
2553
2589
|
};
|
|
2590
|
+
const effectiveOptions = runState.effectiveOptions ?? options;
|
|
2591
|
+
const effectiveProbeOptions = runState.agentProfile ? {
|
|
2592
|
+
...effectiveOptions,
|
|
2593
|
+
profile: runState.agentProfile,
|
|
2594
|
+
_profile: runState.agentProfile,
|
|
2595
|
+
agentTools: effectiveOptions.agentTools ?? normalizeAgentToolNames(runState.agentProfile.tools)
|
|
2596
|
+
} : effectiveOptions;
|
|
2554
2597
|
if (import_trusted_match_publisher_auth.TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(step.task)) {
|
|
2555
2598
|
if (runState.storyboardRequiresPublisherAuthRunner !== true) {
|
|
2556
2599
|
return invalidTrustedMatchPublisherAuthTask(step, phaseId, context, allSteps, runState);
|
|
2557
2600
|
}
|
|
2558
|
-
return executeProbeStep(client, step, phaseId, context, allSteps,
|
|
2601
|
+
return executeProbeStep(client, step, phaseId, context, allSteps, effectiveProbeOptions, runState);
|
|
2559
2602
|
}
|
|
2560
2603
|
if (import_probes.PROBE_TASKS.has(step.task)) {
|
|
2561
|
-
return executeProbeStep(client, step, phaseId, context, allSteps,
|
|
2604
|
+
return executeProbeStep(client, step, phaseId, context, allSteps, effectiveProbeOptions, runState);
|
|
2562
2605
|
}
|
|
2563
2606
|
if (import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(step.task)) {
|
|
2564
2607
|
return (0, import_webhook_assertions.executeWebhookAssertionStep)(step, phaseId, context, allSteps, options, runState);
|
|
@@ -2777,7 +2820,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2777
2820
|
next: next2,
|
|
2778
2821
|
...isPrerequisiteFailure ? { error: detail } : {},
|
|
2779
2822
|
request: {
|
|
2780
|
-
transport:
|
|
2823
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2781
2824
|
operation: effectiveStep.task,
|
|
2782
2825
|
payload: (0, import_redact_secrets.redactSecrets)(request),
|
|
2783
2826
|
...runState.agentUrl ? { url: (0, import_oauth_metadata_graph.redactOAuthUrlForOutput)(runState.agentUrl) } : {}
|
|
@@ -2789,7 +2832,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2789
2832
|
const testsMissingAccount = step.omit_account === true && effectiveStep.task === "create_media_buy";
|
|
2790
2833
|
let rawProbeHeaders;
|
|
2791
2834
|
try {
|
|
2792
|
-
rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth,
|
|
2835
|
+
rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth, effectiveOptions) : void 0;
|
|
2793
2836
|
} catch (err) {
|
|
2794
2837
|
return {
|
|
2795
2838
|
step_id: step.id,
|
|
@@ -2812,6 +2855,8 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2812
2855
|
let responseRecord;
|
|
2813
2856
|
let a2aEnvelope;
|
|
2814
2857
|
let crossResponses;
|
|
2858
|
+
let requestUrl = runState.agentUrl;
|
|
2859
|
+
let captureInfrastructureError;
|
|
2815
2860
|
if (step.parallel_dispatch && !useRawProbe) {
|
|
2816
2861
|
const contractsInScope = new Set(options.contracts ?? []);
|
|
2817
2862
|
if (!contractsInScope.has(import_parallel_dispatch.PARALLEL_DISPATCH_CONTRACT)) {
|
|
@@ -2886,39 +2931,87 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2886
2931
|
if (useRawProbe) {
|
|
2887
2932
|
const started = Date.now();
|
|
2888
2933
|
try {
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2934
|
+
if (effectiveOptions.protocol === "a2a") {
|
|
2935
|
+
const probeClient = createA2AAuthOverrideClient(runState.agentUrl, effectiveOptions, rawProbeHeaders ?? {});
|
|
2936
|
+
const captured = await (0, import_rawResponseCapture.withRawResponseCapture)(
|
|
2937
|
+
() => (0, import_client.runStep)(
|
|
2938
|
+
step.title,
|
|
2939
|
+
effectiveStep.task,
|
|
2940
|
+
() => (0, import_task_map.executeStoryboardTask)(probeClient, effectiveStep.task, request, {
|
|
2941
|
+
skipIdempotencyAutoInject: testsMissingIdempotencyKey,
|
|
2942
|
+
skipAccountValidation: testsMissingAccount,
|
|
2943
|
+
responseProjection: effectiveStep.response_projection ?? (0, import_task_map.defaultStoryboardResponseProjection)(effectiveStep.task, effectiveStep.comply_scenario),
|
|
2944
|
+
signal: effectiveOptions.signal
|
|
2945
|
+
})
|
|
2946
|
+
)
|
|
2947
|
+
);
|
|
2948
|
+
taskResult = captured.result.result;
|
|
2949
|
+
stepResult = captured.result.step;
|
|
2950
|
+
caughtError = captured.result.caughtError;
|
|
2951
|
+
const rpcCapture = selectLastA2aSkillCapture(captured.captures, effectiveStep.task);
|
|
2952
|
+
const crossOriginRpcCapture = rpcCapture !== void 0 && new URL(rpcCapture.url).origin !== new URL(runState.agentUrl).origin;
|
|
2953
|
+
if (rpcCapture && !crossOriginRpcCapture && !rpcCapture.bodyTruncated) {
|
|
2954
|
+
httpResult = httpProbeResultFromCapture(rpcCapture);
|
|
2955
|
+
requestUrl = rpcCapture.url;
|
|
2956
|
+
const filteredHeaders = filterResponseHeaders(httpResult.headers);
|
|
2957
|
+
responseRecord = {
|
|
2958
|
+
transport: "a2a",
|
|
2959
|
+
payload: (0, import_redact_secrets.redactSecrets)(httpResult.body),
|
|
2960
|
+
status: httpResult.status,
|
|
2961
|
+
...filteredHeaders && { headers: filteredHeaders },
|
|
2962
|
+
duration_ms: rpcCapture.latencyMs
|
|
2963
|
+
};
|
|
2964
|
+
a2aEnvelope = parseLastA2aMessageSendCapture([rpcCapture]);
|
|
2965
|
+
} else {
|
|
2966
|
+
const error = crossOriginRpcCapture ? "A2A auth probe selected a cross-origin RPC endpoint; credential-isolated responses cannot be graded" : rpcCapture?.bodyTruncated ? rpcCapture.bodyCaptureError ?? "Raw response capture was incomplete; A2A auth validators cannot grade a partial response body" : stepResult.error ?? taskResult?.error ?? "A2A auth probe produced no HTTP response";
|
|
2967
|
+
requestUrl = rpcCapture?.url ?? runState.agentUrl;
|
|
2968
|
+
httpResult = { url: requestUrl, status: 0, headers: {}, body: null, error };
|
|
2969
|
+
captureInfrastructureError = error;
|
|
2970
|
+
stepResult = { ...stepResult, passed: false };
|
|
2971
|
+
responseRecord = {
|
|
2972
|
+
transport: "a2a",
|
|
2973
|
+
payload: null,
|
|
2974
|
+
status: 0,
|
|
2975
|
+
duration_ms: stepResult.duration_ms
|
|
2976
|
+
};
|
|
2977
|
+
}
|
|
2978
|
+
} else {
|
|
2979
|
+
const probe = await (0, import_probes.rawMcpProbe)({
|
|
2980
|
+
agentUrl: runState.agentUrl,
|
|
2981
|
+
toolName: effectiveStep.task,
|
|
2982
|
+
args: request,
|
|
2983
|
+
headers: rawProbeHeaders,
|
|
2984
|
+
allowPrivateIp: effectiveOptions.allow_http === true,
|
|
2985
|
+
fetchFn: effectiveOptions.transport?.trustedFetchFn
|
|
2986
|
+
});
|
|
2987
|
+
httpResult = probe.httpResult;
|
|
2988
|
+
taskResult = probe.taskResult;
|
|
2989
|
+
const durationMs = Date.now() - started;
|
|
2990
|
+
stepResult = {
|
|
2991
|
+
duration_ms: durationMs,
|
|
2992
|
+
passed: !httpResult.error,
|
|
2993
|
+
error: httpResult.error
|
|
2994
|
+
};
|
|
2995
|
+
const filteredHeaders = filterResponseHeaders(httpResult.headers);
|
|
2996
|
+
responseRecord = {
|
|
2997
|
+
transport: "mcp",
|
|
2998
|
+
payload: (0, import_redact_secrets.redactSecrets)(httpResult.body),
|
|
2999
|
+
...typeof httpResult.status === "number" ? { status: httpResult.status } : {},
|
|
3000
|
+
...filteredHeaders && { headers: filteredHeaders },
|
|
3001
|
+
duration_ms: durationMs
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
2913
3004
|
} catch (err) {
|
|
3005
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
3006
|
+
if (effectiveOptions.protocol === "a2a") captureInfrastructureError = error;
|
|
2914
3007
|
stepResult = {
|
|
2915
3008
|
duration_ms: Date.now() - started,
|
|
2916
3009
|
passed: false,
|
|
2917
|
-
|
|
3010
|
+
...captureInfrastructureError ? {} : { error }
|
|
2918
3011
|
};
|
|
2919
3012
|
}
|
|
2920
3013
|
} else {
|
|
2921
|
-
const captureA2a =
|
|
3014
|
+
const captureA2a = effectiveOptions.protocol === "a2a";
|
|
2922
3015
|
let a2aCaptures;
|
|
2923
3016
|
if (step.parallel_dispatch) {
|
|
2924
3017
|
const started = Date.now();
|
|
@@ -2942,7 +3035,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2942
3035
|
};
|
|
2943
3036
|
if (taskResult) {
|
|
2944
3037
|
responseRecord = {
|
|
2945
|
-
transport:
|
|
3038
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2946
3039
|
payload: (0, import_redact_secrets.redactSecrets)(
|
|
2947
3040
|
taskResult.data ?? (taskResult.adcp_error ? { adcp_error: taskResult.adcp_error } : void 0) ?? taskResult.error ?? null
|
|
2948
3041
|
),
|
|
@@ -2954,7 +3047,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2954
3047
|
skipIdempotencyAutoInject: testsMissingIdempotencyKey,
|
|
2955
3048
|
skipAccountValidation: testsMissingAccount,
|
|
2956
3049
|
responseProjection: effectiveStep.response_projection ?? (0, import_task_map.defaultStoryboardResponseProjection)(effectiveStep.task, effectiveStep.comply_scenario),
|
|
2957
|
-
signal:
|
|
3050
|
+
signal: effectiveOptions.signal
|
|
2958
3051
|
});
|
|
2959
3052
|
const run = await (0, import_client.runStep)(step.title, effectiveStep.task, async () => {
|
|
2960
3053
|
if (!captureA2a) return dispatch();
|
|
@@ -2971,15 +3064,29 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2971
3064
|
taskResult = run.result;
|
|
2972
3065
|
stepResult = run.step;
|
|
2973
3066
|
caughtError = run.caughtError;
|
|
2974
|
-
if (caughtError !== void 0 &&
|
|
3067
|
+
if (caughtError !== void 0 && effectiveOptions.signal?.aborted) {
|
|
2975
3068
|
throw caughtError;
|
|
2976
3069
|
}
|
|
2977
|
-
if (captureA2a
|
|
2978
|
-
|
|
3070
|
+
if (captureA2a) {
|
|
3071
|
+
const skillCapture = a2aCaptures ? selectLastA2aSkillCapture(a2aCaptures, effectiveStep.task) : void 0;
|
|
3072
|
+
const crossOriginSkillCapture = skillCapture !== void 0 && new URL(skillCapture.url).origin !== new URL(runState.agentUrl).origin;
|
|
3073
|
+
if (!skillCapture) {
|
|
3074
|
+
captureInfrastructureError = "A2A tool dispatch produced no matching HTTP response capture";
|
|
3075
|
+
} else if (crossOriginSkillCapture) {
|
|
3076
|
+
captureInfrastructureError = "A2A tool dispatch selected a cross-origin RPC endpoint; credential-isolated responses cannot be graded";
|
|
3077
|
+
} else if (skillCapture.bodyTruncated) {
|
|
3078
|
+
captureInfrastructureError = skillCapture.bodyCaptureError ?? "Raw response capture was incomplete; A2A validators cannot grade a partial response body";
|
|
3079
|
+
} else {
|
|
3080
|
+
a2aEnvelope = parseLastA2aMessageSendCapture([skillCapture]);
|
|
3081
|
+
if (!a2aEnvelope) {
|
|
3082
|
+
captureInfrastructureError = "A2A matching HTTP response capture could not be parsed for grading";
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
if (captureInfrastructureError) stepResult = { ...stepResult, passed: false };
|
|
2979
3086
|
}
|
|
2980
3087
|
if (taskResult) {
|
|
2981
3088
|
responseRecord = {
|
|
2982
|
-
transport:
|
|
3089
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2983
3090
|
payload: (0, import_redact_secrets.redactSecrets)(
|
|
2984
3091
|
taskResult.data ?? (taskResult.adcp_error ? { adcp_error: taskResult.adcp_error } : void 0) ?? taskResult.error ?? null
|
|
2985
3092
|
),
|
|
@@ -2989,10 +3096,10 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2989
3096
|
}
|
|
2990
3097
|
}
|
|
2991
3098
|
const requestRecord = {
|
|
2992
|
-
transport:
|
|
3099
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2993
3100
|
operation: effectiveStep.task,
|
|
2994
3101
|
payload: (0, import_redact_secrets.redactSecrets)(request),
|
|
2995
|
-
...
|
|
3102
|
+
...requestUrl ? { url: (0, import_oauth_metadata_graph.redactOAuthUrlForOutput)(requestUrl) } : {}
|
|
2996
3103
|
};
|
|
2997
3104
|
const inputSchemaStripNotices = collectInputSchemaFieldStripNotices(
|
|
2998
3105
|
taskResult?.debug_logs,
|
|
@@ -3083,7 +3190,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3083
3190
|
runState,
|
|
3084
3191
|
allSteps
|
|
3085
3192
|
);
|
|
3086
|
-
if (responseDerivedSkip && !step.expect_error) {
|
|
3193
|
+
if (responseDerivedSkip && !step.expect_error && !captureInfrastructureError) {
|
|
3087
3194
|
for (const key of responseDerivedSkip.contextKeys) {
|
|
3088
3195
|
runState.responseDerivedNotApplicableContextKeys?.set(key, responseDerivedSkip.detail);
|
|
3089
3196
|
}
|
|
@@ -3119,6 +3226,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3119
3226
|
} else {
|
|
3120
3227
|
passed = stepResult.passed && (taskResult?.success ?? false);
|
|
3121
3228
|
}
|
|
3229
|
+
if (captureInfrastructureError) passed = false;
|
|
3122
3230
|
const schemaValidationError = caughtError instanceof import_response_unwrapper.ResponseSchemaValidationError ? caughtError : void 0;
|
|
3123
3231
|
const validationTaskResult = taskResult ?? (schemaValidationError ? {
|
|
3124
3232
|
// ResponseSchemaValidationError is thrown while validating a
|
|
@@ -3244,9 +3352,10 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3244
3352
|
);
|
|
3245
3353
|
const schemaResults = decoratedCandidates.length ? decoratedCandidates : [{ ...baseSchemaResult, severity: "required" }];
|
|
3246
3354
|
schemaRejectionIsAdvisory = schemaResults.every((result) => !(0, import_validations.validationFailsStep)(result));
|
|
3247
|
-
if (schemaRejectionIsAdvisory && !step.expect_error) passed = true;
|
|
3355
|
+
if (schemaRejectionIsAdvisory && !step.expect_error && !captureInfrastructureError) passed = true;
|
|
3248
3356
|
validations = [...schemaResults, ...validations.filter((result) => result.check !== "response_schema")];
|
|
3249
3357
|
}
|
|
3358
|
+
if (captureInfrastructureError) passed = false;
|
|
3250
3359
|
if (a2aEnvelope && runState.priorA2aEnvelopes) {
|
|
3251
3360
|
runState.priorA2aEnvelopes.set(step.id, a2aEnvelope);
|
|
3252
3361
|
}
|
|
@@ -3365,7 +3474,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3365
3474
|
context_provenance: Object.fromEntries(runState.contextProvenance)
|
|
3366
3475
|
},
|
|
3367
3476
|
...responseDerivedContextResult(runState),
|
|
3368
|
-
error: step.expect_error || schemaRejectionIsAdvisory ? void 0 : truncateError(stepResult.error || taskResult?.error),
|
|
3477
|
+
error: captureInfrastructureError ? truncateError(captureInfrastructureError) : step.expect_error || schemaRejectionIsAdvisory ? void 0 : truncateError(stepResult.error || taskResult?.error),
|
|
3369
3478
|
...!step.expect_error && taskResult?.adcp_error && { adcp_error: taskResult.adcp_error },
|
|
3370
3479
|
next,
|
|
3371
3480
|
request: requestRecord,
|
|
@@ -4421,26 +4530,38 @@ function findPriorProbe(priorStepResults) {
|
|
|
4421
4530
|
}
|
|
4422
4531
|
return void 0;
|
|
4423
4532
|
}
|
|
4533
|
+
function selectLastA2aSkillCapture(captures, skill) {
|
|
4534
|
+
for (let index = captures.length - 1; index >= 0; index--) {
|
|
4535
|
+
const capture = captures[index];
|
|
4536
|
+
if (capture?.method === "POST" && capture.requestAdcpSkill === skill) return capture;
|
|
4537
|
+
}
|
|
4538
|
+
return void 0;
|
|
4539
|
+
}
|
|
4424
4540
|
function parseLastA2aMessageSendCapture(captures) {
|
|
4425
|
-
let
|
|
4541
|
+
let taskFallbackIdx = -1;
|
|
4426
4542
|
let lastPostIdx = -1;
|
|
4427
4543
|
for (let i = captures.length - 1; i >= 0; i--) {
|
|
4428
|
-
const
|
|
4429
|
-
if (!
|
|
4544
|
+
const cap = captures[i];
|
|
4545
|
+
if (!cap || cap.method !== "POST") continue;
|
|
4430
4546
|
if (lastPostIdx === -1) lastPostIdx = i;
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4547
|
+
const isMessageSend = cap.requestJsonRpcMethod === "SendMessage" || cap.requestJsonRpcMethod === "message/send";
|
|
4548
|
+
if (isMessageSend) return cap.bodyTruncated ? void 0 : parseA2aCapture(cap);
|
|
4549
|
+
if (taskFallbackIdx === -1) {
|
|
4550
|
+
const env = tryParseJsonRpcEnvelope(cap.body);
|
|
4551
|
+
if (env && env.result !== void 0 && isTaskShape(normalizeCapturedA2AResult(env.result))) {
|
|
4552
|
+
taskFallbackIdx = i;
|
|
4435
4553
|
}
|
|
4436
4554
|
}
|
|
4437
4555
|
}
|
|
4438
|
-
const idx =
|
|
4556
|
+
const idx = taskFallbackIdx !== -1 ? taskFallbackIdx : lastPostIdx;
|
|
4439
4557
|
if (idx === -1) return void 0;
|
|
4440
|
-
const
|
|
4558
|
+
const capture = captures[idx];
|
|
4559
|
+
return capture.bodyTruncated ? void 0 : parseA2aCapture(capture);
|
|
4560
|
+
}
|
|
4561
|
+
function parseA2aCapture(cap) {
|
|
4441
4562
|
const envelope = tryParseJsonRpcEnvelope(cap.body);
|
|
4442
4563
|
if (!envelope) return void 0;
|
|
4443
|
-
const redactedResult = envelope.result !== void 0 ? (0, import_redact_secrets.redactSecrets)(envelope.result) : null;
|
|
4564
|
+
const redactedResult = envelope.result !== void 0 ? (0, import_redact_secrets.redactSecrets)(normalizeCapturedA2AResult(envelope.result)) : null;
|
|
4444
4565
|
return {
|
|
4445
4566
|
result: redactedResult,
|
|
4446
4567
|
envelope: {
|
|
@@ -4468,6 +4589,55 @@ function tryParseJsonRpcEnvelope(body) {
|
|
|
4468
4589
|
function isTaskShape(result) {
|
|
4469
4590
|
return result != null && typeof result === "object" && !Array.isArray(result) && result.kind === "task";
|
|
4470
4591
|
}
|
|
4592
|
+
function normalizeCapturedA2AResult(result) {
|
|
4593
|
+
if (result == null || typeof result !== "object" || Array.isArray(result)) return result;
|
|
4594
|
+
const record = result;
|
|
4595
|
+
const task = asRecord(record.task);
|
|
4596
|
+
if (task) return normalizeCapturedTask(task);
|
|
4597
|
+
const message = asRecord(record.message);
|
|
4598
|
+
if (message) return normalizeCapturedMessage(message);
|
|
4599
|
+
return result;
|
|
4600
|
+
}
|
|
4601
|
+
function normalizeCapturedTask(task) {
|
|
4602
|
+
const status = asRecord(task.status);
|
|
4603
|
+
const artifacts = Array.isArray(task.artifacts) ? task.artifacts.map((artifact) => {
|
|
4604
|
+
const record = asRecord(artifact);
|
|
4605
|
+
return record ? { ...record, parts: normalizeCapturedParts(record.parts) } : artifact;
|
|
4606
|
+
}) : [];
|
|
4607
|
+
return {
|
|
4608
|
+
...task,
|
|
4609
|
+
kind: "task",
|
|
4610
|
+
...status ? {
|
|
4611
|
+
status: {
|
|
4612
|
+
...status,
|
|
4613
|
+
state: normalizeCapturedTaskState(status.state),
|
|
4614
|
+
...asRecord(status.message) ? { message: normalizeCapturedMessage(asRecord(status.message)) } : {}
|
|
4615
|
+
}
|
|
4616
|
+
} : {},
|
|
4617
|
+
artifacts
|
|
4618
|
+
};
|
|
4619
|
+
}
|
|
4620
|
+
function normalizeCapturedMessage(message) {
|
|
4621
|
+
return { ...message, kind: "message", parts: normalizeCapturedParts(message.parts) };
|
|
4622
|
+
}
|
|
4623
|
+
function normalizeCapturedParts(parts) {
|
|
4624
|
+
if (!Array.isArray(parts)) return [];
|
|
4625
|
+
return parts.map((part) => {
|
|
4626
|
+
const record = asRecord(part);
|
|
4627
|
+
if (!record) return part;
|
|
4628
|
+
if ("data" in record) return { ...record, kind: "data" };
|
|
4629
|
+
if ("text" in record) return { ...record, kind: "text" };
|
|
4630
|
+
if ("file" in record) return { ...record, kind: "file" };
|
|
4631
|
+
return record;
|
|
4632
|
+
});
|
|
4633
|
+
}
|
|
4634
|
+
function normalizeCapturedTaskState(state) {
|
|
4635
|
+
if (typeof state !== "string" || !state.startsWith("TASK_STATE_")) return state;
|
|
4636
|
+
return state.slice("TASK_STATE_".length).toLowerCase().replaceAll("_", "-");
|
|
4637
|
+
}
|
|
4638
|
+
function asRecord(value) {
|
|
4639
|
+
return value != null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4640
|
+
}
|
|
4471
4641
|
function phaseContainsOauthMetadataProbe(phase) {
|
|
4472
4642
|
return phase.steps.some((s) => s.task === "protected_resource_metadata" || s.task === "oauth_auth_server_metadata");
|
|
4473
4643
|
}
|
|
@@ -4558,6 +4728,28 @@ function authHeadersForStep(directive, options) {
|
|
|
4558
4728
|
}
|
|
4559
4729
|
return { authorization: `Bearer ${value}` };
|
|
4560
4730
|
}
|
|
4731
|
+
function createA2AAuthOverrideClient(agentUrl, options, authHeaders) {
|
|
4732
|
+
const headers = {};
|
|
4733
|
+
let auth;
|
|
4734
|
+
for (const [name, value] of Object.entries(authHeaders)) {
|
|
4735
|
+
const lower = name.toLowerCase();
|
|
4736
|
+
if (lower === "authorization" && /^Bearer\s+/i.test(value)) {
|
|
4737
|
+
auth = { type: "bearer", token: value.replace(/^Bearer\s+/i, "") };
|
|
4738
|
+
} else {
|
|
4739
|
+
headers[name] = value;
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
return (0, import_client.createTestClient)(agentUrl, "a2a", {
|
|
4743
|
+
...options,
|
|
4744
|
+
protocol: "a2a",
|
|
4745
|
+
auth,
|
|
4746
|
+
headers: Object.keys(headers).length > 0 ? headers : void 0,
|
|
4747
|
+
test_session_id: void 0,
|
|
4748
|
+
userAgent: void 0,
|
|
4749
|
+
test_kit: void 0,
|
|
4750
|
+
_client: void 0
|
|
4751
|
+
});
|
|
4752
|
+
}
|
|
4561
4753
|
function basicAuthHeadersForStep(directive, options) {
|
|
4562
4754
|
if (directive.value_strategy) {
|
|
4563
4755
|
if (directive.value_strategy !== "random_invalid") return {};
|
|
@@ -4918,7 +5110,8 @@ function createRoutingDispatcher(ctx, options, agents) {
|
|
|
4918
5110
|
client,
|
|
4919
5111
|
agentUrl: url,
|
|
4920
5112
|
instanceIndex: keyToIndex.get(key) ?? 0,
|
|
4921
|
-
profile
|
|
5113
|
+
profile,
|
|
5114
|
+
effectiveOptions: (0, import_agent_routing.buildAgentOptions)(agents[key], options)
|
|
4922
5115
|
};
|
|
4923
5116
|
}
|
|
4924
5117
|
};
|
|
@@ -5009,9 +5202,12 @@ function getFirstStepPreview(storyboard, context = {}) {
|
|
|
5009
5202
|
evaluateCapabilityPredicate,
|
|
5010
5203
|
getFirstStepPreview,
|
|
5011
5204
|
listStrictOnlyFailures,
|
|
5205
|
+
normalizeCapturedA2AResult,
|
|
5206
|
+
parseLastA2aMessageSendCapture,
|
|
5012
5207
|
resolveCapabilityPath,
|
|
5013
5208
|
runStoryboard,
|
|
5014
5209
|
runStoryboardStep,
|
|
5210
|
+
selectLastA2aSkillCapture,
|
|
5015
5211
|
summarizeStrictValidation
|
|
5016
5212
|
});
|
|
5017
5213
|
//# sourceMappingURL=runner.js.map
|