30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
// Metro module 936 (f937).
|
|
import { DEBUG_BUILD } from "./Module823";
|
|
import { debug } from "./consoleSandbox";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
export function isJsonRpcNotification(a0) {
|
|
return (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && "jsonrpc" in a0 && a0.jsonrpc === "2.0" && "method" in a0 && !("id" in a0);
|
|
}
|
|
export function isJsonRpcRequest(a0) {
|
|
return (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && "jsonrpc" in a0 && a0.jsonrpc === "2.0" && "method" in a0 && "id" in a0;
|
|
}
|
|
export function isJsonRpcResponse(a0) {
|
|
return (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && "jsonrpc" in a0 && a0.jsonrpc === "2.0" && "id" in a0 && ("result" in a0 || "error" in a0);
|
|
}
|
|
export function isValidContentItem(a0) {
|
|
return a0 != null && typeof a0 === "object";
|
|
}
|
|
export function validateMcpServerInstance(a0) {
|
|
let r0 = (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && "resource" in a0 && "tool" in a0 && "prompt" in a0 && "connect" in a0;
|
|
if (!r0) {
|
|
r0 = false;
|
|
if (DEBUG_BUILD) {
|
|
debug.warn("Did not patch MCP server. Interface is incompatible.");
|
|
r0 = false;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|