@kya-os/mcp-i-core 1.7.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 (121) hide show
  1. package/README.md +1 -1
  2. package/dist/conformance/capability-verifier-adapter.d.ts +66 -0
  3. package/dist/conformance/capability-verifier-adapter.js +61 -0
  4. package/dist/conformance/index.d.ts +10 -0
  5. package/dist/conformance/index.js +19 -0
  6. package/dist/conformance/validate-level2.d.ts +203 -0
  7. package/dist/conformance/validate-level2.js +294 -0
  8. package/dist/conformance/vc-jwt-verifier.d.ts +55 -0
  9. package/dist/conformance/vc-jwt-verifier.js +147 -0
  10. package/dist/delegation/did-web-resolver.d.ts +60 -0
  11. package/dist/delegation/did-web-resolver.js +129 -0
  12. package/dist/delegation/outbound-proof.d.ts +3 -2
  13. package/dist/delegation/outbound-proof.js +3 -2
  14. package/dist/delegation/utils.d.ts +3 -1
  15. package/dist/index.d.ts +9 -63
  16. package/dist/index.js +22 -161
  17. package/dist/utils/base58.d.ts +4 -28
  18. package/dist/utils/base58.js +18 -98
  19. package/dist/utils/base64.d.ts +4 -29
  20. package/dist/utils/base64.js +18 -167
  21. package/dist/utils/did-helpers.d.ts +4 -165
  22. package/dist/utils/did-helpers.js +18 -217
  23. package/package.json +5 -7
  24. package/dist/auth/handshake.d.ts +0 -119
  25. package/dist/auth/handshake.js +0 -250
  26. package/dist/auth/index.d.ts +0 -6
  27. package/dist/auth/index.js +0 -11
  28. package/dist/auth/types.d.ts +0 -46
  29. package/dist/auth/types.js +0 -10
  30. package/dist/cache/oauth-config-cache.d.ts +0 -69
  31. package/dist/cache/oauth-config-cache.js +0 -76
  32. package/dist/cache/tool-protection-cache.d.ts +0 -89
  33. package/dist/cache/tool-protection-cache.js +0 -118
  34. package/dist/compliance/index.d.ts +0 -8
  35. package/dist/compliance/index.js +0 -24
  36. package/dist/compliance/schema-registry.d.ts +0 -50
  37. package/dist/compliance/schema-registry.js +0 -438
  38. package/dist/compliance/schema-verifier.d.ts +0 -110
  39. package/dist/compliance/schema-verifier.js +0 -518
  40. package/dist/config/remote-config.d.ts +0 -173
  41. package/dist/config/remote-config.js +0 -253
  42. package/dist/config.d.ts +0 -182
  43. package/dist/config.js +0 -148
  44. package/dist/identity/idp-token-resolver.d.ts +0 -69
  45. package/dist/identity/idp-token-resolver.js +0 -136
  46. package/dist/identity/idp-token-storage.interface.d.ts +0 -80
  47. package/dist/identity/idp-token-storage.interface.js +0 -14
  48. package/dist/identity/user-did-manager.d.ts +0 -228
  49. package/dist/identity/user-did-manager.js +0 -356
  50. package/dist/logging/index.d.ts +0 -5
  51. package/dist/logging/index.js +0 -10
  52. package/dist/logging/logger.d.ts +0 -33
  53. package/dist/logging/logger.js +0 -104
  54. package/dist/proof/generator.d.ts +0 -109
  55. package/dist/proof/generator.js +0 -236
  56. package/dist/proof/index.d.ts +0 -5
  57. package/dist/proof/index.js +0 -11
  58. package/dist/providers/base.d.ts +0 -95
  59. package/dist/providers/base.js +0 -47
  60. package/dist/providers/memory.d.ts +0 -42
  61. package/dist/providers/memory.js +0 -121
  62. package/dist/runtime/audit-logger.d.ts +0 -37
  63. package/dist/runtime/audit-logger.js +0 -9
  64. package/dist/runtime/base.d.ts +0 -375
  65. package/dist/runtime/base.js +0 -1491
  66. package/dist/runtime/ext-apps-constants.d.ts +0 -14
  67. package/dist/runtime/ext-apps-constants.js +0 -17
  68. package/dist/services/access-control.service.d.ts +0 -138
  69. package/dist/services/access-control.service.js +0 -721
  70. package/dist/services/authorization/authorization-registry.d.ts +0 -29
  71. package/dist/services/authorization/authorization-registry.js +0 -58
  72. package/dist/services/authorization/types.d.ts +0 -53
  73. package/dist/services/authorization/types.js +0 -10
  74. package/dist/services/batch-delegation.service.d.ts +0 -53
  75. package/dist/services/batch-delegation.service.js +0 -95
  76. package/dist/services/crypto.service.d.ts +0 -69
  77. package/dist/services/crypto.service.js +0 -225
  78. package/dist/services/delegation-error-formatter.d.ts +0 -124
  79. package/dist/services/delegation-error-formatter.js +0 -214
  80. package/dist/services/errors.d.ts +0 -49
  81. package/dist/services/errors.js +0 -66
  82. package/dist/services/index.d.ts +0 -9
  83. package/dist/services/index.js +0 -15
  84. package/dist/services/oauth-config.service.d.ts +0 -53
  85. package/dist/services/oauth-config.service.js +0 -141
  86. package/dist/services/oauth-provider-registry.d.ts +0 -88
  87. package/dist/services/oauth-provider-registry.js +0 -128
  88. package/dist/services/oauth-service.d.ts +0 -122
  89. package/dist/services/oauth-service.js +0 -442
  90. package/dist/services/oauth-token-retrieval.service.d.ts +0 -49
  91. package/dist/services/oauth-token-retrieval.service.js +0 -150
  92. package/dist/services/policy.service.d.ts +0 -130
  93. package/dist/services/policy.service.js +0 -399
  94. package/dist/services/proof-verifier.d.ts +0 -98
  95. package/dist/services/proof-verifier.js +0 -319
  96. package/dist/services/provider-resolver.d.ts +0 -89
  97. package/dist/services/provider-resolver.js +0 -196
  98. package/dist/services/provider-validator.d.ts +0 -55
  99. package/dist/services/provider-validator.js +0 -135
  100. package/dist/services/session-registration.service.d.ts +0 -80
  101. package/dist/services/session-registration.service.js +0 -174
  102. package/dist/services/storage.service.d.ts +0 -116
  103. package/dist/services/storage.service.js +0 -411
  104. package/dist/services/tool-context-builder.d.ts +0 -74
  105. package/dist/services/tool-context-builder.js +0 -215
  106. package/dist/services/tool-protection.service.d.ts +0 -193
  107. package/dist/services/tool-protection.service.js +0 -736
  108. package/dist/session/index.d.ts +0 -5
  109. package/dist/session/index.js +0 -11
  110. package/dist/session/manager.d.ts +0 -113
  111. package/dist/session/manager.js +0 -273
  112. package/dist/types/oauth-required-error.d.ts +0 -46
  113. package/dist/types/oauth-required-error.js +0 -42
  114. package/dist/types/tool-protection.d.ts +0 -144
  115. package/dist/types/tool-protection.js +0 -48
  116. package/dist/utils/cors.d.ts +0 -44
  117. package/dist/utils/cors.js +0 -71
  118. package/dist/utils/index.d.ts +0 -8
  119. package/dist/utils/index.js +0 -24
  120. package/dist/utils/storage-keys.d.ts +0 -120
  121. package/dist/utils/storage-keys.js +0 -217
@@ -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
@@ -1,438 +0,0 @@
1
- "use strict";
2
- /**
3
- * Schema Registry
4
- *
5
- * Canonical list of all schemas from schema.modelcontextprotocol-identity.io
6
- * Used for automated compliance verification.
7
- *
8
- * Auto-generated from https://schema.modelcontextprotocol-identity.io/schema-index.json
9
- * Last updated: 2025-10-17
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SCHEMA_REGISTRY = void 0;
13
- exports.getAllSchemas = getAllSchemas;
14
- exports.getSchemasByCategory = getSchemasByCategory;
15
- exports.getSchemaById = getSchemaById;
16
- exports.getCriticalSchemas = getCriticalSchemas;
17
- exports.getSchemaStats = getSchemaStats;
18
- const SCHEMAS_BASE_URL = 'https://schema.modelcontextprotocol-identity.io/xmcp-i';
19
- /**
20
- * Complete registry of schemas from schema.modelcontextprotocol-identity.io
21
- *
22
- * As of 2025-10-17, there are 38 schemas covering:
23
- * - W3C Verifiable Credentials
24
- * - MCP-I Protocol (Handshake, Proof, Session)
25
- * - Delegation System
26
- * - Agent Registry
27
- * - CLI & Runtime
28
- * - TLKRC (Tool-Level Key Rotation)
29
- */
30
- exports.SCHEMA_REGISTRY = [
31
- // ===================================================================
32
- // W3C Verifiable Credentials
33
- // ===================================================================
34
- {
35
- id: 'verifiable-credential',
36
- url: `${SCHEMAS_BASE_URL}/vc/verifiable-credential.v1.0.0.json`,
37
- version: '1.0.0',
38
- type: 'VerifiableCredential',
39
- description: 'W3C Verifiable Credential Data Model',
40
- },
41
- {
42
- id: 'verifiable-presentation',
43
- url: `${SCHEMAS_BASE_URL}/vc/verifiable-presentation.v1.0.0.json`,
44
- version: '1.0.0',
45
- type: 'VerifiablePresentation',
46
- description: 'W3C Verifiable Presentation',
47
- },
48
- {
49
- id: 'statuslist2021-credential',
50
- url: `${SCHEMAS_BASE_URL}/vc/statuslist-2021-credential.v1.0.0.json`,
51
- version: '1.0.0',
52
- type: 'StatusList2021Credential',
53
- description: 'StatusList2021 Credential for efficient revocation',
54
- },
55
- {
56
- id: 'statuslist2021-credential-subject',
57
- url: `${SCHEMAS_BASE_URL}/vc/statuslist-2021-credential-subject.v1.0.0.json`,
58
- version: '1.0.0',
59
- type: 'StatusList2021CredentialSubject',
60
- description: 'StatusList2021 Credential Subject',
61
- },
62
- // ===================================================================
63
- // Delegation Credentials
64
- // ===================================================================
65
- {
66
- id: 'delegation-credential',
67
- url: `${SCHEMAS_BASE_URL}/credentials/delegation/v1.0.0.json`,
68
- version: '1.0.0',
69
- type: 'DelegationCredential',
70
- description: 'W3C VC-based delegation credential',
71
- },
72
- // ===================================================================
73
- // Delegation System
74
- // ===================================================================
75
- {
76
- id: 'delegation-record',
77
- url: `${SCHEMAS_BASE_URL}/delegation/delegation-record.v1.0.0.json`,
78
- version: '1.0.0',
79
- type: 'DelegationRecord',
80
- description: 'Internal delegation record',
81
- },
82
- {
83
- id: 'delegation-constraints',
84
- url: `${SCHEMAS_BASE_URL}/delegation/constraints.v1.0.0.json`,
85
- version: '1.0.0',
86
- type: 'DelegationConstraints',
87
- description: 'CRISP constraints for delegations',
88
- },
89
- {
90
- id: 'delegation-chain',
91
- url: `${SCHEMAS_BASE_URL}/delegation/delegation-chain.v1.0.0.json`,
92
- version: '1.0.0',
93
- type: 'DelegationChain',
94
- description: 'Delegation chain for hierarchy tracking',
95
- },
96
- {
97
- id: 'delegation-creation-request',
98
- url: `${SCHEMAS_BASE_URL}/delegation/delegation-creation-request.v1.0.0.json`,
99
- version: '1.0.0',
100
- type: 'DelegationCreationRequest',
101
- description: 'Request to create a delegation',
102
- },
103
- {
104
- id: 'delegation-verification-result',
105
- url: `${SCHEMAS_BASE_URL}/delegation/delegation-verification-result.v1.0.0.json`,
106
- version: '1.0.0',
107
- type: 'DelegationVerificationResult',
108
- description: 'Result of delegation verification',
109
- },
110
- // ===================================================================
111
- // MCP-I Protocol - Handshake
112
- // ===================================================================
113
- {
114
- id: 'handshake-request',
115
- url: `${SCHEMAS_BASE_URL}/handshake/handshake-request.v1.0.0.json`,
116
- version: '1.0.0',
117
- type: 'HandshakeRequest',
118
- description: 'MCP-I handshake request',
119
- },
120
- {
121
- id: 'session-context',
122
- url: `${SCHEMAS_BASE_URL}/handshake/session-context.v1.0.0.json`,
123
- version: '1.0.0',
124
- type: 'SessionContext',
125
- description: 'MCP-I session context',
126
- },
127
- {
128
- id: 'nonce-cache-config',
129
- url: `${SCHEMAS_BASE_URL}/handshake/nonce-cache-config.v1.0.0.json`,
130
- version: '1.0.0',
131
- type: 'NonceCacheConfig',
132
- description: 'Nonce cache configuration',
133
- },
134
- {
135
- id: 'nonce-cache-entry',
136
- url: `${SCHEMAS_BASE_URL}/handshake/nonce-cache-entry.v1.0.0.json`,
137
- version: '1.0.0',
138
- type: 'NonceCacheEntry',
139
- description: 'Nonce cache entry for replay protection',
140
- },
141
- // ===================================================================
142
- // MCP-I Protocol - Proof
143
- // ===================================================================
144
- {
145
- id: 'detached-proof',
146
- url: `${SCHEMAS_BASE_URL}/proof/detached-proof.v1.0.0.json`,
147
- version: '1.0.0',
148
- type: 'DetachedProof',
149
- description: 'MCP-I detached proof with JWS',
150
- },
151
- {
152
- id: 'proof-meta',
153
- url: `${SCHEMAS_BASE_URL}/proof/proof-meta.v1.0.0.json`,
154
- version: '1.0.0',
155
- type: 'ProofMeta',
156
- description: 'Metadata for MCP-I proofs',
157
- },
158
- {
159
- id: 'proof',
160
- url: `${SCHEMAS_BASE_URL}/proof/v1.0.0.json`,
161
- version: '1.0.0',
162
- type: 'Proof',
163
- description: 'Generic proof structure',
164
- },
165
- {
166
- id: 'proof-w3c',
167
- url: `${SCHEMAS_BASE_URL}/proof/w3c/v1.0.0.json`,
168
- version: '1.0.0',
169
- type: 'W3CProof',
170
- description: 'W3C-compliant proof',
171
- },
172
- {
173
- id: 'audit-record',
174
- url: `${SCHEMAS_BASE_URL}/proof/audit-record.v1.0.0.json`,
175
- version: '1.0.0',
176
- type: 'AuditRecord',
177
- description: 'Audit trail record',
178
- },
179
- {
180
- id: 'canonical-hashes',
181
- url: `${SCHEMAS_BASE_URL}/proof/canonical-hashes.v1.0.0.json`,
182
- version: '1.0.0',
183
- type: 'CanonicalHashes',
184
- description: 'Canonical hashes for proof generation',
185
- },
186
- // ===================================================================
187
- // Agent Registry
188
- // ===================================================================
189
- {
190
- id: 'registration-input',
191
- url: `${SCHEMAS_BASE_URL}/registry/registration-input.v1.0.0.json`,
192
- version: '1.0.0',
193
- type: 'RegistrationInput',
194
- description: 'Agent registration input',
195
- },
196
- {
197
- id: 'registration-result',
198
- url: `${SCHEMAS_BASE_URL}/registry/registration-result.v1.0.0.json`,
199
- version: '1.0.0',
200
- type: 'RegistrationResult',
201
- description: 'Agent registration result',
202
- },
203
- {
204
- id: 'agent-status',
205
- url: `${SCHEMAS_BASE_URL}/registry/agent-status.v1.0.0.json`,
206
- version: '1.0.0',
207
- type: 'AgentStatus',
208
- description: 'Agent status information',
209
- },
210
- {
211
- id: 'claim-token',
212
- url: `${SCHEMAS_BASE_URL}/registry/claim-token.v1.0.0.json`,
213
- version: '1.0.0',
214
- type: 'ClaimToken',
215
- description: 'Token for claiming agent ownership',
216
- },
217
- {
218
- id: 'delegation-request',
219
- url: `${SCHEMAS_BASE_URL}/registry/delegation-request.v1.0.0.json`,
220
- version: '1.0.0',
221
- type: 'DelegationRequest',
222
- description: 'Registry delegation request',
223
- },
224
- {
225
- id: 'delegation-response',
226
- url: `${SCHEMAS_BASE_URL}/registry/delegation-response.v1.0.0.json`,
227
- version: '1.0.0',
228
- type: 'DelegationResponse',
229
- description: 'Registry delegation response',
230
- },
231
- {
232
- id: 'registry-delegation',
233
- url: `${SCHEMAS_BASE_URL}/registry/delegation.v1.0.0.json`,
234
- version: '1.0.0',
235
- type: 'RegistryDelegation',
236
- description: 'Registry delegation object',
237
- },
238
- {
239
- id: 'mirror-status',
240
- url: `${SCHEMAS_BASE_URL}/registry/mirror-status.v1.0.0.json`,
241
- version: '1.0.0',
242
- type: 'MirrorStatus',
243
- description: 'Registry mirror status',
244
- },
245
- {
246
- id: 'receipt',
247
- url: `${SCHEMAS_BASE_URL}/registry/receipt.v1.0.0.json`,
248
- version: '1.0.0',
249
- type: 'Receipt',
250
- description: 'Registry receipt',
251
- },
252
- // ===================================================================
253
- // Runtime
254
- // ===================================================================
255
- {
256
- id: 'authorization-display',
257
- url: `${SCHEMAS_BASE_URL}/runtime/authorization-display.v1.0.0.json`,
258
- version: '1.0.0',
259
- type: 'AuthorizationDisplay',
260
- description: 'Authorization display information',
261
- },
262
- {
263
- id: 'needs-authorization-error',
264
- url: `${SCHEMAS_BASE_URL}/runtime/needs-authorization-error.v1.0.0.json`,
265
- version: '1.0.0',
266
- type: 'NeedsAuthorizationError',
267
- description: 'Error indicating authorization is needed',
268
- },
269
- {
270
- id: 'runtime-error',
271
- url: `${SCHEMAS_BASE_URL}/runtime/runtime-error.v1.0.0.json`,
272
- version: '1.0.0',
273
- type: 'RuntimeError',
274
- description: 'Generic runtime error',
275
- },
276
- // ===================================================================
277
- // CLI
278
- // ===================================================================
279
- {
280
- id: 'register-output',
281
- url: `${SCHEMAS_BASE_URL}/cli/register-output/v1.0.0.json`,
282
- version: '1.0.0',
283
- type: 'RegisterOutput',
284
- description: 'CLI registration output',
285
- },
286
- // ===================================================================
287
- // TLKRC (Tool-Level Key Rotation)
288
- // ===================================================================
289
- {
290
- id: 'rotation-chain',
291
- url: `${SCHEMAS_BASE_URL}/tlkrc/rotation-chain.v1.0.0.json`,
292
- version: '1.0.0',
293
- type: 'RotationChain',
294
- description: 'Key rotation chain',
295
- },
296
- {
297
- id: 'rotation-event',
298
- url: `${SCHEMAS_BASE_URL}/tlkrc/rotation-event.v1.0.0.json`,
299
- version: '1.0.0',
300
- type: 'RotationEvent',
301
- description: 'Key rotation event',
302
- },
303
- // ===================================================================
304
- // Verifier Service
305
- // ===================================================================
306
- {
307
- id: 'verify-page',
308
- url: `${SCHEMAS_BASE_URL}/verifier/verify-page/v1.0.0.json`,
309
- version: '1.0.0',
310
- type: 'VerifyPage',
311
- description: 'Verifier page response',
312
- },
313
- // ===================================================================
314
- // Well-Known
315
- // ===================================================================
316
- {
317
- id: 'well-known-agent',
318
- url: `${SCHEMAS_BASE_URL}/well-known/agent/v1.0.0.json`,
319
- version: '1.0.0',
320
- type: 'WellKnownAgent',
321
- description: 'Agent well-known metadata',
322
- },
323
- ];
324
- /**
325
- * Get all schemas
326
- */
327
- function getAllSchemas() {
328
- return exports.SCHEMA_REGISTRY;
329
- }
330
- /**
331
- * Get schemas by category
332
- */
333
- function getSchemasByCategory(category) {
334
- const categoryMap = {
335
- 'vc': [
336
- 'verifiable-credential',
337
- 'verifiable-presentation',
338
- 'statuslist2021-credential',
339
- 'statuslist2021-credential-subject',
340
- ],
341
- 'delegation': [
342
- 'delegation-credential',
343
- 'delegation-record',
344
- 'delegation-constraints',
345
- 'delegation-chain',
346
- 'delegation-creation-request',
347
- 'delegation-verification-result',
348
- ],
349
- 'handshake': [
350
- 'handshake-request',
351
- 'session-context',
352
- 'nonce-cache-config',
353
- 'nonce-cache-entry',
354
- ],
355
- 'proof': [
356
- 'detached-proof',
357
- 'proof-meta',
358
- 'proof',
359
- 'proof-w3c',
360
- 'audit-record',
361
- 'canonical-hashes',
362
- ],
363
- 'registry': [
364
- 'registration-input',
365
- 'registration-result',
366
- 'agent-status',
367
- 'claim-token',
368
- 'delegation-request',
369
- 'delegation-response',
370
- 'registry-delegation',
371
- 'mirror-status',
372
- 'receipt',
373
- ],
374
- 'runtime': [
375
- 'authorization-display',
376
- 'needs-authorization-error',
377
- 'runtime-error',
378
- ],
379
- 'cli': ['register-output'],
380
- 'tlkrc': ['rotation-chain', 'rotation-event'],
381
- 'verifier': ['verify-page'],
382
- 'well-known': ['well-known-agent'],
383
- };
384
- const ids = categoryMap[category] || [];
385
- return exports.SCHEMA_REGISTRY.filter((s) => ids.includes(s.id));
386
- }
387
- /**
388
- * Get schema by ID
389
- */
390
- function getSchemaById(id) {
391
- return exports.SCHEMA_REGISTRY.find((s) => s.id === id);
392
- }
393
- /**
394
- * Get critical schemas (must be 100% compliant)
395
- *
396
- * These are the core schemas that power the MCP-I protocol and must
397
- * be fully compliant for the system to function correctly.
398
- */
399
- function getCriticalSchemas() {
400
- const criticalIds = [
401
- // W3C VC Core
402
- 'verifiable-credential',
403
- 'statuslist2021-credential',
404
- // Delegation System
405
- 'delegation-credential',
406
- 'delegation-record',
407
- 'delegation-constraints',
408
- // MCP-I Protocol
409
- 'detached-proof',
410
- 'proof-meta',
411
- 'handshake-request',
412
- 'session-context',
413
- // Audit
414
- 'audit-record',
415
- ];
416
- return exports.SCHEMA_REGISTRY.filter((s) => criticalIds.includes(s.id));
417
- }
418
- /**
419
- * Get schema statistics
420
- */
421
- function getSchemaStats() {
422
- const byCategory = {};
423
- const byVersion = {};
424
- for (const schema of exports.SCHEMA_REGISTRY) {
425
- // Category stats (inferred from URL)
426
- const urlParts = schema.url.replace(SCHEMAS_BASE_URL + '/', '').split('/');
427
- const category = urlParts[0] || 'unknown';
428
- byCategory[category] = (byCategory[category] || 0) + 1;
429
- // Version stats
430
- byVersion[schema.version] = (byVersion[schema.version] || 0) + 1;
431
- }
432
- return {
433
- total: exports.SCHEMA_REGISTRY.length,
434
- byCategory,
435
- byVersion,
436
- };
437
- }
438
- //# sourceMappingURL=schema-registry.js.map
@@ -1,110 +0,0 @@
1
- /**
2
- * Schema Compliance Verification Tool
3
- *
4
- * Supports JSON Schema draft-07 features:
5
- * - $ref resolution
6
- * - oneOf, anyOf, allOf
7
- * - Nested required fields
8
- * - Array tuple validation
9
- * - Format, pattern, enum, const
10
- * - Recursive object validation
11
- */
12
- export interface SchemaMetadata {
13
- id: string;
14
- url: string;
15
- version: string;
16
- type: string;
17
- description?: string;
18
- }
19
- export interface FieldComplianceResult {
20
- fieldPath: string;
21
- present: boolean;
22
- expectedType: string;
23
- actualType?: string;
24
- typeMatches: boolean;
25
- required: boolean;
26
- status: 'pass' | 'fail' | 'warning';
27
- reason?: string;
28
- }
29
- export interface SchemaComplianceReport {
30
- schema: SchemaMetadata;
31
- compliant: boolean;
32
- compliancePercentage: number;
33
- fields: FieldComplianceResult[];
34
- issues: string[];
35
- warnings: string[];
36
- timestamp: number;
37
- }
38
- export interface FullComplianceReport {
39
- totalSchemas: number;
40
- compliantSchemas: number;
41
- overallCompliance: number;
42
- schemaReports: SchemaComplianceReport[];
43
- criticalIssues: string[];
44
- timestamp: number;
45
- }
46
- /**
47
- * Schema Verifier with JSON Schema draft-07 support
48
- */
49
- export declare class SchemaVerifier {
50
- private schemasBaseUrl;
51
- private schemaCache;
52
- constructor(options?: {
53
- schemasBaseUrl?: string;
54
- });
55
- /**
56
- * Verify a single schema against implementation
57
- */
58
- verifySchema(schema: SchemaMetadata, implementation: any): Promise<SchemaComplianceReport>;
59
- /**
60
- * Verify all schemas
61
- */
62
- verifyAll(schemas: SchemaMetadata[], implementations: Map<string, any>): Promise<FullComplianceReport>;
63
- /**
64
- * Validate implementation against schema recursively
65
- */
66
- private validateAgainstSchema;
67
- /**
68
- * Validate against oneOf, anyOf, allOf
69
- */
70
- private validateUnion;
71
- /**
72
- * Check if value matches schema (lightweight check)
73
- */
74
- private matchesSchema;
75
- /**
76
- * Validate array against schema
77
- */
78
- private validateArray;
79
- /**
80
- * Check a single field
81
- */
82
- private checkField;
83
- /**
84
- * Get actual JavaScript type
85
- */
86
- private getActualType;
87
- /**
88
- * Resolve $ref reference
89
- */
90
- private resolveRef;
91
- /**
92
- * Fetch a schema from URL
93
- */
94
- private fetchSchema;
95
- /**
96
- * Generate a formatted report
97
- */
98
- generateReport(report: SchemaComplianceReport): string;
99
- /**
100
- * Generate full report
101
- */
102
- generateFullReport(report: FullComplianceReport): string;
103
- }
104
- /**
105
- * Create a schema verifier
106
- */
107
- export declare function createSchemaVerifier(options?: {
108
- schemasBaseUrl?: string;
109
- }): SchemaVerifier;
110
- //# sourceMappingURL=schema-verifier.d.ts.map