@agentshouse/mdruntime-adapter 0.1.0-c43b33ffa2341 → 0.1.0-c43ed8a091d4d
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 +2 -2
- package/dist/actions.d.ts +6 -49
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +26 -231
- package/dist/adapter.d.ts +0 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +212 -434
- package/dist/authored-path.d.ts +9 -0
- package/dist/authored-path.d.ts.map +1 -0
- package/dist/authored-path.js +34 -0
- package/dist/chunks.d.ts +36 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +281 -0
- package/dist/digest.d.ts +0 -1
- package/dist/discovery.d.ts +42 -12
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +231 -50
- package/dist/history.d.ts +6 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +85 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/map.d.ts +0 -1
- package/dist/model.d.ts +6 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +27 -42
- package/dist/read.d.ts +17 -70
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +70 -351
- package/dist/refusal.d.ts +6 -5
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +27 -11
- package/dist/room-query.d.ts +4 -0
- package/dist/room-query.d.ts.map +1 -0
- package/dist/room-query.js +48 -0
- package/dist/search.d.ts +4 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +47 -0
- package/dist/session-content/check.d.ts +17 -0
- package/dist/session-content/index.d.ts +6 -0
- package/dist/session-content/parts.d.ts +30 -0
- package/dist/session-content/state.d.ts +59 -0
- package/dist/session-content/turn.d.ts +137 -0
- package/dist/site.d.ts +0 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +94 -174
- package/dist/space-schema.d.ts +6 -0
- package/dist/space-schema.d.ts.map +1 -0
- package/dist/space-schema.js +11 -0
- package/dist/stream.d.ts +15 -16
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +242 -426
- package/dist/transport.d.ts +84 -44
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +89 -12
- package/dist/uncertain.d.ts +5 -0
- package/dist/uncertain.d.ts.map +1 -0
- package/dist/uncertain.js +11 -0
- package/dist/upload.d.ts +3 -2
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +10 -8
- package/dist/version.d.ts +0 -1
- package/dist/write.d.ts +6 -3
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +39 -48
- package/package.json +3 -2
- package/dist/app-reference.d.ts +0 -2
- package/dist/app-reference.d.ts.map +0 -1
- package/dist/app-reference.js +0 -2
- package/dist/crockford.d.ts +0 -4
- package/dist/crockford.d.ts.map +0 -1
- package/dist/crockford.js +0 -3
- package/dist/gather.d.ts +0 -4
- package/dist/gather.d.ts.map +0 -1
- package/dist/gather.js +0 -35
- package/dist/house-model.d.ts +0 -2
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -485
- package/dist/part.d.ts +0 -15
- package/dist/part.d.ts.map +0 -1
- package/dist/part.js +0 -82
- package/dist/room-types.d.ts +0 -7
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -125
package/dist/site.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { actionOutcome
|
|
1
|
+
import { HOUSE_ROOM_TYPES, HOUSE_TYPED_PATHS } from '@agentshouse/mdmodel';
|
|
2
|
+
import { actionOutcome } from './actions.js';
|
|
3
|
+
import { chunkedHead, chunkPart, siteChunkList } from './chunks.js';
|
|
3
4
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
|
|
8
|
-
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
5
|
+
import { answeredFailure, discoveryFailure } from './refusal.js';
|
|
6
|
+
import { admittedPath } from './authored-path.js';
|
|
7
|
+
import { siteQuery } from './room-query.js';
|
|
9
8
|
import { houseNotifications } from './stream.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
9
|
+
import { houseSiteRoute, SITE_DOOR_ACTS, SITE_FILES, } from './transport.js';
|
|
10
|
+
import { UNANSWERED, unusable } from './uncertain.js';
|
|
11
|
+
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
13
12
|
function unfound() {
|
|
14
|
-
return { kind: 'rejected', code: '
|
|
13
|
+
return { kind: 'rejected', code: 'not_found', fields: {}, retryable: false };
|
|
15
14
|
}
|
|
16
15
|
function siteRoom(tracked) {
|
|
17
16
|
return {
|
|
@@ -19,174 +18,102 @@ function siteRoom(tracked) {
|
|
|
19
18
|
locator: tracked.locator,
|
|
20
19
|
handle: tracked.handle,
|
|
21
20
|
roomVersion: roomVersion(tracked),
|
|
22
|
-
operations: { write: [],
|
|
21
|
+
operations: { write: [], erase: [] },
|
|
23
22
|
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
23
|
+
typedSelection: null,
|
|
24
24
|
providerOwnedPaths: [],
|
|
25
|
+
authoredPaths: ['**'],
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
export function createSiteAdapter(transport, snapshot = false) {
|
|
28
|
-
const notifications = houseNotifications(transport, 'site'
|
|
29
|
+
const notifications = houseNotifications(transport, 'site', {
|
|
30
|
+
opened: async () => {
|
|
31
|
+
const found = await discovered();
|
|
32
|
+
return found.kind === 'discovery' ? found : null;
|
|
33
|
+
},
|
|
34
|
+
changed: () => null,
|
|
35
|
+
});
|
|
29
36
|
const tracked = new Map();
|
|
30
|
-
const
|
|
37
|
+
const chunked = new Map();
|
|
31
38
|
function fileRoute(request) {
|
|
32
39
|
const entry = tracked.get(request.locator);
|
|
33
40
|
if (entry === undefined)
|
|
34
41
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
35
42
|
return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
|
|
36
43
|
}
|
|
37
|
-
async function
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
],
|
|
47
|
-
});
|
|
48
|
-
const classified = classifyRead(answer.status, answer.body, entry.locator);
|
|
49
|
-
if (classified !== null)
|
|
50
|
-
return classified;
|
|
51
|
-
const found = parseEnumeration(answer.body, 'site');
|
|
52
|
-
if (found === null)
|
|
53
|
-
return UNCERTAIN;
|
|
54
|
-
return viewOf(found, entry) ?? { kind: 'room-not-readable', locator: entry.locator };
|
|
55
|
-
}
|
|
56
|
-
async function enumeration(entry, from) {
|
|
57
|
-
const first = await enumerated(entry, from);
|
|
58
|
-
return 'kind' in first ? first : wholeView(first, (page) => enumerated(entry, from, page));
|
|
44
|
+
async function listedRoom(entry) {
|
|
45
|
+
const past = chunked.get(entry.locator)?.position;
|
|
46
|
+
const listed = siteChunkList(await transport.read(`${houseSiteRoute('chunks')}/${entry.authority}${past === undefined ? '' : `?expired=${past}`}`), entry.locator);
|
|
47
|
+
if ('kind' in listed)
|
|
48
|
+
return listed;
|
|
49
|
+
const head = await chunkedHead(listed, entry);
|
|
50
|
+
if (head.kind === 'bootstrap')
|
|
51
|
+
chunked.set(entry.locator, listed);
|
|
52
|
+
return head;
|
|
59
53
|
}
|
|
60
|
-
async function
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
async function chunkPage(entry, id, arriving) {
|
|
55
|
+
const room = chunked.get(entry.locator);
|
|
56
|
+
const address = room?.chunks.get(id);
|
|
57
|
+
if (room === undefined || address === undefined)
|
|
58
|
+
return UNANSWERED;
|
|
59
|
+
const read = await transport.download(address.url);
|
|
60
|
+
if (read.status !== 200)
|
|
61
|
+
return answeredFailure(read.status, null);
|
|
62
|
+
return chunkPart(read.body, room, id, arriving);
|
|
68
63
|
}
|
|
69
|
-
async function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
return unverifiedPart(entry.locator);
|
|
91
|
-
}
|
|
92
|
-
async function refreshed(entry, fromRoomVersion) {
|
|
93
|
-
const from = logPosition(fromRoomVersion);
|
|
94
|
-
if (from === null)
|
|
95
|
-
return { kind: 'beyond-horizon' };
|
|
96
|
-
const streamed = await stepped(notifications.advance(entry, from));
|
|
97
|
-
if (streamed !== null) {
|
|
98
|
-
const models = await streamedModels(streamed.schemas, entry, 'site');
|
|
99
|
-
return models === undefined ? streamed.page : { ...streamed.page, models };
|
|
100
|
-
}
|
|
101
|
-
const view = await enumeration(entry, from);
|
|
102
|
-
if ('kind' in view)
|
|
103
|
-
return view;
|
|
104
|
-
notifications.reach(entry.authority, view);
|
|
105
|
-
const answer = await refreshFrom(view, fromRoomVersion);
|
|
106
|
-
if (answer.kind !== 'net-advancement')
|
|
107
|
-
return answer;
|
|
108
|
-
const models = await viewModels(view, entry);
|
|
109
|
-
return models === undefined ? answer : { ...answer, models };
|
|
64
|
+
async function discovered() {
|
|
65
|
+
const answer = await transport.read(houseSiteRoute('discover'));
|
|
66
|
+
const failed = discoveryFailure(answer.status, answer.body);
|
|
67
|
+
if (failed !== null)
|
|
68
|
+
return failed;
|
|
69
|
+
const document = parseSiteDiscovery(answer.body);
|
|
70
|
+
if (document === null)
|
|
71
|
+
return unusable();
|
|
72
|
+
const entries = siteTracked(document);
|
|
73
|
+
tracked.clear();
|
|
74
|
+
for (const entry of entries)
|
|
75
|
+
tracked.set(entry.locator, entry);
|
|
76
|
+
notifications.track(entries);
|
|
77
|
+
return {
|
|
78
|
+
...mapDiscovery(document, entries.map(siteRoom), siteCapabilities()),
|
|
79
|
+
queriesOnly: document.queriesOnly.map(({ roomRef, roomHandle }) => ({
|
|
80
|
+
locator: roomRef,
|
|
81
|
+
handle: roomHandle,
|
|
82
|
+
name: roomHandle,
|
|
83
|
+
})),
|
|
84
|
+
};
|
|
110
85
|
}
|
|
111
86
|
return {
|
|
112
87
|
localSaves: true,
|
|
113
|
-
exhaustiveDiscovery: true,
|
|
114
88
|
roomTypes: HOUSE_ROOM_TYPES,
|
|
115
|
-
|
|
89
|
+
typedPaths: HOUSE_TYPED_PATHS,
|
|
90
|
+
pathRule: admittedPath,
|
|
116
91
|
async authorize() {
|
|
117
92
|
return {};
|
|
118
93
|
},
|
|
119
|
-
async discover() {
|
|
120
|
-
const answer = await transport.read(SITE_DOOR_DISCOVER);
|
|
121
|
-
const failed = discoveryFailure(answer.status, answer.body);
|
|
122
|
-
if (failed !== null)
|
|
123
|
-
return failed;
|
|
124
|
-
const document = parseSiteDiscovery(answer.body);
|
|
125
|
-
if (document === null)
|
|
126
|
-
return UNCERTAIN;
|
|
127
|
-
const entries = siteTracked(document);
|
|
128
|
-
tracked.clear();
|
|
129
|
-
for (const entry of entries)
|
|
130
|
-
tracked.set(entry.locator, entry);
|
|
131
|
-
notifications.track(entries);
|
|
132
|
-
return mapDiscovery(document, entries.map(siteRoom), siteCapabilities());
|
|
133
|
-
},
|
|
134
94
|
async bootstrap(_authorization, request) {
|
|
135
95
|
const entry = tracked.get(request.locator);
|
|
136
96
|
if (entry === undefined)
|
|
137
97
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const room = await partedRoom(entry);
|
|
142
|
-
if ('kind' in room)
|
|
143
|
-
return room;
|
|
144
|
-
const { models, seen } = await manifestedModels(room, entry);
|
|
145
|
-
continued = { room, next: 0, seen };
|
|
146
|
-
inventory = partInventory(room);
|
|
147
|
-
if (inventory.parts > 0) {
|
|
148
|
-
return manifested(room, inventory, JSON.stringify(continued), models);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else
|
|
152
|
-
continued = JSON.parse(request.pageToken);
|
|
153
|
-
const listed = continued.room.parts[continued.next];
|
|
154
|
-
const sent = listed === undefined
|
|
155
|
-
? { scope: emptyScope(continued.room), frame: null }
|
|
156
|
-
: await fetchedPart(entry, continued.room, listed, request.received, request.arriving);
|
|
157
|
-
if ('kind' in sent)
|
|
158
|
-
return sent;
|
|
159
|
-
const { scope } = sent;
|
|
160
|
-
notifications.reach(entry.authority, scope);
|
|
161
|
-
const next = continued.next + 1;
|
|
162
|
-
const more = next < continued.room.parts.length;
|
|
163
|
-
const seen = [
|
|
164
|
-
...continued.seen,
|
|
165
|
-
...(scope.files.some((file) => file.path === entry.schema) ? [entry.schema] : []),
|
|
166
|
-
];
|
|
167
|
-
const models = await partModels(scope, entry, new Set(seen), !more);
|
|
168
|
-
const { folders: _folders, ...page } = await stepped(bootstrapping(scope));
|
|
169
|
-
return {
|
|
170
|
-
...page,
|
|
171
|
-
...(models === undefined ? {} : { models }),
|
|
172
|
-
...(more ? { pageToken: JSON.stringify({ ...continued, next, seen }) } : {}),
|
|
173
|
-
...(inventory === undefined ? {} : { inventory }),
|
|
174
|
-
...(sent.frame === null ? {} : { received: sent.frame }),
|
|
175
|
-
};
|
|
98
|
+
return request.pageToken === undefined
|
|
99
|
+
? listedRoom(entry)
|
|
100
|
+
: chunkPage(entry, request.pageToken, request.arriving);
|
|
176
101
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
102
|
+
...(snapshot
|
|
103
|
+
? {
|
|
104
|
+
discover: discovered,
|
|
105
|
+
async refresh(_authorization, request) {
|
|
106
|
+
const entry = tracked.get(request.locator);
|
|
107
|
+
if (entry === undefined)
|
|
108
|
+
return { kind: 'room-not-readable', locator: request.locator };
|
|
109
|
+
if (request.pageToken !== undefined)
|
|
110
|
+
return UNANSWERED;
|
|
111
|
+
return request.fromRoomVersion === roomVersion(entry)
|
|
112
|
+
? { kind: 'still-current' }
|
|
113
|
+
: { kind: 'beyond-horizon' };
|
|
114
|
+
},
|
|
187
115
|
}
|
|
188
|
-
|
|
189
|
-
},
|
|
116
|
+
: {}),
|
|
190
117
|
async mutate() {
|
|
191
118
|
return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {}, retryable: false };
|
|
192
119
|
},
|
|
@@ -196,6 +123,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
196
123
|
async history() {
|
|
197
124
|
return { kind: 'no-history' };
|
|
198
125
|
},
|
|
126
|
+
queryHouse: snapshot ? undefined : (_authorization, request) => siteQuery(transport, request),
|
|
199
127
|
async binary(_authorization, request) {
|
|
200
128
|
const route = fileRoute(request);
|
|
201
129
|
if (typeof route !== 'string')
|
|
@@ -203,11 +131,15 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
203
131
|
const read = await transport.download(route);
|
|
204
132
|
if (read.status === 404)
|
|
205
133
|
return unfound();
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
134
|
+
if (read.status !== 200)
|
|
135
|
+
return answeredFailure(read.status, null);
|
|
136
|
+
if (read.body === null)
|
|
137
|
+
return unusable();
|
|
138
|
+
return { kind: 'binary', body: read.body, mediaType: read.mediaType };
|
|
209
139
|
},
|
|
210
140
|
async link(_authorization, request) {
|
|
141
|
+
if (request.kind === 'key')
|
|
142
|
+
return unfound();
|
|
211
143
|
const route = fileRoute(request);
|
|
212
144
|
if (typeof route !== 'string')
|
|
213
145
|
return route;
|
|
@@ -224,7 +156,10 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
224
156
|
return followsVersion(version, next);
|
|
225
157
|
},
|
|
226
158
|
async action(_authorization, request) {
|
|
227
|
-
|
|
159
|
+
const route = Object.hasOwn(SITE_DOOR_ACTS, request.name)
|
|
160
|
+
? SITE_DOOR_ACTS[request.name]
|
|
161
|
+
: null;
|
|
162
|
+
if (route === null) {
|
|
228
163
|
return {
|
|
229
164
|
kind: 'rejected',
|
|
230
165
|
code: 'action-unimplemented',
|
|
@@ -233,29 +168,14 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
233
168
|
};
|
|
234
169
|
}
|
|
235
170
|
if (!transport.online())
|
|
236
|
-
return
|
|
237
|
-
return actionOutcome(await transport.door(
|
|
171
|
+
return UNANSWERED;
|
|
172
|
+
return actionOutcome(await transport.door(route, request.input), request.name, request.input);
|
|
238
173
|
},
|
|
239
174
|
roomStream: snapshot
|
|
240
175
|
? undefined
|
|
241
176
|
: {
|
|
242
|
-
hold
|
|
243
|
-
notifications.send(rooms.flatMap((room) => {
|
|
244
|
-
const entry = tracked.get(room.locator);
|
|
245
|
-
const at = logPosition(room.roomVersion);
|
|
246
|
-
if (entry === undefined || at === null)
|
|
247
|
-
return [];
|
|
248
|
-
notifications.reach(entry.authority, at);
|
|
249
|
-
return [presented(entry.authority, at)];
|
|
250
|
-
}));
|
|
251
|
-
},
|
|
252
|
-
reopen: notifications.reopen,
|
|
177
|
+
hold: notifications.send,
|
|
253
178
|
observe: notifications.observe,
|
|
254
|
-
published(locator, roomVersion) {
|
|
255
|
-
const at = logPosition(roomVersion);
|
|
256
|
-
if (at !== null)
|
|
257
|
-
notifications.published(locator, at);
|
|
258
|
-
},
|
|
259
179
|
},
|
|
260
180
|
serviceMode: notifications.serviceMode,
|
|
261
181
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type SpaceSchemas = {
|
|
2
|
+
held(space: string, revision: string): string | undefined;
|
|
3
|
+
keep(space: string, revision: string, text: string): void;
|
|
4
|
+
};
|
|
5
|
+
export declare function spaceSchemas(): SpaceSchemas;
|
|
6
|
+
export declare function spaceIdentity(space: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-schema.d.ts","sourceRoot":"","sources":["../src/space-schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF,wBAAgB,YAAY,IAAI,YAAY,CAO3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function spaceSchemas() {
|
|
2
|
+
const texts = new Map();
|
|
3
|
+
const key = (space, revision) => `${space} ${revision}`;
|
|
4
|
+
return {
|
|
5
|
+
held: (space, revision) => texts.get(key(space, revision)),
|
|
6
|
+
keep: (space, revision, text) => void texts.set(key(space, revision), text),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function spaceIdentity(space) {
|
|
10
|
+
return `space:${space}`;
|
|
11
|
+
}
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AuthorityChange, type Discovery, type ConversationStream, type HeldRoom, type RoomStreamEvent, type ServiceModeSignal } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
-
import type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { type HouseDoor, type HouseMode, type HouseStreamFrame } from './transport.js';
|
|
4
|
+
export type HouseOpeningFrame = Extract<HouseStreamFrame, {
|
|
5
|
+
type: 'opening';
|
|
6
|
+
}>;
|
|
7
|
+
export type HouseAuthorityChangedFrame = Extract<HouseStreamFrame, {
|
|
8
|
+
type: 'authority_changed';
|
|
9
|
+
}>;
|
|
10
|
+
export type HouseDiscovering = {
|
|
11
|
+
opened(frame: HouseOpeningFrame | null): Promise<Discovery | null>;
|
|
12
|
+
changed(frame: HouseAuthorityChangedFrame): AuthorityChange | null;
|
|
13
|
+
expired?(entries: readonly TrackedAuthority[]): void;
|
|
9
14
|
};
|
|
10
15
|
export type HouseNotifications = {
|
|
11
16
|
runtime: string;
|
|
12
|
-
observe(notify: (event: RoomStreamEvent) => void
|
|
13
|
-
send(rooms: readonly
|
|
14
|
-
published(locator: string, at: LogPosition): void;
|
|
15
|
-
reopen(): void;
|
|
17
|
+
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
18
|
+
send(rooms: readonly HeldRoom[]): void;
|
|
16
19
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
17
|
-
reach(authority: string, at: LogPosition): void;
|
|
18
|
-
edited(tracked: TrackedAuthority, from: LogPosition): readonly string[];
|
|
19
|
-
advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): Generator<number, StreamedAdvancement | null, void>;
|
|
20
20
|
conversations: ConversationStream;
|
|
21
21
|
serviceMode: ServiceModeSignal;
|
|
22
22
|
};
|
|
23
|
-
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode): HouseNotifications;
|
|
24
|
-
//# sourceMappingURL=stream.d.ts.map
|
|
23
|
+
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode, discovering: HouseDiscovering): HouseNotifications;
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EAEpB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAGb,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYvD,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAGd,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAaxB,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAAC;AAElG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,KAAK,EAAE,0BAA0B,GAAG,eAAe,GAAG,IAAI,CAAC;IACnE,OAAO,CAAC,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IACvC,KAAK,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtD,aAAa,EAAE,kBAAkB,CAAC;IAClC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAyFF,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,gBAAgB,GAC5B,kBAAkB,CAoYpB"}
|