@agentshouse/mdruntime 0.1.0-ca6edc1abd618 → 0.1.0-ca92b54804c33
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 +2 -2
- package/dist/adapter.d.ts +101 -70
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +29 -47
- package/dist/bootstrap.d.ts +16 -14
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +272 -129
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/change.d.ts +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/client.d.ts +13 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +54 -6
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -17
- package/dist/compile.d.ts +1 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +108 -243
- package/dist/connection.d.ts +14 -11
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +2264 -1933
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation.d.ts +21 -17
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +405 -253
- package/dist/durability.d.ts +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- package/dist/file.d.ts +2 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +26 -29
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +12 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +28 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +62 -20
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +12 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +216 -85
- package/dist/messages.d.ts +3 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +20 -19
- package/dist/model.d.ts +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +5 -17
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +8 -3
- package/dist/outcome.d.ts +13 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +16 -2
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +11 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/query.d.ts +8 -207
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/reach.d.ts +18 -11
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +195 -126
- package/dist/react.d.ts +3 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +3 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +35 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +33 -5
- package/dist/replica.d.ts +10 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +52 -20
- package/dist/room-draft.d.ts +21 -5
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +98 -51
- package/dist/rows.d.ts +18 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +45 -153
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +22 -13
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- package/dist/status.d.ts +4 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- package/dist/store.d.ts +101 -61
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +153 -161
- package/dist/stored.d.ts +66 -55
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +341 -273
- package/dist/tables.d.ts +90 -63
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +174 -98
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +42 -100
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +17 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +5 -2
- package/package.json +2 -2
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -368
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -100
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -150
package/dist/save.js
CHANGED
|
@@ -4,7 +4,7 @@ import { immutable, leaving, queuedFile, departure, } from './change.js';
|
|
|
4
4
|
import { collectionOf, documentsOf, governing, } from './collection.js';
|
|
5
5
|
import { changeBatchIdentity } from './identity.js';
|
|
6
6
|
import { overlaying } from './overlay.js';
|
|
7
|
-
import { covered, normalize } from './paths.js';
|
|
7
|
+
import { ancestors, covered, normalize } from './paths.js';
|
|
8
8
|
import { sorting } from './shared.js';
|
|
9
9
|
import { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
10
10
|
import { validatedCollection } from './validation.js';
|
|
@@ -321,6 +321,8 @@ function* incoming(collection, removed, candidates) {
|
|
|
321
321
|
function affected(change) {
|
|
322
322
|
return change.kind === 'move' ? [change.path, change.to] : [change.path];
|
|
323
323
|
}
|
|
324
|
+
const WRITE = ['write'];
|
|
325
|
+
const MOVE_OUT = ['write', 'erase'];
|
|
324
326
|
function guard(changes, input, removing) {
|
|
325
327
|
const overridden = new Map();
|
|
326
328
|
const existing = {
|
|
@@ -329,6 +331,7 @@ function guard(changes, input, removing) {
|
|
|
329
331
|
add: (path) => void overridden.set(path, true),
|
|
330
332
|
delete: (path) => void overridden.set(path, false),
|
|
331
333
|
};
|
|
334
|
+
const occupied = (path) => input.folders.has(path) ? path : (ancestors(path).find((one) => existing.has(one)) ?? null);
|
|
332
335
|
for (const [index, change] of changes.entries()) {
|
|
333
336
|
for (const path of affected(change)) {
|
|
334
337
|
const normalized = normalize(path);
|
|
@@ -337,13 +340,14 @@ function guard(changes, input, removing) {
|
|
|
337
340
|
if (covered(input.providerOwnedPaths, normalized)) {
|
|
338
341
|
return refuse('provider-owned-path', normalized);
|
|
339
342
|
}
|
|
340
|
-
const operation
|
|
341
|
-
|
|
342
|
-
|
|
343
|
+
for (const operation of change.kind === 'remove' ? removing : WRITE)
|
|
344
|
+
if (!input.local && !covered(input.operations[operation], normalized))
|
|
345
|
+
return refuse(`${operation}-grant`, normalized);
|
|
343
346
|
}
|
|
344
347
|
if (change.kind === 'create' || change.kind === 'arrival') {
|
|
345
|
-
|
|
346
|
-
|
|
348
|
+
const taken = existing.has(change.path) ? change.path : occupied(change.path);
|
|
349
|
+
if (taken !== null)
|
|
350
|
+
return refuse('path-collision', taken);
|
|
347
351
|
existing.add(change.path);
|
|
348
352
|
continue;
|
|
349
353
|
}
|
|
@@ -353,6 +357,9 @@ function guard(changes, input, removing) {
|
|
|
353
357
|
input.bases.some((base) => base.kind === 'absent' && base.path === change.path))) {
|
|
354
358
|
return refuse('path-collision', change.path);
|
|
355
359
|
}
|
|
360
|
+
const taken = occupied(change.path);
|
|
361
|
+
if (taken !== null)
|
|
362
|
+
return refuse('path-collision', taken);
|
|
356
363
|
if (!input.local &&
|
|
357
364
|
existing.has(change.path) &&
|
|
358
365
|
input.visible.revisions[departure(changes, index)] === undefined) {
|
|
@@ -364,8 +371,9 @@ function guard(changes, input, removing) {
|
|
|
364
371
|
if (change.kind === 'move') {
|
|
365
372
|
if (!existing.has(change.path))
|
|
366
373
|
return refuse('path-absent', change.path);
|
|
367
|
-
|
|
368
|
-
|
|
374
|
+
const taken = existing.has(change.to) ? change.to : occupied(change.to);
|
|
375
|
+
if (taken !== null)
|
|
376
|
+
return refuse('path-collision', taken);
|
|
369
377
|
if (unrevised(input, change.path)) {
|
|
370
378
|
return refuse('unknown-revision', change.path);
|
|
371
379
|
}
|
|
@@ -968,7 +976,7 @@ function roomReferencesIn(path, content, composition) {
|
|
|
968
976
|
const parsed = parse(content, path);
|
|
969
977
|
if (!parsed.ok)
|
|
970
978
|
return [];
|
|
971
|
-
return roomReferences(
|
|
979
|
+
return roomReferences(parsed.document, definitionOf(governing(composition, path), parsed.document.type));
|
|
972
980
|
}
|
|
973
981
|
function* admittedRooms(changes, visible, resulting, composition) {
|
|
974
982
|
const from = new Map();
|
|
@@ -1014,7 +1022,7 @@ async function batching(input) {
|
|
|
1014
1022
|
const rewritten = await stepped(rewrites(changes, input.visible));
|
|
1015
1023
|
if (rewritten.kind === 'refused')
|
|
1016
1024
|
return rewritten;
|
|
1017
|
-
const refusal = guard(changes, input,
|
|
1025
|
+
const refusal = guard(changes, input, WRITE);
|
|
1018
1026
|
if (refusal !== null)
|
|
1019
1027
|
return refusal;
|
|
1020
1028
|
const preconditions = await stepped(preconditionsOf(changes, input.visible, input.bases));
|
|
@@ -1063,9 +1071,10 @@ function arrivingText(path, to, source, moved) {
|
|
|
1063
1071
|
return applied.outcome === 'applied' ? serialize(applied.document) : content;
|
|
1064
1072
|
}
|
|
1065
1073
|
function arrivalOf({ path, to }, source, moved) {
|
|
1066
|
-
const { documents, revisions, fileIds, changes, binaries } = source.visible;
|
|
1074
|
+
const { documents, revisions, fileIds, created, changes, binaries } = source.visible;
|
|
1067
1075
|
const kept = {
|
|
1068
1076
|
...(fileIds[path] === undefined ? {} : { fileId: fileIds[path] }),
|
|
1077
|
+
...(created[path] === undefined ? {} : { created: created[path] }),
|
|
1069
1078
|
...(changes[path] === undefined ? {} : { change: changes[path] }),
|
|
1070
1079
|
};
|
|
1071
1080
|
const heads = {
|
|
@@ -1095,7 +1104,7 @@ async function moving(input) {
|
|
|
1095
1104
|
if (moves.length === 0)
|
|
1096
1105
|
return refuse('no-change');
|
|
1097
1106
|
const removals = moves.map(({ path }) => ({ kind: 'remove', path }));
|
|
1098
|
-
const leaves = guard(removals, { ...source, local: input.local, bases: [] },
|
|
1107
|
+
const leaves = guard(removals, { ...source, local: input.local, bases: [] }, MOVE_OUT);
|
|
1099
1108
|
if (leaves !== null)
|
|
1100
1109
|
return leaves;
|
|
1101
1110
|
const uploading = moves.find(({ path }) => source.visible.binaries[path]?.state === 'pending');
|
|
@@ -1103,7 +1112,7 @@ async function moving(input) {
|
|
|
1103
1112
|
return refuse('unknown-revision', uploading.path);
|
|
1104
1113
|
const moved = new Map(moves.map(({ path, to }) => [path, to]));
|
|
1105
1114
|
const arrivals = moves.map((move) => arrivalOf(move, source, moved));
|
|
1106
|
-
const arrives = guard(arrivals, { ...destination, local: input.local, bases: [] },
|
|
1115
|
+
const arrives = guard(arrivals, { ...destination, local: input.local, bases: [] }, WRITE);
|
|
1107
1116
|
if (arrives !== null)
|
|
1108
1117
|
return arrives;
|
|
1109
1118
|
const bound = input.providerLimits.find((limit) => limit.name === MOVE_DOCUMENTS)?.value;
|
package/dist/search.d.ts
CHANGED
|
@@ -1,73 +1,22 @@
|
|
|
1
|
-
import type { ProviderRefusal } from './adapter.js';
|
|
2
|
-
import
|
|
3
|
-
import type { Open } from './open.js';
|
|
4
|
-
export type DocumentPart = Open<'fields' | 'sections' | 'preamble' | 'path'>;
|
|
1
|
+
import type { ProviderRefusal, SearchHit } from './adapter.js';
|
|
2
|
+
import type { Failure, Offline } from './outcome.js';
|
|
5
3
|
export type SearchRequest = {
|
|
6
4
|
text: string;
|
|
7
|
-
|
|
8
|
-
collection?: true;
|
|
9
|
-
conversations?: readonly string[];
|
|
10
|
-
limit?: number;
|
|
11
|
-
after?: string;
|
|
12
|
-
total?: true;
|
|
5
|
+
rooms?: readonly string[];
|
|
13
6
|
};
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
at: readonly [number, number];
|
|
19
|
-
};
|
|
20
|
-
export type DocumentHit = {
|
|
21
|
-
room: string;
|
|
22
|
-
path: string;
|
|
23
|
-
type: string;
|
|
24
|
-
score: number;
|
|
25
|
-
matches: Readonly<Record<string, readonly DocumentPart[]>>;
|
|
26
|
-
snippet?: Snippet<DocumentPart>;
|
|
27
|
-
};
|
|
28
|
-
export type MessageHit = {
|
|
29
|
-
conversation: string;
|
|
30
|
-
identity: string;
|
|
31
|
-
score: number;
|
|
32
|
-
matches: Readonly<Record<string, readonly MessagePart[]>>;
|
|
33
|
-
snippet?: Snippet<MessagePart>;
|
|
34
|
-
};
|
|
35
|
-
export type SearchCoverage = {
|
|
36
|
-
rooms: readonly CoveredRoom[];
|
|
37
|
-
conversations: readonly string[];
|
|
38
|
-
overlay: readonly string[];
|
|
7
|
+
export type { SearchHit } from './adapter.js';
|
|
8
|
+
export type SearchFound = {
|
|
9
|
+
kind: 'found';
|
|
10
|
+
documents: readonly SearchHit[];
|
|
39
11
|
};
|
|
40
|
-
export type
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
export type SearchWindow = SearchHits & {
|
|
45
|
-
next?: string;
|
|
46
|
-
total?: {
|
|
47
|
-
documents: number;
|
|
48
|
-
messages: number;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export type SearchPending = SearchHits & {
|
|
52
|
-
pending: readonly PendingRoom[];
|
|
53
|
-
coverage: SearchCoverage;
|
|
54
|
-
};
|
|
55
|
-
export type SearchUndeclared = ProviderRefusal & {
|
|
12
|
+
export type SearchResult = SearchFound | Offline | (ProviderRefusal & {
|
|
13
|
+
kind: 'rejected';
|
|
14
|
+
}) | (ProviderRefusal & {
|
|
56
15
|
kind: 'undeclared';
|
|
57
|
-
};
|
|
58
|
-
export type SearchResult = (SearchWindow & {
|
|
59
|
-
coverage: SearchCoverage;
|
|
60
|
-
}) | SearchPending | SearchUndeclared;
|
|
61
|
-
export declare function undeclaredSearch(): SearchUndeclared;
|
|
62
|
-
export type HitCursor = readonly [number, string, string] | readonly [] | null;
|
|
16
|
+
}) | Failure;
|
|
63
17
|
export type SearchPlan = {
|
|
64
18
|
text: string;
|
|
65
|
-
|
|
66
|
-
collection: boolean;
|
|
67
|
-
conversations: readonly string[] | null;
|
|
68
|
-
limit: number | null;
|
|
69
|
-
after: readonly [HitCursor, HitCursor] | null;
|
|
70
|
-
total: boolean;
|
|
19
|
+
rooms: readonly string[] | null;
|
|
71
20
|
};
|
|
72
21
|
export declare function searchPlanOf(input: unknown): SearchPlan;
|
|
73
22
|
//# sourceMappingURL=search.d.ts.map
|
package/dist/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAExE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,CAAC;AAE7E,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,OAAO,GACP,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACxC,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAC1C,OAAO,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAE3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAYvD"}
|
package/dist/search.js
CHANGED
|
@@ -1,57 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { decodedCursor } from './windows.js';
|
|
3
|
-
export function undeclaredSearch() {
|
|
4
|
-
return {
|
|
5
|
-
kind: 'undeclared',
|
|
6
|
-
code: 'search-undeclared',
|
|
7
|
-
fields: { name: 'local_search' },
|
|
8
|
-
retryable: false,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function hitCursor(input) {
|
|
12
|
-
if (input === null)
|
|
13
|
-
return null;
|
|
14
|
-
if (!Array.isArray(input))
|
|
15
|
-
return undefined;
|
|
16
|
-
if (input.length === 0)
|
|
17
|
-
return [];
|
|
18
|
-
const [score, first, second] = input;
|
|
19
|
-
return input.length === 3 &&
|
|
20
|
-
typeof score === 'number' &&
|
|
21
|
-
typeof first === 'string' &&
|
|
22
|
-
typeof second === 'string'
|
|
23
|
-
? [score, first, second]
|
|
24
|
-
: undefined;
|
|
25
|
-
}
|
|
26
|
-
function searchAfter(input) {
|
|
27
|
-
if (input === undefined)
|
|
28
|
-
return null;
|
|
29
|
-
const decoded = typeof input === 'string' ? decodedCursor(input) : null;
|
|
30
|
-
const documents = decoded?.length === 2 ? hitCursor(decoded[0]) : undefined;
|
|
31
|
-
const messages = decoded?.length === 2 ? hitCursor(decoded[1]) : undefined;
|
|
32
|
-
if (documents === undefined || messages === undefined) {
|
|
33
|
-
invalid('after', 'expects the next an earlier search returned');
|
|
34
|
-
}
|
|
35
|
-
return [documents, messages];
|
|
36
|
-
}
|
|
1
|
+
import { invalid, known, plain } from '@agentshouse/mdmodel';
|
|
37
2
|
export function searchPlanOf(input) {
|
|
38
3
|
if (!plain(input))
|
|
39
4
|
invalid('search', 'expects a search object');
|
|
40
|
-
known(input, ['text', '
|
|
41
|
-
if (typeof input.text !== 'string')
|
|
42
|
-
invalid('text', 'expects
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
(!Array.isArray(
|
|
46
|
-
invalid('
|
|
5
|
+
known(input, ['text', 'rooms'], '');
|
|
6
|
+
if (typeof input.text !== 'string' || input.text.trim() === '')
|
|
7
|
+
invalid('text', 'expects words');
|
|
8
|
+
const rooms = input.rooms;
|
|
9
|
+
if (rooms !== undefined &&
|
|
10
|
+
(!Array.isArray(rooms) || rooms.some((named) => typeof named !== 'string'))) {
|
|
11
|
+
invalid('rooms', 'expects a list of Rooms');
|
|
47
12
|
}
|
|
48
|
-
return {
|
|
49
|
-
text: input.text,
|
|
50
|
-
documents: input.documents,
|
|
51
|
-
collection: flag(input.collection, 'collection'),
|
|
52
|
-
conversations: conversations ?? null,
|
|
53
|
-
limit: limitOf(input.limit),
|
|
54
|
-
after: searchAfter(input.after),
|
|
55
|
-
total: flag(input.total, 'total'),
|
|
56
|
-
};
|
|
13
|
+
return { text: input.text, rooms: rooms ?? null };
|
|
57
14
|
}
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type Paths<V> = Readonly<Record<string, V>>;
|
|
2
2
|
export declare function entriesIn<V>(map: Paths<V>): Generator<readonly [string, V]>;
|
|
3
|
-
export declare function keysIn(...maps: readonly Paths<unknown>[]): Generator<number, Set<string>, void>;
|
|
4
3
|
export declare function sortedKeys(map: Paths<unknown>): Generator<number, readonly string[], void>;
|
|
5
4
|
export declare function sorting(keys: Iterable<string>): Generator<number, readonly string[], void>;
|
|
6
5
|
export declare function sharing<V>(map: Paths<V>): Generator<number, Paths<V>, void>;
|
package/dist/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AA+LnD,wBAAiB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAO5E;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AA+LnD,wBAAiB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAO5E;AAuCD,wBAAiB,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,CAE3F;AAED,wBAAiB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,CAoB3F;AAED,wBAAiB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAE5E;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAEjD;AAED,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EACnC,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAM,GAC7B,KAAK,CAAC,CAAC,CAAC,CAEV;AAED,wBAAiB,QAAQ,CAAC,CAAC,EACzB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EACnC,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAM,GAC7B,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAoBnC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAE/C;AA8CD,wBAAiB,WAAW,CAAC,CAAC,EAC5B,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,IAAI,GAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAmB,GAC/C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAkB9C;AAED,wBAAgB,SAAS,CAAC,CAAC,EACzB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,IAAI,GAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAmB,GAC/C,WAAW,CAAC,MAAM,CAAC,CAErB;AAMD,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAiD5D;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAE7D;AAED,wBAAiB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAUxF"}
|
package/dist/shared.js
CHANGED
|
@@ -202,16 +202,6 @@ function* rooted(map) {
|
|
|
202
202
|
}
|
|
203
203
|
return { node, size };
|
|
204
204
|
}
|
|
205
|
-
export function* keysIn(...maps) {
|
|
206
|
-
const keys = new Set();
|
|
207
|
-
for (const map of maps) {
|
|
208
|
-
for (const [key] of entriesIn(map)) {
|
|
209
|
-
keys.add(key);
|
|
210
|
-
yield ROW_WEIGHT;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return keys;
|
|
214
|
-
}
|
|
215
205
|
const RUN = 1 << 10;
|
|
216
206
|
function* merged(left, right) {
|
|
217
207
|
const into = [];
|
package/dist/status.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { Open } from './open.js';
|
|
2
|
-
import type { ProviderRefusal } from './adapter.js';
|
|
3
2
|
import type { ReturnReason } from './room-draft.js';
|
|
4
3
|
export type AttentionEntry = {
|
|
5
4
|
room: string;
|
|
6
5
|
path: string;
|
|
7
6
|
returned: ReturnReason;
|
|
8
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export type UnsentChange = {
|
|
9
9
|
room: string;
|
|
10
|
-
|
|
10
|
+
path: string;
|
|
11
11
|
};
|
|
12
12
|
export type SyncStatus = {
|
|
13
13
|
state: Open<'pending' | 'syncing' | 'synced'>;
|
|
14
14
|
lastCompleted: string | null;
|
|
15
15
|
providerUnreachable: boolean;
|
|
16
16
|
attentionRequired: readonly AttentionEntry[];
|
|
17
|
+
unsent: readonly UnsentChange[];
|
|
17
18
|
reset: string | null;
|
|
18
19
|
};
|
|
19
20
|
export type CycleProgress = {
|
|
@@ -21,7 +22,5 @@ export type CycleProgress = {
|
|
|
21
22
|
reachable: boolean;
|
|
22
23
|
};
|
|
23
24
|
export declare const STARTING: SyncStatus;
|
|
24
|
-
export declare function transferring(status: SyncStatus): SyncStatus;
|
|
25
|
-
export declare function saving(status: SyncStatus): SyncStatus;
|
|
26
25
|
export declare function same(one: SyncStatus, other: SyncStatus): boolean;
|
|
27
26
|
//# sourceMappingURL=status.d.ts.map
|
package/dist/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,CAAC;IAC9C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,UAOtB,CAAC;AAEF,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAShE"}
|
package/dist/status.js
CHANGED
|
@@ -3,18 +3,14 @@ export const STARTING = {
|
|
|
3
3
|
lastCompleted: null,
|
|
4
4
|
providerUnreachable: false,
|
|
5
5
|
attentionRequired: [],
|
|
6
|
+
unsent: [],
|
|
6
7
|
reset: null,
|
|
7
8
|
};
|
|
8
|
-
export function transferring(status) {
|
|
9
|
-
return { ...status, state: 'syncing' };
|
|
10
|
-
}
|
|
11
|
-
export function saving(status) {
|
|
12
|
-
return { ...status, state: 'pending' };
|
|
13
|
-
}
|
|
14
9
|
export function same(one, other) {
|
|
15
10
|
return (one.state === other.state &&
|
|
16
11
|
one.lastCompleted === other.lastCompleted &&
|
|
17
12
|
one.providerUnreachable === other.providerUnreachable &&
|
|
18
13
|
one.reset === other.reset &&
|
|
19
|
-
JSON.stringify(one.attentionRequired) === JSON.stringify(other.attentionRequired)
|
|
14
|
+
JSON.stringify(one.attentionRequired) === JSON.stringify(other.attentionRequired) &&
|
|
15
|
+
JSON.stringify(one.unsent) === JSON.stringify(other.unsent));
|
|
20
16
|
}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
import type { BootstrapInventory, Capability,
|
|
1
|
+
import type { BootstrapInventory, Capability, ListedConversation, Member, ProviderLimit } from './adapter.js';
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type Composition } from './collection.js';
|
|
4
4
|
import type { Plan } from './query.js';
|
|
5
5
|
import type { ReplicaRecord } from './replica.js';
|
|
6
6
|
import type { Submission } from './outcome.js';
|
|
7
7
|
import type { RoomDraftRecord, SavedDraft } from './room-draft.js';
|
|
8
|
-
import type { ModelState } from './model.js';
|
|
9
|
-
import type {
|
|
10
|
-
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, SearchAsk, StoredEntry, StoredFile, TypedEntry, View, Walked } from './tables.js';
|
|
8
|
+
import type { ModelState, StoredModel } from './model.js';
|
|
9
|
+
import type { CommittedWrite, ConversationWrite, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, ReplicaOpened, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, TypedEntry, View } from './tables.js';
|
|
11
10
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './tables.js';
|
|
12
|
-
export type TransferWriting = {
|
|
13
|
-
readonly token: string | null;
|
|
14
|
-
readonly written: number;
|
|
15
|
-
};
|
|
16
11
|
export type TransferRecord = {
|
|
17
12
|
readonly locator: string;
|
|
18
13
|
readonly transfer: string;
|
|
19
14
|
readonly selection: string;
|
|
20
15
|
readonly from: string;
|
|
21
16
|
readonly last: string;
|
|
22
|
-
readonly pageToken: string | null;
|
|
23
|
-
readonly writing: TransferWriting | null;
|
|
24
|
-
readonly inventory: BootstrapInventory | null;
|
|
25
17
|
readonly done: BootstrapInventory;
|
|
26
18
|
readonly models: {
|
|
27
19
|
readonly collection: ModelState;
|
|
28
20
|
};
|
|
29
21
|
readonly key: number | null;
|
|
30
22
|
};
|
|
23
|
+
export type StoredReplica = Omit<ReplicaRecord, 'model'> & {
|
|
24
|
+
readonly model: StoredModel;
|
|
25
|
+
};
|
|
31
26
|
export type PendingState = {
|
|
32
27
|
readonly drafts: readonly SavedDraft[];
|
|
33
28
|
readonly submission: Submission;
|
|
34
29
|
readonly lost: boolean;
|
|
35
30
|
readonly upload?: unknown;
|
|
36
|
-
readonly accepted?: string;
|
|
37
31
|
};
|
|
38
32
|
export type TargetRecord = {
|
|
39
33
|
established: boolean;
|
|
40
34
|
};
|
|
41
|
-
export type QueueRecord = {
|
|
42
|
-
locator: string;
|
|
43
|
-
pending: readonly {
|
|
44
|
-
batch: ChangeBatch;
|
|
45
|
-
state: PendingState;
|
|
46
|
-
}[];
|
|
47
|
-
};
|
|
48
35
|
export type PresentationRecord = {
|
|
49
36
|
app: string;
|
|
50
37
|
value: unknown;
|
|
@@ -69,83 +56,143 @@ export type CallRecord = {
|
|
|
69
56
|
export type AuthoredWrite = {
|
|
70
57
|
locator: string;
|
|
71
58
|
queue?: readonly ChangeBatch[];
|
|
59
|
+
stored?: readonly ChangeBatch[];
|
|
72
60
|
founded?: readonly ChangeBatch[];
|
|
73
61
|
saved?: ReadonlyMap<string, readonly SavedDraft[]>;
|
|
74
62
|
roomDrafts?: readonly RoomDraftRecord[];
|
|
75
63
|
consumedRoomDrafts?: readonly string[];
|
|
76
|
-
accepted?: readonly {
|
|
77
|
-
readonly id: string;
|
|
78
|
-
readonly roomVersion: string;
|
|
79
|
-
}[];
|
|
80
64
|
};
|
|
81
65
|
export type StagedPage = {
|
|
82
66
|
readonly entries: readonly StoredEntry[];
|
|
83
67
|
readonly folders: readonly string[];
|
|
68
|
+
readonly part?: string;
|
|
69
|
+
};
|
|
70
|
+
export type ResumedTransfer = {
|
|
71
|
+
readonly key: number | null;
|
|
72
|
+
readonly transfer: string;
|
|
73
|
+
readonly staged: readonly string[];
|
|
84
74
|
};
|
|
85
75
|
export type RefreshedPage = StagedPage & {
|
|
86
76
|
readonly removals: readonly string[];
|
|
87
77
|
readonly folderRemovals: readonly string[];
|
|
88
78
|
};
|
|
89
|
-
export type
|
|
90
|
-
readonly
|
|
91
|
-
readonly
|
|
92
|
-
readonly
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
readonly
|
|
79
|
+
export type HeldRoom = {
|
|
80
|
+
readonly record: StoredReplica;
|
|
81
|
+
readonly indexed: boolean;
|
|
82
|
+
readonly documents: number;
|
|
83
|
+
};
|
|
84
|
+
export type QueuedChange = {
|
|
85
|
+
readonly batch: ChangeBatch;
|
|
86
|
+
readonly state: PendingState;
|
|
87
|
+
};
|
|
88
|
+
export type HeldWork = {
|
|
89
|
+
readonly room: (HeldRoom & {
|
|
90
|
+
readonly overlaid: ReadonlySet<string>;
|
|
91
|
+
}) | null;
|
|
92
|
+
readonly queue: readonly QueuedChange[];
|
|
93
|
+
};
|
|
94
|
+
export type CoveredRoom = {
|
|
95
|
+
readonly key: number;
|
|
96
|
+
readonly transfer: string;
|
|
97
|
+
readonly roomVersion: string;
|
|
98
|
+
readonly indexed: boolean;
|
|
99
|
+
readonly documents: number;
|
|
100
|
+
readonly bytes: number;
|
|
101
|
+
readonly offline: string;
|
|
102
|
+
};
|
|
103
|
+
export type HeldCover = {
|
|
104
|
+
readonly rooms: ReadonlyMap<string, CoveredRoom>;
|
|
105
|
+
readonly queues: ReadonlyMap<string, readonly string[]>;
|
|
106
|
+
};
|
|
107
|
+
export type HeldStatus = {
|
|
108
|
+
readonly queued: readonly string[];
|
|
109
|
+
readonly lastCompleted: string | null;
|
|
110
|
+
readonly unsent: readonly {
|
|
111
|
+
readonly room: string;
|
|
112
|
+
readonly path: string;
|
|
113
|
+
}[];
|
|
114
|
+
readonly resets: readonly {
|
|
115
|
+
readonly locator: string;
|
|
116
|
+
readonly reset: string;
|
|
117
|
+
}[];
|
|
118
|
+
readonly returned: readonly RoomDraftRecord[];
|
|
119
|
+
};
|
|
120
|
+
export type Facts = {
|
|
96
121
|
readonly lastCompleted: string | null;
|
|
97
122
|
readonly providerLimits: readonly ProviderLimit[];
|
|
98
123
|
readonly capabilities: readonly Capability[];
|
|
99
124
|
readonly member: Member | null;
|
|
100
125
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
101
|
-
readonly
|
|
126
|
+
readonly conversationList: readonly ListedConversation[] | null;
|
|
127
|
+
readonly conversationCursor: string | null;
|
|
102
128
|
};
|
|
103
129
|
export type Commit = {
|
|
104
130
|
readonly rooms: readonly RoomCommit[];
|
|
105
131
|
readonly writes?: readonly AuthoredWrite[];
|
|
106
132
|
readonly files?: readonly StoredFile[];
|
|
107
133
|
readonly whole?: boolean;
|
|
108
|
-
readonly discards?: readonly string[];
|
|
109
134
|
};
|
|
110
135
|
export type RuntimeStore = {
|
|
111
|
-
opened(): Promise<
|
|
112
|
-
|
|
136
|
+
opened(): Promise<ReplicaOpened>;
|
|
137
|
+
rooms(locators?: readonly string[]): Promise<readonly HeldRoom[]>;
|
|
138
|
+
room(locator: string): Promise<HeldWork>;
|
|
139
|
+
covering(): Promise<HeldCover>;
|
|
140
|
+
offline(locator: string): Promise<string | null>;
|
|
141
|
+
held(): Promise<{
|
|
142
|
+
readonly held: ReadonlySet<string>;
|
|
143
|
+
readonly staged: ReadonlySet<string>;
|
|
144
|
+
}>;
|
|
145
|
+
status(): Promise<HeldStatus>;
|
|
146
|
+
batch(locator: string, id: string): Promise<ChangeBatch | null>;
|
|
147
|
+
order(locator: string): Promise<readonly string[]>;
|
|
148
|
+
queued(): Promise<readonly string[]>;
|
|
149
|
+
moving(): Promise<{
|
|
150
|
+
readonly queued: ReadonlyMap<string, readonly string[]>;
|
|
151
|
+
readonly moving: readonly (QueuedChange & {
|
|
152
|
+
readonly locator: string;
|
|
153
|
+
})[];
|
|
154
|
+
}>;
|
|
155
|
+
pending(locator: string, id: string): Promise<{
|
|
156
|
+
readonly state: PendingState | undefined;
|
|
157
|
+
readonly room: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
facts(): Promise<Facts>;
|
|
160
|
+
presentation(app: string): Promise<unknown>;
|
|
161
|
+
demote(): Promise<void>;
|
|
113
162
|
query(plan: Plan, rooms: readonly QueryRoom[], budget: number | null): Promise<QueryAnswer>;
|
|
114
163
|
changes(keys: readonly number[]): number;
|
|
115
164
|
entries(key: number, view: View, paths: readonly string[]): Promise<readonly HeldEntry[]>;
|
|
116
165
|
typed(key: number, view: View, paths: readonly string[]): Promise<readonly TypedEntry[]>;
|
|
117
|
-
referrers(key: number, view: View, targets: readonly string[]
|
|
118
|
-
|
|
119
|
-
files(key: number, view: View, after: string | null, limit: number): Promise<readonly {
|
|
120
|
-
readonly path: string;
|
|
121
|
-
readonly revision: string;
|
|
122
|
-
}[]>;
|
|
166
|
+
referrers(key: number, view: View, targets: readonly string[]): Promise<readonly Referrer[]>;
|
|
167
|
+
folders(key: number, view: View, paths: readonly string[]): Promise<readonly string[]>;
|
|
123
168
|
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
keepPart(locator: string, token: string, part: Uint8Array): Promise<void>;
|
|
128
|
-
refresh(key: number, page: RefreshedPage): Promise<void>;
|
|
169
|
+
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
170
|
+
resume(record: TransferRecord, composition: Composition, parts: readonly string[], published: number | null): Promise<ResumedTransfer | null>;
|
|
171
|
+
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
129
172
|
unrefresh(key: number): Promise<void>;
|
|
130
173
|
commit(commit: Commit): Promise<CommittedWrite>;
|
|
131
174
|
fence(locators: readonly string[]): Promise<void>;
|
|
132
175
|
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
133
|
-
abandon(locator: string
|
|
176
|
+
abandon(locator: string): Promise<void>;
|
|
177
|
+
unfence(locators: readonly string[]): Promise<ReadonlySet<string>>;
|
|
134
178
|
release(key: number): Promise<void>;
|
|
135
|
-
rederive(key: number,
|
|
179
|
+
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
180
|
+
readonly done: boolean;
|
|
181
|
+
readonly text: number;
|
|
182
|
+
}>;
|
|
136
183
|
fact(name: string, value: unknown): Promise<void>;
|
|
137
|
-
queues(): Promise<readonly QueueRecord[]>;
|
|
138
184
|
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
139
185
|
keepUpload(locator: string, id: string, upload: unknown): Promise<void>;
|
|
140
|
-
roomDrafts(): Promise<readonly RoomDraftRecord[]>;
|
|
186
|
+
roomDrafts(locator?: string, paths?: readonly string[]): Promise<readonly RoomDraftRecord[]>;
|
|
141
187
|
present(record: PresentationRecord): Promise<void>;
|
|
142
|
-
conversations(): Promise<readonly HeldConversation[]>;
|
|
188
|
+
conversations(conversations?: readonly string[]): Promise<readonly HeldConversation[]>;
|
|
143
189
|
keepMessages(write: ConversationWrite): Promise<void>;
|
|
144
|
-
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null): Promise<MessageWindow>;
|
|
145
|
-
messageCount(conversation: string): Promise<number>;
|
|
190
|
+
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null, phrase?: string | null): Promise<MessageWindow>;
|
|
191
|
+
messageCount(conversation: string, phrase?: string | null): Promise<number>;
|
|
146
192
|
turnArrived(conversation: string, turn: string): Promise<boolean>;
|
|
147
193
|
dropConversations(conversations: readonly string[]): Promise<void>;
|
|
148
194
|
chatDrafts(): Promise<readonly ChatDraftRecord[]>;
|
|
195
|
+
chatDraft(conversation: string): Promise<ChatDraftRecord | null>;
|
|
149
196
|
keepChatDrafts(records: readonly ChatDraftRecord[]): Promise<void>;
|
|
150
197
|
dropChatDraft(conversation: string): Promise<void>;
|
|
151
198
|
calls(): Promise<readonly CallRecord[]>;
|
|
@@ -154,16 +201,9 @@ export type RuntimeStore = {
|
|
|
154
201
|
keepRoomDraft(record: RoomDraftRecord, files: readonly StoredFile[]): Promise<void>;
|
|
155
202
|
discardRoomDraft(locator: string, path: string): Promise<void>;
|
|
156
203
|
fences(): Promise<readonly string[]>;
|
|
157
|
-
receivedHeads(): Promise<readonly KeptReceipt[]>;
|
|
158
|
-
receivedParts(key: string, count: number): Promise<readonly unknown[]>;
|
|
159
|
-
keepReceived(key: string, head: unknown, part?: {
|
|
160
|
-
index: number;
|
|
161
|
-
value: unknown;
|
|
162
|
-
}): Promise<void>;
|
|
163
|
-
dropReceived(keys: readonly string[]): Promise<void>;
|
|
164
204
|
generation(): Promise<string | null>;
|
|
165
205
|
rememberGeneration(value: string): Promise<void>;
|
|
166
206
|
file(key: string, type: string): Promise<Blob>;
|
|
167
207
|
};
|
|
168
|
-
export declare function openRuntimeStore(
|
|
208
|
+
export declare function openRuntimeStore(authored: RuntimeDatabase): RuntimeStore;
|
|
169
209
|
//# sourceMappingURL=store.d.ts.map
|