@biolibs/bionet-client 0.0.0-stage → 0.2.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/lab.d.ts ADDED
@@ -0,0 +1,336 @@
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 Crowded, type EntryStatus, type ItemState, type Operation, type Overlap, type PartState, type PlaceState, 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
+ /** Every place. */
50
+ places: PlaceState[];
51
+ /** Positions the log says hold more than one item. */
52
+ crowded: Crowded[];
53
+ overlaps: Overlap[];
54
+ /** How many entries are waiting on others that have not arrived. */
55
+ waiting: number;
56
+ entries: EntryView[];
57
+ }
58
+ /** The connection to the lab's web peer, as a window shows it. */
59
+ export interface PeerView {
60
+ url: string | null;
61
+ /** The web address the lab's inventory is published at. */
62
+ origin: string | null;
63
+ /** What to send somebody who should join. */
64
+ invite: string | null;
65
+ status: LinkStatus;
66
+ problem: string | null;
67
+ /** How many changes made here the peer is not known to have. */
68
+ pending: number;
69
+ lastSynced: string | null;
70
+ }
71
+ /** Everything a window needs to draw, as plain data. */
72
+ export interface LabSnapshot {
73
+ device: {
74
+ key: string;
75
+ fingerprint: string;
76
+ person: string | null;
77
+ };
78
+ lab: LabView | null;
79
+ peer: PeerView;
80
+ /** When this device last published the lab's inventory. */
81
+ published: string | null;
82
+ }
83
+ /** What a device needs. */
84
+ export interface LabOptions {
85
+ /** Where to keep things. */
86
+ store: LabStore;
87
+ /** Where the device's key lives. */
88
+ keys: KeyKeeper;
89
+ /** Something to fetch the published inventory with. Defaults to the runtime's own `fetch`. */
90
+ fetch?: typeof globalThis.fetch;
91
+ /** Something to open sockets with. Defaults to the runtime's own `WebSocket`. */
92
+ WebSocket?: typeof globalThis.WebSocket;
93
+ }
94
+ /** @param peer - The peer's socket address. @returns The web address it serves from. */
95
+ export declare function originOf(peer: string): string;
96
+ /**
97
+ * Read an invitation: the peer's address, then `#`, then the lab's ID.
98
+ *
99
+ * @param invite - What a keeper sent.
100
+ * @returns Where the lab's peer is, and which lab.
101
+ * @throws If it is not an invitation.
102
+ */
103
+ export declare function readInvite(invite: string): {
104
+ peer: string;
105
+ lab: string;
106
+ };
107
+ /**
108
+ * One device in one lab.
109
+ *
110
+ * Make one with somewhere to keep things and somewhere to keep the key, `open()` it, and it is a
111
+ * working lab application: it makes the device's key if there is none, works the lab out from what
112
+ * is held, and starts talking to the lab's peer if it has one.
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * import { Lab, memoryKeys, memoryStore } from "@biolibs/bionet-client";
117
+ *
118
+ * const lab = await new Lab({ store: memoryStore(), keys: memoryKeys() }).open();
119
+ * await lab.setPerson("Ada");
120
+ * await lab.found({ name: "The Wren Lab" });
121
+ * lab.snapshot().lab?.keeper; // true
122
+ * ```
123
+ */
124
+ export declare class Lab {
125
+ private readonly options;
126
+ private readonly store;
127
+ private held;
128
+ private state;
129
+ private link;
130
+ private key;
131
+ private fingerprint;
132
+ private readonly fingerprints;
133
+ private readonly listeners;
134
+ private cached;
135
+ /** One change at a time, so two cannot both write the same place in the log. */
136
+ private turn;
137
+ constructor(options: LabOptions);
138
+ /**
139
+ * Load or make the device's key, and work the lab out from what is held.
140
+ *
141
+ * @returns This, ready.
142
+ */
143
+ open(): Promise<this>;
144
+ /**
145
+ * Be told whenever anything a window would draw has changed.
146
+ *
147
+ * @param listener - Called with nothing; ask `snapshot()` for what is new.
148
+ * @returns A function that stops the telling.
149
+ */
150
+ subscribe: (listener: () => void) => (() => void);
151
+ /**
152
+ * Everything a window needs to draw, as plain data. The same object is returned until something
153
+ * changes, so it can be compared by identity.
154
+ */
155
+ snapshot: () => LabSnapshot;
156
+ /** The lab this device is in, or `null`. */
157
+ get labId(): string | null;
158
+ /** What the person at this device is called, or `null` if they have not said. */
159
+ get person(): string | null;
160
+ /** The web address the lab's inventory is published at. */
161
+ get origin(): string | null;
162
+ /** What to send somebody who should join, or `null` if the lab has no peer to join through. */
163
+ get invite(): string | null;
164
+ /** @param name - What to call the person at this device. */
165
+ setPerson(name: string): Promise<void>;
166
+ /**
167
+ * Found a lab on this device. It works straight away, with or without a peer.
168
+ *
169
+ * @param about - What the lab is called, and its peer's address if it has one yet.
170
+ */
171
+ found(about: {
172
+ name: string;
173
+ peer?: string | null;
174
+ }): Promise<void>;
175
+ /**
176
+ * Join a lab somebody else founded. Nothing arrives until a keeper has added this device's key.
177
+ *
178
+ * @param invite - The invitation a keeper sent.
179
+ */
180
+ join(invite: string): Promise<void>;
181
+ /** @param peer - The lab's peer, or `null` to work with none. */
182
+ setPeer(peer: string | null): Promise<void>;
183
+ /** @param origin - The web address the lab publishes from, if it is not the peer's own. */
184
+ setOrigin(origin: string | null): Promise<void>;
185
+ /**
186
+ * Seal this device's key under a passphrase, to keep somewhere that is not this device.
187
+ *
188
+ * @param passphrase - What it will take to open it again. Nothing here remembers it.
189
+ * @returns The sealed key as text, to be written to a file. It holds nothing readable without the passphrase.
190
+ */
191
+ backUp(passphrase: string): Promise<string>;
192
+ /**
193
+ * Take up a key from a backup, in place of the one this device made for itself.
194
+ *
195
+ * This is for a new device standing in for a lost one, so it is refused once the device is in a
196
+ * lab: a key in use on two devices at once writes two histories under one name, and the lab
197
+ * cannot tell which is true.
198
+ *
199
+ * @param from - The text of the backup file, and the passphrase it was sealed under.
200
+ */
201
+ restore(from: {
202
+ backup: string;
203
+ passphrase: string;
204
+ }): Promise<void>;
205
+ /** Stop talking to the peer, until `goOnline`. The device goes on working. */
206
+ goOffline(): void;
207
+ /** Start talking to the peer again. */
208
+ goOnline(): void;
209
+ /** Add a device's key to the lab. Only a keeper may. */
210
+ addMember(who: {
211
+ key: string;
212
+ person: string;
213
+ role?: Role;
214
+ }): Promise<void>;
215
+ /** Add a part, by its sequence. */
216
+ addPart(part: {
217
+ name: string;
218
+ sequence: string;
219
+ circular?: boolean;
220
+ }): Promise<void>;
221
+ /** Add one physical item of a part. @returns The new item's ID. */
222
+ addItem(item: {
223
+ part: string;
224
+ amount: number;
225
+ unit?: string | null;
226
+ }): Promise<string>;
227
+ /** Add to or take from an item. `by` is a whole-number difference. */
228
+ adjust(change: {
229
+ item: string;
230
+ by: number;
231
+ }): Promise<void>;
232
+ /** Say how much of an item is physically there. */
233
+ recount(count: {
234
+ item: string;
235
+ amount: number;
236
+ }): Promise<void>;
237
+ /** Retire an item. It stays in the history. */
238
+ retire(which: {
239
+ item: string;
240
+ }): Promise<void>;
241
+ /** Say whether a part is on offer to other labs. */
242
+ offer(offer: {
243
+ part: string;
244
+ available: boolean;
245
+ }): Promise<void>;
246
+ /**
247
+ * Add a place: a room, a freezer, a shelf, a box.
248
+ *
249
+ * @param place - What kind it is, what it is called, the place it is in if any, and for a box how
250
+ * many rows and columns of positions it has.
251
+ * @returns The new place's ID.
252
+ */
253
+ addPlace(place: {
254
+ kind: string;
255
+ name: string;
256
+ parent?: string | null;
257
+ grid?: {
258
+ rows: number;
259
+ columns: number;
260
+ } | null;
261
+ }): Promise<string>;
262
+ /** Put a place inside another, or with `null` inside nothing. */
263
+ movePlace(move: {
264
+ place: string;
265
+ parent: string | null;
266
+ }): Promise<void>;
267
+ /**
268
+ * Say where a place stands and how big it is, in metres, or with `null` that nobody has said.
269
+ * It is kept to the millimetre.
270
+ */
271
+ standPlace(stand: {
272
+ place: string;
273
+ standing: {
274
+ position: [number, number, number];
275
+ size: [number, number, number];
276
+ turn?: 0 | 90 | 180 | 270;
277
+ } | null;
278
+ }): Promise<void>;
279
+ /** Retire a place. It stays in the history. */
280
+ retirePlace(which: {
281
+ place: string;
282
+ }): Promise<void>;
283
+ /** Say where an item is: which place, and which position if the place is a box. `null` for nowhere recorded. */
284
+ putItem(put: {
285
+ item: string;
286
+ place: string | null;
287
+ slot?: {
288
+ row: number;
289
+ column: number;
290
+ } | null;
291
+ }): Promise<void>;
292
+ /** Set one field on a part (by checksum), an item or a place (by ID). */
293
+ setField(change: {
294
+ on: "part" | "item" | "place";
295
+ id: string;
296
+ field: string;
297
+ value: string | number | null;
298
+ }): Promise<void>;
299
+ /**
300
+ * Make one change: sign it into this device's log, keep it, and offer it to the peer.
301
+ *
302
+ * The change is tried before it is kept. A log is forever, so an entry the lab would refuse — a
303
+ * sequence that is not one, an item that does not exist — is turned down here, with the reason,
304
+ * and never written.
305
+ *
306
+ * @param op - The change.
307
+ * @throws If this device may not change the lab, or the lab would refuse the change.
308
+ */
309
+ write(op: Operation): Promise<void>;
310
+ /**
311
+ * Take entries that arrived from somewhere else.
312
+ *
313
+ * @param incoming - What arrived.
314
+ * @returns How many were kept.
315
+ */
316
+ take(incoming: readonly unknown[]): Promise<number>;
317
+ /**
318
+ * Publish what the lab shows the world: sign the public inventory and hand it to the peer.
319
+ *
320
+ * The lab keeps pointing at whichever labs its published inventory already points at.
321
+ *
322
+ * @returns Whether it was published, why not if not, and how many parts it listed.
323
+ */
324
+ publish(): Promise<{
325
+ ok: boolean;
326
+ reason: string | null;
327
+ parts: number;
328
+ }>;
329
+ /** Stop talking to the peer and finish with the store. */
330
+ close(): void;
331
+ private changed;
332
+ private remerge;
333
+ private connect;
334
+ private inTurn;
335
+ }
336
+ //# sourceMappingURL=lab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lab.d.ts","sourceRoot":"","sources":["../src/lab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAGe,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAiB,KAAK,SAAS,EAAE,KAAK,OAAO,EACxG,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAoB,MAAM,iBAAiB,CAAC;AAI/G,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtD,mDAAmD;AACnD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,GAAG,EAAE,OAAO,CAAC;CACd;AAED,uCAAuC;AACvC,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,SAAS,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kDAA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