@dupecom/botcha 0.9.0 → 0.10.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.
package/README.md
CHANGED
|
@@ -31,7 +31,10 @@ Use cases:
|
|
|
31
31
|
- 🔄 AI-to-AI marketplaces
|
|
32
32
|
- 🎫 Bot verification systems
|
|
33
33
|
- 🔐 Autonomous agent authentication
|
|
34
|
-
- 🏢 Multi-tenant app isolation
|
|
34
|
+
- 🏢 Multi-tenant app isolation with email-tied accounts
|
|
35
|
+
- 📊 Per-app metrics dashboard at [botcha.ai/dashboard](https://botcha.ai/dashboard)
|
|
36
|
+
- 📧 Email verification, account recovery, and secret rotation
|
|
37
|
+
- 🤖 Agent-first dashboard auth (challenge-based login + device code handoff)
|
|
35
38
|
|
|
36
39
|
## Install
|
|
37
40
|
|
|
@@ -176,15 +179,25 @@ BOTCHA supports **multi-tenant isolation** — create separate apps with unique
|
|
|
176
179
|
### Creating an App
|
|
177
180
|
|
|
178
181
|
```bash
|
|
179
|
-
# Create a new app
|
|
180
|
-
curl -X POST https://botcha.ai/v1/apps
|
|
182
|
+
# Create a new app (email required)
|
|
183
|
+
curl -X POST https://botcha.ai/v1/apps \
|
|
184
|
+
-H "Content-Type: application/json" \
|
|
185
|
+
-d '{"email": "agent@example.com"}'
|
|
181
186
|
|
|
182
187
|
# Returns (save the secret - it's only shown once!):
|
|
183
188
|
{
|
|
184
189
|
"app_id": "app_abc123",
|
|
185
190
|
"app_secret": "sk_xyz789",
|
|
186
|
-
"
|
|
191
|
+
"email": "agent@example.com",
|
|
192
|
+
"email_verified": false,
|
|
193
|
+
"verification_required": true,
|
|
194
|
+
"warning": "Save your app_secret now — it cannot be retrieved again! Check your email for a verification code."
|
|
187
195
|
}
|
|
196
|
+
|
|
197
|
+
# Verify your email with the 6-digit code:
|
|
198
|
+
curl -X POST https://botcha.ai/v1/apps/app_abc123/verify-email \
|
|
199
|
+
-H "Content-Type: application/json" \
|
|
200
|
+
-d '{"code": "123456"}'
|
|
188
201
|
```
|
|
189
202
|
|
|
190
203
|
### Using Your App ID
|
|
@@ -238,6 +251,40 @@ Each app gets its own rate limit bucket:
|
|
|
238
251
|
curl https://botcha.ai/v1/apps/app_abc123
|
|
239
252
|
```
|
|
240
253
|
|
|
254
|
+
## 📊 Per-App Metrics Dashboard
|
|
255
|
+
|
|
256
|
+
BOTCHA includes a built-in **metrics dashboard** at [`/dashboard`](https://botcha.ai/dashboard) showing per-app analytics with a terminal-inspired aesthetic.
|
|
257
|
+
|
|
258
|
+
### What You Get
|
|
259
|
+
|
|
260
|
+
- **Overview stats**: Challenges generated, verifications, success rate, avg solve time
|
|
261
|
+
- **Request volume**: Time-bucketed event charts
|
|
262
|
+
- **Challenge types**: Breakdown by speed/hybrid/reasoning/standard
|
|
263
|
+
- **Performance**: p50/p95 solve times, response latency
|
|
264
|
+
- **Errors & rate limits**: Failure tracking
|
|
265
|
+
- **Geographic distribution**: Top countries by request volume
|
|
266
|
+
|
|
267
|
+
### Access
|
|
268
|
+
|
|
269
|
+
Three ways to access — all require an AI agent:
|
|
270
|
+
|
|
271
|
+
1. **Agent Direct**: Your agent solves a speed challenge via `POST /v1/auth/dashboard` → gets a session token
|
|
272
|
+
2. **Device Code**: Agent solves challenge via `POST /v1/auth/device-code` → gets a `BOTCHA-XXXX` code → human enters it at `/dashboard/code`
|
|
273
|
+
3. **Legacy**: Login with `app_id` + `app_secret` at [botcha.ai/dashboard/login](https://botcha.ai/dashboard/login)
|
|
274
|
+
|
|
275
|
+
Session uses cookie-based auth (HttpOnly, Secure, SameSite=Lax, 1hr expiry).
|
|
276
|
+
|
|
277
|
+
### Email & Recovery
|
|
278
|
+
|
|
279
|
+
- Email is **required** at app creation (`POST /v1/apps` with `{"email": "..."}`)
|
|
280
|
+
- Verify email with a 6-digit code sent to your inbox
|
|
281
|
+
- Lost your secret? Use `POST /v1/auth/recover` to get a recovery device code emailed
|
|
282
|
+
- Rotate secrets via `POST /v1/apps/:id/rotate-secret` (auth required, sends notification)
|
|
283
|
+
|
|
284
|
+
### Period Filters
|
|
285
|
+
|
|
286
|
+
All metrics support `1h`, `24h`, `7d`, and `30d` time windows via htmx-powered buttons — no page reload required.
|
|
287
|
+
|
|
241
288
|
## 🔄 SSE Streaming Flow (AI-Native)
|
|
242
289
|
|
|
243
290
|
For AI agents that prefer a **conversational handshake**, BOTCHA offers **Server-Sent Events (SSE)** streaming:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SpeedProblem, BotchaClientOptions, ChallengeResponse, StandardChallengeResponse, VerifyResponse, TokenResponse, StreamSession, StreamEvent, Problem, VerifyResult, StreamChallengeOptions, } from './types.js';
|
|
2
|
-
import type { BotchaClientOptions, VerifyResponse } from './types.js';
|
|
1
|
+
export type { SpeedProblem, BotchaClientOptions, ChallengeResponse, StandardChallengeResponse, VerifyResponse, TokenResponse, StreamSession, StreamEvent, Problem, VerifyResult, StreamChallengeOptions, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse, } from './types.js';
|
|
2
|
+
import type { BotchaClientOptions, VerifyResponse, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse } from './types.js';
|
|
3
3
|
export { BotchaStreamClient } from './stream.js';
|
|
4
4
|
/**
|
|
5
5
|
* BOTCHA Client SDK for AI Agents
|
|
@@ -87,6 +87,73 @@ export declare class BotchaClient {
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
createHeaders(): Promise<Record<string, string>>;
|
|
90
|
+
/**
|
|
91
|
+
* Create a new BOTCHA app. Email is required.
|
|
92
|
+
*
|
|
93
|
+
* The returned `app_secret` is only shown once — save it securely.
|
|
94
|
+
* A 6-digit verification code will be sent to the provided email.
|
|
95
|
+
*
|
|
96
|
+
* @param email - Email address for the app owner
|
|
97
|
+
* @returns App creation response including app_id and app_secret
|
|
98
|
+
* @throws Error if app creation fails
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const app = await client.createApp('agent@example.com');
|
|
103
|
+
* console.log(app.app_id); // 'app_abc123'
|
|
104
|
+
* console.log(app.app_secret); // 'sk_...' (save this!)
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
createApp(email: string): Promise<CreateAppResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Verify the email address for an app using the 6-digit code sent via email.
|
|
110
|
+
*
|
|
111
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
112
|
+
* @param code - The 6-digit verification code from the email
|
|
113
|
+
* @returns Verification response
|
|
114
|
+
* @throws Error if verification fails
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const result = await client.verifyEmail('123456');
|
|
119
|
+
* console.log(result.email_verified); // true
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
verifyEmail(code: string, appId?: string): Promise<VerifyEmailResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Resend the email verification code.
|
|
125
|
+
*
|
|
126
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
127
|
+
* @returns Response with success status
|
|
128
|
+
* @throws Error if resend fails
|
|
129
|
+
*/
|
|
130
|
+
resendVerification(appId?: string): Promise<ResendVerificationResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Request account recovery via verified email.
|
|
133
|
+
* Sends a device code to the registered email address.
|
|
134
|
+
*
|
|
135
|
+
* Anti-enumeration: always returns the same response shape
|
|
136
|
+
* whether or not the email exists.
|
|
137
|
+
*
|
|
138
|
+
* @param email - The email address associated with the app
|
|
139
|
+
* @returns Recovery response (always success for anti-enumeration)
|
|
140
|
+
*/
|
|
141
|
+
recoverAccount(email: string): Promise<RecoverAccountResponse>;
|
|
142
|
+
/**
|
|
143
|
+
* Rotate the app secret. Requires an active dashboard session (Bearer token).
|
|
144
|
+
* The old secret is immediately invalidated.
|
|
145
|
+
*
|
|
146
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
147
|
+
* @returns New app_secret (save it — only shown once)
|
|
148
|
+
* @throws Error if rotation fails or auth is missing
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const result = await client.rotateSecret();
|
|
153
|
+
* console.log(result.app_secret); // 'sk_new_...' (save this!)
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
rotateSecret(appId?: string): Promise<RotateSecretResponse>;
|
|
90
157
|
}
|
|
91
158
|
/**
|
|
92
159
|
* Convenience function for one-off solves
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/client/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,OAAO,EACP,YAAY,EACZ,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/client/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,OAAO,EACP,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAEV,mBAAmB,EAGnB,cAAc,EAEd,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa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E,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAwB7E;;;;;;;;;OASG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAoBpE;;;;;;;;;;;;;OAaG;IACG,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA+BlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAIxD;AAED,eAAe,YAAY,CAAC"}
|
package/dist/lib/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
// SDK version - hardcoded since npm_package_version is unreliable when used as a library
|
|
3
|
-
const SDK_VERSION = '0.
|
|
3
|
+
const SDK_VERSION = '0.10.0';
|
|
4
4
|
// Export stream client
|
|
5
5
|
export { BotchaStreamClient } from './stream.js';
|
|
6
6
|
/**
|
|
@@ -335,6 +335,165 @@ export class BotchaClient {
|
|
|
335
335
|
}
|
|
336
336
|
return headers;
|
|
337
337
|
}
|
|
338
|
+
// ============ APP MANAGEMENT ============
|
|
339
|
+
/**
|
|
340
|
+
* Create a new BOTCHA app. Email is required.
|
|
341
|
+
*
|
|
342
|
+
* The returned `app_secret` is only shown once — save it securely.
|
|
343
|
+
* A 6-digit verification code will be sent to the provided email.
|
|
344
|
+
*
|
|
345
|
+
* @param email - Email address for the app owner
|
|
346
|
+
* @returns App creation response including app_id and app_secret
|
|
347
|
+
* @throws Error if app creation fails
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```typescript
|
|
351
|
+
* const app = await client.createApp('agent@example.com');
|
|
352
|
+
* console.log(app.app_id); // 'app_abc123'
|
|
353
|
+
* console.log(app.app_secret); // 'sk_...' (save this!)
|
|
354
|
+
* ```
|
|
355
|
+
*/
|
|
356
|
+
async createApp(email) {
|
|
357
|
+
const res = await fetch(`${this.baseUrl}/v1/apps`, {
|
|
358
|
+
method: 'POST',
|
|
359
|
+
headers: {
|
|
360
|
+
'Content-Type': 'application/json',
|
|
361
|
+
'User-Agent': this.agentIdentity,
|
|
362
|
+
},
|
|
363
|
+
body: JSON.stringify({ email }),
|
|
364
|
+
});
|
|
365
|
+
if (!res.ok) {
|
|
366
|
+
const body = await res.json().catch(() => ({}));
|
|
367
|
+
throw new Error(body.message || `App creation failed with status ${res.status}`);
|
|
368
|
+
}
|
|
369
|
+
const data = await res.json();
|
|
370
|
+
// Auto-set appId for subsequent requests
|
|
371
|
+
if (data.app_id) {
|
|
372
|
+
this.appId = data.app_id;
|
|
373
|
+
}
|
|
374
|
+
return data;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Verify the email address for an app using the 6-digit code sent via email.
|
|
378
|
+
*
|
|
379
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
380
|
+
* @param code - The 6-digit verification code from the email
|
|
381
|
+
* @returns Verification response
|
|
382
|
+
* @throws Error if verification fails
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* const result = await client.verifyEmail('123456');
|
|
387
|
+
* console.log(result.email_verified); // true
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
async verifyEmail(code, appId) {
|
|
391
|
+
const id = appId || this.appId;
|
|
392
|
+
if (!id) {
|
|
393
|
+
throw new Error('No app ID. Call createApp() first or pass appId.');
|
|
394
|
+
}
|
|
395
|
+
const res = await fetch(`${this.baseUrl}/v1/apps/${encodeURIComponent(id)}/verify-email`, {
|
|
396
|
+
method: 'POST',
|
|
397
|
+
headers: {
|
|
398
|
+
'Content-Type': 'application/json',
|
|
399
|
+
'User-Agent': this.agentIdentity,
|
|
400
|
+
},
|
|
401
|
+
body: JSON.stringify({ code }),
|
|
402
|
+
});
|
|
403
|
+
if (!res.ok) {
|
|
404
|
+
const body = await res.json().catch(() => ({}));
|
|
405
|
+
throw new Error(body.message || `Email verification failed with status ${res.status}`);
|
|
406
|
+
}
|
|
407
|
+
return await res.json();
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Resend the email verification code.
|
|
411
|
+
*
|
|
412
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
413
|
+
* @returns Response with success status
|
|
414
|
+
* @throws Error if resend fails
|
|
415
|
+
*/
|
|
416
|
+
async resendVerification(appId) {
|
|
417
|
+
const id = appId || this.appId;
|
|
418
|
+
if (!id) {
|
|
419
|
+
throw new Error('No app ID. Call createApp() first or pass appId.');
|
|
420
|
+
}
|
|
421
|
+
const res = await fetch(`${this.baseUrl}/v1/apps/${encodeURIComponent(id)}/resend-verification`, {
|
|
422
|
+
method: 'POST',
|
|
423
|
+
headers: {
|
|
424
|
+
'Content-Type': 'application/json',
|
|
425
|
+
'User-Agent': this.agentIdentity,
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
if (!res.ok) {
|
|
429
|
+
const body = await res.json().catch(() => ({}));
|
|
430
|
+
throw new Error(body.message || `Resend verification failed with status ${res.status}`);
|
|
431
|
+
}
|
|
432
|
+
return await res.json();
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Request account recovery via verified email.
|
|
436
|
+
* Sends a device code to the registered email address.
|
|
437
|
+
*
|
|
438
|
+
* Anti-enumeration: always returns the same response shape
|
|
439
|
+
* whether or not the email exists.
|
|
440
|
+
*
|
|
441
|
+
* @param email - The email address associated with the app
|
|
442
|
+
* @returns Recovery response (always success for anti-enumeration)
|
|
443
|
+
*/
|
|
444
|
+
async recoverAccount(email) {
|
|
445
|
+
const res = await fetch(`${this.baseUrl}/v1/auth/recover`, {
|
|
446
|
+
method: 'POST',
|
|
447
|
+
headers: {
|
|
448
|
+
'Content-Type': 'application/json',
|
|
449
|
+
'User-Agent': this.agentIdentity,
|
|
450
|
+
},
|
|
451
|
+
body: JSON.stringify({ email }),
|
|
452
|
+
});
|
|
453
|
+
if (!res.ok) {
|
|
454
|
+
const body = await res.json().catch(() => ({}));
|
|
455
|
+
throw new Error(body.message || `Account recovery failed with status ${res.status}`);
|
|
456
|
+
}
|
|
457
|
+
return await res.json();
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Rotate the app secret. Requires an active dashboard session (Bearer token).
|
|
461
|
+
* The old secret is immediately invalidated.
|
|
462
|
+
*
|
|
463
|
+
* @param appId - The app ID (defaults to the client's appId)
|
|
464
|
+
* @returns New app_secret (save it — only shown once)
|
|
465
|
+
* @throws Error if rotation fails or auth is missing
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```typescript
|
|
469
|
+
* const result = await client.rotateSecret();
|
|
470
|
+
* console.log(result.app_secret); // 'sk_new_...' (save this!)
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
async rotateSecret(appId) {
|
|
474
|
+
const id = appId || this.appId;
|
|
475
|
+
if (!id) {
|
|
476
|
+
throw new Error('No app ID. Call createApp() first or pass appId.');
|
|
477
|
+
}
|
|
478
|
+
// Rotate secret requires a dashboard session token
|
|
479
|
+
const headers = {
|
|
480
|
+
'Content-Type': 'application/json',
|
|
481
|
+
'User-Agent': this.agentIdentity,
|
|
482
|
+
};
|
|
483
|
+
// Use cached token if available (from dashboard auth)
|
|
484
|
+
if (this.cachedToken) {
|
|
485
|
+
headers['Authorization'] = `Bearer ${this.cachedToken}`;
|
|
486
|
+
}
|
|
487
|
+
const res = await fetch(`${this.baseUrl}/v1/apps/${encodeURIComponent(id)}/rotate-secret`, {
|
|
488
|
+
method: 'POST',
|
|
489
|
+
headers,
|
|
490
|
+
});
|
|
491
|
+
if (!res.ok) {
|
|
492
|
+
const body = await res.json().catch(() => ({}));
|
|
493
|
+
throw new Error(body.message || `Secret rotation failed with status ${res.status}`);
|
|
494
|
+
}
|
|
495
|
+
return await res.json();
|
|
496
|
+
}
|
|
338
497
|
}
|
|
339
498
|
/**
|
|
340
499
|
* Convenience function for one-off solves
|
|
@@ -94,4 +94,41 @@ export interface StreamChallengeOptions {
|
|
|
94
94
|
/** Timeout for the full verification flow in milliseconds (default: 30000) */
|
|
95
95
|
timeout?: number;
|
|
96
96
|
}
|
|
97
|
+
export interface CreateAppResponse {
|
|
98
|
+
success: boolean;
|
|
99
|
+
app_id: string;
|
|
100
|
+
app_secret: string;
|
|
101
|
+
email: string;
|
|
102
|
+
email_verified: boolean;
|
|
103
|
+
verification_required: boolean;
|
|
104
|
+
warning: string;
|
|
105
|
+
credential_advice: string;
|
|
106
|
+
created_at: string;
|
|
107
|
+
rate_limit: number;
|
|
108
|
+
next_step: string;
|
|
109
|
+
}
|
|
110
|
+
export interface VerifyEmailResponse {
|
|
111
|
+
success: boolean;
|
|
112
|
+
email_verified?: boolean;
|
|
113
|
+
error?: string;
|
|
114
|
+
message?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ResendVerificationResponse {
|
|
117
|
+
success: boolean;
|
|
118
|
+
message?: string;
|
|
119
|
+
error?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface RecoverAccountResponse {
|
|
122
|
+
success: boolean;
|
|
123
|
+
message: string;
|
|
124
|
+
}
|
|
125
|
+
export interface RotateSecretResponse {
|
|
126
|
+
success: boolean;
|
|
127
|
+
app_id?: string;
|
|
128
|
+
app_secret?: string;
|
|
129
|
+
warning?: string;
|
|
130
|
+
rotated_at?: string;
|
|
131
|
+
error?: string;
|
|
132
|
+
message?: string;
|
|
133
|
+
}
|
|
97
134
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/client/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM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