@agentshouse/mdruntime 0.1.0-c8f07dbee1c62 → 0.1.0-c907257f60be9
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 +21 -19
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +75 -165
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +8 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +143 -72
- package/dist/adapter.d.ts +130 -61
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +0 -5
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/binary.d.ts +4 -0
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +9 -2
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -18
- 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 +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +0 -2
- package/dist/client.d.ts +20 -21
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +48 -62
- package/dist/collection.d.ts +26 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +28 -10
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -25
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +39 -27
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +149 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +20 -7
- package/dist/conversation.d.ts +57 -48
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +984 -1034
- 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 +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +47 -47
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +5 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +14 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +45 -16
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +8 -0
- package/dist/figures.d.ts +1 -0
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +6 -4
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/host.d.ts +23 -4
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +84 -19
- package/dist/house-query.d.ts +15 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +43 -0
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- package/dist/install.d.ts +10 -6
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +93 -116
- package/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +79 -56
- package/dist/listing.d.ts +29 -22
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +71 -78
- package/dist/live.d.ts +5 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +74 -33
- package/dist/loaded.d.ts +5 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +40 -0
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +12 -39
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +11 -23
- package/dist/media.d.ts +20 -4
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +170 -36
- package/dist/memory.d.ts +9 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +94 -32
- package/dist/messages.d.ts +17 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +39 -38
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +4 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -5
- package/dist/models.d.ts +4 -8
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +97 -137
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +217 -85
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- 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.map +1 -1
- package/dist/opening.js +24 -11
- package/dist/outcome.d.ts +24 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +32 -2
- package/dist/overlay.d.ts +6 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +37 -24
- 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 +5 -58
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +28 -110
- 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 +33 -7
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +210 -92
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +231 -0
- package/dist/queries.d.ts +2 -2
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +86 -71
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +1 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -8
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +480 -0
- package/dist/reach.d.ts +15 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +177 -33
- package/dist/react.d.ts +11 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +20 -5
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +17 -10
- package/dist/reads.d.ts +5 -2
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +33 -5
- package/dist/recovery.d.ts +4 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +31 -8
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -6
- package/dist/replica.d.ts +5 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +15 -17
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +31 -8
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +278 -68
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +28 -22
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +9 -10
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runtime.d.ts +13 -20
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +42 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +324 -223
- package/dist/saves.d.ts +4 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +165 -712
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +4 -5
- package/dist/shared.d.ts +0 -5
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -90
- package/dist/shown.d.ts +9 -5
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +99 -67
- package/dist/socket/lanes.d.ts +12 -4
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +34 -8
- package/dist/socket/session.d.ts +4 -2
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +4 -6
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +6 -16
- package/dist/source.d.ts +5 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +18 -6
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +23 -8
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +84 -24
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store/space.d.ts +1 -1
- package/dist/store/space.d.ts.map +1 -1
- package/dist/store/space.js +0 -2
- package/dist/store/watchers.js +1 -2
- package/dist/store.d.ts +26 -16
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +50 -18
- package/dist/stored.d.ts +33 -15
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +206 -58
- package/dist/surface.d.ts +13 -7
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +70 -37
- package/dist/sync.d.ts +4 -3
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +135 -109
- package/dist/tables.d.ts +19 -58
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +91 -332
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +6 -7
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -10
- package/dist/wire.d.ts +66 -7
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +25 -9
- 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
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/socket/rooms.d.ts +0 -43
- package/dist/socket/rooms.d.ts.map +0 -1
- package/dist/socket/rooms.js +0 -90
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/dist/sync.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { submitAll, submitLater } from './acceptance.js';
|
|
2
1
|
import { resendCalls, resendLater } from './actions.js';
|
|
3
|
-
import {
|
|
2
|
+
import { catchUpConversations, reconcileOpening, resendConversations } from './conversation.js';
|
|
3
|
+
import { declared, sameDeclaration } from './declaration.js';
|
|
4
|
+
import { applyDiscovery, discoverRooms, DISCOVERY, malformed, signIn, zoned } from './discovery.js';
|
|
4
5
|
import { behind, caughtUpTo, publish, pullBootstrap, pullRefresh, reachedBy, replaced, standingAt, } from './install.js';
|
|
5
|
-
import { heldRooms,
|
|
6
|
-
import {
|
|
6
|
+
import { heldRooms, name } from './listing.js';
|
|
7
|
+
import { retainModel, revoked, scoped } from './models.js';
|
|
8
|
+
import { refusalError } from './failure.js';
|
|
7
9
|
import { refuse } from './refusal.js';
|
|
8
|
-
import {
|
|
10
|
+
import { roomListChanged } from './room-list.js';
|
|
11
|
+
import { emitRooms, moveTo, rest, roomUnreadable, submissionDue, transferring, AUTHORITY_TOPIC, } from './shown.js';
|
|
9
12
|
import { unconfirmed } from './transfer.js';
|
|
10
13
|
export const OPENING_LANE = 'opening';
|
|
14
|
+
const FINISHING = 'finishing';
|
|
11
15
|
async function advance(runtime, room, local, authorized, running, unheld) {
|
|
12
|
-
const { store, socket } = runtime;
|
|
16
|
+
const { store, socket, presence } = runtime;
|
|
13
17
|
const live = () => running() && !store.space.full();
|
|
14
18
|
if (!live())
|
|
15
19
|
return unconfirmed;
|
|
16
20
|
const held = unheld === undefined ? await store.record(room.locator) : undefined;
|
|
17
21
|
if (socket.streamed && (held !== undefined || !store.installs.of(room.locator).beyondHorizon)) {
|
|
18
|
-
|
|
22
|
+
presence.stood(room.locator, false);
|
|
23
|
+
runtime.retries.succeeded('download', room.locator);
|
|
19
24
|
await name(runtime, room.locator);
|
|
20
25
|
return null;
|
|
21
26
|
}
|
|
@@ -26,7 +31,7 @@ async function advance(runtime, room, local, authorized, running, unheld) {
|
|
|
26
31
|
return advance(runtime, room, local, authorized, live);
|
|
27
32
|
if (refreshed !== 'beyond-horizon')
|
|
28
33
|
return refreshed;
|
|
29
|
-
if (
|
|
34
|
+
if (presence.standing(room.locator).reloadDue)
|
|
30
35
|
return unconfirmed;
|
|
31
36
|
replaced(store, [room.locator]);
|
|
32
37
|
}
|
|
@@ -44,18 +49,15 @@ async function advance(runtime, room, local, authorized, running, unheld) {
|
|
|
44
49
|
: advance(runtime, room, local, authorized, live);
|
|
45
50
|
}
|
|
46
51
|
async function refreshedRoom(runtime, room, local, authorized, held, live, hold, refresh) {
|
|
47
|
-
const { store, socket } = runtime;
|
|
48
|
-
const { rooms } = socket;
|
|
52
|
+
const { store, socket, presence } = runtime;
|
|
49
53
|
const refreshed = await pullRefresh(runtime, authorized, held, live, hold, refresh);
|
|
50
54
|
if (!live())
|
|
51
55
|
return unconfirmed;
|
|
52
56
|
if (refreshed.kind === 'still-current') {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
emitRooms(runtime);
|
|
58
|
-
}
|
|
57
|
+
presence.stood(room.locator, false);
|
|
58
|
+
runtime.retries.succeeded('download', room.locator);
|
|
59
|
+
if (presence.readable(room.locator))
|
|
60
|
+
emitRooms(runtime, [room.locator]);
|
|
59
61
|
return null;
|
|
60
62
|
}
|
|
61
63
|
if (refreshed.kind === 'advanced') {
|
|
@@ -69,7 +71,7 @@ async function refreshedRoom(runtime, room, local, authorized, held, live, hold,
|
|
|
69
71
|
const reached = now !== undefined && socket.reads.reached(room.locator, now, refreshed.record.roomVersion);
|
|
70
72
|
return reached ? null : 'behind';
|
|
71
73
|
}
|
|
72
|
-
await retainModel(runtime,
|
|
74
|
+
await retainModel(runtime, room.locator, declared(room), null);
|
|
73
75
|
return null;
|
|
74
76
|
}
|
|
75
77
|
return refreshed.kind === 'beyond-horizon' ? 'beyond-horizon' : refreshed;
|
|
@@ -78,43 +80,44 @@ export function advanced(runtime, room, local, authorized) {
|
|
|
78
80
|
return runtime.socket.lanes.inRoom(room.locator, (live) => advance(runtime, room, local, authorized, live));
|
|
79
81
|
}
|
|
80
82
|
export async function withhold(runtime, withheld, room, local, progress) {
|
|
81
|
-
const {
|
|
82
|
-
|
|
83
|
-
if (withheld.kind === 'unconfirmed' || store.fences.has(room.locator))
|
|
83
|
+
const { presence } = runtime;
|
|
84
|
+
if (withheld.kind === 'unconfirmed' || presence.lost(room.locator))
|
|
84
85
|
return;
|
|
85
86
|
if (withheld.kind === 'not-ready') {
|
|
86
87
|
progress.complete = false;
|
|
87
88
|
askAgain(runtime, room.locator);
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
if (withheld.kind === 'transport-uncertainty') {
|
|
92
|
+
runtime.retries.uncertain('download', room.locator, withheld);
|
|
93
|
+
}
|
|
94
|
+
else if (withheld.kind === 'retryable-refusal') {
|
|
95
|
+
runtime.retries.failed('download', room.locator, refusalError(withheld));
|
|
96
|
+
}
|
|
91
97
|
if (withheld.kind === 'transport-uncertainty' || withheld.kind === 'retryable-refusal') {
|
|
92
98
|
const reset = withheld.kind === 'retryable-refusal' ? withheld.reset : undefined;
|
|
93
|
-
|
|
99
|
+
presence.stood(room.locator, true, { reset });
|
|
94
100
|
repairLater(runtime, room.locator, reset === undefined ? { again: true } : { at: Date.parse(reset) });
|
|
95
101
|
}
|
|
96
102
|
else
|
|
97
|
-
|
|
103
|
+
presence.stood(room.locator, true, null);
|
|
98
104
|
if (withheld.kind === 'scoped-refusal') {
|
|
99
|
-
await scoped(runtime, withheld, room,
|
|
105
|
+
await scoped(runtime, withheld, room.locator, declared(room));
|
|
100
106
|
}
|
|
101
107
|
else if (withheld.kind === 'transport-uncertainty') {
|
|
102
108
|
progress.reachable = false;
|
|
103
109
|
}
|
|
104
|
-
else if (withheld.kind === 'retryable-refusal') {
|
|
105
|
-
journal.record(`refusal ${withheld.kind} ${withheld.code}`);
|
|
106
|
-
}
|
|
107
110
|
else if (withheld.kind === 'room-not-readable') {
|
|
108
|
-
roomUnreadable(runtime, room);
|
|
111
|
+
roomUnreadable(runtime, room.locator);
|
|
109
112
|
}
|
|
110
113
|
else if (withheld.kind === 'revoked-authorization') {
|
|
111
114
|
await refuse(runtime, 'revoked-authorization');
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
function askAgain(runtime, locator) {
|
|
115
|
-
const { store, socket } = runtime;
|
|
116
|
-
|
|
117
|
-
const room =
|
|
118
|
+
const { store, socket, presence } = runtime;
|
|
119
|
+
presence.askAgain(locator, () => {
|
|
120
|
+
const room = presence.room(locator);
|
|
118
121
|
if (socket.closed() ||
|
|
119
122
|
socket.stopping() ||
|
|
120
123
|
(socket.streamed && !socket.isOpen()) ||
|
|
@@ -127,50 +130,52 @@ function askAgain(runtime, locator) {
|
|
|
127
130
|
.then(() => rest(runtime, progress), () => undefined);
|
|
128
131
|
});
|
|
129
132
|
}
|
|
130
|
-
async function prepareRoom(runtime, room,
|
|
131
|
-
const { socket
|
|
133
|
+
async function prepareRoom(runtime, room, progress, prior) {
|
|
134
|
+
const { socket } = runtime;
|
|
132
135
|
const { session } = socket;
|
|
133
136
|
if (socket.closed() || session.now().authorization === undefined) {
|
|
134
137
|
progress.complete = false;
|
|
135
138
|
return false;
|
|
136
139
|
}
|
|
137
|
-
if (prior !== undefined && prior.replica.selection !== room.replica.selection) {
|
|
138
|
-
|
|
139
|
-
emitRooms(runtime);
|
|
140
|
-
journal.record(`selection changed ${room.locator}`);
|
|
140
|
+
if (prior !== undefined && prior.declaration.replica.selection !== room.replica.selection) {
|
|
141
|
+
emitRooms(runtime, [room.locator]);
|
|
141
142
|
progress.complete = false;
|
|
142
143
|
return false;
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (prior !== undefined && (prior.name !== room.name || prior.handle !== room.handle)) {
|
|
148
|
-
await keepNaming(runtime, local, room);
|
|
145
|
+
const declaration = declared(room);
|
|
146
|
+
if (prior !== undefined && !sameDeclaration(prior.declaration, declaration)) {
|
|
147
|
+
await retainModel(runtime, room.locator, declaration, null);
|
|
149
148
|
}
|
|
150
149
|
const { paused, authorization } = session.now();
|
|
151
150
|
if (paused || authorization === undefined)
|
|
152
151
|
return false;
|
|
153
152
|
return room.replica.admission === 'admitted';
|
|
154
153
|
}
|
|
155
|
-
|
|
154
|
+
async function synchronize(runtime, listed, progress, attempt, live) {
|
|
156
155
|
const { store, socket } = runtime;
|
|
156
|
+
if (listed.length === 0) {
|
|
157
|
+
if (attempt === 'opened')
|
|
158
|
+
socket.hand([]);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const local = await store.open();
|
|
157
162
|
const heldNow = await store.rooms(listed.map(({ locator }) => locator));
|
|
158
|
-
const prepared = await Promise.allSettled(listed.map((room) => prepareRoom(runtime, room,
|
|
163
|
+
const prepared = await Promise.allSettled(listed.map((room) => prepareRoom(runtime, room, progress, heldNow.get(room.locator)?.record)));
|
|
159
164
|
if (!live())
|
|
160
165
|
return;
|
|
161
166
|
const ready = listed.filter((_, index) => {
|
|
162
167
|
const outcome = prepared[index];
|
|
163
|
-
return outcome
|
|
168
|
+
return outcome.status === 'fulfilled' && outcome.value;
|
|
164
169
|
});
|
|
165
|
-
const held = await heldRooms(runtime, ready);
|
|
166
|
-
if (!live())
|
|
167
|
-
return;
|
|
168
170
|
if (attempt === 'opened') {
|
|
171
|
+
const held = await heldRooms(runtime, ready);
|
|
172
|
+
if (!live())
|
|
173
|
+
return;
|
|
169
174
|
socket.hand(held);
|
|
170
175
|
}
|
|
171
|
-
const kept = attempt === '
|
|
172
|
-
? new Set()
|
|
173
|
-
: new Set(
|
|
176
|
+
const kept = attempt === 'authorized'
|
|
177
|
+
? new Set((await store.rooms(ready.map(({ locator }) => locator))).keys())
|
|
178
|
+
: new Set();
|
|
174
179
|
for (const room of ready) {
|
|
175
180
|
if (attempt === 'opened' || kept.has(room.locator)) {
|
|
176
181
|
if (attempt === 'authorized')
|
|
@@ -203,7 +208,7 @@ export async function loadRoom(runtime, room, local, progress, live, unheld) {
|
|
|
203
208
|
return;
|
|
204
209
|
const prior = unheld === undefined ? await store.record(room.locator) : undefined;
|
|
205
210
|
if (prior !== undefined) {
|
|
206
|
-
if (!(await prepareRoom(runtime, room,
|
|
211
|
+
if (!(await prepareRoom(runtime, room, progress, prior)))
|
|
207
212
|
return;
|
|
208
213
|
if (revoked(prior.model)) {
|
|
209
214
|
await reload(runtime, room, local, progress, live);
|
|
@@ -218,10 +223,10 @@ export async function loadRoom(runtime, room, local, progress, live, unheld) {
|
|
|
218
223
|
await caughtUp(runtime, room, local, progress, live);
|
|
219
224
|
}
|
|
220
225
|
export async function reload(runtime, room, local, progress, live) {
|
|
221
|
-
const { store, socket } = runtime;
|
|
226
|
+
const { store, socket, presence } = runtime;
|
|
222
227
|
try {
|
|
223
228
|
if (live())
|
|
224
|
-
|
|
229
|
+
presence.reload(room.locator, false);
|
|
225
230
|
const { authorization } = socket.session.now();
|
|
226
231
|
if (!live() || authorization === undefined)
|
|
227
232
|
return;
|
|
@@ -241,24 +246,23 @@ export async function reload(runtime, room, local, progress, live) {
|
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
function repairLater(runtime, locator, when) {
|
|
244
|
-
const { socket, recovery } = runtime;
|
|
245
|
-
if (!socket.isOpen() ||
|
|
249
|
+
const { socket, presence, recovery } = runtime;
|
|
250
|
+
if (!socket.isOpen() || presence.standing(locator).repairing)
|
|
246
251
|
return;
|
|
247
252
|
void recovery.attempt(`repair ${locator}`, (signal) => repairPass(runtime, locator, signal), when);
|
|
248
253
|
}
|
|
249
254
|
async function repairPass(runtime, locator, signal) {
|
|
250
|
-
const { store, socket } = runtime;
|
|
251
|
-
const
|
|
252
|
-
const room = rooms.discovered(locator);
|
|
255
|
+
const { store, socket, presence } = runtime;
|
|
256
|
+
const room = presence.room(locator);
|
|
253
257
|
if (!socket.isOpen() ||
|
|
254
258
|
!socket.continuing() ||
|
|
255
259
|
socket.stopping() ||
|
|
256
|
-
!
|
|
260
|
+
!presence.standing(locator).stale)
|
|
257
261
|
return 'done';
|
|
258
262
|
if (room === undefined || room.replica.admission !== 'admitted')
|
|
259
263
|
return 'done';
|
|
260
264
|
const progress = { complete: true, reachable: true };
|
|
261
|
-
|
|
265
|
+
presence.repairing(locator, true);
|
|
262
266
|
try {
|
|
263
267
|
const local = await store.open();
|
|
264
268
|
await socket.lanes.roomTask(locator, async (live) => {
|
|
@@ -271,50 +275,52 @@ async function repairPass(runtime, locator, signal) {
|
|
|
271
275
|
});
|
|
272
276
|
}
|
|
273
277
|
catch {
|
|
274
|
-
|
|
278
|
+
presence.stood(locator, true);
|
|
275
279
|
progress.reachable = false;
|
|
276
280
|
}
|
|
277
281
|
finally {
|
|
278
|
-
|
|
282
|
+
presence.repairing(locator, false);
|
|
279
283
|
}
|
|
280
284
|
if (signal.aborted)
|
|
281
285
|
return 'done';
|
|
282
286
|
await rest(runtime, progress);
|
|
283
|
-
if (!
|
|
284
|
-
|
|
285
|
-
submitLater(runtime, locator);
|
|
287
|
+
if (!presence.standing(locator).stale) {
|
|
288
|
+
await submissionDue(runtime, [locator]);
|
|
286
289
|
return 'done';
|
|
287
290
|
}
|
|
288
|
-
const { repairable } =
|
|
291
|
+
const { repairable } = presence.standing(locator);
|
|
289
292
|
if (repairable === null)
|
|
290
293
|
return 'done';
|
|
291
294
|
return repairable.reset === undefined ? 'again' : { at: Date.parse(repairable.reset) };
|
|
292
295
|
}
|
|
293
296
|
export async function finishOpening(runtime, progress, live) {
|
|
294
|
-
const { socket, conversations, recovery } = runtime;
|
|
297
|
+
const { store, socket, presence, conversations, recovery } = runtime;
|
|
295
298
|
try {
|
|
296
299
|
if (!live()) {
|
|
297
300
|
progress.complete = false;
|
|
298
301
|
return;
|
|
299
302
|
}
|
|
300
|
-
|
|
301
|
-
|
|
303
|
+
const kept = store.needed();
|
|
304
|
+
await submissionDue(runtime);
|
|
305
|
+
for (const locator of presence.repairsOwed())
|
|
302
306
|
repairLater(runtime, locator, {});
|
|
303
|
-
|
|
304
|
-
await conversations.reconcile();
|
|
307
|
+
await reconcileOpening(conversations);
|
|
305
308
|
const reading = { complete: true, reachable: true };
|
|
306
|
-
await conversations
|
|
307
|
-
if (progress.reachable && reading.reachable)
|
|
308
|
-
await conversations
|
|
309
|
-
|
|
309
|
+
await catchUpConversations(conversations, reading);
|
|
310
|
+
if (kept && progress.reachable && reading.reachable) {
|
|
311
|
+
await resendConversations(conversations, reading);
|
|
312
|
+
}
|
|
313
|
+
if (kept && progress.reachable) {
|
|
310
314
|
void recovery.attempt('calls', (signal) => resendCalls(runtime, signal));
|
|
311
315
|
}
|
|
312
316
|
if (!reading.reachable) {
|
|
313
317
|
progress.reachable = false;
|
|
314
318
|
resendLater(runtime);
|
|
315
319
|
}
|
|
320
|
+
runtime.retries.succeeded('conversations', FINISHING);
|
|
316
321
|
}
|
|
317
|
-
catch {
|
|
322
|
+
catch (error) {
|
|
323
|
+
runtime.retries.failed('conversations', FINISHING, error);
|
|
318
324
|
progress.complete = false;
|
|
319
325
|
}
|
|
320
326
|
finally {
|
|
@@ -324,14 +330,17 @@ export async function finishOpening(runtime, progress, live) {
|
|
|
324
330
|
}
|
|
325
331
|
}
|
|
326
332
|
}
|
|
327
|
-
export function sync(runtime, attempt, found) {
|
|
328
|
-
const {
|
|
333
|
+
export async function sync(runtime, attempt, found, current = () => true) {
|
|
334
|
+
const { socket } = runtime;
|
|
329
335
|
const { session } = socket;
|
|
330
|
-
|
|
336
|
+
let answered = true;
|
|
337
|
+
await socket.lanes.task(OPENING_LANE, async (live) => {
|
|
331
338
|
if (!live()) {
|
|
332
339
|
socket.readyFromStore();
|
|
333
340
|
return;
|
|
334
341
|
}
|
|
342
|
+
if (!current())
|
|
343
|
+
return;
|
|
335
344
|
const progress = { complete: true, reachable: true };
|
|
336
345
|
session.set({
|
|
337
346
|
underway: attempt === 'opened' ? progress : null,
|
|
@@ -341,17 +350,17 @@ export function sync(runtime, attempt, found) {
|
|
|
341
350
|
});
|
|
342
351
|
moveTo(runtime, transferring(runtime));
|
|
343
352
|
try {
|
|
344
|
-
const local = await store.open();
|
|
345
|
-
if (!live())
|
|
346
|
-
return;
|
|
347
353
|
await socket.authorize();
|
|
348
354
|
if (!live())
|
|
349
355
|
return;
|
|
350
|
-
const listed = await discoverRooms(runtime,
|
|
356
|
+
const listed = await discoverRooms(runtime, progress, live, found);
|
|
357
|
+
answered = progress.reachable;
|
|
351
358
|
if (listed !== null)
|
|
352
|
-
await synchronize(runtime, listed,
|
|
359
|
+
await synchronize(runtime, listed, progress, attempt, live);
|
|
360
|
+
runtime.retries.succeeded('connection', OPENING_LANE);
|
|
353
361
|
}
|
|
354
|
-
catch {
|
|
362
|
+
catch (error) {
|
|
363
|
+
runtime.retries.failed('connection', OPENING_LANE, error);
|
|
355
364
|
progress.complete = false;
|
|
356
365
|
if (attempt === 'opened' && !socket.isHanded())
|
|
357
366
|
progress.reachable = false;
|
|
@@ -370,40 +379,52 @@ export function sync(runtime, attempt, found) {
|
|
|
370
379
|
session.set({ underway: null });
|
|
371
380
|
await rest(runtime, progress, live);
|
|
372
381
|
});
|
|
382
|
+
return answered;
|
|
383
|
+
}
|
|
384
|
+
export async function discover(runtime) {
|
|
385
|
+
const { recovery } = runtime;
|
|
386
|
+
if (await sync(runtime, 'unstreamed', null)) {
|
|
387
|
+
recovery.cancel(DISCOVERY);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
void recovery.attempt(DISCOVERY, async () => ((await sync(runtime, 'unstreamed', null)) ? 'done' : 'again'), { again: true, attempts: Infinity });
|
|
391
|
+
}
|
|
392
|
+
export function adopt(runtime, unstored) {
|
|
393
|
+
const { session } = runtime.socket;
|
|
394
|
+
return sync(runtime, 'unstreamed', unstored, () => session.now().unstored === unstored).then(() => undefined);
|
|
373
395
|
}
|
|
374
396
|
export function resynchronize(runtime) {
|
|
375
|
-
const {
|
|
397
|
+
const { socket, presence } = runtime;
|
|
376
398
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
377
399
|
if (!live() || !socket.isAnnounced())
|
|
378
400
|
return;
|
|
379
401
|
const progress = { complete: true, reachable: true };
|
|
380
402
|
moveTo(runtime, transferring(runtime));
|
|
381
403
|
try {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
return;
|
|
385
|
-
await synchronize(runtime, socket.rooms.discoveredRooms(), local, progress, 'unstreamed', live);
|
|
404
|
+
await synchronize(runtime, presence.rooms(), progress, 'unstreamed', live);
|
|
405
|
+
runtime.retries.succeeded('download', OPENING_LANE);
|
|
386
406
|
}
|
|
387
|
-
catch {
|
|
407
|
+
catch (error) {
|
|
408
|
+
runtime.retries.failed('download', OPENING_LANE, error);
|
|
388
409
|
progress.complete = false;
|
|
389
410
|
}
|
|
390
411
|
if (live())
|
|
391
412
|
await finishOpening(runtime, progress, live);
|
|
392
413
|
});
|
|
393
414
|
}
|
|
394
|
-
export function countAuthorityChange({ store, socket, lastAnswers }) {
|
|
415
|
+
export function countAuthorityChange({ store, socket, lastAnswers }, listed) {
|
|
395
416
|
const authorityChanges = socket.session.now().authorityChanges + 1;
|
|
396
417
|
socket.session.set({ authorityChanges });
|
|
397
418
|
store.tell(AUTHORITY_TOPIC, authorityChanges);
|
|
398
|
-
lastAnswers.again();
|
|
419
|
+
lastAnswers.again(listed);
|
|
399
420
|
}
|
|
400
421
|
export function changeAuthority(runtime, change) {
|
|
401
|
-
const { store, socket
|
|
422
|
+
const { store, socket } = runtime;
|
|
402
423
|
const { session } = socket;
|
|
403
424
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
404
425
|
if (!live() || !socket.isAnnounced())
|
|
405
426
|
return;
|
|
406
|
-
countAuthorityChange(runtime);
|
|
427
|
+
countAuthorityChange(runtime, roomListChanged(runtime, change.roomList));
|
|
407
428
|
const progress = { complete: true, reachable: true };
|
|
408
429
|
moveTo(runtime, transferring(runtime));
|
|
409
430
|
try {
|
|
@@ -412,18 +433,21 @@ export function changeAuthority(runtime, change) {
|
|
|
412
433
|
return;
|
|
413
434
|
const invalid = malformed(change.rooms);
|
|
414
435
|
if (invalid !== null) {
|
|
415
|
-
journal.record(invalid);
|
|
416
436
|
await refuse(runtime, 'missing-required-guarantee');
|
|
417
437
|
return;
|
|
418
438
|
}
|
|
419
439
|
if (change.member !== undefined)
|
|
420
440
|
await signIn(runtime, local, change.member);
|
|
441
|
+
if (change.timeZone !== undefined)
|
|
442
|
+
await zoned(runtime, local, change.timeZone);
|
|
421
443
|
const discoveries = session.now().discoveries + 1;
|
|
422
444
|
session.set({ discoveries });
|
|
423
445
|
const listed = await applyDiscovery(runtime, change.rooms, discoveries, change.left);
|
|
424
|
-
await synchronize(runtime, listed,
|
|
446
|
+
await synchronize(runtime, listed, progress, 'authorized', live);
|
|
447
|
+
runtime.retries.succeeded('connection', OPENING_LANE);
|
|
425
448
|
}
|
|
426
|
-
catch {
|
|
449
|
+
catch (error) {
|
|
450
|
+
runtime.retries.failed('connection', OPENING_LANE, error);
|
|
427
451
|
progress.complete = false;
|
|
428
452
|
}
|
|
429
453
|
if (!live())
|
|
@@ -468,8 +492,8 @@ async function installCarried(runtime, room, local, change, live, progress) {
|
|
|
468
492
|
await publish(runtime, local, room, bootstrapped.record, { kind: 'bootstrapped', refreshed: bootstrapped.refreshed, from }, live);
|
|
469
493
|
}
|
|
470
494
|
export function applyRoom(runtime, change) {
|
|
471
|
-
const { store, socket } = runtime;
|
|
472
|
-
const {
|
|
495
|
+
const { store, socket, presence } = runtime;
|
|
496
|
+
const { session } = socket;
|
|
473
497
|
const { locator } = change;
|
|
474
498
|
if (socket.stopping())
|
|
475
499
|
return Promise.resolve();
|
|
@@ -482,7 +506,7 @@ export function applyRoom(runtime, change) {
|
|
|
482
506
|
for (;;) {
|
|
483
507
|
if (!live())
|
|
484
508
|
return null;
|
|
485
|
-
const room =
|
|
509
|
+
const room = presence.room(locator);
|
|
486
510
|
if (room === undefined || room.replica.admission !== 'admitted')
|
|
487
511
|
return null;
|
|
488
512
|
const held = await store.record(locator);
|
|
@@ -492,7 +516,7 @@ export function applyRoom(runtime, change) {
|
|
|
492
516
|
await installCarried(runtime, room, local, change, live, progress);
|
|
493
517
|
return progress;
|
|
494
518
|
}
|
|
495
|
-
if (held.replica.selection !== room.replica.selection)
|
|
519
|
+
if (held.declaration.replica.selection !== room.replica.selection)
|
|
496
520
|
return null;
|
|
497
521
|
const at = held.roomVersion;
|
|
498
522
|
if (socket.reads.reached(locator, at, change.roomVersion))
|
|
@@ -513,17 +537,19 @@ export function applyRoom(runtime, change) {
|
|
|
513
537
|
remodelled: refreshed.remodelled,
|
|
514
538
|
};
|
|
515
539
|
if (await publish(runtime, local, room, refreshed.record, landing, writing)) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
540
|
+
presence.stood(locator, false);
|
|
541
|
+
const declaration = declared(room);
|
|
542
|
+
if (!sameDeclaration(held.declaration, declaration))
|
|
543
|
+
await retainModel(runtime, locator, declaration, null);
|
|
519
544
|
return progress;
|
|
520
545
|
}
|
|
521
546
|
}
|
|
522
547
|
}
|
|
523
|
-
catch {
|
|
524
|
-
|
|
548
|
+
catch (error) {
|
|
549
|
+
runtime.retries.failed('download', locator, error);
|
|
550
|
+
if (!presence.standing(locator).stale)
|
|
525
551
|
void name(runtime, locator);
|
|
526
|
-
|
|
552
|
+
presence.stood(locator, true);
|
|
527
553
|
return progress;
|
|
528
554
|
}
|
|
529
555
|
})
|
package/dist/tables.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
2
|
import type { Composed } from './collection.js';
|
|
3
|
+
import { type AuthoredFact, type AuthoredWrite, type HeldQueues, type KeptRecord, type StoredFile } from './authored.js';
|
|
3
4
|
import type { UnsentWork } from './durability.js';
|
|
4
|
-
import type
|
|
5
|
-
import { type ConversationWrite, type HeldConversation, type HeldRow, type MessageWindow } from './messages.js';
|
|
5
|
+
import { type ConversationWrite, type HeldConversation, type HeldFact, type HeldRow, type MessageWindow } from './messages.js';
|
|
6
6
|
import type { GroupTotal, Plan } from './query.js';
|
|
7
7
|
import { type ReadAt } from './reads.js';
|
|
8
8
|
import { type ConversationTally, type RoomTally } from './tallies.js';
|
|
9
|
-
import { type Committed, type Covering, type HeldEntry, type HeldLocators, type HeldRoomRow, type HeldRoomWork, type ReplicaOpened, type Referrer, type Resumed, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
10
|
-
export type { Committed, Covering, HeldEntry, HeldLocators, HeldRoomRow, HeldRoomWork, OverlayEntry, ReplicaOpened, Referrer, Resumed, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
9
|
+
import { type Committed, type CoverLog, type Covering, type HeldEntry, type HeldLocators, type HeldRoomRow, type HeldRoomWork, type ReplicaOpened, type Referrer, type Resumed, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
10
|
+
export type { Committed, CoverLog, Covering, HeldEntry, HeldLocators, HeldRoomRow, HeldRoomWork, OverlayEntry, ReplicaOpened, Referrer, Resumed, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
11
|
+
export { authoredEmptied, authoredTable, FILE_PART_BYTES, formatted, heldTables, type AuthoredFact, type AuthoredRows, type KeptRecord, type StoredFile, } from './authored.js';
|
|
11
12
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
12
|
-
export type { ConversationWrite, HeldConversation, HeldRow, MessageWindow } from './messages.js';
|
|
13
|
+
export type { ConversationFact, ConversationWrite, HeldConversation, HeldFact, HeldRow, MessageWindow, } from './messages.js';
|
|
13
14
|
export type { ConversationTally, RoomTally } from './tallies.js';
|
|
14
15
|
export type Value = string | number | bigint | Uint8Array | null;
|
|
15
16
|
export type Row = Readonly<Record<string, Value>>;
|
|
@@ -51,53 +52,13 @@ export interface SqliteDatabase {
|
|
|
51
52
|
prepare(sql: string): SqliteStatement;
|
|
52
53
|
}
|
|
53
54
|
export declare function sqliteConnection(engine: SqliteEngine, database: SqliteDatabase): Connection;
|
|
54
|
-
export declare const FILE_PART_BYTES = 1048576;
|
|
55
55
|
export declare const RUNTIME_TABLES: readonly string[];
|
|
56
|
-
export type AuthoredFact = 'holder' | 'generation';
|
|
57
|
-
export type StoredFile = {
|
|
58
|
-
readonly key: string;
|
|
59
|
-
readonly blob: Blob;
|
|
60
|
-
};
|
|
61
56
|
export interface FileSpool {
|
|
62
57
|
held(): Iterable<string>;
|
|
63
58
|
spool(key: string, type: string, parts: Iterable<Uint8Array>): Promise<Blob>;
|
|
64
59
|
drop(key: string): Promise<void>;
|
|
65
60
|
probe(bytes: number): Promise<void>;
|
|
66
61
|
}
|
|
67
|
-
export type KeptPending = {
|
|
68
|
-
readonly id: string;
|
|
69
|
-
readonly batch: string;
|
|
70
|
-
readonly state: string;
|
|
71
|
-
readonly files: readonly string[];
|
|
72
|
-
readonly paths: readonly string[];
|
|
73
|
-
readonly moving: boolean;
|
|
74
|
-
};
|
|
75
|
-
export type KeptRecord = {
|
|
76
|
-
readonly record: string;
|
|
77
|
-
readonly files: readonly string[];
|
|
78
|
-
};
|
|
79
|
-
export type AuthoredRows = {
|
|
80
|
-
readonly locator: string;
|
|
81
|
-
readonly order?: readonly string[];
|
|
82
|
-
readonly added?: readonly KeptPending[];
|
|
83
|
-
readonly founded?: readonly Omit<KeptPending, 'state'>[];
|
|
84
|
-
readonly roomDrafts?: readonly (KeptRecord & {
|
|
85
|
-
readonly path: string;
|
|
86
|
-
})[];
|
|
87
|
-
readonly consumedRoomDrafts?: readonly string[];
|
|
88
|
-
};
|
|
89
|
-
export type HeldQueues = {
|
|
90
|
-
readonly queues: readonly {
|
|
91
|
-
readonly locator: string;
|
|
92
|
-
readonly ids: readonly string[];
|
|
93
|
-
}[];
|
|
94
|
-
readonly pending: readonly {
|
|
95
|
-
readonly locator: string;
|
|
96
|
-
readonly id: string;
|
|
97
|
-
readonly batch: string;
|
|
98
|
-
readonly state: string;
|
|
99
|
-
}[];
|
|
100
|
-
};
|
|
101
62
|
export type HeldStatus = {
|
|
102
63
|
readonly queued: readonly string[];
|
|
103
64
|
readonly lastCompleted: string | null;
|
|
@@ -131,11 +92,6 @@ type Nothing = Readonly<Record<never, never>>;
|
|
|
131
92
|
export type CommittedWrite = Committed & {
|
|
132
93
|
readonly fenced: string | null;
|
|
133
94
|
};
|
|
134
|
-
export type AuthoredWrite = {
|
|
135
|
-
readonly writes: readonly AuthoredRows[];
|
|
136
|
-
readonly files: readonly StoredFile[];
|
|
137
|
-
readonly whole: boolean;
|
|
138
|
-
};
|
|
139
95
|
export interface RuntimeRequests {
|
|
140
96
|
readonly 'authored.status': Asked<Nothing, HeldStatus>;
|
|
141
97
|
readonly 'authored.moving': Asked<Nothing, HeldQueues>;
|
|
@@ -212,13 +168,17 @@ export interface RuntimeRequests {
|
|
|
212
168
|
readonly 'replica.room': Asked<{
|
|
213
169
|
readonly locator: string;
|
|
214
170
|
}, HeldRoomWork>;
|
|
215
|
-
readonly 'replica.covering': Asked<
|
|
171
|
+
readonly 'replica.covering': Asked<{
|
|
172
|
+
readonly since: CoverLog | null;
|
|
173
|
+
}, Covering>;
|
|
216
174
|
readonly 'replica.offline': Asked<{
|
|
217
175
|
readonly locator: string;
|
|
218
176
|
}, string | null>;
|
|
219
177
|
readonly 'replica.held': Asked<Nothing, HeldLocators>;
|
|
220
178
|
readonly 'replica.demote': Asked<Nothing, null>;
|
|
221
|
-
readonly 'replica.facts': Asked<
|
|
179
|
+
readonly 'replica.facts': Asked<{
|
|
180
|
+
readonly names: readonly string[] | null;
|
|
181
|
+
}, Readonly<Record<string, string>>>;
|
|
222
182
|
readonly 'replica.presentation': Asked<{
|
|
223
183
|
readonly app: string;
|
|
224
184
|
}, string | null>;
|
|
@@ -249,7 +209,6 @@ export interface RuntimeRequests {
|
|
|
249
209
|
}, readonly Referrer[]>;
|
|
250
210
|
readonly 'replica.folders': Asked<{
|
|
251
211
|
readonly key: number;
|
|
252
|
-
readonly view: View;
|
|
253
212
|
readonly paths: readonly string[];
|
|
254
213
|
}, readonly string[]>;
|
|
255
214
|
readonly 'replica.typedWithin': Asked<{
|
|
@@ -378,16 +337,16 @@ export interface RuntimeRequests {
|
|
|
378
337
|
readonly 'conversation.rows': Asked<{
|
|
379
338
|
readonly conversations: readonly string[];
|
|
380
339
|
}, readonly HeldRow[]>;
|
|
381
|
-
readonly 'conversation.jobs': Asked<{
|
|
382
|
-
readonly conversation: string;
|
|
383
|
-
}, readonly JobMarker[]>;
|
|
384
340
|
readonly 'conversation.tallies': Asked<{
|
|
385
341
|
readonly conversations: readonly string[] | null;
|
|
386
342
|
readonly since: string;
|
|
387
343
|
}, readonly ConversationTally[]>;
|
|
344
|
+
readonly 'conversation.facts': Asked<Nothing, readonly HeldFact[]>;
|
|
345
|
+
readonly 'conversation.fact': Asked<HeldFact, null>;
|
|
346
|
+
readonly 'conversation.stored': Asked<Nothing, readonly string[]>;
|
|
388
347
|
readonly 'conversation.drop': Asked<{
|
|
389
348
|
readonly conversations: readonly string[];
|
|
390
|
-
},
|
|
349
|
+
}, readonly string[]>;
|
|
391
350
|
readonly 'space.probe': Asked<Nothing, null>;
|
|
392
351
|
readonly 'read.stored': Asked<ReadAt, string | null>;
|
|
393
352
|
readonly 'read.keep': Asked<ReadAt & {
|
|
@@ -410,6 +369,8 @@ export interface RuntimeDatabase {
|
|
|
410
369
|
export declare function isRuntime(request: {
|
|
411
370
|
readonly kind: string;
|
|
412
371
|
}): request is RuntimeRequest;
|
|
413
|
-
export declare function readsRuntime(request:
|
|
372
|
+
export declare function readsRuntime(request: {
|
|
373
|
+
readonly kind: string;
|
|
374
|
+
}): boolean;
|
|
414
375
|
export declare function answerRuntime(connection: Connection, request: RuntimeRequest, spool: FileSpool): unknown;
|
|
415
376
|
//# sourceMappingURL=tables.d.ts.map
|