@kya-os/mcp-i 1.6.1 → 1.6.2-canary.clientinfo.20251126041014
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/index.js +12 -2
- package/dist/compiler/parse-xmcp-config.js +5 -0
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/mcpi-runtime.js +7 -1
- package/dist/runtime/session.d.ts +13 -0
- package/dist/runtime/session.js +43 -0
- package/dist/runtime/stdio.js +1 -1
- package/dist/runtime/utils/tools.js +196 -23
- package/package.json +1 -1
package/dist/compiler/index.js
CHANGED
|
@@ -121,6 +121,11 @@ async function compileInternal({ onBuild } = {}) {
|
|
|
121
121
|
(0, fs_utils_1.createFolder)(constants_1.runtimeFolderPath);
|
|
122
122
|
generateCode();
|
|
123
123
|
const compiler = (0, webpack_1.webpack)(webpackConfig);
|
|
124
|
+
// Webpack returns null if config is invalid
|
|
125
|
+
if (!compiler) {
|
|
126
|
+
reject(new Error("Failed to create webpack compiler - invalid config"));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
124
129
|
const handleCompilation = (err, stats) => {
|
|
125
130
|
if (err) {
|
|
126
131
|
console.error(err);
|
|
@@ -179,9 +184,14 @@ async function compileInternal({ onBuild } = {}) {
|
|
|
179
184
|
const watching = compiler.watch({}, handleCompilation);
|
|
180
185
|
// Store watching instance for proper cleanup
|
|
181
186
|
process.on('SIGINT', () => {
|
|
182
|
-
watching
|
|
187
|
+
if (watching) {
|
|
188
|
+
watching.close(() => {
|
|
189
|
+
process.exit(0);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
183
193
|
process.exit(0);
|
|
184
|
-
}
|
|
194
|
+
}
|
|
185
195
|
});
|
|
186
196
|
}
|
|
187
197
|
});
|
|
@@ -116,6 +116,11 @@ async function compileConfig() {
|
|
|
116
116
|
};
|
|
117
117
|
return new Promise((resolve, reject) => {
|
|
118
118
|
const compiler = (0, webpack_1.webpack)(webpackConfig);
|
|
119
|
+
// Webpack returns null if config is invalid
|
|
120
|
+
if (!compiler) {
|
|
121
|
+
reject(new Error("Failed to create webpack compiler - invalid config"));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
119
124
|
// Use memory filesystem for output
|
|
120
125
|
compiler.outputFileSystem = memoryFs;
|
|
121
126
|
compiler.run((err, stats) => {
|