@kya-os/mcp-i-core 1.1.14-canary.1 → 1.2.1-canary.0

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 (60) hide show
  1. package/dist/__tests__/utils/mock-providers.d.ts +5 -3
  2. package/dist/__tests__/utils/mock-providers.d.ts.map +1 -1
  3. package/dist/__tests__/utils/mock-providers.js +23 -12
  4. package/dist/__tests__/utils/mock-providers.js.map +1 -1
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/providers/base.d.ts +18 -3
  10. package/dist/providers/base.d.ts.map +1 -1
  11. package/dist/providers/base.js +5 -1
  12. package/dist/providers/base.js.map +1 -1
  13. package/dist/providers/memory.d.ts +2 -2
  14. package/dist/providers/memory.d.ts.map +1 -1
  15. package/dist/providers/memory.js +9 -5
  16. package/dist/providers/memory.js.map +1 -1
  17. package/dist/runtime/base.d.ts +26 -1
  18. package/dist/runtime/base.d.ts.map +1 -1
  19. package/dist/runtime/base.js +102 -7
  20. package/dist/runtime/base.js.map +1 -1
  21. package/dist/services/access-control.service.d.ts +21 -0
  22. package/dist/services/access-control.service.d.ts.map +1 -1
  23. package/dist/services/access-control.service.js +333 -9
  24. package/dist/services/access-control.service.js.map +1 -1
  25. package/dist/services/proof-verifier.d.ts +1 -1
  26. package/dist/services/proof-verifier.d.ts.map +1 -1
  27. package/dist/services/proof-verifier.js +15 -14
  28. package/dist/services/proof-verifier.js.map +1 -1
  29. package/dist/services/storage.service.d.ts +116 -0
  30. package/dist/services/storage.service.d.ts.map +1 -0
  31. package/dist/services/storage.service.js +405 -0
  32. package/dist/services/storage.service.js.map +1 -0
  33. package/dist/utils/storage-keys.d.ts +1 -0
  34. package/dist/utils/storage-keys.d.ts.map +1 -1
  35. package/dist/utils/storage-keys.js.map +1 -1
  36. package/package.json +3 -3
  37. package/dist/compliance/schema-verifier-v2.d.ts +0 -110
  38. package/dist/compliance/schema-verifier-v2.d.ts.map +0 -1
  39. package/dist/compliance/schema-verifier-v2.js +0 -510
  40. package/dist/compliance/schema-verifier-v2.js.map +0 -1
  41. package/dist/did/resolver.d.ts +0 -92
  42. package/dist/did/resolver.d.ts.map +0 -1
  43. package/dist/did/resolver.js +0 -203
  44. package/dist/did/resolver.js.map +0 -1
  45. package/dist/proof/proof-engine.d.ts +0 -89
  46. package/dist/proof/proof-engine.d.ts.map +0 -1
  47. package/dist/proof/proof-engine.js +0 -249
  48. package/dist/proof/proof-engine.js.map +0 -1
  49. package/dist/runtime/base-v2.d.ts +0 -117
  50. package/dist/runtime/base-v2.d.ts.map +0 -1
  51. package/dist/runtime/base-v2.js +0 -328
  52. package/dist/runtime/base-v2.js.map +0 -1
  53. package/dist/types/providers.d.ts +0 -142
  54. package/dist/types/providers.d.ts.map +0 -1
  55. package/dist/types/providers.js +0 -43
  56. package/dist/types/providers.js.map +0 -1
  57. package/dist/verification/interfaces.d.ts +0 -125
  58. package/dist/verification/interfaces.d.ts.map +0 -1
  59. package/dist/verification/interfaces.js +0 -101
  60. package/dist/verification/interfaces.js.map +0 -1
@@ -1,117 +0,0 @@
1
- /**
2
- * Base MCP-I Runtime V2 - Refactored with better separation of concerns
3
- */
4
- import { CryptoProvider, IdentityProvider, StorageProvider, NonceCacheProvider, ClockProvider, FetchProvider } from "../types/providers";
5
- import { AgentIdentity, SessionContext, HandshakeRequest, HandshakeResponse } from "@kya-os/contracts/handshake";
6
- import { ProofEngine, ProofFormat, ProofOptions } from "../proof/proof-engine";
7
- import { CredentialVerifier, DelegationRegistry, ProgressiveVerifier } from "../verification/interfaces";
8
- import { UniversalDIDResolver } from "../did/resolver";
9
- export interface MCPIRuntimeConfigV2 {
10
- cryptoProvider: CryptoProvider;
11
- identityProvider: IdentityProvider;
12
- storageProvider: StorageProvider;
13
- nonceCacheProvider: NonceCacheProvider;
14
- clockProvider: ClockProvider;
15
- fetchProvider: FetchProvider;
16
- proofEngine?: ProofEngine;
17
- didResolver?: UniversalDIDResolver;
18
- credentialVerifier?: CredentialVerifier;
19
- delegationRegistry?: DelegationRegistry;
20
- session?: {
21
- timestampSkewSeconds?: number;
22
- sessionTtlMinutes?: number;
23
- absoluteSessionLifetime?: number;
24
- };
25
- audit?: {
26
- enabled?: boolean;
27
- includePayloads?: boolean;
28
- logFunction?: (record: string) => void;
29
- };
30
- proof?: {
31
- defaultFormat?: ProofFormat;
32
- canonicalize?: boolean;
33
- };
34
- security?: {
35
- requireCredentialVerification?: boolean;
36
- maxDelegationDepth?: number;
37
- allowExpiredCredentials?: boolean;
38
- };
39
- }
40
- /**
41
- * Refactored MCP-I Runtime Base
42
- * Accepts providers instead of implementing crypto directly
43
- */
44
- export declare class MCPIRuntimeBaseV2 {
45
- protected crypto: CryptoProvider;
46
- protected identity: IdentityProvider;
47
- protected storage: StorageProvider;
48
- protected nonceCache: NonceCacheProvider;
49
- protected clock: ClockProvider;
50
- protected fetch: FetchProvider;
51
- protected proofEngine: ProofEngine;
52
- protected didResolver: UniversalDIDResolver;
53
- protected credentialVerifier?: CredentialVerifier;
54
- protected delegationRegistry?: DelegationRegistry;
55
- protected progressiveVerifier?: ProgressiveVerifier;
56
- protected config: MCPIRuntimeConfigV2;
57
- private cachedIdentity?;
58
- private sessions;
59
- constructor(config: MCPIRuntimeConfigV2);
60
- /**
61
- * Initialize runtime (load or generate identity)
62
- */
63
- initialize(): Promise<void>;
64
- /**
65
- * Get current agent identity
66
- */
67
- getIdentity(): Promise<AgentIdentity>;
68
- /**
69
- * Generate new identity using crypto provider
70
- */
71
- protected generateIdentity(): Promise<void>;
72
- /**
73
- * Create DID from public key
74
- */
75
- protected createDID(publicKey: string): Promise<string>;
76
- /**
77
- * Handle handshake request with improved validation
78
- */
79
- handleHandshake(request: HandshakeRequest): Promise<HandshakeResponse>;
80
- /**
81
- * Create proof using ProofEngine
82
- */
83
- createProof(response: any, session: SessionContext, options?: Partial<ProofOptions>): Promise<any>;
84
- /**
85
- * Verify proof with optional credential/delegation verification
86
- */
87
- verifyProof(data: any, proof: any, options?: {
88
- verifyCredential?: boolean;
89
- checkDelegation?: boolean;
90
- publicKey?: string;
91
- }): Promise<boolean>;
92
- /**
93
- * Process tool call with automatic proof generation
94
- */
95
- processToolCall(toolName: string, args: any, handler: (args: any) => Promise<any>, session: SessionContext): Promise<any>;
96
- /**
97
- * Get edge verification data for offline verification
98
- */
99
- getEdgeVerificationData(id: string): Promise<any>;
100
- /**
101
- * Generate cryptographically secure session ID
102
- */
103
- protected generateSessionId(): Promise<string>;
104
- /**
105
- * Generate cryptographically secure nonce
106
- */
107
- protected generateNonce(): Promise<string>;
108
- /**
109
- * Get runtime capabilities
110
- */
111
- protected getCapabilities(): Promise<string[]>;
112
- /**
113
- * Audit logging
114
- */
115
- protected auditLog(event: string, data?: any): void;
116
- }
117
- //# sourceMappingURL=base-v2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-v2.d.ts","sourceRoot":"","sources":["../../src/runtime/base-v2.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAElC,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,kBAA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BAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAQvD;;OAEG;cACa,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKpD;;OAEG;cACa,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhD;;OAEG;cACa,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBpD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAoBpD"}
@@ -1,328 +0,0 @@
1
- "use strict";
2
- /**
3
- * Base MCP-I Runtime V2 - Refactored with better separation of concerns
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MCPIRuntimeBaseV2 = void 0;
7
- const interfaces_1 = require("../verification/interfaces");
8
- const resolver_1 = require("../did/resolver");
9
- /**
10
- * Refactored MCP-I Runtime Base
11
- * Accepts providers instead of implementing crypto directly
12
- */
13
- class MCPIRuntimeBaseV2 {
14
- // Core providers
15
- crypto;
16
- identity;
17
- storage;
18
- nonceCache;
19
- clock;
20
- fetch;
21
- // Advanced components
22
- proofEngine;
23
- didResolver;
24
- credentialVerifier;
25
- delegationRegistry;
26
- progressiveVerifier;
27
- // Configuration
28
- config;
29
- // Runtime state
30
- cachedIdentity;
31
- sessions = new Map();
32
- constructor(config) {
33
- this.config = config;
34
- // Set core providers
35
- this.crypto = config.cryptoProvider;
36
- this.identity = config.identityProvider;
37
- this.storage = config.storageProvider;
38
- this.nonceCache = config.nonceCacheProvider;
39
- this.clock = config.clockProvider;
40
- this.fetch = config.fetchProvider;
41
- // Initialize advanced components
42
- this.proofEngine = config.proofEngine || new (require('../proof/proof-engine').DefaultProofEngine)(this.crypto);
43
- this.didResolver = config.didResolver || new resolver_1.UniversalDIDResolver(this.fetch);
44
- // Set optional verification components
45
- this.credentialVerifier = config.credentialVerifier;
46
- this.delegationRegistry = config.delegationRegistry;
47
- // Create progressive verifier if both components available
48
- if (this.credentialVerifier && this.delegationRegistry) {
49
- this.progressiveVerifier = new interfaces_1.ProgressiveVerifier(this.credentialVerifier, this.delegationRegistry);
50
- }
51
- }
52
- /**
53
- * Initialize runtime (load or generate identity)
54
- */
55
- async initialize() {
56
- // Try to load existing identity
57
- this.cachedIdentity = await this.identity.loadIdentity() || undefined;
58
- // Generate new identity if none exists
59
- if (!this.cachedIdentity) {
60
- await this.generateIdentity();
61
- }
62
- // Audit initialization
63
- if (this.config.audit?.enabled) {
64
- this.auditLog('runtime_initialized', {
65
- did: this.cachedIdentity?.did,
66
- timestamp: this.clock.now()
67
- });
68
- }
69
- }
70
- /**
71
- * Get current agent identity
72
- */
73
- async getIdentity() {
74
- if (!this.cachedIdentity) {
75
- await this.initialize();
76
- }
77
- if (!this.cachedIdentity) {
78
- throw new Error("Identity not initialized");
79
- }
80
- return this.cachedIdentity;
81
- }
82
- /**
83
- * Generate new identity using crypto provider
84
- */
85
- async generateIdentity() {
86
- const { privateKey, publicKey } = await this.crypto.generateKeyPair();
87
- // Create DID from public key
88
- const did = await this.createDID(publicKey);
89
- const keyId = `${did}#key-1`;
90
- const identity = {
91
- did,
92
- keyId,
93
- privateKey,
94
- publicKey,
95
- createdAt: new Date(this.clock.now()).toISOString()
96
- };
97
- await this.identity.storeIdentity(identity);
98
- this.cachedIdentity = identity;
99
- // Audit identity generation
100
- this.auditLog('identity_generated', { did, keyId });
101
- }
102
- /**
103
- * Create DID from public key
104
- */
105
- async createDID(publicKey) {
106
- // Default: did:key format
107
- const keyBytes = Buffer.from(publicKey, 'base64');
108
- const multicodec = Buffer.concat([
109
- Buffer.from([0xed, 0x01]), // Ed25519 public key multicodec
110
- keyBytes
111
- ]);
112
- const multibase = 'z' + multicodec.toString('base64url');
113
- return `did:key:${multibase}`;
114
- }
115
- /**
116
- * Handle handshake request with improved validation
117
- */
118
- async handleHandshake(request) {
119
- const identity = await this.getIdentity();
120
- // Validate timestamp using clock provider
121
- if (!this.clock.isWithinSkew(request.timestamp, this.config.session?.timestampSkewSeconds || 120)) {
122
- throw new Error("Timestamp outside acceptable window");
123
- }
124
- // Check nonce with prefix
125
- const nonceKey = `${this.nonceCache.getNoncePrefix()}${request.nonce}`;
126
- if (await this.nonceCache.has(nonceKey)) {
127
- throw new Error("Nonce already used");
128
- }
129
- // Add nonce to cache with TTL
130
- const ttl = this.nonceCache.getDefaultTTL();
131
- await this.nonceCache.add(nonceKey, ttl);
132
- // Create session
133
- const sessionId = await this.generateSessionId();
134
- const now = this.clock.now();
135
- const session = {
136
- sessionId,
137
- agentDid: identity.did,
138
- keyId: identity.keyId,
139
- establishedAt: now,
140
- lastActivityAt: now,
141
- nonce: request.nonce,
142
- clientInfo: request.clientInfo
143
- };
144
- this.sessions.set(sessionId, session);
145
- // Audit handshake
146
- this.auditLog('handshake_completed', {
147
- sessionId,
148
- clientInfo: request.clientInfo
149
- });
150
- return {
151
- sessionId,
152
- agentDid: identity.did,
153
- keyId: identity.keyId,
154
- timestamp: now,
155
- capabilities: await this.getCapabilities()
156
- };
157
- }
158
- /**
159
- * Create proof using ProofEngine
160
- */
161
- async createProof(response, session, options) {
162
- const identity = await this.getIdentity();
163
- // Use configured proof format
164
- const proofOptions = {
165
- format: options?.format || this.config.proof?.defaultFormat || {
166
- type: 'DetachedJWS',
167
- algorithm: 'Ed25519'
168
- },
169
- canonicalize: options?.canonicalize ?? this.config.proof?.canonicalize ?? true,
170
- includeMeta: options?.includeMeta ?? true
171
- };
172
- // Add session metadata
173
- const dataWithMeta = {
174
- ...response,
175
- _meta: {
176
- agentDid: identity.did,
177
- keyId: identity.keyId,
178
- sessionId: session.sessionId,
179
- timestamp: this.clock.now(),
180
- nonce: await this.generateNonce()
181
- }
182
- };
183
- // Create proof using engine
184
- const proof = await this.proofEngine.createProof(dataWithMeta, identity.privateKey, proofOptions);
185
- // Audit proof creation
186
- this.auditLog('proof_created', {
187
- sessionId: session.sessionId,
188
- format: proofOptions.format.type
189
- });
190
- return proof;
191
- }
192
- /**
193
- * Verify proof with optional credential/delegation verification
194
- */
195
- async verifyProof(data, proof, options) {
196
- // Extract public key if not provided
197
- let publicKey = options?.publicKey;
198
- if (!publicKey && data._meta?.agentDid) {
199
- // Resolve DID to get public key
200
- publicKey = await this.didResolver.getPublicKey(data._meta.agentDid, data._meta.keyId);
201
- }
202
- if (!publicKey) {
203
- throw new Error('No public key available for verification');
204
- }
205
- // Verify proof using engine
206
- const proofResult = await this.proofEngine.verifyProof(data, proof, publicKey, {
207
- format: { type: 'DetachedJWS', algorithm: 'Ed25519' },
208
- canonicalize: true
209
- });
210
- if (!proofResult.valid) {
211
- return false;
212
- }
213
- // Progressive verification if enabled
214
- if (this.progressiveVerifier && (options?.verifyCredential || options?.checkDelegation)) {
215
- const verificationResult = await this.progressiveVerifier.verifyProgressive(data, {
216
- verifyCredential: options.verifyCredential,
217
- checkRevocation: true,
218
- maxChainDepth: this.config.security?.maxDelegationDepth || 5
219
- });
220
- if (!verificationResult.valid) {
221
- this.auditLog('verification_failed', {
222
- errors: verificationResult.errors,
223
- warnings: verificationResult.warnings
224
- });
225
- return false;
226
- }
227
- }
228
- // Audit successful verification
229
- this.auditLog('proof_verified', {
230
- did: data._meta?.agentDid
231
- });
232
- return true;
233
- }
234
- /**
235
- * Process tool call with automatic proof generation
236
- */
237
- async processToolCall(toolName, args, handler, session) {
238
- // Check session validity
239
- const sessionAge = this.clock.now() - session.establishedAt;
240
- const maxAge = (this.config.session?.absoluteSessionLifetime || 86400) * 1000;
241
- if (sessionAge > maxAge) {
242
- throw new Error('Session expired');
243
- }
244
- // Update session activity
245
- session.lastActivityAt = this.clock.now();
246
- // Execute tool
247
- const startTime = this.clock.now();
248
- const result = await handler(args);
249
- const executionTime = this.clock.now() - startTime;
250
- // Create proof for response
251
- const proofedResult = await this.createProof(result, session);
252
- // Audit tool execution
253
- this.auditLog('tool_executed', {
254
- tool: toolName,
255
- sessionId: session.sessionId,
256
- executionTime,
257
- hasProof: true
258
- });
259
- return proofedResult;
260
- }
261
- /**
262
- * Get edge verification data for offline verification
263
- */
264
- async getEdgeVerificationData(id) {
265
- if (!this.progressiveVerifier) {
266
- throw new Error('Progressive verifier not configured');
267
- }
268
- return this.progressiveVerifier.getEdgeVerificationData(id);
269
- }
270
- /**
271
- * Generate cryptographically secure session ID
272
- */
273
- async generateSessionId() {
274
- // To be implemented by platform-specific runtime
275
- throw new Error('generateSessionId must be implemented by platform runtime');
276
- }
277
- /**
278
- * Generate cryptographically secure nonce
279
- */
280
- async generateNonce() {
281
- // To be implemented by platform-specific runtime
282
- throw new Error('generateNonce must be implemented by platform runtime');
283
- }
284
- /**
285
- * Get runtime capabilities
286
- */
287
- async getCapabilities() {
288
- const capabilities = ['tools', 'identity', 'proof', 'session'];
289
- if (this.credentialVerifier) {
290
- capabilities.push('credential-verification');
291
- }
292
- if (this.delegationRegistry) {
293
- capabilities.push('delegation');
294
- }
295
- if (this.progressiveVerifier) {
296
- capabilities.push('progressive-verification');
297
- }
298
- // Add supported proof formats
299
- const formats = this.proofEngine.getSupportedFormats();
300
- formats.forEach(f => {
301
- capabilities.push(`proof:${f.type.toLowerCase()}`);
302
- });
303
- return capabilities;
304
- }
305
- /**
306
- * Audit logging
307
- */
308
- auditLog(event, data) {
309
- if (!this.config.audit?.enabled) {
310
- return;
311
- }
312
- const record = {
313
- timestamp: this.clock.now(),
314
- event,
315
- data: this.config.audit.includePayloads ? data : undefined,
316
- did: this.cachedIdentity?.did
317
- };
318
- const logLine = JSON.stringify(record);
319
- if (this.config.audit.logFunction) {
320
- this.config.audit.logFunction(logLine);
321
- }
322
- else {
323
- console.log('[AUDIT]', logLine);
324
- }
325
- }
326
- }
327
- exports.MCPIRuntimeBaseV2 = MCPIRuntimeBaseV2;
328
- //# sourceMappingURL=base-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-v2.js","sourceRoot":"","sources":["../../src/runtime/base-v2.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiBH,2DAAyG;AAC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;OAEG;IACO,QAAQ,CAAC,KAAa,EAAE,IAAU;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YAChC,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC3B,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC1D,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG;SAC9B,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEvC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AA7ZD,8CA6ZC"}
@@ -1,142 +0,0 @@
1
- /**
2
- * Provider interfaces for platform-specific implementations
3
- */
4
- import { AgentIdentity } from "@kya-os/contracts/handshake";
5
- /**
6
- * Abstract crypto provider for platform-specific crypto operations
7
- */
8
- export declare abstract class CryptoProvider {
9
- /**
10
- * Sign data with Ed25519 private key
11
- */
12
- abstract sign(data: Uint8Array, privateKey: string): Promise<Uint8Array>;
13
- /**
14
- * Verify signature with Ed25519 public key
15
- */
16
- abstract verify(data: Uint8Array, signature: Uint8Array, publicKey: string): Promise<boolean>;
17
- /**
18
- * Generate Ed25519 key pair
19
- */
20
- abstract generateKeyPair(): Promise<{
21
- privateKey: string;
22
- publicKey: string;
23
- }>;
24
- /**
25
- * Create SHA-256 hash
26
- */
27
- abstract hash(data: Uint8Array): Promise<Uint8Array>;
28
- }
29
- /**
30
- * Abstract identity provider for platform-specific identity storage
31
- */
32
- export declare abstract class IdentityProvider {
33
- /**
34
- * Load agent identity from storage
35
- */
36
- abstract loadIdentity(): Promise<AgentIdentity | null>;
37
- /**
38
- * Store agent identity
39
- */
40
- abstract storeIdentity(identity: AgentIdentity): Promise<void>;
41
- /**
42
- * Check if identity exists
43
- */
44
- abstract hasIdentity(): Promise<boolean>;
45
- /**
46
- * Delete identity
47
- */
48
- abstract deleteIdentity(): Promise<void>;
49
- }
50
- /**
51
- * Abstract storage provider for general key-value storage
52
- */
53
- export declare abstract class StorageProvider {
54
- /**
55
- * Get value by key
56
- */
57
- abstract get(key: string): Promise<string | null>;
58
- /**
59
- * Set value with optional TTL
60
- */
61
- abstract set(key: string, value: string, ttl?: number): Promise<void>;
62
- /**
63
- * Delete value by key
64
- */
65
- abstract delete(key: string): Promise<void>;
66
- /**
67
- * Check if key exists
68
- */
69
- abstract has(key: string): Promise<boolean>;
70
- }
71
- /**
72
- * Nonce cache provider for replay attack prevention
73
- */
74
- export declare abstract class NonceCacheProvider {
75
- /**
76
- * Get nonce prefix for namespacing
77
- */
78
- abstract getNoncePrefix(): string;
79
- /**
80
- * Get default TTL in seconds
81
- */
82
- abstract getDefaultTTL(): number;
83
- /**
84
- * Check if nonce exists
85
- */
86
- abstract has(nonce: string): Promise<boolean>;
87
- /**
88
- * Add nonce with TTL in seconds
89
- */
90
- abstract add(nonce: string, ttl: number): Promise<void>;
91
- /**
92
- * Clean expired nonces (optional)
93
- */
94
- abstract cleanup?(): Promise<void>;
95
- }
96
- /**
97
- * Clock provider for time-based operations
98
- */
99
- export declare abstract class ClockProvider {
100
- /**
101
- * Get current timestamp in milliseconds
102
- */
103
- abstract now(): number;
104
- /**
105
- * Check if a timestamp is within acceptable skew
106
- */
107
- abstract isWithinSkew(timestamp: number, skewSeconds: number): boolean;
108
- /**
109
- * Check if something has expired
110
- */
111
- abstract hasExpired(expiresAt: number): boolean;
112
- /**
113
- * Calculate expiration timestamp
114
- */
115
- abstract calculateExpiry(ttlSeconds: number): number;
116
- }
117
- /**
118
- * Fetch provider for network operations
119
- */
120
- export declare abstract class FetchProvider {
121
- /**
122
- * Resolve a DID document
123
- */
124
- abstract resolveDID(did: string): Promise<any>;
125
- /**
126
- * Fetch status list for credentials
127
- */
128
- abstract fetchStatusList(url: string): Promise<any>;
129
- /**
130
- * Fetch delegation chain
131
- */
132
- abstract fetchDelegationChain(id: string): Promise<any[]>;
133
- /**
134
- * Get edge verification data (compact blob for offline verification)
135
- */
136
- abstract getEdgeVerificationData(id: string): Promise<any>;
137
- /**
138
- * Generic HTTP fetch
139
- */
140
- abstract fetch(url: string, options?: any): Promise<Response>;
141
- }
142
- //# sourceMappingURL=providers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/types/providers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,8BAAsB,cAAc;IAClC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAExE;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAE7F;;OAEG;IACH,QAAQ,CAAC,eAAe,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAE9E;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CACrD;AAED;;GAEG;AACH,8BAAsB,gBAAgB;IACpC;;OAEG;IACH,QAAQ,CAAC,YAAY,IAAI,OAAO,CAAC,aAAa,GAAG,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;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAEtE;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAE/C;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CACrD;AAED;;GAEG;AACH,8BAAsB,aAAa;IACjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzD;;OAEG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAE1D;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;CAC9D"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- /**
3
- * Provider interfaces for platform-specific implementations
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FetchProvider = exports.ClockProvider = exports.NonceCacheProvider = exports.StorageProvider = exports.IdentityProvider = exports.CryptoProvider = void 0;
7
- /**
8
- * Abstract crypto provider for platform-specific crypto operations
9
- */
10
- class CryptoProvider {
11
- }
12
- exports.CryptoProvider = CryptoProvider;
13
- /**
14
- * Abstract identity provider for platform-specific identity storage
15
- */
16
- class IdentityProvider {
17
- }
18
- exports.IdentityProvider = IdentityProvider;
19
- /**
20
- * Abstract storage provider for general key-value storage
21
- */
22
- class StorageProvider {
23
- }
24
- exports.StorageProvider = StorageProvider;
25
- /**
26
- * Nonce cache provider for replay attack prevention
27
- */
28
- class NonceCacheProvider {
29
- }
30
- exports.NonceCacheProvider = NonceCacheProvider;
31
- /**
32
- * Clock provider for time-based operations
33
- */
34
- class ClockProvider {
35
- }
36
- exports.ClockProvider = ClockProvider;
37
- /**
38
- * Fetch provider for network operations
39
- */
40
- class FetchProvider {
41
- }
42
- exports.FetchProvider = FetchProvider;
43
- //# sourceMappingURL=providers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/types/providers.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH;;GAEG;AACH,MAAsB,cAAc;CAoBnC;AApBD,wCAoBC;AAED;;GAEG;AACH,MAAsB,gBAAgB;CAoBrC;AApBD,4CAoBC;AAED;;GAEG;AACH,MAAsB,eAAe;CAoBpC;AApBD,0CAoBC;AAED;;GAEG;AACH,MAAsB,kBAAkB;CAyBvC;AAzBD,gDAyBC;AAED;;GAEG;AACH,MAAsB,aAAa;CAoBlC;AApBD,sCAoBC;AAED;;GAEG;AACH,MAAsB,aAAa;CAyBlC;AAzBD,sCAyBC"}