@agentshouse/mdruntime 0.1.0-cae97ad2e9142 → 0.1.0-caf080a9a9c60
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 +14 -14
- package/dist/acceptance.d.ts +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +318 -0
- package/dist/act-lanes.d.ts +29 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +177 -0
- package/dist/actions.d.ts +25 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +261 -0
- package/dist/adapter.d.ts +126 -107
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +29 -47
- package/dist/bootstrap.d.ts +17 -19
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +266 -135
- 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 +2 -1
- package/dist/chain.d.ts.map +1 -1
- 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 +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +4 -2
- 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 +28 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +84 -20
- package/dist/collection.d.ts +28 -7
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +35 -19
- package/dist/compile.d.ts +8 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +289 -332
- package/dist/connection.d.ts +6 -141
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +111 -5012
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-live.d.ts +138 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +249 -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 +59 -50
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +938 -832
- 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 +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +153 -0
- package/dist/durability.d.ts +18 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +19 -9
- 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 +6 -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 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- 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 -8
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +70 -40
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +33 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/install.d.ts +54 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +539 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +279 -0
- package/dist/listing.d.ts +48 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +139 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +64 -23
- package/dist/locks.d.ts +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +33 -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 +50 -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 +15 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +251 -98
- package/dist/messages.d.ts +24 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +92 -32
- package/dist/model.d.ts +8 -11
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +5 -22
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +156 -0
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +15 -15
- 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 +59 -0
- package/dist/outcome.d.ts +20 -6
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +34 -2
- package/dist/overlay.d.ts +6 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +47 -21
- 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 +3 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +10 -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/presence.d.ts +52 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +220 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +285 -0
- package/dist/query.d.ts +14 -210
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +29 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +115 -0
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +465 -0
- package/dist/reach.d.ts +15 -12
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +228 -145
- package/dist/react.d.ts +15 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +3 -18
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/reads.d.ts +38 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +163 -85
- package/dist/recovery.d.ts +3 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +57 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +35 -7
- 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 +13 -19
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +66 -35
- 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 +24 -10
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +142 -106
- 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 +16 -21
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +46 -174
- 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 -84
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +349 -170
- package/dist/saves.d.ts +32 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +413 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/seed.d.ts +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -1
- package/dist/shared.d.ts +1 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -105
- package/dist/shown.d.ts +32 -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 +21 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +80 -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/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 +68 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +171 -0
- package/dist/source.d.ts +54 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +82 -0
- package/dist/status.d.ts +4 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- 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 +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +430 -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 +110 -158
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +167 -403
- package/dist/stored.d.ts +65 -59
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +356 -271
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +223 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +540 -0
- package/dist/tables.d.ts +127 -69
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +218 -105
- 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/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +42 -100
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +63 -11
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +21 -5
- 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/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -368
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -150
package/dist/reach.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { selected } from './collection.js';
|
|
1
2
|
import { unheldView } from './conversation.js';
|
|
2
3
|
import { modelTypes, NO_MODEL } from './model.js';
|
|
3
4
|
import { changeOf, digestApplied, digestOf, observing, } from './observation.js';
|
|
4
|
-
import { runtimeError } from './failure.js';
|
|
5
|
+
import { runtimeError, uncaught } from './failure.js';
|
|
5
6
|
import { failure, lockedRoom, ROOM_LOCKED, undeclared, UNREADABLE, } from './outcome.js';
|
|
6
7
|
import { beneath } from './paths.js';
|
|
7
8
|
import { moveTarget, readParts, staleWrite, } from './room-draft.js';
|
|
8
9
|
import { documentKey } from './rows.js';
|
|
9
|
-
import { undeclaredSearch } from './search.js';
|
|
10
10
|
const UNHELD_TYPES = { collection: modelTypes(NO_MODEL), typedSelection: null };
|
|
11
11
|
function unconversed(name) {
|
|
12
12
|
return () => Promise.resolve(undeclared(name));
|
|
@@ -14,14 +14,21 @@ 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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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'),
|
|
23
|
+
takeOut: unconversed('conversations/take-out'),
|
|
24
|
+
decide: unconversed('agent-functions/decide'),
|
|
25
|
+
rename: unconversed('conversations/rename'),
|
|
26
|
+
option: unconversed('conversations/option/set'),
|
|
27
|
+
retry: unconversed('conversations/retry'),
|
|
28
|
+
pins: () => Promise.resolve([]),
|
|
29
|
+
pin: () => Promise.resolve(),
|
|
30
|
+
openedTurns: () => Promise.resolve({}),
|
|
31
|
+
openTurn: () => Promise.resolve(),
|
|
25
32
|
};
|
|
26
33
|
const NO_CHAT_DRAFT = {
|
|
27
34
|
write: () => Promise.resolve(),
|
|
@@ -31,17 +38,15 @@ const NO_CHAT_DRAFT = {
|
|
|
31
38
|
function areasOf(reach) {
|
|
32
39
|
return reach.areas ?? [];
|
|
33
40
|
}
|
|
34
|
-
function typedAreas(reach, room) {
|
|
35
|
-
return areasOf(reach).filter((area) => area.room === room && area.types.length > 0);
|
|
36
|
-
}
|
|
37
41
|
function fenced(reach, room, path) {
|
|
38
|
-
return areasOf(reach).some((area) => area.room === room &&
|
|
42
|
+
return areasOf(reach).some((area) => area.room === room &&
|
|
43
|
+
beneath(area.path, path) &&
|
|
44
|
+
!area.open.some((open) => beneath(open, path)));
|
|
39
45
|
}
|
|
40
46
|
export function holds(reach, room) {
|
|
41
47
|
return (reach === null ||
|
|
42
48
|
reach.rooms.includes(room) ||
|
|
43
|
-
reach.documents.some((document) => document.room === room)
|
|
44
|
-
typedAreas(reach, room).length > 0);
|
|
49
|
+
reach.documents.some((document) => document.room === room));
|
|
45
50
|
}
|
|
46
51
|
function wholly(reach, room) {
|
|
47
52
|
return reach === null || reach.rooms.includes(room);
|
|
@@ -50,14 +55,11 @@ export function governs(reach, room) {
|
|
|
50
55
|
if (wholly(reach, room.locator)) {
|
|
51
56
|
return { collection: true, selection: room.typedSelection !== null };
|
|
52
57
|
}
|
|
53
|
-
const
|
|
54
|
-
const paths =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...typedAreas(reach, room.locator).map(({ path }) => path),
|
|
59
|
-
];
|
|
60
|
-
return { collection: paths.some((path) => !selected(path)), selection: paths.some(selected) };
|
|
58
|
+
const within = (path) => selected({ selection: room.typedSelection }, path);
|
|
59
|
+
const paths = reach.documents
|
|
60
|
+
.filter((document) => document.room === room.locator)
|
|
61
|
+
.map(({ path }) => path);
|
|
62
|
+
return { collection: paths.some((path) => !within(path)), selection: paths.some(within) };
|
|
61
63
|
}
|
|
62
64
|
function covers(reach, room, path) {
|
|
63
65
|
return (reach === null ||
|
|
@@ -77,7 +79,7 @@ export function planReach(reach) {
|
|
|
77
79
|
...new Set(reach.documents.map(({ room, path }) => documentKey(room, path))),
|
|
78
80
|
].sort(),
|
|
79
81
|
areas: areasOf(reach)
|
|
80
|
-
.map(({ room, path,
|
|
82
|
+
.map(({ room, path, open }) => ({ room, path, open: [...new Set(open)].sort() }))
|
|
81
83
|
.sort((left, right) => documentKey(left.room, left.path) < documentKey(right.room, right.path) ? -1 : 1),
|
|
82
84
|
};
|
|
83
85
|
}
|
|
@@ -113,12 +115,13 @@ function writeWithin(reach, write) {
|
|
|
113
115
|
function savedWithin(reach, room, result) {
|
|
114
116
|
if (reach === null || result.outcome === 'saved')
|
|
115
117
|
return result;
|
|
116
|
-
const { file, location, referrers, ...refusal } = result;
|
|
118
|
+
const { file, location, line, referrers, ...refusal } = result;
|
|
117
119
|
const hidden = file !== undefined && !covers(reach, room, file);
|
|
118
120
|
return {
|
|
119
121
|
...refusal,
|
|
120
122
|
...(file === undefined || hidden ? {} : { file }),
|
|
121
123
|
...(location === undefined || hidden ? {} : { location }),
|
|
124
|
+
...(line === undefined || hidden ? {} : { line }),
|
|
122
125
|
...(referrers === undefined
|
|
123
126
|
? {}
|
|
124
127
|
: { referrers: referrers.filter((path) => covers(reach, room, path)) }),
|
|
@@ -127,7 +130,8 @@ function savedWithin(reach, room, result) {
|
|
|
127
130
|
function statusWithin(reach, status) {
|
|
128
131
|
return {
|
|
129
132
|
...status,
|
|
130
|
-
attentionRequired: status.attentionRequired.filter((entry) =>
|
|
133
|
+
attentionRequired: status.attentionRequired.filter((entry) => covers(reach, entry.room, entry.path)),
|
|
134
|
+
unsent: status.unsent.filter((change) => covers(reach, change.room, change.path)),
|
|
131
135
|
};
|
|
132
136
|
}
|
|
133
137
|
function queueWithin(reach, room, entries) {
|
|
@@ -144,18 +148,24 @@ function queueWithin(reach, room, entries) {
|
|
|
144
148
|
});
|
|
145
149
|
}
|
|
146
150
|
function unreached(room) {
|
|
147
|
-
return runtimeError('room
|
|
151
|
+
return runtimeError('unknown-room', `Unknown Room ${room}`);
|
|
148
152
|
}
|
|
149
153
|
function lockedError(room) {
|
|
150
154
|
return runtimeError(ROOM_LOCKED, `${room} is locked until House confirms its access`, true);
|
|
151
155
|
}
|
|
152
156
|
function deviceUnreached() {
|
|
153
|
-
return runtimeError('device-unreached', 'Only the panel
|
|
157
|
+
return runtimeError('device-unreached', 'Only the panel reaches this device');
|
|
158
|
+
}
|
|
159
|
+
const ATTACH_REQUIRED = 'attach-required';
|
|
160
|
+
function attachRequired() {
|
|
161
|
+
return runtimeError(ATTACH_REQUIRED, 'App code takes a file in with binaryFile.attach');
|
|
162
|
+
}
|
|
163
|
+
function carriesFile(parts) {
|
|
164
|
+
return parts !== null && typeof parts === 'object' && Object.hasOwn(parts, 'file');
|
|
154
165
|
}
|
|
155
|
-
export function narrowed(runtime, given,
|
|
166
|
+
export function narrowed(runtime, given, port) {
|
|
156
167
|
const { md, watch } = runtime;
|
|
157
168
|
let reach = given;
|
|
158
|
-
let port = told;
|
|
159
169
|
const open = new Set();
|
|
160
170
|
function following(begin, locking = false) {
|
|
161
171
|
let stop = begin();
|
|
@@ -171,70 +181,127 @@ export function narrowed(runtime, given, told) {
|
|
|
171
181
|
stop();
|
|
172
182
|
};
|
|
173
183
|
}
|
|
174
|
-
const unlocking = (rooms) => {
|
|
175
|
-
const
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
const unlocking = (rooms, locked) => {
|
|
185
|
+
const held = (rooms ?? []).filter((room) => locked.includes(room));
|
|
186
|
+
return held.length === 0 ? null : { pending: held.map((room) => ({ room, awaits: 'unlock' })) };
|
|
187
|
+
};
|
|
188
|
+
const unlocked = (entries, locked) => entries.filter((entry) => !locked.includes(entry.room));
|
|
189
|
+
const intoLocked = async (held) => {
|
|
190
|
+
for (const move of held) {
|
|
191
|
+
if (move?.room !== undefined && (await runtime.locked(move.room)))
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
179
195
|
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
196
|
+
function ordered(deliver) {
|
|
197
|
+
let open = true;
|
|
198
|
+
let shown = Promise.resolve();
|
|
199
|
+
return {
|
|
200
|
+
push(making) {
|
|
201
|
+
shown = shown.then(() => making.then((value) => {
|
|
202
|
+
if (open)
|
|
203
|
+
deliver(value);
|
|
204
|
+
}, uncaught), uncaught);
|
|
205
|
+
},
|
|
206
|
+
stop() {
|
|
207
|
+
open = false;
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function unlockedWatch(topic, input, deliver, fail, within) {
|
|
212
|
+
const shown = ordered(deliver);
|
|
213
|
+
const stop = watch(topic, input, (message) => {
|
|
214
|
+
shown.push(runtime.lockedRooms().then((locked) => within(message, locked)));
|
|
215
|
+
}, fail);
|
|
216
|
+
return () => {
|
|
217
|
+
shown.stop();
|
|
218
|
+
stop();
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function lockedFirst(room, start, shut) {
|
|
222
|
+
let open = true;
|
|
223
|
+
let stop = () => { };
|
|
224
|
+
void (async () => {
|
|
225
|
+
const closed = !holds(reach, room) || (await runtime.locked(room));
|
|
226
|
+
if (!open)
|
|
227
|
+
return;
|
|
228
|
+
if (closed)
|
|
229
|
+
shut();
|
|
230
|
+
else
|
|
231
|
+
stop = start();
|
|
232
|
+
})();
|
|
233
|
+
return () => {
|
|
234
|
+
open = false;
|
|
235
|
+
stop();
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
const within = (topic, input, deliver, fail) => {
|
|
239
|
+
if (topic === 'read' && reach !== null) {
|
|
240
|
+
fail(deviceUnreached());
|
|
241
|
+
return () => { };
|
|
242
|
+
}
|
|
183
243
|
if (topic === 'rooms') {
|
|
184
|
-
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms))));
|
|
244
|
+
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms)), fail));
|
|
185
245
|
}
|
|
186
246
|
if (topic === 'readiness') {
|
|
187
247
|
return following(() => runtime.watchReadiness(port, reach, deliver));
|
|
188
248
|
}
|
|
189
249
|
if (topic === 'sync-status') {
|
|
190
|
-
return following(() =>
|
|
191
|
-
const
|
|
192
|
-
|
|
250
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (status, locked) => {
|
|
251
|
+
const shown = statusWithin(reach, status);
|
|
252
|
+
return { ...shown, attentionRequired: unlocked(shown.attentionRequired, locked) };
|
|
193
253
|
}), true);
|
|
194
254
|
}
|
|
195
255
|
if (topic === 'room-drafts') {
|
|
196
|
-
return following(() =>
|
|
256
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (drafts, locked) => unlocked(draftsWithin(reach, drafts), locked)), true);
|
|
197
257
|
}
|
|
198
258
|
if (topic === 'queue') {
|
|
199
259
|
const room = input[0];
|
|
200
|
-
return following(() =>
|
|
201
|
-
if (!holds(reach, room) || runtime.locked(room)) {
|
|
202
|
-
deliver([]);
|
|
203
|
-
return () => { };
|
|
204
|
-
}
|
|
205
|
-
return watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)));
|
|
206
|
-
}, true);
|
|
260
|
+
return following(() => lockedFirst(room, () => watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)), fail), () => deliver([])), true);
|
|
207
261
|
}
|
|
208
262
|
if (topic === 'query') {
|
|
209
|
-
const
|
|
263
|
+
const planning = runtime.plan(input[0], reach);
|
|
210
264
|
let held = null;
|
|
211
265
|
return following(() => {
|
|
212
|
-
const locked = unlocking(plan.rooms);
|
|
213
|
-
if (locked !== null) {
|
|
214
|
-
const answer = { result: locked, keys: [] };
|
|
215
|
-
if (held === null || changeOf(held, answer) !== null)
|
|
216
|
-
deliver(answer);
|
|
217
|
-
held = digestOf(answer);
|
|
218
|
-
return () => { };
|
|
219
|
-
}
|
|
220
|
-
let first = true;
|
|
221
266
|
let open = true;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
267
|
+
let stop = () => { };
|
|
268
|
+
void (async () => {
|
|
269
|
+
const plan = await planning;
|
|
270
|
+
const locked = await runtime.lockedRooms();
|
|
271
|
+
if (!open)
|
|
272
|
+
return;
|
|
273
|
+
const pending = unlocking(plan.rooms, locked);
|
|
274
|
+
if (pending !== null) {
|
|
275
|
+
const answer = { result: pending, keys: [] };
|
|
276
|
+
if (held === null || changeOf(held, answer) !== null)
|
|
277
|
+
deliver(answer);
|
|
278
|
+
held = digestOf(answer);
|
|
226
279
|
return;
|
|
227
280
|
}
|
|
228
|
-
first =
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
281
|
+
let first = true;
|
|
282
|
+
const heard = (message) => {
|
|
283
|
+
if (!first) {
|
|
284
|
+
held = digestApplied(held, message);
|
|
285
|
+
deliver(message);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
first = false;
|
|
289
|
+
const change = held === null ? message : changeOf(held, message);
|
|
290
|
+
held = digestOf(message);
|
|
291
|
+
if (change !== null)
|
|
292
|
+
deliver(change);
|
|
293
|
+
};
|
|
294
|
+
const current = { ...plan, reach: planReach(reach), locked };
|
|
295
|
+
stop = runtime.watchPlan(current, (message) => {
|
|
296
|
+
if (open)
|
|
297
|
+
heard(message);
|
|
298
|
+
}, (error) => {
|
|
299
|
+
if (open)
|
|
300
|
+
fail(error);
|
|
301
|
+
});
|
|
302
|
+
})().catch((error) => {
|
|
236
303
|
if (open)
|
|
237
|
-
|
|
304
|
+
fail(error);
|
|
238
305
|
});
|
|
239
306
|
return () => {
|
|
240
307
|
open = false;
|
|
@@ -245,7 +312,7 @@ export function narrowed(runtime, given, told) {
|
|
|
245
312
|
if (topic === 'conversation') {
|
|
246
313
|
return following(() => {
|
|
247
314
|
if (conversing(reach))
|
|
248
|
-
return watch(topic, input, deliver);
|
|
315
|
+
return watch(topic, input, deliver, fail);
|
|
249
316
|
deliver(unheldView(input[0]));
|
|
250
317
|
return () => { };
|
|
251
318
|
});
|
|
@@ -253,16 +320,22 @@ export function narrowed(runtime, given, told) {
|
|
|
253
320
|
if (topic === 'conversations' || topic === 'agents') {
|
|
254
321
|
return following(() => {
|
|
255
322
|
if (conversing(reach))
|
|
256
|
-
return watch(topic, input, deliver);
|
|
323
|
+
return watch(topic, input, deliver, fail);
|
|
257
324
|
deliver([]);
|
|
258
325
|
return () => { };
|
|
259
326
|
});
|
|
260
327
|
}
|
|
261
|
-
|
|
328
|
+
if (topic === 'figures' || topic === 'holdings') {
|
|
329
|
+
if (reach === null)
|
|
330
|
+
return watch(topic, input, deliver, fail);
|
|
331
|
+
fail(deviceUnreached());
|
|
332
|
+
return () => { };
|
|
333
|
+
}
|
|
334
|
+
return watch(topic, input, deliver, fail);
|
|
262
335
|
};
|
|
263
336
|
const files = new Map();
|
|
264
337
|
let handed = 0;
|
|
265
|
-
|
|
338
|
+
async function hand(reading) {
|
|
266
339
|
const answer = await reading;
|
|
267
340
|
if (answer.kind !== 'binary')
|
|
268
341
|
return answer;
|
|
@@ -270,78 +343,92 @@ export function narrowed(runtime, given, told) {
|
|
|
270
343
|
const file = String(handed);
|
|
271
344
|
files.set(file, answer.file);
|
|
272
345
|
return { ...answer, file };
|
|
273
|
-
}
|
|
346
|
+
}
|
|
274
347
|
const conversation = () => (conversing(reach) ? md.conversation : NO_CONVERSATION);
|
|
275
348
|
const chatDraft = () => (conversing(reach) ? md.chatDraft : NO_CHAT_DRAFT);
|
|
276
349
|
const view = {
|
|
277
350
|
...md,
|
|
278
|
-
rooms: () => roomsWithin(reach,
|
|
279
|
-
query: ((input) => {
|
|
280
|
-
const plan = runtime.plan(input, reach);
|
|
281
|
-
|
|
351
|
+
rooms: () => md.rooms().then((rooms) => roomsWithin(reach, rooms)),
|
|
352
|
+
query: (async (input) => {
|
|
353
|
+
const plan = await runtime.plan(input, reach);
|
|
354
|
+
const locked = await runtime.lockedRooms();
|
|
355
|
+
return unlocking(plan.rooms, locked) ?? runtime.query({ ...plan, locked });
|
|
282
356
|
}),
|
|
283
|
-
search: (input) =>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
types(room) {
|
|
287
|
-
if (holds(reach, room) && runtime.locked(room))
|
|
357
|
+
search: (input) => runtime.search(input, reach),
|
|
358
|
+
async types(room) {
|
|
359
|
+
if (holds(reach, room) && (await runtime.locked(room)))
|
|
288
360
|
throw lockedError(room);
|
|
289
361
|
if (wholly(reach, room))
|
|
290
362
|
return md.types(room);
|
|
291
363
|
if (!holds(reach, room))
|
|
292
364
|
return structuredClone(UNHELD_TYPES);
|
|
293
|
-
|
|
294
|
-
return typesWithin(reach, listed, md.types(room));
|
|
365
|
+
return typesWithin(reach, await runtime.room(room), await md.types(room));
|
|
295
366
|
},
|
|
296
367
|
async save(room, roomDrafts, writtenBy) {
|
|
297
368
|
if (!holds(reach, room))
|
|
298
369
|
throw unreached(room);
|
|
299
|
-
if (runtime.locked(room))
|
|
370
|
+
if (await runtime.locked(room)) {
|
|
300
371
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
372
|
+
}
|
|
301
373
|
const held = (await Promise.all(roomDrafts.map(({ path }) => md.roomDraft.read(room, path)))).map((draft) => draft?.parts.move);
|
|
302
374
|
const outside = roomDrafts.find(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]));
|
|
303
375
|
if (outside !== undefined) {
|
|
304
376
|
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
305
377
|
}
|
|
306
|
-
if (intoLocked(held))
|
|
378
|
+
if (await intoLocked(held))
|
|
307
379
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
308
380
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
309
381
|
},
|
|
310
382
|
async saveParts(room, parts, writtenBy) {
|
|
311
383
|
if (!holds(reach, room))
|
|
312
384
|
throw unreached(room);
|
|
313
|
-
|
|
385
|
+
const filed = reach === null ? undefined : parts.find(({ parts: one }) => carriesFile(one));
|
|
386
|
+
if (filed !== undefined) {
|
|
387
|
+
return { outcome: 'refused', code: ATTACH_REQUIRED, retryable: false, file: filed.path };
|
|
388
|
+
}
|
|
389
|
+
if (await runtime.locked(room)) {
|
|
314
390
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
315
|
-
|
|
391
|
+
}
|
|
392
|
+
const held = parts.map(({ path, parts: one }) => readParts(one, path).move);
|
|
316
393
|
if (parts.some(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]))) {
|
|
317
394
|
throw unreached(room);
|
|
318
395
|
}
|
|
319
|
-
if (intoLocked(held))
|
|
396
|
+
if (await intoLocked(held))
|
|
320
397
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
321
398
|
return savedWithin(reach, room, await md.saveParts(room, parts, writtenBy));
|
|
322
399
|
},
|
|
323
|
-
resolve(room, path, destination) {
|
|
324
|
-
const at = runtime.located(room, path, destination);
|
|
400
|
+
async resolve(room, path, destination) {
|
|
401
|
+
const at = await runtime.located(room, path, destination);
|
|
325
402
|
return at !== null && !covers(reach, at.room, at.path)
|
|
326
|
-
?
|
|
403
|
+
? UNREADABLE
|
|
327
404
|
: md.resolve(room, path, destination);
|
|
328
405
|
},
|
|
329
|
-
history: (room, path, query) => !covers(reach, room, path)
|
|
330
|
-
?
|
|
331
|
-
: runtime.locked(room)
|
|
332
|
-
?
|
|
406
|
+
history: async (room, path, query) => !covers(reach, room, path)
|
|
407
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
408
|
+
: (await runtime.locked(room))
|
|
409
|
+
? lockedRoom(room)
|
|
333
410
|
: md.history(room, path, query),
|
|
334
411
|
binaryFile: {
|
|
335
|
-
read: (room, path, revision) => !covers(reach, room, path)
|
|
336
|
-
?
|
|
337
|
-
: runtime.locked(room)
|
|
338
|
-
?
|
|
412
|
+
read: async (room, path, revision) => !covers(reach, room, path)
|
|
413
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
414
|
+
: (await runtime.locked(room))
|
|
415
|
+
? lockedRoom(room)
|
|
339
416
|
: hand(md.binaryFile.read(room, path, revision)),
|
|
340
|
-
link: (room, path, revision) => !covers(reach, room, path)
|
|
341
|
-
?
|
|
342
|
-
: runtime.locked(room)
|
|
343
|
-
?
|
|
417
|
+
link: async (room, path, revision) => !covers(reach, room, path)
|
|
418
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
419
|
+
: (await runtime.locked(room))
|
|
420
|
+
? lockedRoom(room)
|
|
344
421
|
: md.binaryFile.link(room, path, revision),
|
|
422
|
+
show: async (room, path, revision) => !covers(reach, room, path)
|
|
423
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
424
|
+
: (await runtime.locked(room))
|
|
425
|
+
? lockedRoom(room)
|
|
426
|
+
: hand(md.binaryFile.show(room, path, revision)),
|
|
427
|
+
attach: async (room, file) => !wholly(reach, room)
|
|
428
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
429
|
+
: (await runtime.locked(room))
|
|
430
|
+
? lockedRoom(room)
|
|
431
|
+
: md.binaryFile.attach(room, file),
|
|
345
432
|
async part(file, part) {
|
|
346
433
|
const key = files.get(file);
|
|
347
434
|
if (key === undefined)
|
|
@@ -353,40 +440,38 @@ export function narrowed(runtime, given, told) {
|
|
|
353
440
|
},
|
|
354
441
|
},
|
|
355
442
|
reached: async (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
356
|
-
!runtime.locked(room) &&
|
|
443
|
+
!(await runtime.locked(room)) &&
|
|
357
444
|
(await md.reached(room, roomVersion, path)),
|
|
358
445
|
log: () => (reach === null ? md.log() : ''),
|
|
359
446
|
cleanUp: () => (reach === null ? md.cleanUp() : Promise.reject(deviceUnreached())),
|
|
447
|
+
unsent: () => (reach === null ? md.unsent() : Promise.reject(deviceUnreached())),
|
|
448
|
+
reset: () => (reach === null ? md.reset() : Promise.reject(deviceUnreached())),
|
|
449
|
+
readAgain: () => (reach === null ? md.readAgain() : Promise.reject(deviceUnreached())),
|
|
360
450
|
roomDraft: {
|
|
361
|
-
list: () => md.roomDraft.list()
|
|
451
|
+
list: async () => unlocked(draftsWithin(reach, await md.roomDraft.list()), await runtime.lockedRooms()),
|
|
362
452
|
async read(room, path) {
|
|
363
453
|
if (!covers(reach, room, path))
|
|
364
454
|
return null;
|
|
365
|
-
if (runtime.locked(room))
|
|
455
|
+
if (await runtime.locked(room))
|
|
366
456
|
throw lockedError(room);
|
|
367
457
|
return shownDraft(reach, await md.roomDraft.read(room, path));
|
|
368
458
|
},
|
|
369
|
-
write(room, path, revision, parts, next) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return Promise.reject(error);
|
|
381
|
-
}
|
|
382
|
-
return md.roomDraft
|
|
383
|
-
.write(room, path, revision, parts, next)
|
|
384
|
-
.then((written) => writeWithin(reach, written));
|
|
459
|
+
async write(room, path, revision, parts, next) {
|
|
460
|
+
if (reach !== null && carriesFile(parts))
|
|
461
|
+
throw attachRequired();
|
|
462
|
+
const move = readParts(parts, path).move;
|
|
463
|
+
if (!covers(reach, room, path) || !moves(reach, room, move))
|
|
464
|
+
throw unreached(room);
|
|
465
|
+
if (await runtime.locked(room))
|
|
466
|
+
throw lockedError(room);
|
|
467
|
+
if (await intoLocked([move]))
|
|
468
|
+
throw lockedError(move.room);
|
|
469
|
+
return writeWithin(reach, await md.roomDraft.write(room, path, revision, parts, next));
|
|
385
470
|
},
|
|
386
471
|
async discard(room, path, revision) {
|
|
387
472
|
if (!covers(reach, room, path))
|
|
388
473
|
return staleWrite(null);
|
|
389
|
-
if (runtime.locked(room))
|
|
474
|
+
if (await runtime.locked(room))
|
|
390
475
|
throw lockedError(room);
|
|
391
476
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
392
477
|
},
|
|
@@ -396,16 +481,19 @@ export function narrowed(runtime, given, told) {
|
|
|
396
481
|
read: (id, options) => conversation().read(id, options),
|
|
397
482
|
create: (input) => conversation().create(input),
|
|
398
483
|
send: (id, operation, draft) => conversation().send(id, operation, draft),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
484
|
+
answer: (id, answer, operation) => conversation().answer(id, answer, operation),
|
|
485
|
+
interrupt: (id, operation) => conversation().interrupt(id, operation),
|
|
486
|
+
kill: (id, operation) => conversation().kill(id, operation),
|
|
487
|
+
delete: (id, operation) => conversation().delete(id, operation),
|
|
488
|
+
takeOut: (id, message, operation) => conversation().takeOut(id, message, operation),
|
|
489
|
+
decide: (request, decision, operation) => conversation().decide(request, decision, operation),
|
|
490
|
+
rename: (id, name, operation) => conversation().rename(id, name, operation),
|
|
491
|
+
option: (id, option, value, operation) => conversation().option(id, option, value, operation),
|
|
492
|
+
retry: (id, message, operation) => conversation().retry(id, message, operation),
|
|
493
|
+
pins: () => conversation().pins(),
|
|
494
|
+
pin: (figures) => conversation().pin(figures),
|
|
495
|
+
openedTurns: () => conversation().openedTurns(),
|
|
496
|
+
openTurn: (id, turn) => conversation().openTurn(id, turn),
|
|
409
497
|
},
|
|
410
498
|
chatDraft: {
|
|
411
499
|
write: (id, draft, revision) => chatDraft().write(id, draft, revision),
|
|
@@ -422,10 +510,5 @@ export function narrowed(runtime, given, told) {
|
|
|
422
510
|
for (const restart of [...open])
|
|
423
511
|
restart();
|
|
424
512
|
},
|
|
425
|
-
facts(next) {
|
|
426
|
-
port = next;
|
|
427
|
-
for (const restart of [...open])
|
|
428
|
-
restart();
|
|
429
|
-
},
|
|
430
513
|
};
|
|
431
514
|
}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { Acting, Lane, LaneShown } from './act-lanes.js';
|
|
1
3
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import type { AppRoom
|
|
4
|
+
import type { AppRoom } from './listing.js';
|
|
5
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
6
|
+
import type { SavedRoomDraft, SaveResult } from './saves.js';
|
|
3
7
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
8
|
import type { ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
5
9
|
import { type RuntimeError } from './failure.js';
|
|
10
|
+
import type { FiguresResult } from './figures.js';
|
|
11
|
+
import type { Holdings } from './holdings.js';
|
|
12
|
+
import type { Descriptor, Expecting } from './expectation.js';
|
|
6
13
|
import type { QueueEntry } from './outcome.js';
|
|
7
|
-
import type {
|
|
14
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
8
15
|
import type { Readiness } from './readiness.js';
|
|
9
16
|
import type { RoomDraft, RoomDraftParts } from './room-draft.js';
|
|
10
17
|
import type { SyncStatus } from './status.js';
|
|
@@ -23,6 +30,7 @@ export declare function useObserve(client: Client, topic: 'storage-loss'): Obser
|
|
|
23
30
|
export declare function useObserve(client: Client, topic: 'sync-status'): Observed<SyncStatus>;
|
|
24
31
|
export declare function useObserve(client: Client, topic: 'service-mode'): Observed<ServiceMode>;
|
|
25
32
|
export declare function useObserve(client: Client, topic: 'member'): Observed<Member | null>;
|
|
33
|
+
export declare function useObserve(client: Client, topic: 'authority-changes'): Observed<number>;
|
|
26
34
|
export declare function useObserve(client: Client, topic: 'query', query: DocumentQuery): Observed<DocumentResult | PendingResult>;
|
|
27
35
|
export declare function useObserve(client: Client, topic: 'query', query: GroupQuery): Observed<GroupResult | PendingResult>;
|
|
28
36
|
export declare function useObserve(client: Client, topic: 'queue', locator: string): Observed<readonly QueueEntry[]>;
|
|
@@ -31,6 +39,11 @@ export declare function useObserve(client: Client, topic: 'presentation'): Obser
|
|
|
31
39
|
export declare function useObserve(client: Client, topic: 'conversation', conversation: string, options: ConversationOptions): Observed<ConversationView>;
|
|
32
40
|
export declare function useObserve(client: Client, topic: 'conversations'): Observed<readonly ConversationEntry[]>;
|
|
33
41
|
export declare function useObserve(client: Client, topic: 'agents'): Observed<readonly ConversationAgent[]>;
|
|
42
|
+
export declare function useObserve(client: Client, topic: 'figures'): Observed<FiguresResult>;
|
|
43
|
+
export declare function useObserve(client: Client, topic: 'holdings'): Observed<Holdings>;
|
|
44
|
+
export declare function useExpected<A, T>(store: Expecting, descriptor: Descriptor<A, T>, places: readonly A[], held: ReadonlyMap<A, T> | null): (place: A, held: T) => T;
|
|
45
|
+
export type LaneHeld<O> = LaneShown<O> & Pick<Lane<O>, 'run' | 'forget'>;
|
|
46
|
+
export declare function useLane<O>(lanes: Acting<O>): LaneHeld<O>;
|
|
34
47
|
export type Saving = {
|
|
35
48
|
readonly busy: boolean;
|
|
36
49
|
readonly outcome: SaveResult | null;
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO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