@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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createHash, createHmac } from "node:crypto";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { basename, join } from "node:path";
|
|
4
|
-
import { getOrCreateClientResolution, getOrDiscoverProfile, runStep } from "../client.mjs";
|
|
5
4
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
createTestClient,
|
|
6
|
+
getOrCreateClientResolution,
|
|
7
|
+
getOrDiscoverProfile,
|
|
8
|
+
runStep
|
|
9
|
+
} from "../client.mjs";
|
|
10
|
+
import { closeScopedConnections, withMCPConnectionScope } from "../../protocols/index.mjs";
|
|
10
11
|
import { getCapturesFromError, withRawResponseCapture } from "../../protocols/rawResponseCapture.mjs";
|
|
11
12
|
import { defaultStoryboardResponseProjection, executeStoryboardTask } from "./task-map.mjs";
|
|
12
13
|
import {
|
|
@@ -67,6 +68,7 @@ import { readBrandJsonUrl } from "../../signing/agent-resolver/capabilities-type
|
|
|
67
68
|
import { resolveDeclaredTestKit, validateTestKit } from "./test-kit.mjs";
|
|
68
69
|
import { validateStoryboardShape } from "./loader.mjs";
|
|
69
70
|
import { trustedStoryboardComplianceRoot } from "./provenance.mjs";
|
|
71
|
+
import { applyNativeA2AComplianceTransportOptions } from "./native-a2a-compliance.mjs";
|
|
70
72
|
import { probeRequestSigningVector } from "./request-signing/probe-dispatch.mjs";
|
|
71
73
|
import { createWebhookReceiver } from "./webhook-receiver.mjs";
|
|
72
74
|
import { WEBHOOK_ASSERTION_TASKS, armWebhookAssertions, executeWebhookAssertionStep } from "./webhook-assertions.mjs";
|
|
@@ -94,6 +96,7 @@ function withPreparedTrustedMatchPublisherAuth(options, prepared) {
|
|
|
94
96
|
}
|
|
95
97
|
import {
|
|
96
98
|
buildRoutingContext,
|
|
99
|
+
buildAgentOptions,
|
|
97
100
|
DiscoveryFailure,
|
|
98
101
|
resolveAgentForStep,
|
|
99
102
|
RoutingError
|
|
@@ -177,6 +180,7 @@ function selectionForProbeSkip(reason, detail) {
|
|
|
177
180
|
return { reason: "explicit_scope_excluded", detail };
|
|
178
181
|
case "not_in_only_vectors":
|
|
179
182
|
case "mcp_mode_flattens_url_edges":
|
|
183
|
+
case "transport_flattens_url_edges":
|
|
180
184
|
case "capability_profile_mismatch":
|
|
181
185
|
case "transport_ungradable":
|
|
182
186
|
return { reason: "profile_excluded", detail };
|
|
@@ -608,12 +612,37 @@ function filterResponseHeaders(headers) {
|
|
|
608
612
|
}
|
|
609
613
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
610
614
|
}
|
|
615
|
+
function httpProbeResultFromCapture(capture) {
|
|
616
|
+
if (capture.bodyTruncated) {
|
|
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: null,
|
|
622
|
+
error: capture.bodyCaptureError ?? "Raw response capture was incomplete; storyboard validators cannot grade a partial response body"
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
const contentType = Object.entries(capture.headers).find(([name]) => name.toLowerCase() === "content-type")?.[1];
|
|
626
|
+
let body = capture.body;
|
|
627
|
+
if (contentType?.toLowerCase().includes("json") || /^[\s]*[{[]/.test(capture.body)) {
|
|
628
|
+
try {
|
|
629
|
+
body = JSON.parse(capture.body);
|
|
630
|
+
} catch {
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return {
|
|
634
|
+
url: capture.url,
|
|
635
|
+
status: capture.status,
|
|
636
|
+
headers: Object.fromEntries(Object.entries(capture.headers).map(([name, value]) => [name.toLowerCase(), value])),
|
|
637
|
+
body
|
|
638
|
+
};
|
|
639
|
+
}
|
|
611
640
|
async function runStoryboard(agentUrlOrUrls, storyboard, options = {}) {
|
|
612
641
|
return withMCPConnectionScope(
|
|
613
642
|
async () => {
|
|
614
643
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
615
644
|
options = resolveDeclaredTestKit(storyboard, options);
|
|
616
|
-
options =
|
|
645
|
+
options = applyNativeA2AComplianceTransportOptions(options);
|
|
617
646
|
const schemaRoot = getRunSchemaRoot(options);
|
|
618
647
|
if (schemaRoot) {
|
|
619
648
|
return await withExternalSchemaRoot(
|
|
@@ -1657,7 +1686,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1657
1686
|
}
|
|
1658
1687
|
}
|
|
1659
1688
|
}
|
|
1660
|
-
const buildExecutionState = (agentUrl = agentUrls[0], agentProfile = profile) => ({
|
|
1689
|
+
const buildExecutionState = (agentUrl = agentUrls[0], agentProfile = profile, effectiveOptions = options) => ({
|
|
1661
1690
|
contributions,
|
|
1662
1691
|
priorStepResults,
|
|
1663
1692
|
priorProbes,
|
|
@@ -1669,6 +1698,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1669
1698
|
stepRequestStarts,
|
|
1670
1699
|
responseDerivedNotApplicableContextKeys,
|
|
1671
1700
|
agentProfile,
|
|
1701
|
+
effectiveOptions,
|
|
1672
1702
|
agentLibraryVersion: agentProfile?.library_version,
|
|
1673
1703
|
storyboardRequiresRequestSigner: allRequires.includes("request_signer"),
|
|
1674
1704
|
storyboardRequiresPublisherAuthRunner: storyboard.requires?.includes("trusted_match_publisher_auth_runner") === true,
|
|
@@ -1907,7 +1937,11 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1907
1937
|
phasePassed = false;
|
|
1908
1938
|
continue;
|
|
1909
1939
|
}
|
|
1910
|
-
const stepExecutionState = buildExecutionState(
|
|
1940
|
+
const stepExecutionState = buildExecutionState(
|
|
1941
|
+
assignment.agentUrl,
|
|
1942
|
+
assignment.profile,
|
|
1943
|
+
assignment.effectiveOptions ?? options
|
|
1944
|
+
);
|
|
1911
1945
|
const rawResult = await executeStep(
|
|
1912
1946
|
assignment.client,
|
|
1913
1947
|
step,
|
|
@@ -2444,6 +2478,7 @@ async function runStoryboardStep(agentUrl, storyboard, stepId, options = {}) {
|
|
|
2444
2478
|
validateStoryboardShape(storyboard);
|
|
2445
2479
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
2446
2480
|
options = resolveDeclaredTestKit(storyboard, options);
|
|
2481
|
+
options = applyNativeA2AComplianceTransportOptions(options);
|
|
2447
2482
|
const schemaRoot = getRunSchemaRoot(options);
|
|
2448
2483
|
if (schemaRoot) {
|
|
2449
2484
|
return await withExternalSchemaRoot(
|
|
@@ -2568,14 +2603,21 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2568
2603
|
stepRequestStarts: /* @__PURE__ */ new Map(),
|
|
2569
2604
|
responseDerivedNotApplicableContextKeys: /* @__PURE__ */ new Map()
|
|
2570
2605
|
};
|
|
2606
|
+
const effectiveOptions = runState.effectiveOptions ?? options;
|
|
2607
|
+
const effectiveProbeOptions = runState.agentProfile ? {
|
|
2608
|
+
...effectiveOptions,
|
|
2609
|
+
profile: runState.agentProfile,
|
|
2610
|
+
_profile: runState.agentProfile,
|
|
2611
|
+
agentTools: effectiveOptions.agentTools ?? normalizeAgentToolNames(runState.agentProfile.tools)
|
|
2612
|
+
} : effectiveOptions;
|
|
2571
2613
|
if (TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(step.task)) {
|
|
2572
2614
|
if (runState.storyboardRequiresPublisherAuthRunner !== true) {
|
|
2573
2615
|
return invalidTrustedMatchPublisherAuthTask(step, phaseId, context, allSteps, runState);
|
|
2574
2616
|
}
|
|
2575
|
-
return executeProbeStep(client, step, phaseId, context, allSteps,
|
|
2617
|
+
return executeProbeStep(client, step, phaseId, context, allSteps, effectiveProbeOptions, runState);
|
|
2576
2618
|
}
|
|
2577
2619
|
if (PROBE_TASKS.has(step.task)) {
|
|
2578
|
-
return executeProbeStep(client, step, phaseId, context, allSteps,
|
|
2620
|
+
return executeProbeStep(client, step, phaseId, context, allSteps, effectiveProbeOptions, runState);
|
|
2579
2621
|
}
|
|
2580
2622
|
if (WEBHOOK_ASSERTION_TASKS.has(step.task)) {
|
|
2581
2623
|
return executeWebhookAssertionStep(step, phaseId, context, allSteps, options, runState);
|
|
@@ -2794,7 +2836,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2794
2836
|
next: next2,
|
|
2795
2837
|
...isPrerequisiteFailure ? { error: detail } : {},
|
|
2796
2838
|
request: {
|
|
2797
|
-
transport:
|
|
2839
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2798
2840
|
operation: effectiveStep.task,
|
|
2799
2841
|
payload: redactSecrets(request),
|
|
2800
2842
|
...runState.agentUrl ? { url: redactOAuthUrlForOutput(runState.agentUrl) } : {}
|
|
@@ -2806,7 +2848,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2806
2848
|
const testsMissingAccount = step.omit_account === true && effectiveStep.task === "create_media_buy";
|
|
2807
2849
|
let rawProbeHeaders;
|
|
2808
2850
|
try {
|
|
2809
|
-
rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth,
|
|
2851
|
+
rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth, effectiveOptions) : void 0;
|
|
2810
2852
|
} catch (err) {
|
|
2811
2853
|
return {
|
|
2812
2854
|
step_id: step.id,
|
|
@@ -2829,6 +2871,8 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2829
2871
|
let responseRecord;
|
|
2830
2872
|
let a2aEnvelope;
|
|
2831
2873
|
let crossResponses;
|
|
2874
|
+
let requestUrl = runState.agentUrl;
|
|
2875
|
+
let captureInfrastructureError;
|
|
2832
2876
|
if (step.parallel_dispatch && !useRawProbe) {
|
|
2833
2877
|
const contractsInScope = new Set(options.contracts ?? []);
|
|
2834
2878
|
if (!contractsInScope.has(PARALLEL_DISPATCH_CONTRACT)) {
|
|
@@ -2903,39 +2947,87 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2903
2947
|
if (useRawProbe) {
|
|
2904
2948
|
const started = Date.now();
|
|
2905
2949
|
try {
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2950
|
+
if (effectiveOptions.protocol === "a2a") {
|
|
2951
|
+
const probeClient = createA2AAuthOverrideClient(runState.agentUrl, effectiveOptions, rawProbeHeaders ?? {});
|
|
2952
|
+
const captured = await withRawResponseCapture(
|
|
2953
|
+
() => runStep(
|
|
2954
|
+
step.title,
|
|
2955
|
+
effectiveStep.task,
|
|
2956
|
+
() => executeStoryboardTask(probeClient, effectiveStep.task, request, {
|
|
2957
|
+
skipIdempotencyAutoInject: testsMissingIdempotencyKey,
|
|
2958
|
+
skipAccountValidation: testsMissingAccount,
|
|
2959
|
+
responseProjection: effectiveStep.response_projection ?? defaultStoryboardResponseProjection(effectiveStep.task, effectiveStep.comply_scenario),
|
|
2960
|
+
signal: effectiveOptions.signal
|
|
2961
|
+
})
|
|
2962
|
+
)
|
|
2963
|
+
);
|
|
2964
|
+
taskResult = captured.result.result;
|
|
2965
|
+
stepResult = captured.result.step;
|
|
2966
|
+
caughtError = captured.result.caughtError;
|
|
2967
|
+
const rpcCapture = selectLastA2aSkillCapture(captured.captures, effectiveStep.task);
|
|
2968
|
+
const crossOriginRpcCapture = rpcCapture !== void 0 && new URL(rpcCapture.url).origin !== new URL(runState.agentUrl).origin;
|
|
2969
|
+
if (rpcCapture && !crossOriginRpcCapture && !rpcCapture.bodyTruncated) {
|
|
2970
|
+
httpResult = httpProbeResultFromCapture(rpcCapture);
|
|
2971
|
+
requestUrl = rpcCapture.url;
|
|
2972
|
+
const filteredHeaders = filterResponseHeaders(httpResult.headers);
|
|
2973
|
+
responseRecord = {
|
|
2974
|
+
transport: "a2a",
|
|
2975
|
+
payload: redactSecrets(httpResult.body),
|
|
2976
|
+
status: httpResult.status,
|
|
2977
|
+
...filteredHeaders && { headers: filteredHeaders },
|
|
2978
|
+
duration_ms: rpcCapture.latencyMs
|
|
2979
|
+
};
|
|
2980
|
+
a2aEnvelope = parseLastA2aMessageSendCapture([rpcCapture]);
|
|
2981
|
+
} else {
|
|
2982
|
+
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";
|
|
2983
|
+
requestUrl = rpcCapture?.url ?? runState.agentUrl;
|
|
2984
|
+
httpResult = { url: requestUrl, status: 0, headers: {}, body: null, error };
|
|
2985
|
+
captureInfrastructureError = error;
|
|
2986
|
+
stepResult = { ...stepResult, passed: false };
|
|
2987
|
+
responseRecord = {
|
|
2988
|
+
transport: "a2a",
|
|
2989
|
+
payload: null,
|
|
2990
|
+
status: 0,
|
|
2991
|
+
duration_ms: stepResult.duration_ms
|
|
2992
|
+
};
|
|
2993
|
+
}
|
|
2994
|
+
} else {
|
|
2995
|
+
const probe = await rawMcpProbe({
|
|
2996
|
+
agentUrl: runState.agentUrl,
|
|
2997
|
+
toolName: effectiveStep.task,
|
|
2998
|
+
args: request,
|
|
2999
|
+
headers: rawProbeHeaders,
|
|
3000
|
+
allowPrivateIp: effectiveOptions.allow_http === true,
|
|
3001
|
+
fetchFn: effectiveOptions.transport?.trustedFetchFn
|
|
3002
|
+
});
|
|
3003
|
+
httpResult = probe.httpResult;
|
|
3004
|
+
taskResult = probe.taskResult;
|
|
3005
|
+
const durationMs = Date.now() - started;
|
|
3006
|
+
stepResult = {
|
|
3007
|
+
duration_ms: durationMs,
|
|
3008
|
+
passed: !httpResult.error,
|
|
3009
|
+
error: httpResult.error
|
|
3010
|
+
};
|
|
3011
|
+
const filteredHeaders = filterResponseHeaders(httpResult.headers);
|
|
3012
|
+
responseRecord = {
|
|
3013
|
+
transport: "mcp",
|
|
3014
|
+
payload: redactSecrets(httpResult.body),
|
|
3015
|
+
...typeof httpResult.status === "number" ? { status: httpResult.status } : {},
|
|
3016
|
+
...filteredHeaders && { headers: filteredHeaders },
|
|
3017
|
+
duration_ms: durationMs
|
|
3018
|
+
};
|
|
3019
|
+
}
|
|
2930
3020
|
} catch (err) {
|
|
3021
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
3022
|
+
if (effectiveOptions.protocol === "a2a") captureInfrastructureError = error;
|
|
2931
3023
|
stepResult = {
|
|
2932
3024
|
duration_ms: Date.now() - started,
|
|
2933
3025
|
passed: false,
|
|
2934
|
-
|
|
3026
|
+
...captureInfrastructureError ? {} : { error }
|
|
2935
3027
|
};
|
|
2936
3028
|
}
|
|
2937
3029
|
} else {
|
|
2938
|
-
const captureA2a =
|
|
3030
|
+
const captureA2a = effectiveOptions.protocol === "a2a";
|
|
2939
3031
|
let a2aCaptures;
|
|
2940
3032
|
if (step.parallel_dispatch) {
|
|
2941
3033
|
const started = Date.now();
|
|
@@ -2959,7 +3051,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2959
3051
|
};
|
|
2960
3052
|
if (taskResult) {
|
|
2961
3053
|
responseRecord = {
|
|
2962
|
-
transport:
|
|
3054
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
2963
3055
|
payload: redactSecrets(
|
|
2964
3056
|
taskResult.data ?? (taskResult.adcp_error ? { adcp_error: taskResult.adcp_error } : void 0) ?? taskResult.error ?? null
|
|
2965
3057
|
),
|
|
@@ -2971,7 +3063,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2971
3063
|
skipIdempotencyAutoInject: testsMissingIdempotencyKey,
|
|
2972
3064
|
skipAccountValidation: testsMissingAccount,
|
|
2973
3065
|
responseProjection: effectiveStep.response_projection ?? defaultStoryboardResponseProjection(effectiveStep.task, effectiveStep.comply_scenario),
|
|
2974
|
-
signal:
|
|
3066
|
+
signal: effectiveOptions.signal
|
|
2975
3067
|
});
|
|
2976
3068
|
const run = await runStep(step.title, effectiveStep.task, async () => {
|
|
2977
3069
|
if (!captureA2a) return dispatch();
|
|
@@ -2988,15 +3080,29 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2988
3080
|
taskResult = run.result;
|
|
2989
3081
|
stepResult = run.step;
|
|
2990
3082
|
caughtError = run.caughtError;
|
|
2991
|
-
if (caughtError !== void 0 &&
|
|
3083
|
+
if (caughtError !== void 0 && effectiveOptions.signal?.aborted) {
|
|
2992
3084
|
throw caughtError;
|
|
2993
3085
|
}
|
|
2994
|
-
if (captureA2a
|
|
2995
|
-
|
|
3086
|
+
if (captureA2a) {
|
|
3087
|
+
const skillCapture = a2aCaptures ? selectLastA2aSkillCapture(a2aCaptures, effectiveStep.task) : void 0;
|
|
3088
|
+
const crossOriginSkillCapture = skillCapture !== void 0 && new URL(skillCapture.url).origin !== new URL(runState.agentUrl).origin;
|
|
3089
|
+
if (!skillCapture) {
|
|
3090
|
+
captureInfrastructureError = "A2A tool dispatch produced no matching HTTP response capture";
|
|
3091
|
+
} else if (crossOriginSkillCapture) {
|
|
3092
|
+
captureInfrastructureError = "A2A tool dispatch selected a cross-origin RPC endpoint; credential-isolated responses cannot be graded";
|
|
3093
|
+
} else if (skillCapture.bodyTruncated) {
|
|
3094
|
+
captureInfrastructureError = skillCapture.bodyCaptureError ?? "Raw response capture was incomplete; A2A validators cannot grade a partial response body";
|
|
3095
|
+
} else {
|
|
3096
|
+
a2aEnvelope = parseLastA2aMessageSendCapture([skillCapture]);
|
|
3097
|
+
if (!a2aEnvelope) {
|
|
3098
|
+
captureInfrastructureError = "A2A matching HTTP response capture could not be parsed for grading";
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
if (captureInfrastructureError) stepResult = { ...stepResult, passed: false };
|
|
2996
3102
|
}
|
|
2997
3103
|
if (taskResult) {
|
|
2998
3104
|
responseRecord = {
|
|
2999
|
-
transport:
|
|
3105
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
3000
3106
|
payload: redactSecrets(
|
|
3001
3107
|
taskResult.data ?? (taskResult.adcp_error ? { adcp_error: taskResult.adcp_error } : void 0) ?? taskResult.error ?? null
|
|
3002
3108
|
),
|
|
@@ -3006,10 +3112,10 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3006
3112
|
}
|
|
3007
3113
|
}
|
|
3008
3114
|
const requestRecord = {
|
|
3009
|
-
transport:
|
|
3115
|
+
transport: effectiveOptions.protocol === "a2a" ? "a2a" : "mcp",
|
|
3010
3116
|
operation: effectiveStep.task,
|
|
3011
3117
|
payload: redactSecrets(request),
|
|
3012
|
-
...
|
|
3118
|
+
...requestUrl ? { url: redactOAuthUrlForOutput(requestUrl) } : {}
|
|
3013
3119
|
};
|
|
3014
3120
|
const inputSchemaStripNotices = collectInputSchemaFieldStripNotices(
|
|
3015
3121
|
taskResult?.debug_logs,
|
|
@@ -3100,7 +3206,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3100
3206
|
runState,
|
|
3101
3207
|
allSteps
|
|
3102
3208
|
);
|
|
3103
|
-
if (responseDerivedSkip && !step.expect_error) {
|
|
3209
|
+
if (responseDerivedSkip && !step.expect_error && !captureInfrastructureError) {
|
|
3104
3210
|
for (const key of responseDerivedSkip.contextKeys) {
|
|
3105
3211
|
runState.responseDerivedNotApplicableContextKeys?.set(key, responseDerivedSkip.detail);
|
|
3106
3212
|
}
|
|
@@ -3136,6 +3242,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3136
3242
|
} else {
|
|
3137
3243
|
passed = stepResult.passed && (taskResult?.success ?? false);
|
|
3138
3244
|
}
|
|
3245
|
+
if (captureInfrastructureError) passed = false;
|
|
3139
3246
|
const schemaValidationError = caughtError instanceof ResponseSchemaValidationError ? caughtError : void 0;
|
|
3140
3247
|
const validationTaskResult = taskResult ?? (schemaValidationError ? {
|
|
3141
3248
|
// ResponseSchemaValidationError is thrown while validating a
|
|
@@ -3261,9 +3368,10 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3261
3368
|
);
|
|
3262
3369
|
const schemaResults = decoratedCandidates.length ? decoratedCandidates : [{ ...baseSchemaResult, severity: "required" }];
|
|
3263
3370
|
schemaRejectionIsAdvisory = schemaResults.every((result) => !validationFailsStep(result));
|
|
3264
|
-
if (schemaRejectionIsAdvisory && !step.expect_error) passed = true;
|
|
3371
|
+
if (schemaRejectionIsAdvisory && !step.expect_error && !captureInfrastructureError) passed = true;
|
|
3265
3372
|
validations = [...schemaResults, ...validations.filter((result) => result.check !== "response_schema")];
|
|
3266
3373
|
}
|
|
3374
|
+
if (captureInfrastructureError) passed = false;
|
|
3267
3375
|
if (a2aEnvelope && runState.priorA2aEnvelopes) {
|
|
3268
3376
|
runState.priorA2aEnvelopes.set(step.id, a2aEnvelope);
|
|
3269
3377
|
}
|
|
@@ -3382,7 +3490,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3382
3490
|
context_provenance: Object.fromEntries(runState.contextProvenance)
|
|
3383
3491
|
},
|
|
3384
3492
|
...responseDerivedContextResult(runState),
|
|
3385
|
-
error: step.expect_error || schemaRejectionIsAdvisory ? void 0 : truncateError(stepResult.error || taskResult?.error),
|
|
3493
|
+
error: captureInfrastructureError ? truncateError(captureInfrastructureError) : step.expect_error || schemaRejectionIsAdvisory ? void 0 : truncateError(stepResult.error || taskResult?.error),
|
|
3386
3494
|
...!step.expect_error && taskResult?.adcp_error && { adcp_error: taskResult.adcp_error },
|
|
3387
3495
|
next,
|
|
3388
3496
|
request: requestRecord,
|
|
@@ -4438,26 +4546,38 @@ function findPriorProbe(priorStepResults) {
|
|
|
4438
4546
|
}
|
|
4439
4547
|
return void 0;
|
|
4440
4548
|
}
|
|
4549
|
+
function selectLastA2aSkillCapture(captures, skill) {
|
|
4550
|
+
for (let index = captures.length - 1; index >= 0; index--) {
|
|
4551
|
+
const capture = captures[index];
|
|
4552
|
+
if (capture?.method === "POST" && capture.requestAdcpSkill === skill) return capture;
|
|
4553
|
+
}
|
|
4554
|
+
return void 0;
|
|
4555
|
+
}
|
|
4441
4556
|
function parseLastA2aMessageSendCapture(captures) {
|
|
4442
|
-
let
|
|
4557
|
+
let taskFallbackIdx = -1;
|
|
4443
4558
|
let lastPostIdx = -1;
|
|
4444
4559
|
for (let i = captures.length - 1; i >= 0; i--) {
|
|
4445
|
-
const
|
|
4446
|
-
if (!
|
|
4560
|
+
const cap = captures[i];
|
|
4561
|
+
if (!cap || cap.method !== "POST") continue;
|
|
4447
4562
|
if (lastPostIdx === -1) lastPostIdx = i;
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4563
|
+
const isMessageSend = cap.requestJsonRpcMethod === "SendMessage" || cap.requestJsonRpcMethod === "message/send";
|
|
4564
|
+
if (isMessageSend) return cap.bodyTruncated ? void 0 : parseA2aCapture(cap);
|
|
4565
|
+
if (taskFallbackIdx === -1) {
|
|
4566
|
+
const env = tryParseJsonRpcEnvelope(cap.body);
|
|
4567
|
+
if (env && env.result !== void 0 && isTaskShape(normalizeCapturedA2AResult(env.result))) {
|
|
4568
|
+
taskFallbackIdx = i;
|
|
4452
4569
|
}
|
|
4453
4570
|
}
|
|
4454
4571
|
}
|
|
4455
|
-
const idx =
|
|
4572
|
+
const idx = taskFallbackIdx !== -1 ? taskFallbackIdx : lastPostIdx;
|
|
4456
4573
|
if (idx === -1) return void 0;
|
|
4457
|
-
const
|
|
4574
|
+
const capture = captures[idx];
|
|
4575
|
+
return capture.bodyTruncated ? void 0 : parseA2aCapture(capture);
|
|
4576
|
+
}
|
|
4577
|
+
function parseA2aCapture(cap) {
|
|
4458
4578
|
const envelope = tryParseJsonRpcEnvelope(cap.body);
|
|
4459
4579
|
if (!envelope) return void 0;
|
|
4460
|
-
const redactedResult = envelope.result !== void 0 ? redactSecrets(envelope.result) : null;
|
|
4580
|
+
const redactedResult = envelope.result !== void 0 ? redactSecrets(normalizeCapturedA2AResult(envelope.result)) : null;
|
|
4461
4581
|
return {
|
|
4462
4582
|
result: redactedResult,
|
|
4463
4583
|
envelope: {
|
|
@@ -4485,6 +4605,55 @@ function tryParseJsonRpcEnvelope(body) {
|
|
|
4485
4605
|
function isTaskShape(result) {
|
|
4486
4606
|
return result != null && typeof result === "object" && !Array.isArray(result) && result.kind === "task";
|
|
4487
4607
|
}
|
|
4608
|
+
function normalizeCapturedA2AResult(result) {
|
|
4609
|
+
if (result == null || typeof result !== "object" || Array.isArray(result)) return result;
|
|
4610
|
+
const record = result;
|
|
4611
|
+
const task = asRecord(record.task);
|
|
4612
|
+
if (task) return normalizeCapturedTask(task);
|
|
4613
|
+
const message = asRecord(record.message);
|
|
4614
|
+
if (message) return normalizeCapturedMessage(message);
|
|
4615
|
+
return result;
|
|
4616
|
+
}
|
|
4617
|
+
function normalizeCapturedTask(task) {
|
|
4618
|
+
const status = asRecord(task.status);
|
|
4619
|
+
const artifacts = Array.isArray(task.artifacts) ? task.artifacts.map((artifact) => {
|
|
4620
|
+
const record = asRecord(artifact);
|
|
4621
|
+
return record ? { ...record, parts: normalizeCapturedParts(record.parts) } : artifact;
|
|
4622
|
+
}) : [];
|
|
4623
|
+
return {
|
|
4624
|
+
...task,
|
|
4625
|
+
kind: "task",
|
|
4626
|
+
...status ? {
|
|
4627
|
+
status: {
|
|
4628
|
+
...status,
|
|
4629
|
+
state: normalizeCapturedTaskState(status.state),
|
|
4630
|
+
...asRecord(status.message) ? { message: normalizeCapturedMessage(asRecord(status.message)) } : {}
|
|
4631
|
+
}
|
|
4632
|
+
} : {},
|
|
4633
|
+
artifacts
|
|
4634
|
+
};
|
|
4635
|
+
}
|
|
4636
|
+
function normalizeCapturedMessage(message) {
|
|
4637
|
+
return { ...message, kind: "message", parts: normalizeCapturedParts(message.parts) };
|
|
4638
|
+
}
|
|
4639
|
+
function normalizeCapturedParts(parts) {
|
|
4640
|
+
if (!Array.isArray(parts)) return [];
|
|
4641
|
+
return parts.map((part) => {
|
|
4642
|
+
const record = asRecord(part);
|
|
4643
|
+
if (!record) return part;
|
|
4644
|
+
if ("data" in record) return { ...record, kind: "data" };
|
|
4645
|
+
if ("text" in record) return { ...record, kind: "text" };
|
|
4646
|
+
if ("file" in record) return { ...record, kind: "file" };
|
|
4647
|
+
return record;
|
|
4648
|
+
});
|
|
4649
|
+
}
|
|
4650
|
+
function normalizeCapturedTaskState(state) {
|
|
4651
|
+
if (typeof state !== "string" || !state.startsWith("TASK_STATE_")) return state;
|
|
4652
|
+
return state.slice("TASK_STATE_".length).toLowerCase().replaceAll("_", "-");
|
|
4653
|
+
}
|
|
4654
|
+
function asRecord(value) {
|
|
4655
|
+
return value != null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4656
|
+
}
|
|
4488
4657
|
function phaseContainsOauthMetadataProbe(phase) {
|
|
4489
4658
|
return phase.steps.some((s) => s.task === "protected_resource_metadata" || s.task === "oauth_auth_server_metadata");
|
|
4490
4659
|
}
|
|
@@ -4575,6 +4744,28 @@ function authHeadersForStep(directive, options) {
|
|
|
4575
4744
|
}
|
|
4576
4745
|
return { authorization: `Bearer ${value}` };
|
|
4577
4746
|
}
|
|
4747
|
+
function createA2AAuthOverrideClient(agentUrl, options, authHeaders) {
|
|
4748
|
+
const headers = {};
|
|
4749
|
+
let auth;
|
|
4750
|
+
for (const [name, value] of Object.entries(authHeaders)) {
|
|
4751
|
+
const lower = name.toLowerCase();
|
|
4752
|
+
if (lower === "authorization" && /^Bearer\s+/i.test(value)) {
|
|
4753
|
+
auth = { type: "bearer", token: value.replace(/^Bearer\s+/i, "") };
|
|
4754
|
+
} else {
|
|
4755
|
+
headers[name] = value;
|
|
4756
|
+
}
|
|
4757
|
+
}
|
|
4758
|
+
return createTestClient(agentUrl, "a2a", {
|
|
4759
|
+
...options,
|
|
4760
|
+
protocol: "a2a",
|
|
4761
|
+
auth,
|
|
4762
|
+
headers: Object.keys(headers).length > 0 ? headers : void 0,
|
|
4763
|
+
test_session_id: void 0,
|
|
4764
|
+
userAgent: void 0,
|
|
4765
|
+
test_kit: void 0,
|
|
4766
|
+
_client: void 0
|
|
4767
|
+
});
|
|
4768
|
+
}
|
|
4578
4769
|
function basicAuthHeadersForStep(directive, options) {
|
|
4579
4770
|
if (directive.value_strategy) {
|
|
4580
4771
|
if (directive.value_strategy !== "random_invalid") return {};
|
|
@@ -4935,7 +5126,8 @@ function createRoutingDispatcher(ctx, options, agents) {
|
|
|
4935
5126
|
client,
|
|
4936
5127
|
agentUrl: url,
|
|
4937
5128
|
instanceIndex: keyToIndex.get(key) ?? 0,
|
|
4938
|
-
profile
|
|
5129
|
+
profile,
|
|
5130
|
+
effectiveOptions: buildAgentOptions(agents[key], options)
|
|
4939
5131
|
};
|
|
4940
5132
|
}
|
|
4941
5133
|
};
|
|
@@ -5025,9 +5217,12 @@ export {
|
|
|
5025
5217
|
evaluateCapabilityPredicate,
|
|
5026
5218
|
getFirstStepPreview,
|
|
5027
5219
|
listStrictOnlyFailures,
|
|
5220
|
+
normalizeCapturedA2AResult,
|
|
5221
|
+
parseLastA2aMessageSendCapture,
|
|
5028
5222
|
resolveCapabilityPath,
|
|
5029
5223
|
runStoryboard,
|
|
5030
5224
|
runStoryboardStep,
|
|
5225
|
+
selectLastA2aSkillCapture,
|
|
5031
5226
|
summarizeStrictValidation
|
|
5032
5227
|
};
|
|
5033
5228
|
//# sourceMappingURL=runner.mjs.map
|