@gvnrdao/dh-lit-actions 0.0.2 → 0.0.4
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/package.json +4 -4
- package/pkg-dist/constants/chunks/lit-actions-registry.d.ts +0 -12
- package/pkg-dist/constants/chunks/lit-actions-registry.d.ts.map +1 -1
- package/pkg-dist/constants/chunks/lit-actions-registry.js +17 -98
- package/pkg-dist/constants/chunks/lit-actions-registry.js.map +1 -1
- package/pkg-dist/constants/chunks/package-registry.d.ts.map +1 -1
- package/pkg-dist/constants/chunks/package-registry.js +4 -2
- package/pkg-dist/constants/chunks/package-registry.js.map +1 -1
- package/pkg-dist/index.d.ts +1 -1
- package/pkg-dist/index.d.ts.map +1 -1
- package/pkg-dist/index.js +3 -2
- package/pkg-dist/index.js.map +1 -1
- package/pkg-dist/interfaces/chunks/lit-action-registry.i.d.ts +2 -0
- package/pkg-dist/interfaces/chunks/lit-action-registry.i.d.ts.map +1 -1
- package/pkg-dist/utils/chunks/connection-helpers.d.ts +99 -0
- package/pkg-dist/utils/chunks/connection-helpers.d.ts.map +1 -0
- package/pkg-dist/utils/chunks/connection-helpers.js +362 -0
- package/pkg-dist/utils/chunks/connection-helpers.js.map +1 -0
- package/pkg-dist/utils/chunks/debug-logger.d.ts +93 -0
- package/pkg-dist/utils/chunks/debug-logger.d.ts.map +1 -0
- package/pkg-dist/utils/chunks/debug-logger.js +264 -0
- package/pkg-dist/utils/chunks/debug-logger.js.map +1 -0
- package/pkg-dist/utils/chunks/error-classification.d.ts +97 -0
- package/pkg-dist/utils/chunks/error-classification.d.ts.map +1 -0
- package/pkg-dist/utils/chunks/error-classification.js +385 -0
- package/pkg-dist/utils/chunks/error-classification.js.map +1 -0
- package/pkg-dist/utils/chunks/lit-action-helpers.d.ts +5 -5
- package/pkg-dist/utils/chunks/lit-action-helpers.d.ts.map +1 -1
- package/pkg-dist/utils/chunks/lit-action-helpers.js +17 -12
- package/pkg-dist/utils/chunks/lit-action-helpers.js.map +1 -1
- package/pkg-dist/utils/chunks/pkp-setup.d.ts +1 -1
- package/pkg-dist/utils/chunks/pkp-setup.d.ts.map +1 -1
- package/pkg-dist/utils/chunks/pkp-setup.js +8 -4
- package/pkg-dist/utils/chunks/pkp-setup.js.map +1 -1
- package/pkg-dist/utils/chunks/session-signature-cache.d.ts +84 -0
- package/pkg-dist/utils/chunks/session-signature-cache.d.ts.map +1 -0
- package/pkg-dist/utils/chunks/session-signature-cache.js +194 -0
- package/pkg-dist/utils/chunks/session-signature-cache.js.map +1 -0
- package/pkg-dist/utils/index.d.ts +4 -0
- package/pkg-dist/utils/index.d.ts.map +1 -1
- package/pkg-dist/utils/index.js +4 -0
- package/pkg-dist/utils/index.js.map +1 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Enhanced Error Classification for LIT Protocol Operations
|
|
4
|
+
* Provides detailed error categorization and specific retry strategies
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.litProtocolErrors = exports.RetryStrategy = exports.ErrorCategory = void 0;
|
|
8
|
+
exports.classifyError = classifyError;
|
|
9
|
+
exports.getRetryConfigFromClassification = getRetryConfigFromClassification;
|
|
10
|
+
exports.analyzeError = analyzeError;
|
|
11
|
+
exports.createErrorReport = createErrorReport;
|
|
12
|
+
/**
|
|
13
|
+
* Error categories for different types of failures
|
|
14
|
+
*/
|
|
15
|
+
var ErrorCategory;
|
|
16
|
+
(function (ErrorCategory) {
|
|
17
|
+
ErrorCategory["NETWORK"] = "network";
|
|
18
|
+
ErrorCategory["PROTOCOL"] = "protocol";
|
|
19
|
+
ErrorCategory["AUTHENTICATION"] = "authentication";
|
|
20
|
+
ErrorCategory["RESOURCE"] = "resource";
|
|
21
|
+
ErrorCategory["VALIDATION"] = "validation";
|
|
22
|
+
ErrorCategory["TIMEOUT"] = "timeout";
|
|
23
|
+
ErrorCategory["RATE_LIMIT"] = "rate_limit";
|
|
24
|
+
ErrorCategory["CONFIGURATION"] = "configuration";
|
|
25
|
+
ErrorCategory["UNKNOWN"] = "unknown";
|
|
26
|
+
})(ErrorCategory || (exports.ErrorCategory = ErrorCategory = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Retry strategy types
|
|
29
|
+
*/
|
|
30
|
+
var RetryStrategy;
|
|
31
|
+
(function (RetryStrategy) {
|
|
32
|
+
RetryStrategy["AGGRESSIVE"] = "aggressive";
|
|
33
|
+
RetryStrategy["CONSERVATIVE"] = "conservative";
|
|
34
|
+
RetryStrategy["EXPONENTIAL"] = "exponential";
|
|
35
|
+
RetryStrategy["LINEAR"] = "linear";
|
|
36
|
+
RetryStrategy["NONE"] = "none"; // No retries
|
|
37
|
+
})(RetryStrategy || (exports.RetryStrategy = RetryStrategy = {}));
|
|
38
|
+
/**
|
|
39
|
+
* LIT Protocol specific error patterns
|
|
40
|
+
*/
|
|
41
|
+
const LIT_ERROR_PATTERNS = {
|
|
42
|
+
// Network and connection errors
|
|
43
|
+
network: [
|
|
44
|
+
/network error/i,
|
|
45
|
+
/connection failed/i,
|
|
46
|
+
/connection refused/i,
|
|
47
|
+
/connection timeout/i,
|
|
48
|
+
/socket hang up/i,
|
|
49
|
+
/enotfound/i,
|
|
50
|
+
/econnrefused/i,
|
|
51
|
+
/etimedout/i,
|
|
52
|
+
/dns resolution failed/i,
|
|
53
|
+
/request failed/i
|
|
54
|
+
],
|
|
55
|
+
// Protocol specific errors
|
|
56
|
+
protocol: [
|
|
57
|
+
/lit protocol/i,
|
|
58
|
+
/lit node/i,
|
|
59
|
+
/signing shares/i,
|
|
60
|
+
/node communication/i,
|
|
61
|
+
/consensus/i,
|
|
62
|
+
/threshold/i,
|
|
63
|
+
/decryption/i,
|
|
64
|
+
/signature verification/i,
|
|
65
|
+
/There was an error getting the signing shares/i,
|
|
66
|
+
/Response from the nodes/i,
|
|
67
|
+
/NodeError/i,
|
|
68
|
+
/PKP validation/i,
|
|
69
|
+
/pkp validation failed/i
|
|
70
|
+
],
|
|
71
|
+
// Authentication and authorization errors
|
|
72
|
+
authentication: [
|
|
73
|
+
/authentication/i,
|
|
74
|
+
/authorization/i,
|
|
75
|
+
/session.*expired/i,
|
|
76
|
+
/invalid.*signature/i,
|
|
77
|
+
/unauthorized/i,
|
|
78
|
+
/access.*denied/i,
|
|
79
|
+
/permission/i,
|
|
80
|
+
/auth.*failed/i,
|
|
81
|
+
/siwe/i,
|
|
82
|
+
/session.*sig/i
|
|
83
|
+
],
|
|
84
|
+
// Resource and validation errors
|
|
85
|
+
resource: [
|
|
86
|
+
/resource.*not.*found/i,
|
|
87
|
+
/ipfs.*not.*found/i,
|
|
88
|
+
/cid.*invalid/i,
|
|
89
|
+
/pkp.*not.*found/i,
|
|
90
|
+
/pkp.*validation/i,
|
|
91
|
+
/resource.*validation/i,
|
|
92
|
+
/action.*not.*permitted/i,
|
|
93
|
+
/lit.*action.*not.*found/i
|
|
94
|
+
],
|
|
95
|
+
// Validation errors
|
|
96
|
+
validation: [
|
|
97
|
+
/validation.*failed/i,
|
|
98
|
+
/invalid.*input/i,
|
|
99
|
+
/invalid.*parameter/i,
|
|
100
|
+
/malformed/i,
|
|
101
|
+
/schema.*validation/i,
|
|
102
|
+
/type.*error/i,
|
|
103
|
+
/missing.*required/i
|
|
104
|
+
],
|
|
105
|
+
// Timeout specific errors
|
|
106
|
+
timeout: [
|
|
107
|
+
/timeout/i,
|
|
108
|
+
/request.*timed.*out/i,
|
|
109
|
+
/operation.*timed.*out/i,
|
|
110
|
+
/deadline.*exceeded/i,
|
|
111
|
+
/time.*limit.*exceeded/i
|
|
112
|
+
],
|
|
113
|
+
// Rate limiting errors
|
|
114
|
+
rateLimit: [
|
|
115
|
+
/rate.*limit/i,
|
|
116
|
+
/too.*many.*requests/i,
|
|
117
|
+
/quota.*exceeded/i,
|
|
118
|
+
/throttled/i,
|
|
119
|
+
/429/,
|
|
120
|
+
/rate.*exceeded/i
|
|
121
|
+
],
|
|
122
|
+
// Configuration errors
|
|
123
|
+
configuration: [
|
|
124
|
+
/configuration/i,
|
|
125
|
+
/config.*error/i,
|
|
126
|
+
/environment/i,
|
|
127
|
+
/missing.*env/i,
|
|
128
|
+
/invalid.*config/i,
|
|
129
|
+
/setup.*error/i
|
|
130
|
+
]
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Predefined retry strategies
|
|
134
|
+
*/
|
|
135
|
+
const RETRY_STRATEGIES = {
|
|
136
|
+
[RetryStrategy.AGGRESSIVE]: {
|
|
137
|
+
maxAttempts: 5,
|
|
138
|
+
baseDelayMs: 500,
|
|
139
|
+
maxDelayMs: 5000,
|
|
140
|
+
multiplier: 1.5
|
|
141
|
+
},
|
|
142
|
+
[RetryStrategy.CONSERVATIVE]: {
|
|
143
|
+
maxAttempts: 3,
|
|
144
|
+
baseDelayMs: 3000,
|
|
145
|
+
maxDelayMs: 30000,
|
|
146
|
+
multiplier: 2.5
|
|
147
|
+
},
|
|
148
|
+
[RetryStrategy.EXPONENTIAL]: {
|
|
149
|
+
maxAttempts: 4,
|
|
150
|
+
baseDelayMs: 1000,
|
|
151
|
+
maxDelayMs: 15000,
|
|
152
|
+
multiplier: 2.0
|
|
153
|
+
},
|
|
154
|
+
[RetryStrategy.LINEAR]: {
|
|
155
|
+
maxAttempts: 3,
|
|
156
|
+
baseDelayMs: 2000,
|
|
157
|
+
maxDelayMs: 10000,
|
|
158
|
+
multiplier: 1.0
|
|
159
|
+
},
|
|
160
|
+
[RetryStrategy.NONE]: {
|
|
161
|
+
maxAttempts: 1,
|
|
162
|
+
baseDelayMs: 0,
|
|
163
|
+
maxDelayMs: 0,
|
|
164
|
+
multiplier: 1.0
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Error classification rules
|
|
169
|
+
*/
|
|
170
|
+
const CLASSIFICATION_RULES = {
|
|
171
|
+
[ErrorCategory.NETWORK]: {
|
|
172
|
+
category: ErrorCategory.NETWORK,
|
|
173
|
+
retryStrategy: RetryStrategy.AGGRESSIVE,
|
|
174
|
+
isRetryable: true,
|
|
175
|
+
...RETRY_STRATEGIES[RetryStrategy.AGGRESSIVE],
|
|
176
|
+
description: 'Network connectivity or communication error',
|
|
177
|
+
troubleshooting: [
|
|
178
|
+
'Check internet connection',
|
|
179
|
+
'Verify LIT Protocol network status',
|
|
180
|
+
'Check firewall and proxy settings',
|
|
181
|
+
'Try connecting to different node endpoints'
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
[ErrorCategory.PROTOCOL]: {
|
|
185
|
+
category: ErrorCategory.PROTOCOL,
|
|
186
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
187
|
+
isRetryable: true,
|
|
188
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
189
|
+
description: 'LIT Protocol specific operational error',
|
|
190
|
+
troubleshooting: [
|
|
191
|
+
'Check LIT Protocol network status',
|
|
192
|
+
'Verify PKP configuration',
|
|
193
|
+
'Check signing shares availability',
|
|
194
|
+
'Wait for network consensus'
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
[ErrorCategory.AUTHENTICATION]: {
|
|
198
|
+
category: ErrorCategory.AUTHENTICATION,
|
|
199
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
200
|
+
isRetryable: true,
|
|
201
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
202
|
+
maxAttempts: 2, // Override: limited retries for auth issues
|
|
203
|
+
description: 'Authentication or authorization error',
|
|
204
|
+
troubleshooting: [
|
|
205
|
+
'Check session signatures validity',
|
|
206
|
+
'Regenerate authentication tokens',
|
|
207
|
+
'Verify wallet permissions',
|
|
208
|
+
'Check PKP authorization status'
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
[ErrorCategory.RESOURCE]: {
|
|
212
|
+
category: ErrorCategory.RESOURCE,
|
|
213
|
+
retryStrategy: RetryStrategy.LINEAR,
|
|
214
|
+
isRetryable: true,
|
|
215
|
+
...RETRY_STRATEGIES[RetryStrategy.LINEAR],
|
|
216
|
+
maxAttempts: 2, // Override: limited retries for resource issues
|
|
217
|
+
description: 'Resource not found or validation error',
|
|
218
|
+
troubleshooting: [
|
|
219
|
+
'Verify resource CIDs are correct',
|
|
220
|
+
'Check IPFS availability',
|
|
221
|
+
'Confirm PKP exists and is accessible',
|
|
222
|
+
'Wait for resource propagation'
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
[ErrorCategory.VALIDATION]: {
|
|
226
|
+
category: ErrorCategory.VALIDATION,
|
|
227
|
+
retryStrategy: RetryStrategy.NONE,
|
|
228
|
+
isRetryable: false,
|
|
229
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
230
|
+
description: 'Input validation or schema error',
|
|
231
|
+
troubleshooting: [
|
|
232
|
+
'Check input parameters format',
|
|
233
|
+
'Verify required fields are provided',
|
|
234
|
+
'Validate data types and ranges',
|
|
235
|
+
'Review API documentation'
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
[ErrorCategory.TIMEOUT]: {
|
|
239
|
+
category: ErrorCategory.TIMEOUT,
|
|
240
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
241
|
+
isRetryable: true,
|
|
242
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
243
|
+
description: 'Operation timeout error',
|
|
244
|
+
troubleshooting: [
|
|
245
|
+
'Increase timeout values',
|
|
246
|
+
'Check network latency',
|
|
247
|
+
'Verify system resources',
|
|
248
|
+
'Split operations into smaller chunks'
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
[ErrorCategory.RATE_LIMIT]: {
|
|
252
|
+
category: ErrorCategory.RATE_LIMIT,
|
|
253
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
254
|
+
isRetryable: true,
|
|
255
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
256
|
+
maxAttempts: 2, // Override: limited retries to avoid further rate limiting
|
|
257
|
+
baseDelayMs: 5000, // Override: longer delays for rate limits
|
|
258
|
+
description: 'Rate limit or quota exceeded',
|
|
259
|
+
troubleshooting: [
|
|
260
|
+
'Reduce request frequency',
|
|
261
|
+
'Implement request batching',
|
|
262
|
+
'Check rate limit headers',
|
|
263
|
+
'Wait for quota reset'
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
[ErrorCategory.CONFIGURATION]: {
|
|
267
|
+
category: ErrorCategory.CONFIGURATION,
|
|
268
|
+
retryStrategy: RetryStrategy.NONE,
|
|
269
|
+
isRetryable: false,
|
|
270
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
271
|
+
description: 'Configuration or setup error',
|
|
272
|
+
troubleshooting: [
|
|
273
|
+
'Check environment variables',
|
|
274
|
+
'Verify configuration files',
|
|
275
|
+
'Review setup documentation',
|
|
276
|
+
'Check required dependencies'
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
[ErrorCategory.UNKNOWN]: {
|
|
280
|
+
category: ErrorCategory.UNKNOWN,
|
|
281
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
282
|
+
isRetryable: true,
|
|
283
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
284
|
+
maxAttempts: 2, // Override: conservative retries for unknown errors
|
|
285
|
+
description: 'Unknown or unclassified error',
|
|
286
|
+
troubleshooting: [
|
|
287
|
+
'Check logs for more details',
|
|
288
|
+
'Verify system status',
|
|
289
|
+
'Try again with debug logging',
|
|
290
|
+
'Contact support if persists'
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Classify an error and determine retry strategy
|
|
296
|
+
*/
|
|
297
|
+
function classifyError(error) {
|
|
298
|
+
const errorMessage = error?.message || error?.toString() || '';
|
|
299
|
+
const errorLower = errorMessage.toLowerCase();
|
|
300
|
+
// Check each error category
|
|
301
|
+
for (const [category, patterns] of Object.entries(LIT_ERROR_PATTERNS)) {
|
|
302
|
+
for (const pattern of patterns) {
|
|
303
|
+
if (pattern.test(errorMessage) || pattern.test(errorLower)) {
|
|
304
|
+
const classification = CLASSIFICATION_RULES[category];
|
|
305
|
+
return {
|
|
306
|
+
...classification,
|
|
307
|
+
description: `${classification.description}: ${errorMessage.slice(0, 100)}`
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// Default to unknown category
|
|
313
|
+
const unknownClassification = CLASSIFICATION_RULES[ErrorCategory.UNKNOWN];
|
|
314
|
+
return {
|
|
315
|
+
...unknownClassification,
|
|
316
|
+
description: `${unknownClassification.description}: ${errorMessage.slice(0, 100)}`
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Get retry configuration from error classification
|
|
321
|
+
*/
|
|
322
|
+
function getRetryConfigFromClassification(classification) {
|
|
323
|
+
return {
|
|
324
|
+
maxAttempts: classification.maxAttempts,
|
|
325
|
+
initialDelayMs: classification.baseDelayMs,
|
|
326
|
+
maxDelayMs: classification.maxDelayMs,
|
|
327
|
+
backoffMultiplier: RETRY_STRATEGIES[classification.retryStrategy].multiplier,
|
|
328
|
+
retryableErrors: ['*'] // Classification already determined retryability
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Enhanced error analyzer for detailed error information
|
|
333
|
+
*/
|
|
334
|
+
function analyzeError(error) {
|
|
335
|
+
const classification = classifyError(error);
|
|
336
|
+
return {
|
|
337
|
+
...classification,
|
|
338
|
+
originalError: error,
|
|
339
|
+
errorMessage: error?.message || error?.toString() || 'Unknown error',
|
|
340
|
+
errorStack: error?.stack,
|
|
341
|
+
timestamp: new Date().toISOString(),
|
|
342
|
+
retryConfig: getRetryConfigFromClassification(classification)
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Create a human-readable error report
|
|
347
|
+
*/
|
|
348
|
+
function createErrorReport(error) {
|
|
349
|
+
const analysis = analyzeError(error);
|
|
350
|
+
const report = [
|
|
351
|
+
`🔍 Error Analysis Report`,
|
|
352
|
+
`=====================================`,
|
|
353
|
+
`Category: ${analysis.category.toUpperCase()}`,
|
|
354
|
+
`Retryable: ${analysis.isRetryable ? '✅ Yes' : '❌ No'}`,
|
|
355
|
+
`Strategy: ${analysis.retryStrategy}`,
|
|
356
|
+
`Max Attempts: ${analysis.maxAttempts}`,
|
|
357
|
+
`Description: ${analysis.description}`,
|
|
358
|
+
`Timestamp: ${analysis.timestamp}`,
|
|
359
|
+
``,
|
|
360
|
+
`Original Error: ${analysis.errorMessage}`,
|
|
361
|
+
``
|
|
362
|
+
];
|
|
363
|
+
if (analysis.troubleshooting && analysis.troubleshooting.length > 0) {
|
|
364
|
+
report.push(`🛠️ Troubleshooting Steps:`);
|
|
365
|
+
analysis.troubleshooting.forEach((step, index) => {
|
|
366
|
+
report.push(` ${index + 1}. ${step}`);
|
|
367
|
+
});
|
|
368
|
+
report.push('');
|
|
369
|
+
}
|
|
370
|
+
return report.join('\n');
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* LIT Protocol specific error matchers
|
|
374
|
+
*/
|
|
375
|
+
exports.litProtocolErrors = {
|
|
376
|
+
isNetworkError: (error) => classifyError(error).category === ErrorCategory.NETWORK,
|
|
377
|
+
isProtocolError: (error) => classifyError(error).category === ErrorCategory.PROTOCOL,
|
|
378
|
+
isAuthenticationError: (error) => classifyError(error).category === ErrorCategory.AUTHENTICATION,
|
|
379
|
+
isResourceError: (error) => classifyError(error).category === ErrorCategory.RESOURCE,
|
|
380
|
+
isTimeoutError: (error) => classifyError(error).category === ErrorCategory.TIMEOUT,
|
|
381
|
+
isRateLimitError: (error) => classifyError(error).category === ErrorCategory.RATE_LIMIT,
|
|
382
|
+
isConfigurationError: (error) => classifyError(error).category === ErrorCategory.CONFIGURATION,
|
|
383
|
+
isRetryable: (error) => classifyError(error).isRetryable
|
|
384
|
+
};
|
|
385
|
+
//# sourceMappingURL=error-classification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-classification.js","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/error-classification.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+TH,sCAuBC;AAKD,4EAQC;AAKD,oCAWC;AAKD,8CA0BC;AAhZD;;GAEG;AACH,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,kDAAiC,CAAA;IACjC,sCAAqB,CAAA;IACrB,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,gDAA+B,CAAA;IAC/B,oCAAmB,CAAA;AACrB,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB;AAED;;GAEG;AACH,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,0CAAyB,CAAA;IACzB,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;IAC3B,kCAAiB,CAAA;IACjB,8BAAa,CAAA,CAAmB,aAAa;AAC/C,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAgBD;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,gCAAgC;IAChC,OAAO,EAAE;QACP,gBAAgB;QAChB,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,iBAAiB;QACjB,YAAY;QACZ,eAAe;QACf,YAAY;QACZ,wBAAwB;QACxB,iBAAiB;KAClB;IAED,2BAA2B;IAC3B,QAAQ,EAAE;QACR,eAAe;QACf,WAAW;QACX,iBAAiB;QACjB,qBAAqB;QACrB,YAAY;QACZ,YAAY;QACZ,aAAa;QACb,yBAAyB;QACzB,gDAAgD;QAChD,0BAA0B;QAC1B,YAAY;QACZ,iBAAiB;QACjB,wBAAwB;KACzB;IAED,0CAA0C;IAC1C,cAAc,EAAE;QACd,iBAAiB;QACjB,gBAAgB;QAChB,mBAAmB;QAC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,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,cAAc;IACrG,eAAe,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,QAAQ;IACzF,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,OAAO;IACvF,gBAAgB,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,UAAU;IAC5F,oBAAoB,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,aAAa;IACnG,WAAW,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,WAAW;CAC9D,CAAC"}
|
|
@@ -5,28 +5,28 @@ import { LitActionConfig, LitActionName } from "../../interfaces";
|
|
|
5
5
|
* @returns IPFS CID of the deployed action
|
|
6
6
|
* @throws Error if action is not deployed
|
|
7
7
|
*/
|
|
8
|
-
export declare function getLitActionCID(actionName: LitActionName): string;
|
|
8
|
+
export declare function getLitActionCID(litNetwork: "datil" | "datil-test" | undefined, actionName: LitActionName): string;
|
|
9
9
|
/**
|
|
10
10
|
* Get LIT Action configuration by name
|
|
11
11
|
* @param actionName - Name of the LIT Action
|
|
12
12
|
* @returns Complete LIT Action configuration
|
|
13
13
|
*/
|
|
14
|
-
export declare function getLitActionConfig(actionName: LitActionName): LitActionConfig;
|
|
14
|
+
export declare function getLitActionConfig(actionName: LitActionName, litNetwork?: "datil" | "datil-test"): LitActionConfig;
|
|
15
15
|
/**
|
|
16
16
|
* Check if a LIT Action is deployed and ready to use
|
|
17
17
|
* @param actionName - Name of the LIT Action
|
|
18
18
|
* @returns True if deployed, false otherwise
|
|
19
19
|
*/
|
|
20
|
-
export declare function isLitActionDeployed(actionName: LitActionName): boolean;
|
|
20
|
+
export declare function isLitActionDeployed(actionName: LitActionName, litNetwork?: "datil" | "datil-test"): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Validate that all required actions are deployed
|
|
23
23
|
* @param requiredActions - Array of required action names
|
|
24
24
|
* @returns True if all actions are deployed
|
|
25
25
|
*/
|
|
26
|
-
export declare function validateDeployedActions(requiredActions: LitActionName[]): boolean;
|
|
26
|
+
export declare function validateDeployedActions(requiredActions: LitActionName[], litNetwork?: "datil" | "datil-test"): boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Get all deployed LIT Actions
|
|
29
29
|
* @returns Array of deployed LIT Action configurations
|
|
30
30
|
*/
|
|
31
|
-
export declare function getDeployedActions(): LitActionConfig[];
|
|
31
|
+
export declare function getDeployedActions(litNetwork?: "datil" | "datil-test"): LitActionConfig[];
|
|
32
32
|
//# sourceMappingURL=lit-action-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-action-helpers.d.ts","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/lit-action-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"lit-action-helpers.d.ts","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/lit-action-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMlE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,GAAG,YAAY,YAAU,EAC5C,UAAU,EAAE,aAAa,GACxB,MAAM,CAWR;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,aAAa,EACzB,UAAU,GAAE,OAAO,GAAG,YAAsB,GAC3C,eAAe,CAUjB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,aAAa,EACzB,UAAU,GAAE,OAAO,GAAG,YAAsB,GAC3C,OAAO,CAKT;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,aAAa,EAAE,EAChC,UAAU,GAAE,OAAO,GAAG,YAAsB,GAC3C,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,GAAE,OAAO,GAAG,YAAsB,GAC3C,eAAe,EAAE,CAInB"}
|
|
@@ -12,8 +12,10 @@ const constants_1 = require("../../constants");
|
|
|
12
12
|
* @returns IPFS CID of the deployed action
|
|
13
13
|
* @throws Error if action is not deployed
|
|
14
14
|
*/
|
|
15
|
-
function getLitActionCID(actionName) {
|
|
16
|
-
const action =
|
|
15
|
+
function getLitActionCID(litNetwork = "datil", actionName) {
|
|
16
|
+
const action = litNetwork === "datil"
|
|
17
|
+
? constants_1.DH_LIT_ACTIONS_DATIL[actionName]
|
|
18
|
+
: constants_1.DH_LIT_ACTIONS_DATIL_TEST[actionName];
|
|
17
19
|
if (!action.deployed || !action.cid) {
|
|
18
20
|
throw new Error(`LIT Action '${actionName}' not deployed. Check deployment status.`);
|
|
19
21
|
}
|
|
@@ -24,10 +26,11 @@ function getLitActionCID(actionName) {
|
|
|
24
26
|
* @param actionName - Name of the LIT Action
|
|
25
27
|
* @returns Complete LIT Action configuration
|
|
26
28
|
*/
|
|
27
|
-
function getLitActionConfig(actionName) {
|
|
28
|
-
const
|
|
29
|
+
function getLitActionConfig(actionName, litNetwork = "datil") {
|
|
30
|
+
const registry = litNetwork === "datil" ? constants_1.DH_LIT_ACTIONS_DATIL : constants_1.DH_LIT_ACTIONS_DATIL_TEST;
|
|
31
|
+
const action = registry[actionName];
|
|
29
32
|
if (!action) {
|
|
30
|
-
throw new Error(`LIT Action '${actionName}' not found in registry.`);
|
|
33
|
+
throw new Error(`LIT Action '${actionName}' not found in registry for network '${litNetwork}'.`);
|
|
31
34
|
}
|
|
32
35
|
return action;
|
|
33
36
|
}
|
|
@@ -36,23 +39,25 @@ function getLitActionConfig(actionName) {
|
|
|
36
39
|
* @param actionName - Name of the LIT Action
|
|
37
40
|
* @returns True if deployed, false otherwise
|
|
38
41
|
*/
|
|
39
|
-
function isLitActionDeployed(actionName) {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
+
function isLitActionDeployed(actionName, litNetwork = "datil") {
|
|
43
|
+
const registry = litNetwork === "datil" ? constants_1.DH_LIT_ACTIONS_DATIL : constants_1.DH_LIT_ACTIONS_DATIL_TEST;
|
|
44
|
+
const action = registry[actionName];
|
|
45
|
+
return !!(action && action.deployed && action.cid);
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* Validate that all required actions are deployed
|
|
45
49
|
* @param requiredActions - Array of required action names
|
|
46
50
|
* @returns True if all actions are deployed
|
|
47
51
|
*/
|
|
48
|
-
function validateDeployedActions(requiredActions) {
|
|
49
|
-
return requiredActions.every((actionName) => isLitActionDeployed(actionName));
|
|
52
|
+
function validateDeployedActions(requiredActions, litNetwork = "datil") {
|
|
53
|
+
return requiredActions.every((actionName) => isLitActionDeployed(actionName, litNetwork));
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* Get all deployed LIT Actions
|
|
53
57
|
* @returns Array of deployed LIT Action configurations
|
|
54
58
|
*/
|
|
55
|
-
function getDeployedActions() {
|
|
56
|
-
|
|
59
|
+
function getDeployedActions(litNetwork = "datil") {
|
|
60
|
+
const registry = litNetwork === "datil" ? constants_1.DH_LIT_ACTIONS_DATIL : constants_1.DH_LIT_ACTIONS_DATIL_TEST;
|
|
61
|
+
return Object.values(registry).filter((action) => action.deployed);
|
|
57
62
|
}
|
|
58
63
|
//# sourceMappingURL=lit-action-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-action-helpers.js","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/lit-action-helpers.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"lit-action-helpers.js","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/lit-action-helpers.ts"],"names":[],"mappings":";;AAYA,0CAcC;AAOD,gDAaC;AAOD,kDAQC;AAOD,0DAOC;AAMD,gDAMC;AAtFD,+CAGyB;AAEzB;;;;;GAKG;AACH,SAAgB,eAAe,CAC7B,aAAqC,OAAO,EAC5C,UAAyB;IAEzB,MAAM,MAAM,GACV,UAAU,KAAK,OAAO;QACpB,CAAC,CAAC,gCAAoB,CAAC,UAAU,CAAC;QAClC,CAAC,CAAC,qCAAyB,CAAC,UAAU,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,eAAe,UAAU,0CAA0C,CACpE,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAChC,UAAyB,EACzB,aAAqC,OAAO;IAE5C,MAAM,QAAQ,GACZ,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,gCAAoB,CAAC,CAAC,CAAC,qCAAyB,CAAC;IAC5E,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,eAAe,UAAU,wCAAwC,UAAU,IAAI,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,UAAyB,EACzB,aAAqC,OAAO;IAE5C,MAAM,QAAQ,GACZ,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,gCAAoB,CAAC,CAAC,CAAC,qCAAyB,CAAC;IAC5E,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IACpC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB,CACrC,eAAgC,EAChC,aAAqC,OAAO;IAE5C,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE,CAC1C,mBAAmB,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5C,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,aAAqC,OAAO;IAE5C,MAAM,QAAQ,GACZ,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,gCAAoB,CAAC,CAAC,CAAC,qCAAyB,CAAC;IAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Get the complete setup for PKP Validator testing
|
|
3
3
|
* Returns both the LIT Action config and its associated PKP
|
|
4
4
|
*/
|
|
5
|
-
export declare function getPKPValidatorSetup(): {
|
|
5
|
+
export declare function getPKPValidatorSetup(litNetwork?: "datil" | "datil-test"): {
|
|
6
6
|
litAction: import("../..").LitActionConfig;
|
|
7
7
|
pkp: import("../..").PKPInfo;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkp-setup.d.ts","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/pkp-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pkp-setup.d.ts","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/pkp-setup.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,GAAE,OAAO,GAAG,YAAsB;;;EAY7C"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPKPValidatorSetup = getPKPValidatorSetup;
|
|
4
|
-
const
|
|
4
|
+
const lit_actions_registry_1 = require("../../constants/chunks/lit-actions-registry");
|
|
5
5
|
/**
|
|
6
6
|
* Get the complete setup for PKP Validator testing
|
|
7
7
|
* Returns both the LIT Action config and its associated PKP
|
|
8
8
|
*/
|
|
9
|
-
function getPKPValidatorSetup() {
|
|
9
|
+
function getPKPValidatorSetup(litNetwork = "datil") {
|
|
10
10
|
return {
|
|
11
|
-
litAction:
|
|
12
|
-
|
|
11
|
+
litAction: litNetwork === "datil"
|
|
12
|
+
? lit_actions_registry_1.DH_LIT_ACTIONS_DATIL.pkpValidator
|
|
13
|
+
: lit_actions_registry_1.DH_LIT_ACTIONS_DATIL_TEST.pkpValidator,
|
|
14
|
+
pkp: litNetwork === "datil"
|
|
15
|
+
? lit_actions_registry_1.DH_LIT_ACTIONS_DATIL.pkpValidator.pkp
|
|
16
|
+
: lit_actions_registry_1.DH_LIT_ACTIONS_DATIL_TEST.pkpValidator.pkp,
|
|
13
17
|
};
|
|
14
18
|
}
|
|
15
19
|
//# sourceMappingURL=pkp-setup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkp-setup.js","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/pkp-setup.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"pkp-setup.js","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/pkp-setup.ts"],"names":[],"mappings":";;AAQA,oDAaC;AArBD,sFAGqD;AACrD;;;GAGG;AACH,SAAgB,oBAAoB,CAClC,aAAqC,OAAO;IAE5C,OAAO;QACL,SAAS,EACP,UAAU,KAAK,OAAO;YACpB,CAAC,CAAC,2CAAoB,CAAC,YAAY;YACnC,CAAC,CAAC,gDAAyB,CAAC,YAAY;QAC5C,GAAG,EACD,UAAU,KAAK,OAAO;YACpB,CAAC,CAAC,2CAAoB,CAAC,YAAY,CAAC,GAAI;YACxC,CAAC,CAAC,gDAAyB,CAAC,YAAY,CAAC,GAAI;KAClD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Signature Cache for PKP Operations
|
|
3
|
+
* Provides intelligent caching of session signatures to avoid regeneration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Session signature cache configuration
|
|
7
|
+
*/
|
|
8
|
+
export interface SessionSignatureCacheConfig {
|
|
9
|
+
maxEntries: number;
|
|
10
|
+
bufferTimeMs: number;
|
|
11
|
+
enableLogging: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_CACHE_CONFIG: SessionSignatureCacheConfig;
|
|
14
|
+
/**
|
|
15
|
+
* In-memory session signature cache
|
|
16
|
+
*/
|
|
17
|
+
declare class SessionSignatureCache {
|
|
18
|
+
private cache;
|
|
19
|
+
private config;
|
|
20
|
+
constructor(config?: Partial<SessionSignatureCacheConfig>);
|
|
21
|
+
/**
|
|
22
|
+
* Generate cache key from PKP and context
|
|
23
|
+
*/
|
|
24
|
+
private generateCacheKey;
|
|
25
|
+
/**
|
|
26
|
+
* Check if cache entry is still valid
|
|
27
|
+
*/
|
|
28
|
+
private isEntryValid;
|
|
29
|
+
/**
|
|
30
|
+
* Clean expired entries from cache
|
|
31
|
+
*/
|
|
32
|
+
private cleanExpiredEntries;
|
|
33
|
+
/**
|
|
34
|
+
* Enforce cache size limits
|
|
35
|
+
*/
|
|
36
|
+
private enforceCacheSize;
|
|
37
|
+
/**
|
|
38
|
+
* Get cached session signatures if valid
|
|
39
|
+
*/
|
|
40
|
+
get(pkpTokenId: string, litActionCid: string, signerAddress: string, network: string): any | null;
|
|
41
|
+
/**
|
|
42
|
+
* Cache session signatures
|
|
43
|
+
*/
|
|
44
|
+
set(pkpTokenId: string, litActionCid: string, signerAddress: string, network: string, sessionSigs: any, expiration: Date): void;
|
|
45
|
+
/**
|
|
46
|
+
* Clear all cached session signatures
|
|
47
|
+
*/
|
|
48
|
+
clear(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get cache statistics
|
|
51
|
+
*/
|
|
52
|
+
getStats(): {
|
|
53
|
+
size: number;
|
|
54
|
+
maxEntries: number;
|
|
55
|
+
utilizationPercent: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Remove specific cache entry
|
|
59
|
+
*/
|
|
60
|
+
delete(pkpTokenId: string, litActionCid: string, signerAddress: string, network: string): boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare const sessionSignatureCache: SessionSignatureCache;
|
|
63
|
+
/**
|
|
64
|
+
* Enhanced session signature generator with caching
|
|
65
|
+
*/
|
|
66
|
+
export declare function generateSessionSignaturesWithCache(litNodeClient: any, sessionConfig: any, pkpTokenId: string, litActionCid: string, signerAddress: string, network?: string): Promise<any>;
|
|
67
|
+
/**
|
|
68
|
+
* Configure the global session signature cache
|
|
69
|
+
*/
|
|
70
|
+
export declare function configureSessionSignatureCache(config: Partial<SessionSignatureCacheConfig>): void;
|
|
71
|
+
/**
|
|
72
|
+
* Clear the global session signature cache
|
|
73
|
+
*/
|
|
74
|
+
export declare function clearSessionSignatureCache(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Get session signature cache statistics
|
|
77
|
+
*/
|
|
78
|
+
export declare function getSessionSignatureCacheStats(): {
|
|
79
|
+
size: number;
|
|
80
|
+
maxEntries: number;
|
|
81
|
+
utilizationPercent: number;
|
|
82
|
+
};
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=session-signature-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-signature-cache.d.ts","sourceRoot":"","sources":["../../../pkg-src/utils/chunks/session-signature-cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,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