@agentshouse/mdruntime 0.1.0-c698c0ebd65bd → 0.1.0-c6b1e70f2da66
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 +19 -16
- package/dist/acceptance.d.ts +6 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +387 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +251 -0
- package/dist/adapter.d.ts +155 -86
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +7 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +40 -41
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +31 -11
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +324 -93
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/chain.d.ts +12 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +9 -14
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -63
- package/dist/change.d.ts +32 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +14 -3
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +45 -16
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +104 -13
- package/dist/collection.d.ts +31 -9
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +49 -80
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +711 -0
- package/dist/connection.d.ts +8 -117
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +106 -2486
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +1 -4
- package/dist/conversation-live.d.ts +135 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +247 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +53 -0
- package/dist/conversation.d.ts +55 -42
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +985 -649
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/durability.d.ts +19 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +7 -4
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +33 -28
- package/dist/expectation.d.ts +4 -2
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +33 -11
- package/dist/failure.d.ts +1 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -0
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- 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 +11 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +127 -20
- package/dist/index.d.ts +35 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/install.d.ts +56 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +556 -0
- package/dist/job.d.ts +5 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +7 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +270 -0
- package/dist/listing.d.ts +53 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +176 -0
- package/dist/live.d.ts +23 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +165 -0
- package/dist/locks.d.ts +9 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +62 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +61 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +19 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +251 -97
- package/dist/messages.d.ts +49 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +148 -0
- package/dist/model.d.ts +11 -12
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -15
- package/dist/models.d.ts +14 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +197 -0
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +22 -4
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +127 -26
- package/dist/opened.d.ts +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +60 -0
- package/dist/outcome.d.ts +49 -8
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +42 -0
- package/dist/overlay.d.ts +5 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +132 -192
- package/dist/parts.d.ts +11 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +21 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +26 -0
- package/dist/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +233 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +272 -0
- package/dist/query.d.ts +49 -183
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -464
- package/dist/{chat/questions.d.ts → questions.d.ts} +5 -2
- package/dist/questions.d.ts.map +1 -0
- package/dist/{chat/questions.js → questions.js} +13 -2
- package/dist/reach.d.ts +21 -7
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +292 -91
- package/dist/react.d.ts +20 -6
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +17 -18
- package/dist/{chat/read.d.ts → read.d.ts} +2 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/{chat/read.js → read.js} +4 -0
- package/dist/readiness.d.ts +49 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +27 -0
- package/dist/reads.d.ts +37 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +174 -0
- package/dist/recovery.d.ts +26 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +232 -0
- package/dist/refresh.d.ts +17 -14
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +143 -51
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +57 -0
- package/dist/replica.d.ts +56 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +338 -159
- package/dist/room-draft.d.ts +39 -9
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +186 -86
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +217 -0
- package/dist/rows.d.ts +30 -37
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +60 -128
- package/dist/runtime.d.ts +43 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +58 -10
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +569 -189
- package/dist/saves.d.ts +70 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +1008 -0
- package/dist/search.d.ts +15 -55
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -121
- package/dist/seed.d.ts +25 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +145 -0
- package/dist/shared.d.ts +10 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +339 -0
- package/dist/shown.d.ts +31 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +290 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/rooms.d.ts +44 -0
- package/dist/socket/rooms.d.ts.map +1 -0
- package/dist/socket/rooms.js +90 -0
- package/dist/socket/session.d.ts +38 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +70 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +175 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +82 -0
- package/dist/status.d.ts +5 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- package/dist/store/fences.d.ts +16 -0
- package/dist/store/fences.d.ts.map +1 -0
- package/dist/store/fences.js +26 -0
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +210 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +428 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -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 +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +106 -127
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +136 -575
- package/dist/stored.d.ts +156 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +649 -0
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +224 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +532 -0
- package/dist/tables.d.ts +412 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +737 -0
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +75 -0
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +104 -0
- package/dist/windows.d.ts +11 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +16 -0
- package/dist/wire.d.ts +181 -33
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +62 -31
- package/package.json +19 -19
- package/AGENTS.md +0 -299
- package/dist/chat/acts.d.ts +0 -33
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/input.d.ts +0 -9
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -99
- package/dist/chat/kit.d.ts +0 -60
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -26
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -62
- package/dist/chat/markdown.d.ts +0 -20
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -188
- package/dist/chat/message.d.ts +0 -6
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -192
- package/dist/chat/messages.d.ts +0 -21
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -151
- package/dist/chat/name.d.ts +0 -6
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -11
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -17
- package/dist/chat/overlay.d.ts +0 -31
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -97
- package/dist/chat/parts.d.ts +0 -57
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -119
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -63
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -620
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -80
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/ready.d.ts +0 -33
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -91
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -302
- package/dist/chat.d.ts +0 -14
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/read-side.d.ts +0 -18
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -440
package/dist/reach.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { selected } from './collection.js';
|
|
1
2
|
import { unheldView } from './conversation.js';
|
|
2
3
|
import { modelTypes, NO_MODEL } from './model.js';
|
|
3
|
-
import {
|
|
4
|
-
import { runtimeError } from './failure.js';
|
|
5
|
-
import { failure, undeclared, } from './outcome.js';
|
|
4
|
+
import { changeOf, digestApplied, digestOf, observing, } from './observation.js';
|
|
5
|
+
import { runtimeError, uncaught } from './failure.js';
|
|
6
|
+
import { failure, lockedRoom, ROOM_LOCKED, undeclared, UNREADABLE, } from './outcome.js';
|
|
6
7
|
import { beneath } from './paths.js';
|
|
7
|
-
import { reconciled } from './read-side.js';
|
|
8
8
|
import { moveTarget, readParts, staleWrite, } from './room-draft.js';
|
|
9
9
|
import { documentKey } from './rows.js';
|
|
10
10
|
const UNHELD_TYPES = { collection: modelTypes(NO_MODEL), typedSelection: null };
|
|
@@ -14,18 +14,26 @@ function unconversed(name) {
|
|
|
14
14
|
const NO_CONVERSATION = {
|
|
15
15
|
list: () => Promise.resolve([]),
|
|
16
16
|
read: (conversation) => Promise.resolve(unheldView(conversation)),
|
|
17
|
-
create: unconversed('
|
|
18
|
-
send: unconversed('
|
|
19
|
-
answer: unconversed('
|
|
20
|
-
interrupt: unconversed('
|
|
21
|
-
kill: unconversed('
|
|
22
|
-
|
|
23
|
-
delete: unconversed('conversation.delete'),
|
|
17
|
+
create: unconversed('conversations/create'),
|
|
18
|
+
send: unconversed('conversations/send'),
|
|
19
|
+
answer: unconversed('conversations/interaction/answer'),
|
|
20
|
+
interrupt: unconversed('conversations/interrupt'),
|
|
21
|
+
kill: unconversed('conversations/kill'),
|
|
22
|
+
delete: unconversed('conversations/delete'),
|
|
24
23
|
};
|
|
25
24
|
const NO_CHAT_DRAFT = {
|
|
26
25
|
write: () => Promise.resolve(),
|
|
26
|
+
prepend: () => Promise.resolve(),
|
|
27
27
|
discard: () => Promise.resolve(),
|
|
28
28
|
};
|
|
29
|
+
function areasOf(reach) {
|
|
30
|
+
return reach.areas ?? [];
|
|
31
|
+
}
|
|
32
|
+
function fenced(reach, room, path) {
|
|
33
|
+
return areasOf(reach).some((area) => area.room === room &&
|
|
34
|
+
beneath(area.path, path) &&
|
|
35
|
+
!area.open.some((open) => beneath(open, path)));
|
|
36
|
+
}
|
|
29
37
|
export function holds(reach, room) {
|
|
30
38
|
return (reach === null ||
|
|
31
39
|
reach.rooms.includes(room) ||
|
|
@@ -38,34 +46,21 @@ export function governs(reach, room) {
|
|
|
38
46
|
if (wholly(reach, room.locator)) {
|
|
39
47
|
return { collection: true, selection: room.typedSelection !== null };
|
|
40
48
|
}
|
|
41
|
-
const
|
|
49
|
+
const within = (path) => selected({ selection: room.typedSelection }, path);
|
|
42
50
|
const paths = reach.documents
|
|
43
51
|
.filter((document) => document.room === room.locator)
|
|
44
52
|
.map(({ path }) => path);
|
|
45
|
-
return { collection: paths.some((path) => !
|
|
53
|
+
return { collection: paths.some((path) => !within(path)), selection: paths.some(within) };
|
|
46
54
|
}
|
|
47
55
|
function covers(reach, room, path) {
|
|
48
56
|
return (reach === null ||
|
|
49
|
-
reach
|
|
50
|
-
|
|
57
|
+
(!fenced(reach, room, path) &&
|
|
58
|
+
(reach.rooms.includes(room) ||
|
|
59
|
+
reach.documents.some((document) => document.room === room && document.path === path))));
|
|
51
60
|
}
|
|
52
61
|
function conversing(reach) {
|
|
53
62
|
return reach === null || reach.conversations;
|
|
54
63
|
}
|
|
55
|
-
function refers(reach, scope) {
|
|
56
|
-
if (reach === null)
|
|
57
|
-
return true;
|
|
58
|
-
if (scope === null)
|
|
59
|
-
return false;
|
|
60
|
-
if (scope.kind === 'conversations')
|
|
61
|
-
return reach.conversations;
|
|
62
|
-
return scope.path === undefined
|
|
63
|
-
? wholly(reach, scope.locator)
|
|
64
|
-
: covers(reach, scope.locator, scope.path);
|
|
65
|
-
}
|
|
66
|
-
function unreachedReference(fileRef) {
|
|
67
|
-
return { kind: 'absent', code: 'binary-file-absent', fields: { fileRef }, retryable: false };
|
|
68
|
-
}
|
|
69
64
|
export function planReach(reach) {
|
|
70
65
|
return reach === null
|
|
71
66
|
? null
|
|
@@ -74,6 +69,9 @@ export function planReach(reach) {
|
|
|
74
69
|
documents: [
|
|
75
70
|
...new Set(reach.documents.map(({ room, path }) => documentKey(room, path))),
|
|
76
71
|
].sort(),
|
|
72
|
+
areas: areasOf(reach)
|
|
73
|
+
.map(({ room, path, open }) => ({ room, path, open: [...new Set(open)].sort() }))
|
|
74
|
+
.sort((left, right) => documentKey(left.room, left.path) < documentKey(right.room, right.path) ? -1 : 1),
|
|
77
75
|
};
|
|
78
76
|
}
|
|
79
77
|
function roomsWithin(reach, rooms) {
|
|
@@ -89,7 +87,7 @@ function typesWithin(reach, room, types) {
|
|
|
89
87
|
};
|
|
90
88
|
}
|
|
91
89
|
function moves(reach, room, move) {
|
|
92
|
-
return move === undefined || covers(reach, room, moveTarget(move));
|
|
90
|
+
return move === undefined || covers(reach, move.room ?? room, moveTarget(move));
|
|
93
91
|
}
|
|
94
92
|
function draftWithin(reach, draft) {
|
|
95
93
|
return covers(reach, draft.room, draft.path) && moves(reach, draft.room, draft.parts.move);
|
|
@@ -123,80 +121,188 @@ function statusWithin(reach, status) {
|
|
|
123
121
|
return {
|
|
124
122
|
...status,
|
|
125
123
|
attentionRequired: status.attentionRequired.filter((entry) => covers(reach, entry.room, entry.path)),
|
|
124
|
+
unsent: status.unsent.filter((change) => covers(reach, change.room, change.path)),
|
|
126
125
|
};
|
|
127
126
|
}
|
|
128
127
|
function queueWithin(reach, room, entries) {
|
|
129
|
-
return entries
|
|
130
|
-
(
|
|
128
|
+
return entries
|
|
129
|
+
.filter(({ batch }) => batch.changes.every((change) => covers(reach, room, change.path) &&
|
|
130
|
+
(change.kind !== 'move' || covers(reach, room, change.to))))
|
|
131
|
+
.map((entry) => {
|
|
132
|
+
const { between, ...batch } = entry.batch;
|
|
133
|
+
if (between === undefined)
|
|
134
|
+
return entry;
|
|
135
|
+
return wholly(reach, between.source.room) && wholly(reach, between.destination.room)
|
|
136
|
+
? entry
|
|
137
|
+
: { ...entry, batch };
|
|
138
|
+
});
|
|
131
139
|
}
|
|
132
140
|
function unreached(room) {
|
|
133
|
-
return runtimeError('room
|
|
141
|
+
return runtimeError('unknown-room', `Unknown Room ${room}`);
|
|
134
142
|
}
|
|
135
|
-
|
|
143
|
+
function lockedError(room) {
|
|
144
|
+
return runtimeError(ROOM_LOCKED, `${room} is locked until House confirms its access`, true);
|
|
145
|
+
}
|
|
146
|
+
function deviceUnreached() {
|
|
147
|
+
return runtimeError('device-unreached', 'Only the panel reaches this device');
|
|
148
|
+
}
|
|
149
|
+
const ATTACH_REQUIRED = 'attach-required';
|
|
150
|
+
function attachRequired() {
|
|
151
|
+
return runtimeError(ATTACH_REQUIRED, 'App code takes a file in with binaryFile.attach');
|
|
152
|
+
}
|
|
153
|
+
function carriesFile(parts) {
|
|
154
|
+
return parts !== null && typeof parts === 'object' && Object.hasOwn(parts, 'file');
|
|
155
|
+
}
|
|
156
|
+
export function narrowed(runtime, given, port) {
|
|
136
157
|
const { md, watch } = runtime;
|
|
137
158
|
let reach = given;
|
|
138
159
|
const open = new Set();
|
|
139
|
-
function following(begin) {
|
|
160
|
+
function following(begin, locking = false) {
|
|
140
161
|
let stop = begin();
|
|
141
162
|
const restart = () => {
|
|
142
163
|
stop();
|
|
143
164
|
stop = begin();
|
|
144
165
|
};
|
|
145
166
|
open.add(restart);
|
|
167
|
+
const unwatch = locking ? runtime.watchLocks(restart) : () => { };
|
|
146
168
|
return () => {
|
|
147
169
|
open.delete(restart);
|
|
170
|
+
unwatch();
|
|
171
|
+
stop();
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const unlocking = (rooms, locked) => {
|
|
175
|
+
const held = (rooms ?? []).filter((room) => locked.includes(room));
|
|
176
|
+
return held.length === 0 ? null : { pending: held.map((room) => ({ room, awaits: 'unlock' })) };
|
|
177
|
+
};
|
|
178
|
+
const unlocked = (entries, locked) => entries.filter((entry) => !locked.includes(entry.room));
|
|
179
|
+
const intoLocked = async (held) => {
|
|
180
|
+
for (const move of held) {
|
|
181
|
+
if (move?.room !== undefined && (await runtime.locked(move.room)))
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
};
|
|
186
|
+
function ordered(deliver) {
|
|
187
|
+
let open = true;
|
|
188
|
+
let shown = Promise.resolve();
|
|
189
|
+
return {
|
|
190
|
+
push(making) {
|
|
191
|
+
shown = shown.then(() => making.then((value) => {
|
|
192
|
+
if (open)
|
|
193
|
+
deliver(value);
|
|
194
|
+
}, uncaught), uncaught);
|
|
195
|
+
},
|
|
196
|
+
stop() {
|
|
197
|
+
open = false;
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function unlockedWatch(topic, input, deliver, fail, within) {
|
|
202
|
+
const shown = ordered(deliver);
|
|
203
|
+
const stop = watch(topic, input, (message) => {
|
|
204
|
+
shown.push(runtime.lockedRooms().then((locked) => within(message, locked)));
|
|
205
|
+
}, fail);
|
|
206
|
+
return () => {
|
|
207
|
+
shown.stop();
|
|
148
208
|
stop();
|
|
149
209
|
};
|
|
150
210
|
}
|
|
151
|
-
|
|
211
|
+
function lockedFirst(room, start, shut) {
|
|
212
|
+
let open = true;
|
|
213
|
+
let stop = () => { };
|
|
214
|
+
void (async () => {
|
|
215
|
+
const closed = !holds(reach, room) || (await runtime.locked(room));
|
|
216
|
+
if (!open)
|
|
217
|
+
return;
|
|
218
|
+
if (closed)
|
|
219
|
+
shut();
|
|
220
|
+
else
|
|
221
|
+
stop = start();
|
|
222
|
+
})();
|
|
223
|
+
return () => {
|
|
224
|
+
open = false;
|
|
225
|
+
stop();
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const within = (topic, input, deliver, fail) => {
|
|
229
|
+
if (topic === 'read' && reach !== null) {
|
|
230
|
+
fail(deviceUnreached());
|
|
231
|
+
return () => { };
|
|
232
|
+
}
|
|
152
233
|
if (topic === 'rooms') {
|
|
153
|
-
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms))));
|
|
234
|
+
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms)), fail));
|
|
235
|
+
}
|
|
236
|
+
if (topic === 'readiness') {
|
|
237
|
+
return following(() => runtime.watchReadiness(port, reach, deliver));
|
|
154
238
|
}
|
|
155
239
|
if (topic === 'sync-status') {
|
|
156
|
-
return following(() =>
|
|
240
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (status, locked) => {
|
|
241
|
+
const shown = statusWithin(reach, status);
|
|
242
|
+
return { ...shown, attentionRequired: unlocked(shown.attentionRequired, locked) };
|
|
243
|
+
}), true);
|
|
157
244
|
}
|
|
158
245
|
if (topic === 'room-drafts') {
|
|
159
|
-
return following(() =>
|
|
246
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (drafts, locked) => unlocked(draftsWithin(reach, drafts), locked)), true);
|
|
160
247
|
}
|
|
161
248
|
if (topic === 'queue') {
|
|
162
249
|
const room = input[0];
|
|
163
|
-
return following(() =>
|
|
164
|
-
if (!holds(reach, room)) {
|
|
165
|
-
deliver([]);
|
|
166
|
-
return () => { };
|
|
167
|
-
}
|
|
168
|
-
return watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)));
|
|
169
|
-
});
|
|
250
|
+
return following(() => lockedFirst(room, () => watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)), fail), () => deliver([])), true);
|
|
170
251
|
}
|
|
171
252
|
if (topic === 'query') {
|
|
172
|
-
const
|
|
253
|
+
const planning = runtime.plan(input[0], reach);
|
|
173
254
|
let held = null;
|
|
174
255
|
return following(() => {
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
256
|
+
let open = true;
|
|
257
|
+
let stop = () => { };
|
|
258
|
+
void (async () => {
|
|
259
|
+
const plan = await planning;
|
|
260
|
+
const locked = await runtime.lockedRooms();
|
|
261
|
+
if (!open)
|
|
180
262
|
return;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
held
|
|
185
|
-
|
|
263
|
+
const pending = unlocking(plan.rooms, locked);
|
|
264
|
+
if (pending !== null) {
|
|
265
|
+
const answer = { result: pending, keys: [] };
|
|
266
|
+
if (held === null || changeOf(held, answer) !== null)
|
|
267
|
+
deliver(answer);
|
|
268
|
+
held = digestOf(answer);
|
|
186
269
|
return;
|
|
187
270
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
271
|
+
let first = true;
|
|
272
|
+
const heard = (message) => {
|
|
273
|
+
if (!first) {
|
|
274
|
+
held = digestApplied(held, message);
|
|
275
|
+
deliver(message);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
first = false;
|
|
279
|
+
const change = held === null ? message : changeOf(held, message);
|
|
280
|
+
held = digestOf(message);
|
|
281
|
+
if (change !== null)
|
|
282
|
+
deliver(change);
|
|
283
|
+
};
|
|
284
|
+
const current = { ...plan, reach: planReach(reach), locked };
|
|
285
|
+
stop = runtime.watchPlan(current, (message) => {
|
|
286
|
+
if (open)
|
|
287
|
+
heard(message);
|
|
288
|
+
}, (error) => {
|
|
289
|
+
if (open)
|
|
290
|
+
fail(error);
|
|
291
|
+
});
|
|
292
|
+
})().catch((error) => {
|
|
293
|
+
if (open)
|
|
294
|
+
fail(error);
|
|
193
295
|
});
|
|
194
|
-
|
|
296
|
+
return () => {
|
|
297
|
+
open = false;
|
|
298
|
+
stop();
|
|
299
|
+
};
|
|
300
|
+
}, true);
|
|
195
301
|
}
|
|
196
302
|
if (topic === 'conversation') {
|
|
197
303
|
return following(() => {
|
|
198
304
|
if (conversing(reach))
|
|
199
|
-
return watch(topic, input, deliver);
|
|
305
|
+
return watch(topic, input, deliver, fail);
|
|
200
306
|
deliver(unheldView(input[0]));
|
|
201
307
|
return () => { };
|
|
202
308
|
});
|
|
@@ -204,64 +310,159 @@ export function narrowed(runtime, given) {
|
|
|
204
310
|
if (topic === 'conversations' || topic === 'agents') {
|
|
205
311
|
return following(() => {
|
|
206
312
|
if (conversing(reach))
|
|
207
|
-
return watch(topic, input, deliver);
|
|
313
|
+
return watch(topic, input, deliver, fail);
|
|
208
314
|
deliver([]);
|
|
209
315
|
return () => { };
|
|
210
316
|
});
|
|
211
317
|
}
|
|
212
|
-
|
|
318
|
+
if (topic === 'figures' || topic === 'holdings') {
|
|
319
|
+
if (reach === null)
|
|
320
|
+
return watch(topic, input, deliver, fail);
|
|
321
|
+
fail(deviceUnreached());
|
|
322
|
+
return () => { };
|
|
323
|
+
}
|
|
324
|
+
return watch(topic, input, deliver, fail);
|
|
213
325
|
};
|
|
326
|
+
const files = new Map();
|
|
327
|
+
let handed = 0;
|
|
328
|
+
async function hand(reading) {
|
|
329
|
+
const answer = await reading;
|
|
330
|
+
if (answer.kind !== 'binary')
|
|
331
|
+
return answer;
|
|
332
|
+
handed += 1;
|
|
333
|
+
const file = String(handed);
|
|
334
|
+
files.set(file, answer.file);
|
|
335
|
+
return { ...answer, file };
|
|
336
|
+
}
|
|
214
337
|
const conversation = () => (conversing(reach) ? md.conversation : NO_CONVERSATION);
|
|
215
338
|
const chatDraft = () => (conversing(reach) ? md.chatDraft : NO_CHAT_DRAFT);
|
|
216
339
|
const view = {
|
|
217
340
|
...md,
|
|
218
|
-
rooms: () => roomsWithin(reach,
|
|
219
|
-
query: ((input) =>
|
|
341
|
+
rooms: () => md.rooms().then((rooms) => roomsWithin(reach, rooms)),
|
|
342
|
+
query: (async (input) => {
|
|
343
|
+
const plan = await runtime.plan(input, reach);
|
|
344
|
+
const locked = await runtime.lockedRooms();
|
|
345
|
+
return unlocking(plan.rooms, locked) ?? runtime.query({ ...plan, locked });
|
|
346
|
+
}),
|
|
220
347
|
search: (input) => runtime.search(input, reach),
|
|
221
|
-
types(room) {
|
|
348
|
+
async types(room) {
|
|
349
|
+
if (holds(reach, room) && (await runtime.locked(room)))
|
|
350
|
+
throw lockedError(room);
|
|
222
351
|
if (wholly(reach, room))
|
|
223
352
|
return md.types(room);
|
|
224
353
|
if (!holds(reach, room))
|
|
225
354
|
return structuredClone(UNHELD_TYPES);
|
|
226
|
-
|
|
227
|
-
return typesWithin(reach, listed, md.types(room));
|
|
355
|
+
return typesWithin(reach, await runtime.room(room), await md.types(room));
|
|
228
356
|
},
|
|
229
357
|
async save(room, roomDrafts, writtenBy) {
|
|
230
358
|
if (!holds(reach, room))
|
|
231
359
|
throw unreached(room);
|
|
232
|
-
|
|
233
|
-
|
|
360
|
+
if (await runtime.locked(room)) {
|
|
361
|
+
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
362
|
+
}
|
|
363
|
+
const held = (await Promise.all(roomDrafts.map(({ path }) => md.roomDraft.read(room, path)))).map((draft) => draft?.parts.move);
|
|
364
|
+
const outside = roomDrafts.find(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]));
|
|
234
365
|
if (outside !== undefined) {
|
|
235
366
|
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
236
367
|
}
|
|
368
|
+
if (await intoLocked(held))
|
|
369
|
+
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
237
370
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
238
371
|
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
372
|
+
async saveParts(room, parts, writtenBy) {
|
|
373
|
+
if (!holds(reach, room))
|
|
374
|
+
throw unreached(room);
|
|
375
|
+
const filed = reach === null ? undefined : parts.find(({ parts: one }) => carriesFile(one));
|
|
376
|
+
if (filed !== undefined) {
|
|
377
|
+
return { outcome: 'refused', code: ATTACH_REQUIRED, retryable: false, file: filed.path };
|
|
378
|
+
}
|
|
379
|
+
if (await runtime.locked(room)) {
|
|
380
|
+
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
381
|
+
}
|
|
382
|
+
const held = parts.map(({ path, parts: one }) => readParts(one, path).move);
|
|
383
|
+
if (parts.some(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]))) {
|
|
384
|
+
throw unreached(room);
|
|
385
|
+
}
|
|
386
|
+
if (await intoLocked(held))
|
|
387
|
+
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
388
|
+
return savedWithin(reach, room, await md.saveParts(room, parts, writtenBy));
|
|
389
|
+
},
|
|
390
|
+
async resolve(room, path, destination) {
|
|
391
|
+
const at = await runtime.located(room, path, destination);
|
|
392
|
+
return at !== null && !covers(reach, at.room, at.path)
|
|
393
|
+
? UNREADABLE
|
|
394
|
+
: md.resolve(room, path, destination);
|
|
395
|
+
},
|
|
396
|
+
history: async (room, path, query) => !covers(reach, room, path)
|
|
397
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
398
|
+
: (await runtime.locked(room))
|
|
399
|
+
? lockedRoom(room)
|
|
400
|
+
: md.history(room, path, query),
|
|
242
401
|
binaryFile: {
|
|
243
|
-
read: (room, path, revision) => covers(reach, room, path)
|
|
244
|
-
?
|
|
245
|
-
:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
402
|
+
read: async (room, path, revision) => !covers(reach, room, path)
|
|
403
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
404
|
+
: (await runtime.locked(room))
|
|
405
|
+
? lockedRoom(room)
|
|
406
|
+
: hand(md.binaryFile.read(room, path, revision)),
|
|
407
|
+
link: async (room, path, revision) => !covers(reach, room, path)
|
|
408
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
409
|
+
: (await runtime.locked(room))
|
|
410
|
+
? lockedRoom(room)
|
|
411
|
+
: md.binaryFile.link(room, path, revision),
|
|
412
|
+
show: async (room, path, revision) => !covers(reach, room, path)
|
|
413
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
414
|
+
: (await runtime.locked(room))
|
|
415
|
+
? lockedRoom(room)
|
|
416
|
+
: hand(md.binaryFile.show(room, path, revision)),
|
|
417
|
+
attach: async (room, file) => !wholly(reach, room)
|
|
418
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
419
|
+
: (await runtime.locked(room))
|
|
420
|
+
? lockedRoom(room)
|
|
421
|
+
: md.binaryFile.attach(room, file),
|
|
422
|
+
async part(file, part) {
|
|
423
|
+
const key = files.get(file);
|
|
424
|
+
if (key === undefined)
|
|
425
|
+
return null;
|
|
426
|
+
const bytes = await md.binaryFile.part(key, part);
|
|
427
|
+
if (bytes === null)
|
|
428
|
+
files.delete(file);
|
|
429
|
+
return bytes;
|
|
430
|
+
},
|
|
249
431
|
},
|
|
250
|
-
reached: (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
251
|
-
|
|
432
|
+
reached: async (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
433
|
+
!(await runtime.locked(room)) &&
|
|
434
|
+
(await md.reached(room, roomVersion, path)),
|
|
252
435
|
log: () => (reach === null ? md.log() : ''),
|
|
436
|
+
cleanUp: () => (reach === null ? md.cleanUp() : Promise.reject(deviceUnreached())),
|
|
437
|
+
unsent: () => (reach === null ? md.unsent() : Promise.reject(deviceUnreached())),
|
|
438
|
+
reset: () => (reach === null ? md.reset() : Promise.reject(deviceUnreached())),
|
|
439
|
+
readAgain: () => (reach === null ? md.readAgain() : Promise.reject(deviceUnreached())),
|
|
253
440
|
roomDraft: {
|
|
254
|
-
list: () => md.roomDraft.list()
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
441
|
+
list: async () => unlocked(draftsWithin(reach, await md.roomDraft.list()), await runtime.lockedRooms()),
|
|
442
|
+
async read(room, path) {
|
|
443
|
+
if (!covers(reach, room, path))
|
|
444
|
+
return null;
|
|
445
|
+
if (await runtime.locked(room))
|
|
446
|
+
throw lockedError(room);
|
|
447
|
+
return shownDraft(reach, await md.roomDraft.read(room, path));
|
|
448
|
+
},
|
|
449
|
+
async write(room, path, revision, parts, next) {
|
|
450
|
+
if (reach !== null && carriesFile(parts))
|
|
451
|
+
throw attachRequired();
|
|
452
|
+
const move = readParts(parts, path).move;
|
|
453
|
+
if (!covers(reach, room, path) || !moves(reach, room, move))
|
|
258
454
|
throw unreached(room);
|
|
259
|
-
|
|
260
|
-
|
|
455
|
+
if (await runtime.locked(room))
|
|
456
|
+
throw lockedError(room);
|
|
457
|
+
if (await intoLocked([move]))
|
|
458
|
+
throw lockedError(move.room);
|
|
459
|
+
return writeWithin(reach, await md.roomDraft.write(room, path, revision, parts, next));
|
|
261
460
|
},
|
|
262
461
|
async discard(room, path, revision) {
|
|
263
462
|
if (!covers(reach, room, path))
|
|
264
463
|
return staleWrite(null);
|
|
464
|
+
if (await runtime.locked(room))
|
|
465
|
+
throw lockedError(room);
|
|
265
466
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
266
467
|
},
|
|
267
468
|
},
|
|
@@ -273,11 +474,11 @@ export function narrowed(runtime, given) {
|
|
|
273
474
|
answer: (id, answer) => conversation().answer(id, answer),
|
|
274
475
|
interrupt: (id) => conversation().interrupt(id),
|
|
275
476
|
kill: (id) => conversation().kill(id),
|
|
276
|
-
cancel: (id, turn) => conversation().cancel(id, turn),
|
|
277
477
|
delete: (id) => conversation().delete(id),
|
|
278
478
|
},
|
|
279
479
|
chatDraft: {
|
|
280
480
|
write: (id, draft, revision) => chatDraft().write(id, draft, revision),
|
|
481
|
+
prepend: (id, draft) => chatDraft().prepend(id, draft),
|
|
281
482
|
discard: (id) => chatDraft().discard(id),
|
|
282
483
|
},
|
|
283
484
|
observe: observing(within),
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import type { AppRoom
|
|
3
|
+
import type { AppRoom } from './listing.js';
|
|
4
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
5
|
+
import type { SavedRoomDraft, SaveResult } from './saves.js';
|
|
3
6
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
7
|
import type { ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
5
8
|
import { type RuntimeError } from './failure.js';
|
|
9
|
+
import type { FiguresResult } from './figures.js';
|
|
10
|
+
import type { Holdings } from './holdings.js';
|
|
11
|
+
import type { Expecting } from './expectation.js';
|
|
6
12
|
import type { QueueEntry } from './outcome.js';
|
|
7
|
-
import type {
|
|
13
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
14
|
+
import type { Readiness } from './readiness.js';
|
|
8
15
|
import type { RoomDraft, RoomDraftParts } from './room-draft.js';
|
|
9
16
|
import type { SyncStatus } from './status.js';
|
|
10
17
|
type Client = MdRuntimeClient | null;
|
|
@@ -16,26 +23,33 @@ export type Observed<T> = {
|
|
|
16
23
|
};
|
|
17
24
|
export declare function useObserve(client: Client, topic: 'deployment-facts'): Observed<unknown>;
|
|
18
25
|
export declare function useObserve(client: Client, topic: 'rooms'): Observed<readonly AppRoom[]>;
|
|
26
|
+
export declare function useObserve(client: Client, topic: 'readiness'): Observed<Readiness>;
|
|
19
27
|
export declare function useObserve(client: Client, topic: 'connection-refusal'): Observed<ConnectionRefusal | null>;
|
|
20
28
|
export declare function useObserve(client: Client, topic: 'storage-loss'): Observed<string | null>;
|
|
21
29
|
export declare function useObserve(client: Client, topic: 'sync-status'): Observed<SyncStatus>;
|
|
22
30
|
export declare function useObserve(client: Client, topic: 'service-mode'): Observed<ServiceMode>;
|
|
23
31
|
export declare function useObserve(client: Client, topic: 'member'): Observed<Member | null>;
|
|
24
|
-
export declare function useObserve(client: Client, topic: '
|
|
25
|
-
export declare function useObserve(client: Client, topic: 'query', query:
|
|
32
|
+
export declare function useObserve(client: Client, topic: 'authority-changes'): Observed<number>;
|
|
33
|
+
export declare function useObserve(client: Client, topic: 'query', query: DocumentQuery): Observed<DocumentResult | PendingResult>;
|
|
34
|
+
export declare function useObserve(client: Client, topic: 'query', query: GroupQuery): Observed<GroupResult | PendingResult>;
|
|
26
35
|
export declare function useObserve(client: Client, topic: 'queue', locator: string): Observed<readonly QueueEntry[]>;
|
|
27
36
|
export declare function useObserve(client: Client, topic: 'room-drafts'): Observed<readonly RoomDraft[]>;
|
|
28
37
|
export declare function useObserve(client: Client, topic: 'presentation'): Observed<unknown>;
|
|
29
38
|
export declare function useObserve(client: Client, topic: 'conversation', conversation: string, options: ConversationOptions): Observed<ConversationView>;
|
|
30
39
|
export declare function useObserve(client: Client, topic: 'conversations'): Observed<readonly ConversationEntry[]>;
|
|
31
40
|
export declare function useObserve(client: Client, topic: 'agents'): Observed<readonly ConversationAgent[]>;
|
|
41
|
+
export declare function useObserve(client: Client, topic: 'figures'): Observed<FiguresResult>;
|
|
42
|
+
export declare function useObserve(client: Client, topic: 'holdings'): Observed<Holdings>;
|
|
43
|
+
export declare function useReading<E extends {
|
|
44
|
+
readonly key: string;
|
|
45
|
+
}>(store: Pick<Expecting<E>, 'reads' | 'heard' | 'left'>, asks: (one: E) => boolean, shown: ((one: E) => boolean) | null): void;
|
|
32
46
|
export type Saving = {
|
|
33
47
|
readonly busy: boolean;
|
|
34
48
|
readonly outcome: SaveResult | null;
|
|
35
49
|
readonly failure: RuntimeError | null;
|
|
36
|
-
save(room: string,
|
|
50
|
+
save(room: string, parts: ReadonlyMap<string, RoomDraftParts>): Promise<SaveResult>;
|
|
51
|
+
saveWritten(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;
|
|
37
52
|
};
|
|
38
|
-
export declare function saveRoomDrafts(client: MdRuntimeClient, room: string, roomDrafts: ReadonlyMap<string, RoomDraftParts>): Promise<SaveResult>;
|
|
39
53
|
export declare function useSave(client: MdRuntimeClient): Saving;
|
|
40
54
|
export {};
|
|
41
55
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC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