@agentshouse/mdruntime 0.1.0-c2e8a6f99866d → 0.1.0-c2ef9303a058d

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.
Files changed (220) hide show
  1. package/README.md +11 -9
  2. package/dist/adapter.d.ts +95 -67
  3. package/dist/adapter.d.ts.map +1 -1
  4. package/dist/attached-model.d.ts +5 -11
  5. package/dist/attached-model.d.ts.map +1 -1
  6. package/dist/attached-model.js +36 -47
  7. package/dist/binary.d.ts +0 -5
  8. package/dist/binary.d.ts.map +1 -1
  9. package/dist/binary.js +1 -1
  10. package/dist/bootstrap.d.ts +17 -9
  11. package/dist/bootstrap.d.ts.map +1 -1
  12. package/dist/bootstrap.js +143 -94
  13. package/dist/chain.d.ts +2 -1
  14. package/dist/chain.d.ts.map +1 -1
  15. package/dist/change-set.d.ts +1 -7
  16. package/dist/change-set.d.ts.map +1 -1
  17. package/dist/change-set.js +1 -4
  18. package/dist/client.d.ts +15 -12
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +56 -8
  21. package/dist/collection.d.ts +7 -4
  22. package/dist/collection.d.ts.map +1 -1
  23. package/dist/collection.js +24 -19
  24. package/dist/compile.d.ts.map +1 -1
  25. package/dist/compile.js +117 -243
  26. package/dist/connection.d.ts +14 -12
  27. package/dist/connection.d.ts.map +1 -1
  28. package/dist/connection.js +1466 -1431
  29. package/dist/context.d.ts +2 -0
  30. package/dist/context.d.ts.map +1 -0
  31. package/dist/{chat/context.js → context.js} +1 -4
  32. package/dist/conversation.d.ts +18 -15
  33. package/dist/conversation.d.ts.map +1 -1
  34. package/dist/conversation.js +273 -185
  35. package/dist/durability.d.ts +6 -4
  36. package/dist/durability.d.ts.map +1 -1
  37. package/dist/durability.js +5 -0
  38. package/dist/entry.d.ts +3 -2
  39. package/dist/entry.d.ts.map +1 -1
  40. package/dist/entry.js +17 -8
  41. package/dist/file.d.ts +2 -11
  42. package/dist/file.d.ts.map +1 -1
  43. package/dist/file.js +6 -4
  44. package/dist/host.d.ts +3 -7
  45. package/dist/host.d.ts.map +1 -1
  46. package/dist/host.js +55 -38
  47. package/dist/identity.d.ts +0 -2
  48. package/dist/identity.d.ts.map +1 -1
  49. package/dist/identity.js +0 -6
  50. package/dist/index.d.ts +15 -12
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +6 -3
  53. package/dist/job.d.ts +14 -0
  54. package/dist/job.d.ts.map +1 -0
  55. package/dist/job.js +28 -0
  56. package/dist/live.d.ts +2 -1
  57. package/dist/live.d.ts.map +1 -1
  58. package/dist/live.js +9 -5
  59. package/dist/media.d.ts +8 -0
  60. package/dist/media.d.ts.map +1 -0
  61. package/dist/media.js +218 -0
  62. package/dist/memory.d.ts +12 -6
  63. package/dist/memory.d.ts.map +1 -1
  64. package/dist/memory.js +209 -101
  65. package/dist/messages.d.ts +28 -0
  66. package/dist/messages.d.ts.map +1 -0
  67. package/dist/messages.js +89 -0
  68. package/dist/model.d.ts +8 -8
  69. package/dist/model.d.ts.map +1 -1
  70. package/dist/model.js +7 -13
  71. package/dist/observation.d.ts +3 -2
  72. package/dist/observation.d.ts.map +1 -1
  73. package/dist/observation.js +8 -3
  74. package/dist/outcome.d.ts +13 -6
  75. package/dist/outcome.d.ts.map +1 -1
  76. package/dist/outcome.js +16 -5
  77. package/dist/overlay.js +1 -1
  78. package/dist/paths.d.ts +1 -0
  79. package/dist/paths.d.ts.map +1 -1
  80. package/dist/paths.js +4 -0
  81. package/dist/query.d.ts +10 -206
  82. package/dist/query.d.ts.map +1 -1
  83. package/dist/query.js +3 -494
  84. package/dist/reach.d.ts +14 -9
  85. package/dist/reach.d.ts.map +1 -1
  86. package/dist/reach.js +84 -72
  87. package/dist/react.d.ts +3 -1
  88. package/dist/react.d.ts.map +1 -1
  89. package/dist/readiness.d.ts +14 -17
  90. package/dist/readiness.d.ts.map +1 -1
  91. package/dist/readiness.js +2 -8
  92. package/dist/recovery.d.ts +1 -0
  93. package/dist/recovery.d.ts.map +1 -1
  94. package/dist/recovery.js +26 -0
  95. package/dist/refresh.d.ts +10 -4
  96. package/dist/refresh.d.ts.map +1 -1
  97. package/dist/refresh.js +88 -30
  98. package/dist/replica.d.ts +11 -8
  99. package/dist/replica.d.ts.map +1 -1
  100. package/dist/replica.js +30 -15
  101. package/dist/room-draft.d.ts +22 -5
  102. package/dist/room-draft.d.ts.map +1 -1
  103. package/dist/room-draft.js +131 -51
  104. package/dist/rows.d.ts +18 -16
  105. package/dist/rows.d.ts.map +1 -1
  106. package/dist/rows.js +45 -153
  107. package/dist/save.d.ts +2 -0
  108. package/dist/save.d.ts.map +1 -1
  109. package/dist/save.js +13 -7
  110. package/dist/search.d.ts +12 -95
  111. package/dist/search.d.ts.map +1 -1
  112. package/dist/search.js +10 -349
  113. package/dist/shared.d.ts +0 -1
  114. package/dist/shared.d.ts.map +1 -1
  115. package/dist/shared.js +0 -10
  116. package/dist/status.d.ts +4 -3
  117. package/dist/status.d.ts.map +1 -1
  118. package/dist/status.js +3 -1
  119. package/dist/store.d.ts +25 -62
  120. package/dist/store.d.ts.map +1 -1
  121. package/dist/store.js +43 -282
  122. package/dist/stored.d.ts +12 -26
  123. package/dist/stored.d.ts.map +1 -1
  124. package/dist/stored.js +189 -226
  125. package/dist/tables.d.ts +55 -48
  126. package/dist/tables.d.ts.map +1 -1
  127. package/dist/tables.js +107 -57
  128. package/dist/transfer.d.ts +0 -5
  129. package/dist/transfer.d.ts.map +1 -1
  130. package/dist/validation.d.ts +3 -4
  131. package/dist/validation.d.ts.map +1 -1
  132. package/dist/validation.js +39 -97
  133. package/dist/windows.d.ts +1 -12
  134. package/dist/windows.d.ts.map +1 -1
  135. package/dist/windows.js +2 -75
  136. package/dist/wire.d.ts +14 -9
  137. package/dist/wire.d.ts.map +1 -1
  138. package/dist/wire.js +5 -3
  139. package/package.json +14 -18
  140. package/AGENTS.md +0 -312
  141. package/dist/chat/acts.d.ts +0 -33
  142. package/dist/chat/acts.d.ts.map +0 -1
  143. package/dist/chat/acts.js +0 -36
  144. package/dist/chat/context.d.ts +0 -3
  145. package/dist/chat/context.d.ts.map +0 -1
  146. package/dist/chat/earlier.d.ts +0 -10
  147. package/dist/chat/earlier.d.ts.map +0 -1
  148. package/dist/chat/earlier.js +0 -54
  149. package/dist/chat/house.d.ts +0 -25
  150. package/dist/chat/house.d.ts.map +0 -1
  151. package/dist/chat/house.js +0 -38
  152. package/dist/chat/input.d.ts +0 -11
  153. package/dist/chat/input.d.ts.map +0 -1
  154. package/dist/chat/input.js +0 -92
  155. package/dist/chat/kit.d.ts +0 -61
  156. package/dist/chat/kit.d.ts.map +0 -1
  157. package/dist/chat/kit.js +0 -123
  158. package/dist/chat/lasting.d.ts +0 -6
  159. package/dist/chat/lasting.d.ts.map +0 -1
  160. package/dist/chat/lasting.js +0 -19
  161. package/dist/chat/list.d.ts +0 -28
  162. package/dist/chat/list.d.ts.map +0 -1
  163. package/dist/chat/list.js +0 -103
  164. package/dist/chat/markdown.d.ts +0 -21
  165. package/dist/chat/markdown.d.ts.map +0 -1
  166. package/dist/chat/markdown.js +0 -246
  167. package/dist/chat/message.d.ts +0 -7
  168. package/dist/chat/message.d.ts.map +0 -1
  169. package/dist/chat/message.js +0 -244
  170. package/dist/chat/messages.d.ts +0 -30
  171. package/dist/chat/messages.d.ts.map +0 -1
  172. package/dist/chat/messages.js +0 -198
  173. package/dist/chat/name.d.ts +0 -7
  174. package/dist/chat/name.d.ts.map +0 -1
  175. package/dist/chat/name.js +0 -37
  176. package/dist/chat/opened.d.ts +0 -12
  177. package/dist/chat/opened.d.ts.map +0 -1
  178. package/dist/chat/opened.js +0 -19
  179. package/dist/chat/overlay.d.ts +0 -32
  180. package/dist/chat/overlay.d.ts.map +0 -1
  181. package/dist/chat/overlay.js +0 -103
  182. package/dist/chat/parts.d.ts +0 -58
  183. package/dist/chat/parts.d.ts.map +0 -1
  184. package/dist/chat/parts.js +0 -120
  185. package/dist/chat/pieces.d.ts +0 -62
  186. package/dist/chat/pieces.d.ts.map +0 -1
  187. package/dist/chat/pieces.js +0 -1110
  188. package/dist/chat/process.d.ts +0 -20
  189. package/dist/chat/process.d.ts.map +0 -1
  190. package/dist/chat/process.js +0 -32
  191. package/dist/chat/provider.d.ts +0 -70
  192. package/dist/chat/provider.d.ts.map +0 -1
  193. package/dist/chat/provider.js +0 -635
  194. package/dist/chat/question.d.ts +0 -9
  195. package/dist/chat/question.d.ts.map +0 -1
  196. package/dist/chat/question.js +0 -69
  197. package/dist/chat/questions.d.ts +0 -31
  198. package/dist/chat/questions.d.ts.map +0 -1
  199. package/dist/chat/questions.js +0 -111
  200. package/dist/chat/read.d.ts +0 -5
  201. package/dist/chat/read.d.ts.map +0 -1
  202. package/dist/chat/read.js +0 -13
  203. package/dist/chat/ready.d.ts +0 -37
  204. package/dist/chat/ready.d.ts.map +0 -1
  205. package/dist/chat/ready.js +0 -93
  206. package/dist/chat/room-file.d.ts +0 -8
  207. package/dist/chat/room-file.d.ts.map +0 -1
  208. package/dist/chat/room-file.js +0 -72
  209. package/dist/chat/steady.d.ts +0 -3
  210. package/dist/chat/steady.d.ts.map +0 -1
  211. package/dist/chat/steady.js +0 -26
  212. package/dist/chat/style.d.ts +0 -4
  213. package/dist/chat/style.d.ts.map +0 -1
  214. package/dist/chat/style.js +0 -306
  215. package/dist/chat.d.ts +0 -15
  216. package/dist/chat.d.ts.map +0 -1
  217. package/dist/chat.js +0 -8
  218. package/dist/reads.d.ts +0 -11
  219. package/dist/reads.d.ts.map +0 -1
  220. package/dist/reads.js +0 -98
package/dist/store.js CHANGED
@@ -1,123 +1,6 @@
1
- import { precedes } from './windows.js';
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, accepted }, held) {
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 async function openRuntimeStore(fenced, authored) {
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 unprepared = new Set(held.keys.flatMap(({ key, rederiving }) => (rederiving === null ? [] : [key])));
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
- transfers: new Map(held.transfers
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) {
@@ -289,40 +159,36 @@ export async function openRuntimeStore(fenced, authored) {
289
159
  typed(key, view, paths) {
290
160
  return authored.ask({ kind: 'replica.typed', key, view, paths });
291
161
  },
292
- referrers(key, view, targets, kinds) {
293
- return authored.ask({ kind: 'replica.referrers', key, view, targets, kinds });
294
- },
295
- walk(key, view, after, bytes) {
296
- return authored.ask({ kind: 'replica.walk', key, view, after, bytes });
162
+ referrers(key, view, targets) {
163
+ return authored.ask({ kind: 'replica.referrers', key, view, targets });
297
164
  },
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
- searched(key, locator, after, limit, paths) {
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
- record: last ? JSON.stringify(kept) : null,
316
- key,
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,25 +198,23 @@ export async function openRuntimeStore(fenced, authored) {
332
198
  async unrefresh(key) {
333
199
  await authored.ask({ kind: 'replica.unrefresh', key });
334
200
  },
335
- async commit({ rooms, writes = [], files = [], whole = false, discards = [] }) {
201
+ async commit({ rooms, writes = [], files = [], whole = false }) {
336
202
  const kept = whole ? writes : writes.filter(({ locator }) => !fenced(locator));
337
203
  const refused = whole ? kept.find(({ locator }) => fenced(locator)) : undefined;
338
204
  if (refused !== undefined) {
339
- return { fenced: refused.locator, counts: {}, changed: {}, prepared: {} };
205
+ return { fenced: refused.locator, counts: {}, changed: {}, indexed: {} };
340
206
  }
341
207
  for (const room of rooms)
342
208
  change(room.key);
343
209
  const committed = await authored.ask({
344
210
  kind: 'replica.commit',
345
- ...(kept.length === 0 && files.length === 0 && discards.length === 0
211
+ ...(kept.length === 0 && files.length === 0
346
212
  ? {}
347
- : { authored: { writes: rows(kept), files, whole, discards } }),
213
+ : { authored: { writes: rows(kept), files, whole } }),
348
214
  rooms: rooms.filter(({ locator }) => !fenced(locator)),
349
215
  });
350
216
  if (committed.fenced === null || !whole)
351
217
  noted(kept);
352
- for (const locator of discards)
353
- queued.delete(locator);
354
218
  return committed;
355
219
  },
356
220
  async fence(locators) {
@@ -361,17 +225,24 @@ export async function openRuntimeStore(fenced, authored) {
361
225
  async erase(locator, limit) {
362
226
  return (await authored.ask({ kind: 'replica.erase', locator, limit })).remaining;
363
227
  },
364
- async abandon(locator, kept = false) {
228
+ async abandon(locator) {
365
229
  if (fenced(locator))
366
- return null;
367
- return authored.ask({ kind: 'replica.abandon', locator, kept });
230
+ return;
231
+ await authored.ask({ kind: 'replica.abandon', locator });
368
232
  },
369
233
  async release(key) {
370
234
  await authored.ask({ kind: 'replica.release', key });
371
235
  },
372
- async rederive(key, limit) {
236
+ async rederive(key, composition, bytes, ms, floor) {
373
237
  change(key);
374
- return (await authored.ask({ kind: 'replica.rederive', key, limit })).done;
238
+ return authored.ask({
239
+ kind: 'replica.rederive',
240
+ key,
241
+ composed: composedOf(composition),
242
+ bytes,
243
+ ms,
244
+ floor,
245
+ });
375
246
  },
376
247
  async fact(name, value) {
377
248
  await authored.ask({ kind: 'replica.fact', name, value: JSON.stringify(value) });
@@ -417,110 +288,22 @@ export async function openRuntimeStore(fenced, authored) {
417
288
  });
418
289
  },
419
290
  conversations() {
420
- return transacted(database, [CONVERSATIONS, MESSAGES], 'readonly', async (transaction) => {
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
- });
291
+ return authored.ask({ kind: 'conversation.held' });
445
292
  },
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
- });
460
- },
461
- messageWindow(conversation, limit, before) {
462
- return transacted(database, MESSAGES, 'readonly', async (transaction) => {
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
- });
293
+ async keepMessages(write) {
294
+ await authored.ask({ kind: 'conversation.keep', ...write });
492
295
  },
493
- messageCount(conversation) {
494
- return transacted(database, MESSAGES, 'readonly', (transaction) => settled(transaction.objectStore(MESSAGES).index('conversation').count(conversation)));
296
+ messageWindow(conversation, limit, before, phrase = null) {
297
+ return authored.ask({ kind: 'conversation.window', conversation, limit, before, phrase });
495
298
  },
496
- async messagesAfter(conversation, identity) {
497
- const range = identity === null
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);
299
+ messageCount(conversation, phrase = null) {
300
+ return authored.ask({ kind: 'conversation.count', conversation, phrase });
502
301
  },
503
- async messageIdentities(conversation) {
504
- const found = await transacted(database, MESSAGES, 'readonly', (transaction) => settled(transaction.objectStore(MESSAGES).index('conversation').getAllKeys(conversation)));
505
- return found.map((key) => key[1]);
506
- },
507
- async turnArrived(conversation, turn) {
508
- const held = await transacted(database, MESSAGES, 'readonly', (transaction) => settled(transaction.objectStore(MESSAGES).index('turn').count([conversation, turn])));
509
- return held > 0;
302
+ turnArrived(conversation, turn) {
303
+ return authored.ask({ kind: 'conversation.turn', conversation, turn });
510
304
  },
511
305
  async dropConversations(conversations) {
512
- await authored.ask({ kind: 'authored.chatDraft', kept: [], dropped: conversations });
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
- });
306
+ await authored.ask({ kind: 'conversation.drop', conversations });
524
307
  },
525
308
  async chatDrafts() {
526
309
  const records = await authored.ask({ kind: 'authored.chatDrafts' });
@@ -574,25 +357,6 @@ export async function openRuntimeStore(fenced, authored) {
574
357
  fences() {
575
358
  return authored.ask({ kind: 'authored.fences' });
576
359
  },
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
360
  generation() {
597
361
  return fact('generation');
598
362
  },
@@ -602,8 +366,5 @@ export async function openRuntimeStore(fenced, authored) {
602
366
  file(key, type) {
603
367
  return authored.ask({ kind: 'authored.file', key, type });
604
368
  },
605
- close() {
606
- void idle(database).then(() => database.close());
607
- },
608
369
  };
609
370
  }
package/dist/stored.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import type { HeadChange } from './adapter.js';
2
- import type { Composition } from './collection.js';
1
+ import type { SavedFacts, HeadChange } from './adapter.js';
2
+ import { type Composed, type Composition } from './collection.js';
3
3
  import type { HeldBinary } from './overlay.js';
4
- import type { SearchedDocument } from './search.js';
5
4
  import type { Connection } from './tables.js';
6
5
  export declare const REPLICA_TABLES: readonly string[];
7
6
  export type View = 'confirmed' | 'visible' | 'refreshed';
@@ -13,6 +12,7 @@ export type StoredEntry = {
13
12
  readonly fileId: string | null;
14
13
  readonly change: HeadChange | null;
15
14
  readonly written: string | null;
15
+ readonly facts: SavedFacts | null;
16
16
  };
17
17
  export type OverlayEntry = StoredEntry & {
18
18
  readonly present: boolean;
@@ -28,7 +28,6 @@ export type TypedEntry = {
28
28
  export type Referrer = {
29
29
  readonly path: string;
30
30
  readonly target: string;
31
- readonly kind: string;
32
31
  };
33
32
  export type HeldKey = {
34
33
  readonly key: number;
@@ -42,11 +41,6 @@ export type ReplicaOpened = {
42
41
  readonly key: number;
43
42
  readonly record: string;
44
43
  }[];
45
- readonly transfers: readonly {
46
- readonly locator: string;
47
- readonly key: number;
48
- readonly record: string;
49
- }[];
50
44
  readonly keys: readonly HeldKey[];
51
45
  readonly facts: Readonly<Record<string, string>>;
52
46
  readonly presentation: readonly {
@@ -72,7 +66,7 @@ export type RoomCommit = {
72
66
  readonly from: number | null;
73
67
  };
74
68
  readonly refreshed?: true;
75
- readonly composition?: Composition;
69
+ readonly composed: Composed;
76
70
  readonly confirmed?: {
77
71
  readonly set: readonly StoredEntry[];
78
72
  readonly removed: readonly string[];
@@ -85,29 +79,24 @@ export type RoomCommit = {
85
79
  export type Committed = {
86
80
  readonly counts: Readonly<Record<string, number>>;
87
81
  readonly changed: Readonly<Record<string, readonly string[] | null>>;
88
- readonly prepared: Readonly<Record<string, boolean>>;
82
+ readonly indexed: Readonly<Record<string, boolean>>;
89
83
  };
90
84
  export type CountedRoom = {
91
85
  readonly key: number;
92
86
  readonly roots: readonly string[];
93
87
  };
94
- export type Walked = {
95
- readonly entries: readonly HeldEntry[];
96
- readonly next: string | null;
97
- };
98
- export declare function fingerprint(composition: Composition): string;
99
88
  export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
100
89
  export declare function stage(connection: Connection, request: {
101
90
  readonly locator: string;
102
91
  readonly transfer: string;
103
- readonly record: string | null;
104
92
  readonly key: number | null;
105
- readonly composition: Composition;
93
+ readonly fingerprint: string;
106
94
  readonly entries: readonly StoredEntry[];
107
95
  readonly folders: readonly string[];
108
96
  }): number;
109
97
  export declare function refreshing(connection: Connection, request: {
110
98
  readonly key: number;
99
+ readonly composed: Composed;
111
100
  readonly entries: readonly StoredEntry[];
112
101
  readonly removals: readonly string[];
113
102
  readonly folders: readonly string[];
@@ -117,27 +106,24 @@ export declare function unrefresh(connection: Connection, key: number): null;
117
106
  export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
118
107
  export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
119
108
  export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
120
- export declare function abandon(connection: Connection, locator: string, kept: boolean): number | null;
109
+ export declare function abandon(connection: Connection, locator: string): null;
121
110
  export declare function release(connection: Connection, key: number): null;
122
111
  export declare function erase(connection: Connection, locator: string | null, limit: number): {
123
112
  readonly remaining: boolean;
124
113
  };
125
- export declare function rederive(connection: Connection, key: number, limit: number): {
114
+ export declare function rederive(connection: Connection, key: number, composed: Composed, bytes: number, ms: number, floor: number): {
126
115
  readonly done: boolean;
116
+ readonly text: number;
127
117
  };
128
118
  export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
129
119
  export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
130
- 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;
120
+ export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]): Referrer[];
132
121
  export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
133
122
  readonly path: string;
134
123
  readonly revision: string;
135
124
  }[];
125
+ export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
136
126
  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
127
  export declare function opened(connection: Connection): ReplicaOpened;
142
128
  export declare function ended(connection: Connection): void;
143
129
  //# sourceMappingURL=stored.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cA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