@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.
Files changed (219) hide show
  1. package/README.md +11 -9
  2. package/dist/adapter.d.ts +94 -63
  3. package/dist/adapter.d.ts.map +1 -1
  4. package/dist/attached-model.d.ts +2 -1
  5. package/dist/attached-model.d.ts.map +1 -1
  6. package/dist/attached-model.js +28 -4
  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 +16 -8
  11. package/dist/bootstrap.d.ts.map +1 -1
  12. package/dist/bootstrap.js +142 -94
  13. package/dist/change-set.d.ts +1 -7
  14. package/dist/change-set.d.ts.map +1 -1
  15. package/dist/change-set.js +1 -4
  16. package/dist/client.d.ts +10 -11
  17. package/dist/client.d.ts.map +1 -1
  18. package/dist/client.js +54 -8
  19. package/dist/collection.d.ts +5 -3
  20. package/dist/collection.d.ts.map +1 -1
  21. package/dist/collection.js +24 -19
  22. package/dist/compile.d.ts +7 -2
  23. package/dist/compile.d.ts.map +1 -1
  24. package/dist/compile.js +125 -48
  25. package/dist/connection.d.ts +10 -10
  26. package/dist/connection.d.ts.map +1 -1
  27. package/dist/connection.js +1611 -1313
  28. package/dist/context.d.ts +2 -0
  29. package/dist/context.d.ts.map +1 -0
  30. package/dist/{chat/context.js → context.js} +1 -4
  31. package/dist/conversation.d.ts +17 -14
  32. package/dist/conversation.d.ts.map +1 -1
  33. package/dist/conversation.js +262 -159
  34. package/dist/durability.d.ts +1 -5
  35. package/dist/durability.d.ts.map +1 -1
  36. package/dist/durability.js +5 -0
  37. package/dist/entry.d.ts +1 -0
  38. package/dist/entry.d.ts.map +1 -1
  39. package/dist/entry.js +2 -1
  40. package/dist/file.d.ts +2 -11
  41. package/dist/file.d.ts.map +1 -1
  42. package/dist/file.js +6 -4
  43. package/dist/host.d.ts +4 -7
  44. package/dist/host.d.ts.map +1 -1
  45. package/dist/host.js +52 -32
  46. package/dist/identity.d.ts +0 -1
  47. package/dist/identity.d.ts.map +1 -1
  48. package/dist/identity.js +0 -3
  49. package/dist/index.d.ts +13 -11
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +6 -3
  52. package/dist/job.d.ts +14 -0
  53. package/dist/job.d.ts.map +1 -0
  54. package/dist/job.js +28 -0
  55. package/dist/live.d.ts +2 -1
  56. package/dist/live.d.ts.map +1 -1
  57. package/dist/live.js +9 -5
  58. package/dist/media.d.ts +8 -0
  59. package/dist/media.d.ts.map +1 -0
  60. package/dist/media.js +218 -0
  61. package/dist/memory.d.ts +10 -6
  62. package/dist/memory.d.ts.map +1 -1
  63. package/dist/memory.js +177 -100
  64. package/dist/messages.d.ts +28 -0
  65. package/dist/messages.d.ts.map +1 -0
  66. package/dist/messages.js +89 -0
  67. package/dist/model.d.ts +6 -1
  68. package/dist/model.d.ts.map +1 -1
  69. package/dist/model.js +7 -10
  70. package/dist/observation.d.ts +3 -2
  71. package/dist/observation.d.ts.map +1 -1
  72. package/dist/observation.js +8 -3
  73. package/dist/outcome.d.ts +13 -6
  74. package/dist/outcome.d.ts.map +1 -1
  75. package/dist/outcome.js +16 -5
  76. package/dist/overlay.js +1 -1
  77. package/dist/paths.d.ts +1 -0
  78. package/dist/paths.d.ts.map +1 -1
  79. package/dist/paths.js +4 -0
  80. package/dist/phrase.d.ts +3 -0
  81. package/dist/phrase.d.ts.map +1 -0
  82. package/dist/phrase.js +8 -0
  83. package/dist/query.d.ts +14 -1
  84. package/dist/query.d.ts.map +1 -1
  85. package/dist/query.js +32 -2
  86. package/dist/reach.d.ts +13 -7
  87. package/dist/reach.d.ts.map +1 -1
  88. package/dist/reach.js +80 -64
  89. package/dist/react.d.ts +1 -0
  90. package/dist/react.d.ts.map +1 -1
  91. package/dist/readiness.d.ts +14 -17
  92. package/dist/readiness.d.ts.map +1 -1
  93. package/dist/readiness.js +2 -8
  94. package/dist/recovery.d.ts +1 -0
  95. package/dist/recovery.d.ts.map +1 -1
  96. package/dist/recovery.js +26 -0
  97. package/dist/refresh.d.ts +10 -4
  98. package/dist/refresh.d.ts.map +1 -1
  99. package/dist/refresh.js +104 -30
  100. package/dist/replica.d.ts +5 -5
  101. package/dist/replica.d.ts.map +1 -1
  102. package/dist/replica.js +7 -7
  103. package/dist/room-draft.d.ts +20 -3
  104. package/dist/room-draft.d.ts.map +1 -1
  105. package/dist/room-draft.js +131 -51
  106. package/dist/rows.d.ts +17 -7
  107. package/dist/rows.d.ts.map +1 -1
  108. package/dist/rows.js +120 -87
  109. package/dist/save.d.ts +2 -0
  110. package/dist/save.d.ts.map +1 -1
  111. package/dist/save.js +13 -7
  112. package/dist/search.d.ts +12 -95
  113. package/dist/search.d.ts.map +1 -1
  114. package/dist/search.js +10 -349
  115. package/dist/shared.d.ts +0 -1
  116. package/dist/shared.d.ts.map +1 -1
  117. package/dist/shared.js +0 -10
  118. package/dist/status.d.ts +4 -3
  119. package/dist/status.d.ts.map +1 -1
  120. package/dist/status.js +3 -1
  121. package/dist/store.d.ts +34 -60
  122. package/dist/store.d.ts.map +1 -1
  123. package/dist/store.js +71 -275
  124. package/dist/stored.d.ts +42 -23
  125. package/dist/stored.d.ts.map +1 -1
  126. package/dist/stored.js +198 -210
  127. package/dist/tables.d.ts +79 -46
  128. package/dist/tables.d.ts.map +1 -1
  129. package/dist/tables.js +101 -53
  130. package/dist/transfer.d.ts +0 -5
  131. package/dist/transfer.d.ts.map +1 -1
  132. package/dist/validation.d.ts +3 -4
  133. package/dist/validation.d.ts.map +1 -1
  134. package/dist/validation.js +35 -96
  135. package/dist/wire.d.ts +6 -9
  136. package/dist/wire.d.ts.map +1 -1
  137. package/dist/wire.js +3 -3
  138. package/package.json +14 -18
  139. package/AGENTS.md +0 -310
  140. package/dist/chat/acts.d.ts +0 -33
  141. package/dist/chat/acts.d.ts.map +0 -1
  142. package/dist/chat/acts.js +0 -36
  143. package/dist/chat/context.d.ts +0 -3
  144. package/dist/chat/context.d.ts.map +0 -1
  145. package/dist/chat/earlier.d.ts +0 -10
  146. package/dist/chat/earlier.d.ts.map +0 -1
  147. package/dist/chat/earlier.js +0 -54
  148. package/dist/chat/house.d.ts +0 -25
  149. package/dist/chat/house.d.ts.map +0 -1
  150. package/dist/chat/house.js +0 -38
  151. package/dist/chat/input.d.ts +0 -11
  152. package/dist/chat/input.d.ts.map +0 -1
  153. package/dist/chat/input.js +0 -92
  154. package/dist/chat/kit.d.ts +0 -61
  155. package/dist/chat/kit.d.ts.map +0 -1
  156. package/dist/chat/kit.js +0 -123
  157. package/dist/chat/lasting.d.ts +0 -6
  158. package/dist/chat/lasting.d.ts.map +0 -1
  159. package/dist/chat/lasting.js +0 -19
  160. package/dist/chat/list.d.ts +0 -28
  161. package/dist/chat/list.d.ts.map +0 -1
  162. package/dist/chat/list.js +0 -103
  163. package/dist/chat/markdown.d.ts +0 -21
  164. package/dist/chat/markdown.d.ts.map +0 -1
  165. package/dist/chat/markdown.js +0 -246
  166. package/dist/chat/message.d.ts +0 -7
  167. package/dist/chat/message.d.ts.map +0 -1
  168. package/dist/chat/message.js +0 -237
  169. package/dist/chat/messages.d.ts +0 -29
  170. package/dist/chat/messages.d.ts.map +0 -1
  171. package/dist/chat/messages.js +0 -190
  172. package/dist/chat/name.d.ts +0 -7
  173. package/dist/chat/name.d.ts.map +0 -1
  174. package/dist/chat/name.js +0 -37
  175. package/dist/chat/opened.d.ts +0 -12
  176. package/dist/chat/opened.d.ts.map +0 -1
  177. package/dist/chat/opened.js +0 -19
  178. package/dist/chat/overlay.d.ts +0 -32
  179. package/dist/chat/overlay.d.ts.map +0 -1
  180. package/dist/chat/overlay.js +0 -103
  181. package/dist/chat/parts.d.ts +0 -58
  182. package/dist/chat/parts.d.ts.map +0 -1
  183. package/dist/chat/parts.js +0 -120
  184. package/dist/chat/pieces.d.ts +0 -62
  185. package/dist/chat/pieces.d.ts.map +0 -1
  186. package/dist/chat/pieces.js +0 -1110
  187. package/dist/chat/process.d.ts +0 -20
  188. package/dist/chat/process.d.ts.map +0 -1
  189. package/dist/chat/process.js +0 -32
  190. package/dist/chat/provider.d.ts +0 -68
  191. package/dist/chat/provider.d.ts.map +0 -1
  192. package/dist/chat/provider.js +0 -619
  193. package/dist/chat/question.d.ts +0 -9
  194. package/dist/chat/question.d.ts.map +0 -1
  195. package/dist/chat/question.js +0 -69
  196. package/dist/chat/questions.d.ts +0 -31
  197. package/dist/chat/questions.d.ts.map +0 -1
  198. package/dist/chat/questions.js +0 -111
  199. package/dist/chat/read.d.ts +0 -5
  200. package/dist/chat/read.d.ts.map +0 -1
  201. package/dist/chat/read.js +0 -13
  202. package/dist/chat/ready.d.ts +0 -37
  203. package/dist/chat/ready.d.ts.map +0 -1
  204. package/dist/chat/ready.js +0 -93
  205. package/dist/chat/room-file.d.ts +0 -8
  206. package/dist/chat/room-file.d.ts.map +0 -1
  207. package/dist/chat/room-file.js +0 -72
  208. package/dist/chat/steady.d.ts +0 -3
  209. package/dist/chat/steady.d.ts.map +0 -1
  210. package/dist/chat/steady.js +0 -26
  211. package/dist/chat/style.d.ts +0 -4
  212. package/dist/chat/style.d.ts.map +0 -1
  213. package/dist/chat/style.js +0 -306
  214. package/dist/chat.d.ts +0 -15
  215. package/dist/chat.d.ts.map +0 -1
  216. package/dist/chat.js +0 -8
  217. package/dist/reads.d.ts +0 -11
  218. package/dist/reads.d.ts.map +0 -1
  219. 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) {
@@ -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
- 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,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: {}, prepared: {} };
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, kept = false) {
263
+ async abandon(locator) {
365
264
  if (fenced(locator))
366
- return null;
367
- return authored.ask({ kind: 'replica.abandon', locator, kept });
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, limit) {
271
+ async rederive(key, composition, bytes, ms, floor) {
373
272
  change(key);
374
- return (await authored.ask({ kind: 'replica.rederive', key, limit })).done;
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 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
- });
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
- 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
- });
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
- 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);
331
+ messageWindow(conversation, limit, before, phrase = null) {
332
+ return authored.ask({ kind: 'conversation.window', conversation, limit, before, phrase });
502
333
  },
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]);
334
+ messageCount(conversation, phrase = null) {
335
+ return authored.ask({ kind: 'conversation.count', conversation, phrase });
506
336
  },
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;
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: '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
- });
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 { Composition } from './collection.js';
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 composition?: Composition;
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 prepared: Readonly<Record<string, boolean>>;
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 composition: Composition;
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, kept: boolean): number | null;
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, limit: 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(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