decord/source/936_isJsonRpcNotification.js
2026-08-04 21:03:28 +00:00

101 lines
2.2 KiB
JavaScript

// Module ID: 936
// Function ID: 937
// Name: isJsonRpcNotification
// Dependencies: [823, 824]
// Module 936 (isJsonRpcNotification)
const require = arg1;
const dependencyMap = arg6;
Object.defineProperty(arg5, Symbol.toStringTag, { value: "Module" });
arg5.isJsonRpcNotification = function isJsonRpcNotification(closure_2) {
let tmp = typeof closure_2 === "object";
if (typeof closure_2 === "object") {
tmp = null !== closure_2;
}
if (tmp) {
tmp = "jsonrpc" in closure_2;
}
if (tmp) {
tmp = "2.0" === closure_2.jsonrpc;
}
if (tmp) {
tmp = "method" in closure_2;
}
if (tmp) {
tmp = !("id" in closure_2);
}
return tmp;
};
arg5.isJsonRpcRequest = function isJsonRpcRequest(method) {
let tmp = typeof method === "object";
if (typeof method === "object") {
tmp = null !== method;
}
if (tmp) {
tmp = "jsonrpc" in method;
}
if (tmp) {
tmp = "2.0" === method.jsonrpc;
}
if (tmp) {
tmp = "method" in method;
}
if (tmp) {
tmp = "id" in method;
}
return tmp;
};
arg5.isJsonRpcResponse = function isJsonRpcResponse(closure_2) {
let tmp = typeof closure_2 === "object";
if (typeof closure_2 === "object") {
tmp = null !== closure_2;
}
if (tmp) {
tmp = "jsonrpc" in closure_2;
}
if (tmp) {
tmp = "2.0" === closure_2.jsonrpc;
}
if (tmp) {
tmp = "id" in closure_2;
}
if (tmp) {
let tmp2 = "result" in closure_2;
if (!tmp2) {
tmp2 = "error" in closure_2;
}
tmp = tmp2;
}
return tmp;
};
arg5.isValidContentItem = function isValidContentItem(clientInfo) {
return null != clientInfo && typeof clientInfo === "object";
};
arg5.validateMcpServerInstance = function validateMcpServerInstance(obj) {
let flag = typeof obj === "object";
if (typeof obj === "object") {
flag = null !== obj;
}
if (flag) {
flag = "resource" in obj;
}
if (flag) {
flag = "tool" in obj;
}
if (flag) {
flag = "prompt" in obj;
}
if (flag) {
flag = "connect" in obj;
}
if (!flag) {
flag = false;
if (require(823) /* __SENTRY_DEBUG__ */.DEBUG_BUILD) {
const debug = tmp(824).debug;
debug.warn("Did not patch MCP server. Interface is incompatible.");
flag = false;
}
tmp = require;
}
return flag;
};