fix: Remove redundant type
This commit is contained in:
parent
2ab7d625e4
commit
b000fc25bb
1 changed files with 7 additions and 11 deletions
|
|
@ -30,7 +30,6 @@ import {
|
||||||
Progress,
|
Progress,
|
||||||
LoggingLevel,
|
LoggingLevel,
|
||||||
ElicitRequestSchema,
|
ElicitRequestSchema,
|
||||||
JSONRPCMessage,
|
|
||||||
isJSONRPCRequest,
|
isJSONRPCRequest,
|
||||||
} from "@modelcontextprotocol/sdk/types.js";
|
} from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
||||||
|
|
@ -687,22 +686,19 @@ export function useConnection({
|
||||||
|
|
||||||
const protocolOnMessage = transport.onmessage;
|
const protocolOnMessage = transport.onmessage;
|
||||||
if (protocolOnMessage) {
|
if (protocolOnMessage) {
|
||||||
transport.onmessage = (message: JSONRPCMessage) => {
|
transport.onmessage = (message) => {
|
||||||
// Resolve $ref references in requests before validation
|
// Resolve $ref references in requests before validation
|
||||||
if (isJSONRPCRequest(message) && message.params?.requestedSchema) {
|
if (isJSONRPCRequest(message) && message.params?.requestedSchema) {
|
||||||
const requestedSchema = message.params
|
const requestedSchema = message.params
|
||||||
.requestedSchema as JsonSchemaType;
|
.requestedSchema as JsonSchemaType;
|
||||||
if (requestedSchema?.properties) {
|
if (requestedSchema?.properties) {
|
||||||
const resolvedProperties = Object.fromEntries(
|
const resolvedProperties = Object.fromEntries(
|
||||||
Object.entries(
|
Object.entries(requestedSchema.properties).map(
|
||||||
requestedSchema.properties as Record<
|
([key, propSchema]) => [
|
||||||
string,
|
key,
|
||||||
JsonSchemaType
|
resolveRef(propSchema, requestedSchema),
|
||||||
>,
|
],
|
||||||
).map(([key, propSchema]) => [
|
),
|
||||||
key,
|
|
||||||
resolveRef(propSchema, requestedSchema),
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
message.params = {
|
message.params = {
|
||||||
...message.params,
|
...message.params,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue