@agentshouse/mdruntime 0.1.0-c52f87bb83a70 → 0.1.0-c55c6f69061ee
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 +11 -9
- package/dist/adapter.d.ts +94 -63
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +2 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +28 -4
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +16 -8
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +142 -94
- package/dist/change-set.d.ts +1 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +1 -4
- package/dist/client.d.ts +10 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +54 -8
- package/dist/collection.d.ts +5 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +24 -19
- package/dist/compile.d.ts +7 -2
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +125 -48
- package/dist/connection.d.ts +10 -10
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1611 -1313
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +1 -4
- package/dist/conversation.d.ts +17 -14
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +262 -159
- package/dist/durability.d.ts +1 -5
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +1 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +2 -1
- package/dist/file.d.ts +2 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- package/dist/host.d.ts +4 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +52 -32
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +13 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +28 -0
- package/dist/live.d.ts +2 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +9 -5
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +10 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +177 -100
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +89 -0
- package/dist/model.d.ts +6 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -10
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +8 -3
- package/dist/outcome.d.ts +13 -6
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +16 -5
- package/dist/overlay.js +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/phrase.d.ts +3 -0
- package/dist/phrase.d.ts.map +1 -0
- package/dist/phrase.js +8 -0
- package/dist/query.d.ts +14 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +32 -2
- package/dist/reach.d.ts +13 -7
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +80 -64
- package/dist/react.d.ts +1 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +14 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -8
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +26 -0
- package/dist/refresh.d.ts +10 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +104 -30
- package/dist/replica.d.ts +5 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +7 -7
- package/dist/room-draft.d.ts +20 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +131 -51
- package/dist/rows.d.ts +17 -7
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +120 -87
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +13 -7
- package/dist/search.d.ts +12 -95
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -349
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- package/dist/status.d.ts +4 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -1
- package/dist/store.d.ts +34 -60
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +71 -275
- package/dist/stored.d.ts +42 -23
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +198 -210
- package/dist/tables.d.ts +79 -46
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +101 -53
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +35 -96
- package/dist/wire.d.ts +6 -9
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +3 -3
- package/package.json +14 -18
- package/AGENTS.md +0 -310
- package/dist/chat/acts.d.ts +0 -33
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/earlier.d.ts +0 -10
- package/dist/chat/earlier.d.ts.map +0 -1
- package/dist/chat/earlier.js +0 -54
- package/dist/chat/house.d.ts +0 -25
- package/dist/chat/house.d.ts.map +0 -1
- package/dist/chat/house.js +0 -38
- package/dist/chat/input.d.ts +0 -11
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -92
- package/dist/chat/kit.d.ts +0 -61
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -28
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -103
- package/dist/chat/markdown.d.ts +0 -21
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -246
- package/dist/chat/message.d.ts +0 -7
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -237
- package/dist/chat/messages.d.ts +0 -29
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -190
- package/dist/chat/name.d.ts +0 -7
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -12
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -19
- package/dist/chat/overlay.d.ts +0 -32
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -103
- package/dist/chat/parts.d.ts +0 -58
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -120
- package/dist/chat/pieces.d.ts +0 -62
- package/dist/chat/pieces.d.ts.map +0 -1
- package/dist/chat/pieces.js +0 -1110
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -68
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -619
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -69
- package/dist/chat/questions.d.ts +0 -31
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/questions.js +0 -111
- package/dist/chat/read.d.ts +0 -5
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/read.js +0 -13
- package/dist/chat/ready.d.ts +0 -37
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -93
- package/dist/chat/room-file.d.ts +0 -8
- package/dist/chat/room-file.d.ts.map +0 -1
- package/dist/chat/room-file.js +0 -72
- package/dist/chat/steady.d.ts +0 -3
- package/dist/chat/steady.d.ts.map +0 -1
- package/dist/chat/steady.js +0 -26
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -306
- package/dist/chat.d.ts +0 -15
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -98
package/dist/store.js
CHANGED
|
@@ -1,123 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { composedOf } from './collection.js';
|
|
2
2
|
import { binaryLocalId } from './identity.js';
|
|
3
|
-
const DATABASE = 'mdruntime';
|
|
4
|
-
const CONVERSATIONS = 'conversations';
|
|
5
|
-
const MESSAGES = 'messages';
|
|
6
3
|
const FILE = '\u0000file';
|
|
7
|
-
export const STORE_SCHEMA = 26;
|
|
8
|
-
const STORES = [
|
|
9
|
-
[CONVERSATIONS, { keyPath: 'conversation' }],
|
|
10
|
-
[MESSAGES, { keyPath: ['conversation', 'identity'] }],
|
|
11
|
-
];
|
|
12
|
-
const READ_BATCH = 256;
|
|
13
|
-
const MESSAGE_INDEXES = [
|
|
14
|
-
['conversation', 'conversation'],
|
|
15
|
-
['position', ['conversation', 'position']],
|
|
16
|
-
['turn', ['conversation', 'turn']],
|
|
17
|
-
];
|
|
18
|
-
function settled(request) {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
request.onsuccess = () => resolve(request.result);
|
|
21
|
-
request.onerror = () => reject(request.error);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const turns = new Map();
|
|
25
|
-
function idle(database) {
|
|
26
|
-
return turns.get(database.name) ?? Promise.resolve();
|
|
27
|
-
}
|
|
28
|
-
export function transacted(database, stores, mode, work) {
|
|
29
|
-
let release = () => { };
|
|
30
|
-
const turn = new Promise((resolve) => {
|
|
31
|
-
release = resolve;
|
|
32
|
-
});
|
|
33
|
-
const before = idle(database);
|
|
34
|
-
const queued = before.then(() => turn);
|
|
35
|
-
turns.set(database.name, queued);
|
|
36
|
-
void queued.then(() => {
|
|
37
|
-
if (turns.get(database.name) === queued)
|
|
38
|
-
turns.delete(database.name);
|
|
39
|
-
});
|
|
40
|
-
return before.then(() => {
|
|
41
|
-
let transaction;
|
|
42
|
-
try {
|
|
43
|
-
transaction = database.transaction(stores, mode);
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
release();
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
const committed = new Promise((resolve, reject) => {
|
|
50
|
-
transaction.oncomplete = () => {
|
|
51
|
-
release();
|
|
52
|
-
resolve();
|
|
53
|
-
};
|
|
54
|
-
transaction.onabort = () => {
|
|
55
|
-
release();
|
|
56
|
-
reject(transaction.error);
|
|
57
|
-
};
|
|
58
|
-
transaction.onerror = () => reject(transaction.error);
|
|
59
|
-
});
|
|
60
|
-
let value;
|
|
61
|
-
try {
|
|
62
|
-
value = work(transaction);
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
void committed.catch(() => { });
|
|
66
|
-
transaction.abort();
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
69
|
-
return Promise.all([value, committed]).then(([held]) => held);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function accepted({ conversation: _held, ...message }) {
|
|
73
|
-
return message;
|
|
74
|
-
}
|
|
75
|
-
function removeDatabase(name) {
|
|
76
|
-
return new Promise((resolve, reject) => {
|
|
77
|
-
const removal = indexedDB.deleteDatabase(name);
|
|
78
|
-
removal.onsuccess = () => resolve();
|
|
79
|
-
removal.onerror = () => reject(removal.error);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
export async function endRuntimeStore(database, holder) {
|
|
83
|
-
await removeDatabase(DATABASE);
|
|
84
|
-
return database.ask({ kind: 'authored.end', holder: holder ?? null });
|
|
85
|
-
}
|
|
86
|
-
export function openDatabase(name, version, upgrade) {
|
|
87
|
-
return new Promise((resolve, reject) => {
|
|
88
|
-
const opening = indexedDB.open(name, version);
|
|
89
|
-
opening.onupgradeneeded = (event) => upgrade(opening, event.oldVersion);
|
|
90
|
-
opening.onsuccess = () => resolve(opening.result);
|
|
91
|
-
opening.onerror = () => {
|
|
92
|
-
if (opening.error?.name !== 'VersionError') {
|
|
93
|
-
reject(opening.error);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
removeDatabase(name)
|
|
97
|
-
.then(() => openDatabase(name, version, upgrade))
|
|
98
|
-
.then(resolve, reject);
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function openConversations() {
|
|
103
|
-
return openDatabase(DATABASE, STORE_SCHEMA, (opening, oldVersion) => {
|
|
104
|
-
const database = opening.result;
|
|
105
|
-
if (oldVersion < STORE_SCHEMA) {
|
|
106
|
-
for (const name of [...database.objectStoreNames])
|
|
107
|
-
database.deleteObjectStore(name);
|
|
108
|
-
}
|
|
109
|
-
for (const [name, parameters] of STORES) {
|
|
110
|
-
if (database.objectStoreNames.contains(name))
|
|
111
|
-
continue;
|
|
112
|
-
database.createObjectStore(name, parameters);
|
|
113
|
-
}
|
|
114
|
-
const messages = opening.transaction.objectStore(MESSAGES);
|
|
115
|
-
for (const [name, keyPath] of MESSAGE_INDEXES) {
|
|
116
|
-
if (!messages.indexNames.contains(name))
|
|
117
|
-
messages.createIndex(name, keyPath);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
4
|
function batchFiles(batch) {
|
|
122
5
|
return batch.changes.flatMap((change) => (change.kind === 'binary' ? [change.localId] : []));
|
|
123
6
|
}
|
|
@@ -127,7 +10,7 @@ function draftFiles(drafts) {
|
|
|
127
10
|
function roomDraftRow(record) {
|
|
128
11
|
return { path: record.path, record: JSON.stringify(record), files: draftFiles([record]) };
|
|
129
12
|
}
|
|
130
|
-
function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoomDrafts
|
|
13
|
+
function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoomDrafts }, held) {
|
|
131
14
|
return {
|
|
132
15
|
locator,
|
|
133
16
|
...(queue === undefined
|
|
@@ -161,14 +44,6 @@ function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoom
|
|
|
161
44
|
}),
|
|
162
45
|
...(roomDrafts === undefined ? {} : { roomDrafts: roomDrafts.map(roomDraftRow) }),
|
|
163
46
|
...(consumedRoomDrafts === undefined ? {} : { consumedRoomDrafts }),
|
|
164
|
-
...(accepted === undefined
|
|
165
|
-
? {}
|
|
166
|
-
: {
|
|
167
|
-
amendments: accepted.map(({ id, roomVersion }) => ({
|
|
168
|
-
id,
|
|
169
|
-
amendment: JSON.stringify({ accepted: roomVersion }),
|
|
170
|
-
})),
|
|
171
|
-
}),
|
|
172
47
|
};
|
|
173
48
|
}
|
|
174
49
|
function marked(value) {
|
|
@@ -206,8 +81,7 @@ async function filed(value, read) {
|
|
|
206
81
|
function json(value, fallback) {
|
|
207
82
|
return value === undefined ? fallback : JSON.parse(value);
|
|
208
83
|
}
|
|
209
|
-
export
|
|
210
|
-
const database = await openConversations();
|
|
84
|
+
export function openRuntimeStore(fenced, authored) {
|
|
211
85
|
const keys = new WeakMap();
|
|
212
86
|
const read = async (key, type) => {
|
|
213
87
|
const blob = await authored.ask({ kind: 'authored.file', key, type });
|
|
@@ -239,7 +113,7 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
239
113
|
return {
|
|
240
114
|
async opened() {
|
|
241
115
|
const held = await authored.ask({ kind: 'replica.open' });
|
|
242
|
-
const
|
|
116
|
+
const unindexed = new Set(held.keys.flatMap(({ key, rederiving }) => (rederiving === null ? [] : [key])));
|
|
243
117
|
const overlaid = new Map();
|
|
244
118
|
for (const { key, path } of held.overlaid) {
|
|
245
119
|
const paths = overlaid.get(key) ?? new Set();
|
|
@@ -253,13 +127,7 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
253
127
|
locator,
|
|
254
128
|
{ ...JSON.parse(record), key },
|
|
255
129
|
])),
|
|
256
|
-
|
|
257
|
-
.filter(({ locator }) => !fenced(locator))
|
|
258
|
-
.map(({ locator, key, record }) => [
|
|
259
|
-
locator,
|
|
260
|
-
{ ...JSON.parse(record), key },
|
|
261
|
-
])),
|
|
262
|
-
unprepared,
|
|
130
|
+
unindexed,
|
|
263
131
|
overlaid,
|
|
264
132
|
erasing: held.erasing.length > 0,
|
|
265
133
|
orphans: held.orphans,
|
|
@@ -272,6 +140,8 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
272
140
|
app,
|
|
273
141
|
value: JSON.parse(value),
|
|
274
142
|
})),
|
|
143
|
+
conversationList: json(held.facts.conversationList, null),
|
|
144
|
+
conversationCursor: json(held.facts.conversationCursor, null),
|
|
275
145
|
};
|
|
276
146
|
},
|
|
277
147
|
counts(rooms) {
|
|
@@ -292,37 +162,33 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
292
162
|
referrers(key, view, targets, kinds) {
|
|
293
163
|
return authored.ask({ kind: 'replica.referrers', key, view, targets, kinds });
|
|
294
164
|
},
|
|
295
|
-
walk(key, view, after, bytes) {
|
|
296
|
-
return authored.ask({ kind: 'replica.walk', key, view, after, bytes });
|
|
297
|
-
},
|
|
298
165
|
files(key, view, after, limit) {
|
|
299
166
|
return authored.ask({ kind: 'replica.files', key, view, after, limit });
|
|
300
167
|
},
|
|
168
|
+
folders(key, view, paths) {
|
|
169
|
+
return authored.ask({ kind: 'replica.folders', key, view, paths });
|
|
170
|
+
},
|
|
301
171
|
typedWithin(key, view, roots, within) {
|
|
302
172
|
return authored.ask({ kind: 'replica.typedWithin', key, view, roots, within });
|
|
303
173
|
},
|
|
304
|
-
|
|
305
|
-
return authored.ask({ kind: 'replica.searched', key, locator, after, limit, paths });
|
|
306
|
-
},
|
|
307
|
-
async stage(record, composition, page, key, last) {
|
|
174
|
+
async stage(record, composition, page) {
|
|
308
175
|
if (fenced(record.locator))
|
|
309
176
|
return null;
|
|
310
|
-
const { key: _key, ...kept } = record;
|
|
311
177
|
return authored.ask({
|
|
312
178
|
kind: 'replica.stage',
|
|
313
179
|
locator: record.locator,
|
|
314
180
|
transfer: record.transfer,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
composition,
|
|
181
|
+
key: record.key,
|
|
182
|
+
fingerprint: composedOf(composition).fingerprint,
|
|
318
183
|
entries: page.entries,
|
|
319
184
|
folders: page.folders,
|
|
320
185
|
});
|
|
321
186
|
},
|
|
322
|
-
async refresh(key, page) {
|
|
187
|
+
async refresh(key, composition, page) {
|
|
323
188
|
await authored.ask({
|
|
324
189
|
kind: 'replica.refresh',
|
|
325
190
|
key,
|
|
191
|
+
composed: composedOf(composition),
|
|
326
192
|
entries: page.entries,
|
|
327
193
|
removals: page.removals,
|
|
328
194
|
folders: page.folders,
|
|
@@ -332,11 +198,44 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
332
198
|
async unrefresh(key) {
|
|
333
199
|
await authored.ask({ kind: 'replica.unrefresh', key });
|
|
334
200
|
},
|
|
201
|
+
async hold(locator, key, composition, texts) {
|
|
202
|
+
if (fenced(locator))
|
|
203
|
+
return [];
|
|
204
|
+
change(key);
|
|
205
|
+
return authored.ask({
|
|
206
|
+
kind: 'replica.hold',
|
|
207
|
+
key,
|
|
208
|
+
locator,
|
|
209
|
+
composed: composedOf(composition),
|
|
210
|
+
texts,
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
async unhold(locator, key, composition) {
|
|
214
|
+
if (fenced(locator))
|
|
215
|
+
return { paths: [], bytes: 0 };
|
|
216
|
+
change(key);
|
|
217
|
+
return authored.ask({
|
|
218
|
+
kind: 'replica.unhold',
|
|
219
|
+
key,
|
|
220
|
+
locator,
|
|
221
|
+
composed: composedOf(composition),
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
async wanted(locator, key) {
|
|
225
|
+
if (fenced(locator))
|
|
226
|
+
return [];
|
|
227
|
+
return authored.ask({ kind: 'replica.wanted', key, locator });
|
|
228
|
+
},
|
|
229
|
+
async remember(locator, key, paths) {
|
|
230
|
+
if (fenced(locator) || paths.length === 0)
|
|
231
|
+
return;
|
|
232
|
+
await authored.ask({ kind: 'replica.remember', key, locator, paths });
|
|
233
|
+
},
|
|
335
234
|
async commit({ rooms, writes = [], files = [], whole = false, discards = [] }) {
|
|
336
235
|
const kept = whole ? writes : writes.filter(({ locator }) => !fenced(locator));
|
|
337
236
|
const refused = whole ? kept.find(({ locator }) => fenced(locator)) : undefined;
|
|
338
237
|
if (refused !== undefined) {
|
|
339
|
-
return { fenced: refused.locator, counts: {}, changed: {},
|
|
238
|
+
return { fenced: refused.locator, counts: {}, changed: {}, indexed: {} };
|
|
340
239
|
}
|
|
341
240
|
for (const room of rooms)
|
|
342
241
|
change(room.key);
|
|
@@ -361,17 +260,24 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
361
260
|
async erase(locator, limit) {
|
|
362
261
|
return (await authored.ask({ kind: 'replica.erase', locator, limit })).remaining;
|
|
363
262
|
},
|
|
364
|
-
async abandon(locator
|
|
263
|
+
async abandon(locator) {
|
|
365
264
|
if (fenced(locator))
|
|
366
|
-
return
|
|
367
|
-
|
|
265
|
+
return;
|
|
266
|
+
await authored.ask({ kind: 'replica.abandon', locator });
|
|
368
267
|
},
|
|
369
268
|
async release(key) {
|
|
370
269
|
await authored.ask({ kind: 'replica.release', key });
|
|
371
270
|
},
|
|
372
|
-
async rederive(key,
|
|
271
|
+
async rederive(key, composition, bytes, ms, floor) {
|
|
373
272
|
change(key);
|
|
374
|
-
return
|
|
273
|
+
return authored.ask({
|
|
274
|
+
kind: 'replica.rederive',
|
|
275
|
+
key,
|
|
276
|
+
composed: composedOf(composition),
|
|
277
|
+
bytes,
|
|
278
|
+
ms,
|
|
279
|
+
floor,
|
|
280
|
+
});
|
|
375
281
|
},
|
|
376
282
|
async fact(name, value) {
|
|
377
283
|
await authored.ask({ kind: 'replica.fact', name, value: JSON.stringify(value) });
|
|
@@ -417,110 +323,22 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
417
323
|
});
|
|
418
324
|
},
|
|
419
325
|
conversations() {
|
|
420
|
-
return
|
|
421
|
-
const records = await settled(transaction.objectStore(CONVERSATIONS).getAll());
|
|
422
|
-
const held = new Map(records.map(({ conversation, read, partial }) => [
|
|
423
|
-
conversation,
|
|
424
|
-
{ conversation, read, partial: partial === true },
|
|
425
|
-
]));
|
|
426
|
-
const keys = transaction.objectStore(MESSAGES).index('conversation');
|
|
427
|
-
await new Promise((resolve, reject) => {
|
|
428
|
-
const cursor = keys.openKeyCursor(null, 'nextunique');
|
|
429
|
-
cursor.onerror = () => reject(cursor.error);
|
|
430
|
-
cursor.onsuccess = () => {
|
|
431
|
-
const at = cursor.result;
|
|
432
|
-
if (at === null) {
|
|
433
|
-
resolve();
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
const conversation = at.key;
|
|
437
|
-
if (!held.has(conversation)) {
|
|
438
|
-
held.set(conversation, { conversation, read: undefined, partial: true });
|
|
439
|
-
}
|
|
440
|
-
at.continue();
|
|
441
|
-
};
|
|
442
|
-
});
|
|
443
|
-
return [...held.values()];
|
|
444
|
-
});
|
|
445
|
-
},
|
|
446
|
-
async keepMessages({ conversation, messages, read }) {
|
|
447
|
-
await transacted(database, [CONVERSATIONS, MESSAGES], 'readwrite', (transaction) => {
|
|
448
|
-
const stored = transaction.objectStore(MESSAGES);
|
|
449
|
-
for (const message of messages) {
|
|
450
|
-
stored.put({ ...message, conversation });
|
|
451
|
-
}
|
|
452
|
-
if (read !== undefined) {
|
|
453
|
-
transaction.objectStore(CONVERSATIONS).put({
|
|
454
|
-
conversation,
|
|
455
|
-
read: read.at,
|
|
456
|
-
...(read.partial ? { partial: true } : {}),
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
});
|
|
326
|
+
return authored.ask({ kind: 'conversation.held' });
|
|
460
327
|
},
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const index = transaction.objectStore(MESSAGES).index('position');
|
|
464
|
-
const range = IDBKeyRange.bound([conversation], [conversation, before?.[0] ?? []]);
|
|
465
|
-
const latest = [];
|
|
466
|
-
let more = false;
|
|
467
|
-
await new Promise((resolve, reject) => {
|
|
468
|
-
const cursor = index.openCursor(range, 'prev');
|
|
469
|
-
cursor.onerror = () => reject(cursor.error);
|
|
470
|
-
cursor.onsuccess = () => {
|
|
471
|
-
const at = cursor.result;
|
|
472
|
-
if (at === null) {
|
|
473
|
-
resolve();
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
const record = at.value;
|
|
477
|
-
if (!precedes(record, before)) {
|
|
478
|
-
at.continue();
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
if (latest.length === limit) {
|
|
482
|
-
more = true;
|
|
483
|
-
resolve();
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
latest.push(accepted(record));
|
|
487
|
-
at.continue();
|
|
488
|
-
};
|
|
489
|
-
});
|
|
490
|
-
return { messages: latest.reverse(), more };
|
|
491
|
-
});
|
|
492
|
-
},
|
|
493
|
-
messageCount(conversation) {
|
|
494
|
-
return transacted(database, MESSAGES, 'readonly', (transaction) => settled(transaction.objectStore(MESSAGES).index('conversation').count(conversation)));
|
|
328
|
+
async keepMessages(write) {
|
|
329
|
+
await authored.ask({ kind: 'conversation.keep', ...write });
|
|
495
330
|
},
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
? IDBKeyRange.bound([conversation], [conversation, []])
|
|
499
|
-
: IDBKeyRange.bound([conversation, identity], [conversation, []], true);
|
|
500
|
-
const held = await transacted(database, MESSAGES, 'readonly', (transaction) => settled(transaction.objectStore(MESSAGES).getAll(range, READ_BATCH)));
|
|
501
|
-
return held.map(accepted);
|
|
331
|
+
messageWindow(conversation, limit, before, phrase = null) {
|
|
332
|
+
return authored.ask({ kind: 'conversation.window', conversation, limit, before, phrase });
|
|
502
333
|
},
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
return found.map((key) => key[1]);
|
|
334
|
+
messageCount(conversation, phrase = null) {
|
|
335
|
+
return authored.ask({ kind: 'conversation.count', conversation, phrase });
|
|
506
336
|
},
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return held > 0;
|
|
337
|
+
turnArrived(conversation, turn) {
|
|
338
|
+
return authored.ask({ kind: 'conversation.turn', conversation, turn });
|
|
510
339
|
},
|
|
511
340
|
async dropConversations(conversations) {
|
|
512
|
-
await authored.ask({ kind: '
|
|
513
|
-
await transacted(database, [CONVERSATIONS, MESSAGES], 'readwrite', (transaction) => {
|
|
514
|
-
const messages = transaction.objectStore(MESSAGES);
|
|
515
|
-
for (const conversation of conversations) {
|
|
516
|
-
transaction.objectStore(CONVERSATIONS).delete(conversation);
|
|
517
|
-
const held = messages.index('conversation').getAllKeys(conversation);
|
|
518
|
-
held.onsuccess = () => {
|
|
519
|
-
for (const key of held.result)
|
|
520
|
-
messages.delete(key);
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
});
|
|
341
|
+
await authored.ask({ kind: 'conversation.drop', conversations });
|
|
524
342
|
},
|
|
525
343
|
async chatDrafts() {
|
|
526
344
|
const records = await authored.ask({ kind: 'authored.chatDrafts' });
|
|
@@ -574,25 +392,6 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
574
392
|
fences() {
|
|
575
393
|
return authored.ask({ kind: 'authored.fences' });
|
|
576
394
|
},
|
|
577
|
-
receivedHeads() {
|
|
578
|
-
return authored.ask({ kind: 'replica.received' });
|
|
579
|
-
},
|
|
580
|
-
receivedParts(key, count) {
|
|
581
|
-
return authored.ask({ kind: 'replica.receivedParts', key, count });
|
|
582
|
-
},
|
|
583
|
-
async keepReceived(key, head, part) {
|
|
584
|
-
await authored.ask({
|
|
585
|
-
kind: 'replica.receive',
|
|
586
|
-
key,
|
|
587
|
-
head: JSON.stringify(head),
|
|
588
|
-
...(part === undefined
|
|
589
|
-
? {}
|
|
590
|
-
: { part: { index: part.index, value: JSON.stringify(part.value) } }),
|
|
591
|
-
});
|
|
592
|
-
},
|
|
593
|
-
async dropReceived(keys) {
|
|
594
|
-
await authored.ask({ kind: 'replica.unreceive', keys });
|
|
595
|
-
},
|
|
596
395
|
generation() {
|
|
597
396
|
return fact('generation');
|
|
598
397
|
},
|
|
@@ -602,8 +401,5 @@ export async function openRuntimeStore(fenced, authored) {
|
|
|
602
401
|
file(key, type) {
|
|
603
402
|
return authored.ask({ kind: 'authored.file', key, type });
|
|
604
403
|
},
|
|
605
|
-
close() {
|
|
606
|
-
void idle(database).then(() => database.close());
|
|
607
|
-
},
|
|
608
404
|
};
|
|
609
405
|
}
|
package/dist/stored.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { Outline } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { HeadChange } from './adapter.js';
|
|
2
|
-
import type
|
|
3
|
+
import { type Composed, type Composition } from './collection.js';
|
|
3
4
|
import type { HeldBinary } from './overlay.js';
|
|
4
|
-
import type { SearchedDocument } from './search.js';
|
|
5
5
|
import type { Connection } from './tables.js';
|
|
6
6
|
export declare const REPLICA_TABLES: readonly string[];
|
|
7
7
|
export type View = 'confirmed' | 'visible' | 'refreshed';
|
|
8
8
|
export type StoredEntry = {
|
|
9
9
|
readonly path: string;
|
|
10
10
|
readonly content: string | null;
|
|
11
|
+
readonly outline: Outline | null;
|
|
11
12
|
readonly binary: HeldBinary | null;
|
|
12
13
|
readonly revision: string | null;
|
|
13
14
|
readonly fileId: string | null;
|
|
@@ -42,11 +43,6 @@ export type ReplicaOpened = {
|
|
|
42
43
|
readonly key: number;
|
|
43
44
|
readonly record: string;
|
|
44
45
|
}[];
|
|
45
|
-
readonly transfers: readonly {
|
|
46
|
-
readonly locator: string;
|
|
47
|
-
readonly key: number;
|
|
48
|
-
readonly record: string;
|
|
49
|
-
}[];
|
|
50
46
|
readonly keys: readonly HeldKey[];
|
|
51
47
|
readonly facts: Readonly<Record<string, string>>;
|
|
52
48
|
readonly presentation: readonly {
|
|
@@ -72,7 +68,7 @@ export type RoomCommit = {
|
|
|
72
68
|
readonly from: number | null;
|
|
73
69
|
};
|
|
74
70
|
readonly refreshed?: true;
|
|
75
|
-
readonly
|
|
71
|
+
readonly composed: Composed;
|
|
76
72
|
readonly confirmed?: {
|
|
77
73
|
readonly set: readonly StoredEntry[];
|
|
78
74
|
readonly removed: readonly string[];
|
|
@@ -85,29 +81,24 @@ export type RoomCommit = {
|
|
|
85
81
|
export type Committed = {
|
|
86
82
|
readonly counts: Readonly<Record<string, number>>;
|
|
87
83
|
readonly changed: Readonly<Record<string, readonly string[] | null>>;
|
|
88
|
-
readonly
|
|
84
|
+
readonly indexed: Readonly<Record<string, boolean>>;
|
|
89
85
|
};
|
|
90
86
|
export type CountedRoom = {
|
|
91
87
|
readonly key: number;
|
|
92
88
|
readonly roots: readonly string[];
|
|
93
89
|
};
|
|
94
|
-
export type Walked = {
|
|
95
|
-
readonly entries: readonly HeldEntry[];
|
|
96
|
-
readonly next: string | null;
|
|
97
|
-
};
|
|
98
|
-
export declare function fingerprint(composition: Composition): string;
|
|
99
90
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
100
91
|
export declare function stage(connection: Connection, request: {
|
|
101
92
|
readonly locator: string;
|
|
102
93
|
readonly transfer: string;
|
|
103
|
-
readonly record: string | null;
|
|
104
94
|
readonly key: number | null;
|
|
105
|
-
readonly
|
|
95
|
+
readonly fingerprint: string;
|
|
106
96
|
readonly entries: readonly StoredEntry[];
|
|
107
97
|
readonly folders: readonly string[];
|
|
108
98
|
}): number;
|
|
109
99
|
export declare function refreshing(connection: Connection, request: {
|
|
110
100
|
readonly key: number;
|
|
101
|
+
readonly composed: Composed;
|
|
111
102
|
readonly entries: readonly StoredEntry[];
|
|
112
103
|
readonly removals: readonly string[];
|
|
113
104
|
readonly folders: readonly string[];
|
|
@@ -117,27 +108,55 @@ export declare function unrefresh(connection: Connection, key: number): null;
|
|
|
117
108
|
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
118
109
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
119
110
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
120
|
-
export declare function abandon(connection: Connection, locator: string
|
|
111
|
+
export declare function abandon(connection: Connection, locator: string): null;
|
|
121
112
|
export declare function release(connection: Connection, key: number): null;
|
|
122
113
|
export declare function erase(connection: Connection, locator: string | null, limit: number): {
|
|
123
114
|
readonly remaining: boolean;
|
|
124
115
|
};
|
|
125
|
-
export declare function rederive(connection: Connection, key: number,
|
|
116
|
+
export declare function rederive(connection: Connection, key: number, composed: Composed, bytes: number, ms: number, floor: number): {
|
|
126
117
|
readonly done: boolean;
|
|
118
|
+
readonly text: number;
|
|
119
|
+
};
|
|
120
|
+
export type HeldText = {
|
|
121
|
+
readonly path: string;
|
|
122
|
+
readonly revision: string;
|
|
123
|
+
readonly content: string;
|
|
124
|
+
};
|
|
125
|
+
export declare function holdTexts(connection: Connection, request: {
|
|
126
|
+
readonly key: number;
|
|
127
|
+
readonly locator: string;
|
|
128
|
+
readonly composed: Composed;
|
|
129
|
+
readonly texts: readonly HeldText[];
|
|
130
|
+
}): string[];
|
|
131
|
+
export declare function unholdTexts(connection: Connection, request: {
|
|
132
|
+
readonly key: number;
|
|
133
|
+
readonly locator: string;
|
|
134
|
+
readonly composed: Composed;
|
|
135
|
+
}): {
|
|
136
|
+
readonly paths: readonly string[];
|
|
137
|
+
readonly bytes: number;
|
|
127
138
|
};
|
|
139
|
+
export declare function remembered(connection: Connection, request: {
|
|
140
|
+
readonly key: number;
|
|
141
|
+
readonly locator: string;
|
|
142
|
+
readonly paths: readonly string[];
|
|
143
|
+
}): null;
|
|
144
|
+
export declare function wanted(connection: Connection, request: {
|
|
145
|
+
readonly key: number;
|
|
146
|
+
readonly locator: string;
|
|
147
|
+
}): {
|
|
148
|
+
readonly path: string;
|
|
149
|
+
readonly revision: string;
|
|
150
|
+
}[];
|
|
128
151
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
129
152
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
130
153
|
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[], kinds: readonly string[]): Referrer[];
|
|
131
|
-
export declare function walk(connection: Connection, key: number, view: View, after: string | null, bytes: number): Walked;
|
|
132
154
|
export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
|
|
133
155
|
readonly path: string;
|
|
134
156
|
readonly revision: string;
|
|
135
157
|
}[];
|
|
158
|
+
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
136
159
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
137
|
-
export declare function searched(connection: Connection, key: number, locator: string, after: string | null, limit: number, only: readonly string[] | null): {
|
|
138
|
-
readonly documents: readonly SearchedDocument[];
|
|
139
|
-
readonly next: string | null;
|
|
140
|
-
};
|
|
141
160
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
142
161
|
export declare function ended(connection: Connection): void;
|
|
143
162
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAc,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9E,O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