@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.
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,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