@kya-os/mcp-i 1.6.14 → 1.6.16

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.
@@ -18,9 +18,28 @@ const kta_registration_1 = require("./kta-registration");
18
18
  * It recreates the alpha `enableMCPIdentityCLI` function.
19
19
  */
20
20
  async function enableMCPIdentityCLI(options = {}) {
21
- const { name, description, repository, endpoint = "https://knowthat.ai", onProgress, skipRegistration = false, } = options;
21
+ const { name, description, repository, endpoint = "https://knowthat.ai", logLevel = "info", onProgress, skipRegistration = false, } = options;
22
22
  let isNewIdentity = false;
23
23
  let capturedClaimUrl;
24
+ // Helper to log based on logLevel
25
+ const log = {
26
+ silent: () => { },
27
+ info: (...args) => {
28
+ if (logLevel === "info" || logLevel === "debug") {
29
+ console.log(...args);
30
+ }
31
+ },
32
+ debug: (...args) => {
33
+ if (logLevel === "debug") {
34
+ console.log(...args);
35
+ }
36
+ },
37
+ warn: (...args) => {
38
+ if (logLevel !== "silent") {
39
+ console.warn(...args);
40
+ }
41
+ },
42
+ };
24
43
  // Helper to emit progress events
25
44
  const emitProgress = async (stage, message, data) => {
26
45
  if (onProgress) {
@@ -29,7 +48,7 @@ async function enableMCPIdentityCLI(options = {}) {
29
48
  }
30
49
  catch (error) {
31
50
  // Continue even if progress callback throws
32
- console.warn("Warning: Progress callback threw an error:", error);
51
+ log.warn("Warning: Progress callback threw an error:", error);
33
52
  }
34
53
  }
35
54
  };
@@ -66,8 +85,8 @@ async function enableMCPIdentityCLI(options = {}) {
66
85
  capturedClaimUrl = registrationResult.claimURL;
67
86
  }
68
87
  catch (error) {
69
- console.warn("Warning: KTA registration failed:", error.message);
70
- console.warn("Continuing with local identity only");
88
+ log.warn("Warning: KTA registration failed:", error.message);
89
+ log.warn("Continuing with local identity only");
71
90
  }
72
91
  }
73
92
  // Step 4: Save (already done by IdentityManager, but emit event for CLI)