@agentshouse/mdruntime 0.1.0-cf08ada271a7f → 0.1.0-cf08df9b663d8
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.map +1 -1
- package/dist/acceptance.js +57 -38
- 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 +173 -83
- package/dist/adapter.d.ts +210 -30
- 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 +2 -7
- package/dist/{binary.d.ts → attachment.d.ts} +8 -4
- package/dist/attachment.d.ts.map +1 -0
- package/dist/attachment.js +15 -0
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/chain.d.ts +1 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +5 -2
- package/dist/change.d.ts +6 -2
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +3 -0
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +2 -4
- package/dist/client.d.ts +29 -24
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +49 -64
- package/dist/collection.d.ts +6 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -9
- 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 +4 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +88 -44
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +32 -17
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +26 -11
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +24 -11
- package/dist/conversation-row.d.ts +23 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +37 -8
- package/dist/conversation.d.ts +45 -11
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +337 -203
- package/dist/declaration.js +3 -3
- package/dist/discovery.d.ts +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +46 -48
- 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 +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +26 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +126 -36
- package/dist/expectation.d.ts +25 -14
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +51 -20
- package/dist/failure.d.ts +2 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +6 -1
- package/dist/figures.d.ts +1 -1
- 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/holdings.d.ts.map +1 -1
- package/dist/holdings.js +5 -3
- package/dist/host.d.ts +7 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +94 -30
- package/dist/house-query.d.ts +24 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +102 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +27 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -9
- package/dist/install.d.ts +10 -5
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +49 -55
- package/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +74 -51
- package/dist/linked-file.d.ts +7 -0
- package/dist/linked-file.d.ts.map +1 -0
- package/dist/linked-file.js +13 -0
- package/dist/listing.d.ts +27 -20
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +68 -69
- package/dist/live.d.ts +19 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +94 -36
- package/dist/loaded.d.ts +7 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +46 -0
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +10 -38
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +8 -20
- package/dist/media.d.ts +19 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +181 -34
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +99 -37
- package/dist/messages.d.ts +21 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +48 -16
- 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 +10 -7
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +18 -35
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +206 -69
- 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 +6 -6
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +4 -4
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +22 -10
- package/dist/outcome.d.ts +33 -13
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +36 -6
- package/dist/overlay.d.ts +21 -7
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +112 -39
- 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 -9
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +30 -15
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/preparation.d.ts +33 -7
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +207 -96
- 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 +137 -79
- package/dist/query.d.ts +2 -2
- 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 +2 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +76 -49
- package/dist/reach.d.ts +15 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +196 -37
- package/dist/react.d.ts +17 -5
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +28 -5
- package/dist/readiness.d.ts +23 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +18 -10
- package/dist/reads.d.ts +5 -3
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +26 -14
- package/dist/recovery.d.ts +4 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +31 -8
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +4 -4
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +2 -4
- package/dist/replica.d.ts +3 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +5 -5
- 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 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +262 -36
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +12 -7
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +47 -0
- package/dist/rows.d.ts +11 -3
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +25 -11
- package/dist/run-tables.d.ts +25 -0
- package/dist/run-tables.d.ts.map +1 -0
- package/dist/run-tables.js +98 -0
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runs.d.ts +27 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +92 -0
- package/dist/runtime.d.ts +11 -5
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +120 -135
- package/dist/saves.d.ts +7 -5
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +116 -65
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +4 -4
- package/dist/selector.d.ts +3 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +22 -0
- package/dist/shown.d.ts +8 -5
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +95 -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 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +9 -6
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +17 -16
- package/dist/source.d.ts +42 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +76 -9
- 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 +31 -7
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +70 -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.d.ts +24 -14
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +49 -17
- package/dist/stored.d.ts +41 -16
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +215 -57
- package/dist/surface.d.ts +20 -8
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +66 -32
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +109 -82
- package/dist/tables.d.ts +40 -52
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +109 -326
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +3 -4
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +50 -10
- package/dist/wire.d.ts +68 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +28 -11
- package/package.json +4 -4
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/binary.d.ts.map +0 -1
- package/dist/binary.js +0 -8
- package/dist/job.d.ts +0 -5
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -7
- 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 -41
- 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/store/records.js
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { composedOf } from '../collection.js';
|
|
2
|
-
import {
|
|
2
|
+
import { attachmentLocalId } from '../identity.js';
|
|
3
|
+
import { lockingMode } from '../presence.js';
|
|
3
4
|
import { readsRuntime } from '../tables.js';
|
|
4
5
|
const FILE = '\u0000file';
|
|
6
|
+
const UNSTATED = {
|
|
7
|
+
lastCompleted: null,
|
|
8
|
+
providerLimits: [],
|
|
9
|
+
capabilities: [],
|
|
10
|
+
member: null,
|
|
11
|
+
timeZone: null,
|
|
12
|
+
targets: {},
|
|
13
|
+
conversationList: null,
|
|
14
|
+
agentList: null,
|
|
15
|
+
conversationCursor: null,
|
|
16
|
+
chatPins: [],
|
|
17
|
+
readUntil: null,
|
|
18
|
+
roomList: null,
|
|
19
|
+
queriesOnly: [],
|
|
20
|
+
};
|
|
5
21
|
function batchFacts(batch) {
|
|
6
22
|
return { paths: batch.changes.map(({ path }) => path), moving: batch.between !== undefined };
|
|
7
23
|
}
|
|
@@ -64,7 +80,7 @@ function keyed(keys, value) {
|
|
|
64
80
|
return held;
|
|
65
81
|
let key = keys.get(held);
|
|
66
82
|
if (key === undefined) {
|
|
67
|
-
key =
|
|
83
|
+
key = attachmentLocalId();
|
|
68
84
|
keys.set(held, key);
|
|
69
85
|
}
|
|
70
86
|
stored.push({ key, blob: held });
|
|
@@ -95,15 +111,30 @@ function roomOf(row) {
|
|
|
95
111
|
function json(value, fallback) {
|
|
96
112
|
return value === undefined ? fallback : JSON.parse(value);
|
|
97
113
|
}
|
|
98
|
-
function coverOf(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
function coverOf(kept, answer) {
|
|
115
|
+
const { log, whole, rooms, removed, queues } = answer;
|
|
116
|
+
const queued = new Map(queues.map(({ locator, ids }) => [locator, ids]));
|
|
117
|
+
const fresh = whole || kept === null || kept.log.token !== log.token;
|
|
118
|
+
if (!fresh && log.at < kept.log.at)
|
|
119
|
+
return kept;
|
|
120
|
+
const held = fresh ? { rooms: new Map(), locking: new Set() } : kept;
|
|
121
|
+
for (const locator of removed) {
|
|
122
|
+
held.rooms.delete(locator);
|
|
123
|
+
held.locking.delete(locator);
|
|
124
|
+
}
|
|
125
|
+
for (const { locator, ...room } of rooms) {
|
|
126
|
+
held.rooms.set(locator, room);
|
|
127
|
+
if (lockingMode(room.offline))
|
|
128
|
+
held.locking.add(locator);
|
|
129
|
+
else
|
|
130
|
+
held.locking.delete(locator);
|
|
131
|
+
}
|
|
132
|
+
return { log, rooms: held.rooms, locking: held.locking, queues: queued };
|
|
103
133
|
}
|
|
104
134
|
export function openRuntimeStore(database) {
|
|
105
135
|
let written = 0;
|
|
106
136
|
let covered = null;
|
|
137
|
+
let kept = null;
|
|
107
138
|
const authored = {
|
|
108
139
|
ask(request) {
|
|
109
140
|
if (!readsRuntime(request))
|
|
@@ -152,7 +183,12 @@ export function openRuntimeStore(database) {
|
|
|
152
183
|
return covered.cover;
|
|
153
184
|
const held = {
|
|
154
185
|
at: written,
|
|
155
|
-
cover: authored
|
|
186
|
+
cover: authored
|
|
187
|
+
.ask({ kind: 'replica.covering', since: kept?.log ?? null })
|
|
188
|
+
.then((answer) => {
|
|
189
|
+
kept = coverOf(kept, answer);
|
|
190
|
+
return kept;
|
|
191
|
+
}),
|
|
156
192
|
};
|
|
157
193
|
covered = held;
|
|
158
194
|
held.cover.catch(() => {
|
|
@@ -205,18 +241,13 @@ export function openRuntimeStore(database) {
|
|
|
205
241
|
const { state, room } = await authored.ask({ kind: 'authored.pending', locator, id });
|
|
206
242
|
return { state: state === null ? undefined : JSON.parse(state), room };
|
|
207
243
|
},
|
|
208
|
-
async
|
|
209
|
-
const held = await authored.ask({ kind: 'replica.facts' });
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
targets: json(held.targets, {}),
|
|
216
|
-
conversationList: json(held.conversationList, null),
|
|
217
|
-
conversationCursor: json(held.conversationCursor, null),
|
|
218
|
-
};
|
|
219
|
-
},
|
|
244
|
+
facts: (async (names) => {
|
|
245
|
+
const held = await authored.ask({ kind: 'replica.facts', names: names ?? null });
|
|
246
|
+
return Object.fromEntries((names ?? Object.keys(UNSTATED)).map((name) => [
|
|
247
|
+
name,
|
|
248
|
+
json(held[name], UNSTATED[name]),
|
|
249
|
+
]));
|
|
250
|
+
}),
|
|
220
251
|
async presentation(app) {
|
|
221
252
|
const held = await authored.ask({ kind: 'replica.presentation', app });
|
|
222
253
|
return held === null ? undefined : JSON.parse(held);
|
|
@@ -224,8 +255,11 @@ export function openRuntimeStore(database) {
|
|
|
224
255
|
async demote() {
|
|
225
256
|
await authored.ask({ kind: 'replica.demote' });
|
|
226
257
|
},
|
|
227
|
-
query(plan, rooms, budget) {
|
|
228
|
-
return authored.ask({ kind: 'replica.query', plan, rooms, budget });
|
|
258
|
+
query(plan, rooms, follows, budget) {
|
|
259
|
+
return authored.ask({ kind: 'replica.query', plan, rooms, follows, budget });
|
|
260
|
+
},
|
|
261
|
+
named(plan, rooms, handles) {
|
|
262
|
+
return authored.ask({ kind: 'replica.named', plan, rooms, handles });
|
|
229
263
|
},
|
|
230
264
|
changes(keys) {
|
|
231
265
|
return keys.reduce((total, key) => total + (changed.get(key) ?? 0), 0);
|
|
@@ -239,6 +273,9 @@ export function openRuntimeStore(database) {
|
|
|
239
273
|
referrers(key, view, targets) {
|
|
240
274
|
return authored.ask({ kind: 'replica.referrers', key, view, targets });
|
|
241
275
|
},
|
|
276
|
+
holders(key, view, sought) {
|
|
277
|
+
return authored.ask({ kind: 'replica.holders', key, view, sought });
|
|
278
|
+
},
|
|
242
279
|
folders(key, paths) {
|
|
243
280
|
return authored.ask({ kind: 'replica.folders', key, paths });
|
|
244
281
|
},
|
|
@@ -360,8 +397,17 @@ export function openRuntimeStore(database) {
|
|
|
360
397
|
conversationRows(conversations) {
|
|
361
398
|
return authored.ask({ kind: 'conversation.rows', conversations });
|
|
362
399
|
},
|
|
363
|
-
|
|
364
|
-
|
|
400
|
+
conversationFacts() {
|
|
401
|
+
return authored.ask({ kind: 'conversation.facts' });
|
|
402
|
+
},
|
|
403
|
+
async keepConversationFact(fact) {
|
|
404
|
+
await authored.ask({ kind: 'conversation.fact', ...fact });
|
|
405
|
+
},
|
|
406
|
+
storedConversations() {
|
|
407
|
+
return authored.ask({ kind: 'conversation.stored' });
|
|
408
|
+
},
|
|
409
|
+
dropConversations(conversations) {
|
|
410
|
+
return authored.ask({ kind: 'conversation.drop', conversations });
|
|
365
411
|
},
|
|
366
412
|
async chatDrafts() {
|
|
367
413
|
const records = await authored.ask({ kind: 'authored.chatDrafts' });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ListedEntry, Listing } from '../listing.js';
|
|
2
|
+
export type RoomsShown = {
|
|
3
|
+
now(): Listing | null;
|
|
4
|
+
show(listing: Listing | null): void;
|
|
5
|
+
patch(entries: readonly ListedEntry[]): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function createRoomsShown(): RoomsShown;
|
|
8
|
+
//# sourceMappingURL=rooms-shown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms-shown.d.ts","sourceRoot":"","sources":["../../src/store/rooms-shown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,IAAI,OAAO,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IACpC,KAAK,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,UAAU,CAW7C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createRoomsShown() {
|
|
2
|
+
let shown = null;
|
|
3
|
+
return {
|
|
4
|
+
now: () => shown,
|
|
5
|
+
show(listing) {
|
|
6
|
+
shown = listing === null ? null : new Map(listing);
|
|
7
|
+
},
|
|
8
|
+
patch(entries) {
|
|
9
|
+
for (const entry of entries)
|
|
10
|
+
shown?.set(entry.locator, entry);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
package/dist/store.d.ts
CHANGED
|
@@ -4,26 +4,26 @@ import { type Cell } from './cell.js';
|
|
|
4
4
|
import type { ChangeBatch } from './change.js';
|
|
5
5
|
import type { ChangeSet } from './change-set.js';
|
|
6
6
|
import type { Composition } from './collection.js';
|
|
7
|
-
import type { ReadinessWatch } from './preparation.js';
|
|
7
|
+
import type { ReadinessShowing, ReadinessWatch } from './preparation.js';
|
|
8
8
|
import type { Persistence } from './readiness.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { Retries } from './retried.js';
|
|
10
10
|
import type { Seeded } from './seed.js';
|
|
11
11
|
import type { ModelState } from './model.js';
|
|
12
12
|
import { type OpenedFiles } from './opened.js';
|
|
13
13
|
import { type HeldReplica, type ReplicaRecord } from './replica.js';
|
|
14
|
-
import type { RoomDraftRecord } from './room-draft.js';
|
|
14
|
+
import type { ReturnReason, RoomDraftRecord } from './room-draft.js';
|
|
15
15
|
import { type SyncStatus } from './status.js';
|
|
16
16
|
import type { RuntimeDatabase } from './tables.js';
|
|
17
|
-
import { type Fences } from './store/fences.js';
|
|
18
17
|
import { type Installs } from './store/installs.js';
|
|
19
|
-
import { type HeldCover, type PendingState, type RuntimeStore } from './store/records.js';
|
|
18
|
+
import { type HeldCover, type HeldStatus, type PendingState, type RuntimeStore } from './store/records.js';
|
|
20
19
|
import { type ReadinessQueue } from './store/readiness.js';
|
|
21
20
|
import { type RoomHeld } from './store/room-held.js';
|
|
21
|
+
import { type RoomsShown } from './store/rooms-shown.js';
|
|
22
22
|
import { type Space } from './store/space.js';
|
|
23
23
|
import { type Watcher, type Watching } from './store/watchers.js';
|
|
24
24
|
import { createWrites, type InstallHold } from './store/writes.js';
|
|
25
|
-
export {
|
|
26
|
-
export type { AuthoredWrite, ChatDraftRecord, ChatSubmission, CoveredRoom, Facts, HeldConversation, HeldCover, PendingState, RefreshedPage, RuntimeStore, StagedPage, TransferRecord, } from './store/records.js';
|
|
25
|
+
export type { RoomInstall } from './store/installs.js';
|
|
26
|
+
export type { AuthoredWrite, ChatDraftRecord, ChatSubmission, ConversationFact, CoveredRoom, Facts, HeldConversation, HeldCover, PendingState, RefreshedPage, RuntimeStore, StagedPage, StoredReplica, TransferRecord, } from './store/records.js';
|
|
27
27
|
export type { InstallHold } from './store/writes.js';
|
|
28
28
|
export type { CommittedWrite, QueryRoom, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, View, } from './tables.js';
|
|
29
29
|
export type Stored = {
|
|
@@ -39,7 +39,10 @@ export type Work = {
|
|
|
39
39
|
readonly queue: readonly ChangeBatch[];
|
|
40
40
|
readonly states: ReadonlyMap<string, PendingState>;
|
|
41
41
|
};
|
|
42
|
-
type
|
|
42
|
+
type HeldConflict = {
|
|
43
|
+
readonly revisions: Readonly<Record<string, string | undefined>>;
|
|
44
|
+
readonly returned: ReturnReason | null;
|
|
45
|
+
};
|
|
43
46
|
type AttachedFile = {
|
|
44
47
|
readonly revision: string;
|
|
45
48
|
readonly mediaType: string;
|
|
@@ -52,13 +55,13 @@ type Seeds = {
|
|
|
52
55
|
type Device = {
|
|
53
56
|
readonly persistence: Persistence;
|
|
54
57
|
readonly storageLoss: string | null;
|
|
55
|
-
readonly
|
|
58
|
+
readonly completedWhenOpened: boolean;
|
|
56
59
|
readonly preparing: boolean;
|
|
57
60
|
readonly sweeping: boolean;
|
|
58
61
|
readonly unpreparedDemand: ReadonlySet<string>;
|
|
62
|
+
readonly unpreparable: ReadonlySet<string>;
|
|
59
63
|
readonly establishing: ReadonlySet<string>;
|
|
60
64
|
readonly status: SyncStatus;
|
|
61
|
-
readonly roomsShown: Listing | null;
|
|
62
65
|
};
|
|
63
66
|
type StoreOptions = {
|
|
64
67
|
readonly database: RuntimeDatabase;
|
|
@@ -66,19 +69,24 @@ type StoreOptions = {
|
|
|
66
69
|
readonly builtIn: ModelState;
|
|
67
70
|
readonly typedPaths: readonly TypedPath[];
|
|
68
71
|
readonly persistence: Persistence;
|
|
72
|
+
readonly retries: Retries;
|
|
73
|
+
lost(locator: string): boolean;
|
|
74
|
+
losing(): boolean;
|
|
69
75
|
opening(records: RuntimeStore): Promise<RuntimeStore>;
|
|
70
76
|
unpublished(error: unknown): void;
|
|
71
77
|
changed(set: ChangeSet): Promise<void>;
|
|
72
|
-
deliverReadiness(owed: readonly ReadinessWatch[]): Promise<void>;
|
|
78
|
+
deliverReadiness(owed: readonly ReadinessWatch[], rooms: ReadonlySet<string> | null): Promise<void>;
|
|
73
79
|
spaceFreed(): void;
|
|
74
80
|
};
|
|
75
81
|
export type Store = {
|
|
76
82
|
readonly device: Cell<Device>;
|
|
83
|
+
readonly roomsShown: RoomsShown;
|
|
77
84
|
readonly space: Space;
|
|
78
|
-
readonly readiness: ReadinessQueue<ReadinessWatch>;
|
|
85
|
+
readonly readiness: ReadinessQueue<ReadinessWatch, ReadinessShowing>;
|
|
79
86
|
ask: RuntimeDatabase['ask'];
|
|
80
87
|
changed(set: ChangeSet): Promise<void>;
|
|
81
88
|
open(): Promise<RuntimeStore>;
|
|
89
|
+
needed(): boolean;
|
|
82
90
|
durably<T>(work: (local: RuntimeStore) => Promise<T>): Promise<T>;
|
|
83
91
|
exclusive<T>(work: () => Promise<T>): Promise<T>;
|
|
84
92
|
gathered<I, T>(key: string, input: I, merge: (earlier: I, later: I) => I | null, work: (input: I) => Promise<T>): Promise<T>;
|
|
@@ -95,6 +103,8 @@ export type Store = {
|
|
|
95
103
|
work(locator: string): Promise<Work>;
|
|
96
104
|
replica(locator: string): Promise<Held | undefined>;
|
|
97
105
|
covering(): Promise<HeldCover>;
|
|
106
|
+
status(): Promise<HeldStatus>;
|
|
107
|
+
queued(): Promise<readonly string[]>;
|
|
98
108
|
drafts(locator?: string, paths?: readonly string[]): Promise<readonly RoomDraftRecord[]>;
|
|
99
109
|
draft(locator: string, path: string): Promise<RoomDraftRecord | undefined>;
|
|
100
110
|
composed(record: Pick<ReplicaRecord, 'model' | 'declaration'>): Composition;
|
|
@@ -103,13 +113,13 @@ export type Store = {
|
|
|
103
113
|
watch(topic: string, notify: (value: unknown) => void): Watcher;
|
|
104
114
|
watching(topic: string, which?: Watching): readonly Watcher[];
|
|
105
115
|
tell(topic: string, value: unknown): void;
|
|
106
|
-
readonly fences: Fences;
|
|
107
116
|
readonly installs: Installs;
|
|
108
117
|
readonly seeds: Seeds;
|
|
109
|
-
readonly
|
|
118
|
+
readonly conflicted: RoomHeld<HeldConflict>;
|
|
110
119
|
readonly attached: RoomHeld<AttachedFile>;
|
|
111
120
|
readonly opened: OpenedFiles;
|
|
112
121
|
part(file: string, part: number): Promise<Uint8Array | null>;
|
|
122
|
+
prepareAgain(locator?: string): void;
|
|
113
123
|
forget(locator: string): void;
|
|
114
124
|
close(): void;
|
|
115
125
|
};
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAA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MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC7D,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAMF,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,CA4LxD"}
|
package/dist/store.js
CHANGED
|
@@ -3,45 +3,59 @@ import { createCell } from './cell.js';
|
|
|
3
3
|
import { openedFiles } from './opened.js';
|
|
4
4
|
import { compositionOf } from './replica.js';
|
|
5
5
|
import { STARTING } from './status.js';
|
|
6
|
-
import {
|
|
7
|
-
import { createInstalls } from './store/installs.js';
|
|
6
|
+
import { createInstalls, NO_INSTALL } from './store/installs.js';
|
|
8
7
|
import { openRuntimeStore, } from './store/records.js';
|
|
9
8
|
import { createReadinessQueue } from './store/readiness.js';
|
|
10
9
|
import { createRoomHeld } from './store/room-held.js';
|
|
10
|
+
import { createRoomsShown } from './store/rooms-shown.js';
|
|
11
11
|
import { createSpace } from './store/space.js';
|
|
12
12
|
import { createWatchers } from './store/watchers.js';
|
|
13
13
|
import { createWrites } from './store/writes.js';
|
|
14
|
-
|
|
14
|
+
const OPENING = 'store';
|
|
15
15
|
export function createStore(options) {
|
|
16
16
|
const writes = createWrites();
|
|
17
17
|
const watchers = createWatchers(options.unpublished);
|
|
18
|
-
const
|
|
18
|
+
const { lost } = options;
|
|
19
19
|
const installs = createInstalls();
|
|
20
20
|
const seeds = new Map();
|
|
21
|
-
const
|
|
21
|
+
const conflicted = createRoomHeld();
|
|
22
22
|
const attached = createRoomHeld();
|
|
23
23
|
const typesHeld = new Map();
|
|
24
24
|
const device = createCell({
|
|
25
25
|
persistence: options.persistence,
|
|
26
26
|
storageLoss: null,
|
|
27
|
-
|
|
27
|
+
completedWhenOpened: false,
|
|
28
28
|
preparing: false,
|
|
29
29
|
sweeping: false,
|
|
30
30
|
unpreparedDemand: new Set(),
|
|
31
|
+
unpreparable: new Set(),
|
|
31
32
|
establishing: new Set(),
|
|
32
33
|
status: STARTING,
|
|
33
|
-
roomsShown: null,
|
|
34
34
|
});
|
|
35
35
|
const space = createSpace(options.database, options.spaceFreed);
|
|
36
36
|
const readiness = createReadinessQueue(options.deliverReadiness, options.unpublished);
|
|
37
37
|
let opening;
|
|
38
|
+
let needed = false;
|
|
38
39
|
function open() {
|
|
39
|
-
|
|
40
|
+
needed = true;
|
|
41
|
+
opening ??= options.opening(openRuntimeStore(options.database)).then((opened) => {
|
|
42
|
+
options.retries.succeeded('database', OPENING);
|
|
43
|
+
return opened;
|
|
44
|
+
}, (error) => {
|
|
40
45
|
opening = undefined;
|
|
46
|
+
options.retries.failed('database', OPENING, error);
|
|
41
47
|
throw error;
|
|
42
48
|
});
|
|
43
49
|
return opening;
|
|
44
50
|
}
|
|
51
|
+
function prepareAgain(locator) {
|
|
52
|
+
const { unpreparable } = device.now();
|
|
53
|
+
device.set({
|
|
54
|
+
unpreparable: locator === undefined
|
|
55
|
+
? new Set()
|
|
56
|
+
: new Set([...unpreparable].filter((held) => held !== locator)),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
45
59
|
function typed(locator, persisted) {
|
|
46
60
|
if (persisted.status === 'unavailable')
|
|
47
61
|
return persisted;
|
|
@@ -59,14 +73,14 @@ export function createStore(options) {
|
|
|
59
73
|
async function rooms(locators) {
|
|
60
74
|
const held = await (await open()).rooms(locators);
|
|
61
75
|
return new Map(held
|
|
62
|
-
.filter(({ record }) => !
|
|
76
|
+
.filter(({ record }) => !lost(record.locator))
|
|
63
77
|
.map(({ record, indexed, documents }) => [
|
|
64
78
|
record.locator,
|
|
65
79
|
{ record: recordOf(record), indexed, documents },
|
|
66
80
|
]));
|
|
67
81
|
}
|
|
68
82
|
async function work(locator) {
|
|
69
|
-
if (
|
|
83
|
+
if (lost(locator))
|
|
70
84
|
return { replica: undefined, queue: [], states: new Map() };
|
|
71
85
|
const { room, queue } = await (await open()).room(locator);
|
|
72
86
|
const batches = queue.map(({ batch }) => batch);
|
|
@@ -81,15 +95,17 @@ export function createStore(options) {
|
|
|
81
95
|
}
|
|
82
96
|
async function drafts(locator, paths) {
|
|
83
97
|
const held = await (await open()).roomDrafts(locator, paths);
|
|
84
|
-
return held.filter((record) => !
|
|
98
|
+
return held.filter((record) => !lost(record.locator));
|
|
85
99
|
}
|
|
86
100
|
return {
|
|
87
101
|
device,
|
|
102
|
+
roomsShown: createRoomsShown(),
|
|
88
103
|
space,
|
|
89
104
|
readiness,
|
|
90
105
|
ask: options.database.ask,
|
|
91
106
|
changed: options.changed,
|
|
92
107
|
open,
|
|
108
|
+
needed: () => needed,
|
|
93
109
|
durably: (work) => writes.exclusive(async () => {
|
|
94
110
|
const local = await open();
|
|
95
111
|
return work(local);
|
|
@@ -110,11 +126,25 @@ export function createStore(options) {
|
|
|
110
126
|
replica: async (locator) => (await work(locator)).replica,
|
|
111
127
|
async covering() {
|
|
112
128
|
const held = await (await open()).covering();
|
|
129
|
+
if (!options.losing())
|
|
130
|
+
return held;
|
|
131
|
+
return {
|
|
132
|
+
rooms: new Map([...held.rooms].filter(([locator]) => !lost(locator))),
|
|
133
|
+
locking: new Set([...held.locking].filter((locator) => !lost(locator))),
|
|
134
|
+
queues: new Map([...held.queues].filter(([locator]) => !lost(locator))),
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
async status() {
|
|
138
|
+
const held = await (await open()).status();
|
|
113
139
|
return {
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
queued: held.queued.filter((locator) => !lost(locator)),
|
|
141
|
+
lastCompleted: held.lastCompleted,
|
|
142
|
+
unsent: held.unsent.filter(({ room }) => !lost(room)),
|
|
143
|
+
resets: held.resets.filter(({ locator }) => !lost(locator)),
|
|
144
|
+
returned: held.returned.filter(({ locator }) => !lost(locator)),
|
|
116
145
|
};
|
|
117
146
|
},
|
|
147
|
+
queued: async () => (await (await open()).queued()).filter((locator) => !lost(locator)),
|
|
118
148
|
drafts,
|
|
119
149
|
draft: async (locator, path) => (await drafts(locator, [path]))[0],
|
|
120
150
|
composed: ({ model, declaration }) => compositionOf(model, declaration.typedSelection, options.builtIn, options.typedPaths),
|
|
@@ -123,7 +153,6 @@ export function createStore(options) {
|
|
|
123
153
|
watch: watchers.watch,
|
|
124
154
|
watching: watchers.watching,
|
|
125
155
|
tell: watchers.tell,
|
|
126
|
-
fences,
|
|
127
156
|
installs,
|
|
128
157
|
seeds: {
|
|
129
158
|
of: (key) => seeds.get(key),
|
|
@@ -134,14 +163,17 @@ export function createStore(options) {
|
|
|
134
163
|
seeds.delete(key);
|
|
135
164
|
},
|
|
136
165
|
},
|
|
137
|
-
|
|
166
|
+
conflicted,
|
|
138
167
|
attached,
|
|
139
|
-
opened: openedFiles(options.database,
|
|
168
|
+
opened: openedFiles(options.database, lost),
|
|
169
|
+
prepareAgain,
|
|
140
170
|
part: (file, part) => options.database.ask({ kind: 'file.part', key: file, part }),
|
|
141
171
|
forget(locator) {
|
|
142
172
|
typesHeld.delete(locator);
|
|
143
|
-
|
|
173
|
+
conflicted.forget(locator);
|
|
144
174
|
attached.forget(locator);
|
|
175
|
+
installs.change(locator, ({ installing }) => ({ ...NO_INSTALL, installing }));
|
|
176
|
+
prepareAgain(locator);
|
|
145
177
|
},
|
|
146
178
|
close() {
|
|
147
179
|
space.stop();
|
package/dist/stored.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { SavedFacts, HeadChange } from './adapter.js';
|
|
2
2
|
import { type Composed, type Composition } from './collection.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { HeldAttachment } from './overlay.js';
|
|
4
|
+
import { type Sought } from './rows.js';
|
|
4
5
|
import type { Connection } from './tables.js';
|
|
6
|
+
export declare const ROOM_HANDLE: (alias: string) => string;
|
|
5
7
|
export declare const REPLICA_TABLES: readonly string[];
|
|
6
8
|
export type View = 'confirmed' | 'visible' | 'refreshed';
|
|
7
9
|
export type StoredEntry = {
|
|
8
10
|
readonly path: string;
|
|
9
11
|
readonly content: string | null;
|
|
10
|
-
readonly binary:
|
|
12
|
+
readonly binary: HeldAttachment | null;
|
|
11
13
|
readonly revision: string | null;
|
|
12
14
|
readonly fileId: string | null;
|
|
13
15
|
readonly created: string | null;
|
|
@@ -21,6 +23,11 @@ export type OverlayEntry = StoredEntry & {
|
|
|
21
23
|
export type HeldEntry = StoredEntry & {
|
|
22
24
|
readonly type: string | null;
|
|
23
25
|
};
|
|
26
|
+
export type ValuedEntry = {
|
|
27
|
+
readonly path: string;
|
|
28
|
+
readonly type: string;
|
|
29
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
30
|
+
};
|
|
24
31
|
export type TypedEntry = {
|
|
25
32
|
readonly path: string;
|
|
26
33
|
readonly type: string | null;
|
|
@@ -30,6 +37,10 @@ export type Referrer = {
|
|
|
30
37
|
readonly path: string;
|
|
31
38
|
readonly target: string;
|
|
32
39
|
};
|
|
40
|
+
export type { Sought };
|
|
41
|
+
export type Holder = Sought & {
|
|
42
|
+
readonly path: string;
|
|
43
|
+
};
|
|
33
44
|
export type HeldRoomRow = {
|
|
34
45
|
readonly locator: string;
|
|
35
46
|
readonly key: number;
|
|
@@ -47,17 +58,28 @@ export type HeldRoomWork = {
|
|
|
47
58
|
readonly state: string;
|
|
48
59
|
}[];
|
|
49
60
|
};
|
|
50
|
-
export type
|
|
51
|
-
readonly
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
export type CoverLog = {
|
|
62
|
+
readonly token: string;
|
|
63
|
+
readonly at: number;
|
|
64
|
+
};
|
|
65
|
+
export type CoveredRow = {
|
|
66
|
+
readonly locator: string;
|
|
67
|
+
readonly handle: string;
|
|
68
|
+
readonly key: number;
|
|
69
|
+
readonly transfer: string;
|
|
70
|
+
readonly roomVersion: string;
|
|
71
|
+
readonly indexed: boolean;
|
|
72
|
+
readonly documents: number;
|
|
73
|
+
readonly bytes: number;
|
|
74
|
+
readonly offline: string;
|
|
75
|
+
};
|
|
76
|
+
export type CoveredRooms = {
|
|
77
|
+
readonly log: CoverLog;
|
|
78
|
+
readonly whole: boolean;
|
|
79
|
+
readonly rooms: readonly CoveredRow[];
|
|
80
|
+
readonly removed: readonly string[];
|
|
81
|
+
};
|
|
82
|
+
export type Covering = CoveredRooms & {
|
|
61
83
|
readonly queues: readonly {
|
|
62
84
|
readonly locator: string;
|
|
63
85
|
readonly ids: readonly string[];
|
|
@@ -94,7 +116,8 @@ export type Committed = {
|
|
|
94
116
|
readonly changed: Readonly<Record<string, readonly string[] | null>>;
|
|
95
117
|
readonly indexed: Readonly<Record<string, boolean>>;
|
|
96
118
|
};
|
|
97
|
-
export declare function entered(connection: Connection, locator: string, composition: Composition,
|
|
119
|
+
export declare function entered(connection: Connection, locator: string, composition: Composition, entries: readonly StoredEntry[]): number;
|
|
120
|
+
export declare function enteredValues(connection: Connection, locator: string, composition: Composition, documents: readonly ValuedEntry[]): number;
|
|
98
121
|
export declare function stage(connection: Connection, request: {
|
|
99
122
|
readonly locator: string;
|
|
100
123
|
readonly transfer: string;
|
|
@@ -138,6 +161,7 @@ export declare function rederive(connection: Connection, key: number, composed:
|
|
|
138
161
|
};
|
|
139
162
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
140
163
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
164
|
+
export declare function holders(connection: Connection, key: number, view: View, sought: readonly Sought[]): Holder[];
|
|
141
165
|
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]): Referrer[];
|
|
142
166
|
export declare function folders(connection: Connection, key: number, list: readonly string[]): string[];
|
|
143
167
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
@@ -145,12 +169,13 @@ export declare function opened(connection: Connection): ReplicaOpened;
|
|
|
145
169
|
export declare function heldRooms(connection: Connection, locators: readonly string[] | null): readonly HeldRoomRow[];
|
|
146
170
|
export declare function heldRoom(connection: Connection, locator: string): HeldRoomRow | null;
|
|
147
171
|
export declare function overlaid(connection: Connection, key: number): readonly string[];
|
|
148
|
-
export declare function covering(connection: Connection):
|
|
172
|
+
export declare function covering(connection: Connection, since: CoverLog | null): CoveredRooms;
|
|
149
173
|
export declare function offlineMode(connection: Connection, locator: string): string | null;
|
|
150
174
|
export declare function stagedLocators(connection: Connection): readonly string[];
|
|
151
175
|
export declare function heldLocators(connection: Connection): readonly string[];
|
|
152
176
|
export declare function demoted(connection: Connection): null;
|
|
153
|
-
export declare function facts(connection: Connection): Readonly<Record<string, string>>;
|
|
177
|
+
export declare function facts(connection: Connection, names: readonly string[] | null): Readonly<Record<string, string>>;
|
|
154
178
|
export declare function presentation(connection: Connection, app: string): string | null;
|
|
179
|
+
export declare function tablesOf(statements: readonly string[]): readonly string[];
|
|
155
180
|
export declare function ended(connection: Connection): void;
|
|
156
181
|
//# sourceMappingURL=stored.d.ts.map
|
package/dist/stored.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAc,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAc,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAA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