@enbox/agent 0.4.0 → 0.5.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/dist/browser.mjs +8 -8
- package/dist/browser.mjs.map +4 -4
- package/dist/esm/enbox-connect-protocol.js +0 -20
- package/dist/esm/enbox-connect-protocol.js.map +1 -1
- package/dist/esm/enbox-user-agent.js +1 -7
- package/dist/esm/enbox-user-agent.js.map +1 -1
- package/dist/esm/hd-identity-vault.js +11 -0
- package/dist/esm/hd-identity-vault.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/test-harness.js +2 -3
- package/dist/esm/test-harness.js.map +1 -1
- package/dist/esm/types/dwn.js.map +1 -1
- package/dist/types/enbox-connect-protocol.d.ts +13 -27
- package/dist/types/enbox-connect-protocol.d.ts.map +1 -1
- package/dist/types/enbox-user-agent.d.ts +3 -7
- package/dist/types/enbox-user-agent.d.ts.map +1 -1
- package/dist/types/hd-identity-vault.d.ts +7 -0
- package/dist/types/hd-identity-vault.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/test-harness.d.ts.map +1 -1
- package/dist/types/types/agent.d.ts +2 -7
- package/dist/types/types/agent.d.ts.map +1 -1
- package/dist/types/types/dwn.d.ts +0 -10
- package/dist/types/types/dwn.d.ts.map +1 -1
- package/dist/types/types/sync.d.ts +6 -0
- package/dist/types/types/sync.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/enbox-connect-protocol.ts +14 -39
- package/src/enbox-user-agent.ts +4 -14
- package/src/hd-identity-vault.ts +21 -0
- package/src/index.ts +0 -2
- package/src/test-harness.ts +2 -3
- package/src/types/agent.ts +3 -14
- package/src/types/dwn.ts +1 -13
- package/src/types/sync.ts +7 -0
- package/dist/esm/connect.js +0 -176
- package/dist/esm/connect.js.map +0 -1
- package/dist/esm/sync-api.js +0 -64
- package/dist/esm/sync-api.js.map +0 -1
- package/dist/types/connect.d.ts +0 -84
- package/dist/types/connect.d.ts.map +0 -1
- package/dist/types/sync-api.d.ts +0 -40
- package/dist/types/sync-api.d.ts.map +0 -1
- package/src/connect.ts +0 -276
- package/src/sync-api.ts +0 -75
|
@@ -27,16 +27,6 @@ import { MessagesRead, MessagesSubscribe, MessagesSync, ProtocolsConfigure, Prot
|
|
|
27
27
|
* @see {@link https://github.com/enboxorg/dwn-spec | Enbox DWN Specification}
|
|
28
28
|
*/
|
|
29
29
|
export interface DwnDidService extends DidService {
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Optional legacy field. Resolve encryption keys from the DID document's
|
|
32
|
-
* `keyAgreement` verification methods instead.
|
|
33
|
-
*/
|
|
34
|
-
enc?: string | string[];
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated Optional legacy field. Resolve signing keys from the DID document's
|
|
37
|
-
* `authentication` or `assertionMethod` verification methods instead.
|
|
38
|
-
*/
|
|
39
|
-
sig?: string | string[];
|
|
40
30
|
}
|
|
41
31
|
export declare enum DwnInterface {
|
|
42
32
|
MessagesRead = "MessagesRead",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dwn.d.ts","sourceRoot":"","sources":["../../../src/types/dwn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gB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S,YAAY,IAAI;IACvD,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CACzC,CAAC;AAOF,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,WAAW,EACX,0BAA0B,IAAI,6BAA6B,EAC3D,mBAAmB,IAAI,sBAAsB,EAC7C,eAAe,IAAI,kBAAkB,EACrC,iBAAiB,IAAI,oBAAoB,EACzC,mBAAmB,IAAI,sBAAsB,GAC9C,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,8BAA8B,IAAI,iCAAiC,EACnE,aAAa,IAAI,SAAS,EAC1B,mBAAmB,IAAI,sBAAsB,EAC7C,uBAAuB,IAAI,0BAA0B,EACrD,gBAAgB,IAAI,mBAAmB,EACvC,oBAAoB,IAAI,uBAAuB,EAC/C,mBAAmB,IAAI,sBAAsB,EAC7C,qBAAqB,IAAI,wBAAwB,EACjD,eAAe,IAAI,kBAAkB,EACrC,kBAAkB,IAAI,qBAAqB,EAC3C,uBAAuB,IAAI,0BAA0B,EACrD,YAAY,IAAI,eAAe,EAC/B,sBAAsB,IAAI,yBAAyB,EACnD,oBAAoB,IAAI,uBAAuB,EAC/C,mBAAmB,IAAI,sBAAsB,GAC9C,MAAM,mBAAmB,CAAC"}
|
|
@@ -104,5 +104,11 @@ export interface SyncEngine {
|
|
|
104
104
|
* @throws {Error} if the sync operation fails to stop before the timeout.
|
|
105
105
|
*/
|
|
106
106
|
stopSync(timeout?: number): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Release all resources held by the sync engine (LevelDB handles, timers,
|
|
109
|
+
* WebSocket subscriptions). After calling `close()`, the engine should not
|
|
110
|
+
* be reused.
|
|
111
|
+
*/
|
|
112
|
+
close(): Promise<void>;
|
|
107
113
|
}
|
|
108
114
|
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":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I,CAAC,CAAC;IAC/C;;OAEG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAC1E;;OAEG;IACH,qBAAqB,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5F;;;;;OAKG;IACH,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enbox/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@scure/bip39": "1.2.2",
|
|
74
|
-
"@enbox/dwn-clients": "0.
|
|
75
|
-
"@enbox/dwn-sdk-js": "0.
|
|
76
|
-
"@enbox/common": "0.0
|
|
77
|
-
"@enbox/crypto": "0.0
|
|
78
|
-
"@enbox/dids": "0.0
|
|
74
|
+
"@enbox/dwn-clients": "0.2.0",
|
|
75
|
+
"@enbox/dwn-sdk-js": "0.2.0",
|
|
76
|
+
"@enbox/common": "0.1.0",
|
|
77
|
+
"@enbox/crypto": "0.1.0",
|
|
78
|
+
"@enbox/dids": "0.1.0",
|
|
79
79
|
"abstract-level": "1.0.4",
|
|
80
80
|
"ed25519-keygen": "0.4.11",
|
|
81
81
|
"level": "8.0.1",
|
|
@@ -13,11 +13,24 @@
|
|
|
13
13
|
* and ECDH (Ed25519 → X25519 + HKDF) for key agreement.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import type { ConnectPermissionRequest } from './connect.js';
|
|
17
16
|
import type { EnboxAgent } from './types/agent.js';
|
|
18
17
|
import type { RequireOnly } from '@enbox/common';
|
|
19
18
|
import type { DidDocument, PortableDid } from '@enbox/dids';
|
|
20
19
|
import type { DwnDataEncodedRecordsWriteMessage, DwnPermissionScope, DwnProtocolDefinition } from './types/dwn.js';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The protocols of permissions requested, along with the definition and permission scopes for each protocol.
|
|
23
|
+
*/
|
|
24
|
+
export type ConnectPermissionRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* The definition of the protocol the permissions are being requested for.
|
|
27
|
+
* In the event that the protocol is not already installed, the wallet will install this given protocol definition.
|
|
28
|
+
*/
|
|
29
|
+
protocolDefinition: DwnProtocolDefinition;
|
|
30
|
+
|
|
31
|
+
/** The scope of the permissions being requested for the given protocol */
|
|
32
|
+
permissionScopes: DwnPermissionScope[];
|
|
33
|
+
};
|
|
21
34
|
import type {
|
|
22
35
|
JoseHeaderParams,
|
|
23
36
|
Jwk } from '@enbox/crypto';
|
|
@@ -139,22 +152,6 @@ export type ConnectEndpoint =
|
|
|
139
152
|
| 'callback'
|
|
140
153
|
| 'token';
|
|
141
154
|
|
|
142
|
-
// ---------------------------------------------------------------------------
|
|
143
|
-
// Deprecated type aliases — kept temporarily for migration
|
|
144
|
-
// ---------------------------------------------------------------------------
|
|
145
|
-
|
|
146
|
-
/** @deprecated Use {@link EnboxConnectRequest} instead. */
|
|
147
|
-
export type EnboxConnectAuthRequest = EnboxConnectRequest;
|
|
148
|
-
|
|
149
|
-
/** @deprecated Use {@link EnboxConnectResponse} instead. */
|
|
150
|
-
export type EnboxConnectAuthResponse = EnboxConnectResponse;
|
|
151
|
-
|
|
152
|
-
/** @deprecated Use {@link ConnectPushedRequest} instead. */
|
|
153
|
-
export type PushedAuthRequest = ConnectPushedRequest;
|
|
154
|
-
|
|
155
|
-
/** @deprecated Use {@link ConnectPushedResponse} instead. */
|
|
156
|
-
export type PushedAuthResponse = ConnectPushedResponse;
|
|
157
|
-
|
|
158
155
|
// ---------------------------------------------------------------------------
|
|
159
156
|
// URL building
|
|
160
157
|
// ---------------------------------------------------------------------------
|
|
@@ -754,25 +751,3 @@ export const EnboxConnectProtocol = {
|
|
|
754
751
|
createPermissionGrants,
|
|
755
752
|
submitConnectResponse,
|
|
756
753
|
};
|
|
757
|
-
|
|
758
|
-
// ---------------------------------------------------------------------------
|
|
759
|
-
// Deprecated aliases — migration aid from the old `Oidc` namespace
|
|
760
|
-
// ---------------------------------------------------------------------------
|
|
761
|
-
|
|
762
|
-
/** @deprecated Use {@link EnboxConnectProtocol} instead. */
|
|
763
|
-
export const Oidc = {
|
|
764
|
-
createAuthRequest : createConnectRequest,
|
|
765
|
-
encryptAuthRequest : encryptRequest,
|
|
766
|
-
getAuthRequest : getConnectRequest,
|
|
767
|
-
decryptAuthRequest : decryptRequest,
|
|
768
|
-
createPermissionGrants,
|
|
769
|
-
createResponseObject : createConnectResponse,
|
|
770
|
-
encryptAuthResponse : encryptResponse,
|
|
771
|
-
decryptAuthResponse : decryptResponse,
|
|
772
|
-
deriveSharedKey,
|
|
773
|
-
signJwt,
|
|
774
|
-
verifyJwt,
|
|
775
|
-
buildOidcUrl : buildConnectUrl,
|
|
776
|
-
generateCodeChallenge : undefined as never, // Removed — PKCE was never functional.
|
|
777
|
-
submitAuthResponse : submitConnectResponse,
|
|
778
|
-
};
|
package/src/enbox-user-agent.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { BearerDid } from '@enbox/dids';
|
|
|
3
3
|
import type { EnboxPlatformAgent } from './types/agent.js';
|
|
4
4
|
import type { EnboxRpc } from '@enbox/dwn-clients';
|
|
5
5
|
import type { LocalDwnStrategy } from './local-dwn.js';
|
|
6
|
+
import type { SyncEngine } from './types/sync.js';
|
|
6
7
|
import type { DidInterface, DidRequest, DidResponse } from './did-api.js';
|
|
7
8
|
import type { DwnInterface, DwnResponse, ProcessDwnRequest, SendDwnRequest } from './types/dwn.js';
|
|
8
9
|
import type { ProcessVcRequest, SendVcRequest, VcResponse } from './types/vc.js';
|
|
@@ -13,7 +14,6 @@ import { AgentDidResolverCache } from './agent-did-resolver-cache.js';
|
|
|
13
14
|
import { AgentDwnApi } from './dwn-api.js';
|
|
14
15
|
import { AgentIdentityApi } from './identity-api.js';
|
|
15
16
|
import { AgentPermissionsApi } from './permissions-api.js';
|
|
16
|
-
import { AgentSyncApi } from './sync-api.js';
|
|
17
17
|
import { DwnDidStore } from './store-did.js';
|
|
18
18
|
import { DwnIdentityStore } from './store-identity.js';
|
|
19
19
|
import { DwnKeyStore } from './store-key.js';
|
|
@@ -85,7 +85,7 @@ export type AgentParams<TKeyManager extends AgentKeyManager = LocalKeyManager> =
|
|
|
85
85
|
/** Remote procedure call (RPC) client used to communicate with other Enbox services. */
|
|
86
86
|
rpcClient: EnboxRpc;
|
|
87
87
|
/** Facilitates data synchronization of DWN records between nodes. */
|
|
88
|
-
syncApi:
|
|
88
|
+
syncApi: SyncEngine;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export type CreateUserAgentParams = Partial<AgentParams> & {
|
|
@@ -110,7 +110,7 @@ export class EnboxUserAgent<TKeyManager extends AgentKeyManager = LocalKeyManage
|
|
|
110
110
|
public keyManager: TKeyManager;
|
|
111
111
|
public permissions: AgentPermissionsApi;
|
|
112
112
|
public rpc: EnboxRpc;
|
|
113
|
-
public sync:
|
|
113
|
+
public sync: SyncEngine;
|
|
114
114
|
public vault: HdIdentityVault;
|
|
115
115
|
|
|
116
116
|
private _agentDid?: BearerDid;
|
|
@@ -202,7 +202,7 @@ export class EnboxUserAgent<TKeyManager extends AgentKeyManager = LocalKeyManage
|
|
|
202
202
|
|
|
203
203
|
rpcClient ??= new EnboxRpcClient();
|
|
204
204
|
|
|
205
|
-
syncApi ??= new
|
|
205
|
+
syncApi ??= new SyncEngineLevel({ dataPath });
|
|
206
206
|
|
|
207
207
|
// Instantiate the Agent using the provided or default components.
|
|
208
208
|
return new EnboxUserAgent({
|
|
@@ -284,13 +284,3 @@ export class EnboxUserAgent<TKeyManager extends AgentKeyManager = LocalKeyManage
|
|
|
284
284
|
this.agentDid = await this.vault.getDid();
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
|
|
288
|
-
// ---------------------------------------------------------------------------
|
|
289
|
-
// Deprecated aliases — migration aid
|
|
290
|
-
// ---------------------------------------------------------------------------
|
|
291
|
-
|
|
292
|
-
/** @deprecated Use {@link EnboxUserAgent} instead. Will be removed in a future version. */
|
|
293
|
-
export const Web5UserAgent = EnboxUserAgent;
|
|
294
|
-
|
|
295
|
-
/** @deprecated Use {@link EnboxUserAgent} instead. Will be removed in a future version. */
|
|
296
|
-
export type Web5UserAgent = EnboxUserAgent;
|
package/src/hd-identity-vault.ts
CHANGED
|
@@ -150,6 +150,14 @@ export class HdIdentityVault implements IdentityVault<{ InitializeResult: string
|
|
|
150
150
|
/** The cryptographic key used to encrypt and decrypt the vault's content securely. */
|
|
151
151
|
private _contentEncryptionKey: Jwk | undefined;
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Cached initialization state. Once read from the store, avoids redundant LevelDB reads on
|
|
155
|
+
* subsequent checks. The `initialized` flag is write-once (false → true) and never reverts,
|
|
156
|
+
* making it safe to cache indefinitely. Mirrors the pattern used by {@link _contentEncryptionKey}
|
|
157
|
+
* for the synchronous {@link isLocked} check.
|
|
158
|
+
*/
|
|
159
|
+
private _cachedInitialized: boolean | undefined;
|
|
160
|
+
|
|
153
161
|
/**
|
|
154
162
|
* Constructs an instance of `HdIdentityVault`, initializing the key derivation factor and data
|
|
155
163
|
* store. It sets the default key derivation work factor and initializes the internal data store,
|
|
@@ -337,6 +345,13 @@ export class HdIdentityVault implements IdentityVault<{ InitializeResult: string
|
|
|
337
345
|
throw new Error('HdIdentityVault: Invalid IdentityVaultStatus object in store');
|
|
338
346
|
}
|
|
339
347
|
|
|
348
|
+
// Only cache the `true` state — `initialized` is write-once (false → true) and never reverts,
|
|
349
|
+
// so a cached `true` is always valid. Leaving `false` uncached ensures a subsequent
|
|
350
|
+
// `isInitialized()` call after `initialize()` correctly reads the updated store.
|
|
351
|
+
if (vaultStatus.initialized) {
|
|
352
|
+
this._cachedInitialized = true;
|
|
353
|
+
}
|
|
354
|
+
|
|
340
355
|
return vaultStatus;
|
|
341
356
|
}
|
|
342
357
|
|
|
@@ -595,6 +610,9 @@ export class HdIdentityVault implements IdentityVault<{ InitializeResult: string
|
|
|
595
610
|
* @returns A promise that resolves to `true` if the vault has been initialized, otherwise `false`.
|
|
596
611
|
*/
|
|
597
612
|
public async isInitialized(): Promise<boolean> {
|
|
613
|
+
if (this._cachedInitialized === true) {
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
598
616
|
return this.getStatus().then(({ initialized }) => initialized);
|
|
599
617
|
}
|
|
600
618
|
|
|
@@ -851,6 +869,9 @@ export class HdIdentityVault implements IdentityVault<{ InitializeResult: string
|
|
|
851
869
|
// Write the changes to the store.
|
|
852
870
|
await this._store.set('vaultStatus', JSON.stringify(vaultStatus));
|
|
853
871
|
|
|
872
|
+
// Update the in-memory cache so subsequent reads skip the store.
|
|
873
|
+
this._cachedInitialized = vaultStatus.initialized;
|
|
874
|
+
|
|
854
875
|
return true;
|
|
855
876
|
}
|
|
856
877
|
}
|
package/src/index.ts
CHANGED
|
@@ -31,10 +31,8 @@ export * from './store-data.js';
|
|
|
31
31
|
export * from './store-did.js';
|
|
32
32
|
export * from './store-identity.js';
|
|
33
33
|
export * from './store-key.js';
|
|
34
|
-
export * from './sync-api.js';
|
|
35
34
|
export * from './sync-engine-level.js';
|
|
36
35
|
export * from './test-harness.js';
|
|
37
36
|
export * from './utils.js';
|
|
38
|
-
export * from './connect.js';
|
|
39
37
|
export * from './enbox-connect-protocol.js';
|
|
40
38
|
export * from './enbox-user-agent.js';
|
package/src/test-harness.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { AgentDidResolverCache } from './agent-did-resolver-cache.js';
|
|
|
16
16
|
import { AgentDwnApi } from './dwn-api.js';
|
|
17
17
|
import { AgentIdentityApi } from './identity-api.js';
|
|
18
18
|
import { AgentPermissionsApi } from './permissions-api.js';
|
|
19
|
-
import { AgentSyncApi } from './sync-api.js';
|
|
20
19
|
import { EnboxRpcClient } from '@enbox/dwn-clients';
|
|
21
20
|
import { HdIdentityVault } from './hd-identity-vault.js';
|
|
22
21
|
import { LocalKeyManager } from './local-key-manager.js';
|
|
@@ -107,6 +106,7 @@ export class PlatformAgentTestHarness {
|
|
|
107
106
|
await this.dwnResumableTaskStore.clear();
|
|
108
107
|
await this.syncStore.clear();
|
|
109
108
|
await this.vaultStore.clear();
|
|
109
|
+
(this.agent.vault as any)['_cachedInitialized'] = undefined;
|
|
110
110
|
await this.agent.permissions.clear();
|
|
111
111
|
this.dwnStores.clear();
|
|
112
112
|
|
|
@@ -282,8 +282,7 @@ export class PlatformAgentTestHarness {
|
|
|
282
282
|
|
|
283
283
|
// Instantiate Agent's Sync API using a custom LevelDB-backed store.
|
|
284
284
|
const syncStore = new Level(testDataPath('SYNC_STORE'));
|
|
285
|
-
const
|
|
286
|
-
const syncApi = new AgentSyncApi({ syncEngine });
|
|
285
|
+
const syncApi = new SyncEngineLevel({ db: syncStore });
|
|
287
286
|
|
|
288
287
|
// Create EnboxPlatformAgent instance
|
|
289
288
|
const agent = new agentClass({
|
package/src/types/agent.ts
CHANGED
|
@@ -5,10 +5,9 @@ import type { AgentDwnApi } from '../dwn-api.js';
|
|
|
5
5
|
import type { AgentIdentityApi } from '../identity-api.js';
|
|
6
6
|
import type { AgentKeyManager } from './key-manager.js';
|
|
7
7
|
import type { AgentPermissionsApi } from '../permissions-api.js';
|
|
8
|
-
import type { AgentSyncApi } from '../sync-api.js';
|
|
9
8
|
import type { EnboxRpc } from '@enbox/dwn-clients';
|
|
10
9
|
import type { IdentityVault } from './identity-vault.js';
|
|
11
|
-
import type {
|
|
10
|
+
import type { SyncEngine } from './sync.js';
|
|
12
11
|
import type { AgentDidApi, DidInterface, DidRequest, DidResponse } from '../did-api.js';
|
|
13
12
|
import type { DwnInterface, DwnResponse, ProcessDwnRequest, SendDwnRequest } from './dwn.js';
|
|
14
13
|
import type { ProcessVcRequest, SendVcRequest, VcResponse } from './vc.js';
|
|
@@ -168,7 +167,7 @@ export interface EnboxPlatformAgent<TKeyManager extends AgentKeyManager = AgentK
|
|
|
168
167
|
* The synchronization API, responsible for managing the consistency and real-time update of the
|
|
169
168
|
* agent's data with the state of the distributed network.
|
|
170
169
|
*/
|
|
171
|
-
sync:
|
|
170
|
+
sync: SyncEngine;
|
|
172
171
|
|
|
173
172
|
/**
|
|
174
173
|
* An instance of {@link IdentityVault}, providing secure storage and management of an Enbox Agent's
|
|
@@ -193,14 +192,4 @@ export interface EnboxPlatformAgent<TKeyManager extends AgentKeyManager = AgentK
|
|
|
193
192
|
* normal operation and readiness to process requests.
|
|
194
193
|
*/
|
|
195
194
|
start(params: unknown): Promise<unknown>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// ---------------------------------------------------------------------------
|
|
199
|
-
// Deprecated aliases — migration aid
|
|
200
|
-
// ---------------------------------------------------------------------------
|
|
201
|
-
|
|
202
|
-
/** @deprecated Use {@link EnboxAgent} instead. Will be removed in a future version. */
|
|
203
|
-
export type Web5Agent = EnboxAgent;
|
|
204
|
-
|
|
205
|
-
/** @deprecated Use {@link EnboxPlatformAgent} instead. Will be removed in a future version. */
|
|
206
|
-
export type Web5PlatformAgent<TKeyManager extends AgentKeyManager = LocalKeyManager> = EnboxPlatformAgent<TKeyManager>;
|
|
195
|
+
}
|
package/src/types/dwn.ts
CHANGED
|
@@ -72,19 +72,7 @@ import {
|
|
|
72
72
|
*
|
|
73
73
|
* @see {@link https://github.com/enboxorg/dwn-spec | Enbox DWN Specification}
|
|
74
74
|
*/
|
|
75
|
-
export interface DwnDidService extends DidService {
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated Optional legacy field. Resolve encryption keys from the DID document's
|
|
78
|
-
* `keyAgreement` verification methods instead.
|
|
79
|
-
*/
|
|
80
|
-
enc?: string | string[];
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated Optional legacy field. Resolve signing keys from the DID document's
|
|
84
|
-
* `authentication` or `assertionMethod` verification methods instead.
|
|
85
|
-
*/
|
|
86
|
-
sig?: string | string[];
|
|
87
|
-
}
|
|
75
|
+
export interface DwnDidService extends DidService {}
|
|
88
76
|
|
|
89
77
|
export enum DwnInterface {
|
|
90
78
|
MessagesRead = DwnInterfaceName.Messages + DwnMethodName.Read,
|
package/src/types/sync.ts
CHANGED
|
@@ -106,4 +106,11 @@ export interface SyncEngine {
|
|
|
106
106
|
* @throws {Error} if the sync operation fails to stop before the timeout.
|
|
107
107
|
*/
|
|
108
108
|
stopSync(timeout?: number): Promise<void>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Release all resources held by the sync engine (LevelDB handles, timers,
|
|
112
|
+
* WebSocket subscriptions). After calling `close()`, the engine should not
|
|
113
|
+
* be reused.
|
|
114
|
+
*/
|
|
115
|
+
close(): Promise<void>;
|
|
109
116
|
}
|
package/dist/esm/connect.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { CryptoUtils } from '@enbox/crypto';
|
|
11
|
-
import { DidJwk } from '@enbox/dids';
|
|
12
|
-
import { EnboxConnectProtocol } from './enbox-connect-protocol.js';
|
|
13
|
-
import { pollWithTtl } from './utils.js';
|
|
14
|
-
import { Convert, logger } from '@enbox/common';
|
|
15
|
-
import { DwnInterfaceName, DwnMethodName } from '@enbox/dwn-sdk-js';
|
|
16
|
-
/**
|
|
17
|
-
* Initiates the wallet connect process. Used when a client wants to obtain
|
|
18
|
-
* a did from a provider.
|
|
19
|
-
*/
|
|
20
|
-
function initClient(_a) {
|
|
21
|
-
return __awaiter(this, arguments, void 0, function* ({ displayName, connectServerUrl, walletUri, permissionRequests, onWalletUriReady, validatePin, }) {
|
|
22
|
-
// ephemeral client did for ECDH, signing, verification
|
|
23
|
-
const clientDid = yield DidJwk.create();
|
|
24
|
-
// TODO: properly implement PKCE. this implementation is lacking server side validations and more.
|
|
25
|
-
// https://github.com/enboxorg/enbox/issues/829
|
|
26
|
-
// Derive the code challenge based on the code verifier
|
|
27
|
-
// const { codeChallengeBytes, codeChallengeBase64Url } =
|
|
28
|
-
// await Oidc.generateCodeChallenge();
|
|
29
|
-
const encryptionKey = CryptoUtils.randomBytes(32);
|
|
30
|
-
// Build callback URL for the connect request.
|
|
31
|
-
const callbackEndpoint = EnboxConnectProtocol.buildConnectUrl({
|
|
32
|
-
baseURL: connectServerUrl,
|
|
33
|
-
endpoint: 'callback',
|
|
34
|
-
});
|
|
35
|
-
// Build the connect request.
|
|
36
|
-
const request = yield EnboxConnectProtocol.createConnectRequest({
|
|
37
|
-
clientDid: clientDid.uri,
|
|
38
|
-
callbackUrl: callbackEndpoint,
|
|
39
|
-
permissionRequests: permissionRequests,
|
|
40
|
-
appName: displayName,
|
|
41
|
-
});
|
|
42
|
-
// Sign the request as a JWT.
|
|
43
|
-
const requestJwt = yield EnboxConnectProtocol.signJwt({
|
|
44
|
-
did: clientDid,
|
|
45
|
-
data: request,
|
|
46
|
-
});
|
|
47
|
-
if (!requestJwt) {
|
|
48
|
-
throw new Error('Unable to sign requestObject');
|
|
49
|
-
}
|
|
50
|
-
// Encrypt the request JWT with the symmetric key.
|
|
51
|
-
const requestObjectJwe = yield EnboxConnectProtocol.encryptRequest({
|
|
52
|
-
jwt: requestJwt,
|
|
53
|
-
encryptionKey,
|
|
54
|
-
});
|
|
55
|
-
const pushedAuthorizationRequestEndpoint = EnboxConnectProtocol.buildConnectUrl({
|
|
56
|
-
baseURL: connectServerUrl,
|
|
57
|
-
endpoint: 'pushedAuthorizationRequest',
|
|
58
|
-
});
|
|
59
|
-
const parResponse = yield fetch(pushedAuthorizationRequestEndpoint, {
|
|
60
|
-
body: JSON.stringify({ request: requestObjectJwe }),
|
|
61
|
-
method: 'POST',
|
|
62
|
-
headers: {
|
|
63
|
-
'Content-Type': 'application/json',
|
|
64
|
-
},
|
|
65
|
-
signal: AbortSignal.timeout(30000),
|
|
66
|
-
});
|
|
67
|
-
if (!parResponse.ok) {
|
|
68
|
-
throw new Error(`${parResponse.status}: ${parResponse.statusText}`);
|
|
69
|
-
}
|
|
70
|
-
const parData = yield parResponse.json();
|
|
71
|
-
// a deeplink to a compatible wallet. if the wallet scans this link it should receive
|
|
72
|
-
// a route to its Connect provider flow and the params of where to fetch the auth request.
|
|
73
|
-
logger.log(`Wallet URI: ${walletUri}`);
|
|
74
|
-
const generatedWalletUri = new URL(walletUri);
|
|
75
|
-
generatedWalletUri.searchParams.set('request_uri', parData.request_uri);
|
|
76
|
-
generatedWalletUri.searchParams.set('encryption_key', Convert.uint8Array(encryptionKey).toBase64Url());
|
|
77
|
-
// call user's callback so they can send the URI to the wallet as they see fit
|
|
78
|
-
onWalletUriReady(generatedWalletUri.toString());
|
|
79
|
-
const tokenUrl = EnboxConnectProtocol.buildConnectUrl({
|
|
80
|
-
baseURL: connectServerUrl,
|
|
81
|
-
endpoint: 'token',
|
|
82
|
-
tokenParam: request.state,
|
|
83
|
-
});
|
|
84
|
-
// subscribe to receiving a response from the wallet with default TTL. receive ciphertext of {@link EnboxConnectAuthResponse}
|
|
85
|
-
const authResponse = yield pollWithTtl(() => fetch(tokenUrl, { signal: AbortSignal.timeout(30000) }));
|
|
86
|
-
if (authResponse) {
|
|
87
|
-
const jwe = yield (authResponse === null || authResponse === void 0 ? void 0 : authResponse.text());
|
|
88
|
-
// Get the PIN from the user and use it as AAD to decrypt.
|
|
89
|
-
const pin = yield validatePin();
|
|
90
|
-
const jwt = yield EnboxConnectProtocol.decryptResponse(clientDid, jwe, pin);
|
|
91
|
-
const verifiedResponse = (yield EnboxConnectProtocol.verifyJwt({
|
|
92
|
-
jwt,
|
|
93
|
-
}));
|
|
94
|
-
return {
|
|
95
|
-
delegateGrants: verifiedResponse.delegateGrants,
|
|
96
|
-
delegatePortableDid: verifiedResponse.delegatePortableDid,
|
|
97
|
-
connectedDid: verifiedResponse.providerDid,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Creates a set of Dwn Permission Scopes to request for a given protocol.
|
|
104
|
-
*
|
|
105
|
-
* If no permissions are provided, the default is to request all relevant record permissions (write, read, delete, query, subscribe).
|
|
106
|
-
* 'configure' is not included by default, as this gives the application a lot of control over the protocol.
|
|
107
|
-
*/
|
|
108
|
-
function createPermissionRequestForProtocol({ definition, permissions }) {
|
|
109
|
-
const requests = [];
|
|
110
|
-
// Add the ability to query for the specific protocol
|
|
111
|
-
requests.push({
|
|
112
|
-
protocol: definition.protocol,
|
|
113
|
-
interface: DwnInterfaceName.Protocols,
|
|
114
|
-
method: DwnMethodName.Query,
|
|
115
|
-
});
|
|
116
|
-
// A Messages.Read grant is a unified scope that covers MessagesRead, MessagesSync, and MessagesSubscribe.
|
|
117
|
-
// This single grant enables sync and real-time subscriptions for the protocol.
|
|
118
|
-
requests.push({
|
|
119
|
-
protocol: definition.protocol,
|
|
120
|
-
interface: DwnInterfaceName.Messages,
|
|
121
|
-
method: DwnMethodName.Read,
|
|
122
|
-
});
|
|
123
|
-
// We also request any additional permissions the user has requested for this protocol
|
|
124
|
-
for (const permission of permissions) {
|
|
125
|
-
switch (permission) {
|
|
126
|
-
case 'write':
|
|
127
|
-
requests.push({
|
|
128
|
-
protocol: definition.protocol,
|
|
129
|
-
interface: DwnInterfaceName.Records,
|
|
130
|
-
method: DwnMethodName.Write,
|
|
131
|
-
});
|
|
132
|
-
break;
|
|
133
|
-
case 'read':
|
|
134
|
-
requests.push({
|
|
135
|
-
protocol: definition.protocol,
|
|
136
|
-
interface: DwnInterfaceName.Records,
|
|
137
|
-
method: DwnMethodName.Read,
|
|
138
|
-
});
|
|
139
|
-
break;
|
|
140
|
-
case 'delete':
|
|
141
|
-
requests.push({
|
|
142
|
-
protocol: definition.protocol,
|
|
143
|
-
interface: DwnInterfaceName.Records,
|
|
144
|
-
method: DwnMethodName.Delete,
|
|
145
|
-
});
|
|
146
|
-
break;
|
|
147
|
-
case 'query':
|
|
148
|
-
requests.push({
|
|
149
|
-
protocol: definition.protocol,
|
|
150
|
-
interface: DwnInterfaceName.Records,
|
|
151
|
-
method: DwnMethodName.Query,
|
|
152
|
-
});
|
|
153
|
-
break;
|
|
154
|
-
case 'subscribe':
|
|
155
|
-
requests.push({
|
|
156
|
-
protocol: definition.protocol,
|
|
157
|
-
interface: DwnInterfaceName.Records,
|
|
158
|
-
method: DwnMethodName.Subscribe,
|
|
159
|
-
});
|
|
160
|
-
break;
|
|
161
|
-
case 'configure':
|
|
162
|
-
requests.push({
|
|
163
|
-
protocol: definition.protocol,
|
|
164
|
-
interface: DwnInterfaceName.Protocols,
|
|
165
|
-
method: DwnMethodName.Configure,
|
|
166
|
-
});
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return {
|
|
171
|
-
protocolDefinition: definition,
|
|
172
|
-
permissionScopes: requests,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export const WalletConnect = { initClient, createPermissionRequestForProtocol };
|
|
176
|
-
//# sourceMappingURL=connect.js.map
|
package/dist/esm/connect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;GAGG;AACH,SAAe,UAAU;yDAAC,EACxB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,GACU;QAKrB,uDAAuD;QACvD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;QAExC,kGAAkG;QAClG,+CAA+C;QAC/C,uDAAuD;QACvD,yDAAyD;QACzD,wCAAwC;QACxC,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAElD,8CAA8C;QAC9C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,eAAe,CAAC;YAC5D,OAAO,EAAI,gBAAgB;YAC3B,QAAQ,EAAG,UAAU;SACtB,CAAC,CAAC;QAEH,6BAA6B;QAC7B,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,oBAAoB,CAAC;YAC9D,SAAS,EAAY,SAA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,QAAQ,EAAI,UAAU,CAAC,QAAQ;oBAC/B,SAAS,EAAG,gBAAgB,CAAC,OAAO;oBACpC,MAAM,EAAM,aAAa,CAAC,KAAK;iBAChC,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,QAAQ,CAAC,IAAI,CAAC;oBACZ,QAAQ,EAAI,UAAU,CAAC,QAAQ;oBAC/B,SAAS,EAAG,gBAAgB,CAAC,OAAO;oBACpC,MAAM,EAAM,aAAa,CAAC,SAAS;iBACpC,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,QAAQ,CAAC,IAAI,CAAC;oBACZ,QAAQ,EAAI,UAAU,CAAC,QAAQ;oBAC/B,SAAS,EAAG,gBAAgB,CAAC,SAAS;oBACtC,MAAM,EAAM,aAAa,CAAC,SAAS;iBACpC,CAAC,CAAC;gBACH,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO;QACL,kBAAkB,EAAG,UAAU;QAC/B,gBAAgB,EAAK,QAAQ;KAC9B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,UAAU,EAAE,kCAAkC,EAAE,CAAC"}
|
package/dist/esm/sync-api.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export class AgentSyncApi {
|
|
11
|
-
constructor({ agent, syncEngine }) {
|
|
12
|
-
this._syncEngine = syncEngine;
|
|
13
|
-
this._agent = agent;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves the `EnboxPlatformAgent` execution context.
|
|
17
|
-
*
|
|
18
|
-
* @returns The `EnboxPlatformAgent` instance that represents the current execution context.
|
|
19
|
-
* @throws Will throw an error if the `agent` instance property is undefined.
|
|
20
|
-
*/
|
|
21
|
-
get agent() {
|
|
22
|
-
if (this._agent === undefined) {
|
|
23
|
-
throw new Error('AgentSyncApi: Unable to determine agent execution context.');
|
|
24
|
-
}
|
|
25
|
-
return this._agent;
|
|
26
|
-
}
|
|
27
|
-
set agent(agent) {
|
|
28
|
-
this._agent = agent;
|
|
29
|
-
this._syncEngine.agent = agent;
|
|
30
|
-
}
|
|
31
|
-
get connectivityState() {
|
|
32
|
-
return this._syncEngine.connectivityState;
|
|
33
|
-
}
|
|
34
|
-
registerIdentity(params) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
yield this._syncEngine.registerIdentity(params);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
unregisterIdentity(did) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
yield this._syncEngine.unregisterIdentity(did);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
getIdentityOptions(did) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
return yield this._syncEngine.getIdentityOptions(did);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
updateIdentityOptions(params) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
yield this._syncEngine.updateIdentityOptions(params);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
sync(direction) {
|
|
55
|
-
return this._syncEngine.sync(direction);
|
|
56
|
-
}
|
|
57
|
-
startSync(params) {
|
|
58
|
-
return this._syncEngine.startSync(params);
|
|
59
|
-
}
|
|
60
|
-
stopSync(timeout) {
|
|
61
|
-
return this._syncEngine.stopSync(timeout);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=sync-api.js.map
|
package/dist/esm/sync-api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-api.js","sourceRoot":"","sources":["../../src/sync-api.ts"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,OAAO,YAAY;IAWvB,YAAY,EAAE,KAAK,EAAE,UAAU,EAAiB;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAyB;QACjC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;IAC5C,CAAC;IAEY,gBAAgB,CAAC,MAAsD;;YAClF,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;KAAA;IAEY,kBAAkB,CAAC,GAAW;;YACzC,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACjD,CAAC;KAAA;IAEY,kBAAkB,CAAC,GAAW;;YACzC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;KAAA;IAEY,qBAAqB,CAAC,MAAqD;;YACtF,MAAM,I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