fix(browser): distinguish WebMCP registration frame owners (#813)
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -410,7 +410,7 @@ const normalizeTool = (
|
||||
const description = stringValue(value.description) ?? "";
|
||||
const annotations = recordValue(value.annotations);
|
||||
return {
|
||||
tool_key: toolKey(frame.url, name),
|
||||
tool_key: toolKey(frame.url, frameId, name),
|
||||
name,
|
||||
description,
|
||||
frame_id: frameId,
|
||||
@@ -497,8 +497,8 @@ const buildWebMcpResult = (options: WebMcpResultOptions): WebMcpDiscovery => {
|
||||
};
|
||||
};
|
||||
|
||||
const toolKey = (frameUrl: string, name: string): string =>
|
||||
`webmcp_${createHash("sha256").update(`${frameUrl}\0${name}`).digest("hex")}`;
|
||||
const toolKey = (frameUrl: string, frameId: string, name: string): string =>
|
||||
`webmcp_${createHash("sha256").update(`${frameUrl}\0${frameId}\0${name}`).digest("hex")}`;
|
||||
|
||||
const booleanOrNull = (value: unknown): boolean | null =>
|
||||
typeof value === "boolean" ? value : null;
|
||||
|
||||
Reference in New Issue
Block a user