@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.
@@ -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.log(`✅ Identity saved to ${identityPath}`);
129
- console.log(` DID: ${identity.did}`);
130
- console.log(` Key ID: ${identity.keyId}`);
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
@@ -94,7 +94,7 @@ export declare class MCPIRuntime {
94
94
  identity: {
95
95
  did: string | undefined;
96
96
  keyId: string | undefined;
97
- environment: "production" | "development";
97
+ environment: "development" | "production";
98
98
  };
99
99
  session: {
100
100
  activeSessions: number;
@@ -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.log(`✅ XMCP-I Runtime initialized`);
64
- console.log(` DID: ${this.cachedIdentity.did}`);
65
- console.log(` Key ID: ${this.cachedIdentity.keyId}`);
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.log(`✅ Runtime environment check passed`);
215
- console.log(` Environment: ${this.describeEnvironment(env)}`);
216
- console.log(` ESM Support: ${env.supportsESM}`);
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.log(` Node.js: ${env.nodeVersion}`);
218
+ console.error(` Node.js: ${env.nodeVersion}`);
219
219
  }
220
220
  }
221
221
  /**