@agentshouse/mdruntime 0.1.0-c0ffc146f48dd → 0.1.0-c10002a0f5d24
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 +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +299 -0
- 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 +302 -0
- package/dist/adapter.d.ts +135 -81
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -11
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +20 -60
- 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 +9 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +204 -85
- 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 +5 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +11 -0
- package/dist/client.d.ts +32 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -55
- package/dist/collection.d.ts +26 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +19 -2
- 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 +8 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +255 -318
- package/dist/connection.d.ts +5 -142
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +111 -5074
- 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 +150 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +40 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +66 -0
- package/dist/conversation.d.ts +67 -46
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +1003 -911
- 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 +11 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +157 -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 +20 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +2 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- 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 +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +199 -0
- 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 +21 -6
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +83 -36
- 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 +37 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -5
- package/dist/install.d.ts +60 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +282 -0
- package/dist/listing.d.ts +52 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +152 -0
- package/dist/live.d.ts +9 -6
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +118 -35
- 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 +32 -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 +13 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +138 -37
- package/dist/messages.d.ts +35 -5
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +109 -39
- package/dist/model.d.ts +2 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -14
- 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 +28 -13
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +185 -81
- 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 +53 -0
- package/dist/outcome.d.ts +17 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +35 -2
- package/dist/overlay.d.ts +7 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +48 -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 +4 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +13 -0
- 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 +314 -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 +308 -0
- package/dist/query.d.ts +13 -209
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +30 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +116 -0
- 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 -14
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +241 -125
- package/dist/react.d.ts +18 -3
- 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 +9 -6
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +39 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +178 -0
- package/dist/recovery.d.ts +3 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +38 -8
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +9 -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 +11 -16
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +66 -32
- 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 +33 -9
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +276 -69
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +220 -0
- 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 +16 -22
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +49 -186
- package/dist/runtime.d.ts +34 -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 +332 -228
- package/dist/saves.d.ts +34 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +437 -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 -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 +313 -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 +28 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +103 -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 +67 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +164 -0
- package/dist/source.d.ts +59 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +93 -0
- package/dist/status.d.ts +0 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -6
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +40 -0
- 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 +224 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +466 -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/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 +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 +115 -144
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +171 -365
- package/dist/stored.d.ts +72 -35
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +337 -197
- package/dist/surface.d.ts +92 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +251 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +538 -0
- package/dist/tables.d.ts +118 -67
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +199 -278
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +128 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +9 -12
- 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 +73 -7
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +25 -4
- 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 -370
- package/dist/log.d.ts +0 -5
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -156
package/dist/reach.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { QueryError } from '@agentshouse/mdmodel';
|
|
2
|
+
import { selected } from './collection.js';
|
|
1
3
|
import { unheldView } from './conversation.js';
|
|
2
4
|
import { modelTypes, NO_MODEL } from './model.js';
|
|
3
|
-
import { changeOf, digestApplied, digestOf, observing, } from './observation.js';
|
|
4
|
-
import { runtimeError } from './failure.js';
|
|
5
|
-
import { failure, lockedRoom, ROOM_LOCKED, undeclared, UNREADABLE, } from './outcome.js';
|
|
5
|
+
import { changeOf, digestApplied, digestOf, observing, unchanged, } from './observation.js';
|
|
6
|
+
import { runtimeError, uncaught } from './failure.js';
|
|
7
|
+
import { absentBinary, failure, lockedRoom, ROOM_LOCKED, undeclared, UNREADABLE, } from './outcome.js';
|
|
6
8
|
import { beneath } from './paths.js';
|
|
7
9
|
import { moveTarget, readParts, staleWrite, } from './room-draft.js';
|
|
8
10
|
import { documentKey } from './rows.js';
|
|
9
|
-
import { undeclaredSearch } from './search.js';
|
|
10
11
|
const UNHELD_TYPES = { collection: modelTypes(NO_MODEL), typedSelection: null };
|
|
11
12
|
function unconversed(name) {
|
|
12
13
|
return () => Promise.resolve(undeclared(name));
|
|
@@ -20,10 +21,21 @@ const NO_CONVERSATION = {
|
|
|
20
21
|
interrupt: unconversed('conversations/interrupt'),
|
|
21
22
|
kill: unconversed('conversations/kill'),
|
|
22
23
|
delete: unconversed('conversations/delete'),
|
|
24
|
+
takeOut: unconversed('conversations/take-out'),
|
|
25
|
+
decide: unconversed('agent-functions/decide'),
|
|
26
|
+
rename: unconversed('conversations/rename'),
|
|
27
|
+
option: unconversed('conversations/option/set'),
|
|
28
|
+
retry: unconversed('conversations/retry'),
|
|
29
|
+
pin: () => Promise.resolve(),
|
|
30
|
+
openTurn: () => Promise.resolve(),
|
|
31
|
+
dismissSuggestion: () => Promise.resolve(),
|
|
32
|
+
attach: () => Promise.resolve(undeclared('conversation.attach')),
|
|
33
|
+
attachment: (link) => Promise.resolve(absentBinary(link)),
|
|
23
34
|
};
|
|
24
35
|
const NO_CHAT_DRAFT = {
|
|
25
36
|
write: () => Promise.resolve(),
|
|
26
37
|
prepend: () => Promise.resolve(),
|
|
38
|
+
append: () => Promise.resolve(),
|
|
27
39
|
discard: () => Promise.resolve(),
|
|
28
40
|
};
|
|
29
41
|
function areasOf(reach) {
|
|
@@ -46,11 +58,11 @@ export function governs(reach, room) {
|
|
|
46
58
|
if (wholly(reach, room.locator)) {
|
|
47
59
|
return { collection: true, selection: room.typedSelection !== null };
|
|
48
60
|
}
|
|
49
|
-
const
|
|
61
|
+
const within = (path) => selected({ selection: room.typedSelection }, path);
|
|
50
62
|
const paths = reach.documents
|
|
51
63
|
.filter((document) => document.room === room.locator)
|
|
52
64
|
.map(({ path }) => path);
|
|
53
|
-
return { collection: paths.some((path) => !
|
|
65
|
+
return { collection: paths.some((path) => !within(path)), selection: paths.some(within) };
|
|
54
66
|
}
|
|
55
67
|
function covers(reach, room, path) {
|
|
56
68
|
return (reach === null ||
|
|
@@ -61,6 +73,19 @@ function covers(reach, room, path) {
|
|
|
61
73
|
function conversing(reach) {
|
|
62
74
|
return reach === null || reach.conversations;
|
|
63
75
|
}
|
|
76
|
+
function roomsAwaited(error, reach) {
|
|
77
|
+
return error.code === 'unknown-type' && reach !== null && reach.rooms.length === 0;
|
|
78
|
+
}
|
|
79
|
+
async function planInReach(runtime, input, reach, answered) {
|
|
80
|
+
try {
|
|
81
|
+
return await runtime.plan(input, reach);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error instanceof QueryError && (answered || roomsAwaited(error, reach)))
|
|
85
|
+
return null;
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
64
89
|
export function planReach(reach) {
|
|
65
90
|
return reach === null
|
|
66
91
|
? null
|
|
@@ -77,6 +102,14 @@ export function planReach(reach) {
|
|
|
77
102
|
function roomsWithin(reach, rooms) {
|
|
78
103
|
return rooms.filter((room) => wholly(reach, room.locator));
|
|
79
104
|
}
|
|
105
|
+
function roomsChangeWithin(reach, { changed, removed, order }) {
|
|
106
|
+
const within = {
|
|
107
|
+
changed: changed.filter(([locator]) => wholly(reach, locator)),
|
|
108
|
+
removed,
|
|
109
|
+
order: order === null ? null : order.filter((locator) => wholly(reach, locator)),
|
|
110
|
+
};
|
|
111
|
+
return unchanged(within) ? null : within;
|
|
112
|
+
}
|
|
80
113
|
function typesWithin(reach, room, types) {
|
|
81
114
|
if (room === undefined)
|
|
82
115
|
return structuredClone(UNHELD_TYPES);
|
|
@@ -106,12 +139,13 @@ function writeWithin(reach, write) {
|
|
|
106
139
|
function savedWithin(reach, room, result) {
|
|
107
140
|
if (reach === null || result.outcome === 'saved')
|
|
108
141
|
return result;
|
|
109
|
-
const { file, location, referrers, ...refusal } = result;
|
|
142
|
+
const { file, location, line, referrers, ...refusal } = result;
|
|
110
143
|
const hidden = file !== undefined && !covers(reach, room, file);
|
|
111
144
|
return {
|
|
112
145
|
...refusal,
|
|
113
146
|
...(file === undefined || hidden ? {} : { file }),
|
|
114
147
|
...(location === undefined || hidden ? {} : { location }),
|
|
148
|
+
...(line === undefined || hidden ? {} : { line }),
|
|
115
149
|
...(referrers === undefined
|
|
116
150
|
? {}
|
|
117
151
|
: { referrers: referrers.filter((path) => covers(reach, room, path)) }),
|
|
@@ -144,7 +178,7 @@ function lockedError(room) {
|
|
|
144
178
|
return runtimeError(ROOM_LOCKED, `${room} is locked until House confirms its access`, true);
|
|
145
179
|
}
|
|
146
180
|
function deviceUnreached() {
|
|
147
|
-
return runtimeError('device-unreached', 'Only the panel
|
|
181
|
+
return runtimeError('device-unreached', 'Only the panel reaches this device');
|
|
148
182
|
}
|
|
149
183
|
const ATTACH_REQUIRED = 'attach-required';
|
|
150
184
|
function attachRequired() {
|
|
@@ -153,10 +187,9 @@ function attachRequired() {
|
|
|
153
187
|
function carriesFile(parts) {
|
|
154
188
|
return parts !== null && typeof parts === 'object' && Object.hasOwn(parts, 'file');
|
|
155
189
|
}
|
|
156
|
-
export function narrowed(runtime, given,
|
|
190
|
+
export function narrowed(runtime, given, port) {
|
|
157
191
|
const { md, watch } = runtime;
|
|
158
192
|
let reach = given;
|
|
159
|
-
let port = told;
|
|
160
193
|
const open = new Set();
|
|
161
194
|
function following(begin, locking = false) {
|
|
162
195
|
let stop = begin();
|
|
@@ -172,70 +205,139 @@ export function narrowed(runtime, given, told) {
|
|
|
172
205
|
stop();
|
|
173
206
|
};
|
|
174
207
|
}
|
|
175
|
-
const unlocking = (rooms) => {
|
|
176
|
-
const
|
|
177
|
-
return
|
|
178
|
-
|
|
179
|
-
|
|
208
|
+
const unlocking = (rooms, locked) => {
|
|
209
|
+
const held = (rooms ?? []).filter((room) => locked.includes(room));
|
|
210
|
+
return held.length === 0 ? null : { pending: held.map((room) => ({ room, awaits: 'unlock' })) };
|
|
211
|
+
};
|
|
212
|
+
const unlocked = (entries, locked) => entries.filter((entry) => !locked.includes(entry.room));
|
|
213
|
+
const intoLocked = async (held) => {
|
|
214
|
+
for (const move of held) {
|
|
215
|
+
if (move?.room !== undefined && (await runtime.locked(move.room)))
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
180
219
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
220
|
+
function ordered(deliver) {
|
|
221
|
+
let open = true;
|
|
222
|
+
let shown = Promise.resolve();
|
|
223
|
+
return {
|
|
224
|
+
push(making) {
|
|
225
|
+
shown = shown.then(() => making.then((value) => {
|
|
226
|
+
if (open)
|
|
227
|
+
deliver(value);
|
|
228
|
+
}, uncaught), uncaught);
|
|
229
|
+
},
|
|
230
|
+
stop() {
|
|
231
|
+
open = false;
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function unlockedWatch(topic, input, deliver, fail, within) {
|
|
236
|
+
const shown = ordered(deliver);
|
|
237
|
+
const stop = watch(topic, input, (message) => {
|
|
238
|
+
shown.push(runtime.lockedRooms().then((locked) => within(message, locked)));
|
|
239
|
+
}, fail);
|
|
240
|
+
return () => {
|
|
241
|
+
shown.stop();
|
|
242
|
+
stop();
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function lockedFirst(room, start, shut) {
|
|
246
|
+
let open = true;
|
|
247
|
+
let stop = () => { };
|
|
248
|
+
void (async () => {
|
|
249
|
+
const closed = !holds(reach, room) || (await runtime.locked(room));
|
|
250
|
+
if (!open)
|
|
251
|
+
return;
|
|
252
|
+
if (closed)
|
|
253
|
+
shut();
|
|
254
|
+
else
|
|
255
|
+
stop = start();
|
|
256
|
+
})();
|
|
257
|
+
return () => {
|
|
258
|
+
open = false;
|
|
259
|
+
stop();
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
const within = (topic, input, deliver, fail) => {
|
|
263
|
+
if (topic === 'read' && reach !== null) {
|
|
264
|
+
fail(deviceUnreached());
|
|
265
|
+
return () => { };
|
|
266
|
+
}
|
|
184
267
|
if (topic === 'rooms') {
|
|
185
|
-
return following(() => watch(topic, input, (rooms) =>
|
|
268
|
+
return following(() => watch(topic, input, (rooms) => {
|
|
269
|
+
const shown = Array.isArray(rooms)
|
|
270
|
+
? roomsWithin(reach, rooms)
|
|
271
|
+
: roomsChangeWithin(reach, rooms);
|
|
272
|
+
if (shown !== null)
|
|
273
|
+
deliver(shown);
|
|
274
|
+
}, fail));
|
|
186
275
|
}
|
|
187
276
|
if (topic === 'readiness') {
|
|
188
277
|
return following(() => runtime.watchReadiness(port, reach, deliver));
|
|
189
278
|
}
|
|
190
279
|
if (topic === 'sync-status') {
|
|
191
|
-
return following(() =>
|
|
192
|
-
const
|
|
193
|
-
|
|
280
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (status, locked) => {
|
|
281
|
+
const shown = statusWithin(reach, status);
|
|
282
|
+
return { ...shown, attentionRequired: unlocked(shown.attentionRequired, locked) };
|
|
194
283
|
}), true);
|
|
195
284
|
}
|
|
196
285
|
if (topic === 'room-drafts') {
|
|
197
|
-
return following(() =>
|
|
286
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (drafts, locked) => unlocked(draftsWithin(reach, drafts), locked)), true);
|
|
198
287
|
}
|
|
199
288
|
if (topic === 'queue') {
|
|
200
289
|
const room = input[0];
|
|
201
|
-
return following(() =>
|
|
202
|
-
if (!holds(reach, room) || runtime.locked(room)) {
|
|
203
|
-
deliver([]);
|
|
204
|
-
return () => { };
|
|
205
|
-
}
|
|
206
|
-
return watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)));
|
|
207
|
-
}, true);
|
|
290
|
+
return following(() => lockedFirst(room, () => watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)), fail), () => deliver([])), true);
|
|
208
291
|
}
|
|
209
292
|
if (topic === 'query') {
|
|
210
|
-
const plan = runtime.plan(input[0], reach);
|
|
211
293
|
let held = null;
|
|
294
|
+
let planning = null;
|
|
295
|
+
const waiting = (result) => {
|
|
296
|
+
const answer = { result, keys: [] };
|
|
297
|
+
if (held === null || changeOf(held, answer) !== null)
|
|
298
|
+
deliver(answer);
|
|
299
|
+
held = digestOf(answer);
|
|
300
|
+
};
|
|
212
301
|
return following(() => {
|
|
213
|
-
const locked = unlocking(plan.rooms);
|
|
214
|
-
if (locked !== null) {
|
|
215
|
-
const answer = { result: locked, keys: [] };
|
|
216
|
-
if (held === null || changeOf(held, answer) !== null)
|
|
217
|
-
deliver(answer);
|
|
218
|
-
held = digestOf(answer);
|
|
219
|
-
return () => { };
|
|
220
|
-
}
|
|
221
|
-
let first = true;
|
|
222
302
|
let open = true;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
303
|
+
let stop = () => { };
|
|
304
|
+
if (planning?.reach !== reach) {
|
|
305
|
+
planning = { reach, plan: planInReach(runtime, input[0], reach, held !== null) };
|
|
306
|
+
}
|
|
307
|
+
const planned = planning.plan;
|
|
308
|
+
void (async () => {
|
|
309
|
+
const plan = await planned;
|
|
310
|
+
const locked = await runtime.lockedRooms();
|
|
311
|
+
if (!open)
|
|
227
312
|
return;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
313
|
+
if (plan === null)
|
|
314
|
+
return waiting({ pending: [] });
|
|
315
|
+
const pending = unlocking(plan.rooms, locked);
|
|
316
|
+
if (pending !== null)
|
|
317
|
+
return waiting(pending);
|
|
318
|
+
let first = true;
|
|
319
|
+
const heard = (message) => {
|
|
320
|
+
if (!first) {
|
|
321
|
+
held = digestApplied(held, message);
|
|
322
|
+
deliver(message);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
first = false;
|
|
326
|
+
const change = held === null ? message : changeOf(held, message);
|
|
327
|
+
held = digestOf(message);
|
|
328
|
+
if (change !== null)
|
|
329
|
+
deliver(change);
|
|
330
|
+
};
|
|
331
|
+
stop = runtime.watchPlan({ ...plan, locked }, (message) => {
|
|
332
|
+
if (open)
|
|
333
|
+
heard(message);
|
|
334
|
+
}, (error) => {
|
|
335
|
+
if (open)
|
|
336
|
+
fail(error);
|
|
337
|
+
});
|
|
338
|
+
})().catch((error) => {
|
|
237
339
|
if (open)
|
|
238
|
-
|
|
340
|
+
fail(error);
|
|
239
341
|
});
|
|
240
342
|
return () => {
|
|
241
343
|
open = false;
|
|
@@ -246,7 +348,7 @@ export function narrowed(runtime, given, told) {
|
|
|
246
348
|
if (topic === 'conversation') {
|
|
247
349
|
return following(() => {
|
|
248
350
|
if (conversing(reach))
|
|
249
|
-
return watch(topic, input, deliver);
|
|
351
|
+
return watch(topic, input, deliver, fail);
|
|
250
352
|
deliver(unheldView(input[0]));
|
|
251
353
|
return () => { };
|
|
252
354
|
});
|
|
@@ -254,12 +356,21 @@ export function narrowed(runtime, given, told) {
|
|
|
254
356
|
if (topic === 'conversations' || topic === 'agents') {
|
|
255
357
|
return following(() => {
|
|
256
358
|
if (conversing(reach))
|
|
257
|
-
return watch(topic, input, deliver);
|
|
359
|
+
return watch(topic, input, deliver, fail);
|
|
258
360
|
deliver([]);
|
|
259
361
|
return () => { };
|
|
260
362
|
});
|
|
261
363
|
}
|
|
262
|
-
|
|
364
|
+
if (topic === 'figures' ||
|
|
365
|
+
topic === 'holdings' ||
|
|
366
|
+
topic === 'listed-agents' ||
|
|
367
|
+
topic === 'room-list') {
|
|
368
|
+
if (reach === null)
|
|
369
|
+
return watch(topic, input, deliver, fail);
|
|
370
|
+
fail(deviceUnreached());
|
|
371
|
+
return () => { };
|
|
372
|
+
}
|
|
373
|
+
return watch(topic, input, deliver, fail);
|
|
263
374
|
};
|
|
264
375
|
const files = new Map();
|
|
265
376
|
let handed = 0;
|
|
@@ -277,33 +388,35 @@ export function narrowed(runtime, given, told) {
|
|
|
277
388
|
const view = {
|
|
278
389
|
...md,
|
|
279
390
|
rooms: () => md.rooms().then((rooms) => roomsWithin(reach, rooms)),
|
|
280
|
-
query: ((input) => {
|
|
281
|
-
const plan = runtime
|
|
282
|
-
|
|
391
|
+
query: (async (input) => {
|
|
392
|
+
const plan = await planInReach(runtime, input, reach, false);
|
|
393
|
+
if (plan === null)
|
|
394
|
+
return { pending: [] };
|
|
395
|
+
const locked = await runtime.lockedRooms();
|
|
396
|
+
return unlocking(plan.rooms, locked) ?? runtime.query({ ...plan, locked });
|
|
283
397
|
}),
|
|
284
|
-
search: (input) =>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
types(room) {
|
|
288
|
-
if (holds(reach, room) && runtime.locked(room))
|
|
398
|
+
search: (input) => runtime.search(input, reach),
|
|
399
|
+
async types(room) {
|
|
400
|
+
if (holds(reach, room) && (await runtime.locked(room)))
|
|
289
401
|
throw lockedError(room);
|
|
290
402
|
if (wholly(reach, room))
|
|
291
403
|
return md.types(room);
|
|
292
404
|
if (!holds(reach, room))
|
|
293
405
|
return structuredClone(UNHELD_TYPES);
|
|
294
|
-
return typesWithin(reach, runtime.room(room), md.types(room));
|
|
406
|
+
return typesWithin(reach, await runtime.room(room), await md.types(room));
|
|
295
407
|
},
|
|
296
408
|
async save(room, roomDrafts, writtenBy) {
|
|
297
409
|
if (!holds(reach, room))
|
|
298
410
|
throw unreached(room);
|
|
299
|
-
if (runtime.locked(room))
|
|
411
|
+
if (await runtime.locked(room)) {
|
|
300
412
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
413
|
+
}
|
|
301
414
|
const held = (await Promise.all(roomDrafts.map(({ path }) => md.roomDraft.read(room, path)))).map((draft) => draft?.parts.move);
|
|
302
415
|
const outside = roomDrafts.find(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]));
|
|
303
416
|
if (outside !== undefined) {
|
|
304
417
|
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
305
418
|
}
|
|
306
|
-
if (intoLocked(held))
|
|
419
|
+
if (await intoLocked(held))
|
|
307
420
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
308
421
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
309
422
|
},
|
|
@@ -314,47 +427,48 @@ export function narrowed(runtime, given, told) {
|
|
|
314
427
|
if (filed !== undefined) {
|
|
315
428
|
return { outcome: 'refused', code: ATTACH_REQUIRED, retryable: false, file: filed.path };
|
|
316
429
|
}
|
|
317
|
-
if (runtime.locked(room))
|
|
430
|
+
if (await runtime.locked(room)) {
|
|
318
431
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
432
|
+
}
|
|
319
433
|
const held = parts.map(({ path, parts: one }) => readParts(one, path).move);
|
|
320
434
|
if (parts.some(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]))) {
|
|
321
435
|
throw unreached(room);
|
|
322
436
|
}
|
|
323
|
-
if (intoLocked(held))
|
|
437
|
+
if (await intoLocked(held))
|
|
324
438
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
325
439
|
return savedWithin(reach, room, await md.saveParts(room, parts, writtenBy));
|
|
326
440
|
},
|
|
327
|
-
resolve(room, path, destination) {
|
|
328
|
-
const at = runtime.located(room, path, destination);
|
|
441
|
+
async resolve(room, path, destination) {
|
|
442
|
+
const at = await runtime.located(room, path, destination);
|
|
329
443
|
return at !== null && !covers(reach, at.room, at.path)
|
|
330
|
-
?
|
|
444
|
+
? UNREADABLE
|
|
331
445
|
: md.resolve(room, path, destination);
|
|
332
446
|
},
|
|
333
|
-
history: (room, path, query) => !covers(reach, room, path)
|
|
334
|
-
?
|
|
335
|
-
: runtime.locked(room)
|
|
336
|
-
?
|
|
447
|
+
history: async (room, path, query) => !covers(reach, room, path)
|
|
448
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
449
|
+
: (await runtime.locked(room))
|
|
450
|
+
? lockedRoom(room)
|
|
337
451
|
: md.history(room, path, query),
|
|
338
452
|
binaryFile: {
|
|
339
|
-
read: (room, path, revision) => !covers(reach, room, path)
|
|
340
|
-
?
|
|
341
|
-
: runtime.locked(room)
|
|
342
|
-
?
|
|
453
|
+
read: async (room, path, revision) => !covers(reach, room, path)
|
|
454
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
455
|
+
: (await runtime.locked(room))
|
|
456
|
+
? lockedRoom(room)
|
|
343
457
|
: hand(md.binaryFile.read(room, path, revision)),
|
|
344
|
-
link: (room, path, revision) => !covers(reach, room, path)
|
|
345
|
-
?
|
|
346
|
-
: runtime.locked(room)
|
|
347
|
-
?
|
|
458
|
+
link: async (room, path, revision) => !covers(reach, room, path)
|
|
459
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
460
|
+
: (await runtime.locked(room))
|
|
461
|
+
? lockedRoom(room)
|
|
348
462
|
: md.binaryFile.link(room, path, revision),
|
|
349
|
-
show: (room, path, revision) => !covers(reach, room, path)
|
|
350
|
-
?
|
|
351
|
-
: runtime.locked(room)
|
|
352
|
-
?
|
|
463
|
+
show: async (room, path, revision) => !covers(reach, room, path)
|
|
464
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
465
|
+
: (await runtime.locked(room))
|
|
466
|
+
? lockedRoom(room)
|
|
353
467
|
: hand(md.binaryFile.show(room, path, revision)),
|
|
354
|
-
attach: (room, file) => !wholly(reach, room)
|
|
355
|
-
?
|
|
356
|
-
: runtime.locked(room)
|
|
357
|
-
?
|
|
468
|
+
attach: async (room, file) => !wholly(reach, room)
|
|
469
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
470
|
+
: (await runtime.locked(room))
|
|
471
|
+
? lockedRoom(room)
|
|
358
472
|
: md.binaryFile.attach(room, file),
|
|
359
473
|
async part(file, part) {
|
|
360
474
|
const key = files.get(file);
|
|
@@ -367,42 +481,38 @@ export function narrowed(runtime, given, told) {
|
|
|
367
481
|
},
|
|
368
482
|
},
|
|
369
483
|
reached: async (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
370
|
-
!runtime.locked(room) &&
|
|
484
|
+
!(await runtime.locked(room)) &&
|
|
371
485
|
(await md.reached(room, roomVersion, path)),
|
|
372
|
-
log: () => (reach === null ? md.log() : ''),
|
|
373
486
|
cleanUp: () => (reach === null ? md.cleanUp() : Promise.reject(deviceUnreached())),
|
|
487
|
+
unsent: () => (reach === null ? md.unsent() : Promise.reject(deviceUnreached())),
|
|
488
|
+
sent: () => (reach === null ? md.sent() : Promise.reject(deviceUnreached())),
|
|
489
|
+
reset: () => (reach === null ? md.reset() : Promise.reject(deviceUnreached())),
|
|
490
|
+
readAgain: () => (reach === null ? md.readAgain() : Promise.reject(deviceUnreached())),
|
|
374
491
|
roomDraft: {
|
|
375
|
-
list: () => md.roomDraft.list()
|
|
492
|
+
list: async () => unlocked(draftsWithin(reach, await md.roomDraft.list()), await runtime.lockedRooms()),
|
|
376
493
|
async read(room, path) {
|
|
377
494
|
if (!covers(reach, room, path))
|
|
378
495
|
return null;
|
|
379
|
-
if (runtime.locked(room))
|
|
496
|
+
if (await runtime.locked(room))
|
|
380
497
|
throw lockedError(room);
|
|
381
498
|
return shownDraft(reach, await md.roomDraft.read(room, path));
|
|
382
499
|
},
|
|
383
|
-
write(room, path, revision, parts, next) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
catch (error) {
|
|
396
|
-
return Promise.reject(error);
|
|
397
|
-
}
|
|
398
|
-
return md.roomDraft
|
|
399
|
-
.write(room, path, revision, parts, next)
|
|
400
|
-
.then((written) => writeWithin(reach, written));
|
|
500
|
+
async write(room, path, revision, parts, next) {
|
|
501
|
+
if (reach !== null && carriesFile(parts))
|
|
502
|
+
throw attachRequired();
|
|
503
|
+
const move = readParts(parts, path).move;
|
|
504
|
+
if (!covers(reach, room, path) || !moves(reach, room, move))
|
|
505
|
+
throw unreached(room);
|
|
506
|
+
if (await runtime.locked(room))
|
|
507
|
+
throw lockedError(room);
|
|
508
|
+
if (await intoLocked([move]))
|
|
509
|
+
throw lockedError(move.room);
|
|
510
|
+
return writeWithin(reach, await md.roomDraft.write(room, path, revision, parts, next));
|
|
401
511
|
},
|
|
402
512
|
async discard(room, path, revision) {
|
|
403
513
|
if (!covers(reach, room, path))
|
|
404
514
|
return staleWrite(null);
|
|
405
|
-
if (runtime.locked(room))
|
|
515
|
+
if (await runtime.locked(room))
|
|
406
516
|
throw lockedError(room);
|
|
407
517
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
408
518
|
},
|
|
@@ -412,14 +522,25 @@ export function narrowed(runtime, given, told) {
|
|
|
412
522
|
read: (id, options) => conversation().read(id, options),
|
|
413
523
|
create: (input) => conversation().create(input),
|
|
414
524
|
send: (id, operation, draft) => conversation().send(id, operation, draft),
|
|
415
|
-
answer: (id, answer) => conversation().answer(id, answer),
|
|
416
|
-
interrupt: (id) => conversation().interrupt(id),
|
|
417
|
-
kill: (id) => conversation().kill(id),
|
|
418
|
-
delete: (id) => conversation().delete(id),
|
|
525
|
+
answer: (id, answer, operation) => conversation().answer(id, answer, operation),
|
|
526
|
+
interrupt: (id, operation) => conversation().interrupt(id, operation),
|
|
527
|
+
kill: (id, operation) => conversation().kill(id, operation),
|
|
528
|
+
delete: (id, operation) => conversation().delete(id, operation),
|
|
529
|
+
takeOut: (id, message, operation) => conversation().takeOut(id, message, operation),
|
|
530
|
+
decide: (request, decision, operation) => conversation().decide(request, decision, operation),
|
|
531
|
+
rename: (id, name, operation) => conversation().rename(id, name, operation),
|
|
532
|
+
option: (id, option, value, operation) => conversation().option(id, option, value, operation),
|
|
533
|
+
retry: (id, message, operation) => conversation().retry(id, message, operation),
|
|
534
|
+
pin: (figures) => conversation().pin(figures),
|
|
535
|
+
openTurn: (id, turn) => conversation().openTurn(id, turn),
|
|
536
|
+
dismissSuggestion: (id, suggestion) => conversation().dismissSuggestion(id, suggestion),
|
|
537
|
+
attach: (file) => conversation().attach(file),
|
|
538
|
+
attachment: (link) => conversation().attachment(link),
|
|
419
539
|
},
|
|
420
540
|
chatDraft: {
|
|
421
541
|
write: (id, draft, revision) => chatDraft().write(id, draft, revision),
|
|
422
542
|
prepend: (id, draft) => chatDraft().prepend(id, draft),
|
|
543
|
+
append: (id, draft) => chatDraft().append(id, draft),
|
|
423
544
|
discard: (id) => chatDraft().discard(id),
|
|
424
545
|
},
|
|
425
546
|
observe: observing(within),
|
|
@@ -432,10 +553,5 @@ export function narrowed(runtime, given, told) {
|
|
|
432
553
|
for (const restart of [...open])
|
|
433
554
|
restart();
|
|
434
555
|
},
|
|
435
|
-
facts(next) {
|
|
436
|
-
port = next;
|
|
437
|
-
for (const restart of [...open])
|
|
438
|
-
restart();
|
|
439
|
-
},
|
|
440
556
|
};
|
|
441
557
|
}
|
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
|
|
3
|
-
import type {
|
|
4
|
+
import type { AppRoom } from './listing.js';
|
|
5
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
6
|
+
import type { SavedRoomDraft, SaveResult } from './saves.js';
|
|
7
|
+
import type { ListedAgent, Member, RoomList, 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: 'time-zone'): Observed<string | null>;
|
|
26
34
|
export declare function useObserve(client: Client, topic: 'authority-changes'): Observed<number>;
|
|
27
35
|
export declare function useObserve(client: Client, topic: 'query', query: DocumentQuery): Observed<DocumentResult | PendingResult>;
|
|
28
36
|
export declare function useObserve(client: Client, topic: 'query', query: GroupQuery): Observed<GroupResult | PendingResult>;
|
|
@@ -32,6 +40,13 @@ export declare function useObserve(client: Client, topic: 'presentation'): Obser
|
|
|
32
40
|
export declare function useObserve(client: Client, topic: 'conversation', conversation: string, options: ConversationOptions): Observed<ConversationView>;
|
|
33
41
|
export declare function useObserve(client: Client, topic: 'conversations'): Observed<readonly ConversationEntry[]>;
|
|
34
42
|
export declare function useObserve(client: Client, topic: 'agents'): Observed<readonly ConversationAgent[]>;
|
|
43
|
+
export declare function useObserve(client: Client, topic: 'listed-agents'): Observed<readonly ListedAgent[]>;
|
|
44
|
+
export declare function useObserve(client: Client, topic: 'room-list'): Observed<RoomList | null>;
|
|
45
|
+
export declare function useObserve(client: Client, topic: 'figures'): Observed<FiguresResult>;
|
|
46
|
+
export declare function useObserve(client: Client, topic: 'holdings'): Observed<Holdings>;
|
|
47
|
+
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;
|
|
48
|
+
export type LaneHeld<O> = LaneShown<O> & Pick<Lane<O>, 'run' | 'forget'>;
|
|
49
|
+
export declare function useLane<O>(lanes: Acting<O>): LaneHeld<O>;
|
|
35
50
|
export type Saving = {
|
|
36
51
|
readonly busy: boolean;
|
|
37
52
|
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":"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