fix(browser)!: preserve payload shapes and WebMCP declarations

Retain primitive and nested array types with typed paths, and compare only mutually observed body shapes while preserving selected coverage uncertainty. Return full untrusted WebMCP input declarations with canonical digests, without resolving references or invoking tools.

BREAKING CHANGE: JSON shape paths now contain typed property and array-element segments. WebMCP input_schema_shape is replaced by input_schema and input_schema_sha256, retaining declared examples and defaults.
This commit is contained in:
morluto
2026-10-10 06:20:28 +08:00
parent d79317cda0
commit 4951a897c5
12 changed files with 463 additions and 85 deletions
+12 -3
View File
@@ -209,10 +209,16 @@ export function assertSensitiveShapes(result) {
(item) =>
item.url.includes("/api") &&
item.body_shapes.request?.properties.some(
({ path }) => path === "/token",
({ path }) =>
path.length === 1 &&
path[0].kind === "property" &&
path[0].name === "token",
) &&
item.body_shapes.response?.properties.some(
({ path }) => path === "/secret",
({ path }) =>
path.length === 1 &&
path[0].kind === "property" &&
path[0].name === "secret",
),
);
if (request === undefined)
@@ -244,7 +250,10 @@ export function assertSensitiveShapes(result) {
(event) =>
event.payload_shape?.format === "json" &&
event.payload_shape.json_shape?.properties.some(
({ path }) => path === "/token",
({ path }) =>
path.length === 1 &&
path[0].kind === "property" &&
path[0].name === "token",
),
)
)