@kya-os/mcp-i 1.5.1 → 1.5.3-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler/config/injection.d.ts +5 -1
- package/dist/compiler/config/injection.js +25 -0
- package/dist/compiler/get-webpack-config/get-injected-variables.js +2 -0
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/auth-handshake.d.ts +2 -0
- package/dist/runtime/auth-handshake.js +2 -3
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +13 -1
- package/dist/runtime/mcpi-runtime.d.ts +16 -0
- package/dist/runtime/mcpi-runtime.js +63 -0
- package/dist/runtime/proof-batch-queue.d.ts +3 -0
- package/dist/runtime/proof-batch-queue.js +21 -4
- package/dist/runtime/proof.d.ts +8 -6
- package/dist/runtime/proof.js +35 -16
- package/dist/runtime/request-context.d.ts +37 -0
- package/dist/runtime/request-context.js +56 -0
- package/dist/runtime/session.js +1 -0
- package/dist/runtime/stdio.js +1 -1
- package/dist/runtime/tool-protection-registry.d.ts +94 -0
- package/dist/runtime/tool-protection-registry.js +140 -0
- package/dist/runtime/tool-protection.d.ts +120 -0
- package/dist/runtime/tool-protection.js +192 -0
- package/dist/runtime/transports/http/index.js +2 -1
- package/dist/runtime/utils/tools.js +293 -76
- package/package.json +1 -1
|
@@ -27,4 +27,8 @@ export declare function injectIdentityVariables(identityConfig: any, mode: strin
|
|
|
27
27
|
IDENTITY_CONFIG: string;
|
|
28
28
|
};
|
|
29
29
|
export type IdentityVariables = ReturnType<typeof injectIdentityVariables>;
|
|
30
|
-
export
|
|
30
|
+
export declare function injectRuntimeConfigPath(projectRoot: string): {
|
|
31
|
+
RUNTIME_CONFIG_PATH: string;
|
|
32
|
+
};
|
|
33
|
+
export type RuntimeConfigVariables = ReturnType<typeof injectRuntimeConfigPath>;
|
|
34
|
+
export type InjectedVariables = HttpVariables | CorsVariables | OAuthVariables | PathsVariables | StdioVariables | IdentityVariables | RuntimeConfigVariables;
|
|
@@ -6,6 +6,7 @@ exports.injectOAuthVariables = injectOAuthVariables;
|
|
|
6
6
|
exports.injectPathsVariables = injectPathsVariables;
|
|
7
7
|
exports.injectStdioVariables = injectStdioVariables;
|
|
8
8
|
exports.injectIdentityVariables = injectIdentityVariables;
|
|
9
|
+
exports.injectRuntimeConfigPath = injectRuntimeConfigPath;
|
|
9
10
|
const utils_1 = require("./utils");
|
|
10
11
|
function injectHttpVariables(httpConfig, mode) {
|
|
11
12
|
const resolvedConfig = (0, utils_1.getResolvedHttpConfig)(httpConfig);
|
|
@@ -95,3 +96,27 @@ function injectIdentityVariables(identityConfig, mode, projectRoot) {
|
|
|
95
96
|
})),
|
|
96
97
|
};
|
|
97
98
|
}
|
|
99
|
+
function injectRuntimeConfigPath(projectRoot) {
|
|
100
|
+
// Check if mcpi-runtime-config.ts exists in the project
|
|
101
|
+
const fs = require("fs");
|
|
102
|
+
const path = require("path");
|
|
103
|
+
// Try multiple possible locations
|
|
104
|
+
const possiblePaths = [
|
|
105
|
+
path.join(projectRoot, "src/mcpi-runtime-config.ts"),
|
|
106
|
+
path.join(projectRoot, "src/mcpi-runtime-config.js"),
|
|
107
|
+
path.join(projectRoot, "mcpi-runtime-config.ts"),
|
|
108
|
+
path.join(projectRoot, "mcpi-runtime-config.js"),
|
|
109
|
+
];
|
|
110
|
+
let runtimeConfigPath = null;
|
|
111
|
+
for (const p of possiblePaths) {
|
|
112
|
+
if (fs.existsSync(p)) {
|
|
113
|
+
runtimeConfigPath = p;
|
|
114
|
+
console.log("[COMPILER] Found runtime config at:", p);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Double-stringify for webpack DefinePlugin
|
|
119
|
+
return {
|
|
120
|
+
RUNTIME_CONFIG_PATH: JSON.stringify(JSON.stringify(runtimeConfigPath)),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -16,6 +16,7 @@ function getInjectedVariables(xmcpConfig) {
|
|
|
16
16
|
const pathsVariables = (0, injection_1.injectPathsVariables)(xmcpConfig);
|
|
17
17
|
const stdioVariables = (0, injection_1.injectStdioVariables)(xmcpConfig.stdio);
|
|
18
18
|
const identityVariables = (0, injection_1.injectIdentityVariables)(xmcpConfig.identity, mode, projectRoot);
|
|
19
|
+
const runtimeConfigVariables = (0, injection_1.injectRuntimeConfigPath)(projectRoot);
|
|
19
20
|
return {
|
|
20
21
|
...httpVariables,
|
|
21
22
|
...corsVariables,
|
|
@@ -23,5 +24,6 @@ function getInjectedVariables(xmcpConfig) {
|
|
|
23
24
|
...pathsVariables,
|
|
24
25
|
...stdioVariables,
|
|
25
26
|
...identityVariables,
|
|
27
|
+
...runtimeConfigVariables,
|
|
26
28
|
};
|
|
27
29
|
}
|