@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,14 +0,0 @@
1
- /**
2
- * MCP Apps Extension Constants
3
- *
4
- * Shared constants for the MCP Apps consent UI integration.
5
- * Kept separate from the runtime class so consumers can import
6
- * without pulling in the full MCPIRuntimeBase dependency.
7
- */
8
- /**
9
- * URI for the shared consent UI resource.
10
- * All consent-requiring tools reference this single resource;
11
- * tool-specific data is passed via structuredContent.
12
- */
13
- export declare const CONSENT_UI_RESOURCE_URI = "ui://mcpi-consent/authorize";
14
- //# sourceMappingURL=ext-apps-constants.d.ts.map
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP Apps Extension Constants
4
- *
5
- * Shared constants for the MCP Apps consent UI integration.
6
- * Kept separate from the runtime class so consumers can import
7
- * without pulling in the full MCPIRuntimeBase dependency.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.CONSENT_UI_RESOURCE_URI = void 0;
11
- /**
12
- * URI for the shared consent UI resource.
13
- * All consent-requiring tools reference this single resource;
14
- * tool-specific data is passed via structuredContent.
15
- */
16
- exports.CONSENT_UI_RESOURCE_URI = "ui://mcpi-consent/authorize";
17
- //# sourceMappingURL=ext-apps-constants.js.map
@@ -1,138 +0,0 @@
1
- /**
2
- * Access Control API Service
3
- *
4
- * Brand-neutral service for interacting with access-control APIs
5
- * (currently AgentShield/bouncer, but designed to be provider-agnostic).
6
- *
7
- * This service provides:
8
- * - Delegation verification
9
- * - Configuration fetching
10
- * - Proof submission
11
- *
12
- * @package @kya-os/mcp-i-core
13
- */
14
- import type { VerifyDelegationRequest, VerifyDelegationAPIResponse, ToolProtectionConfigAPIResponse, ProofSubmissionRequest, ProofSubmissionResponse } from "@kya-os/contracts/agentshield-api";
15
- import type { FetchProvider } from "../providers/base";
16
- export interface AccessControlApiServiceConfig {
17
- /** Base URL for the access-control API (e.g., "https://kya.vouched.id") */
18
- baseUrl: string;
19
- /** API key for authentication */
20
- apiKey: string;
21
- /** Fetch provider for making HTTP requests */
22
- fetchProvider: FetchProvider;
23
- /** Optional logger callback for diagnostics */
24
- logger?: (message: string, data?: unknown) => void;
25
- /** Optional retry configuration */
26
- retryConfig?: {
27
- maxRetries?: number;
28
- initialDelayMs?: number;
29
- maxDelayMs?: number;
30
- };
31
- /** Optional sleep function for delays (platform-agnostic) */
32
- sleepProvider?: (ms: number) => Promise<void>;
33
- }
34
- export interface AccessControlApiServiceMetrics {
35
- /** Number of successful requests */
36
- successCount: number;
37
- /** Number of failed requests */
38
- errorCount: number;
39
- /** Number of retries performed */
40
- retryCount: number;
41
- }
42
- /**
43
- * Access Control API Service
44
- *
45
- * Handles all interactions with the access-control API (AgentShield/bouncer).
46
- * Designed to be brand-neutral and work with any access-control provider.
47
- */
48
- export declare class AccessControlApiService {
49
- private config;
50
- private metrics;
51
- constructor(config: AccessControlApiServiceConfig);
52
- /**
53
- * Fetch tool protection configuration for an agent
54
- *
55
- * GET /api/v1/bouncer/config?agent_did={agentDid}
56
- */
57
- fetchConfig(options: {
58
- agentDid: string;
59
- }): Promise<ToolProtectionConfigAPIResponse>;
60
- /**
61
- * Verify a delegation token
62
- *
63
- * POST /api/v1/bouncer/delegations/verify
64
- */
65
- verifyDelegation(request: VerifyDelegationRequest, context?: {
66
- delegationToken?: string;
67
- credentialJwt?: string;
68
- }): Promise<VerifyDelegationAPIResponse>;
69
- /**
70
- * Submit proofs for audit and verification
71
- *
72
- * POST /api/v1/bouncer/proofs
73
- */
74
- submitProofs(request: ProofSubmissionRequest): Promise<ProofSubmissionResponse>;
75
- /**
76
- * Get current metrics
77
- */
78
- getMetrics(): AccessControlApiServiceMetrics;
79
- /**
80
- * Reset metrics
81
- */
82
- resetMetrics(): void;
83
- /**
84
- * Retry logic with exponential backoff
85
- *
86
- * @internal
87
- */
88
- private retryWithBackoff;
89
- /**
90
- * Check if an error is retryable (5xx status codes)
91
- *
92
- * @internal
93
- */
94
- private isRetryableError;
95
- /**
96
- * Sleep utility for retry delays
97
- * Uses platform-agnostic sleep provider
98
- *
99
- * @internal
100
- */
101
- private sleep;
102
- /**
103
- * Parse response text to JSON with error handling
104
- *
105
- * @internal
106
- */
107
- private parseResponseJSON;
108
- /**
109
- * Map HTTP status codes to error codes
110
- *
111
- * @internal
112
- */
113
- private mapStatusToErrorCode;
114
- /**
115
- * Handle error responses and throw appropriate AgentShieldAPIError
116
- *
117
- * @internal
118
- */
119
- private handleErrorResponse;
120
- }
121
- /**
122
- * Compare delegation authorization with current tool protection authorization
123
- * Returns true if they match, false otherwise
124
- *
125
- * @param delegationAuth - Authorization from the delegation credential
126
- * @param toolAuth - Authorization required by the tool protection config
127
- * @returns true if authorization methods match
128
- */
129
- export declare function authorizationMatches(delegationAuth: {
130
- type: string;
131
- provider?: string;
132
- credentialType?: string;
133
- }, toolAuth: {
134
- type: string;
135
- provider?: string;
136
- credentialType?: string;
137
- } | undefined): boolean;
138
- //# sourceMappingURL=access-control.service.d.ts.map