@kya-os/mcp-i-core 1.8.0 → 1.8.1

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.
Files changed (111) hide show
  1. package/dist/conformance/capability-verifier-adapter.d.ts +66 -0
  2. package/dist/conformance/capability-verifier-adapter.js +61 -0
  3. package/dist/conformance/index.d.ts +3 -1
  4. package/dist/conformance/index.js +7 -1
  5. package/dist/conformance/validate-level2.d.ts +13 -3
  6. package/dist/conformance/validate-level2.js +15 -5
  7. package/dist/conformance/vc-jwt-verifier.d.ts +55 -0
  8. package/dist/conformance/vc-jwt-verifier.js +147 -0
  9. package/dist/delegation/did-web-resolver.d.ts +60 -0
  10. package/dist/delegation/did-web-resolver.js +129 -0
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +9 -1
  13. package/package.json +3 -3
  14. package/dist/auth/handshake.d.ts +0 -119
  15. package/dist/auth/handshake.js +0 -250
  16. package/dist/auth/index.d.ts +0 -6
  17. package/dist/auth/index.js +0 -11
  18. package/dist/auth/types.d.ts +0 -46
  19. package/dist/auth/types.js +0 -10
  20. package/dist/cache/oauth-config-cache.d.ts +0 -69
  21. package/dist/cache/oauth-config-cache.js +0 -76
  22. package/dist/cache/tool-protection-cache.d.ts +0 -89
  23. package/dist/cache/tool-protection-cache.js +0 -118
  24. package/dist/compliance/index.d.ts +0 -8
  25. package/dist/compliance/index.js +0 -24
  26. package/dist/compliance/schema-registry.d.ts +0 -50
  27. package/dist/compliance/schema-registry.js +0 -438
  28. package/dist/compliance/schema-verifier.d.ts +0 -110
  29. package/dist/compliance/schema-verifier.js +0 -518
  30. package/dist/config/remote-config.d.ts +0 -173
  31. package/dist/config/remote-config.js +0 -253
  32. package/dist/config.d.ts +0 -182
  33. package/dist/config.js +0 -148
  34. package/dist/identity/idp-token-resolver.d.ts +0 -69
  35. package/dist/identity/idp-token-resolver.js +0 -136
  36. package/dist/identity/idp-token-storage.interface.d.ts +0 -80
  37. package/dist/identity/idp-token-storage.interface.js +0 -14
  38. package/dist/identity/user-did-manager.d.ts +0 -228
  39. package/dist/identity/user-did-manager.js +0 -356
  40. package/dist/logging/index.d.ts +0 -5
  41. package/dist/logging/index.js +0 -10
  42. package/dist/logging/logger.d.ts +0 -33
  43. package/dist/logging/logger.js +0 -104
  44. package/dist/proof/generator.d.ts +0 -109
  45. package/dist/proof/generator.js +0 -236
  46. package/dist/proof/index.d.ts +0 -5
  47. package/dist/proof/index.js +0 -11
  48. package/dist/providers/base.d.ts +0 -95
  49. package/dist/providers/base.js +0 -47
  50. package/dist/providers/memory.d.ts +0 -42
  51. package/dist/providers/memory.js +0 -121
  52. package/dist/runtime/audit-logger.d.ts +0 -37
  53. package/dist/runtime/audit-logger.js +0 -9
  54. package/dist/runtime/base.d.ts +0 -375
  55. package/dist/runtime/base.js +0 -1491
  56. package/dist/runtime/ext-apps-constants.d.ts +0 -14
  57. package/dist/runtime/ext-apps-constants.js +0 -17
  58. package/dist/services/access-control.service.d.ts +0 -138
  59. package/dist/services/access-control.service.js +0 -721
  60. package/dist/services/authorization/authorization-registry.d.ts +0 -29
  61. package/dist/services/authorization/authorization-registry.js +0 -58
  62. package/dist/services/authorization/types.d.ts +0 -53
  63. package/dist/services/authorization/types.js +0 -10
  64. package/dist/services/batch-delegation.service.d.ts +0 -53
  65. package/dist/services/batch-delegation.service.js +0 -95
  66. package/dist/services/crypto.service.d.ts +0 -69
  67. package/dist/services/crypto.service.js +0 -225
  68. package/dist/services/delegation-error-formatter.d.ts +0 -124
  69. package/dist/services/delegation-error-formatter.js +0 -214
  70. package/dist/services/errors.d.ts +0 -49
  71. package/dist/services/errors.js +0 -66
  72. package/dist/services/index.d.ts +0 -9
  73. package/dist/services/index.js +0 -15
  74. package/dist/services/oauth-config.service.d.ts +0 -53
  75. package/dist/services/oauth-config.service.js +0 -141
  76. package/dist/services/oauth-provider-registry.d.ts +0 -88
  77. package/dist/services/oauth-provider-registry.js +0 -128
  78. package/dist/services/oauth-service.d.ts +0 -122
  79. package/dist/services/oauth-service.js +0 -442
  80. package/dist/services/oauth-token-retrieval.service.d.ts +0 -49
  81. package/dist/services/oauth-token-retrieval.service.js +0 -150
  82. package/dist/services/policy.service.d.ts +0 -130
  83. package/dist/services/policy.service.js +0 -399
  84. package/dist/services/proof-verifier.d.ts +0 -98
  85. package/dist/services/proof-verifier.js +0 -319
  86. package/dist/services/provider-resolver.d.ts +0 -89
  87. package/dist/services/provider-resolver.js +0 -196
  88. package/dist/services/provider-validator.d.ts +0 -55
  89. package/dist/services/provider-validator.js +0 -135
  90. package/dist/services/session-registration.service.d.ts +0 -80
  91. package/dist/services/session-registration.service.js +0 -174
  92. package/dist/services/storage.service.d.ts +0 -116
  93. package/dist/services/storage.service.js +0 -411
  94. package/dist/services/tool-context-builder.d.ts +0 -74
  95. package/dist/services/tool-context-builder.js +0 -215
  96. package/dist/services/tool-protection.service.d.ts +0 -193
  97. package/dist/services/tool-protection.service.js +0 -736
  98. package/dist/session/index.d.ts +0 -5
  99. package/dist/session/index.js +0 -11
  100. package/dist/session/manager.d.ts +0 -113
  101. package/dist/session/manager.js +0 -273
  102. package/dist/types/oauth-required-error.d.ts +0 -46
  103. package/dist/types/oauth-required-error.js +0 -42
  104. package/dist/types/tool-protection.d.ts +0 -144
  105. package/dist/types/tool-protection.js +0 -48
  106. package/dist/utils/cors.d.ts +0 -44
  107. package/dist/utils/cors.js +0 -71
  108. package/dist/utils/index.d.ts +0 -8
  109. package/dist/utils/index.js +0 -24
  110. package/dist/utils/storage-keys.d.ts +0 -120
  111. 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
@@ -1,8 +0,0 @@
1
- /**
2
- * Schema Compliance Module
3
- *
4
- * Automated verification against canonical schemas from schemas.kya-os.ai
5
- */
6
- export * from './schema-verifier';
7
- export * from './schema-registry';
8
- //# sourceMappingURL=index.d.ts.map
@@ -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