UNPKG

@kya-os/mcp-i

Version:

The TypeScript MCP framework with identity features built-in

25 lines (24 loc) 865 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getXmcpConfig = exports.compilerContextProvider = exports.compilerContext = void 0; const context_1 = require("../utils/context"); exports.compilerContext = (0, context_1.createContext)({ name: "xmcp-compiler", }); // Preset some defaults for the compiler context const compilerContextProvider = (initialValue, callback) => { return exports.compilerContext.provider({ ...initialValue, toolPaths: new Set(), hasMiddleware: false, }, callback); }; exports.compilerContextProvider = compilerContextProvider; const getXmcpConfig = () => { const { xmcpConfig } = exports.compilerContext.getContext(); if (!xmcpConfig) { throw new Error("xmcp config not found"); } return xmcpConfig; }; exports.getXmcpConfig = getXmcpConfig;