@kya-os/mcp-i 1.6.1 → 1.6.2-canary.0

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.
@@ -43,8 +43,6 @@ export interface CLIIdentityResult {
43
43
  did: string;
44
44
  claimUrl?: string;
45
45
  registryUrl: string;
46
- agentId?: string;
47
- agentSlug?: string;
48
46
  };
49
47
  }
50
48
  /**
@@ -9,7 +9,6 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.enableMCPIdentityCLI = enableMCPIdentityCLI;
11
11
  const identity_1 = require("../runtime/identity");
12
- const did_helpers_1 = require("@kya-os/mcp-i-core/utils/did-helpers");
13
12
  const kta_registration_1 = require("./kta-registration");
14
13
  /**
15
14
  * Enable MCP Identity for CLI
@@ -53,8 +52,7 @@ async function enableMCPIdentityCLI(options = {}) {
53
52
  if (!skipRegistration && isNewIdentity) {
54
53
  await emitProgress("registering", "Registering with Know-That-AI...");
55
54
  try {
56
- // Use fast CLI registration endpoint for immediate response
57
- registrationResult = await (0, kta_registration_1.registerWithKTACLI)({
55
+ registrationResult = await (0, kta_registration_1.registerWithKTA)({
58
56
  did: identity.did,
59
57
  publicKey: identity.publicKey,
60
58
  kid: identity.kid,
@@ -76,10 +74,10 @@ async function enableMCPIdentityCLI(options = {}) {
76
74
  await emitProgress("complete", "Identity setup complete!", {
77
75
  claimUrl: capturedClaimUrl,
78
76
  });
79
- // Use agent metadata from registration result if available, otherwise extract from DID
80
- const agentId = registrationResult?.agentId || (0, did_helpers_1.extractAgentId)(identity.did);
81
- const agentSlug = registrationResult?.agentSlug || (0, did_helpers_1.extractAgentSlug)(identity.did);
82
- const registryUrl = registrationResult?.agentURL || `https://knowthat.ai/agents/${agentSlug}`;
77
+ // Generate registry URL
78
+ const didParts = identity.did.split(":");
79
+ const agentId = didParts[didParts.length - 1];
80
+ const registryUrl = `https://knowthat.ai/agents/${agentId}`;
83
81
  return {
84
82
  identity,
85
83
  metadata: {
@@ -87,8 +85,6 @@ async function enableMCPIdentityCLI(options = {}) {
87
85
  did: identity.did,
88
86
  claimUrl: capturedClaimUrl,
89
87
  registryUrl,
90
- agentId,
91
- agentSlug,
92
88
  },
93
89
  };
94
90
  }
@@ -24,9 +24,7 @@ export interface KTARegistrationResult {
24
24
  agentDID: string;
25
25
  agentURL: string;
26
26
  agentId: string;
27
- agentSlug: string;
28
27
  claimURL: string;
29
- claimToken?: string;
30
28
  verificationEndpoint: string;
31
29
  conformanceCapabilities: readonly string[];
32
30
  mirrorStatus: "pending" | "success" | "error";
@@ -39,10 +37,3 @@ export interface KTARegistrationResult {
39
37
  * Returns registration details including claim URL.
40
38
  */
41
39
  export declare function registerWithKTA(options: KTARegistrationOptions): Promise<KTARegistrationResult>;
42
- /**
43
- * Register agent with Know-That-AI using fast CLI endpoint
44
- *
45
- * Uses the /cli-register endpoint which returns immediately without polling.
46
- * Returns claimUrl and claimToken for browser-based claiming.
47
- */
48
- export declare function registerWithKTACLI(options: KTARegistrationOptions): Promise<KTARegistrationResult>;
@@ -10,7 +10,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.registerWithKTA = registerWithKTA;
13
- exports.registerWithKTACLI = registerWithKTACLI;
14
13
  const axios_1 = __importDefault(require("axios"));
15
14
  /**
16
15
  * MCP-I Capabilities (from contracts)
@@ -63,9 +62,7 @@ async function registerWithKTA(options) {
63
62
  agentDID: did,
64
63
  agentURL: data.agentURL || data.agentUrl || `${endpoint}/agents/by-did/${encodeURIComponent(did)}`,
65
64
  agentId: data.agentId || agentId,
66
- agentSlug: data.agentSlug || data.agent?.slug || agentId,
67
65
  claimURL: data.claimURL || data.claimUrl || `${endpoint}/claim/${agentId}`,
68
- claimToken: data.claimToken,
69
66
  verificationEndpoint,
70
67
  conformanceCapabilities: MCP_I_CAPABILITIES,
71
68
  mirrorStatus: data.mirrorStatus || "pending",
@@ -94,75 +91,3 @@ async function registerWithKTA(options) {
94
91
  throw new Error(`Failed to register with KTA: ${error.message}`);
95
92
  }
96
93
  }
97
- /**
98
- * Register agent with Know-That-AI using fast CLI endpoint
99
- *
100
- * Uses the /cli-register endpoint which returns immediately without polling.
101
- * Returns claimUrl and claimToken for browser-based claiming.
102
- */
103
- async function registerWithKTACLI(options) {
104
- const { did, publicKey, kid, name, description, repository, endpoint = "https://knowthat.ai", } = options;
105
- try {
106
- // Construct verification endpoint from DID
107
- const verificationEndpoint = did.includes("localhost")
108
- ? `http://localhost:3000/.well-known/did.json`
109
- : `${did.replace("did:web:", "https://").replace(":", "/")}/.well-known/did.json`;
110
- // Prepare registration payload for CLI endpoint
111
- const payload = {
112
- name,
113
- description,
114
- githubRepo: repository,
115
- publicKey,
116
- kid,
117
- did,
118
- verificationEndpoint,
119
- capabilities: MCP_I_CAPABILITIES,
120
- };
121
- // Make registration request to CLI endpoint
122
- const response = await axios_1.default.post(`${endpoint}/api/agents/cli-register`, payload, {
123
- headers: {
124
- "Content-Type": "application/json",
125
- "User-Agent": "@kya-os/mcp-i-cli",
126
- },
127
- timeout: 30000, // 30 second timeout
128
- });
129
- const data = response.data;
130
- // Extract agent ID and slug from response
131
- const agentId = data.agent?.id || did.split(":").pop() || `agent-${Date.now()}`;
132
- const agentSlug = data.agent?.slug || agentId;
133
- // Build result structure from CLI registration response
134
- const result = {
135
- agentDID: data.did || did,
136
- agentURL: data.agent?.url || `${endpoint}/agents/${agentSlug}`,
137
- agentId,
138
- agentSlug,
139
- claimURL: data.claimUrl || `${endpoint}/agents/claim?did=${encodeURIComponent(did)}`,
140
- claimToken: data.claimToken,
141
- verificationEndpoint,
142
- conformanceCapabilities: MCP_I_CAPABILITIES,
143
- mirrorStatus: "pending", // CLI register doesn't poll for mirror status
144
- mirrorLink: `${endpoint}/agents/pending`,
145
- };
146
- return result;
147
- }
148
- catch (error) {
149
- // Handle different error types
150
- if (axios_1.default.isAxiosError(error)) {
151
- if (error.code === "ECONNREFUSED") {
152
- throw new Error(`Could not connect to KTA registry at ${endpoint}. ` +
153
- "Please check your internet connection or try again later.");
154
- }
155
- if (error.response?.status === 503) {
156
- throw new Error("KTA registry is temporarily unavailable (maintenance mode). " +
157
- "Please try again in a few minutes.");
158
- }
159
- if (error.response?.status === 429) {
160
- throw new Error("Rate limit exceeded. Please wait a moment and try again.");
161
- }
162
- if (error.response?.data?.message) {
163
- throw new Error(`KTA registration failed: ${error.response.data.message}`);
164
- }
165
- }
166
- throw new Error(`Failed to register with KTA: ${error.message}`);
167
- }
168
- }
@@ -11,8 +11,8 @@ const compiler_context_1 = require("../compiler-context");
11
11
  const get_entries_1 = require("./get-entries");
12
12
  const get_injected_variables_1 = require("./get-injected-variables");
13
13
  const resolve_tsconfig_paths_1 = require("./resolve-tsconfig-paths");
14
+ const clean_webpack_plugin_1 = require("clean-webpack-plugin");
14
15
  const plugins_1 = require("./plugins");
15
- const fs_extra_1 = __importDefault(require("fs-extra"));
16
16
  const get_externals_1 = require("./get-externals");
17
17
  /** Creates the webpack configuration that xmcp will use to bundle the user's code */
18
18
  function getWebpackConfig(xmcpConfig) {
@@ -87,16 +87,7 @@ function getWebpackConfig(xmcpConfig) {
87
87
  // add clean plugin
88
88
  if (!xmcpConfig.experimental?.adapter) {
89
89
  // not needed in adapter mode since it only outputs one file
90
- // Simple cleanup plugin using fs-extra (replaces CleanWebpackPlugin)
91
- config.plugins.push({
92
- apply: (compiler) => {
93
- compiler.hooks.beforeCompile.tap("CleanOutputPlugin", () => {
94
- if (fs_extra_1.default.pathExistsSync(outputPath)) {
95
- fs_extra_1.default.removeSync(outputPath);
96
- }
97
- });
98
- },
99
- });
90
+ config.plugins.push(new clean_webpack_plugin_1.CleanWebpackPlugin());
100
91
  }
101
92
  // add shebang to CLI output on stdio mode
102
93
  if (xmcpConfig.stdio) {
@@ -1,3 +1,9 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
1
7
  /*!
2
8
  * fill-range <https://github.com/jonschlinkert/fill-range>
3
9
  *