@agentshouse/mdruntime 0.1.0-cd3486bd400ed → 0.1.0-cde2b99d2fcbc
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/AGENTS.md +70 -42
- package/README.md +11 -2
- package/dist/adapter.d.ts +34 -11
- package/dist/adapter.d.ts.map +1 -1
- package/dist/binary.d.ts +23 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +5 -8
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +8 -7
- package/dist/change.d.ts +11 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +26 -1
- package/dist/chat/context.d.ts +3 -0
- package/dist/chat/context.d.ts.map +1 -0
- package/dist/chat/context.js +10 -0
- package/dist/chat/input.d.ts +9 -0
- package/dist/chat/input.d.ts.map +1 -0
- package/dist/chat/input.js +99 -0
- package/dist/chat/kit.d.ts +60 -0
- package/dist/chat/kit.d.ts.map +1 -0
- package/dist/chat/kit.js +123 -0
- package/dist/chat/lasting.d.ts +6 -0
- package/dist/chat/lasting.d.ts.map +1 -0
- package/dist/chat/lasting.js +19 -0
- package/dist/chat/list.d.ts +20 -0
- package/dist/chat/list.d.ts.map +1 -0
- package/dist/chat/list.js +59 -0
- package/dist/chat/markdown.d.ts +19 -0
- package/dist/chat/markdown.d.ts.map +1 -0
- package/dist/chat/markdown.js +187 -0
- package/dist/chat/message.d.ts +6 -0
- package/dist/chat/message.d.ts.map +1 -0
- package/dist/chat/message.js +192 -0
- package/dist/chat/name.d.ts +6 -0
- package/dist/chat/name.d.ts.map +1 -0
- package/dist/chat/name.js +37 -0
- package/dist/chat/opened.d.ts +11 -0
- package/dist/chat/opened.d.ts.map +1 -0
- package/dist/chat/opened.js +17 -0
- package/dist/chat/provider.d.ts +6 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +9 -1
- package/dist/chat/question.d.ts +9 -0
- package/dist/chat/question.d.ts.map +1 -0
- package/dist/chat/question.js +80 -0
- package/dist/chat/ready.d.ts +33 -0
- package/dist/chat/ready.d.ts.map +1 -0
- package/dist/chat/ready.js +91 -0
- package/dist/chat/style.d.ts +4 -0
- package/dist/chat/style.d.ts.map +1 -0
- package/dist/chat/style.js +302 -0
- package/dist/chat.d.ts +7 -0
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +6 -0
- package/dist/client.d.ts +7 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -0
- package/dist/connection.d.ts +9 -4
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +184 -15
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +4 -0
- package/dist/identity.d.ts +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +3 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/memory.d.ts +3 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +31 -11
- package/dist/outcome.d.ts +7 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +6 -0
- package/dist/overlay.d.ts +13 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +56 -22
- package/dist/query.d.ts +2 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/reach.d.ts +2 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +23 -1
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +9 -2
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +12 -17
- package/dist/replica.d.ts +5 -2
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +43 -27
- package/dist/room-draft.d.ts +19 -2
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +119 -1
- package/dist/rows.d.ts +3 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -1
- package/dist/save.d.ts +24 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +304 -14
- package/dist/store.d.ts +6 -7
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +79 -91
- package/dist/wire.d.ts +2 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +2 -0
- package/package.json +11 -3
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.js +0 -8
package/dist/store.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { sameChange } from './overlay.js';
|
|
1
|
+
import { sameBinary, sameChange } from './overlay.js';
|
|
3
2
|
const DATABASE = 'mdruntime';
|
|
4
3
|
const ROOMS = 'rooms';
|
|
5
4
|
const DOCUMENTS = 'documents';
|
|
6
|
-
const
|
|
7
|
-
const ATTACHMENTS = 'attachments';
|
|
5
|
+
const BINARY_FILES = 'binaryFiles';
|
|
8
6
|
const TRANSFERS = 'transfers';
|
|
9
7
|
const PENDING_CHANGES = 'pendingChanges';
|
|
10
8
|
const DECLARATIONS = 'declarations';
|
|
@@ -15,8 +13,9 @@ const MESSAGES = 'messages';
|
|
|
15
13
|
const CHAT_DRAFTS = 'chatDrafts';
|
|
16
14
|
const CURRENT = 'current';
|
|
17
15
|
const MEMBER = 'member';
|
|
18
|
-
export const STORE_SCHEMA =
|
|
19
|
-
const
|
|
16
|
+
export const STORE_SCHEMA = 22;
|
|
17
|
+
const ATTACHMENT_SCHEMA = 21;
|
|
18
|
+
const ATTACHMENT_REFERENCE = /at_[1-9a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]*\.[0-9a-hjkmnp-tv-z]/u;
|
|
20
19
|
const READ_BATCH = 256;
|
|
21
20
|
function settled(request) {
|
|
22
21
|
return new Promise((resolve, reject) => {
|
|
@@ -62,7 +61,7 @@ function amendPending(database, locator, id, amendment) {
|
|
|
62
61
|
return completed(transaction);
|
|
63
62
|
}
|
|
64
63
|
function roomRecord(record, queue) {
|
|
65
|
-
const { documents,
|
|
64
|
+
const { documents, binaries, revisions, changes, written, ...room } = record;
|
|
66
65
|
return { ...room, order: queue.map((batch) => batch.id) };
|
|
67
66
|
}
|
|
68
67
|
function underTransfer(locator, transfer, after) {
|
|
@@ -85,7 +84,7 @@ async function readTransfer(store, locator, transfer, receive) {
|
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
function emptyLayer() {
|
|
88
|
-
return { documents: {},
|
|
87
|
+
return { documents: {}, binaries: {}, revisions: {}, changes: {}, written: {} };
|
|
89
88
|
}
|
|
90
89
|
async function readLayer(transaction, locator, transfer) {
|
|
91
90
|
const layer = emptyLayer();
|
|
@@ -101,9 +100,9 @@ async function readLayer(transaction, locator, transfer) {
|
|
|
101
100
|
layer.written[document.path] = document.written;
|
|
102
101
|
head(document);
|
|
103
102
|
});
|
|
104
|
-
await readTransfer(transaction.objectStore(
|
|
105
|
-
layer.
|
|
106
|
-
head(
|
|
103
|
+
await readTransfer(transaction.objectStore(BINARY_FILES), locator, transfer, (file) => {
|
|
104
|
+
layer.binaries[file.path] = file.binary;
|
|
105
|
+
head(file);
|
|
107
106
|
});
|
|
108
107
|
return layer;
|
|
109
108
|
}
|
|
@@ -118,13 +117,14 @@ function documentRecord(locator, transfer, layer, path) {
|
|
|
118
117
|
written: layer.written[path] ?? null,
|
|
119
118
|
};
|
|
120
119
|
}
|
|
121
|
-
function
|
|
120
|
+
function binaryFileRecord(locator, transfer, layer, path) {
|
|
122
121
|
return {
|
|
123
122
|
locator,
|
|
124
123
|
transfer,
|
|
125
124
|
path,
|
|
126
125
|
revision: layer.revisions[path] ?? null,
|
|
127
126
|
change: layer.changes[path] ?? null,
|
|
127
|
+
binary: layer.binaries[path],
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
function writeLayer(transaction, locator, transfer, next, base) {
|
|
@@ -141,18 +141,16 @@ function writeLayer(transaction, locator, transfer, next, base) {
|
|
|
141
141
|
continue;
|
|
142
142
|
documents.put(documentRecord(locator, transfer, next, path));
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (!afterTargets.has(path))
|
|
149
|
-
targets.delete([locator, transfer, path]);
|
|
144
|
+
const files = transaction.objectStore(BINARY_FILES);
|
|
145
|
+
for (const path of Object.keys(base?.binaries ?? {})) {
|
|
146
|
+
if (next.binaries[path] === undefined)
|
|
147
|
+
files.delete([locator, transfer, path]);
|
|
150
148
|
}
|
|
151
|
-
for (const path of
|
|
152
|
-
if (!
|
|
149
|
+
for (const path of Object.keys(next.binaries)) {
|
|
150
|
+
if (!sameBinary(base?.binaries[path], next.binaries[path]) ||
|
|
153
151
|
base?.revisions[path] !== next.revisions[path] ||
|
|
154
152
|
!sameChange(base?.changes[path], next.changes[path])) {
|
|
155
|
-
|
|
153
|
+
files.put(binaryFileRecord(locator, transfer, next, path));
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
156
|
}
|
|
@@ -172,60 +170,70 @@ export function removeRuntimeStore() {
|
|
|
172
170
|
removal.onerror = () => reject(removal.error);
|
|
173
171
|
});
|
|
174
172
|
}
|
|
175
|
-
function
|
|
176
|
-
database.
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
room.continue();
|
|
173
|
+
function withoutAttachments(database, upgrade) {
|
|
174
|
+
database.deleteObjectStore('attachments');
|
|
175
|
+
const files = upgrade.objectStore('binaryTargets');
|
|
176
|
+
files.name = BINARY_FILES;
|
|
177
|
+
files.clear();
|
|
178
|
+
upgrade.objectStore(TRANSFERS).clear();
|
|
179
|
+
const documents = upgrade.objectStore(DOCUMENTS);
|
|
180
|
+
const dropped = new Set();
|
|
181
|
+
const kept = new Map();
|
|
182
|
+
const pending = upgrade.objectStore(PENDING_CHANGES).openCursor();
|
|
183
|
+
pending.onsuccess = () => {
|
|
184
|
+
const entry = pending.result;
|
|
185
|
+
if (entry !== null) {
|
|
186
|
+
const record = entry.value;
|
|
187
|
+
if (ATTACHMENT_REFERENCE.test(JSON.stringify(record.batch))) {
|
|
188
|
+
dropped.add(`${record.locator}\0${record.id}`);
|
|
189
|
+
entry.delete();
|
|
190
|
+
}
|
|
191
|
+
entry.continue();
|
|
195
192
|
return;
|
|
196
193
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
194
|
+
const rooms = upgrade.objectStore(ROOMS).openCursor();
|
|
195
|
+
rooms.onsuccess = () => {
|
|
196
|
+
const room = rooms.result;
|
|
197
|
+
if (room !== null) {
|
|
198
|
+
const record = room.value;
|
|
199
|
+
const order = record.order.filter((id) => !dropped.has(`${record.locator}\0${id}`));
|
|
200
|
+
if (order.length === 0) {
|
|
201
|
+
room.delete();
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
kept.set(record.locator, record.transfer);
|
|
205
|
+
room.update({ ...record, roomVersion: '', order });
|
|
204
206
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
room.continue();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const staged = documents.openCursor();
|
|
211
|
+
staged.onsuccess = () => {
|
|
212
|
+
const document = staged.result;
|
|
213
|
+
if (document === null)
|
|
214
|
+
return;
|
|
215
|
+
const record = document.value;
|
|
216
|
+
if (kept.get(record.locator) !== record.transfer)
|
|
217
|
+
document.delete();
|
|
218
|
+
document.continue();
|
|
210
219
|
};
|
|
211
|
-
}
|
|
220
|
+
};
|
|
212
221
|
};
|
|
213
222
|
}
|
|
214
223
|
export async function openRuntimeStore() {
|
|
215
224
|
const opening = indexedDB.open(DATABASE, STORE_SCHEMA);
|
|
216
225
|
opening.onupgradeneeded = (event) => {
|
|
217
226
|
const database = opening.result;
|
|
218
|
-
if (event.oldVersion ===
|
|
219
|
-
|
|
227
|
+
if (event.oldVersion === ATTACHMENT_SCHEMA && opening.transaction !== null) {
|
|
228
|
+
withoutAttachments(database, opening.transaction);
|
|
220
229
|
return;
|
|
221
230
|
}
|
|
222
231
|
for (const name of [...database.objectStoreNames])
|
|
223
232
|
database.deleteObjectStore(name);
|
|
224
233
|
database.createObjectStore(ROOMS, { keyPath: 'locator' });
|
|
225
234
|
database.createObjectStore(DOCUMENTS, { keyPath: ['locator', 'transfer', 'path'] });
|
|
226
|
-
database.createObjectStore(
|
|
235
|
+
database.createObjectStore(BINARY_FILES, { keyPath: ['locator', 'transfer', 'path'] });
|
|
227
236
|
database.createObjectStore(TRANSFERS, { keyPath: 'locator' });
|
|
228
|
-
database.createObjectStore(ATTACHMENTS, { keyPath: ['locator', 'reference'] });
|
|
229
237
|
database.createObjectStore(PENDING_CHANGES, { keyPath: ['locator', 'id'] });
|
|
230
238
|
database.createObjectStore(DECLARATIONS);
|
|
231
239
|
database.createObjectStore(ROOM_DRAFTS, { keyPath: ['locator', 'path'] });
|
|
@@ -240,46 +248,26 @@ export async function openRuntimeStore() {
|
|
|
240
248
|
const database = await settled(opening);
|
|
241
249
|
return {
|
|
242
250
|
async all() {
|
|
243
|
-
const transaction = database.transaction([ROOMS, DOCUMENTS,
|
|
244
|
-
const
|
|
245
|
-
settled(transaction.objectStore(ROOMS).getAll()),
|
|
246
|
-
settled(transaction.objectStore(ATTACHMENTS).getAll()),
|
|
247
|
-
]);
|
|
251
|
+
const transaction = database.transaction([ROOMS, DOCUMENTS, BINARY_FILES], 'readonly');
|
|
252
|
+
const rooms = await settled(transaction.objectStore(ROOMS).getAll());
|
|
248
253
|
const records = [];
|
|
249
254
|
for (const { order, ...room } of rooms) {
|
|
250
|
-
|
|
251
|
-
records.push({
|
|
252
|
-
...room,
|
|
253
|
-
...layer,
|
|
254
|
-
attachments: attachments.flatMap(({ locator, ...attachment }) => locator === room.locator ? [attachment] : []),
|
|
255
|
-
});
|
|
255
|
+
records.push({ ...room, ...(await readLayer(transaction, room.locator, room.transfer)) });
|
|
256
256
|
}
|
|
257
257
|
return records;
|
|
258
258
|
},
|
|
259
259
|
async write({ next, previous, stored, queue, previousQueue, saved, roomDrafts, consumedRoomDrafts, }) {
|
|
260
|
-
const transaction = database.transaction([ROOMS, DOCUMENTS,
|
|
260
|
+
const transaction = database.transaction([ROOMS, DOCUMENTS, BINARY_FILES, TRANSFERS, PENDING_CHANGES, ROOM_DRAFTS], 'readwrite');
|
|
261
261
|
transaction.objectStore(ROOMS).put(roomRecord(next, queue));
|
|
262
262
|
const moved = previous?.transfer !== next.transfer;
|
|
263
263
|
if (moved && previous !== null) {
|
|
264
264
|
const range = underTransfer(previous.locator, previous.transfer);
|
|
265
265
|
transaction.objectStore(DOCUMENTS).delete(range);
|
|
266
|
-
transaction.objectStore(
|
|
266
|
+
transaction.objectStore(BINARY_FILES).delete(range);
|
|
267
267
|
}
|
|
268
268
|
if (moved)
|
|
269
269
|
transaction.objectStore(TRANSFERS).delete(next.locator);
|
|
270
270
|
writeLayer(transaction, next.locator, next.transfer, next, moved ? (stored ?? null) : previous);
|
|
271
|
-
const attachments = transaction.objectStore(ATTACHMENTS);
|
|
272
|
-
const held = new Map((previous?.attachments ?? []).map((attachment) => [attachment.reference, attachment]));
|
|
273
|
-
const declared = new Set(next.attachments.map((attachment) => attachment.reference));
|
|
274
|
-
for (const reference of held.keys()) {
|
|
275
|
-
if (!declared.has(reference))
|
|
276
|
-
attachments.delete([next.locator, reference]);
|
|
277
|
-
}
|
|
278
|
-
for (const attachment of next.attachments) {
|
|
279
|
-
if (held.get(attachment.reference) === attachment)
|
|
280
|
-
continue;
|
|
281
|
-
attachments.put({ ...attachment, locator: next.locator });
|
|
282
|
-
}
|
|
283
271
|
if (previousQueue !== undefined) {
|
|
284
272
|
const pending = transaction.objectStore(PENDING_CHANGES);
|
|
285
273
|
const before = new Set(previousQueue.map((batch) => batch.id));
|
|
@@ -294,7 +282,7 @@ export async function openRuntimeStore() {
|
|
|
294
282
|
locator: next.locator,
|
|
295
283
|
id: batch.id,
|
|
296
284
|
batch,
|
|
297
|
-
drafts: saved ?? [],
|
|
285
|
+
drafts: saved?.get(batch.id) ?? [],
|
|
298
286
|
submission: { state: 'waiting' },
|
|
299
287
|
lost: false,
|
|
300
288
|
});
|
|
@@ -457,13 +445,13 @@ export async function openRuntimeStore() {
|
|
|
457
445
|
await completed(transaction);
|
|
458
446
|
},
|
|
459
447
|
async dropRooms(locators) {
|
|
460
|
-
const transaction = database.transaction([ROOMS, DOCUMENTS,
|
|
448
|
+
const transaction = database.transaction([ROOMS, DOCUMENTS, BINARY_FILES, TRANSFERS, PENDING_CHANGES, ROOM_DRAFTS], 'readwrite');
|
|
461
449
|
for (const locator of locators) {
|
|
462
450
|
transaction.objectStore(ROOMS).delete(locator);
|
|
463
451
|
transaction.objectStore(TRANSFERS).delete(locator);
|
|
464
452
|
transaction.objectStore(DOCUMENTS).delete(underRoom(locator));
|
|
465
|
-
transaction.objectStore(
|
|
466
|
-
for (const name of [
|
|
453
|
+
transaction.objectStore(BINARY_FILES).delete(underRoom(locator));
|
|
454
|
+
for (const name of [PENDING_CHANGES, ROOM_DRAFTS]) {
|
|
467
455
|
removeRoomEntries(transaction.objectStore(name), locator);
|
|
468
456
|
}
|
|
469
457
|
}
|
|
@@ -474,17 +462,17 @@ export async function openRuntimeStore() {
|
|
|
474
462
|
return settled(transaction.objectStore(TRANSFERS).getAll());
|
|
475
463
|
},
|
|
476
464
|
staged(record) {
|
|
477
|
-
const transaction = database.transaction([DOCUMENTS,
|
|
465
|
+
const transaction = database.transaction([DOCUMENTS, BINARY_FILES], 'readonly');
|
|
478
466
|
return readLayer(transaction, record.locator, record.transfer);
|
|
479
467
|
},
|
|
480
468
|
async stage(record, page) {
|
|
481
|
-
const transaction = database.transaction([TRANSFERS, DOCUMENTS,
|
|
469
|
+
const transaction = database.transaction([TRANSFERS, DOCUMENTS, BINARY_FILES], 'readwrite');
|
|
482
470
|
writeLayer(transaction, record.locator, record.transfer, page, null);
|
|
483
471
|
transaction.objectStore(TRANSFERS).put(record);
|
|
484
472
|
await completed(transaction);
|
|
485
473
|
},
|
|
486
474
|
async abandon(locator) {
|
|
487
|
-
const transaction = database.transaction([TRANSFERS, DOCUMENTS,
|
|
475
|
+
const transaction = database.transaction([TRANSFERS, DOCUMENTS, BINARY_FILES], 'readwrite');
|
|
488
476
|
const transfers = transaction.objectStore(TRANSFERS);
|
|
489
477
|
const held = transfers.get(locator);
|
|
490
478
|
held.onsuccess = () => {
|
|
@@ -494,7 +482,7 @@ export async function openRuntimeStore() {
|
|
|
494
482
|
transfers.delete(locator);
|
|
495
483
|
const range = underTransfer(locator, record.transfer);
|
|
496
484
|
transaction.objectStore(DOCUMENTS).delete(range);
|
|
497
|
-
transaction.objectStore(
|
|
485
|
+
transaction.objectStore(BINARY_FILES).delete(range);
|
|
498
486
|
};
|
|
499
487
|
await completed(transaction);
|
|
500
488
|
},
|
package/dist/wire.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare const MEMBERS: {
|
|
|
15
15
|
readonly types: 'within';
|
|
16
16
|
readonly save: 'within';
|
|
17
17
|
readonly history: 'within';
|
|
18
|
+
readonly 'binaryFile.read': 'within';
|
|
19
|
+
readonly 'binaryFile.readReference': 'within';
|
|
18
20
|
readonly call: 'actions';
|
|
19
21
|
readonly reached: 'within';
|
|
20
22
|
readonly log: 'whole';
|
package/dist/wire.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG;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,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC9C,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,GAC7C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAElE,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAQ7C,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAiC5D;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAgC1D"}
|
package/dist/wire.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/mdruntime",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-cde2b99d2fcbc",
|
|
4
4
|
"description": "The headless core of MD App",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,11 +46,19 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@agentshouse/mdmodel": "0.1.0-cc9fa0498a7f7",
|
|
49
|
+
"@assistant-ui/react-markdown": "0.14.20",
|
|
49
50
|
"@tanstack/db": "0.9.2",
|
|
50
|
-
"
|
|
51
|
+
"lucide-react": "1.47.0",
|
|
52
|
+
"mdast-util-from-markdown": "2.0.3",
|
|
53
|
+
"mdast-util-gfm": "3.1.0",
|
|
54
|
+
"micromark-extension-gfm": "3.0.0",
|
|
55
|
+
"minisearch": "7.2.0",
|
|
56
|
+
"radix-ui": "1.8.0",
|
|
57
|
+
"remark-gfm": "4.0.1"
|
|
51
58
|
},
|
|
52
59
|
"peerDependencies": {
|
|
53
60
|
"@assistant-ui/react": "^0.15.22",
|
|
54
|
-
"react": ">=18"
|
|
61
|
+
"react": ">=18",
|
|
62
|
+
"react-dom": ">=18"
|
|
55
63
|
}
|
|
56
64
|
}
|
package/dist/attachment.d.ts
DELETED
package/dist/attachment.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,GAC5C,SAAS,cAAc,EAAE,CAQ3B"}
|
package/dist/attachment.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function declaredAttachments(pages) {
|
|
2
|
-
const byReference = new Map();
|
|
3
|
-
for (const page of pages) {
|
|
4
|
-
for (const attachment of page)
|
|
5
|
-
byReference.set(attachment.reference, attachment);
|
|
6
|
-
}
|
|
7
|
-
return [...byReference.values()].sort((left, right) => left.reference < right.reference ? -1 : left.reference > right.reference ? 1 : 0);
|
|
8
|
-
}
|