@kya-os/mcp-i 1.5.9-canary.9 → 1.6.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.
- package/dist/295.js +1 -1
- package/dist/cli-adapter/index.d.ts +2 -0
- package/dist/cli-adapter/index.js +9 -5
- package/dist/cli-adapter/kta-registration.d.ts +9 -0
- package/dist/cli-adapter/kta-registration.js +75 -0
- package/dist/compiler/get-webpack-config/index.js +11 -2
- package/dist/index.js.LICENSE.txt +0 -6
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/audit.d.ts +4 -0
- package/dist/runtime/audit.js +6 -2
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/identity.d.ts +12 -0
- package/dist/runtime/identity.js +15 -1
- package/dist/runtime/mcpi-runtime-wrapper.d.ts +2 -3
- package/dist/runtime/mcpi-runtime-wrapper.js +20 -17
- package/dist/runtime/stdio.js +1 -1
- package/package.json +19 -20
|
@@ -111,6 +111,18 @@ export declare class IdentityManager {
|
|
|
111
111
|
* Default identity manager instance
|
|
112
112
|
*/
|
|
113
113
|
export declare const defaultIdentityManager: IdentityManager;
|
|
114
|
+
/**
|
|
115
|
+
* Extract agent ID from DID
|
|
116
|
+
* @deprecated Use extractAgentId from @kya-os/mcp-i-core/utils/did-helpers instead
|
|
117
|
+
* This re-export is maintained for backward compatibility
|
|
118
|
+
*/
|
|
119
|
+
export { extractAgentId } from '@kya-os/mcp-i-core/utils/did-helpers';
|
|
120
|
+
/**
|
|
121
|
+
* Extract agent slug from DID
|
|
122
|
+
* @deprecated Use extractAgentSlug from @kya-os/mcp-i-core/utils/did-helpers instead
|
|
123
|
+
* This re-export is maintained for backward compatibility
|
|
124
|
+
*/
|
|
125
|
+
export { extractAgentSlug } from '@kya-os/mcp-i-core/utils/did-helpers';
|
|
114
126
|
/**
|
|
115
127
|
* Convenience function to ensure identity
|
|
116
128
|
*/
|
package/dist/runtime/identity.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and production environments according to requirements 4.1-4.4.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.defaultIdentityManager = exports.IdentityManager = exports.IDENTITY_ERRORS = void 0;
|
|
9
|
+
exports.extractAgentSlug = exports.extractAgentId = exports.defaultIdentityManager = exports.IdentityManager = exports.IDENTITY_ERRORS = void 0;
|
|
10
10
|
exports.ensureIdentity = ensureIdentity;
|
|
11
11
|
const promises_1 = require("fs/promises");
|
|
12
12
|
const fs_1 = require("fs");
|
|
@@ -291,6 +291,20 @@ exports.IdentityManager = IdentityManager;
|
|
|
291
291
|
* Default identity manager instance
|
|
292
292
|
*/
|
|
293
293
|
exports.defaultIdentityManager = new IdentityManager();
|
|
294
|
+
/**
|
|
295
|
+
* Extract agent ID from DID
|
|
296
|
+
* @deprecated Use extractAgentId from @kya-os/mcp-i-core/utils/did-helpers instead
|
|
297
|
+
* This re-export is maintained for backward compatibility
|
|
298
|
+
*/
|
|
299
|
+
var did_helpers_1 = require("@kya-os/mcp-i-core/utils/did-helpers");
|
|
300
|
+
Object.defineProperty(exports, "extractAgentId", { enumerable: true, get: function () { return did_helpers_1.extractAgentId; } });
|
|
301
|
+
/**
|
|
302
|
+
* Extract agent slug from DID
|
|
303
|
+
* @deprecated Use extractAgentSlug from @kya-os/mcp-i-core/utils/did-helpers instead
|
|
304
|
+
* This re-export is maintained for backward compatibility
|
|
305
|
+
*/
|
|
306
|
+
var did_helpers_2 = require("@kya-os/mcp-i-core/utils/did-helpers");
|
|
307
|
+
Object.defineProperty(exports, "extractAgentSlug", { enumerable: true, get: function () { return did_helpers_2.extractAgentSlug; } });
|
|
294
308
|
/**
|
|
295
309
|
* Convenience function to ensure identity
|
|
296
310
|
*/
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
* Node.js-specific runtime that extends the core runtime with Node.js providers.
|
|
5
5
|
* Provides backward compatibility by accepting legacy configuration format.
|
|
6
6
|
*/
|
|
7
|
-
import { MCPIRuntimeBase, AccessControlApiService, ProofVerifier } from
|
|
8
|
-
import type { MCPIRuntimeConfig } from
|
|
7
|
+
import { MCPIRuntimeBase, AccessControlApiService, ProofVerifier } from "@kya-os/mcp-i-core";
|
|
8
|
+
import type { MCPIRuntimeConfig } from "./mcpi-runtime";
|
|
9
9
|
/**
|
|
10
10
|
* Node.js-specific runtime implementation
|
|
11
11
|
*/
|
|
12
12
|
export declare class MCPINodeRuntimeWrapper extends MCPIRuntimeBase {
|
|
13
13
|
private legacyConfig;
|
|
14
|
-
protected accessControlService?: AccessControlApiService;
|
|
15
14
|
constructor(config?: MCPIRuntimeConfig);
|
|
16
15
|
/**
|
|
17
16
|
* Set AccessControlApiService (for testing or manual injection)
|
|
@@ -21,8 +21,7 @@ function createProvidersFromConfig(config) {
|
|
|
21
21
|
const cryptoProvider = new node_providers_1.NodeCryptoProvider();
|
|
22
22
|
const clockProvider = new node_providers_1.NodeClockProvider();
|
|
23
23
|
const fetchProvider = new node_providers_1.NodeFetchProvider();
|
|
24
|
-
const identityPath = config.identity?.devIdentityPath ||
|
|
25
|
-
path_1.default.join(process.cwd(), '.mcp-i');
|
|
24
|
+
const identityPath = config.identity?.devIdentityPath || path_1.default.join(process.cwd(), ".mcp-i");
|
|
26
25
|
const storageProvider = new node_providers_1.FileStorageProvider(identityPath);
|
|
27
26
|
const identityProvider = new node_providers_1.FileIdentityProvider(identityPath, cryptoProvider);
|
|
28
27
|
const nonceCacheProvider = (0, node_providers_1.getNonceCacheProvider)();
|
|
@@ -33,21 +32,25 @@ function createProvidersFromConfig(config) {
|
|
|
33
32
|
storageProvider,
|
|
34
33
|
nonceCacheProvider,
|
|
35
34
|
identityProvider,
|
|
36
|
-
environment: config.identity?.environment ||
|
|
35
|
+
environment: config.identity?.environment || "development",
|
|
37
36
|
session: {
|
|
38
37
|
timestampSkewSeconds: config.session?.timestampSkewSeconds || 120,
|
|
39
|
-
ttlMinutes: config.session?.sessionTtlMinutes || 30
|
|
38
|
+
ttlMinutes: config.session?.sessionTtlMinutes || 30,
|
|
40
39
|
},
|
|
41
|
-
audit: config.audit
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
audit: config.audit
|
|
41
|
+
? {
|
|
42
|
+
enabled: config.audit.enabled !== false,
|
|
43
|
+
logFunction: config.audit.logFunction,
|
|
44
|
+
includePayloads: config.audit.includePayloads,
|
|
45
|
+
includeProofHashes: config.audit.includeProofHashes,
|
|
46
|
+
}
|
|
47
|
+
: undefined,
|
|
48
|
+
wellKnown: config.wellKnown
|
|
49
|
+
? {
|
|
50
|
+
enabled: true,
|
|
51
|
+
serviceName: config.wellKnown.agentMetadata?.name,
|
|
52
|
+
}
|
|
53
|
+
: undefined,
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
@@ -55,7 +58,7 @@ function createProvidersFromConfig(config) {
|
|
|
55
58
|
*/
|
|
56
59
|
class MCPINodeRuntimeWrapper extends mcp_i_core_1.MCPIRuntimeBase {
|
|
57
60
|
legacyConfig;
|
|
58
|
-
accessControlService
|
|
61
|
+
// accessControlService is inherited from MCPIRuntimeBase (protected), no need to redeclare
|
|
59
62
|
// proofVerifier is inherited from MCPIRuntimeBase (protected), no need to redeclare
|
|
60
63
|
constructor(config = {}) {
|
|
61
64
|
const coreConfig = createProvidersFromConfig(config);
|
|
@@ -72,14 +75,14 @@ class MCPINodeRuntimeWrapper extends mcp_i_core_1.MCPIRuntimeBase {
|
|
|
72
75
|
});
|
|
73
76
|
// Instantiate AccessControlApiService if API key is available
|
|
74
77
|
const apiKey = process.env.AGENTSHIELD_API_KEY;
|
|
75
|
-
const apiUrl = process.env.AGENTSHIELD_API_URL ||
|
|
78
|
+
const apiUrl = process.env.AGENTSHIELD_API_URL || "https://kya.vouched.id";
|
|
76
79
|
if (apiKey) {
|
|
77
80
|
this.accessControlService = new mcp_i_core_1.AccessControlApiService({
|
|
78
81
|
baseUrl: apiUrl,
|
|
79
82
|
apiKey,
|
|
80
83
|
fetchProvider: coreConfig.fetchProvider,
|
|
81
84
|
logger: (msg, data) => {
|
|
82
|
-
if (coreConfig.environment ===
|
|
85
|
+
if (coreConfig.environment === "development") {
|
|
83
86
|
console.log(`[AccessControl] ${msg}`, data);
|
|
84
87
|
}
|
|
85
88
|
},
|