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