@agentshouse/mdruntime 0.1.0-ca14c49c06d90 → 0.1.0-ca4dc698bd0c4
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 +260 -259
- package/dist/acquisition.d.ts +14 -0
- package/dist/acquisition.d.ts.map +1 -0
- package/dist/acquisition.js +24 -0
- package/dist/adapter.d.ts +6 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/change-set.d.ts +2 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +34 -9
- package/dist/client.d.ts +8 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/collection.d.ts +17 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +230 -19
- package/dist/connection.d.ts +20 -7
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +926 -175
- package/dist/conversation.d.ts +8 -5
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +128 -83
- package/dist/durability.d.ts +7 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +2 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +3 -3
- package/dist/host.d.ts +11 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +33 -3
- package/dist/identity.d.ts +2 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +6 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/memory.d.ts +2 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +7 -2
- package/dist/model.d.ts +1 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +9 -0
- package/dist/observation.d.ts +5 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +22 -11
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +25 -54
- package/dist/query.d.ts +28 -3
- package/dist/query.d.ts.map +1 -1
- package/dist/reach.d.ts +6 -2
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +16 -4
- package/dist/react.d.ts +5 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/read-side.d.ts +13 -6
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +282 -83
- package/dist/readiness.d.ts +53 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +33 -0
- package/dist/recovery.d.ts +25 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +197 -0
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +11 -10
- package/dist/replica.d.ts +1 -1
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +47 -19
- package/dist/rows.d.ts +4 -13
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +2 -12
- package/dist/save.d.ts +5 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +36 -13
- package/dist/search.d.ts +28 -6
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +108 -45
- package/dist/shared.d.ts +11 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +368 -0
- package/dist/status.d.ts +4 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/store.d.ts +18 -3
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +147 -49
- package/dist/turn.d.ts +7 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +45 -0
- package/dist/wire.d.ts +2 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +2 -0
- package/package.json +2 -2
package/dist/store.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sameBinary, sameChange } from './overlay.js';
|
|
2
|
+
import { differing } from './shared.js';
|
|
2
3
|
const DATABASE = 'mdruntime';
|
|
3
4
|
const AUTHORED = 'mdruntime-authored';
|
|
4
5
|
const FENCES = 'fences';
|
|
@@ -19,10 +20,11 @@ const QUEUES = 'queues';
|
|
|
19
20
|
const FACTS = 'facts';
|
|
20
21
|
const CURRENT = 'current';
|
|
21
22
|
const MEMBER = 'member';
|
|
23
|
+
const TARGETS = 'targets';
|
|
22
24
|
const GENERATION = 'generation';
|
|
23
25
|
const HOLDER = 'holder';
|
|
24
26
|
const BINDING = 'binding';
|
|
25
|
-
export const STORE_SCHEMA =
|
|
27
|
+
export const STORE_SCHEMA = 25;
|
|
26
28
|
const REPLICA_SHAPE = 23;
|
|
27
29
|
export const AUTHORED_SCHEMA = 2;
|
|
28
30
|
const AUTHORED_STORES = [
|
|
@@ -46,6 +48,11 @@ const REPLICA_STORES = [
|
|
|
46
48
|
[MESSAGES, { keyPath: ['conversation', 'identity'] }],
|
|
47
49
|
];
|
|
48
50
|
const READ_BATCH = 256;
|
|
51
|
+
const MESSAGE_INDEXES = [
|
|
52
|
+
['conversation', 'conversation'],
|
|
53
|
+
['position', ['conversation', 'position']],
|
|
54
|
+
['turn', ['conversation', 'turn']],
|
|
55
|
+
];
|
|
49
56
|
function settled(request) {
|
|
50
57
|
return new Promise((resolve, reject) => {
|
|
51
58
|
request.onsuccess = () => resolve(request.result);
|
|
@@ -88,6 +95,9 @@ function amendPending(database, locator, id, amendment) {
|
|
|
88
95
|
};
|
|
89
96
|
return completed(transaction);
|
|
90
97
|
}
|
|
98
|
+
function accepted({ conversation: _held, ...message }) {
|
|
99
|
+
return message;
|
|
100
|
+
}
|
|
91
101
|
function roomRecord(record) {
|
|
92
102
|
const { documents, binaries, revisions, changes, written, ...room } = record;
|
|
93
103
|
return room;
|
|
@@ -160,29 +170,29 @@ function binaryFileRecord(locator, transfer, layer, path) {
|
|
|
160
170
|
}
|
|
161
171
|
function writeLayer(transaction, locator, transfer, next, base) {
|
|
162
172
|
const documents = transaction.objectStore(DOCUMENTS);
|
|
163
|
-
for (const path of Object.keys(base?.documents ?? {})) {
|
|
164
|
-
if (next.documents[path] === undefined)
|
|
165
|
-
documents.delete([locator, transfer, path]);
|
|
166
|
-
}
|
|
167
|
-
for (const [path, content] of Object.entries(next.documents)) {
|
|
168
|
-
if (base?.documents[path] === content &&
|
|
169
|
-
base.revisions[path] === next.revisions[path] &&
|
|
170
|
-
base.written[path] === next.written[path] &&
|
|
171
|
-
sameChange(base.changes[path], next.changes[path]))
|
|
172
|
-
continue;
|
|
173
|
-
documents.put(documentRecord(locator, transfer, next, path));
|
|
174
|
-
}
|
|
175
173
|
const files = transaction.objectStore(BINARY_FILES);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
base
|
|
183
|
-
|
|
174
|
+
const paths = base === null
|
|
175
|
+
? new Set([...Object.keys(next.documents), ...Object.keys(next.binaries)])
|
|
176
|
+
: new Set([
|
|
177
|
+
...differing(base.documents, next.documents),
|
|
178
|
+
...differing(base.revisions, next.revisions),
|
|
179
|
+
...differing(base.written, next.written),
|
|
180
|
+
...differing(base.changes, next.changes, sameChange),
|
|
181
|
+
...differing(base.binaries, next.binaries, sameBinary),
|
|
182
|
+
]);
|
|
183
|
+
for (const path of paths) {
|
|
184
|
+
if (next.documents[path] !== undefined) {
|
|
185
|
+
documents.put(documentRecord(locator, transfer, next, path));
|
|
186
|
+
}
|
|
187
|
+
else if (base?.documents[path] !== undefined) {
|
|
188
|
+
documents.delete([locator, transfer, path]);
|
|
189
|
+
}
|
|
190
|
+
if (next.binaries[path] !== undefined) {
|
|
184
191
|
files.put(binaryFileRecord(locator, transfer, next, path));
|
|
185
192
|
}
|
|
193
|
+
else if (base?.binaries[path] !== undefined) {
|
|
194
|
+
files.delete([locator, transfer, path]);
|
|
195
|
+
}
|
|
186
196
|
}
|
|
187
197
|
}
|
|
188
198
|
function removeRoomEntries(store, locator) {
|
|
@@ -263,34 +273,49 @@ export async function removeRuntimeStore(holder) {
|
|
|
263
273
|
await removeDatabase(AUTHORED);
|
|
264
274
|
return false;
|
|
265
275
|
}
|
|
276
|
+
export function openDatabase(name, version, upgrade) {
|
|
277
|
+
return new Promise((resolve, reject) => {
|
|
278
|
+
const opening = indexedDB.open(name, version);
|
|
279
|
+
opening.onupgradeneeded = (event) => upgrade(opening, event.oldVersion);
|
|
280
|
+
opening.onsuccess = () => resolve(opening.result);
|
|
281
|
+
opening.onerror = () => {
|
|
282
|
+
if (opening.error?.name !== 'VersionError') {
|
|
283
|
+
reject(opening.error);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
removeDatabase(name)
|
|
287
|
+
.then(() => openDatabase(name, version, upgrade))
|
|
288
|
+
.then(resolve, reject);
|
|
289
|
+
};
|
|
290
|
+
});
|
|
291
|
+
}
|
|
266
292
|
function openReplica() {
|
|
267
|
-
|
|
268
|
-
opening.onupgradeneeded = (event) => {
|
|
293
|
+
return openDatabase(DATABASE, STORE_SCHEMA, (opening, oldVersion) => {
|
|
269
294
|
const database = opening.result;
|
|
270
|
-
if (
|
|
295
|
+
if (oldVersion < REPLICA_SHAPE) {
|
|
271
296
|
for (const name of [...database.objectStoreNames])
|
|
272
297
|
database.deleteObjectStore(name);
|
|
273
298
|
}
|
|
274
299
|
for (const [name, parameters] of REPLICA_STORES) {
|
|
275
300
|
if (database.objectStoreNames.contains(name))
|
|
276
301
|
continue;
|
|
277
|
-
|
|
278
|
-
if (name === MESSAGES)
|
|
279
|
-
store.createIndex('conversation', 'conversation');
|
|
302
|
+
database.createObjectStore(name, parameters);
|
|
280
303
|
}
|
|
281
|
-
|
|
282
|
-
|
|
304
|
+
const messages = opening.transaction.objectStore(MESSAGES);
|
|
305
|
+
for (const [name, keyPath] of MESSAGE_INDEXES) {
|
|
306
|
+
if (!messages.indexNames.contains(name))
|
|
307
|
+
messages.createIndex(name, keyPath);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
283
310
|
}
|
|
284
311
|
function openAuthored() {
|
|
285
|
-
|
|
286
|
-
opening.onupgradeneeded = () => {
|
|
312
|
+
return openDatabase(AUTHORED, AUTHORED_SCHEMA, (opening) => {
|
|
287
313
|
const database = opening.result;
|
|
288
314
|
for (const [name, parameters] of AUTHORED_STORES) {
|
|
289
315
|
if (!database.objectStoreNames.contains(name))
|
|
290
316
|
database.createObjectStore(name, parameters);
|
|
291
317
|
}
|
|
292
|
-
};
|
|
293
|
-
return settled(opening);
|
|
318
|
+
});
|
|
294
319
|
}
|
|
295
320
|
export async function openRuntimeStore(fenced) {
|
|
296
321
|
const authored = await openAuthored();
|
|
@@ -402,6 +427,16 @@ export async function openRuntimeStore(fenced) {
|
|
|
402
427
|
transaction.objectStore(DECLARATIONS).put(member, MEMBER);
|
|
403
428
|
await completed(transaction);
|
|
404
429
|
},
|
|
430
|
+
async targets() {
|
|
431
|
+
const transaction = database.transaction(DECLARATIONS, 'readonly');
|
|
432
|
+
const held = await settled(transaction.objectStore(DECLARATIONS).get(TARGETS));
|
|
433
|
+
return held ?? {};
|
|
434
|
+
},
|
|
435
|
+
async keepTargets(targets) {
|
|
436
|
+
const transaction = database.transaction(DECLARATIONS, 'readwrite');
|
|
437
|
+
transaction.objectStore(DECLARATIONS).put(targets, TARGETS);
|
|
438
|
+
await completed(transaction);
|
|
439
|
+
},
|
|
405
440
|
async queues() {
|
|
406
441
|
const transaction = authored.transaction([QUEUES, PENDING_CHANGES], 'readonly');
|
|
407
442
|
const [queues, pending] = await Promise.all([
|
|
@@ -450,19 +485,28 @@ export async function openRuntimeStore(fenced) {
|
|
|
450
485
|
},
|
|
451
486
|
async conversations() {
|
|
452
487
|
const transaction = database.transaction([CONVERSATIONS, MESSAGES], 'readonly');
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
488
|
+
const records = await settled(transaction.objectStore(CONVERSATIONS).getAll());
|
|
489
|
+
const held = new Map(records.map(({ conversation, read, partial }) => [
|
|
490
|
+
conversation,
|
|
491
|
+
{ conversation, read, partial: partial === true },
|
|
492
|
+
]));
|
|
493
|
+
const keys = transaction.objectStore(MESSAGES).index('conversation');
|
|
494
|
+
await new Promise((resolve, reject) => {
|
|
495
|
+
const cursor = keys.openKeyCursor(null, 'nextunique');
|
|
496
|
+
cursor.onerror = () => reject(cursor.error);
|
|
497
|
+
cursor.onsuccess = () => {
|
|
498
|
+
const at = cursor.result;
|
|
499
|
+
if (at === null) {
|
|
500
|
+
resolve();
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const conversation = at.key;
|
|
504
|
+
if (!held.has(conversation)) {
|
|
505
|
+
held.set(conversation, { conversation, read: undefined, partial: true });
|
|
506
|
+
}
|
|
507
|
+
at.continue();
|
|
508
|
+
};
|
|
509
|
+
});
|
|
466
510
|
return [...held.values()];
|
|
467
511
|
},
|
|
468
512
|
async keepMessages({ conversation, messages, read }) {
|
|
@@ -472,12 +516,60 @@ export async function openRuntimeStore(fenced) {
|
|
|
472
516
|
stored.put({ ...message, conversation });
|
|
473
517
|
}
|
|
474
518
|
if (read !== undefined) {
|
|
475
|
-
transaction
|
|
476
|
-
|
|
477
|
-
.
|
|
519
|
+
transaction.objectStore(CONVERSATIONS).put({
|
|
520
|
+
conversation,
|
|
521
|
+
read: read.at,
|
|
522
|
+
...(read.partial ? { partial: true } : {}),
|
|
523
|
+
});
|
|
478
524
|
}
|
|
479
525
|
await completed(transaction);
|
|
480
526
|
},
|
|
527
|
+
async messageWindow(conversation, limit) {
|
|
528
|
+
const transaction = database.transaction(MESSAGES, 'readonly');
|
|
529
|
+
const index = transaction.objectStore(MESSAGES).index('position');
|
|
530
|
+
const range = IDBKeyRange.bound([conversation], [conversation, []]);
|
|
531
|
+
if (limit === undefined) {
|
|
532
|
+
return (await settled(index.getAll(range))).map(accepted);
|
|
533
|
+
}
|
|
534
|
+
const latest = [];
|
|
535
|
+
if (limit === 0)
|
|
536
|
+
return latest;
|
|
537
|
+
await new Promise((resolve, reject) => {
|
|
538
|
+
const cursor = index.openCursor(range, 'prev');
|
|
539
|
+
cursor.onerror = () => reject(cursor.error);
|
|
540
|
+
cursor.onsuccess = () => {
|
|
541
|
+
const at = cursor.result;
|
|
542
|
+
if (at === null) {
|
|
543
|
+
resolve();
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
latest.push(accepted(at.value));
|
|
547
|
+
if (latest.length === limit)
|
|
548
|
+
resolve();
|
|
549
|
+
else
|
|
550
|
+
at.continue();
|
|
551
|
+
};
|
|
552
|
+
});
|
|
553
|
+
return latest.reverse();
|
|
554
|
+
},
|
|
555
|
+
async messagesAfter(conversation, identity) {
|
|
556
|
+
const transaction = database.transaction(MESSAGES, 'readonly');
|
|
557
|
+
const range = identity === null
|
|
558
|
+
? IDBKeyRange.bound([conversation], [conversation, []])
|
|
559
|
+
: IDBKeyRange.bound([conversation, identity], [conversation, []], true);
|
|
560
|
+
const held = await settled(transaction.objectStore(MESSAGES).getAll(range, READ_BATCH));
|
|
561
|
+
return held.map(accepted);
|
|
562
|
+
},
|
|
563
|
+
async messageIdentities(conversation) {
|
|
564
|
+
const transaction = database.transaction(MESSAGES, 'readonly');
|
|
565
|
+
const keys = await settled(transaction.objectStore(MESSAGES).index('conversation').getAllKeys(conversation));
|
|
566
|
+
return keys.map((key) => key[1]);
|
|
567
|
+
},
|
|
568
|
+
async turnArrived(conversation, turn) {
|
|
569
|
+
const transaction = database.transaction(MESSAGES, 'readonly');
|
|
570
|
+
const held = await settled(transaction.objectStore(MESSAGES).index('turn').count([conversation, turn]));
|
|
571
|
+
return held > 0;
|
|
572
|
+
},
|
|
481
573
|
async dropConversations(conversations) {
|
|
482
574
|
const drafts = authored.transaction(CHAT_DRAFTS, 'readwrite');
|
|
483
575
|
for (const conversation of conversations)
|
|
@@ -552,6 +644,12 @@ export async function openRuntimeStore(fenced) {
|
|
|
552
644
|
fences.objectStore(FENCES).delete(locator);
|
|
553
645
|
await completed(fences);
|
|
554
646
|
},
|
|
647
|
+
async discard(locator) {
|
|
648
|
+
const transaction = authored.transaction([QUEUES, PENDING_CHANGES], 'readwrite');
|
|
649
|
+
transaction.objectStore(QUEUES).delete(locator);
|
|
650
|
+
removeRoomEntries(transaction.objectStore(PENDING_CHANGES), locator);
|
|
651
|
+
await completed(transaction);
|
|
652
|
+
},
|
|
555
653
|
async transfers() {
|
|
556
654
|
const transaction = database.transaction(TRANSFERS, 'readonly');
|
|
557
655
|
const held = await settled(transaction.objectStore(TRANSFERS).getAll());
|
package/dist/turn.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function yielded(): Promise<void>;
|
|
2
|
+
export declare const ROW_WEIGHT = 256;
|
|
3
|
+
export type Later<T> = T | Promise<T>;
|
|
4
|
+
export declare function after<T, R>(value: Later<T>, next: (value: T) => R): Later<R>;
|
|
5
|
+
export declare function inUnits<T>(items: Iterable<T>, each: (item: T) => number): Later<void>;
|
|
6
|
+
export declare function inChunks<T>(items: readonly T[], weigh: (item: T) => number, each: (chunk: readonly T[]) => void): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=turn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../src/turn.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CASvC;AAID,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtC,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAE5E;AAaD,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAOrF;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC1B,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,IAAI,GAClC,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
package/dist/turn.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function yielded() {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
const channel = new MessageChannel();
|
|
4
|
+
channel.port1.onmessage = () => {
|
|
5
|
+
channel.port1.close();
|
|
6
|
+
resolve();
|
|
7
|
+
};
|
|
8
|
+
channel.port2.postMessage(null);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const UNIT = 1 << 20;
|
|
12
|
+
export const ROW_WEIGHT = 256;
|
|
13
|
+
export function after(value, next) {
|
|
14
|
+
return value instanceof Promise ? value.then(next) : next(value);
|
|
15
|
+
}
|
|
16
|
+
async function resumed(iterator, each) {
|
|
17
|
+
let spent = UNIT;
|
|
18
|
+
for (let next = iterator.next(); next.done !== true; next = iterator.next()) {
|
|
19
|
+
if (spent >= UNIT) {
|
|
20
|
+
await yielded();
|
|
21
|
+
spent = 0;
|
|
22
|
+
}
|
|
23
|
+
spent += each(next.value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function inUnits(items, each) {
|
|
27
|
+
const iterator = items[Symbol.iterator]();
|
|
28
|
+
let spent = 0;
|
|
29
|
+
for (let next = iterator.next(); next.done !== true; next = iterator.next()) {
|
|
30
|
+
spent += each(next.value);
|
|
31
|
+
if (spent >= UNIT)
|
|
32
|
+
return resumed(iterator, each);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function inChunks(items, weigh, each) {
|
|
36
|
+
for (let at = 0; at < items.length;) {
|
|
37
|
+
await yielded();
|
|
38
|
+
const chunk = [];
|
|
39
|
+
for (let spent = 0; at < items.length && spent < UNIT; at += 1) {
|
|
40
|
+
chunk.push(items[at]);
|
|
41
|
+
spent += weigh(items[at]);
|
|
42
|
+
}
|
|
43
|
+
each(chunk);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/wire.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare const MEMBERS: {
|
|
|
21
21
|
readonly reached: 'within';
|
|
22
22
|
readonly log: 'whole';
|
|
23
23
|
readonly persistence: 'runtime';
|
|
24
|
+
readonly retry: 'runtime';
|
|
24
25
|
readonly reauthorize: 'runtime';
|
|
25
26
|
readonly 'roomDraft.list': 'within';
|
|
26
27
|
readonly 'roomDraft.read': 'within';
|
|
@@ -42,6 +43,7 @@ declare const MEMBERS: {
|
|
|
42
43
|
};
|
|
43
44
|
declare const TOPICS: {
|
|
44
45
|
readonly rooms: 'within';
|
|
46
|
+
readonly readiness: 'within';
|
|
45
47
|
readonly 'connection-refusal': 'runtime';
|
|
46
48
|
readonly 'storage-loss': 'runtime';
|
|
47
49
|
readonly 'deployment-facts': 'runtime';
|
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;IACxB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IACjG,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,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AE,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
|
@@ -11,6 +11,7 @@ const MEMBERS = {
|
|
|
11
11
|
reached: 'within',
|
|
12
12
|
log: 'whole',
|
|
13
13
|
persistence: 'runtime',
|
|
14
|
+
retry: 'runtime',
|
|
14
15
|
reauthorize: 'runtime',
|
|
15
16
|
'roomDraft.list': 'within',
|
|
16
17
|
'roomDraft.read': 'within',
|
|
@@ -32,6 +33,7 @@ const MEMBERS = {
|
|
|
32
33
|
};
|
|
33
34
|
const TOPICS = {
|
|
34
35
|
rooms: 'within',
|
|
36
|
+
readiness: 'within',
|
|
35
37
|
'connection-refusal': 'runtime',
|
|
36
38
|
'storage-loss': 'runtime',
|
|
37
39
|
'deployment-facts': 'runtime',
|
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-ca4dc698bd0c4",
|
|
4
4
|
"description": "The headless core of MD App",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"LICENSE"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agentshouse/mdmodel": "0.1.0-
|
|
52
|
+
"@agentshouse/mdmodel": "0.1.0-cad192ab63d5f",
|
|
53
53
|
"@assistant-ui/react-markdown": "0.14.20",
|
|
54
54
|
"@tanstack/db": "0.9.2",
|
|
55
55
|
"lucide-react": "1.47.0",
|