@kya-os/mcp-i 1.5.9-canary.11 → 1.5.9-canary.13

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/README.md CHANGED
@@ -274,7 +274,7 @@ xmcp-i dev
274
274
  mcpi build
275
275
 
276
276
  # Platform-specific builds with identity optimization
277
- mcpi build --vercel
277
+ mcpi build --platform vercel
278
278
  mcpi build --lambda
279
279
  mcpi build --docker
280
280
  ```
@@ -2,5 +2,6 @@ export { type Middleware } from "../types/middleware";
2
2
  export type CompilerMode = "development" | "production";
3
3
  export interface CompileOptions {
4
4
  onBuild?: () => void;
5
+ platform?: 'vercel';
5
6
  }
6
- export declare function compile({ onBuild }?: CompileOptions): Promise<void>;
7
+ export declare function compile({ onBuild, platform }?: CompileOptions): Promise<void>;
@@ -40,7 +40,7 @@ const start_http_server_1 = require("./start-http-server");
40
40
  const path_validation_1 = require("../utils/path-validation");
41
41
  const utils_1 = require("./config/utils");
42
42
  dotenv_1.default.config();
43
- async function compile({ onBuild } = {}) {
43
+ async function compile({ onBuild, platform } = {}) {
44
44
  // Initialize compiler context if not already set
45
45
  const mode = process.env.NODE_ENV === "production" ? "production" : "development";
46
46
  // Use compiler context provider to set up the context properly
@@ -50,11 +50,11 @@ async function compile({ onBuild } = {}) {
50
50
  projectRoot: process.cwd(),
51
51
  platforms: {},
52
52
  }, () => {
53
- compileInternal({ onBuild }).then(resolve).catch(reject);
53
+ compileInternal({ onBuild, platform }).then(resolve).catch(reject);
54
54
  });
55
55
  });
56
56
  }
57
- async function compileInternal({ onBuild } = {}) {
57
+ async function compileInternal({ onBuild, platform } = {}) {
58
58
  const { mode } = compiler_context_1.compilerContext.getContext();
59
59
  const { toolPaths } = compiler_context_1.compilerContext.getContext();
60
60
  const startTime = Date.now();
@@ -145,14 +145,33 @@ async function compileInternal({ onBuild } = {}) {
145
145
  onBuild?.();
146
146
  // In production mode, close watcher and compiler, then resolve
147
147
  if (mode === "production") {
148
- watcher.close().then(() => {
148
+ watcher.close().then(async () => {
149
149
  // Close webpack compiler to release all resources
150
- compiler.close((compilerCloseErr) => {
150
+ compiler.close(async (compilerCloseErr) => {
151
151
  if (compilerCloseErr) {
152
152
  console.error('Error closing webpack compiler:', compilerCloseErr);
153
153
  reject(compilerCloseErr);
154
154
  }
155
155
  else {
156
+ // Platform-specific post-build steps
157
+ if (platform === 'vercel') {
158
+ try {
159
+ console.log('\nšŸ“¦ Building Vercel deployment package...');
160
+ // Dynamic import of Vercel build utilities
161
+ // This will be available when @kya-os/mcp-i-vercel is installed
162
+ const vercelModule = await import('@kya-os/mcp-i-vercel/build').catch((importErr) => {
163
+ throw new Error(`Cannot find @kya-os/mcp-i-vercel package. ` +
164
+ `Install it with: npm install @kya-os/mcp-i-vercel\n` +
165
+ `Original error: ${importErr instanceof Error ? importErr.message : String(importErr)}`);
166
+ });
167
+ await vercelModule.buildVercelOutput();
168
+ }
169
+ catch (vercelBuildErr) {
170
+ console.error('Error building Vercel output:', vercelBuildErr);
171
+ reject(vercelBuildErr);
172
+ return;
173
+ }
174
+ }
156
175
  resolve();
157
176
  }
158
177
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/mcp-i",
3
- "version": "1.5.9-canary.11",
3
+ "version": "1.5.9-canary.13",
4
4
  "description": "The TypeScript MCP framework with identity features built-in",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -63,8 +63,8 @@
63
63
  "model-context-protocol"
64
64
  ],
65
65
  "dependencies": {
66
- "@kya-os/contracts": "^1.5.3-canary.8",
67
- "@kya-os/mcp-i-core": "^1.2.2-canary.9",
66
+ "@kya-os/contracts": "^1.5.3-canary.7",
67
+ "@kya-os/mcp-i-core": "^1.2.2-canary.8",
68
68
  "@modelcontextprotocol/sdk": "^1.11.4",
69
69
  "@swc/core": "^1.11.24",
70
70
  "@types/express": "^5.0.1",