@agentshouse/mdruntime 0.1.0-ce6bc9239a3ee → 0.1.0-ce80727f9590f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -19
- package/dist/acceptance.d.ts +2 -25
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +119 -204
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +26 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +321 -0
- package/dist/adapter.d.ts +114 -57
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +0 -5
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -18
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/change.d.ts +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +2 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +11 -2
- package/dist/client.d.ts +25 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +45 -58
- package/dist/collection.d.ts +26 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +28 -10
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -25
- package/dist/connection.d.ts +4 -116
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +103 -2994
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +150 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +22 -3
- package/dist/conversation.d.ts +57 -45
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +974 -1031
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts +12 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +14 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +5 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +23 -12
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +8 -0
- package/dist/figures.d.ts +1 -0
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +6 -4
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +20 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +83 -19
- package/dist/house-query.d.ts +21 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +41 -0
- package/dist/index.d.ts +28 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- package/dist/install.d.ts +22 -48
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +161 -161
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +290 -0
- package/dist/listing.d.ts +60 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +168 -0
- package/dist/live.d.ts +5 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +74 -33
- package/dist/loaded.d.ts +5 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +40 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +34 -0
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +49 -0
- package/dist/media.d.ts +19 -2
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +105 -27
- package/dist/memory.d.ts +9 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +94 -32
- package/dist/messages.d.ts +12 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +35 -39
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +4 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -5
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +153 -0
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +217 -85
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +70 -0
- package/dist/outcome.d.ts +16 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +32 -2
- package/dist/overlay.d.ts +6 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +37 -24
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +5 -58
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +28 -110
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts +41 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +326 -0
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +231 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +287 -0
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +3 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +4 -6
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +480 -0
- package/dist/reach.d.ts +15 -5
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +164 -33
- package/dist/react.d.ts +17 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +9 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +5 -2
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +49 -7
- package/dist/recovery.d.ts +4 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +31 -8
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +55 -0
- package/dist/replica.d.ts +5 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +17 -18
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +31 -8
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +273 -66
- package/dist/room-drafts.d.ts +7 -12
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +44 -40
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +9 -10
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runtime.d.ts +36 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +42 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +326 -225
- package/dist/saves.d.ts +8 -70
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +199 -761
- package/dist/seed.d.ts +3 -8
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +21 -17
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +35 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +326 -0
- package/dist/socket/lanes.d.ts +28 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +103 -0
- package/dist/socket/session.d.ts +41 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +26 -0
- package/dist/socket.d.ts +30 -5
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +75 -6
- package/dist/source.d.ts +5 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +18 -6
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +11 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +68 -0
- package/dist/store/records.d.ts +22 -8
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +84 -24
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +2 -0
- package/dist/store/watchers.d.ts.map +1 -1
- package/dist/store/watchers.js +23 -3
- package/dist/store.d.ts +50 -9
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +78 -17
- package/dist/stored.d.ts +25 -14
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +99 -36
- package/dist/surface.d.ts +94 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +255 -0
- package/dist/sync.d.ts +21 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +557 -0
- package/dist/tables.d.ts +28 -59
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +106 -331
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +6 -7
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -10
- package/dist/wire.d.ts +68 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +26 -9
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/dist/compile.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ARRAY_INDEX, bodied, byCodePoint, compared, cursorOf, heldKind, parse, pointerSegments, sql, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { binaryRecord } from './binary.js';
|
|
3
|
+
import { definitionsAt, UNTYPED } from './collection.js';
|
|
3
4
|
import { documentKey, pathOfKey, roomOfKey } from './rows.js';
|
|
4
5
|
import { FROM_START, MAXIMUM_WINDOW } from './windows.js';
|
|
5
6
|
const { all, any, exists, fragment, grouped, joined, listed } = sql;
|
|
6
|
-
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1
|
|
7
|
+
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1`;
|
|
7
8
|
function located(alias) {
|
|
8
9
|
return fragment(`(SELECT k.locator FROM replica_keys k WHERE k.key = ${alias}.key)`);
|
|
9
10
|
}
|
|
@@ -310,11 +311,20 @@ function sectionsOf(sections, names) {
|
|
|
310
311
|
return sections;
|
|
311
312
|
return Object.fromEntries(names.flatMap((name) => (Object.hasOwn(sections, name) ? [[name, sections[name]]] : [])));
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function freeParts(room, path, type, content) {
|
|
315
|
+
const definitions = room.composition === undefined ? undefined : definitionsAt(room.composition, path);
|
|
316
|
+
const definition = definitions?.(type === UNTYPED ? undefined : type);
|
|
317
|
+
if (definition === undefined && type !== UNTYPED)
|
|
318
|
+
return null;
|
|
319
|
+
const read = parse(content, path, definition);
|
|
320
|
+
return read.ok ? read.document : null;
|
|
321
|
+
}
|
|
322
|
+
function documentOf(shape, queried, row, linked) {
|
|
323
|
+
const room = queried.locator;
|
|
314
324
|
const path = row.path;
|
|
315
325
|
const type = row.type;
|
|
316
|
-
const fileId = row.file_id
|
|
317
|
-
const revision = row.revision
|
|
326
|
+
const fileId = row.file_id;
|
|
327
|
+
const revision = row.revision;
|
|
318
328
|
if (type === null) {
|
|
319
329
|
const binary = row.binary === null ? null : JSON.parse(row.binary);
|
|
320
330
|
const content = row.content ?? null;
|
|
@@ -333,8 +343,9 @@ function documentOf(shape, room, row, linked) {
|
|
|
333
343
|
...heldFacts(shape, row),
|
|
334
344
|
};
|
|
335
345
|
}
|
|
336
|
-
const
|
|
337
|
-
|
|
346
|
+
const body = shape.sections !== null || shape.preamble
|
|
347
|
+
? freeParts(queried, path, type, row.content)
|
|
348
|
+
: null;
|
|
338
349
|
const fields = JSON.parse(row.fields ?? '{}');
|
|
339
350
|
return {
|
|
340
351
|
room,
|
|
@@ -365,7 +376,7 @@ function changeOf(row) {
|
|
|
365
376
|
function heldFacts(shape, row) {
|
|
366
377
|
return {
|
|
367
378
|
...(shape.size ? { size: row.bytes === null ? null : Number(row.bytes) } : {}),
|
|
368
|
-
...(shape.created ? { created: row.created
|
|
379
|
+
...(shape.created ? { created: row.created } : {}),
|
|
369
380
|
};
|
|
370
381
|
}
|
|
371
382
|
function backlinksOf(connection, bound, rows) {
|
|
@@ -377,8 +388,8 @@ function backlinksOf(connection, bound, rows) {
|
|
|
377
388
|
held.push(row.path);
|
|
378
389
|
byKey.set(key, held);
|
|
379
390
|
}
|
|
391
|
+
const reach = reached(bound, 's');
|
|
380
392
|
for (const [key, targets] of byKey) {
|
|
381
|
-
const reach = reached(bound, 's');
|
|
382
393
|
const room = bound.rooms.find((one) => one.key === key).locator;
|
|
383
394
|
const found = connection.rows(`SELECT target, path, type, field FROM (SELECT l.target, s.path, s.type, l.field, ROW_NUMBER() OVER (PARTITION BY l.target ORDER BY s.path, l.field) AS rank FROM (SELECT DISTINCT doc, target, field FROM replica_links WHERE key = ? AND kind = 'field' AND target IN (SELECT value FROM json_each(?))) l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE ${reach.sql}) WHERE rank <= ? ORDER BY target, path, field`, [key, JSON.stringify(targets), ...reach.bind, MAXIMUM_WINDOW]);
|
|
384
395
|
for (const row of found) {
|
|
@@ -395,22 +406,19 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
395
406
|
const filter = filtered(bound, plan);
|
|
396
407
|
const cursor = plan.after?.values ?? null;
|
|
397
408
|
const room = located('d');
|
|
398
|
-
const
|
|
409
|
+
const after = cursor === null
|
|
399
410
|
? null
|
|
400
411
|
: (() => {
|
|
401
412
|
const key = cursor[shape.orderBy.length];
|
|
402
|
-
return any([
|
|
413
|
+
return sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), any([
|
|
403
414
|
fragment(`${room.sql} > ?`, [...room.bind, roomOfKey(key)]),
|
|
404
415
|
fragment(`${room.sql} = ? AND d.path > ?`, [
|
|
405
416
|
...room.bind,
|
|
406
417
|
roomOfKey(key),
|
|
407
418
|
pathOfKey(key),
|
|
408
419
|
]),
|
|
409
|
-
]);
|
|
420
|
+
]));
|
|
410
421
|
})();
|
|
411
|
-
const after = cursor === null || tie === null
|
|
412
|
-
? null
|
|
413
|
-
: sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), tie);
|
|
414
422
|
const selected = joined([
|
|
415
423
|
fragment('SELECT d.id, d.key, d.path, d.type, d.binary, d.revision, d.fields, d.change, d.file_id, d.bytes, d.created'),
|
|
416
424
|
...terms.map(({ term }, index) => joined([
|
|
@@ -431,8 +439,9 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
431
439
|
const kept = bodied(shape) ? withContent(connection, windowed, budget) : windowed;
|
|
432
440
|
const cut = kept.length;
|
|
433
441
|
const roomOf = new Map(bound.rooms.map(({ key, locator }) => [key, locator]));
|
|
442
|
+
const queried = new Map(bound.rooms.map((one) => [one.key, one]));
|
|
434
443
|
const linked = shape.backlinks ? backlinksOf(connection, bound, kept) : new Map();
|
|
435
|
-
const found = kept.map((row) => documentOf(shape,
|
|
444
|
+
const found = kept.map((row) => documentOf(shape, queried.get(Number(row.key)), row, linked));
|
|
436
445
|
const last = kept.at(-1);
|
|
437
446
|
const cursorAt = (row) => cursorOf([
|
|
438
447
|
...shape.orderBy.map(({ key }, index) => decodedKey(key, row, index)),
|
|
@@ -645,17 +654,14 @@ function groups(connection, bound, plan, shape) {
|
|
|
645
654
|
{ ordering: GROUP_TIES, kind: fragment("'string'"), value: fragment(`k${index}`) },
|
|
646
655
|
]);
|
|
647
656
|
const cursor = plan.after?.values ?? null;
|
|
648
|
-
const
|
|
657
|
+
const after = cursor === null
|
|
649
658
|
? null
|
|
650
|
-
:
|
|
651
|
-
value,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
: sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
|
|
657
|
-
.slice(0, -1)
|
|
658
|
-
.map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
|
|
659
|
+
: (() => {
|
|
660
|
+
const tieValues = cursor[shape.orderBy.length].flatMap((value) => [value, heldKind(value ?? null)]);
|
|
661
|
+
return sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
|
|
662
|
+
.slice(0, -1)
|
|
663
|
+
.map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
|
|
664
|
+
})();
|
|
659
665
|
const grouping = joined([fragment(`SELECT ${columns} FROM (`), ranked, fragment(`) GROUP BY ${held}`)], '');
|
|
660
666
|
const windowed = joined([
|
|
661
667
|
fragment('SELECT * FROM ('),
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
import { type Observation } from './observation.js';
|
|
4
|
-
import { type DocumentResult, type GroupResult, type PendingResult } from './query.js';
|
|
5
|
-
import { type FiguresResult } from './figures.js';
|
|
6
|
-
import { type EntrySeed } from './seed.js';
|
|
7
|
-
import { type SearchRequest, type SearchResult } from './search.js';
|
|
8
|
-
import { type Adapter, type Authorization, type Member, type ProviderRefusal, type ServiceMode } from './adapter.js';
|
|
9
|
-
import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
10
|
-
import { type WrittenBy } from './change.js';
|
|
11
|
-
import type { Open } from './open.js';
|
|
12
|
-
import { type CallResult, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
13
|
-
import { type ObservedRead } from './reads.js';
|
|
1
|
+
import type { Adapter, Authorization } from './adapter.js';
|
|
2
|
+
import { type RuntimeShell } from './durability.js';
|
|
14
3
|
import { type Recovery } from './recovery.js';
|
|
15
|
-
import type { RoomDraft } from './room-draft.js';
|
|
16
|
-
import { type SyncStatus } from './status.js';
|
|
17
|
-
import { type RuntimeShell, type UnsentWork } from './durability.js';
|
|
18
|
-
import { type CodeAvailability, type Persistence, type Readiness } from './readiness.js';
|
|
19
4
|
import { type RuntimeDatabase } from './store.js';
|
|
20
|
-
import { type
|
|
21
|
-
import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
|
|
22
|
-
import { type BinaryFileSurface, type SavedParts, type SavedRoomDraft, type SaveResult } from './saves.js';
|
|
23
|
-
export type AppTypedSelection = {
|
|
24
|
-
roots: readonly string[];
|
|
25
|
-
model: TypesResult;
|
|
26
|
-
};
|
|
27
|
-
export type AppRoom = {
|
|
28
|
-
name: string;
|
|
29
|
-
locator: string;
|
|
30
|
-
handle: string;
|
|
31
|
-
operations: import('./adapter.js').OperationScopes;
|
|
32
|
-
replica: import('./adapter.js').ReplicaAdmission;
|
|
33
|
-
model: TypesResult;
|
|
34
|
-
typedSelection: AppTypedSelection | null;
|
|
35
|
-
providerOwnedPaths: readonly string[];
|
|
36
|
-
roomVersion: string | null;
|
|
37
|
-
documents: number;
|
|
38
|
-
synchronizationAvailable: boolean;
|
|
39
|
-
refusal: ProviderRefusal | null;
|
|
40
|
-
locked: boolean;
|
|
41
|
-
};
|
|
42
|
-
export type RoomSchemas = {
|
|
43
|
-
collection: TypesResult;
|
|
44
|
-
typedSelection: TypesResult | null;
|
|
45
|
-
};
|
|
46
|
-
type RefusalReason = 'missing-required-guarantee' | 'revoked-authorization';
|
|
47
|
-
export type ConnectionRefusalCode = Open<RefusalReason>;
|
|
48
|
-
export type ConnectionRefusal = {
|
|
49
|
-
code: ConnectionRefusalCode;
|
|
50
|
-
retryable: boolean;
|
|
51
|
-
reauthorizationOffered: boolean;
|
|
52
|
-
refusal: ProviderRefusal | null;
|
|
53
|
-
};
|
|
5
|
+
import { type ComposedRuntime } from './surface.js';
|
|
54
6
|
export type MdRuntimeOptions = {
|
|
55
7
|
adapter: Adapter;
|
|
56
8
|
shell: RuntimeShell;
|
|
@@ -60,71 +12,7 @@ export type MdRuntimeOptions = {
|
|
|
60
12
|
recovery?: Recovery;
|
|
61
13
|
usableWhenHeld?: readonly string[];
|
|
62
14
|
build?: string;
|
|
63
|
-
|
|
64
|
-
export type HistoryQuery = {
|
|
65
|
-
revision?: string;
|
|
66
|
-
pageToken?: string;
|
|
67
|
-
};
|
|
68
|
-
export type MdRuntime = {
|
|
69
|
-
loaded(): Promise<void>;
|
|
70
|
-
rooms(): Promise<readonly AppRoom[]>;
|
|
71
|
-
query: {
|
|
72
|
-
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
73
|
-
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
74
|
-
};
|
|
75
|
-
search(request: SearchRequest): Promise<SearchResult>;
|
|
76
|
-
types(locator: string): Promise<RoomSchemas>;
|
|
77
|
-
roomDraft: RoomDraftSurface;
|
|
78
|
-
conversation: ConversationSurface;
|
|
79
|
-
chatDraft: ChatDraftSurface;
|
|
80
|
-
presentation: PresentationSurface;
|
|
81
|
-
save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
82
|
-
saveParts(room: string, parts: readonly SavedParts[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
83
|
-
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
84
|
-
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
85
|
-
binaryFile: BinaryFileSurface;
|
|
86
|
-
call(name: string, input: unknown): Promise<CallResult>;
|
|
87
|
-
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
88
|
-
log(): string;
|
|
89
|
-
persistence(): boolean;
|
|
90
|
-
retry(): Promise<void>;
|
|
91
|
-
cleanUp(): Promise<number>;
|
|
92
|
-
unsent(): Promise<readonly UnsentWork[]>;
|
|
93
|
-
reset(): Promise<void>;
|
|
94
|
-
readAgain(): Promise<void>;
|
|
95
|
-
observe: {
|
|
96
|
-
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
97
|
-
(topic: 'readiness'): Promise<Observation<Readiness>>;
|
|
98
|
-
(topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;
|
|
99
|
-
(topic: 'storage-loss'): Promise<Observation<string | null>>;
|
|
100
|
-
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
101
|
-
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
102
|
-
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
103
|
-
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
104
|
-
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
105
|
-
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
106
|
-
(topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
|
|
107
|
-
(topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
|
|
108
|
-
(topic: 'presentation', app: string): Promise<Observation<unknown>>;
|
|
109
|
-
(topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
|
|
110
|
-
(topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
|
|
111
|
-
(topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
|
|
112
|
-
(topic: 'figures'): Promise<Observation<FiguresResult>>;
|
|
113
|
-
(topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
|
|
114
|
-
};
|
|
115
|
-
reauthorize(): Promise<void>;
|
|
116
|
-
};
|
|
117
|
-
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'figures' | 'read';
|
|
118
|
-
export type ReadinessPort = {
|
|
119
|
-
readonly target: string;
|
|
120
|
-
readonly code: CodeAvailability;
|
|
121
|
-
};
|
|
122
|
-
export type ComposedRuntime = RuntimeView & {
|
|
123
|
-
seed(entry: EntrySeed): void;
|
|
124
|
-
stop(): Promise<void>;
|
|
125
|
-
persisted(answer: Persistence): void;
|
|
126
|
-
within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
15
|
+
storeOnNeed?: boolean;
|
|
127
16
|
};
|
|
128
17
|
export declare function composeRuntime(options: MdRuntimeOptions): ComposedRuntime;
|
|
129
|
-
export {};
|
|
130
18
|
//# sourceMappingURL=connection.d.ts.map
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAI/E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAUrE,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9D,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGrE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAuGzE"}
|