@agentshouse/mdruntime-adapter 0.1.0-cdcec0737ac0e → 0.1.0-cde42e60258b9
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 +1 -1
- package/dist/actions.d.ts +2 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +15 -3
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +65 -75
- package/dist/chunks.d.ts +38 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +247 -0
- package/dist/discovery.d.ts +1 -2
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +4 -5
- package/dist/history.js +1 -1
- package/dist/house-model.d.ts +70 -107
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +59 -56
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/model.d.ts +3 -7
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +3 -13
- package/dist/read.d.ts +9 -9
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +24 -143
- package/dist/refusal.d.ts +1 -0
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +4 -0
- package/dist/room-types.d.ts +0 -2
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +2 -5
- package/dist/search.js +1 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +28 -40
- package/dist/stream.d.ts +4 -3
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +79 -14
- package/dist/transport.d.ts +4 -8
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +12 -12
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +3 -5
- package/package.json +2 -2
- package/dist/part.d.ts +0 -14
- package/dist/part.d.ts.map +0 -1
- package/dist/part.js +0 -90
- package/dist/room-stream.d.ts +0 -20
- package/dist/room-stream.d.ts.map +0 -1
- package/dist/room-stream.js +0 -57
package/dist/model.js
CHANGED
|
@@ -23,22 +23,12 @@ async function modelsOf(tracked, read) {
|
|
|
23
23
|
return undefined;
|
|
24
24
|
return { collection: await heldModel(collection, schemaPath(tracked.handle, tracked.schema)) };
|
|
25
25
|
}
|
|
26
|
-
export function partModels(scope, tracked, seen, final) {
|
|
27
|
-
return modelsOf(tracked, (schema) => {
|
|
28
|
-
if (scope.files.some((file) => file.path === schema))
|
|
29
|
-
return schemaOf(scope, schema);
|
|
30
|
-
return final && !seen.has(schema) ? ABSENT_SCHEMA : undefined;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
26
|
export async function manifestedModels(room, tracked, spaces) {
|
|
34
27
|
const scope = modelScope(room);
|
|
35
28
|
const held = schemaOf(scope, tracked.schema);
|
|
36
29
|
if (held?.space !== undefined && held.schema !== null && held.revision !== null)
|
|
37
30
|
spaces.keep(held.space, held.revision, held.schema);
|
|
38
|
-
return
|
|
39
|
-
models: await partModels(scope, tracked, new Set(), true),
|
|
40
|
-
seen: scope.files.some((file) => file.path === tracked.schema) ? [tracked.schema] : [],
|
|
41
|
-
};
|
|
31
|
+
return modelsOf(tracked, (schema) => scope.files.some((file) => file.path === schema) ? schemaOf(scope, schema) : ABSENT_SCHEMA);
|
|
42
32
|
}
|
|
43
33
|
export function keptSpaceSchemas(entries, spaces) {
|
|
44
34
|
for (const entry of entries) {
|
|
@@ -51,11 +41,11 @@ function streamedText(entry, spaces) {
|
|
|
51
41
|
return entry.text;
|
|
52
42
|
return spaces.held(entry.space, entry.revision);
|
|
53
43
|
}
|
|
54
|
-
export function streamedModels(schemas, tracked, mode, spaces) {
|
|
44
|
+
export function streamedModels(schemas, tracked, mode, spaces, whole) {
|
|
55
45
|
return modelsOf(tracked, (schema) => {
|
|
56
46
|
const entry = schemas.get(schema);
|
|
57
47
|
if (entry === undefined)
|
|
58
|
-
return undefined;
|
|
48
|
+
return whole ? ABSENT_SCHEMA : undefined;
|
|
59
49
|
const space = entry.space === undefined ? {} : { space: entry.space };
|
|
60
50
|
if (entry.kind === 'removed')
|
|
61
51
|
return { ...ABSENT_SCHEMA, ...space };
|
package/dist/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BinaryFile, type BootstrapPage, type SavedFacts
|
|
1
|
+
import { type BinaryFile, type BootstrapPage, type SavedFacts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { HouseMode } from './transport.js';
|
|
3
3
|
import { type LogPosition } from './version.js';
|
|
4
4
|
export type HeadChange = BootstrapPage['changes'][string];
|
|
@@ -7,6 +7,7 @@ export type Answered = {
|
|
|
7
7
|
readonly facts: Map<string, SavedFacts>;
|
|
8
8
|
readonly revisions: Map<string, string>;
|
|
9
9
|
readonly fileIds: Map<string, string>;
|
|
10
|
+
readonly created: Map<string, string>;
|
|
10
11
|
readonly changes: Map<string, HeadChange>;
|
|
11
12
|
readonly binaryFiles: Map<string, BinaryFile>;
|
|
12
13
|
readonly removals: Set<string>;
|
|
@@ -22,6 +23,7 @@ export declare function answered(answer: Answered): Generator<number, {
|
|
|
22
23
|
facts: Readonly<Record<string, SavedFacts>>;
|
|
23
24
|
revisions: Readonly<Record<string, string>>;
|
|
24
25
|
fileIds?: Readonly<Record<string, string>>;
|
|
26
|
+
created?: Readonly<Record<string, string>>;
|
|
25
27
|
changes: Readonly<Record<string, HeadChange>>;
|
|
26
28
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
27
29
|
removals: readonly string[];
|
|
@@ -34,6 +36,7 @@ export type HouseManifestFile = {
|
|
|
34
36
|
version: string;
|
|
35
37
|
sha256?: string;
|
|
36
38
|
head?: HeadChange;
|
|
39
|
+
created?: string;
|
|
37
40
|
binary?: BinaryFile;
|
|
38
41
|
facts?: SavedFacts;
|
|
39
42
|
space?: string;
|
|
@@ -72,22 +75,19 @@ export declare function parseGrant(body: unknown): HouseGrant | null;
|
|
|
72
75
|
export declare function parseFileAddress(body: unknown): HouseFileAddress | null;
|
|
73
76
|
export declare function headChange(held: {
|
|
74
77
|
readonly author?: unknown;
|
|
75
|
-
readonly
|
|
78
|
+
readonly changed_at?: unknown;
|
|
76
79
|
}): HeadChange | undefined | null;
|
|
80
|
+
export declare function createdOf(held: {
|
|
81
|
+
readonly created_at?: unknown;
|
|
82
|
+
}): string | undefined | null;
|
|
77
83
|
export declare function binaryFileOf(held: Readonly<Record<string, unknown>>): BinaryFile | undefined | null;
|
|
78
84
|
export declare function carriedFacts(held: Readonly<Record<string, unknown>>): {
|
|
79
85
|
facts?: undefined;
|
|
80
86
|
} | {
|
|
81
87
|
facts: SavedFacts;
|
|
82
88
|
};
|
|
83
|
-
export declare function
|
|
84
|
-
export declare function manifested(room: HouseRoomHead, pageToken: string, models: RoomModels | undefined): BootstrapPage;
|
|
89
|
+
export declare function parseFile(value: unknown, mode: HouseMode): HouseManifestFile | null;
|
|
85
90
|
export declare function modelScope(room: HouseRoomHead): HouseScope;
|
|
86
|
-
export declare function emptyScope(room: HouseRoomHead): HouseScope;
|
|
87
|
-
export declare function housePart(room: HouseRoomHead, payload: Uint8Array<ArrayBuffer>, mode: HouseMode): Promise<{
|
|
88
|
-
scope: HouseScope;
|
|
89
|
-
ended: boolean;
|
|
90
|
-
} | TransportUncertainty>;
|
|
91
91
|
export declare function bootstrapping(scope: HouseScope): Generator<number, BootstrapPage, void>;
|
|
92
92
|
export type HouseSchema = {
|
|
93
93
|
schema: string | null;
|
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,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6B,KAAK,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AAG,SAAS,GAAG,IAAI,CAMhC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAG5F;AAUD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtC,UAAU,GAAG,SAAS,GAAG,IAAI,CAM/B;AAMD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;WACJ,UAAU;EACzE;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,iBAAiB,GAAG,IAAI,CA+BnF;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAQ1D;AAED,wBAAiB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,CAsBxF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAY9E"}
|
package/dist/read.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { readPosition, roomVersion } from './version.js';
|
|
1
|
+
import { patching, ROW_WEIGHT, } from '@agentshouse/mdruntime';
|
|
2
|
+
import { roomVersion } from './version.js';
|
|
4
3
|
const REVISION_FILE = /^fr_([0-9a-z]+)\.[0-9a-z]+\.[0-9a-z]$/u;
|
|
5
4
|
function fileOf(revision) {
|
|
6
5
|
return REVISION_FILE.exec(revision)?.[1];
|
|
@@ -11,6 +10,7 @@ export function answering() {
|
|
|
11
10
|
facts: new Map(),
|
|
12
11
|
revisions: new Map(),
|
|
13
12
|
fileIds: new Map(),
|
|
13
|
+
created: new Map(),
|
|
14
14
|
changes: new Map(),
|
|
15
15
|
binaryFiles: new Map(),
|
|
16
16
|
removals: new Set(),
|
|
@@ -29,6 +29,7 @@ export function forgotten(answer, path) {
|
|
|
29
29
|
answer.facts.delete(path);
|
|
30
30
|
answer.revisions.delete(path);
|
|
31
31
|
answer.fileIds.delete(path);
|
|
32
|
+
answer.created.delete(path);
|
|
32
33
|
answer.changes.delete(path);
|
|
33
34
|
answer.binaryFiles.delete(path);
|
|
34
35
|
answer.removals.delete(path);
|
|
@@ -58,6 +59,7 @@ export function* answered(answer) {
|
|
|
58
59
|
facts: yield* patching({}, answer.facts),
|
|
59
60
|
revisions: yield* patching({}, answer.revisions),
|
|
60
61
|
...(answer.fileIds.size === 0 ? {} : { fileIds: yield* patching({}, answer.fileIds) }),
|
|
62
|
+
...(answer.created.size === 0 ? {} : { created: yield* patching({}, answer.created) }),
|
|
61
63
|
changes: yield* patching({}, answer.changes),
|
|
62
64
|
binaryFiles: yield* patching({}, answer.binaryFiles),
|
|
63
65
|
removals,
|
|
@@ -121,11 +123,19 @@ export function headChange(held) {
|
|
|
121
123
|
const author = held.author === undefined ? null : changeAuthor(held.author);
|
|
122
124
|
if (held.author !== undefined && author === null)
|
|
123
125
|
return null;
|
|
124
|
-
if (held.
|
|
126
|
+
if (held.changed_at === undefined)
|
|
125
127
|
return undefined;
|
|
126
|
-
if (typeof held.
|
|
128
|
+
if (typeof held.changed_at !== 'string')
|
|
127
129
|
return null;
|
|
128
|
-
return { author, time: held.
|
|
130
|
+
return { author, time: held.changed_at };
|
|
131
|
+
}
|
|
132
|
+
export function createdOf(held) {
|
|
133
|
+
if (held.created_at === undefined)
|
|
134
|
+
return undefined;
|
|
135
|
+
return typeof held.created_at === 'string' ? held.created_at : null;
|
|
136
|
+
}
|
|
137
|
+
function createdHeld(created) {
|
|
138
|
+
return created === undefined ? {} : { created };
|
|
129
139
|
}
|
|
130
140
|
function headed(head) {
|
|
131
141
|
return head === undefined ? {} : { head };
|
|
@@ -147,15 +157,16 @@ export function carriedFacts(held) {
|
|
|
147
157
|
function carriedSpace(held) {
|
|
148
158
|
return typeof held.space === 'string' ? { space: held.space } : {};
|
|
149
159
|
}
|
|
150
|
-
function parseFile(value, mode) {
|
|
160
|
+
export function parseFile(value, mode) {
|
|
151
161
|
if (typeof value !== 'object' || value === null)
|
|
152
162
|
return null;
|
|
153
163
|
const file = value;
|
|
154
164
|
if (typeof file.path !== 'string')
|
|
155
165
|
return null;
|
|
156
166
|
const head = headChange(file);
|
|
167
|
+
const created = createdOf(file);
|
|
157
168
|
const binary = binaryFileOf(file);
|
|
158
|
-
if (head === null || binary === null)
|
|
169
|
+
if (head === null || created === null || binary === null)
|
|
159
170
|
return null;
|
|
160
171
|
if (mode === 'site') {
|
|
161
172
|
if (typeof file.sha256 !== 'string')
|
|
@@ -177,153 +188,21 @@ function parseFile(value, mode) {
|
|
|
177
188
|
version: file.revision,
|
|
178
189
|
...(typeof file.sha256 === 'string' ? { sha256: file.sha256 } : {}),
|
|
179
190
|
...headed(head),
|
|
191
|
+
...createdHeld(created),
|
|
180
192
|
...binaried(binary),
|
|
181
193
|
...carriedFacts(file),
|
|
182
194
|
...carriedSpace(file),
|
|
183
195
|
};
|
|
184
196
|
}
|
|
185
|
-
function parseModels(value, mode) {
|
|
186
|
-
if (!Array.isArray(value))
|
|
187
|
-
return null;
|
|
188
|
-
const files = [];
|
|
189
|
-
const contents = [];
|
|
190
|
-
for (const entry of value) {
|
|
191
|
-
const file = parseFile(entry, mode);
|
|
192
|
-
const { content } = entry;
|
|
193
|
-
if (file === null || typeof content !== 'string')
|
|
194
|
-
return null;
|
|
195
|
-
files.push(file);
|
|
196
|
-
contents.push({ path: file.path, content });
|
|
197
|
-
}
|
|
198
|
-
return { files, contents };
|
|
199
|
-
}
|
|
200
|
-
function parseRoomHead(value, mode) {
|
|
201
|
-
if (typeof value !== 'object' || value === null)
|
|
202
|
-
return null;
|
|
203
|
-
const held = value;
|
|
204
|
-
if (typeof held.manifest !== 'object' || held.manifest === null)
|
|
205
|
-
return null;
|
|
206
|
-
const models = parseModels(held.models, mode);
|
|
207
|
-
if (models === null)
|
|
208
|
-
return null;
|
|
209
|
-
const manifest = held.manifest;
|
|
210
|
-
if (manifest.scope !== 'room')
|
|
211
|
-
return null;
|
|
212
|
-
const at = readPosition(manifest);
|
|
213
|
-
if (typeof manifest.anchor !== 'string' || manifest.anchor.length === 0 || at === null)
|
|
214
|
-
return null;
|
|
215
|
-
if (typeof manifest.room_handle !== 'string' || manifest.room_handle.length === 0)
|
|
216
|
-
return null;
|
|
217
|
-
return { anchor: manifest.anchor, ...at, models };
|
|
218
|
-
}
|
|
219
|
-
export async function roomHead(payload, mode) {
|
|
220
|
-
let text = '';
|
|
221
|
-
try {
|
|
222
|
-
for await (const chunk of gunzipped(payload))
|
|
223
|
-
text += chunk;
|
|
224
|
-
return text.endsWith('\n') && text.indexOf('\n') === text.length - 1
|
|
225
|
-
? parseRoomHead(JSON.parse(text), mode)
|
|
226
|
-
: null;
|
|
227
|
-
}
|
|
228
|
-
catch {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
export function manifested(room, pageToken, models) {
|
|
233
|
-
return {
|
|
234
|
-
kind: 'bootstrap',
|
|
235
|
-
roomVersion: roomVersion(room),
|
|
236
|
-
documents: {},
|
|
237
|
-
facts: {},
|
|
238
|
-
revisions: {},
|
|
239
|
-
changes: {},
|
|
240
|
-
binaryFiles: {},
|
|
241
|
-
pageToken,
|
|
242
|
-
...(models === undefined ? {} : { models }),
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
197
|
export function modelScope(room) {
|
|
246
|
-
return { ...emptyScope(room), files: room.models.files, contents: room.models.contents };
|
|
247
|
-
}
|
|
248
|
-
export function emptyScope(room) {
|
|
249
198
|
return {
|
|
250
199
|
anchor: room.anchor,
|
|
251
200
|
position: room.position,
|
|
252
201
|
logEpoch: room.logEpoch,
|
|
253
|
-
files:
|
|
254
|
-
contents:
|
|
202
|
+
files: room.models.files,
|
|
203
|
+
contents: room.models.contents,
|
|
255
204
|
};
|
|
256
205
|
}
|
|
257
|
-
function partLine(line, mode, read) {
|
|
258
|
-
if (read.ended)
|
|
259
|
-
return false;
|
|
260
|
-
let entry;
|
|
261
|
-
try {
|
|
262
|
-
entry = JSON.parse(line);
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
if (endLine(entry)) {
|
|
268
|
-
read.ended = true;
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
if (folderLine(entry)) {
|
|
272
|
-
read.folders.push(entry.folder);
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
const file = parseFile(entry, mode);
|
|
276
|
-
if (file === null)
|
|
277
|
-
return false;
|
|
278
|
-
read.files.push(file);
|
|
279
|
-
const { content } = entry;
|
|
280
|
-
if (typeof content === 'string')
|
|
281
|
-
read.contents.push({ path: file.path, content });
|
|
282
|
-
else if (content !== undefined)
|
|
283
|
-
return false;
|
|
284
|
-
return true;
|
|
285
|
-
}
|
|
286
|
-
async function partRead(chunks, mode) {
|
|
287
|
-
const read = { files: [], contents: [], folders: [], ended: false };
|
|
288
|
-
const pace = paced();
|
|
289
|
-
const unfinished = [];
|
|
290
|
-
for (let chunk = await chunks.read(); chunk.done !== true; chunk = await chunks.read()) {
|
|
291
|
-
const text = chunk.value;
|
|
292
|
-
let start = 0;
|
|
293
|
-
for (let end = text.indexOf('\n'); end !== -1; end = text.indexOf('\n', start)) {
|
|
294
|
-
const piece = text.slice(start, end);
|
|
295
|
-
const line = unfinished.length === 0 ? piece : unfinished.splice(0).join('') + piece;
|
|
296
|
-
if (!partLine(line, mode, read)) {
|
|
297
|
-
await chunks.cancel();
|
|
298
|
-
return null;
|
|
299
|
-
}
|
|
300
|
-
start = end + 1;
|
|
301
|
-
const due = pace(line.length + ROW_WEIGHT);
|
|
302
|
-
if (due instanceof Promise)
|
|
303
|
-
await due;
|
|
304
|
-
}
|
|
305
|
-
if (start < text.length)
|
|
306
|
-
unfinished.push(text.slice(start));
|
|
307
|
-
}
|
|
308
|
-
return unfinished.length === 0 ? read : null;
|
|
309
|
-
}
|
|
310
|
-
function endLine(entry) {
|
|
311
|
-
if (typeof entry !== 'object' || entry === null || !('end' in entry))
|
|
312
|
-
return false;
|
|
313
|
-
return entry.end === true && Object.keys(entry).length === 1;
|
|
314
|
-
}
|
|
315
|
-
function folderLine(entry) {
|
|
316
|
-
if (typeof entry !== 'object' || entry === null || !('folder' in entry))
|
|
317
|
-
return false;
|
|
318
|
-
return typeof entry.folder === 'string' && Object.keys(entry).length === 1;
|
|
319
|
-
}
|
|
320
|
-
export async function housePart(room, payload, mode) {
|
|
321
|
-
const read = await partRead(gunzipped(payload).getReader(), mode).catch(() => null);
|
|
322
|
-
if (read === null)
|
|
323
|
-
return { kind: 'transport-uncertainty' };
|
|
324
|
-
const { ended, ...scope } = read;
|
|
325
|
-
return { scope: { ...emptyScope(room), ...scope }, ended };
|
|
326
|
-
}
|
|
327
206
|
export function* bootstrapping(scope) {
|
|
328
207
|
const contents = new Map();
|
|
329
208
|
for (const entry of scope.contents) {
|
|
@@ -337,6 +216,8 @@ export function* bootstrapping(scope) {
|
|
|
337
216
|
continue;
|
|
338
217
|
if (file.head !== undefined)
|
|
339
218
|
answer.changes.set(file.path, file.head);
|
|
219
|
+
if (file.created !== undefined)
|
|
220
|
+
answer.created.set(file.path, file.created);
|
|
340
221
|
const content = contents.get(file.path);
|
|
341
222
|
if (file.binary !== undefined)
|
|
342
223
|
answer.binaryFiles.set(file.path, file.binary);
|
package/dist/refusal.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AdapterFailure, DiscoverResult, ProviderRefusal, ScopedRefusal } from '@agentshouse/mdruntime';
|
|
2
2
|
export declare function doorRefusal(body: unknown): ProviderRefusal | null;
|
|
3
|
+
export declare function resetOf(refusal: ProviderRefusal | null): string | undefined;
|
|
3
4
|
export declare function scopedRefusal(locator: string, scope: ScopedRefusal['scope'], refusal: ProviderRefusal): ScopedRefusal;
|
|
4
5
|
export declare function classifyDoor(status: number, body: unknown, locator: string): AdapterFailure | null;
|
|
5
6
|
export declare function discoveryFailure(status: number, body: unknown): DiscoverResult | null;
|
package/dist/refusal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../src/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAOjE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,eAAe,GACvB,aAAa,CAEf;AAqBD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,cAAc,GAAG,IAAI,CAMvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAQrF"}
|
|
1
|
+
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../src/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAOjE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAG3E;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,eAAe,GACvB,aAAa,CAEf;AAqBD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,cAAc,GAAG,IAAI,CAMvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAQrF"}
|
package/dist/refusal.js
CHANGED
|
@@ -9,6 +9,10 @@ export function doorRefusal(body) {
|
|
|
9
9
|
const { code, retryable, ...fields } = error;
|
|
10
10
|
return { code, fields, retryable: retryable === true };
|
|
11
11
|
}
|
|
12
|
+
export function resetOf(refusal) {
|
|
13
|
+
const reset = refusal?.fields.retry_at;
|
|
14
|
+
return refusal?.retryable === true && typeof reset === 'string' ? reset : undefined;
|
|
15
|
+
}
|
|
12
16
|
export function scopedRefusal(locator, scope, refusal) {
|
|
13
17
|
return { kind: 'scoped-refusal', locator, scope, ...refusal };
|
|
14
18
|
}
|
package/dist/room-types.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare const INBOX_CHANNEL_KINDS: readonly ['telegram-bot', 'telegram-business', 'whatsapp', 'messenger', 'instagram', 'viber', 'tiktok'];
|
|
2
2
|
export type InboxChannelKind = (typeof INBOX_CHANNEL_KINDS)[number];
|
|
3
|
-
export declare const CHAT_TYPE = "chat";
|
|
4
|
-
export declare const CHAT_MESSAGE_TYPE = "chat-message";
|
|
5
3
|
export declare const HOUSE_NAMEABLE_ROOM_TYPES: string[];
|
|
6
4
|
export declare const HOUSE_ROOM_TYPES: string;
|
|
7
5
|
//# sourceMappingURL=room-types.d.ts.map
|
package/dist/room-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB,UAAiC,CAAC;AAyBxE,eAAO,MAAM,gBAAgB,QAyFjB,CAAC"}
|
package/dist/room-types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHAT_MESSAGE_TYPE, CHAT_TYPE } from '@agentshouse/mdruntime';
|
|
1
2
|
import { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
2
3
|
import { HOUSE_MODEL_TYPES } from './house-model.js';
|
|
3
4
|
export const INBOX_CHANNEL_KINDS = [
|
|
@@ -9,8 +10,6 @@ export const INBOX_CHANNEL_KINDS = [
|
|
|
9
10
|
'viber',
|
|
10
11
|
'tiktok',
|
|
11
12
|
];
|
|
12
|
-
export const CHAT_TYPE = 'chat';
|
|
13
|
-
export const CHAT_MESSAGE_TYPE = 'chat-message';
|
|
14
13
|
export const HOUSE_NAMEABLE_ROOM_TYPES = [CHAT_TYPE, CHAT_MESSAGE_TYPE];
|
|
15
14
|
const WAYFINDING_MAP_TYPE = 'wayfinding-map';
|
|
16
15
|
const WAYFINDING_TICKET_TYPE = 'wayfinding-ticket';
|
|
@@ -52,9 +51,7 @@ export const HOUSE_ROOM_TYPES = [
|
|
|
52
51
|
' properties:',
|
|
53
52
|
' direction: { enum: [in, out] }',
|
|
54
53
|
' sender:',
|
|
55
|
-
|
|
56
|
-
' properties:',
|
|
57
|
-
' name: { type: string }',
|
|
54
|
+
...ASSIGNEE,
|
|
58
55
|
` username: ${IDENTITY}`,
|
|
59
56
|
' sent_at: { type: string, format: date-time }',
|
|
60
57
|
` channel_message: ${IDENTITY}`,
|
package/dist/search.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function houseSearch(transport, tracked, request) {
|
|
|
27
27
|
: tracked.filter((entry) => request.rooms.includes(entry.locator));
|
|
28
28
|
if (named !== null && named.length === 0)
|
|
29
29
|
return { kind: 'found', documents: [] };
|
|
30
|
-
const answer = await transport.door(houseDoorRoute('search'), {
|
|
30
|
+
const answer = await transport.door(houseDoorRoute('rooms/search'), {
|
|
31
31
|
query: request.text,
|
|
32
32
|
...(named === null ? {} : { paths: named.map((entry) => `${ROOMS}${entry.handle}`) }),
|
|
33
33
|
});
|
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,EAQR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,wBAAwB,CAAC;AAehC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAuBxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAiK1F"}
|
package/dist/site.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { stepped } from '@agentshouse/mdruntime';
|
|
2
1
|
import { actionOutcome } from './actions.js';
|
|
2
|
+
import { chunkedHead, chunkPart, siteChunkList } from './chunks.js';
|
|
3
3
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
4
|
-
import { bootstrapping } from './read.js';
|
|
5
|
-
import { roomStreams } from './room-stream.js';
|
|
6
4
|
import { spaceSchemas } from './space-schema.js';
|
|
7
|
-
import {
|
|
5
|
+
import { discoveryFailure } from './refusal.js';
|
|
8
6
|
import { HOUSE_TYPED_PATHS } from './house-model.js';
|
|
9
7
|
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
10
8
|
import { houseNotifications } from './stream.js';
|
|
11
|
-
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES,
|
|
12
|
-
import { followsVersion,
|
|
9
|
+
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES, SITES_SUBMISSIONS_CREATE, } from './transport.js';
|
|
10
|
+
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
13
11
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
14
12
|
function unfound() {
|
|
15
13
|
return { kind: 'rejected', code: 'file_not_found', fields: {}, retryable: false };
|
|
@@ -20,7 +18,7 @@ function siteRoom(tracked) {
|
|
|
20
18
|
locator: tracked.locator,
|
|
21
19
|
handle: tracked.handle,
|
|
22
20
|
roomVersion: roomVersion(tracked),
|
|
23
|
-
operations: { write: [],
|
|
21
|
+
operations: { write: [], erase: [] },
|
|
24
22
|
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
25
23
|
providerOwnedPaths: [],
|
|
26
24
|
};
|
|
@@ -35,36 +33,32 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
35
33
|
changed: () => null,
|
|
36
34
|
}, spaces);
|
|
37
35
|
const tracked = new Map();
|
|
38
|
-
const
|
|
39
|
-
const rooms = roomStreams('site', spaces);
|
|
36
|
+
const chunked = new Map();
|
|
40
37
|
function fileRoute(request) {
|
|
41
38
|
const entry = tracked.get(request.locator);
|
|
42
39
|
if (entry === undefined)
|
|
43
40
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
44
41
|
return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
|
|
45
42
|
}
|
|
46
|
-
async function
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
51
|
-
const head = await
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
read.set(entry.locator, at.position);
|
|
43
|
+
async function listedRoom(entry) {
|
|
44
|
+
const past = chunked.get(entry.locator)?.position;
|
|
45
|
+
const listed = siteChunkList(await transport.read(`${houseSiteRoute('chunks')}/${entry.authority}${past === undefined ? '' : `?expired=${past}`}`), entry.locator);
|
|
46
|
+
if ('kind' in listed)
|
|
47
|
+
return listed;
|
|
48
|
+
const head = await chunkedHead(listed, entry, spaces);
|
|
49
|
+
if (head.kind === 'bootstrap')
|
|
50
|
+
chunked.set(entry.locator, listed);
|
|
55
51
|
return head;
|
|
56
52
|
}
|
|
57
|
-
async function
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
bytes: part.bytes,
|
|
67
|
-
};
|
|
53
|
+
async function chunkPage(entry, id, arriving) {
|
|
54
|
+
const room = chunked.get(entry.locator);
|
|
55
|
+
const address = room?.chunks.get(id);
|
|
56
|
+
if (room === undefined || address === undefined)
|
|
57
|
+
return UNCERTAIN;
|
|
58
|
+
const read = await transport.download(address.url);
|
|
59
|
+
if (read.status !== 200)
|
|
60
|
+
return UNCERTAIN;
|
|
61
|
+
return chunkPart(read.body, room, id, arriving);
|
|
68
62
|
}
|
|
69
63
|
async function discovered() {
|
|
70
64
|
const answer = await transport.read(houseSiteRoute('discover'));
|
|
@@ -94,8 +88,8 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
94
88
|
if (entry === undefined)
|
|
95
89
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
96
90
|
return request.pageToken === undefined
|
|
97
|
-
?
|
|
98
|
-
:
|
|
91
|
+
? listedRoom(entry)
|
|
92
|
+
: chunkPage(entry, request.pageToken, request.arriving);
|
|
99
93
|
},
|
|
100
94
|
...(snapshot
|
|
101
95
|
? {
|
|
@@ -149,7 +143,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
149
143
|
return followsVersion(version, next);
|
|
150
144
|
},
|
|
151
145
|
async action(_authorization, request) {
|
|
152
|
-
if (request.name !==
|
|
146
|
+
if (request.name !== SITES_SUBMISSIONS_CREATE) {
|
|
153
147
|
return {
|
|
154
148
|
kind: 'rejected',
|
|
155
149
|
code: 'action-unimplemented',
|
|
@@ -159,18 +153,12 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
159
153
|
}
|
|
160
154
|
if (!transport.online())
|
|
161
155
|
return UNCERTAIN;
|
|
162
|
-
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input),
|
|
156
|
+
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITES_SUBMISSIONS_CREATE, request.input);
|
|
163
157
|
},
|
|
164
158
|
roomStream: snapshot
|
|
165
159
|
? undefined
|
|
166
160
|
: {
|
|
167
|
-
hold
|
|
168
|
-
notifications.send(rooms.flatMap((room) => {
|
|
169
|
-
const entry = tracked.get(room.locator);
|
|
170
|
-
const at = logPosition(room.roomVersion);
|
|
171
|
-
return entry === undefined || at === null ? [] : [presented(entry.authority, at)];
|
|
172
|
-
}));
|
|
173
|
-
},
|
|
161
|
+
hold: notifications.send,
|
|
174
162
|
observe: notifications.observe,
|
|
175
163
|
},
|
|
176
164
|
serviceMode: notifications.serviceMode,
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type AuthorityChange, type Discovery, type ConversationStream, type RoomStreamEvent, type ServiceModeSignal } from '@agentshouse/mdruntime';
|
|
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
3
|
import type { SpaceSchemas } from './space-schema.js';
|
|
4
|
-
import { type HouseDoor, type
|
|
4
|
+
import { type HouseDoor, type HouseMode, type HouseStreamFrame } from './transport.js';
|
|
5
5
|
export type HouseOpeningFrame = Extract<HouseStreamFrame, {
|
|
6
6
|
type: 'opening';
|
|
7
7
|
}>;
|
|
@@ -11,11 +11,12 @@ export type HouseAuthorityChangedFrame = Extract<HouseStreamFrame, {
|
|
|
11
11
|
export type HouseDiscovering = {
|
|
12
12
|
opened(frame: HouseOpeningFrame | null): Promise<Discovery | null>;
|
|
13
13
|
changed(frame: HouseAuthorityChangedFrame): AuthorityChange | null;
|
|
14
|
+
expired?(authorities: readonly string[]): void;
|
|
14
15
|
};
|
|
15
16
|
export type HouseNotifications = {
|
|
16
17
|
runtime: string;
|
|
17
18
|
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
18
|
-
send(rooms: readonly
|
|
19
|
+
send(rooms: readonly HeldRoom[]): void;
|
|
19
20
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
20
21
|
conversations: ConversationStream;
|
|
21
22
|
serviceMode: ServiceModeSignal;
|
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,eAAe,EAEpB,KAAK,SAAS,EACd,KAAK,kBAAkB,
|
|
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;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