@agentshouse/mdruntime-adapter 0.1.0-alpha.9 → 0.1.0-c023d3564cb7c
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/AGENTS.md +312 -74
- package/README.md +32 -0
- package/dist/actions.d.ts +57 -13
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +274 -397
- package/dist/adapter.d.ts +1 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +525 -216
- package/dist/digest.js +1 -5
- package/dist/discovery.d.ts +27 -36
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +173 -228
- package/dist/gather.d.ts +4 -0
- package/dist/gather.d.ts.map +1 -0
- package/dist/gather.js +35 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/map.d.ts +2 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +6 -7
- package/dist/model.d.ts +7 -18
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +60 -57
- package/dist/part.d.ts +15 -0
- package/dist/part.d.ts.map +1 -0
- package/dist/part.js +85 -0
- package/dist/read.d.ts +93 -35
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +415 -245
- package/dist/refusal.d.ts +5 -7
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +47 -68
- package/dist/room-types.d.ts +6 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +66 -0
- package/dist/site.d.ts +1 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +219 -161
- package/dist/stream.d.ts +18 -6
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +556 -214
- package/dist/transport.d.ts +131 -38
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +4 -3
- package/dist/upload.d.ts +12 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +52 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +32 -18
- package/dist/write.d.ts +18 -8
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +259 -228
- package/package.json +4 -13
- package/dist/actions.js.map +0 -1
- package/dist/adapter.js.map +0 -1
- package/dist/digest.js.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/map.js.map +0 -1
- package/dist/model.js.map +0 -1
- package/dist/read.js.map +0 -1
- package/dist/refusal.js.map +0 -1
- package/dist/site.js.map +0 -1
- package/dist/stream.js.map +0 -1
- package/dist/transport.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/write.js.map +0 -1
package/dist/site.js
CHANGED
|
@@ -1,198 +1,256 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { stepped } from '@agentshouse/mdruntime';
|
|
2
|
+
import { actionOutcome, SITE_SUBMIT } from './actions.js';
|
|
3
|
+
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
4
|
+
import { partModels, streamedModels, viewModels } from './model.js';
|
|
5
|
+
import { bootstrapping, emptyScope, housePart, manifested, parseEnumeration, parseSiteParted, partInventory, refreshFrom, viewOf, wholeView, } from './read.js';
|
|
6
|
+
import { PART_ATTEMPTS, partArrival, partFrame, unverifiedPart } from './part.js';
|
|
7
|
+
import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
|
|
8
|
+
import { HOUSE_ROOM_TYPES } from './room-types.js';
|
|
5
9
|
import { houseNotifications } from './stream.js';
|
|
6
|
-
import {
|
|
7
|
-
import { logPosition, presented, roomVersion } from './version.js';
|
|
8
|
-
const UNCERTAIN = {
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, SITE_FILES, } from './transport.js';
|
|
11
|
+
import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
|
|
12
|
+
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
13
|
+
function unfound() {
|
|
14
|
+
return { kind: 'rejected', code: 'file_not_found', fields: {}, retryable: false };
|
|
15
|
+
}
|
|
16
|
+
function siteRoom(tracked) {
|
|
13
17
|
return {
|
|
14
|
-
name: tracked.
|
|
18
|
+
name: tracked.handle,
|
|
15
19
|
locator: tracked.locator,
|
|
16
|
-
|
|
20
|
+
handle: tracked.handle,
|
|
17
21
|
roomVersion: roomVersion(tracked),
|
|
18
|
-
operations: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
],
|
|
22
|
-
sync: [
|
|
23
|
-
...read
|
|
24
|
-
],
|
|
25
|
-
write: [],
|
|
26
|
-
delete: []
|
|
27
|
-
},
|
|
28
|
-
replica: {
|
|
29
|
-
selection: tracked.locator,
|
|
30
|
-
admission: 'admitted'
|
|
31
|
-
},
|
|
32
|
-
attachedModel,
|
|
33
|
-
providerOwnedPaths: []
|
|
22
|
+
operations: { write: [], delete: [] },
|
|
23
|
+
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
24
|
+
providerOwnedPaths: [],
|
|
34
25
|
};
|
|
35
26
|
}
|
|
36
|
-
function
|
|
37
|
-
return refused.kind === 'beyond-horizon' ? UNCERTAIN : refused;
|
|
38
|
-
}
|
|
39
|
-
export function createSiteAdapter(transport) {
|
|
27
|
+
export function createSiteAdapter(transport, snapshot = false) {
|
|
40
28
|
const notifications = houseNotifications(transport, 'site');
|
|
41
29
|
const tracked = new Map();
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
const expired = new Map();
|
|
31
|
+
function fileRoute(request) {
|
|
32
|
+
const entry = tracked.get(request.locator);
|
|
33
|
+
if (entry === undefined)
|
|
34
|
+
return { kind: 'room-not-readable', locator: request.locator };
|
|
35
|
+
return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
|
|
36
|
+
}
|
|
37
|
+
async function enumerated(entry, from, page) {
|
|
46
38
|
const answer = await transport.door(SITE_DOOR_ENUMERATE, {
|
|
47
39
|
positions: [
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
page === undefined
|
|
41
|
+
? presented(entry.authority, from)
|
|
42
|
+
: {
|
|
43
|
+
...presented(entry.authority, { position: page.after, logEpoch: from.logEpoch }),
|
|
44
|
+
page: { through: page.through, read: page.read },
|
|
45
|
+
},
|
|
46
|
+
],
|
|
50
47
|
});
|
|
51
|
-
const classified =
|
|
52
|
-
if (classified !== null)
|
|
53
|
-
|
|
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));
|
|
54
59
|
}
|
|
55
|
-
async function
|
|
56
|
-
const
|
|
60
|
+
async function partedRoom(entry) {
|
|
61
|
+
const cut = expired.get(entry.locator);
|
|
62
|
+
const answer = await transport.read(`${SITE_DOOR_BOOTSTRAP}${entry.authority}${cut === undefined ? '' : `?expired=${cut}`}`);
|
|
57
63
|
const classified = classifyDoor(answer.status, answer.body, entry.locator);
|
|
58
|
-
if (classified !== null)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
scope
|
|
81
|
-
|
|
64
|
+
if (classified !== null)
|
|
65
|
+
return classified;
|
|
66
|
+
const room = parseSiteParted(answer.body);
|
|
67
|
+
return room === null || room.anchor !== entry.authority ? UNCERTAIN : room;
|
|
68
|
+
}
|
|
69
|
+
async function fetchedPart(entry, room, listed, received, arriving) {
|
|
70
|
+
if (received !== undefined) {
|
|
71
|
+
const kept = new Uint8Array(received);
|
|
72
|
+
const held = await housePart(room, kept, listed, 'site');
|
|
73
|
+
if (held !== null)
|
|
74
|
+
return 'kind' in held ? held : { scope: held, frame: kept };
|
|
75
|
+
}
|
|
76
|
+
for (let attempt = 0; attempt < PART_ATTEMPTS; attempt += 1) {
|
|
77
|
+
const answer = await transport.read(`${SITE_DOOR_BOOTSTRAP}${entry.authority}?part=${encodeURIComponent(listed.part)}`, partArrival(listed, arriving));
|
|
78
|
+
const failure = classifyRead(answer.status, answer.body, entry.locator);
|
|
79
|
+
if (failure?.kind === 'beyond-horizon')
|
|
80
|
+
expired.set(entry.locator, room.position);
|
|
81
|
+
if (failure !== null)
|
|
82
|
+
return failure;
|
|
83
|
+
const frame = partFrame(answer.body);
|
|
84
|
+
if (frame === null)
|
|
85
|
+
continue;
|
|
86
|
+
const scope = await housePart(room, frame, listed, 'site');
|
|
87
|
+
if (scope !== null)
|
|
88
|
+
return 'kind' in scope ? scope : { scope, frame };
|
|
89
|
+
}
|
|
90
|
+
return unverifiedPart(entry.locator);
|
|
82
91
|
}
|
|
83
92
|
async function refreshed(entry, fromRoomVersion) {
|
|
84
93
|
const from = logPosition(fromRoomVersion);
|
|
85
|
-
if (from === null)
|
|
86
|
-
kind: 'beyond-horizon'
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
roomVersion: roomVersion(held.scope),
|
|
102
|
-
model
|
|
103
|
-
});
|
|
104
|
-
return model;
|
|
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 };
|
|
105
110
|
}
|
|
106
111
|
return {
|
|
107
|
-
|
|
112
|
+
localSaves: true,
|
|
113
|
+
exhaustiveDiscovery: true,
|
|
114
|
+
roomTypes: HOUSE_ROOM_TYPES,
|
|
115
|
+
async authorize() {
|
|
108
116
|
return {};
|
|
109
117
|
},
|
|
110
|
-
async
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const classified = classifyDoor(answer.status, answer.body, PRIVATE_AUTHORITY);
|
|
116
|
-
if (classified !== null) return discoveryFailure(classified);
|
|
118
|
+
async discover() {
|
|
119
|
+
const answer = await transport.read(SITE_DOOR_DISCOVER);
|
|
120
|
+
const failed = discoveryFailure(answer.status, answer.body);
|
|
121
|
+
if (failed !== null)
|
|
122
|
+
return failed;
|
|
117
123
|
const document = parseSiteDiscovery(answer.body);
|
|
118
|
-
if (document === null)
|
|
124
|
+
if (document === null)
|
|
125
|
+
return UNCERTAIN;
|
|
119
126
|
const entries = siteTracked(document);
|
|
120
127
|
tracked.clear();
|
|
121
|
-
for (const entry of entries)
|
|
128
|
+
for (const entry of entries)
|
|
129
|
+
tracked.set(entry.locator, entry);
|
|
122
130
|
notifications.track(entries);
|
|
123
|
-
|
|
124
|
-
for (const authority of [
|
|
125
|
-
...acquired.keys()
|
|
126
|
-
]){
|
|
127
|
-
if (!published.has(authority)) acquired.delete(authority);
|
|
128
|
-
}
|
|
129
|
-
const fresh = new Map();
|
|
130
|
-
const current = new Map();
|
|
131
|
-
for (const entry of entries){
|
|
132
|
-
if (current.has(entry.authority)) continue;
|
|
133
|
-
const kept = acquired.get(entry.authority);
|
|
134
|
-
if (kept !== undefined && kept.roomVersion === roomVersion(entry)) {
|
|
135
|
-
current.set(entry.authority, kept.model);
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
const held = await caughtUp(entry);
|
|
139
|
-
fresh.set(entry.authority, held);
|
|
140
|
-
current.set(entry.authority, await acquire(entry, held));
|
|
141
|
-
}
|
|
142
|
-
caught = fresh;
|
|
143
|
-
const rooms = entries.map((entry)=>{
|
|
144
|
-
const shelved = models.retain(modelKey(entry.locator, 'collection'), current.get(entry.authority));
|
|
145
|
-
return siteRoom(entry, shelved?.identity ?? null);
|
|
146
|
-
});
|
|
147
|
-
models.keep(entries.map((entry)=>entry.locator));
|
|
148
|
-
return mapDiscovery(document, rooms, siteCapabilities());
|
|
131
|
+
return mapDiscovery(document, entries.map(siteRoom), siteCapabilities());
|
|
149
132
|
},
|
|
150
|
-
async bootstrap
|
|
133
|
+
async bootstrap(_authorization, request) {
|
|
151
134
|
const entry = tracked.get(request.locator);
|
|
152
|
-
if (entry === undefined)
|
|
153
|
-
kind: 'room-not-readable',
|
|
154
|
-
|
|
135
|
+
if (entry === undefined)
|
|
136
|
+
return { kind: 'room-not-readable', locator: request.locator };
|
|
137
|
+
let continued;
|
|
138
|
+
let inventory;
|
|
139
|
+
if (request.pageToken === undefined) {
|
|
140
|
+
const room = await partedRoom(entry);
|
|
141
|
+
if ('kind' in room)
|
|
142
|
+
return room;
|
|
143
|
+
continued = { room, next: 0, seen: [] };
|
|
144
|
+
inventory = partInventory(room);
|
|
145
|
+
if (inventory.parts > 0)
|
|
146
|
+
return manifested(room, inventory, JSON.stringify(continued));
|
|
147
|
+
}
|
|
148
|
+
else
|
|
149
|
+
continued = JSON.parse(request.pageToken);
|
|
150
|
+
const listed = continued.room.parts[continued.next];
|
|
151
|
+
const sent = listed === undefined
|
|
152
|
+
? { scope: emptyScope(continued.room), frame: null }
|
|
153
|
+
: await fetchedPart(entry, continued.room, listed, request.received, request.arriving);
|
|
154
|
+
if ('kind' in sent)
|
|
155
|
+
return sent;
|
|
156
|
+
const { scope } = sent;
|
|
157
|
+
notifications.reach(entry.authority, scope);
|
|
158
|
+
const next = continued.next + 1;
|
|
159
|
+
const more = next < continued.room.parts.length;
|
|
160
|
+
const seen = [
|
|
161
|
+
...continued.seen,
|
|
162
|
+
...entry.schemas.filter((schema) => scope.files.some((file) => file.path === schema)),
|
|
163
|
+
];
|
|
164
|
+
const models = await partModels(scope, entry, new Set(seen), !more);
|
|
165
|
+
const { folders: _folders, ...page } = await stepped(bootstrapping(scope));
|
|
166
|
+
return {
|
|
167
|
+
...page,
|
|
168
|
+
...(models === undefined ? {} : { models }),
|
|
169
|
+
...(more ? { pageToken: JSON.stringify({ ...continued, next, seen }) } : {}),
|
|
170
|
+
...(inventory === undefined ? {} : { inventory }),
|
|
171
|
+
...(sent.frame === null ? {} : { received: sent.frame }),
|
|
155
172
|
};
|
|
156
|
-
if (request.pageToken !== undefined) return UNCERTAIN;
|
|
157
|
-
const held = caught.get(entry.authority) ?? await caughtUp(entry);
|
|
158
|
-
if ('failure' in held) return held.failure;
|
|
159
|
-
return bootstrapOf(held.scope, entry);
|
|
160
173
|
},
|
|
161
|
-
async refresh
|
|
174
|
+
async refresh(_authorization, request) {
|
|
162
175
|
const entry = tracked.get(request.locator);
|
|
163
|
-
if (entry === undefined)
|
|
164
|
-
kind: 'room-not-readable',
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
if (entry === undefined)
|
|
177
|
+
return { kind: 'room-not-readable', locator: request.locator };
|
|
178
|
+
if (request.pageToken !== undefined)
|
|
179
|
+
return UNCERTAIN;
|
|
180
|
+
if (snapshot) {
|
|
181
|
+
return request.fromRoomVersion === roomVersion(entry)
|
|
182
|
+
? { kind: 'still-current' }
|
|
183
|
+
: { kind: 'beyond-horizon' };
|
|
184
|
+
}
|
|
185
|
+
return refreshed(entry, request.fromRoomVersion);
|
|
171
186
|
},
|
|
172
|
-
async mutate
|
|
173
|
-
return {
|
|
174
|
-
kind: 'rejected',
|
|
175
|
-
affected: {},
|
|
176
|
-
code: 'write-grant',
|
|
177
|
-
fields: {}
|
|
178
|
-
};
|
|
187
|
+
async mutate() {
|
|
188
|
+
return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {}, retryable: false };
|
|
179
189
|
},
|
|
180
|
-
async history
|
|
181
|
-
return {
|
|
182
|
-
|
|
183
|
-
|
|
190
|
+
async history() {
|
|
191
|
+
return { kind: 'no-history' };
|
|
192
|
+
},
|
|
193
|
+
async binary(_authorization, request) {
|
|
194
|
+
const route = fileRoute(request);
|
|
195
|
+
if (typeof route !== 'string')
|
|
196
|
+
return route;
|
|
197
|
+
const read = await transport.download(route);
|
|
198
|
+
if (read.status === 404)
|
|
199
|
+
return unfound();
|
|
200
|
+
return read.status === 200 && read.body !== null
|
|
201
|
+
? { kind: 'binary', body: read.body, mediaType: read.mediaType }
|
|
202
|
+
: UNCERTAIN;
|
|
184
203
|
},
|
|
185
|
-
async
|
|
204
|
+
async link(_authorization, request) {
|
|
205
|
+
const route = fileRoute(request);
|
|
206
|
+
if (typeof route !== 'string')
|
|
207
|
+
return route;
|
|
186
208
|
return {
|
|
187
|
-
kind: '
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
name: request.name
|
|
191
|
-
}
|
|
209
|
+
kind: 'link',
|
|
210
|
+
url: route,
|
|
211
|
+
name: request.path.slice(request.path.lastIndexOf('/') + 1),
|
|
192
212
|
};
|
|
193
213
|
},
|
|
194
|
-
|
|
214
|
+
reached(locator, version, target) {
|
|
215
|
+
return reachedVersion(version, target, tracked.get(locator)?.logEpoch);
|
|
216
|
+
},
|
|
217
|
+
follows(_locator, version, next) {
|
|
218
|
+
return followsVersion(version, next);
|
|
219
|
+
},
|
|
220
|
+
async action(_authorization, request) {
|
|
221
|
+
if (request.name !== SITE_SUBMIT) {
|
|
222
|
+
return {
|
|
223
|
+
kind: 'rejected',
|
|
224
|
+
code: 'action-unimplemented',
|
|
225
|
+
fields: { name: request.name },
|
|
226
|
+
retryable: false,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (!transport.online())
|
|
230
|
+
return UNCERTAIN;
|
|
231
|
+
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITE_SUBMIT);
|
|
232
|
+
},
|
|
233
|
+
roomStream: snapshot
|
|
234
|
+
? undefined
|
|
235
|
+
: {
|
|
236
|
+
hold(rooms) {
|
|
237
|
+
notifications.send(rooms.flatMap((room) => {
|
|
238
|
+
const entry = tracked.get(room.locator);
|
|
239
|
+
const at = logPosition(room.roomVersion);
|
|
240
|
+
if (entry === undefined || at === null)
|
|
241
|
+
return [];
|
|
242
|
+
notifications.reach(entry.authority, at);
|
|
243
|
+
return [presented(entry.authority, at)];
|
|
244
|
+
}));
|
|
245
|
+
},
|
|
246
|
+
reopen: notifications.reopen,
|
|
247
|
+
observe: notifications.observe,
|
|
248
|
+
published(locator, roomVersion) {
|
|
249
|
+
const at = logPosition(roomVersion);
|
|
250
|
+
if (at !== null)
|
|
251
|
+
notifications.published(locator, at);
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
serviceMode: notifications.serviceMode,
|
|
195
255
|
};
|
|
196
256
|
}
|
|
197
|
-
|
|
198
|
-
//# sourceMappingURL=site.js.map
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConversationStream, type RefreshPage, type RoomStreamEvent, type ServiceModeSignal, type StreamReceipts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
-
import {
|
|
4
|
-
import type { HouseMode } from './transport.js';
|
|
3
|
+
import type { HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
|
|
5
4
|
import { type LogPosition } from './version.js';
|
|
6
|
-
export type
|
|
5
|
+
export type HeldRevision = (path: string, revision: string) => boolean;
|
|
6
|
+
export type StreamedAdvancement = {
|
|
7
|
+
page: RefreshPage;
|
|
8
|
+
schemas: ReadonlyMap<string, HouseStreamEntry>;
|
|
9
|
+
};
|
|
10
|
+
export type HouseNotifications = {
|
|
11
|
+
runtime: string;
|
|
12
|
+
observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
|
|
13
|
+
send(rooms: readonly HouseHeldRoom[]): void;
|
|
14
|
+
published(locator: string, at: LogPosition): void;
|
|
15
|
+
reopen(): void;
|
|
7
16
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
conversations: ConversationStream;
|
|
21
|
+
serviceMode: ServiceModeSignal;
|
|
10
22
|
};
|
|
11
23
|
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode): HouseNotifications;
|
|
12
24
|
//# sourceMappingURL=stream.d.ts.map
|
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,KAAK,
|
|
1
|
+
{"version":3,"file":"stream.d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