@agentshouse/mdruntime-adapter 0.1.0-c240f8024d197 → 0.1.0-c249a3be0107c
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 +11 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +196 -9
- package/dist/adapter.d.ts +0 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +136 -122
- package/dist/authored-path.d.ts +61 -0
- package/dist/authored-path.d.ts.map +1 -0
- package/dist/authored-path.js +166 -0
- package/dist/chunks.d.ts +2 -4
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +72 -38
- package/dist/digest.d.ts +0 -1
- package/dist/discovery.d.ts +26 -8
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +174 -26
- package/dist/history.d.ts +1 -7
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +21 -28
- package/dist/index.d.ts +8 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -8
- package/dist/map.d.ts +0 -1
- package/dist/model.d.ts +5 -6
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +18 -28
- package/dist/read.d.ts +11 -25
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +74 -47
- package/dist/refusal.d.ts +6 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +28 -7
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +20 -0
- package/dist/room-query.d.ts +4 -0
- package/dist/room-query.d.ts.map +1 -0
- package/dist/room-query.js +63 -0
- package/dist/search.d.ts +0 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +4 -4
- 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 +61 -23
- package/dist/space-schema.d.ts +0 -1
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +1 -8
- package/dist/stream.d.ts +4 -5
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +150 -89
- package/dist/transport.d.ts +76 -25
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +47 -10
- 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 +7 -2
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +49 -6
- package/dist/version.d.ts +0 -1
- package/dist/write.d.ts +3 -10
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +90 -110
- package/package.json +4 -3
- 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/house-model.d.ts +0 -672
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -377
- package/dist/room-types.d.ts +0 -7
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -123
package/dist/chunks.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type AdapterFailure, type BootstrapPart, type BootstrapResult } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
3
|
import { type HouseModels, type HouseScope } from './read.js';
|
|
4
|
-
import type { SpaceSchemas } from './space-schema.js';
|
|
5
4
|
import { type HouseDoor, type HouseMode } from './transport.js';
|
|
6
5
|
import { type LogPosition } from './version.js';
|
|
7
6
|
export type ChunkAddress = {
|
|
@@ -25,9 +24,9 @@ type Answered = {
|
|
|
25
24
|
};
|
|
26
25
|
export declare function partId(logEpoch: string, hash: string): string;
|
|
27
26
|
export declare function siteChunkList(answer: Answered, locator: string): Listed;
|
|
28
|
-
export declare function chunkedHead(listed: ChunkedRoom, entry: TrackedAuthority
|
|
27
|
+
export declare function chunkedHead(listed: ChunkedRoom, entry: TrackedAuthority): Promise<BootstrapResult>;
|
|
29
28
|
export declare function chunkPart(body: ReadableStream<Uint8Array> | null, room: ChunkedRoom, id: string, arriving: ((bytes: number) => void) | undefined): Promise<BootstrapResult>;
|
|
30
|
-
export declare function chunkLister(transport: HouseDoor, most: () => number): {
|
|
29
|
+
export declare function chunkLister(transport: HouseDoor, most: () => number, tracked: (locator: string) => TrackedAuthority | undefined): {
|
|
31
30
|
askAll: (entries: readonly TrackedAuthority[]) => void;
|
|
32
31
|
list: (entry: TrackedAuthority) => Promise<Listed>;
|
|
33
32
|
renew(entry: TrackedAuthority, installing: readonly TrackedAuthority[]): Promise<Listed>;
|
|
@@ -35,4 +34,3 @@ export declare function chunkLister(transport: HouseDoor, most: () => number): {
|
|
|
35
34
|
};
|
|
36
35
|
export declare function chunkScope(body: ReadableStream<Uint8Array>, room: ChunkedRoom, arriving: ((bytes: number) => void) | undefined): Promise<HouseScope | null>;
|
|
37
36
|
export {};
|
|
38
|
-
//# sourceMappingURL=chunks.d.ts.map
|
package/dist/chunks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../src/chunks.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,
|
|
1
|
+
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../src/chunks.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,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KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,eAAe,CAAC,CAsB1B;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,EACvC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,GAC9C,OAAO,CAAC,eAAe,CAAC,CAW1B;AAiBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,MAAM,EAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS;sBA0CjC,SAAS,gBAAgB,EAAE;kBA0B/B,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAAC;iBAcxC,gBAAgB,cAAc,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;;EAY3F;AAqCD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,GAC9C,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA4B5B"}
|
package/dist/chunks.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { paced, ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
2
|
import { manifestedModels } from './model.js';
|
|
3
|
-
import { authorityRoot, bootstrapping,
|
|
3
|
+
import { authorityRoot, bootstrapping, documentEntry, } from './read.js';
|
|
4
4
|
import { classifyDoor } from './refusal.js';
|
|
5
|
+
import { failedOn, unusable } from './uncertain.js';
|
|
6
|
+
import { spaceSchemas } from './space-schema.js';
|
|
5
7
|
import { houseDoorRoute } from './transport.js';
|
|
6
8
|
import { readPosition, roomVersion } from './version.js';
|
|
7
9
|
function authorKey(author) {
|
|
@@ -26,27 +28,35 @@ function namesOf(authors) {
|
|
|
26
28
|
}
|
|
27
29
|
return names;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
31
|
+
function schemaText(file, texts) {
|
|
32
|
+
const { space, revision, content } = file;
|
|
33
|
+
if (content !== undefined) {
|
|
34
|
+
if (space !== undefined && revision !== undefined)
|
|
35
|
+
texts.keep(space, revision, content);
|
|
36
|
+
return content;
|
|
37
|
+
}
|
|
38
|
+
return space === undefined || revision === undefined ? undefined : texts.held(space, revision);
|
|
39
|
+
}
|
|
40
|
+
function modelsOf(models, mode, texts) {
|
|
30
41
|
if (!Array.isArray(models))
|
|
31
42
|
return null;
|
|
32
43
|
const files = [];
|
|
33
|
-
const contents = [];
|
|
34
44
|
for (const entry of models) {
|
|
35
|
-
const file =
|
|
36
|
-
|
|
45
|
+
const file = documentEntry(entry, mode);
|
|
46
|
+
const content = file === null ? undefined : schemaText(file, texts);
|
|
47
|
+
if (file === null || content === undefined)
|
|
37
48
|
return null;
|
|
38
|
-
files.push(file);
|
|
39
|
-
contents.push({ path: file.path, content: entry.content });
|
|
49
|
+
files.push({ ...file, content });
|
|
40
50
|
}
|
|
41
|
-
return
|
|
51
|
+
return files;
|
|
42
52
|
}
|
|
43
53
|
export function partId(logEpoch, hash) {
|
|
44
54
|
return `${logEpoch}:${hash}`;
|
|
45
55
|
}
|
|
46
|
-
function chunkedRoom(room, mode) {
|
|
56
|
+
function chunkedRoom(room, mode, texts) {
|
|
47
57
|
const at = readPosition(room);
|
|
48
58
|
const names = mode === 'site' ? new Map() : namesOf(room.authors);
|
|
49
|
-
const models = modelsOf(room.models, mode);
|
|
59
|
+
const models = modelsOf(room.models, mode, texts);
|
|
50
60
|
if (at === null || names === null || models === null || !Array.isArray(room.chunks))
|
|
51
61
|
return null;
|
|
52
62
|
const chunks = new Map();
|
|
@@ -61,7 +71,7 @@ function chunkedRoom(room, mode) {
|
|
|
61
71
|
}
|
|
62
72
|
return { anchor: room.room_ref, ...at, mode, chunks, parts, names, models };
|
|
63
73
|
}
|
|
64
|
-
function listedRoom(room, mode) {
|
|
74
|
+
function listedRoom(room, mode, texts) {
|
|
65
75
|
if (typeof room !== 'object' || room === null)
|
|
66
76
|
return null;
|
|
67
77
|
const held = room;
|
|
@@ -69,23 +79,23 @@ function listedRoom(room, mode) {
|
|
|
69
79
|
return null;
|
|
70
80
|
if (held.ready === false)
|
|
71
81
|
return { kind: 'not-ready' };
|
|
72
|
-
return held.ready === true ? chunkedRoom(held, mode) : null;
|
|
82
|
+
return held.ready === true ? chunkedRoom(held, mode, texts) : null;
|
|
73
83
|
}
|
|
74
84
|
export function siteChunkList(answer, locator) {
|
|
75
85
|
const failure = classifyDoor(answer.status, answer.body, locator);
|
|
76
86
|
if (failure !== null)
|
|
77
87
|
return failure;
|
|
78
|
-
return listedRoom(answer.body, 'site') ??
|
|
88
|
+
return listedRoom(answer.body, 'site', spaceSchemas()) ?? unusable();
|
|
79
89
|
}
|
|
80
|
-
export async function chunkedHead(listed, entry
|
|
90
|
+
export async function chunkedHead(listed, entry) {
|
|
81
91
|
if (listed.anchor !== entry.authority)
|
|
82
|
-
return
|
|
92
|
+
return unusable();
|
|
83
93
|
const models = await manifestedModels({
|
|
84
94
|
anchor: listed.anchor,
|
|
85
95
|
position: listed.position,
|
|
86
96
|
logEpoch: listed.logEpoch,
|
|
87
97
|
models: listed.models,
|
|
88
|
-
}, entry
|
|
98
|
+
}, entry);
|
|
89
99
|
return {
|
|
90
100
|
kind: 'bootstrap',
|
|
91
101
|
roomVersion: roomVersion(listed),
|
|
@@ -93,7 +103,7 @@ export async function chunkedHead(listed, entry, spaces) {
|
|
|
93
103
|
facts: {},
|
|
94
104
|
revisions: {},
|
|
95
105
|
changes: {},
|
|
96
|
-
|
|
106
|
+
attachments: {},
|
|
97
107
|
parts: listed.parts,
|
|
98
108
|
...(models === undefined ? {} : { models }),
|
|
99
109
|
};
|
|
@@ -101,10 +111,16 @@ export async function chunkedHead(listed, entry, spaces) {
|
|
|
101
111
|
export async function chunkPart(body, room, id, arriving) {
|
|
102
112
|
const address = room.chunks.get(id);
|
|
103
113
|
if (body === null || address === undefined)
|
|
104
|
-
return
|
|
105
|
-
|
|
114
|
+
return unusable();
|
|
115
|
+
let scope;
|
|
116
|
+
try {
|
|
117
|
+
scope = await chunkScope(body, room, arriving);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
return failedOn(error);
|
|
121
|
+
}
|
|
106
122
|
if (scope === null)
|
|
107
|
-
return
|
|
123
|
+
return unusable();
|
|
108
124
|
return { ...(await stepped(bootstrapping(scope))), bytes: address.bytes };
|
|
109
125
|
}
|
|
110
126
|
function listedRooms(answer) {
|
|
@@ -112,16 +128,18 @@ function listedRooms(answer) {
|
|
|
112
128
|
if (!Array.isArray(rooms))
|
|
113
129
|
return null;
|
|
114
130
|
const listed = new Map();
|
|
131
|
+
const texts = spaceSchemas();
|
|
115
132
|
for (const room of rooms) {
|
|
116
|
-
const held = listedRoom(room, 'credential');
|
|
133
|
+
const held = listedRoom(room, 'credential', texts);
|
|
117
134
|
if (held === null)
|
|
118
135
|
return null;
|
|
119
136
|
listed.set(room.room_ref, held);
|
|
120
137
|
}
|
|
121
138
|
return listed;
|
|
122
139
|
}
|
|
123
|
-
export function chunkLister(transport, most) {
|
|
140
|
+
export function chunkLister(transport, most, tracked) {
|
|
124
141
|
const asked = new Map();
|
|
142
|
+
const unlisted = new Set();
|
|
125
143
|
function answered(entries, whole) {
|
|
126
144
|
const prefixes = whole ? ['/'] : entries.map((entry) => authorityRoot(entry.handle));
|
|
127
145
|
return transport.door(houseDoorRoute('room-chunks/list'), { prefixes }).then((answer) => {
|
|
@@ -129,8 +147,8 @@ export function chunkLister(transport, most) {
|
|
|
129
147
|
if (failure !== null)
|
|
130
148
|
return failed(entries, failure);
|
|
131
149
|
const listed = listedRooms(answer);
|
|
132
|
-
return listed ?? failed(entries,
|
|
133
|
-
}, () => failed(entries,
|
|
150
|
+
return listed ?? failed(entries, unusable());
|
|
151
|
+
}, (error) => failed(entries, failedOn(error)));
|
|
134
152
|
}
|
|
135
153
|
function failed(entries, failure) {
|
|
136
154
|
return new Map(entries.map((entry) => [
|
|
@@ -153,24 +171,46 @@ export function chunkLister(transport, most) {
|
|
|
153
171
|
asked.set(entry.authority, { entry, listed });
|
|
154
172
|
}
|
|
155
173
|
}
|
|
174
|
+
function current(entry) {
|
|
175
|
+
return asked.get(entry.authority)?.entry.handle === entry.handle;
|
|
176
|
+
}
|
|
177
|
+
function askTogether(entries) {
|
|
178
|
+
askAll([...new Map(entries.map((one) => [one.authority, one])).values()]);
|
|
179
|
+
}
|
|
180
|
+
function waiting() {
|
|
181
|
+
return [...unlisted].flatMap((locator) => {
|
|
182
|
+
const entry = tracked(locator);
|
|
183
|
+
if (entry === undefined)
|
|
184
|
+
unlisted.delete(locator);
|
|
185
|
+
return entry ?? [];
|
|
186
|
+
});
|
|
187
|
+
}
|
|
156
188
|
function list(entry) {
|
|
157
|
-
|
|
189
|
+
if (!current(entry))
|
|
190
|
+
askTogether([...waiting().filter((one) => !current(one)), entry]);
|
|
191
|
+
const { listed } = asked.get(entry.authority);
|
|
158
192
|
asked.delete(entry.authority);
|
|
159
|
-
return
|
|
193
|
+
return listed.then((answer) => {
|
|
194
|
+
if ('kind' in answer)
|
|
195
|
+
unlisted.add(entry.locator);
|
|
196
|
+
else
|
|
197
|
+
unlisted.delete(entry.locator);
|
|
198
|
+
return answer;
|
|
199
|
+
});
|
|
160
200
|
}
|
|
161
201
|
return {
|
|
162
202
|
askAll,
|
|
163
203
|
list,
|
|
164
204
|
renew(entry, installing) {
|
|
165
|
-
if (!
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
askAll([...due.values()]);
|
|
205
|
+
if (!current(entry)) {
|
|
206
|
+
const listed = [...asked.values()].flatMap((held) => tracked(held.entry.locator) ?? []);
|
|
207
|
+
askTogether([...listed, ...waiting(), ...installing, entry]);
|
|
169
208
|
}
|
|
170
209
|
return list(entry);
|
|
171
210
|
},
|
|
172
211
|
forget() {
|
|
173
212
|
asked.clear();
|
|
213
|
+
unlisted.clear();
|
|
174
214
|
},
|
|
175
215
|
};
|
|
176
216
|
}
|
|
@@ -201,20 +241,14 @@ function chunkEntry(line, room, read) {
|
|
|
201
241
|
return false;
|
|
202
242
|
named = { ...entry, author: { ...author, name } };
|
|
203
243
|
}
|
|
204
|
-
const file =
|
|
244
|
+
const file = documentEntry(named, room.mode);
|
|
205
245
|
if (file === null)
|
|
206
246
|
return false;
|
|
207
247
|
read.files.push(file);
|
|
208
|
-
if (typeof entry.content === 'string')
|
|
209
|
-
read.contents.push({ path: file.path, content: entry.content });
|
|
210
248
|
return true;
|
|
211
249
|
}
|
|
212
250
|
export async function chunkScope(body, room, arriving) {
|
|
213
|
-
const read = {
|
|
214
|
-
files: [],
|
|
215
|
-
contents: [],
|
|
216
|
-
folders: [],
|
|
217
|
-
};
|
|
251
|
+
const read = { files: [], folders: [] };
|
|
218
252
|
const reader = body.getReader();
|
|
219
253
|
const decoder = new TextDecoder();
|
|
220
254
|
const pace = paced();
|
package/dist/digest.d.ts
CHANGED
package/dist/discovery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Capability, DiscoveredRoom, Discovery, Member, ProviderLimit, Retention } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { Capability, DiscoveredRoom, Discovery, Member, ProviderLimit, Retention, RoomList } from '@agentshouse/mdruntime';
|
|
2
2
|
import { type LogPosition } from './version.js';
|
|
3
3
|
export declare const PROVIDER_ACTIONS = "provider-actions";
|
|
4
4
|
export type HouseBounds = {
|
|
@@ -7,13 +7,13 @@ export type HouseBounds = {
|
|
|
7
7
|
max_batch_documents: number;
|
|
8
8
|
max_path_length: number;
|
|
9
9
|
max_path_depth: number;
|
|
10
|
-
max_mount_files: number;
|
|
11
|
-
max_mount_bytes: number;
|
|
12
10
|
max_inline_body_bytes: number;
|
|
13
11
|
max_upload_bytes: number;
|
|
14
12
|
max_prefixes: number;
|
|
15
13
|
change_retention_seconds: number;
|
|
16
14
|
max_move_documents?: number;
|
|
15
|
+
max_indexed_fields?: number;
|
|
16
|
+
max_indexed_text_length?: number;
|
|
17
17
|
};
|
|
18
18
|
export type HouseOperations = {
|
|
19
19
|
write: readonly string[];
|
|
@@ -28,19 +28,25 @@ export type HouseAuthority = LogPosition & {
|
|
|
28
28
|
typedSelection: readonly string[] | null;
|
|
29
29
|
managedReplication: 'admitted' | 'unavailable';
|
|
30
30
|
protectedPaths: readonly string[];
|
|
31
|
+
writtenHomes: readonly string[];
|
|
31
32
|
level: HouseAccessLevel;
|
|
32
33
|
operations: HouseOperations;
|
|
33
34
|
};
|
|
34
35
|
export type HouseDiscoveryDocument = {
|
|
35
36
|
member: Member;
|
|
37
|
+
timeZone: string | null;
|
|
36
38
|
bounds: HouseBounds;
|
|
37
39
|
authorities: readonly HouseAuthority[];
|
|
38
40
|
actions: readonly string[];
|
|
41
|
+
roomList: RoomList;
|
|
39
42
|
};
|
|
40
43
|
export type HouseAuthorityChange = {
|
|
41
44
|
member: Member;
|
|
45
|
+
timeZone: string | null;
|
|
42
46
|
authorities: readonly HouseAuthority[];
|
|
47
|
+
listed: readonly string[];
|
|
43
48
|
left: readonly string[];
|
|
49
|
+
roomList: RoomList;
|
|
44
50
|
};
|
|
45
51
|
export type TrackedAuthority = LogPosition & {
|
|
46
52
|
locator: string;
|
|
@@ -54,18 +60,31 @@ export type HouseSiteAuthority = LogPosition & {
|
|
|
54
60
|
roomHandle: string;
|
|
55
61
|
schema: string;
|
|
56
62
|
};
|
|
63
|
+
export type HouseSiteQueried = {
|
|
64
|
+
roomRef: string;
|
|
65
|
+
roomHandle: string;
|
|
66
|
+
};
|
|
57
67
|
export type HouseSiteDiscovery = {
|
|
58
68
|
bounds: HouseBounds;
|
|
59
69
|
authorities: readonly HouseSiteAuthority[];
|
|
70
|
+
queriesOnly: readonly HouseSiteQueried[];
|
|
71
|
+
};
|
|
72
|
+
export declare const ROOM_OWN: {
|
|
73
|
+
readonly room_ref: true;
|
|
74
|
+
readonly room_handle: true;
|
|
75
|
+
readonly name: true;
|
|
76
|
+
readonly position: true;
|
|
77
|
+
readonly created: true;
|
|
78
|
+
readonly archived: true;
|
|
60
79
|
};
|
|
61
|
-
type RoomOwn =
|
|
62
|
-
type Folded<A extends Record<
|
|
80
|
+
type RoomOwn = keyof typeof ROOM_OWN;
|
|
81
|
+
type Folded<A extends Record<'room_ref' | 'room_handle' | 'name' | 'position', unknown>> = {
|
|
63
82
|
readonly shapes: readonly Omit<A, RoomOwn>[];
|
|
64
|
-
readonly rooms: readonly (Pick<A, RoomOwn
|
|
83
|
+
readonly rooms: readonly (Pick<A, Extract<keyof A, RoomOwn>> & {
|
|
65
84
|
readonly shape: number;
|
|
66
85
|
})[];
|
|
67
86
|
};
|
|
68
|
-
export declare function foldedAuthorities<A extends Record<
|
|
87
|
+
export declare function foldedAuthorities<A extends Record<'room_ref' | 'room_handle' | 'name' | 'position', unknown>>(authorities: readonly A[]): Folded<A>;
|
|
69
88
|
export declare function parseDiscovery(body: unknown): HouseDiscoveryDocument | null;
|
|
70
89
|
export declare function parseAuthorityChange(body: unknown): HouseAuthorityChange | null;
|
|
71
90
|
export declare function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null;
|
|
@@ -78,4 +97,3 @@ export declare function siteCapabilities(): readonly Capability[];
|
|
|
78
97
|
export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
|
|
79
98
|
export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
|
|
80
99
|
export {};
|
|
81
|
-
//# sourceMappingURL=discovery.d.ts.map
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAC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