@agentshouse/mdruntime-adapter 0.1.0-cd028205a5103 → 0.1.0-cd36fe2bc9d48
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 +298 -225
- package/dist/actions.d.ts +53 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +178 -204
- package/dist/adapter.d.ts +1 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +376 -105
- package/dist/discovery.d.ts +7 -4
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +46 -13
- package/dist/gather.d.ts +2 -1
- package/dist/gather.d.ts.map +1 -1
- package/dist/gather.js +15 -20
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/model.d.ts +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -2
- 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 +72 -20
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +323 -161
- package/dist/refusal.d.ts +2 -5
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +6 -9
- 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 +165 -61
- package/dist/stream.d.ts +5 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +355 -42
- package/dist/transport.d.ts +67 -13
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +3 -0
- 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 +1 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/write.d.ts +14 -9
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +156 -41
- package/package.json +3 -4
- package/dist/links.d.ts +0 -20
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -104
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const INBOX_CHANNEL_KINDS = ['telegram-bot', 'whatsapp', 'messenger', 'instagram'];
|
|
2
|
+
export const INBOX_CHAT_TYPE = 'inbox-chat';
|
|
3
|
+
export const INBOX_MESSAGE_TYPE = 'inbox-message';
|
|
4
|
+
const IDENTITY = "{ type: string, pattern: '^\\S+$' }";
|
|
5
|
+
const AGENT = [' agent: { type: string, format: uuid }', ' name: { type: string }'];
|
|
6
|
+
const ASSIGNEE = [
|
|
7
|
+
' type: object',
|
|
8
|
+
' properties:',
|
|
9
|
+
' user: { type: string, format: uuid }',
|
|
10
|
+
...AGENT,
|
|
11
|
+
];
|
|
12
|
+
export const HOUSE_ROOM_TYPES = [
|
|
13
|
+
`${INBOX_CHAT_TYPE}:`,
|
|
14
|
+
' properties:',
|
|
15
|
+
' inbox: { type: string, format: uuid }',
|
|
16
|
+
` channel: { enum: [${INBOX_CHANNEL_KINDS.join(', ')}] }`,
|
|
17
|
+
` chat: ${IDENTITY}`,
|
|
18
|
+
' customer:',
|
|
19
|
+
' type: object',
|
|
20
|
+
' properties:',
|
|
21
|
+
' name: { type: string }',
|
|
22
|
+
` username: ${IDENTITY}`,
|
|
23
|
+
` phone: ${IDENTITY}`,
|
|
24
|
+
' assignee:',
|
|
25
|
+
...ASSIGNEE,
|
|
26
|
+
' return_to:',
|
|
27
|
+
' type: object',
|
|
28
|
+
' properties:',
|
|
29
|
+
...AGENT,
|
|
30
|
+
' conversation: { type: string, format: uuid }',
|
|
31
|
+
' required: [inbox, channel, chat, customer]',
|
|
32
|
+
`${INBOX_MESSAGE_TYPE}:`,
|
|
33
|
+
' properties:',
|
|
34
|
+
' direction: { enum: [in, out] }',
|
|
35
|
+
' sender:',
|
|
36
|
+
' type: object',
|
|
37
|
+
' properties:',
|
|
38
|
+
' name: { type: string }',
|
|
39
|
+
` username: ${IDENTITY}`,
|
|
40
|
+
' sent_at: { type: string, format: date-time }',
|
|
41
|
+
` channel_message: ${IDENTITY}`,
|
|
42
|
+
' state: { enum: [sending, sent, failed] }',
|
|
43
|
+
' reason: { type: string }',
|
|
44
|
+
' reactions:',
|
|
45
|
+
' type: array',
|
|
46
|
+
' items:',
|
|
47
|
+
' type: object',
|
|
48
|
+
' properties:',
|
|
49
|
+
' reaction: { type: string, minLength: 1 }',
|
|
50
|
+
' sender:',
|
|
51
|
+
' type: object',
|
|
52
|
+
' properties:',
|
|
53
|
+
` id: ${IDENTITY}`,
|
|
54
|
+
' name: { type: string }',
|
|
55
|
+
` username: ${IDENTITY}`,
|
|
56
|
+
' count: { type: integer, minimum: 1 }',
|
|
57
|
+
' required: [reaction]',
|
|
58
|
+
` post: ${IDENTITY}`,
|
|
59
|
+
' assignee:',
|
|
60
|
+
...ASSIGNEE,
|
|
61
|
+
' sent_outside: { const: true }',
|
|
62
|
+
' required: [direction]',
|
|
63
|
+
' if: { properties: { direction: { const: in } } }',
|
|
64
|
+
' then: { required: [sent_at] }',
|
|
65
|
+
'',
|
|
66
|
+
].join('\n');
|
package/dist/site.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Adapter } from '@agentshouse/mdruntime';
|
|
2
2
|
import { type HouseSiteTransport } from './transport.js';
|
|
3
|
-
export declare function createSiteAdapter(transport: HouseSiteTransport): Adapter;
|
|
3
|
+
export declare function createSiteAdapter(transport: HouseSiteTransport, snapshot?: boolean): Adapter;
|
|
4
4
|
//# sourceMappingURL=site.d.ts.map
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAWR,MAAM,wBAAwB,CAAC;AA+BhC,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAoCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAoP1F"}
|
package/dist/site.js
CHANGED
|
@@ -1,79 +1,117 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stepped } from '@agentshouse/mdruntime';
|
|
2
|
+
import { actionOutcome, SITE_SUBMIT } from './actions.js';
|
|
2
3
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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';
|
|
5
7
|
import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
|
|
8
|
+
import { HOUSE_ROOM_TYPES } from './room-types.js';
|
|
6
9
|
import { houseNotifications } from './stream.js';
|
|
7
|
-
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, } from './transport.js';
|
|
10
|
+
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, SITE_FILES, } from './transport.js';
|
|
8
11
|
import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
|
|
9
12
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
13
|
+
function unfound() {
|
|
14
|
+
return { kind: 'rejected', code: 'file_not_found', fields: {}, retryable: false };
|
|
15
|
+
}
|
|
10
16
|
function siteRoom(tracked) {
|
|
11
17
|
return {
|
|
12
18
|
name: tracked.handle,
|
|
13
19
|
locator: tracked.locator,
|
|
14
20
|
handle: tracked.handle,
|
|
15
21
|
roomVersion: roomVersion(tracked),
|
|
16
|
-
operations: {
|
|
17
|
-
replica: { selection: tracked.locator, admission: 'admitted' },
|
|
22
|
+
operations: { write: [], delete: [] },
|
|
23
|
+
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
18
24
|
providerOwnedPaths: [],
|
|
19
25
|
};
|
|
20
26
|
}
|
|
21
|
-
function
|
|
22
|
-
return refused.kind === 'beyond-horizon' ? UNCERTAIN : refused;
|
|
23
|
-
}
|
|
24
|
-
export function createSiteAdapter(transport) {
|
|
27
|
+
export function createSiteAdapter(transport, snapshot = false) {
|
|
25
28
|
const notifications = houseNotifications(transport, 'site');
|
|
26
29
|
const tracked = new Map();
|
|
27
|
-
|
|
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) {
|
|
28
38
|
const answer = await transport.door(SITE_DOOR_ENUMERATE, {
|
|
29
|
-
positions: [
|
|
39
|
+
positions: [
|
|
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
|
+
],
|
|
30
47
|
});
|
|
31
48
|
const classified = classifyRead(answer.status, answer.body, entry.locator);
|
|
32
49
|
if (classified !== null)
|
|
33
50
|
return classified;
|
|
34
|
-
|
|
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 };
|
|
35
55
|
}
|
|
36
|
-
async function
|
|
37
|
-
const
|
|
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));
|
|
59
|
+
}
|
|
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}`}`);
|
|
38
63
|
const classified = classifyDoor(answer.status, answer.body, entry.locator);
|
|
39
64
|
if (classified !== null)
|
|
40
|
-
return
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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);
|
|
53
91
|
}
|
|
54
92
|
async function refreshed(entry, fromRoomVersion) {
|
|
55
93
|
const from = logPosition(fromRoomVersion);
|
|
56
94
|
if (from === null)
|
|
57
95
|
return { kind: 'beyond-horizon' };
|
|
58
|
-
const streamed = notifications.advance(entry, from);
|
|
96
|
+
const streamed = await stepped(notifications.advance(entry, from));
|
|
59
97
|
if (streamed !== null) {
|
|
60
98
|
const models = await streamedModels(streamed.schemas, entry, 'site');
|
|
61
99
|
return models === undefined ? streamed.page : { ...streamed.page, models };
|
|
62
100
|
}
|
|
63
|
-
const
|
|
64
|
-
if ('kind' in
|
|
65
|
-
return
|
|
66
|
-
const view = viewOf(found, entry);
|
|
67
|
-
if (view === undefined)
|
|
68
|
-
return { kind: 'room-not-readable', locator: entry.locator };
|
|
101
|
+
const view = await enumeration(entry, from);
|
|
102
|
+
if ('kind' in view)
|
|
103
|
+
return view;
|
|
69
104
|
notifications.reach(entry.authority, view);
|
|
70
|
-
const answer = refreshFrom(view, fromRoomVersion);
|
|
105
|
+
const answer = await refreshFrom(view, fromRoomVersion);
|
|
71
106
|
if (answer.kind !== 'net-advancement')
|
|
72
107
|
return answer;
|
|
73
108
|
const models = await viewModels(view, entry);
|
|
74
109
|
return models === undefined ? answer : { ...answer, models };
|
|
75
110
|
}
|
|
76
111
|
return {
|
|
112
|
+
localSaves: true,
|
|
113
|
+
exhaustiveDiscovery: true,
|
|
114
|
+
roomTypes: HOUSE_ROOM_TYPES,
|
|
77
115
|
async authorize() {
|
|
78
116
|
return {};
|
|
79
117
|
},
|
|
@@ -96,14 +134,42 @@ export function createSiteAdapter(transport) {
|
|
|
96
134
|
const entry = tracked.get(request.locator);
|
|
97
135
|
if (entry === undefined)
|
|
98
136
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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 }),
|
|
172
|
+
};
|
|
107
173
|
},
|
|
108
174
|
async refresh(_authorization, request) {
|
|
109
175
|
const entry = tracked.get(request.locator);
|
|
@@ -111,14 +177,40 @@ export function createSiteAdapter(transport) {
|
|
|
111
177
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
112
178
|
if (request.pageToken !== undefined)
|
|
113
179
|
return UNCERTAIN;
|
|
180
|
+
if (snapshot) {
|
|
181
|
+
return request.fromRoomVersion === roomVersion(entry)
|
|
182
|
+
? { kind: 'still-current' }
|
|
183
|
+
: { kind: 'beyond-horizon' };
|
|
184
|
+
}
|
|
114
185
|
return refreshed(entry, request.fromRoomVersion);
|
|
115
186
|
},
|
|
116
187
|
async mutate() {
|
|
117
|
-
return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {} };
|
|
188
|
+
return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {}, retryable: false };
|
|
118
189
|
},
|
|
119
190
|
async history() {
|
|
120
191
|
return { kind: 'no-history' };
|
|
121
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;
|
|
203
|
+
},
|
|
204
|
+
async link(_authorization, request) {
|
|
205
|
+
const route = fileRoute(request);
|
|
206
|
+
if (typeof route !== 'string')
|
|
207
|
+
return route;
|
|
208
|
+
return {
|
|
209
|
+
kind: 'link',
|
|
210
|
+
url: route,
|
|
211
|
+
name: request.path.slice(request.path.lastIndexOf('/') + 1),
|
|
212
|
+
};
|
|
213
|
+
},
|
|
122
214
|
reached(locator, version, target) {
|
|
123
215
|
return reachedVersion(version, target, tracked.get(locator)?.logEpoch);
|
|
124
216
|
},
|
|
@@ -126,27 +218,39 @@ export function createSiteAdapter(transport) {
|
|
|
126
218
|
return followsVersion(version, next);
|
|
127
219
|
},
|
|
128
220
|
async action(_authorization, request) {
|
|
129
|
-
if (request.name !==
|
|
130
|
-
return {
|
|
221
|
+
if (request.name !== SITE_SUBMIT) {
|
|
222
|
+
return {
|
|
223
|
+
kind: 'rejected',
|
|
224
|
+
code: 'action-unimplemented',
|
|
225
|
+
fields: { name: request.name },
|
|
226
|
+
retryable: false,
|
|
227
|
+
};
|
|
131
228
|
}
|
|
132
229
|
if (!transport.online())
|
|
133
230
|
return UNCERTAIN;
|
|
134
|
-
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input),
|
|
231
|
+
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITE_SUBMIT);
|
|
135
232
|
},
|
|
136
|
-
roomStream:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
+
},
|
|
146
253
|
},
|
|
147
|
-
reopen: notifications.reopen,
|
|
148
|
-
observe: notifications.observe,
|
|
149
|
-
},
|
|
150
254
|
serviceMode: notifications.serviceMode,
|
|
151
255
|
};
|
|
152
256
|
}
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
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
3
|
import type { HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
|
|
4
4
|
import { type LogPosition } from './version.js';
|
|
5
5
|
export type HeldRevision = (path: string, revision: string) => boolean;
|
|
6
6
|
export type StreamedAdvancement = {
|
|
7
7
|
page: RefreshPage;
|
|
8
|
-
entries: readonly HouseStreamEntry[];
|
|
9
8
|
schemas: ReadonlyMap<string, HouseStreamEntry>;
|
|
10
9
|
};
|
|
11
10
|
export type HouseNotifications = {
|
|
12
11
|
runtime: string;
|
|
13
|
-
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
12
|
+
observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
|
|
14
13
|
send(rooms: readonly HouseHeldRoom[]): void;
|
|
14
|
+
published(locator: string, at: LogPosition): void;
|
|
15
15
|
reopen(): void;
|
|
16
16
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
17
17
|
reach(authority: string, at: LogPosition): void;
|
|
18
|
-
|
|
18
|
+
edited(tracked: TrackedAuthority, from: LogPosition): readonly string[];
|
|
19
|
+
advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): Generator<number, StreamedAdvancement | null, void>;
|
|
19
20
|
conversations: ConversationStream;
|
|
20
21
|
serviceMode: ServiceModeSignal;
|
|
21
22
|
};
|
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.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings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