@agentshouse/mdruntime-adapter 0.1.0-cc1bdabaf4e28 → 0.1.0-cc34762b70bb0
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/dist/actions.d.ts +4 -59
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -289
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +134 -327
- package/dist/discovery.d.ts +19 -6
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +63 -30
- package/dist/history.d.ts +12 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +92 -0
- package/dist/house-model.d.ts +718 -1
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +393 -442
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/model.d.ts +2 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -17
- package/dist/part.d.ts +11 -12
- package/dist/part.d.ts.map +1 -1
- package/dist/part.js +63 -55
- package/dist/read.d.ts +10 -58
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +37 -220
- package/dist/refusal.d.ts +0 -3
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +0 -5
- package/dist/room-stream.d.ts +19 -0
- package/dist/room-stream.d.ts.map +1 -0
- package/dist/room-stream.js +57 -0
- package/dist/room-types.d.ts +3 -3
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +8 -7
- package/dist/search.d.ts +5 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +47 -0
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +75 -158
- package/dist/stream.d.ts +13 -14
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +163 -425
- package/dist/transport.d.ts +48 -35
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +54 -11
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +2 -2
- package/dist/write.d.ts +6 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +17 -24
- package/package.json +2 -2
- package/dist/gather.d.ts +0 -4
- package/dist/gather.d.ts.map +0 -1
- package/dist/gather.js +0 -35
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
|
+
export { foldedAuthorities } from './discovery.js';
|
|
2
3
|
export { finishedUpload, houseUpload, type HouseUpload } from './upload.js';
|
|
3
|
-
export {
|
|
4
|
+
export { houseAction, type HouseActDoor } from './actions.js';
|
|
5
|
+
export { HISTORY_PAGE } from './history.js';
|
|
6
|
+
export { houseParts, type ChangeMapping } from './write.js';
|
|
4
7
|
export { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
5
|
-
export { HOUSE_MODEL_TYPES } from './house-model.js';
|
|
8
|
+
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, HOUSE_TYPED_PATHS, type HouseDocumentFields, type HouseModelType, } from './house-model.js';
|
|
6
9
|
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
|
|
7
|
-
export {
|
|
8
|
-
export
|
|
10
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES, INBOX_CHANNEL_KINDS, type InboxChannelKind, } from './room-types.js';
|
|
11
|
+
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, type HouseRuntimeAct, type HouseRuntimeFrame, } from './transport.js';
|
|
12
|
+
export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, HouseClosing, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamed, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter } from './adapter.js';
|
|
2
|
+
export { foldedAuthorities } from './discovery.js';
|
|
2
3
|
export { finishedUpload, houseUpload } from './upload.js';
|
|
3
|
-
export {
|
|
4
|
+
export { houseAction } from './actions.js';
|
|
5
|
+
export { HISTORY_PAGE } from './history.js';
|
|
6
|
+
export { houseParts } from './write.js';
|
|
4
7
|
export { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
5
|
-
export { HOUSE_MODEL_TYPES } from './house-model.js';
|
|
8
|
+
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, HOUSE_TYPED_PATHS, } from './house-model.js';
|
|
6
9
|
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
|
|
7
|
-
export {
|
|
10
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES, INBOX_CHANNEL_KINDS, } from './room-types.js';
|
|
11
|
+
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, } from './transport.js';
|
package/dist/model.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { RoomModels } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type HouseRoomHead, type HouseScope } from './read.js';
|
|
4
4
|
import type { HouseMode, HouseStreamEntry } from './transport.js';
|
|
5
5
|
export declare function partModels(scope: HouseScope, tracked: TrackedAuthority, seen: ReadonlySet<string>, final: boolean): Promise<RoomModels | undefined>;
|
|
6
|
-
export declare function manifestedModels(room:
|
|
6
|
+
export declare function manifestedModels(room: HouseRoomHead, tracked: TrackedAuthority): Promise<{
|
|
7
7
|
readonly models: RoomModels | undefined;
|
|
8
8
|
readonly seen: string[];
|
|
9
9
|
}>;
|
|
10
|
-
export declare function viewModels(view: HouseView, tracked: TrackedAuthority): Promise<RoomModels | undefined>;
|
|
11
10
|
export declare function streamedModels(schemas: ReadonlyMap<string, HouseStreamEntry>, tracked: TrackedAuthority, mode: HouseMode): Promise<RoomModels | undefined>;
|
|
12
11
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAIL,KAAK,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAIL,KAAK,aAAa,EAElB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA0BlE,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAKjC;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAM/E;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC9C,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAWjC"}
|
package/dist/model.js
CHANGED
|
@@ -31,23 +31,6 @@ export async function manifestedModels(room, tracked) {
|
|
|
31
31
|
seen: scope.files.some((file) => file.path === tracked.schema) ? [tracked.schema] : [],
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
export function viewModels(view, tracked) {
|
|
35
|
-
return modelsOf(tracked, (schema) => {
|
|
36
|
-
const change = view.changes.find((candidate) => candidate.path === schema);
|
|
37
|
-
if (change === undefined)
|
|
38
|
-
return undefined;
|
|
39
|
-
if ('removed' in change)
|
|
40
|
-
return ABSENT_SCHEMA;
|
|
41
|
-
if ('content' in change) {
|
|
42
|
-
return {
|
|
43
|
-
schema: change.content,
|
|
44
|
-
version: change.version,
|
|
45
|
-
revision: change.revision ?? null,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
34
|
export function streamedModels(schemas, tracked, mode) {
|
|
52
35
|
return modelsOf(tracked, (schema) => {
|
|
53
36
|
const entry = schemas.get(schema);
|
package/dist/part.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export type RoomFrame = {
|
|
2
|
+
readonly kind: 'frame';
|
|
3
|
+
readonly payload: Uint8Array<ArrayBuffer>;
|
|
4
|
+
readonly bytes: number;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'ended';
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'broken';
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function checkedPayload(frame: Uint8Array<ArrayBuffer>, listed: HousePart): Promise<Uint8Array<ArrayBuffer> | null>;
|
|
10
|
+
export type RoomFrames = () => Promise<RoomFrame>;
|
|
11
|
+
export declare function checkedPayload(frame: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer> | null>;
|
|
12
|
+
export declare function roomFrames(room: ReadableStream<Uint8Array>, arrived?: (bytes: number) => void, signal?: AbortSignal): RoomFrames;
|
|
13
13
|
export declare function gunzipped(payload: Uint8Array<ArrayBuffer>): ReadableStream<string>;
|
|
14
|
-
export declare function unverifiedPart(locator: string): ScopedRefusal;
|
|
15
14
|
//# sourceMappingURL=part.d.ts.map
|
package/dist/part.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"part.d.ts","sourceRoot":"","sources":["../src/part.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"part.d.ts","sourceRoot":"","sources":["../src/part.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7F;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;AAQlD,wBAAsB,cAAc,CAClC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,GAC7B,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CASzC;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,MAAM,CAAC,EAAE,WAAW,GACnB,UAAU,CAwDZ;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAKlF"}
|
package/dist/part.js
CHANGED
|
@@ -1,54 +1,13 @@
|
|
|
1
1
|
const PART_MAGIC = 0x48505431;
|
|
2
2
|
const PART_HEAD_BYTES = 8;
|
|
3
3
|
const PART_DIGEST_BYTES = 32;
|
|
4
|
-
const PART_SHA256 = /^[0-9a-f]{64}$/u;
|
|
5
|
-
export const PART_ATTEMPTS = 3;
|
|
6
|
-
export const PART_UNVERIFIED = 'part_unverified';
|
|
7
|
-
export function parsePart(value) {
|
|
8
|
-
if (typeof value !== 'object' || value === null)
|
|
9
|
-
return null;
|
|
10
|
-
const { part, bytes, sha256 } = value;
|
|
11
|
-
if (typeof part !== 'string' || part.length === 0)
|
|
12
|
-
return null;
|
|
13
|
-
if (typeof bytes !== 'number' || !Number.isSafeInteger(bytes) || bytes <= 0)
|
|
14
|
-
return null;
|
|
15
|
-
if (typeof sha256 !== 'string' || !PART_SHA256.test(sha256))
|
|
16
|
-
return null;
|
|
17
|
-
return { part, bytes, sha256 };
|
|
18
|
-
}
|
|
19
|
-
function decoded(text) {
|
|
20
|
-
let binary;
|
|
21
|
-
try {
|
|
22
|
-
binary = atob(text);
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const bytes = new Uint8Array(binary.length);
|
|
28
|
-
for (let at = 0; at < binary.length; at += 1)
|
|
29
|
-
bytes[at] = binary.charCodeAt(at);
|
|
30
|
-
return bytes;
|
|
31
|
-
}
|
|
32
4
|
function hex(bytes) {
|
|
33
5
|
let text = '';
|
|
34
6
|
for (const byte of bytes)
|
|
35
7
|
text += byte.toString(16).padStart(2, '0');
|
|
36
8
|
return text;
|
|
37
9
|
}
|
|
38
|
-
export function
|
|
39
|
-
if (arriving === undefined)
|
|
40
|
-
return undefined;
|
|
41
|
-
return (answered) => arriving(Math.min(listed.bytes, Math.floor((answered * 3) / 4)));
|
|
42
|
-
}
|
|
43
|
-
export function partFrame(body) {
|
|
44
|
-
if (typeof body !== 'object' || body === null)
|
|
45
|
-
return null;
|
|
46
|
-
const { part } = body;
|
|
47
|
-
return typeof part === 'string' ? decoded(part) : null;
|
|
48
|
-
}
|
|
49
|
-
export async function checkedPayload(frame, listed) {
|
|
50
|
-
if (frame.length !== listed.bytes)
|
|
51
|
-
return null;
|
|
10
|
+
export async function checkedPayload(frame) {
|
|
52
11
|
if (frame.length < PART_HEAD_BYTES + PART_DIGEST_BYTES)
|
|
53
12
|
return null;
|
|
54
13
|
const view = new DataView(frame.buffer, frame.byteOffset, frame.byteLength);
|
|
@@ -59,10 +18,69 @@ export async function checkedPayload(frame, listed) {
|
|
|
59
18
|
return null;
|
|
60
19
|
const payload = frame.subarray(PART_HEAD_BYTES, PART_HEAD_BYTES + length);
|
|
61
20
|
const digest = hex(new Uint8Array(await crypto.subtle.digest('SHA-256', payload)));
|
|
62
|
-
|
|
63
|
-
|
|
21
|
+
return hex(frame.subarray(PART_HEAD_BYTES + length)) === digest ? payload : null;
|
|
22
|
+
}
|
|
23
|
+
export function roomFrames(room, arrived, signal) {
|
|
24
|
+
const reader = room.getReader();
|
|
25
|
+
signal?.addEventListener('abort', () => void reader.cancel().catch(() => { }), { once: true });
|
|
26
|
+
const chunks = [];
|
|
27
|
+
let held = 0;
|
|
28
|
+
let received = 0;
|
|
29
|
+
let ended = false;
|
|
30
|
+
async function filled(bytes) {
|
|
31
|
+
while (held < bytes && !ended) {
|
|
32
|
+
const read = await reader.read();
|
|
33
|
+
if (read.done) {
|
|
34
|
+
ended = true;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
chunks.push(read.value);
|
|
38
|
+
held += read.value.byteLength;
|
|
39
|
+
received += read.value.byteLength;
|
|
40
|
+
arrived?.(received);
|
|
41
|
+
}
|
|
42
|
+
return held >= bytes;
|
|
64
43
|
}
|
|
65
|
-
|
|
44
|
+
function taken(bytes) {
|
|
45
|
+
const out = new Uint8Array(bytes);
|
|
46
|
+
let at = 0;
|
|
47
|
+
while (at < bytes) {
|
|
48
|
+
const chunk = chunks[0];
|
|
49
|
+
const used = Math.min(chunk.byteLength, bytes - at);
|
|
50
|
+
out.set(chunk.subarray(0, used), at);
|
|
51
|
+
at += used;
|
|
52
|
+
if (used === chunk.byteLength)
|
|
53
|
+
chunks.shift();
|
|
54
|
+
else
|
|
55
|
+
chunks[0] = chunk.subarray(used);
|
|
56
|
+
}
|
|
57
|
+
held -= bytes;
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
return async () => {
|
|
61
|
+
try {
|
|
62
|
+
if (!(await filled(PART_HEAD_BYTES)))
|
|
63
|
+
return held === 0 ? { kind: 'ended' } : { kind: 'broken' };
|
|
64
|
+
const head = taken(PART_HEAD_BYTES);
|
|
65
|
+
const view = new DataView(head.buffer);
|
|
66
|
+
if (view.getUint32(0) !== PART_MAGIC)
|
|
67
|
+
return { kind: 'broken' };
|
|
68
|
+
const length = view.getUint32(4);
|
|
69
|
+
const rest = length + PART_DIGEST_BYTES;
|
|
70
|
+
if (!(await filled(rest)))
|
|
71
|
+
return { kind: 'broken' };
|
|
72
|
+
const frame = new Uint8Array(PART_HEAD_BYTES + rest);
|
|
73
|
+
frame.set(head, 0);
|
|
74
|
+
frame.set(taken(rest), PART_HEAD_BYTES);
|
|
75
|
+
const payload = await checkedPayload(frame);
|
|
76
|
+
return payload === null
|
|
77
|
+
? { kind: 'broken' }
|
|
78
|
+
: { kind: 'frame', payload, bytes: frame.byteLength };
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return { kind: 'broken' };
|
|
82
|
+
}
|
|
83
|
+
};
|
|
66
84
|
}
|
|
67
85
|
export function gunzipped(payload) {
|
|
68
86
|
return new Blob([payload])
|
|
@@ -70,13 +88,3 @@ export function gunzipped(payload) {
|
|
|
70
88
|
.pipeThrough(new DecompressionStream('gzip'))
|
|
71
89
|
.pipeThrough(new TextDecoderStream());
|
|
72
90
|
}
|
|
73
|
-
export function unverifiedPart(locator) {
|
|
74
|
-
return {
|
|
75
|
-
kind: 'scoped-refusal',
|
|
76
|
-
locator,
|
|
77
|
-
scope: 'undisclosed',
|
|
78
|
-
code: PART_UNVERIFIED,
|
|
79
|
-
fields: {},
|
|
80
|
-
retryable: true,
|
|
81
|
-
};
|
|
82
|
-
}
|
package/dist/read.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
-
import { type HousePart } from './part.js';
|
|
1
|
+
import { type BinaryFile, type BootstrapPage, type RoomModels, type TransportUncertainty } from '@agentshouse/mdruntime';
|
|
4
2
|
import type { HouseMode } from './transport.js';
|
|
5
3
|
import { type LogPosition } from './version.js';
|
|
6
4
|
export type HeadChange = BootstrapPage['changes'][string];
|
|
@@ -50,14 +48,9 @@ export type HouseModels = {
|
|
|
50
48
|
files: readonly HouseManifestFile[];
|
|
51
49
|
contents: readonly HouseContent[];
|
|
52
50
|
};
|
|
53
|
-
export type
|
|
51
|
+
export type HouseRoomHead = LogPosition & {
|
|
54
52
|
anchor: string;
|
|
55
53
|
models: HouseModels;
|
|
56
|
-
parts: readonly HousePart[];
|
|
57
|
-
};
|
|
58
|
-
export type HouseParted = {
|
|
59
|
-
rooms: readonly HouseRoomParts[];
|
|
60
|
-
next?: string;
|
|
61
54
|
};
|
|
62
55
|
export type HouseGrant = {
|
|
63
56
|
operation: string;
|
|
@@ -69,43 +62,6 @@ export type HouseFileAddress = {
|
|
|
69
62
|
sha256: string;
|
|
70
63
|
mediaType: string;
|
|
71
64
|
};
|
|
72
|
-
export type HouseChange = {
|
|
73
|
-
path: string;
|
|
74
|
-
removed: true;
|
|
75
|
-
} | {
|
|
76
|
-
path: string;
|
|
77
|
-
content: string;
|
|
78
|
-
revision: string | undefined;
|
|
79
|
-
version: string;
|
|
80
|
-
head?: HeadChange;
|
|
81
|
-
} | {
|
|
82
|
-
path: string;
|
|
83
|
-
binary: BinaryFile;
|
|
84
|
-
revision: string | undefined;
|
|
85
|
-
version: string;
|
|
86
|
-
head?: HeadChange;
|
|
87
|
-
};
|
|
88
|
-
export type HousePage = {
|
|
89
|
-
after: string;
|
|
90
|
-
through: string;
|
|
91
|
-
read: number;
|
|
92
|
-
};
|
|
93
|
-
export type HouseFolder = {
|
|
94
|
-
path: string;
|
|
95
|
-
removed: boolean;
|
|
96
|
-
};
|
|
97
|
-
export type HouseView = LogPosition & {
|
|
98
|
-
authority: string;
|
|
99
|
-
changes: readonly HouseChange[];
|
|
100
|
-
folders?: readonly HouseFolder[];
|
|
101
|
-
next?: HousePage;
|
|
102
|
-
};
|
|
103
|
-
type PageFailure = AdapterFailure | {
|
|
104
|
-
kind: 'beyond-horizon';
|
|
105
|
-
};
|
|
106
|
-
export type HouseEnumeration = {
|
|
107
|
-
authorities: readonly HouseView[];
|
|
108
|
-
};
|
|
109
65
|
export declare function authorityRoot(handle: string): string;
|
|
110
66
|
export declare function schemaPath(handle: string, schema: string): string;
|
|
111
67
|
export declare function parseGrant(body: unknown): HouseGrant | null;
|
|
@@ -115,15 +71,14 @@ export declare function headChange(held: {
|
|
|
115
71
|
readonly created_at?: unknown;
|
|
116
72
|
}): HeadChange | undefined | null;
|
|
117
73
|
export declare function binaryFileOf(held: Readonly<Record<string, unknown>>): BinaryFile | undefined | null;
|
|
118
|
-
export declare function
|
|
119
|
-
export declare function
|
|
120
|
-
export declare function
|
|
121
|
-
export declare function
|
|
122
|
-
export declare function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export declare function wholeView(first: HouseView, more: (page: HousePage) => Promise<HouseView | PageFailure>): Promise<HouseView | PageFailure>;
|
|
74
|
+
export declare function roomHead(payload: Uint8Array<ArrayBuffer>, mode: HouseMode): Promise<HouseRoomHead | null>;
|
|
75
|
+
export declare function manifested(room: HouseRoomHead, pageToken: string, models: RoomModels | undefined): BootstrapPage;
|
|
76
|
+
export declare function modelScope(room: HouseRoomHead): HouseScope;
|
|
77
|
+
export declare function emptyScope(room: HouseRoomHead): HouseScope;
|
|
78
|
+
export declare function housePart(room: HouseRoomHead, payload: Uint8Array<ArrayBuffer>, mode: HouseMode): Promise<{
|
|
79
|
+
scope: HouseScope;
|
|
80
|
+
ended: boolean;
|
|
81
|
+
} | TransportUncertainty>;
|
|
127
82
|
export declare function bootstrapping(scope: HouseScope): Generator<number, BootstrapPage, void>;
|
|
128
83
|
export type HouseSchema = {
|
|
129
84
|
schema: string | null;
|
|
@@ -131,7 +86,4 @@ export type HouseSchema = {
|
|
|
131
86
|
revision: string | null;
|
|
132
87
|
};
|
|
133
88
|
export declare function schemaOf(scope: HouseScope, schema: string): HouseSchema | null;
|
|
134
|
-
export declare function viewOf(enumeration: HouseEnumeration, tracked: TrackedAuthority): HouseView | undefined;
|
|
135
|
-
export declare function refreshFrom(view: HouseView, fromRoomVersion: string): Promise<RefreshResult>;
|
|
136
|
-
export {};
|
|
137
89
|
//# sourceMappingURL=read.d.ts.map
|
package/dist/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gB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