@kya-os/mcp-i 1.2.6 → 1.2.8
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/compiler-context.d.ts +2 -0
- package/dist/compiler/config/index.d.ts +33 -0
- package/dist/compiler/config/index.js +1 -0
- package/dist/compiler/config/injection.d.ts +5 -1
- package/dist/compiler/config/injection.js +47 -8
- package/dist/compiler/config/schemas/identity.d.ts +24 -0
- package/dist/compiler/config/schemas/identity.js +22 -0
- package/dist/compiler/config/schemas/index.d.ts +1 -0
- package/dist/compiler/config/schemas/index.js +3 -1
- package/dist/compiler/get-webpack-config/get-injected-variables.js +3 -1
- package/dist/compiler/get-webpack-config/index.js +1 -1
- package/dist/compiler/get-webpack-config/plugins.js +3 -3
- package/dist/compiler/index.js +1 -0
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/adapters/nextjs/index.js +6 -1
- package/dist/runtime/demo.js +3 -3
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/identity.js +16 -4
- package/dist/runtime/mcpi-runtime.d.ts +1 -1
- package/dist/runtime/mcpi-runtime.js +7 -7
- package/dist/runtime/stdio.js +1 -1
- package/dist/runtime/transports/stdio/index.js +3 -3
- package/dist/runtime/utils/server.d.ts +9 -7
- package/dist/runtime/utils/server.js +51 -10
- package/dist/runtime/utils/tools.d.ts +18 -1
- package/dist/runtime/utils/tools.js +93 -2
- package/package.json +1 -1
package/dist/runtime/identity.js
CHANGED
|
@@ -27,11 +27,23 @@ class IdentityManager {
|
|
|
27
27
|
config;
|
|
28
28
|
cachedIdentity;
|
|
29
29
|
constructor(config = { environment: "development" }) {
|
|
30
|
+
// Resolve devIdentityPath to absolute if needed
|
|
31
|
+
const path = require("path");
|
|
32
|
+
let resolvedDevIdentityPath = config.devIdentityPath || ".mcpi/identity.json";
|
|
33
|
+
// If path is relative, resolve it relative to process.cwd() (the project root when the server starts)
|
|
34
|
+
if (!path.isAbsolute(resolvedDevIdentityPath)) {
|
|
35
|
+
resolvedDevIdentityPath = path.resolve(process.cwd(), resolvedDevIdentityPath);
|
|
36
|
+
}
|
|
30
37
|
this.config = {
|
|
31
38
|
privacyMode: false, // Single public DID default
|
|
32
|
-
devIdentityPath: ".mcpi/identity.json",
|
|
33
39
|
...config,
|
|
40
|
+
devIdentityPath: resolvedDevIdentityPath,
|
|
34
41
|
};
|
|
42
|
+
// Debug: log the actual config being used
|
|
43
|
+
console.error("[IdentityManager] Constructed with config:", {
|
|
44
|
+
environment: this.config.environment,
|
|
45
|
+
devIdentityPath: this.config.devIdentityPath,
|
|
46
|
+
});
|
|
35
47
|
}
|
|
36
48
|
/**
|
|
37
49
|
* Load or generate agent identity
|
|
@@ -125,9 +137,9 @@ class IdentityManager {
|
|
|
125
137
|
await (0, promises_1.writeFile)(identityPath, JSON.stringify(devIdentity, null, 2), {
|
|
126
138
|
mode: 0o600,
|
|
127
139
|
});
|
|
128
|
-
console.
|
|
129
|
-
console.
|
|
130
|
-
console.
|
|
140
|
+
console.error(`✅ Identity saved to ${identityPath}`);
|
|
141
|
+
console.error(` DID: ${identity.did}`);
|
|
142
|
+
console.error(` Key ID: ${identity.keyId}`);
|
|
131
143
|
}
|
|
132
144
|
/**
|
|
133
145
|
* Load production identity from environment variables
|
|
@@ -60,9 +60,9 @@ class MCPIRuntime {
|
|
|
60
60
|
identityBadge: this.config.demo?.identityBadge || false,
|
|
61
61
|
environment: this.config.identity?.environment || "development",
|
|
62
62
|
});
|
|
63
|
-
console.
|
|
64
|
-
console.
|
|
65
|
-
console.
|
|
63
|
+
console.error(`✅ XMCP-I Runtime initialized`);
|
|
64
|
+
console.error(` DID: ${this.cachedIdentity.did}`);
|
|
65
|
+
console.error(` Key ID: ${this.cachedIdentity.keyId}`);
|
|
66
66
|
// Show verify link in development (default true)
|
|
67
67
|
const showVerifyLink = this.config.runtime?.showVerifyLink !== false;
|
|
68
68
|
demo_1.DemoConsole.printVerifyLink(showVerifyLink, this.config.identity?.environment || "development");
|
|
@@ -211,11 +211,11 @@ class MCPIRuntime {
|
|
|
211
211
|
error.code = "XMCP_I_ERUNTIME";
|
|
212
212
|
throw error;
|
|
213
213
|
}
|
|
214
|
-
console.
|
|
215
|
-
console.
|
|
216
|
-
console.
|
|
214
|
+
console.error(`✅ Runtime environment check passed`);
|
|
215
|
+
console.error(` Environment: ${this.describeEnvironment(env)}`);
|
|
216
|
+
console.error(` ESM Support: ${env.supportsESM}`);
|
|
217
217
|
if (env.nodeVersion) {
|
|
218
|
-
console.
|
|
218
|
+
console.error(` Node.js: ${env.nodeVersion}`);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
/**
|