@kya-os/mcp-i 1.2.10 → 1.3.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/cache/cloudflare-kv.d.ts +90 -0
- package/dist/cache/cloudflare-kv.js +98 -0
- package/dist/cache/index.d.ts +1 -1
- package/dist/cache/index.js +2 -2
- package/dist/compiler/get-webpack-config/get-entries.js +9 -5
- package/dist/compiler/get-webpack-config/get-externals.d.ts +5 -3
- package/dist/compiler/get-webpack-config/get-externals.js +14 -21
- package/dist/compiler/get-webpack-config/plugins.js +10 -12
- package/dist/providers/node-providers.d.ts +69 -0
- package/dist/providers/node-providers.js +368 -0
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/adapter-nextjs.js.LICENSE.txt +0 -6
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +5 -3
- package/dist/runtime/mcpi-runtime-wrapper.d.ts +19 -0
- package/dist/runtime/mcpi-runtime-wrapper.js +70 -0
- package/dist/runtime/stdio.js +1 -1
- package/package.json +2 -1
package/dist/runtime/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Identity-aware MCP runtime with proof generation, session management,
|
|
5
5
|
* audit logging, and well-known endpoints.
|
|
6
6
|
*/
|
|
7
|
-
export { MCPIRuntime, createMCPIRuntime
|
|
7
|
+
export { MCPIRuntimeWrapper as MCPIRuntime, createMCPIRuntime } from "./mcpi-runtime-wrapper";
|
|
8
|
+
export { RuntimeFactory, RUNTIME_ERRORS, type MCPIRuntimeConfig, type RuntimeEnvironment, } from "./mcpi-runtime";
|
|
8
9
|
export { IdentityManager, defaultIdentityManager, ensureIdentity, IDENTITY_ERRORS, type AgentIdentity, type DevIdentityFile, type ProdEnvironment, type IdentityConfig, } from "./identity";
|
|
9
10
|
export { SessionManager, defaultSessionManager, createHandshakeRequest, validateHandshakeFormat, type SessionConfig, type HandshakeResult, } from "./session";
|
|
10
11
|
export { ProofGenerator, createProofResponse, extractCanonicalData, type ToolRequest, type ToolResponse, type ProofOptions, } from "./proof";
|
package/dist/runtime/index.js
CHANGED
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.formatVerifyLink = exports.DemoConsole = exports.createDemoManager = exports.DemoManager = exports.createDebugEndpoint = exports.DebugManager = exports.extractDIDFromPath = exports.validateAgentDocument = exports.validateDIDDocument = exports.createWellKnownHandler = exports.WellKnownManager = exports.validateAuditRecord = exports.parseAuditLine = exports.logKeyRotationAudit = exports.defaultAuditLogger = exports.AuditLogger = exports.extractCanonicalData = exports.createProofResponse = exports.ProofGenerator = exports.validateHandshakeFormat = exports.createHandshakeRequest = exports.defaultSessionManager = exports.SessionManager = exports.IDENTITY_ERRORS = exports.ensureIdentity = exports.defaultIdentityManager = exports.IdentityManager = exports.RUNTIME_ERRORS = exports.RuntimeFactory = exports.createMCPIRuntime = exports.MCPIRuntime = void 0;
|
|
10
|
-
// Main runtime
|
|
10
|
+
// Main runtime - now using core with Node.js providers
|
|
11
|
+
var mcpi_runtime_wrapper_1 = require("./mcpi-runtime-wrapper");
|
|
12
|
+
Object.defineProperty(exports, "MCPIRuntime", { enumerable: true, get: function () { return mcpi_runtime_wrapper_1.MCPIRuntimeWrapper; } });
|
|
13
|
+
Object.defineProperty(exports, "createMCPIRuntime", { enumerable: true, get: function () { return mcpi_runtime_wrapper_1.createMCPIRuntime; } });
|
|
14
|
+
// Legacy exports for compatibility
|
|
11
15
|
var mcpi_runtime_1 = require("./mcpi-runtime");
|
|
12
|
-
Object.defineProperty(exports, "MCPIRuntime", { enumerable: true, get: function () { return mcpi_runtime_1.MCPIRuntime; } });
|
|
13
|
-
Object.defineProperty(exports, "createMCPIRuntime", { enumerable: true, get: function () { return mcpi_runtime_1.createMCPIRuntime; } });
|
|
14
16
|
Object.defineProperty(exports, "RuntimeFactory", { enumerable: true, get: function () { return mcpi_runtime_1.RuntimeFactory; } });
|
|
15
17
|
Object.defineProperty(exports, "RUNTIME_ERRORS", { enumerable: true, get: function () { return mcpi_runtime_1.RUNTIME_ERRORS; } });
|
|
16
18
|
// Identity management
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCPIRuntime Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Extends the core runtime with Node.js-specific providers while
|
|
5
|
+
* maintaining the exact same API for backward compatibility.
|
|
6
|
+
*/
|
|
7
|
+
import { MCPIRuntimeBase } from '@kya-os/mcp-i-core';
|
|
8
|
+
import type { MCPIRuntimeConfig } from './mcpi-runtime';
|
|
9
|
+
/**
|
|
10
|
+
* Enhanced MCPIRuntime using the core with Node.js providers
|
|
11
|
+
*/
|
|
12
|
+
export declare class MCPIRuntimeWrapper extends MCPIRuntimeBase {
|
|
13
|
+
private legacyConfig;
|
|
14
|
+
constructor(config?: MCPIRuntimeConfig);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Factory function for creating runtime
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMCPIRuntime(config?: MCPIRuntimeConfig): MCPIRuntimeWrapper;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCPIRuntime Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Extends the core runtime with Node.js-specific providers while
|
|
6
|
+
* maintaining the exact same API for backward compatibility.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MCPIRuntimeWrapper = void 0;
|
|
13
|
+
exports.createMCPIRuntime = createMCPIRuntime;
|
|
14
|
+
const mcp_i_core_1 = require("@kya-os/mcp-i-core");
|
|
15
|
+
const node_providers_1 = require("../providers/node-providers");
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
/**
|
|
18
|
+
* Convert legacy config to provider-based config
|
|
19
|
+
*/
|
|
20
|
+
function createProvidersFromConfig(config) {
|
|
21
|
+
const cryptoProvider = new node_providers_1.NodeCryptoProvider();
|
|
22
|
+
const clockProvider = new node_providers_1.NodeClockProvider();
|
|
23
|
+
const fetchProvider = new node_providers_1.NodeFetchProvider();
|
|
24
|
+
const identityPath = config.identity?.devIdentityPath ||
|
|
25
|
+
path_1.default.join(process.cwd(), '.mcp-i');
|
|
26
|
+
const storageProvider = new node_providers_1.FileStorageProvider(identityPath);
|
|
27
|
+
const identityProvider = new node_providers_1.FileIdentityProvider(identityPath, cryptoProvider);
|
|
28
|
+
const nonceCacheProvider = (0, node_providers_1.getNonceCacheProvider)();
|
|
29
|
+
return {
|
|
30
|
+
cryptoProvider,
|
|
31
|
+
clockProvider,
|
|
32
|
+
fetchProvider,
|
|
33
|
+
storageProvider,
|
|
34
|
+
nonceCacheProvider,
|
|
35
|
+
identityProvider,
|
|
36
|
+
environment: config.identity?.environment || 'development',
|
|
37
|
+
timestampSkewSeconds: config.session?.timestampSkewSeconds || 120,
|
|
38
|
+
sessionTtlMinutes: config.session?.sessionTtlMinutes || 30,
|
|
39
|
+
audit: config.audit ? {
|
|
40
|
+
enabled: config.audit.enabled !== false,
|
|
41
|
+
logFunction: config.audit.logFunction,
|
|
42
|
+
includePayloads: config.audit.includePayloads
|
|
43
|
+
} : undefined,
|
|
44
|
+
wellKnown: config.wellKnown ? {
|
|
45
|
+
enabled: true,
|
|
46
|
+
serviceName: config.wellKnown.agentMetadata?.name,
|
|
47
|
+
serviceEndpoint: config.wellKnown.baseUrl
|
|
48
|
+
} : undefined,
|
|
49
|
+
showVerifyLink: config.runtime?.showVerifyLink !== false,
|
|
50
|
+
identityBadge: config.demo?.identityBadge || config.runtime?.identityBadge || false
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Enhanced MCPIRuntime using the core with Node.js providers
|
|
55
|
+
*/
|
|
56
|
+
class MCPIRuntimeWrapper extends mcp_i_core_1.MCPIRuntimeBase {
|
|
57
|
+
legacyConfig;
|
|
58
|
+
constructor(config = {}) {
|
|
59
|
+
const coreConfig = createProvidersFromConfig(config);
|
|
60
|
+
super(coreConfig);
|
|
61
|
+
this.legacyConfig = config;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.MCPIRuntimeWrapper = MCPIRuntimeWrapper;
|
|
65
|
+
/**
|
|
66
|
+
* Factory function for creating runtime
|
|
67
|
+
*/
|
|
68
|
+
function createMCPIRuntime(config) {
|
|
69
|
+
return new MCPIRuntimeWrapper(config);
|
|
70
|
+
}
|