@kya-os/mcp-i-core 1.8.0 → 1.8.2
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/conformance/capability-verifier-adapter.d.ts +66 -0
- package/dist/conformance/capability-verifier-adapter.js +61 -0
- package/dist/conformance/index.d.ts +3 -1
- package/dist/conformance/index.js +7 -1
- package/dist/conformance/validate-level2.d.ts +13 -3
- package/dist/conformance/validate-level2.js +15 -5
- package/dist/conformance/vc-jwt-verifier.d.ts +55 -0
- package/dist/conformance/vc-jwt-verifier.js +147 -0
- package/dist/delegation/did-web-resolver.d.ts +60 -0
- package/dist/delegation/did-web-resolver.js +129 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -1
- package/package.json +3 -3
- package/dist/auth/handshake.d.ts +0 -119
- package/dist/auth/handshake.js +0 -250
- package/dist/auth/index.d.ts +0 -6
- package/dist/auth/index.js +0 -11
- package/dist/auth/types.d.ts +0 -46
- package/dist/auth/types.js +0 -10
- package/dist/cache/oauth-config-cache.d.ts +0 -69
- package/dist/cache/oauth-config-cache.js +0 -76
- package/dist/cache/tool-protection-cache.d.ts +0 -89
- package/dist/cache/tool-protection-cache.js +0 -118
- package/dist/compliance/index.d.ts +0 -8
- package/dist/compliance/index.js +0 -24
- package/dist/compliance/schema-registry.d.ts +0 -50
- package/dist/compliance/schema-registry.js +0 -438
- package/dist/compliance/schema-verifier.d.ts +0 -110
- package/dist/compliance/schema-verifier.js +0 -518
- package/dist/config/remote-config.d.ts +0 -173
- package/dist/config/remote-config.js +0 -253
- package/dist/config.d.ts +0 -182
- package/dist/config.js +0 -148
- package/dist/identity/idp-token-resolver.d.ts +0 -69
- package/dist/identity/idp-token-resolver.js +0 -136
- package/dist/identity/idp-token-storage.interface.d.ts +0 -80
- package/dist/identity/idp-token-storage.interface.js +0 -14
- package/dist/identity/user-did-manager.d.ts +0 -228
- package/dist/identity/user-did-manager.js +0 -356
- package/dist/logging/index.d.ts +0 -5
- package/dist/logging/index.js +0 -10
- package/dist/logging/logger.d.ts +0 -33
- package/dist/logging/logger.js +0 -104
- package/dist/proof/generator.d.ts +0 -109
- package/dist/proof/generator.js +0 -236
- package/dist/proof/index.d.ts +0 -5
- package/dist/proof/index.js +0 -11
- package/dist/providers/base.d.ts +0 -95
- package/dist/providers/base.js +0 -47
- package/dist/providers/memory.d.ts +0 -42
- package/dist/providers/memory.js +0 -121
- package/dist/runtime/audit-logger.d.ts +0 -37
- package/dist/runtime/audit-logger.js +0 -9
- package/dist/runtime/base.d.ts +0 -375
- package/dist/runtime/base.js +0 -1491
- package/dist/runtime/ext-apps-constants.d.ts +0 -14
- package/dist/runtime/ext-apps-constants.js +0 -17
- package/dist/services/access-control.service.d.ts +0 -138
- package/dist/services/access-control.service.js +0 -721
- package/dist/services/authorization/authorization-registry.d.ts +0 -29
- package/dist/services/authorization/authorization-registry.js +0 -58
- package/dist/services/authorization/types.d.ts +0 -53
- package/dist/services/authorization/types.js +0 -10
- package/dist/services/batch-delegation.service.d.ts +0 -53
- package/dist/services/batch-delegation.service.js +0 -95
- package/dist/services/crypto.service.d.ts +0 -69
- package/dist/services/crypto.service.js +0 -225
- package/dist/services/delegation-error-formatter.d.ts +0 -124
- package/dist/services/delegation-error-formatter.js +0 -214
- package/dist/services/errors.d.ts +0 -49
- package/dist/services/errors.js +0 -66
- package/dist/services/index.d.ts +0 -9
- package/dist/services/index.js +0 -15
- package/dist/services/oauth-config.service.d.ts +0 -53
- package/dist/services/oauth-config.service.js +0 -141
- package/dist/services/oauth-provider-registry.d.ts +0 -88
- package/dist/services/oauth-provider-registry.js +0 -128
- package/dist/services/oauth-service.d.ts +0 -122
- package/dist/services/oauth-service.js +0 -442
- package/dist/services/oauth-token-retrieval.service.d.ts +0 -49
- package/dist/services/oauth-token-retrieval.service.js +0 -150
- package/dist/services/policy.service.d.ts +0 -130
- package/dist/services/policy.service.js +0 -399
- package/dist/services/proof-verifier.d.ts +0 -98
- package/dist/services/proof-verifier.js +0 -319
- package/dist/services/provider-resolver.d.ts +0 -89
- package/dist/services/provider-resolver.js +0 -196
- package/dist/services/provider-validator.d.ts +0 -55
- package/dist/services/provider-validator.js +0 -135
- package/dist/services/session-registration.service.d.ts +0 -80
- package/dist/services/session-registration.service.js +0 -174
- package/dist/services/storage.service.d.ts +0 -116
- package/dist/services/storage.service.js +0 -411
- package/dist/services/tool-context-builder.d.ts +0 -74
- package/dist/services/tool-context-builder.js +0 -215
- package/dist/services/tool-protection.service.d.ts +0 -193
- package/dist/services/tool-protection.service.js +0 -736
- package/dist/session/index.d.ts +0 -5
- package/dist/session/index.js +0 -11
- package/dist/session/manager.d.ts +0 -113
- package/dist/session/manager.js +0 -273
- package/dist/types/oauth-required-error.d.ts +0 -46
- package/dist/types/oauth-required-error.js +0 -42
- package/dist/types/tool-protection.d.ts +0 -144
- package/dist/types/tool-protection.js +0 -48
- package/dist/utils/cors.d.ts +0 -44
- package/dist/utils/cors.js +0 -71
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.js +0 -24
- package/dist/utils/storage-keys.d.ts +0 -120
- package/dist/utils/storage-keys.js +0 -217
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform-agnostic cache interface for tool protection configurations
|
|
3
|
-
*
|
|
4
|
-
* This interface allows different runtime adapters to provide their own
|
|
5
|
-
* caching implementations (e.g., in-memory for Node.js, KV for CloudFlare)
|
|
6
|
-
*
|
|
7
|
-
* @package @kya-os/mcp-i-core
|
|
8
|
-
*/
|
|
9
|
-
import type { ToolProtectionConfig } from '../types/tool-protection.js';
|
|
10
|
-
/**
|
|
11
|
-
* Cache interface for storing and retrieving tool protection configurations
|
|
12
|
-
*/
|
|
13
|
-
export interface ToolProtectionCache {
|
|
14
|
-
/**
|
|
15
|
-
* Retrieve a cached tool protection configuration
|
|
16
|
-
* @param key Cache key (typically projectId)
|
|
17
|
-
* @returns Cached config or null if not found/expired
|
|
18
|
-
*/
|
|
19
|
-
get(key: string): Promise<ToolProtectionConfig | null>;
|
|
20
|
-
/**
|
|
21
|
-
* Store a tool protection configuration in cache
|
|
22
|
-
* @param key Cache key (typically projectId)
|
|
23
|
-
* @param value Tool protection configuration to cache
|
|
24
|
-
* @param ttl Time-to-live in milliseconds
|
|
25
|
-
*/
|
|
26
|
-
set(key: string, value: ToolProtectionConfig, ttl: number): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Clear all cached entries
|
|
29
|
-
*/
|
|
30
|
-
clear(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Remove a specific cache entry
|
|
33
|
-
* @param key Cache key to remove
|
|
34
|
-
*/
|
|
35
|
-
delete(key: string): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* In-memory cache implementation
|
|
39
|
-
*
|
|
40
|
-
* Suitable for:
|
|
41
|
-
* - Node.js runtimes
|
|
42
|
-
* - Development/testing
|
|
43
|
-
* - Single-instance deployments
|
|
44
|
-
*
|
|
45
|
-
* NOT suitable for:
|
|
46
|
-
* - Multi-instance deployments (cache not shared)
|
|
47
|
-
* - Serverless environments (state not persisted)
|
|
48
|
-
*/
|
|
49
|
-
export declare class InMemoryToolProtectionCache implements ToolProtectionCache {
|
|
50
|
-
private cache;
|
|
51
|
-
get(key: string): Promise<ToolProtectionConfig | null>;
|
|
52
|
-
set(key: string, value: ToolProtectionConfig, ttl: number): Promise<void>;
|
|
53
|
-
clear(): Promise<void>;
|
|
54
|
-
delete(key: string): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Clean up expired entries (call periodically)
|
|
57
|
-
*/
|
|
58
|
-
cleanup(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get stale cache entry (including expired entries)
|
|
61
|
-
* Used for fail-safe behavior when API is unavailable
|
|
62
|
-
* This method accesses the internal cache map directly to avoid
|
|
63
|
-
* deletion of expired entries that would occur with get()
|
|
64
|
-
* @param key Cache key
|
|
65
|
-
* @returns Cached config or null if not found
|
|
66
|
-
*/
|
|
67
|
-
getStale(key: string): ToolProtectionConfig | null;
|
|
68
|
-
/**
|
|
69
|
-
* Get expiration timestamp for a cache entry
|
|
70
|
-
* Used to check if stale cache is within maxStaleCacheAge
|
|
71
|
-
* @param key Cache key
|
|
72
|
-
* @returns Expiration timestamp in milliseconds, or null if not found
|
|
73
|
-
*/
|
|
74
|
-
getExpiresAt(key: string): number | null;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* No-op cache implementation (disables caching)
|
|
78
|
-
*
|
|
79
|
-
* Use when:
|
|
80
|
-
* - You want to disable caching entirely
|
|
81
|
-
* - Testing scenarios that require fresh data
|
|
82
|
-
*/
|
|
83
|
-
export declare class NoOpToolProtectionCache implements ToolProtectionCache {
|
|
84
|
-
get(_key: string): Promise<ToolProtectionConfig | null>;
|
|
85
|
-
set(_key: string, _value: ToolProtectionConfig, _ttl: number): Promise<void>;
|
|
86
|
-
clear(): Promise<void>;
|
|
87
|
-
delete(_key: string): Promise<void>;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=tool-protection-cache.d.ts.map
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Platform-agnostic cache interface for tool protection configurations
|
|
4
|
-
*
|
|
5
|
-
* This interface allows different runtime adapters to provide their own
|
|
6
|
-
* caching implementations (e.g., in-memory for Node.js, KV for CloudFlare)
|
|
7
|
-
*
|
|
8
|
-
* @package @kya-os/mcp-i-core
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.NoOpToolProtectionCache = exports.InMemoryToolProtectionCache = void 0;
|
|
12
|
-
/**
|
|
13
|
-
* In-memory cache implementation
|
|
14
|
-
*
|
|
15
|
-
* Suitable for:
|
|
16
|
-
* - Node.js runtimes
|
|
17
|
-
* - Development/testing
|
|
18
|
-
* - Single-instance deployments
|
|
19
|
-
*
|
|
20
|
-
* NOT suitable for:
|
|
21
|
-
* - Multi-instance deployments (cache not shared)
|
|
22
|
-
* - Serverless environments (state not persisted)
|
|
23
|
-
*/
|
|
24
|
-
class InMemoryToolProtectionCache {
|
|
25
|
-
cache = new Map();
|
|
26
|
-
async get(key) {
|
|
27
|
-
const entry = this.cache.get(key);
|
|
28
|
-
if (!entry) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
// Check if expired
|
|
32
|
-
if (Date.now() > entry.expiresAt) {
|
|
33
|
-
this.cache.delete(key);
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return entry.value;
|
|
37
|
-
}
|
|
38
|
-
async set(key, value, ttl) {
|
|
39
|
-
// If TTL is <= 0, don't store (entry would be immediately expired)
|
|
40
|
-
if (ttl <= 0) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const expiresAt = Date.now() + ttl;
|
|
44
|
-
this.cache.set(key, { value, expiresAt });
|
|
45
|
-
}
|
|
46
|
-
async clear() {
|
|
47
|
-
this.cache.clear();
|
|
48
|
-
}
|
|
49
|
-
async delete(key) {
|
|
50
|
-
this.cache.delete(key);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Clean up expired entries (call periodically)
|
|
54
|
-
*/
|
|
55
|
-
cleanup() {
|
|
56
|
-
const now = Date.now();
|
|
57
|
-
for (const [key, entry] of this.cache.entries()) {
|
|
58
|
-
if (now > entry.expiresAt) {
|
|
59
|
-
this.cache.delete(key);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Get stale cache entry (including expired entries)
|
|
65
|
-
* Used for fail-safe behavior when API is unavailable
|
|
66
|
-
* This method accesses the internal cache map directly to avoid
|
|
67
|
-
* deletion of expired entries that would occur with get()
|
|
68
|
-
* @param key Cache key
|
|
69
|
-
* @returns Cached config or null if not found
|
|
70
|
-
*/
|
|
71
|
-
getStale(key) {
|
|
72
|
-
// Access internal cache map directly (not through async get() which deletes expired entries)
|
|
73
|
-
const entry = this.cache.get(key);
|
|
74
|
-
if (!entry) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
// Return value even if expired (getStale is meant for fail-safe behavior)
|
|
78
|
-
return entry.value;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get expiration timestamp for a cache entry
|
|
82
|
-
* Used to check if stale cache is within maxStaleCacheAge
|
|
83
|
-
* @param key Cache key
|
|
84
|
-
* @returns Expiration timestamp in milliseconds, or null if not found
|
|
85
|
-
*/
|
|
86
|
-
getExpiresAt(key) {
|
|
87
|
-
// Access internal cache map directly (not through async get() which deletes expired entries)
|
|
88
|
-
const entry = this.cache.get(key);
|
|
89
|
-
if (!entry) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return entry.expiresAt;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.InMemoryToolProtectionCache = InMemoryToolProtectionCache;
|
|
96
|
-
/**
|
|
97
|
-
* No-op cache implementation (disables caching)
|
|
98
|
-
*
|
|
99
|
-
* Use when:
|
|
100
|
-
* - You want to disable caching entirely
|
|
101
|
-
* - Testing scenarios that require fresh data
|
|
102
|
-
*/
|
|
103
|
-
class NoOpToolProtectionCache {
|
|
104
|
-
async get(_key) {
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
async set(_key, _value, _ttl) {
|
|
108
|
-
// No-op
|
|
109
|
-
}
|
|
110
|
-
async clear() {
|
|
111
|
-
// No-op
|
|
112
|
-
}
|
|
113
|
-
async delete(_key) {
|
|
114
|
-
// No-op
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.NoOpToolProtectionCache = NoOpToolProtectionCache;
|
|
118
|
-
//# sourceMappingURL=tool-protection-cache.js.map
|
package/dist/compliance/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Schema Compliance Module
|
|
4
|
-
*
|
|
5
|
-
* Automated verification against canonical schemas from schemas.kya-os.ai
|
|
6
|
-
*/
|
|
7
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
__exportStar(require("./schema-verifier"), exports);
|
|
23
|
-
__exportStar(require("./schema-registry"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema Registry
|
|
3
|
-
*
|
|
4
|
-
* Canonical list of all schemas from schema.modelcontextprotocol-identity.io
|
|
5
|
-
* Used for automated compliance verification.
|
|
6
|
-
*
|
|
7
|
-
* Auto-generated from https://schema.modelcontextprotocol-identity.io/schema-index.json
|
|
8
|
-
* Last updated: 2025-10-17
|
|
9
|
-
*/
|
|
10
|
-
import type { SchemaMetadata } from './schema-verifier';
|
|
11
|
-
/**
|
|
12
|
-
* Complete registry of schemas from schema.modelcontextprotocol-identity.io
|
|
13
|
-
*
|
|
14
|
-
* As of 2025-10-17, there are 38 schemas covering:
|
|
15
|
-
* - W3C Verifiable Credentials
|
|
16
|
-
* - MCP-I Protocol (Handshake, Proof, Session)
|
|
17
|
-
* - Delegation System
|
|
18
|
-
* - Agent Registry
|
|
19
|
-
* - CLI & Runtime
|
|
20
|
-
* - TLKRC (Tool-Level Key Rotation)
|
|
21
|
-
*/
|
|
22
|
-
export declare const SCHEMA_REGISTRY: SchemaMetadata[];
|
|
23
|
-
/**
|
|
24
|
-
* Get all schemas
|
|
25
|
-
*/
|
|
26
|
-
export declare function getAllSchemas(): SchemaMetadata[];
|
|
27
|
-
/**
|
|
28
|
-
* Get schemas by category
|
|
29
|
-
*/
|
|
30
|
-
export declare function getSchemasByCategory(category: string): SchemaMetadata[];
|
|
31
|
-
/**
|
|
32
|
-
* Get schema by ID
|
|
33
|
-
*/
|
|
34
|
-
export declare function getSchemaById(id: string): SchemaMetadata | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Get critical schemas (must be 100% compliant)
|
|
37
|
-
*
|
|
38
|
-
* These are the core schemas that power the MCP-I protocol and must
|
|
39
|
-
* be fully compliant for the system to function correctly.
|
|
40
|
-
*/
|
|
41
|
-
export declare function getCriticalSchemas(): SchemaMetadata[];
|
|
42
|
-
/**
|
|
43
|
-
* Get schema statistics
|
|
44
|
-
*/
|
|
45
|
-
export declare function getSchemaStats(): {
|
|
46
|
-
total: number;
|
|
47
|
-
byCategory: Record<string, number>;
|
|
48
|
-
byVersion: Record<string, number>;
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=schema-registry.d.ts.map
|