@agentshouse/mdruntime 0.1.0-c49444f2a8fc6 → 0.1.0-c4c5934c45f21
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 +8 -8
- package/dist/acceptance.d.ts +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +308 -0
- package/dist/act-lanes.d.ts +33 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +177 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +251 -0
- package/dist/adapter.d.ts +31 -44
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -18
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +4 -2
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +19 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +30 -14
- package/dist/collection.d.ts +22 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +12 -2
- package/dist/compile.d.ts +5 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +200 -75
- package/dist/connection.d.ts +5 -143
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +104 -5308
- package/dist/conversation-live.d.ts +136 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +249 -0
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +7 -1
- package/dist/conversation.d.ts +43 -44
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +906 -1024
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +148 -0
- package/dist/durability.d.ts +9 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/expectation.d.ts +4 -2
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +33 -11
- package/dist/failure.d.ts +1 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -0
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +18 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +45 -12
- package/dist/index.d.ts +22 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/install.d.ts +54 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +538 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +272 -0
- package/dist/listing.d.ts +48 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +139 -0
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +3 -3
- package/dist/locks.d.ts +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +33 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +50 -0
- package/dist/media.d.ts +1 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +4 -4
- package/dist/memory.d.ts +4 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +38 -20
- package/dist/messages.d.ts +1 -4
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +14 -32
- package/dist/model.d.ts +0 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -5
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +156 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +12 -17
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +59 -0
- package/dist/outcome.d.ts +4 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +3 -0
- package/dist/overlay.d.ts +2 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +32 -21
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +3 -51
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +14 -111
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +233 -0
- package/dist/presence.d.ts +52 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +220 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +270 -0
- package/dist/query.d.ts +10 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +2 -0
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +5 -1
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +455 -0
- package/dist/reach.d.ts +3 -1
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +38 -8
- package/dist/react.d.ts +18 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +15 -1
- package/dist/readiness.d.ts +0 -1
- package/dist/readiness.d.ts.map +1 -1
- package/dist/reads.d.ts +37 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +174 -0
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +57 -0
- package/dist/replica.d.ts +5 -13
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +15 -16
- package/dist/room-draft.d.ts +4 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +36 -52
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +217 -0
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -4
- package/dist/runtime.d.ts +34 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +41 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +232 -112
- package/dist/saves.d.ts +32 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +413 -0
- package/dist/seed.d.ts +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -1
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +32 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +290 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/session.d.ts +38 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +67 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +170 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +5 -4
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +430 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- package/dist/store/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +112 -204
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +158 -394
- package/dist/stored.d.ts +1 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +28 -14
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +223 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +521 -0
- package/dist/tables.d.ts +32 -8
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +43 -12
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/wire.d.ts +48 -5
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +16 -3
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function createRoomHeld() {
|
|
2
|
+
const rooms = new Map();
|
|
3
|
+
return {
|
|
4
|
+
of: (locator, key) => rooms.get(locator)?.get(key),
|
|
5
|
+
hold(locator, key, value) {
|
|
6
|
+
const room = rooms.get(locator) ?? new Map();
|
|
7
|
+
room.set(key, value);
|
|
8
|
+
rooms.set(locator, room);
|
|
9
|
+
},
|
|
10
|
+
drop(locator, key) {
|
|
11
|
+
rooms.get(locator)?.delete(key);
|
|
12
|
+
},
|
|
13
|
+
forget(locator) {
|
|
14
|
+
rooms.delete(locator);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RuntimeDatabase } from '../tables.js';
|
|
2
|
+
export type Space = {
|
|
3
|
+
full(): boolean;
|
|
4
|
+
fill(): boolean;
|
|
5
|
+
probing(): boolean;
|
|
6
|
+
probeEachMinute(): void;
|
|
7
|
+
probe(): Promise<void>;
|
|
8
|
+
stop(): void;
|
|
9
|
+
};
|
|
10
|
+
export declare function createSpace(database: RuntimeDatabase, freed: () => void): Space;
|
|
11
|
+
//# sourceMappingURL=space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/store/space.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,IAAI,OAAO,CAAC;IAChB,IAAI,IAAI,OAAO,CAAC;IAChB,OAAO,IAAI,OAAO,CAAC;IACnB,eAAe,IAAI,IAAI,CAAC;IACxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,IAAI,CAAC;CACd,CAAC;AAEF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,KAAK,CA0C/E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function createSpace(database, freed) {
|
|
2
|
+
let full = false;
|
|
3
|
+
let probing = null;
|
|
4
|
+
let testing = null;
|
|
5
|
+
function probe() {
|
|
6
|
+
testing ??= database.ask({ kind: 'space.probe' }).then(() => {
|
|
7
|
+
testing = null;
|
|
8
|
+
if (full) {
|
|
9
|
+
full = false;
|
|
10
|
+
if (probing !== null)
|
|
11
|
+
clearInterval(probing);
|
|
12
|
+
probing = null;
|
|
13
|
+
freed();
|
|
14
|
+
}
|
|
15
|
+
}, () => {
|
|
16
|
+
testing = null;
|
|
17
|
+
});
|
|
18
|
+
return testing;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
full: () => full,
|
|
22
|
+
fill() {
|
|
23
|
+
if (full)
|
|
24
|
+
return false;
|
|
25
|
+
full = true;
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
probing: () => probing !== null,
|
|
29
|
+
probeEachMinute() {
|
|
30
|
+
// A device whose storage filled after its install tries a write each minute, so space freed elsewhere ends its read-only mode without a Retry.
|
|
31
|
+
probing = setInterval(() => {
|
|
32
|
+
void probe();
|
|
33
|
+
}, 60_000);
|
|
34
|
+
},
|
|
35
|
+
probe,
|
|
36
|
+
stop() {
|
|
37
|
+
if (probing !== null)
|
|
38
|
+
clearInterval(probing);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type Watcher = {
|
|
2
|
+
held(): boolean;
|
|
3
|
+
stop(): void;
|
|
4
|
+
answer(value: unknown): void;
|
|
5
|
+
};
|
|
6
|
+
export type Watching = 'all' | 'waiting' | 'ready';
|
|
7
|
+
type Watchers = {
|
|
8
|
+
publication(work: () => Promise<void>): Promise<void>;
|
|
9
|
+
owing<T>(topic: string, add: (owed: T | undefined) => T, work: (owed: T) => Promise<void>): Promise<void>;
|
|
10
|
+
watch(topic: string, notify: (value: unknown) => void): Watcher;
|
|
11
|
+
watching(topic: string, which?: Watching): readonly Watcher[];
|
|
12
|
+
tell(topic: string, value: unknown): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
};
|
|
15
|
+
export declare function createWatchers(unpublished: (error: unknown) => void): Watchers;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=watchers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchers.d.ts","sourceRoot":"","sources":["../../src/store/watchers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,IAAI,OAAO,CAAC;IAChB,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAMnD,KAAK,QAAQ,GAAG;IACd,WAAW,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,CAAC,CAAC,EACL,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,EAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,OAAO,EAAE,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAEF,wBAAgB,cAAc,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,QAAQ,CA6D9E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export function createWatchers(unpublished) {
|
|
2
|
+
let published = Promise.resolve();
|
|
3
|
+
const topics = new Map();
|
|
4
|
+
const owed = new Map();
|
|
5
|
+
function publication(work) {
|
|
6
|
+
published = published.then(work).catch(unpublished);
|
|
7
|
+
return published;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
publication,
|
|
11
|
+
owing(topic, add, work) {
|
|
12
|
+
const held = owed.get(topic);
|
|
13
|
+
if (held !== undefined) {
|
|
14
|
+
held.value = add(held.value);
|
|
15
|
+
return held.shown;
|
|
16
|
+
}
|
|
17
|
+
const owing = { value: add(undefined), shown: Promise.resolve() };
|
|
18
|
+
owed.set(topic, owing);
|
|
19
|
+
owing.shown = publication(async () => {
|
|
20
|
+
owed.delete(topic);
|
|
21
|
+
await work(owing.value);
|
|
22
|
+
});
|
|
23
|
+
return owing.shown;
|
|
24
|
+
},
|
|
25
|
+
watch(topic, notify) {
|
|
26
|
+
const held = topics.get(topic) ?? new Set();
|
|
27
|
+
topics.set(topic, held);
|
|
28
|
+
const watcher = {
|
|
29
|
+
ready: false,
|
|
30
|
+
held: () => topics.get(topic)?.has(watcher) === true,
|
|
31
|
+
stop() {
|
|
32
|
+
const on = topics.get(topic);
|
|
33
|
+
on?.delete(watcher);
|
|
34
|
+
if (on?.size === 0)
|
|
35
|
+
topics.delete(topic);
|
|
36
|
+
},
|
|
37
|
+
answer(value) {
|
|
38
|
+
watcher.ready = true;
|
|
39
|
+
notify(value);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
held.add(watcher);
|
|
43
|
+
return watcher;
|
|
44
|
+
},
|
|
45
|
+
watching(topic, which = 'all') {
|
|
46
|
+
return [...(topics.get(topic) ?? [])].filter(({ ready }) => which === 'all' || ready === (which === 'ready'));
|
|
47
|
+
},
|
|
48
|
+
tell(topic, value) {
|
|
49
|
+
for (const watcher of topics.get(topic) ?? [])
|
|
50
|
+
watcher.answer(value);
|
|
51
|
+
},
|
|
52
|
+
close() {
|
|
53
|
+
topics.clear();
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Composition } from '../collection.js';
|
|
2
|
+
import type { RefreshedPage, RuntimeStore } from './records.js';
|
|
3
|
+
export type InstallHold = {
|
|
4
|
+
take(): void;
|
|
5
|
+
release(): void;
|
|
6
|
+
};
|
|
7
|
+
type Writes = {
|
|
8
|
+
exclusive<T>(work: () => Promise<T>): Promise<T>;
|
|
9
|
+
gathered<I, T>(key: string, input: I, merge: (earlier: I, later: I) => I | null, work: (input: I) => Promise<T>): Promise<T>;
|
|
10
|
+
written(): Promise<unknown>;
|
|
11
|
+
startingWrite<T>(work: () => Promise<T>): Promise<T>;
|
|
12
|
+
finishingWrite<T>(work: () => Promise<T>): Promise<T>;
|
|
13
|
+
ahead<T>(work: (hold: InstallHold) => Promise<T>): Promise<T>;
|
|
14
|
+
rederive(local: RuntimeStore, key: number, composition: Composition): Promise<{
|
|
15
|
+
readonly done: boolean;
|
|
16
|
+
readonly text: number;
|
|
17
|
+
}>;
|
|
18
|
+
refreshPage(local: RuntimeStore, key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
19
|
+
stageBytes(): number;
|
|
20
|
+
deriveBytes(): number;
|
|
21
|
+
};
|
|
22
|
+
export declare function createWrites(): Writes;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../src/store/writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA8BhE,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,IAAI,IAAI,CAAC;IAAC,OAAO,IAAI,IAAI,CAAA;CAAE,CAAC;AAE5D,KAAK,MAAM,GAAG;IACZ,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,CAAC,EAAE,CAAC,EACX,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,EACzC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrD,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CACN,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,WAAW,CACT,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,UAAU,IAAI,MAAM,CAAC;IACrB,WAAW,IAAI,MAAM,CAAC;CACvB,CAAC;AAcF,wBAAgB,YAAY,IAAI,MAAM,CAqHrC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { yielded } from '../turn.js';
|
|
2
|
+
const DERIVE_BYTES = 1 << 23;
|
|
3
|
+
const DERIVE_FLOOR = 1 << 18;
|
|
4
|
+
// An index build aims at this much database work, so a Save, a query or the next part's progress waits behind at most one short build.
|
|
5
|
+
const DERIVE_AIM_MS = 250;
|
|
6
|
+
// A build past its floor of text stops after a second and a half of work, its full-text writes included, so a Room whose text costs ten times the usual holds a Save, a query or the next part's progress behind no longer build.
|
|
7
|
+
const DERIVE_LONGEST_MS = 1_500;
|
|
8
|
+
const STAGE_BYTES = 1 << 20;
|
|
9
|
+
const STAGE_FLOOR = 1 << 16;
|
|
10
|
+
// A batch aims at this much database work, so a Save or a query waits behind at most one short write.
|
|
11
|
+
const STAGE_AIM_MS = 50;
|
|
12
|
+
async function timed(budget, work) {
|
|
13
|
+
const started = performance.now();
|
|
14
|
+
const done = await work();
|
|
15
|
+
const spent = performance.now() - started;
|
|
16
|
+
if (spent < budget.aim / 2)
|
|
17
|
+
budget.bytes = Math.min(budget.ceiling, Math.round(budget.bytes * 1.5));
|
|
18
|
+
else if (spent > budget.aim * 2) {
|
|
19
|
+
budget.bytes = Math.max(budget.floor, Math.round(budget.bytes / 1.5));
|
|
20
|
+
}
|
|
21
|
+
return done;
|
|
22
|
+
}
|
|
23
|
+
export function createWrites() {
|
|
24
|
+
let mutations = Promise.resolve();
|
|
25
|
+
let gathering = null;
|
|
26
|
+
const stageBudget = {
|
|
27
|
+
bytes: STAGE_FLOOR * 4,
|
|
28
|
+
floor: STAGE_FLOOR,
|
|
29
|
+
ceiling: STAGE_BYTES,
|
|
30
|
+
aim: STAGE_AIM_MS,
|
|
31
|
+
};
|
|
32
|
+
const deriveBudget = {
|
|
33
|
+
bytes: DERIVE_FLOOR * 4,
|
|
34
|
+
floor: DERIVE_FLOOR,
|
|
35
|
+
ceiling: DERIVE_BYTES,
|
|
36
|
+
aim: DERIVE_AIM_MS,
|
|
37
|
+
};
|
|
38
|
+
const installTurns = { busy: false, ahead: 0, finishing: [], starting: [] };
|
|
39
|
+
function exclusive(work) {
|
|
40
|
+
gathering = null;
|
|
41
|
+
const next = mutations.then(work, work);
|
|
42
|
+
mutations = next.then(() => undefined, () => undefined);
|
|
43
|
+
return next;
|
|
44
|
+
}
|
|
45
|
+
function gathered(key, input, merge, work) {
|
|
46
|
+
const tail = gathering;
|
|
47
|
+
if (tail !== null && tail.key === key) {
|
|
48
|
+
const merged = merge(tail.input, input);
|
|
49
|
+
if (merged !== null) {
|
|
50
|
+
tail.input = merged;
|
|
51
|
+
return tail.done;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const entry = { key, input, done: Promise.resolve() };
|
|
55
|
+
entry.done = exclusive(() => {
|
|
56
|
+
if (gathering === entry)
|
|
57
|
+
gathering = null;
|
|
58
|
+
return work(entry.input);
|
|
59
|
+
});
|
|
60
|
+
gathering = entry;
|
|
61
|
+
return entry.done;
|
|
62
|
+
}
|
|
63
|
+
function nextInstallTurn() {
|
|
64
|
+
if (installTurns.busy || installTurns.ahead > 0)
|
|
65
|
+
return;
|
|
66
|
+
const turn = installTurns.finishing.shift() ?? installTurns.starting.shift();
|
|
67
|
+
if (turn === undefined)
|
|
68
|
+
return;
|
|
69
|
+
installTurns.busy = true;
|
|
70
|
+
turn();
|
|
71
|
+
}
|
|
72
|
+
function installTurn(queue, work) {
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
queue.push(() => void exclusive(work)
|
|
75
|
+
.then(resolve, reject)
|
|
76
|
+
.finally(() => {
|
|
77
|
+
installTurns.busy = false;
|
|
78
|
+
nextInstallTurn();
|
|
79
|
+
}));
|
|
80
|
+
nextInstallTurn();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function resumeInstall() {
|
|
84
|
+
if (installTurns.ahead > 0)
|
|
85
|
+
return;
|
|
86
|
+
void yielded().then(nextInstallTurn);
|
|
87
|
+
}
|
|
88
|
+
async function ahead(work) {
|
|
89
|
+
let taken = false;
|
|
90
|
+
const hold = {
|
|
91
|
+
take() {
|
|
92
|
+
if (taken)
|
|
93
|
+
return;
|
|
94
|
+
taken = true;
|
|
95
|
+
installTurns.ahead += 1;
|
|
96
|
+
},
|
|
97
|
+
release() {
|
|
98
|
+
if (!taken)
|
|
99
|
+
return;
|
|
100
|
+
taken = false;
|
|
101
|
+
installTurns.ahead -= 1;
|
|
102
|
+
resumeInstall();
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
hold.take();
|
|
106
|
+
try {
|
|
107
|
+
return await work(hold);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
hold.release();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
exclusive,
|
|
115
|
+
gathered,
|
|
116
|
+
written: () => mutations,
|
|
117
|
+
startingWrite: (work) => installTurn(installTurns.starting, work),
|
|
118
|
+
finishingWrite: (work) => installTurn(installTurns.finishing, work),
|
|
119
|
+
ahead,
|
|
120
|
+
rederive: (local, key, composition) => timed(deriveBudget, () => local.rederive(key, composition, deriveBudget.bytes, DERIVE_LONGEST_MS, DERIVE_FLOOR)),
|
|
121
|
+
refreshPage: (local, key, composition, page) => timed(stageBudget, () => local.refresh(key, composition, page)),
|
|
122
|
+
stageBytes: () => stageBudget.bytes,
|
|
123
|
+
deriveBytes: () => deriveBudget.bytes,
|
|
124
|
+
};
|
|
125
|
+
}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,212 +1,120 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TypedPath } from './adapter.js';
|
|
2
|
+
import { schemaTypes } from './attached-model.js';
|
|
3
|
+
import { type Cell } from './cell.js';
|
|
2
4
|
import type { ChangeBatch } from './change.js';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readonly drafts: readonly SavedDraft[];
|
|
29
|
-
readonly submission: Submission;
|
|
30
|
-
readonly lost: boolean;
|
|
31
|
-
readonly upload?: unknown;
|
|
32
|
-
};
|
|
33
|
-
export type TargetRecord = {
|
|
34
|
-
established: boolean;
|
|
35
|
-
};
|
|
36
|
-
export type PresentationRecord = {
|
|
37
|
-
app: string;
|
|
38
|
-
value: unknown;
|
|
39
|
-
};
|
|
40
|
-
export type ChatSubmission = {
|
|
41
|
-
readonly operation: string;
|
|
42
|
-
readonly text: string;
|
|
43
|
-
readonly turn: string | null;
|
|
44
|
-
};
|
|
45
|
-
export type ChatDraftRecord = {
|
|
46
|
-
conversation: string;
|
|
47
|
-
text: string;
|
|
48
|
-
revision: string;
|
|
49
|
-
submitted?: readonly ChatSubmission[];
|
|
50
|
-
moves?: readonly string[];
|
|
51
|
-
};
|
|
52
|
-
export type CallRecord = {
|
|
53
|
-
readonly operation: string;
|
|
54
|
-
readonly name: string;
|
|
55
|
-
readonly input: unknown;
|
|
56
|
-
};
|
|
57
|
-
export type AuthoredWrite = {
|
|
58
|
-
locator: string;
|
|
59
|
-
queue?: readonly ChangeBatch[];
|
|
60
|
-
stored?: readonly ChangeBatch[];
|
|
61
|
-
founded?: readonly ChangeBatch[];
|
|
62
|
-
saved?: ReadonlyMap<string, readonly SavedDraft[]>;
|
|
63
|
-
roomDrafts?: readonly RoomDraftRecord[];
|
|
64
|
-
consumedRoomDrafts?: readonly string[];
|
|
65
|
-
};
|
|
66
|
-
export type StagedPage = {
|
|
67
|
-
readonly entries: readonly StoredEntry[];
|
|
68
|
-
readonly folders: readonly string[];
|
|
69
|
-
readonly part?: string;
|
|
70
|
-
};
|
|
71
|
-
export type ResumedTransfer = {
|
|
72
|
-
readonly key: number | null;
|
|
73
|
-
readonly transfer: string;
|
|
74
|
-
readonly staged: readonly string[];
|
|
75
|
-
};
|
|
76
|
-
export type RefreshedPage = StagedPage & {
|
|
77
|
-
readonly removals: readonly string[];
|
|
78
|
-
readonly folderRemovals: readonly string[];
|
|
79
|
-
};
|
|
80
|
-
export type HeldRoom = {
|
|
81
|
-
readonly record: StoredReplica;
|
|
82
|
-
readonly indexed: boolean;
|
|
83
|
-
readonly documents: number;
|
|
84
|
-
};
|
|
85
|
-
export type QueuedChange = {
|
|
86
|
-
readonly batch: ChangeBatch;
|
|
87
|
-
readonly state: PendingState;
|
|
88
|
-
};
|
|
89
|
-
export type HeldWork = {
|
|
90
|
-
readonly room: (HeldRoom & {
|
|
91
|
-
readonly overlaid: ReadonlySet<string>;
|
|
92
|
-
}) | null;
|
|
93
|
-
readonly queue: readonly QueuedChange[];
|
|
94
|
-
};
|
|
95
|
-
export type CoveredRoom = {
|
|
96
|
-
readonly key: number;
|
|
97
|
-
readonly transfer: string;
|
|
98
|
-
readonly roomVersion: string;
|
|
5
|
+
import type { ChangeSet } from './change-set.js';
|
|
6
|
+
import type { Composition } from './collection.js';
|
|
7
|
+
import type { ReadinessWatch } from './preparation.js';
|
|
8
|
+
import type { Persistence } from './readiness.js';
|
|
9
|
+
import type { Listing } from './listing.js';
|
|
10
|
+
import type { Seeded } from './seed.js';
|
|
11
|
+
import type { ModelState } from './model.js';
|
|
12
|
+
import { type OpenedFiles } from './opened.js';
|
|
13
|
+
import { type HeldReplica, type ReplicaRecord } from './replica.js';
|
|
14
|
+
import type { RoomDraftRecord } from './room-draft.js';
|
|
15
|
+
import { type SyncStatus } from './status.js';
|
|
16
|
+
import type { RuntimeDatabase } from './tables.js';
|
|
17
|
+
import { type Installs } from './store/installs.js';
|
|
18
|
+
import { type HeldCover, type HeldStatus, type PendingState, type RuntimeStore } from './store/records.js';
|
|
19
|
+
import { type ReadinessQueue } from './store/readiness.js';
|
|
20
|
+
import { type RoomHeld } from './store/room-held.js';
|
|
21
|
+
import { type Space } from './store/space.js';
|
|
22
|
+
import { type Watcher, type Watching } from './store/watchers.js';
|
|
23
|
+
import { createWrites, type InstallHold } from './store/writes.js';
|
|
24
|
+
export type { RoomInstall } from './store/installs.js';
|
|
25
|
+
export type { AuthoredWrite, ChatDraftRecord, ChatSubmission, CoveredRoom, Facts, HeldConversation, HeldCover, PendingState, RefreshedPage, RuntimeStore, StagedPage, TransferRecord, } from './store/records.js';
|
|
26
|
+
export type { InstallHold } from './store/writes.js';
|
|
27
|
+
export type { CommittedWrite, QueryRoom, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, View, } from './tables.js';
|
|
28
|
+
export type Stored = {
|
|
29
|
+
readonly record: ReplicaRecord;
|
|
99
30
|
readonly indexed: boolean;
|
|
100
31
|
readonly documents: number;
|
|
101
|
-
readonly bytes: number;
|
|
102
|
-
readonly offline: string;
|
|
103
32
|
};
|
|
104
|
-
export type
|
|
105
|
-
readonly
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
readonly
|
|
110
|
-
readonly
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
readonly
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
126
|
-
readonly
|
|
127
|
-
readonly
|
|
128
|
-
readonly
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
33
|
+
export type Held = HeldReplica & {
|
|
34
|
+
readonly states: ReadonlyMap<string, PendingState>;
|
|
35
|
+
};
|
|
36
|
+
export type Work = {
|
|
37
|
+
readonly replica: Held | undefined;
|
|
38
|
+
readonly queue: readonly ChangeBatch[];
|
|
39
|
+
readonly states: ReadonlyMap<string, PendingState>;
|
|
40
|
+
};
|
|
41
|
+
type LandedAhead = Readonly<Record<string, string | undefined>>;
|
|
42
|
+
type AttachedFile = {
|
|
43
|
+
readonly revision: string;
|
|
44
|
+
readonly mediaType: string;
|
|
45
|
+
};
|
|
46
|
+
type Seeds = {
|
|
47
|
+
of(key: string): Seeded | undefined;
|
|
48
|
+
keep(key: string, seed: Seeded): void;
|
|
49
|
+
drop(key: string): void;
|
|
50
|
+
};
|
|
51
|
+
type Device = {
|
|
52
|
+
readonly persistence: Persistence;
|
|
53
|
+
readonly storageLoss: string | null;
|
|
54
|
+
readonly heldWhenOpened: boolean;
|
|
55
|
+
readonly preparing: boolean;
|
|
56
|
+
readonly sweeping: boolean;
|
|
57
|
+
readonly unpreparedDemand: ReadonlySet<string>;
|
|
58
|
+
readonly unpreparable: ReadonlySet<string>;
|
|
59
|
+
readonly establishing: ReadonlySet<string>;
|
|
60
|
+
readonly status: SyncStatus;
|
|
61
|
+
readonly roomsShown: Listing | null;
|
|
62
|
+
};
|
|
63
|
+
type StoreOptions = {
|
|
64
|
+
readonly database: RuntimeDatabase;
|
|
65
|
+
readonly roomTypes: Parameters<typeof schemaTypes>[1];
|
|
66
|
+
readonly builtIn: ModelState;
|
|
67
|
+
readonly typedPaths: readonly TypedPath[];
|
|
68
|
+
readonly persistence: Persistence;
|
|
69
|
+
lost(locator: string): boolean;
|
|
70
|
+
opening(records: RuntimeStore): Promise<RuntimeStore>;
|
|
71
|
+
unpublished(error: unknown): void;
|
|
72
|
+
changed(set: ChangeSet): Promise<void>;
|
|
73
|
+
deliverReadiness(owed: readonly ReadinessWatch[]): Promise<void>;
|
|
74
|
+
spaceFreed(): void;
|
|
75
|
+
};
|
|
76
|
+
export type Store = {
|
|
77
|
+
readonly device: Cell<Device>;
|
|
78
|
+
readonly space: Space;
|
|
79
|
+
readonly readiness: ReadinessQueue<ReadinessWatch>;
|
|
80
|
+
ask: RuntimeDatabase['ask'];
|
|
81
|
+
changed(set: ChangeSet): Promise<void>;
|
|
82
|
+
open(): Promise<RuntimeStore>;
|
|
83
|
+
durably<T>(work: (local: RuntimeStore) => Promise<T>): Promise<T>;
|
|
84
|
+
exclusive<T>(work: () => Promise<T>): Promise<T>;
|
|
85
|
+
gathered<I, T>(key: string, input: I, merge: (earlier: I, later: I) => I | null, work: (input: I) => Promise<T>): Promise<T>;
|
|
86
|
+
written(): Promise<unknown>;
|
|
87
|
+
startingWrite<T>(work: () => Promise<T>): Promise<T>;
|
|
88
|
+
finishingWrite<T>(work: () => Promise<T>): Promise<T>;
|
|
89
|
+
ahead<T>(work: (hold: InstallHold) => Promise<T>): Promise<T>;
|
|
90
|
+
rederive: ReturnType<typeof createWrites>['rederive'];
|
|
91
|
+
refreshPage: ReturnType<typeof createWrites>['refreshPage'];
|
|
92
|
+
stageBytes(): number;
|
|
93
|
+
deriveBytes(): number;
|
|
94
|
+
rooms(locators?: readonly string[]): Promise<ReadonlyMap<string, Stored>>;
|
|
95
|
+
record(locator: string): Promise<ReplicaRecord | undefined>;
|
|
96
|
+
work(locator: string): Promise<Work>;
|
|
97
|
+
replica(locator: string): Promise<Held | undefined>;
|
|
140
98
|
covering(): Promise<HeldCover>;
|
|
141
|
-
offline(locator: string): Promise<string | null>;
|
|
142
|
-
held(): Promise<{
|
|
143
|
-
readonly held: ReadonlySet<string>;
|
|
144
|
-
readonly staged: ReadonlySet<string>;
|
|
145
|
-
}>;
|
|
146
99
|
status(): Promise<HeldStatus>;
|
|
147
|
-
batch(locator: string, id: string): Promise<ChangeBatch | null>;
|
|
148
|
-
order(locator: string): Promise<readonly string[]>;
|
|
149
100
|
queued(): Promise<readonly string[]>;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
170
|
-
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
171
|
-
resume(record: TransferRecord, composition: Composition, parts: readonly string[], published: number | null): Promise<ResumedTransfer | null>;
|
|
172
|
-
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
173
|
-
unrefresh(key: number): Promise<void>;
|
|
174
|
-
commit(commit: Commit): Promise<CommittedWrite>;
|
|
175
|
-
fence(locators: readonly string[]): Promise<void>;
|
|
176
|
-
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
177
|
-
abandon(locator: string): Promise<void>;
|
|
178
|
-
unfence(locators: readonly string[]): Promise<ReadonlySet<string>>;
|
|
179
|
-
release(key: number): Promise<void>;
|
|
180
|
-
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
181
|
-
readonly done: boolean;
|
|
182
|
-
readonly text: number;
|
|
183
|
-
}>;
|
|
184
|
-
fact(name: string, value: unknown): Promise<void>;
|
|
185
|
-
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
186
|
-
keepUpload(locator: string, id: string, upload: unknown): Promise<void>;
|
|
187
|
-
roomDrafts(locator?: string, paths?: readonly string[]): Promise<readonly RoomDraftRecord[]>;
|
|
188
|
-
present(record: PresentationRecord): Promise<void>;
|
|
189
|
-
conversations(conversations?: readonly string[]): Promise<readonly HeldConversation[]>;
|
|
190
|
-
keepMessages(write: ConversationWrite): Promise<void>;
|
|
191
|
-
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null, phrase?: string | null): Promise<MessageWindow>;
|
|
192
|
-
messageCount(conversation: string, phrase?: string | null): Promise<number>;
|
|
193
|
-
turnArrived(conversation: string, turn: string): Promise<boolean>;
|
|
194
|
-
conversationRows(conversations: readonly string[]): Promise<readonly HeldRow[]>;
|
|
195
|
-
jobMarkers(conversation: string): Promise<readonly JobMarker[]>;
|
|
196
|
-
dropConversations(conversations: readonly string[]): Promise<void>;
|
|
197
|
-
chatDrafts(): Promise<readonly ChatDraftRecord[]>;
|
|
198
|
-
chatDraft(conversation: string): Promise<ChatDraftRecord | null>;
|
|
199
|
-
keepChatDrafts(records: readonly ChatDraftRecord[]): Promise<void>;
|
|
200
|
-
dropChatDraft(conversation: string): Promise<void>;
|
|
201
|
-
calls(): Promise<readonly CallRecord[]>;
|
|
202
|
-
keepCall(record: CallRecord): Promise<void>;
|
|
203
|
-
dropCall(operation: string): Promise<void>;
|
|
204
|
-
keepRoomDraft(record: RoomDraftRecord, files: readonly StoredFile[]): Promise<void>;
|
|
205
|
-
discardRoomDraft(locator: string, path: string): Promise<void>;
|
|
206
|
-
fences(): Promise<readonly string[]>;
|
|
207
|
-
generation(): Promise<string | null>;
|
|
208
|
-
rememberGeneration(value: string): Promise<void>;
|
|
209
|
-
file(key: string, type: string): Promise<Blob>;
|
|
210
|
-
};
|
|
211
|
-
export declare function openRuntimeStore(authored: RuntimeDatabase): RuntimeStore;
|
|
101
|
+
drafts(locator?: string, paths?: readonly string[]): Promise<readonly RoomDraftRecord[]>;
|
|
102
|
+
draft(locator: string, path: string): Promise<RoomDraftRecord | undefined>;
|
|
103
|
+
composed(record: Pick<ReplicaRecord, 'model' | 'declaration'>): Composition;
|
|
104
|
+
publication(work: () => Promise<void>): Promise<void>;
|
|
105
|
+
owing<T>(topic: string, add: (owed: T | undefined) => T, work: (owed: T) => Promise<void>): Promise<void>;
|
|
106
|
+
watch(topic: string, notify: (value: unknown) => void): Watcher;
|
|
107
|
+
watching(topic: string, which?: Watching): readonly Watcher[];
|
|
108
|
+
tell(topic: string, value: unknown): void;
|
|
109
|
+
readonly installs: Installs;
|
|
110
|
+
readonly seeds: Seeds;
|
|
111
|
+
readonly landed: RoomHeld<LandedAhead>;
|
|
112
|
+
readonly attached: RoomHeld<AttachedFile>;
|
|
113
|
+
readonly opened: OpenedFiles;
|
|
114
|
+
part(file: string, part: number): Promise<Uint8Array | null>;
|
|
115
|
+
prepareAgain(locator?: string): void;
|
|
116
|
+
forget(locator: string): void;
|
|
117
|
+
close(): void;
|
|
118
|
+
};
|
|
119
|
+
export declare function createStore(options: StoreOptions): Store;
|
|
212
120
|
//# sourceMappingURL=store.d.ts.map
|