@biolibs/bionet-client 0.0.0-stage → 0.1.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 +77 -2
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/lab.d.ts +266 -0
- package/dist/lab.d.ts.map +1 -0
- package/dist/lab.js +372 -0
- package/dist/lab.js.map +1 -0
- package/dist/link.d.ts +83 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +228 -0
- package/dist/link.js.map +1 -0
- package/dist/source.d.ts +52 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +36 -0
- package/dist/source.js.map +1 -0
- package/dist/sqlite.d.ts +9 -0
- package/dist/sqlite.d.ts.map +1 -0
- package/dist/sqlite.js +60 -0
- package/dist/sqlite.js.map +1 -0
- package/dist/store.d.ts +46 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +32 -0
- package/dist/store.js.map +1 -0
- package/package.json +48 -4
- package/src/index.ts +22 -0
- package/src/lab.ts +468 -0
- package/src/link.ts +240 -0
- package/src/source.ts +62 -0
- package/src/sqlite.ts +60 -0
- package/src/store.ts +59 -0
package/README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @biolibs/bionet-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One device in one lab: its key, its copy of the lab's signed log, everything a member can do, and the
|
|
4
|
+
connection to the lab's web peer. It works with no network and syncs when there is one.
|
|
5
|
+
|
|
6
|
+
It is an application with the edges left open. Where entries are kept, where the key lives and what
|
|
7
|
+
opens a socket are handed in, so the same `Lab` runs behind a desktop window, in a browser or in a test.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @biolibs/bionet-client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## A device
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { Lab, memoryKeys, memoryStore } from "@biolibs/bionet-client";
|
|
19
|
+
|
|
20
|
+
const lab = await new Lab({ store: memoryStore(), keys: memoryKeys() }).open();
|
|
21
|
+
await lab.setPerson("Ada");
|
|
22
|
+
await lab.found({ name: "The Wren Lab" }); // works at once, with no peer anywhere
|
|
23
|
+
|
|
24
|
+
await lab.addPart({ name: "f1", sequence: "GGATCACAGTCTACACTGCTCACTCC" });
|
|
25
|
+
const part = lab.snapshot().lab.parts[0].checksum;
|
|
26
|
+
const tube = await lab.addItem({ part, amount: 10, unit: "µL" });
|
|
27
|
+
await lab.adjust({ item: tube, by: -3 });
|
|
28
|
+
lab.snapshot().lab.items[0].amount; // 7
|
|
29
|
+
|
|
30
|
+
await lab.setPeer("wss://lab-wren.onrender.com/sync"); // now it syncs, and keeps trying when it cannot
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Every action becomes a signed entry in this device's own log. A change the lab would refuse is tried
|
|
34
|
+
first and **never written**, because a log is forever: the promise rejects with the reason.
|
|
35
|
+
|
|
36
|
+
On a desktop, keep the entries in a SQLite file. It is its own entry point because it needs Node:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { sqliteStore } from "@biolibs/bionet-client/sqlite";
|
|
40
|
+
|
|
41
|
+
const lab = await new Lab({ store: sqliteStore("./lab-data"), keys }).open();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`keys` is anything with `load()` and `save()`. A real device keeps its key where the operating system
|
|
45
|
+
guards it; `memoryKeys()` is for tests.
|
|
46
|
+
|
|
47
|
+
## Joining
|
|
48
|
+
|
|
49
|
+
1. The new member sends a keeper their device's key: `lab.snapshot().device.key`.
|
|
50
|
+
2. The keeper adds it, `lab.addMember({ key, person })`, and sends back `lab.invite`.
|
|
51
|
+
3. The new member calls `lab.join(invite)`. The lab arrives once the keeper's change reaches the peer.
|
|
52
|
+
|
|
53
|
+
## The window's side
|
|
54
|
+
|
|
55
|
+
A window does not always share a process with the lab. It reaches one through a `LabSource`: the lab
|
|
56
|
+
as plain data, to be told when it changes, and one of a fixed list of things to be done.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { ACTIONS, perform, sourceOf } from "@biolibs/bionet-client";
|
|
60
|
+
|
|
61
|
+
const source = sourceOf(lab); // a lab in this process
|
|
62
|
+
source.snapshot(); // the same object until something changes
|
|
63
|
+
await source.act("adjust", { item: tube, by: -1 }); // { ok: true, result } or { ok: false, error }
|
|
64
|
+
|
|
65
|
+
await perform(lab, "close"); // { ok: false, ... }: not on the list, so refused
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`perform` is the door for a lab in another process: it does only what is in `ACTIONS`.
|
|
69
|
+
|
|
70
|
+
## Testing
|
|
71
|
+
|
|
72
|
+
`test/client.test.ts` runs two devices against the real peer from `@biolibs/bionet-peer`, in process:
|
|
73
|
+
founding offline, joining, live changes, a network that goes away and comes back, refusals, removal,
|
|
74
|
+
publishing, and reopening from disk.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* `@biolibs/bionet-client`: one device in one lab.
|
|
4
|
+
*
|
|
5
|
+
* `@biolibs/bionet` says what a lab's signed log means. This is the thing that keeps one: a device's
|
|
6
|
+
* key, its copy of the log, every action a member can take, and the connection to the lab's web
|
|
7
|
+
* peer. It works with no network and syncs when there is one.
|
|
8
|
+
*
|
|
9
|
+
* It is an application with the edges left open. Where entries are kept, where the key lives and
|
|
10
|
+
* what opens a socket are handed in, so the same `Lab` runs behind a desktop window, in a browser or
|
|
11
|
+
* in a test:
|
|
12
|
+
*
|
|
13
|
+
* - `lab.ts` — the device: `Lab`, and the plain-data snapshot a window draws
|
|
14
|
+
* - `link.ts` — the connection to the web peer, which is allowed to fail
|
|
15
|
+
* - `source.ts` — the narrow way a window reaches a lab, in this process or another
|
|
16
|
+
* - `store.ts` — the interfaces for storage and key keeping, with in-memory versions
|
|
17
|
+
* - `sqlite.ts` — storage in a SQLite file, at `@biolibs/bionet-client/sqlite` because it needs Node
|
|
18
|
+
*/
|
|
19
|
+
export * from "./lab.js";
|
|
20
|
+
export * from "./link.js";
|
|
21
|
+
export * from "./store.js";
|
|
22
|
+
export * from "./source.js";
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* `@biolibs/bionet-client`: one device in one lab.
|
|
4
|
+
*
|
|
5
|
+
* `@biolibs/bionet` says what a lab's signed log means. This is the thing that keeps one: a device's
|
|
6
|
+
* key, its copy of the log, every action a member can take, and the connection to the lab's web
|
|
7
|
+
* peer. It works with no network and syncs when there is one.
|
|
8
|
+
*
|
|
9
|
+
* It is an application with the edges left open. Where entries are kept, where the key lives and
|
|
10
|
+
* what opens a socket are handed in, so the same `Lab` runs behind a desktop window, in a browser or
|
|
11
|
+
* in a test:
|
|
12
|
+
*
|
|
13
|
+
* - `lab.ts` — the device: `Lab`, and the plain-data snapshot a window draws
|
|
14
|
+
* - `link.ts` — the connection to the web peer, which is allowed to fail
|
|
15
|
+
* - `source.ts` — the narrow way a window reaches a lab, in this process or another
|
|
16
|
+
* - `store.ts` — the interfaces for storage and key keeping, with in-memory versions
|
|
17
|
+
* - `sqlite.ts` — storage in a SQLite file, at `@biolibs/bionet-client/sqlite` because it needs Node
|
|
18
|
+
*/
|
|
19
|
+
export * from "./lab.js";
|
|
20
|
+
export * from "./link.js";
|
|
21
|
+
export * from "./store.js";
|
|
22
|
+
export * from "./source.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/lab.d.ts
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One person's device in one lab: its key, what it holds, and everything it can do.
|
|
3
|
+
*
|
|
4
|
+
* This is a whole lab application without a window. It knows nothing of Electron, React or a
|
|
5
|
+
* browser, so the same class sits behind a desktop app, a web page or a test, and two of these and a
|
|
6
|
+
* web peer are a lab.
|
|
7
|
+
*
|
|
8
|
+
* Everything a member does becomes a signed entry in this device's own log, is kept, and is offered
|
|
9
|
+
* to the lab's web peer when there is one to offer it to. Nothing waits for the network. What the lab
|
|
10
|
+
* holds is worked out from the entries each time they change, by `mergeLog`, which is why two devices
|
|
11
|
+
* that have been apart agree the moment they have each other's entries.
|
|
12
|
+
*/
|
|
13
|
+
import { type EntryStatus, type ItemState, type Operation, type Overlap, type PartState, type Role, type RosterKey } from "@biolibs/bionet";
|
|
14
|
+
import { type LinkStatus } from "./link.js";
|
|
15
|
+
import type { KeyKeeper, LabStore } from "./store.js";
|
|
16
|
+
/** One key on the roster, as a window shows it. */
|
|
17
|
+
export interface RosterView extends RosterKey {
|
|
18
|
+
/** The key's fingerprint, for a person to compare. */
|
|
19
|
+
fingerprint: string;
|
|
20
|
+
/** Whether it is this device's key. */
|
|
21
|
+
you: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** One entry, as a window shows it. */
|
|
24
|
+
export interface EntryView {
|
|
25
|
+
id: string;
|
|
26
|
+
author: string;
|
|
27
|
+
seq: number;
|
|
28
|
+
op: Operation;
|
|
29
|
+
status: EntryStatus;
|
|
30
|
+
reason: string | null;
|
|
31
|
+
/** What the signer called themselves. A claim. */
|
|
32
|
+
signer: string | null;
|
|
33
|
+
/** When they say they signed. A claim. */
|
|
34
|
+
signedAt: string;
|
|
35
|
+
}
|
|
36
|
+
/** The lab, as a window shows it. */
|
|
37
|
+
export interface LabView {
|
|
38
|
+
id: string | null;
|
|
39
|
+
name: string | null;
|
|
40
|
+
/** Whether any of the lab has reached this device yet. */
|
|
41
|
+
arrived: boolean;
|
|
42
|
+
/** Whether this device's key is on the roster, so it may change the lab. */
|
|
43
|
+
member: boolean;
|
|
44
|
+
/** Whether it may change the roster as well. */
|
|
45
|
+
keeper: boolean;
|
|
46
|
+
roster: RosterView[];
|
|
47
|
+
parts: PartState[];
|
|
48
|
+
items: ItemState[];
|
|
49
|
+
overlaps: Overlap[];
|
|
50
|
+
/** How many entries are waiting on others that have not arrived. */
|
|
51
|
+
waiting: number;
|
|
52
|
+
entries: EntryView[];
|
|
53
|
+
}
|
|
54
|
+
/** The connection to the lab's web peer, as a window shows it. */
|
|
55
|
+
export interface PeerView {
|
|
56
|
+
url: string | null;
|
|
57
|
+
/** The web address the lab's inventory is published at. */
|
|
58
|
+
origin: string | null;
|
|
59
|
+
/** What to send somebody who should join. */
|
|
60
|
+
invite: string | null;
|
|
61
|
+
status: LinkStatus;
|
|
62
|
+
problem: string | null;
|
|
63
|
+
/** How many changes made here the peer is not known to have. */
|
|
64
|
+
pending: number;
|
|
65
|
+
lastSynced: string | null;
|
|
66
|
+
}
|
|
67
|
+
/** Everything a window needs to draw, as plain data. */
|
|
68
|
+
export interface LabSnapshot {
|
|
69
|
+
device: {
|
|
70
|
+
key: string;
|
|
71
|
+
fingerprint: string;
|
|
72
|
+
person: string | null;
|
|
73
|
+
};
|
|
74
|
+
lab: LabView | null;
|
|
75
|
+
peer: PeerView;
|
|
76
|
+
/** When this device last published the lab's inventory. */
|
|
77
|
+
published: string | null;
|
|
78
|
+
}
|
|
79
|
+
/** What a device needs. */
|
|
80
|
+
export interface LabOptions {
|
|
81
|
+
/** Where to keep things. */
|
|
82
|
+
store: LabStore;
|
|
83
|
+
/** Where the device's key lives. */
|
|
84
|
+
keys: KeyKeeper;
|
|
85
|
+
/** Something to fetch the published inventory with. Defaults to the runtime's own `fetch`. */
|
|
86
|
+
fetch?: typeof globalThis.fetch;
|
|
87
|
+
/** Something to open sockets with. Defaults to the runtime's own `WebSocket`. */
|
|
88
|
+
WebSocket?: typeof globalThis.WebSocket;
|
|
89
|
+
}
|
|
90
|
+
/** @param peer - The peer's socket address. @returns The web address it serves from. */
|
|
91
|
+
export declare function originOf(peer: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Read an invitation: the peer's address, then `#`, then the lab's ID.
|
|
94
|
+
*
|
|
95
|
+
* @param invite - What a keeper sent.
|
|
96
|
+
* @returns Where the lab's peer is, and which lab.
|
|
97
|
+
* @throws If it is not an invitation.
|
|
98
|
+
*/
|
|
99
|
+
export declare function readInvite(invite: string): {
|
|
100
|
+
peer: string;
|
|
101
|
+
lab: string;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* One device in one lab.
|
|
105
|
+
*
|
|
106
|
+
* Make one with somewhere to keep things and somewhere to keep the key, `open()` it, and it is a
|
|
107
|
+
* working lab application: it makes the device's key if there is none, works the lab out from what
|
|
108
|
+
* is held, and starts talking to the lab's peer if it has one.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* import { Lab, memoryKeys, memoryStore } from "@biolibs/bionet-client";
|
|
113
|
+
*
|
|
114
|
+
* const lab = await new Lab({ store: memoryStore(), keys: memoryKeys() }).open();
|
|
115
|
+
* await lab.setPerson("Ada");
|
|
116
|
+
* await lab.found({ name: "The Wren Lab" });
|
|
117
|
+
* lab.snapshot().lab?.keeper; // true
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare class Lab {
|
|
121
|
+
private readonly options;
|
|
122
|
+
private readonly store;
|
|
123
|
+
private held;
|
|
124
|
+
private state;
|
|
125
|
+
private link;
|
|
126
|
+
private key;
|
|
127
|
+
private fingerprint;
|
|
128
|
+
private readonly fingerprints;
|
|
129
|
+
private readonly listeners;
|
|
130
|
+
private cached;
|
|
131
|
+
/** One change at a time, so two cannot both write the same place in the log. */
|
|
132
|
+
private turn;
|
|
133
|
+
constructor(options: LabOptions);
|
|
134
|
+
/**
|
|
135
|
+
* Load or make the device's key, and work the lab out from what is held.
|
|
136
|
+
*
|
|
137
|
+
* @returns This, ready.
|
|
138
|
+
*/
|
|
139
|
+
open(): Promise<this>;
|
|
140
|
+
/**
|
|
141
|
+
* Be told whenever anything a window would draw has changed.
|
|
142
|
+
*
|
|
143
|
+
* @param listener - Called with nothing; ask `snapshot()` for what is new.
|
|
144
|
+
* @returns A function that stops the telling.
|
|
145
|
+
*/
|
|
146
|
+
subscribe: (listener: () => void) => (() => void);
|
|
147
|
+
/**
|
|
148
|
+
* Everything a window needs to draw, as plain data. The same object is returned until something
|
|
149
|
+
* changes, so it can be compared by identity.
|
|
150
|
+
*/
|
|
151
|
+
snapshot: () => LabSnapshot;
|
|
152
|
+
/** The lab this device is in, or `null`. */
|
|
153
|
+
get labId(): string | null;
|
|
154
|
+
/** What the person at this device is called, or `null` if they have not said. */
|
|
155
|
+
get person(): string | null;
|
|
156
|
+
/** The web address the lab's inventory is published at. */
|
|
157
|
+
get origin(): string | null;
|
|
158
|
+
/** What to send somebody who should join, or `null` if the lab has no peer to join through. */
|
|
159
|
+
get invite(): string | null;
|
|
160
|
+
/** @param name - What to call the person at this device. */
|
|
161
|
+
setPerson(name: string): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Found a lab on this device. It works straight away, with or without a peer.
|
|
164
|
+
*
|
|
165
|
+
* @param about - What the lab is called, and its peer's address if it has one yet.
|
|
166
|
+
*/
|
|
167
|
+
found(about: {
|
|
168
|
+
name: string;
|
|
169
|
+
peer?: string | null;
|
|
170
|
+
}): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Join a lab somebody else founded. Nothing arrives until a keeper has added this device's key.
|
|
173
|
+
*
|
|
174
|
+
* @param invite - The invitation a keeper sent.
|
|
175
|
+
*/
|
|
176
|
+
join(invite: string): Promise<void>;
|
|
177
|
+
/** @param peer - The lab's peer, or `null` to work with none. */
|
|
178
|
+
setPeer(peer: string | null): Promise<void>;
|
|
179
|
+
/** @param origin - The web address the lab publishes from, if it is not the peer's own. */
|
|
180
|
+
setOrigin(origin: string | null): Promise<void>;
|
|
181
|
+
/** Stop talking to the peer, until `goOnline`. The device goes on working. */
|
|
182
|
+
goOffline(): void;
|
|
183
|
+
/** Start talking to the peer again. */
|
|
184
|
+
goOnline(): void;
|
|
185
|
+
/** Add a device's key to the lab. Only a keeper may. */
|
|
186
|
+
addMember(who: {
|
|
187
|
+
key: string;
|
|
188
|
+
person: string;
|
|
189
|
+
role?: Role;
|
|
190
|
+
}): Promise<void>;
|
|
191
|
+
/** Add a part, by its sequence. */
|
|
192
|
+
addPart(part: {
|
|
193
|
+
name: string;
|
|
194
|
+
sequence: string;
|
|
195
|
+
circular?: boolean;
|
|
196
|
+
}): Promise<void>;
|
|
197
|
+
/** Add one physical item of a part. @returns The new item's ID. */
|
|
198
|
+
addItem(item: {
|
|
199
|
+
part: string;
|
|
200
|
+
amount: number;
|
|
201
|
+
unit?: string | null;
|
|
202
|
+
}): Promise<string>;
|
|
203
|
+
/** Add to or take from an item. `by` is a whole-number difference. */
|
|
204
|
+
adjust(change: {
|
|
205
|
+
item: string;
|
|
206
|
+
by: number;
|
|
207
|
+
}): Promise<void>;
|
|
208
|
+
/** Say how much of an item is physically there. */
|
|
209
|
+
recount(count: {
|
|
210
|
+
item: string;
|
|
211
|
+
amount: number;
|
|
212
|
+
}): Promise<void>;
|
|
213
|
+
/** Retire an item. It stays in the history. */
|
|
214
|
+
retire(which: {
|
|
215
|
+
item: string;
|
|
216
|
+
}): Promise<void>;
|
|
217
|
+
/** Say whether a part is on offer to other labs. */
|
|
218
|
+
offer(offer: {
|
|
219
|
+
part: string;
|
|
220
|
+
available: boolean;
|
|
221
|
+
}): Promise<void>;
|
|
222
|
+
/** Set one field on a part (by checksum) or an item (by ID). */
|
|
223
|
+
setField(change: {
|
|
224
|
+
on: "part" | "item";
|
|
225
|
+
id: string;
|
|
226
|
+
field: string;
|
|
227
|
+
value: string | number | null;
|
|
228
|
+
}): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Make one change: sign it into this device's log, keep it, and offer it to the peer.
|
|
231
|
+
*
|
|
232
|
+
* The change is tried before it is kept. A log is forever, so an entry the lab would refuse — a
|
|
233
|
+
* sequence that is not one, an item that does not exist — is turned down here, with the reason,
|
|
234
|
+
* and never written.
|
|
235
|
+
*
|
|
236
|
+
* @param op - The change.
|
|
237
|
+
* @throws If this device may not change the lab, or the lab would refuse the change.
|
|
238
|
+
*/
|
|
239
|
+
write(op: Operation): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Take entries that arrived from somewhere else.
|
|
242
|
+
*
|
|
243
|
+
* @param incoming - What arrived.
|
|
244
|
+
* @returns How many were kept.
|
|
245
|
+
*/
|
|
246
|
+
take(incoming: readonly unknown[]): Promise<number>;
|
|
247
|
+
/**
|
|
248
|
+
* Publish what the lab shows the world: sign the public inventory and hand it to the peer.
|
|
249
|
+
*
|
|
250
|
+
* The lab keeps pointing at whichever labs its published inventory already points at.
|
|
251
|
+
*
|
|
252
|
+
* @returns Whether it was published, why not if not, and how many parts it listed.
|
|
253
|
+
*/
|
|
254
|
+
publish(): Promise<{
|
|
255
|
+
ok: boolean;
|
|
256
|
+
reason: string | null;
|
|
257
|
+
parts: number;
|
|
258
|
+
}>;
|
|
259
|
+
/** Stop talking to the peer and finish with the store. */
|
|
260
|
+
close(): void;
|
|
261
|
+
private changed;
|
|
262
|
+
private remerge;
|
|
263
|
+
private connect;
|
|
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