@agentshouse/mdruntime-adapter 0.1.0-c637ad982fd79 → 0.1.0-c648eb955ddfd
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 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +11 -3
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +74 -76
- 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 +10 -3
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +34 -8
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +3 -2
- package/dist/house-model.d.ts +138 -1370
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +82 -733
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/model.d.ts +5 -7
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +30 -18
- package/dist/read.d.ts +19 -9
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +46 -143
- package/dist/room-types.d.ts +0 -2
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +6 -11
- 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 +33 -41
- package/dist/space-schema.d.ts +7 -0
- package/dist/space-schema.d.ts.map +1 -0
- package/dist/space-schema.js +18 -0
- package/dist/stream.d.ts +6 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +91 -18
- package/dist/transport.d.ts +11 -10
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +12 -11
- package/dist/write.d.ts +2 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +8 -23
- 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 -19
- package/dist/room-stream.d.ts.map +0 -1
- package/dist/room-stream.js +0 -57
package/dist/site.js
CHANGED
|
@@ -1,13 +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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { spaceSchemas } from './space-schema.js';
|
|
5
|
+
import { discoveryFailure } from './refusal.js';
|
|
6
|
+
import { HOUSE_TYPED_PATHS } from './house-model.js';
|
|
7
7
|
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
8
8
|
import { houseNotifications } from './stream.js';
|
|
9
|
-
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES,
|
|
10
|
-
import { followsVersion,
|
|
9
|
+
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES, SITES_SUBMISSIONS_CREATE, } from './transport.js';
|
|
10
|
+
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
11
11
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
12
12
|
function unfound() {
|
|
13
13
|
return { kind: 'rejected', code: 'file_not_found', fields: {}, retryable: false };
|
|
@@ -18,50 +18,47 @@ function siteRoom(tracked) {
|
|
|
18
18
|
locator: tracked.locator,
|
|
19
19
|
handle: tracked.handle,
|
|
20
20
|
roomVersion: roomVersion(tracked),
|
|
21
|
-
operations: { write: [],
|
|
21
|
+
operations: { write: [], erase: [] },
|
|
22
22
|
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
23
23
|
providerOwnedPaths: [],
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
export function createSiteAdapter(transport, snapshot = false) {
|
|
27
|
+
const spaces = spaceSchemas();
|
|
27
28
|
const notifications = houseNotifications(transport, 'site', {
|
|
28
29
|
opened: async () => {
|
|
29
30
|
const found = await discovered();
|
|
30
31
|
return found.kind === 'discovery' ? found : null;
|
|
31
32
|
},
|
|
32
33
|
changed: () => null,
|
|
33
|
-
});
|
|
34
|
+
}, spaces);
|
|
34
35
|
const tracked = new Map();
|
|
35
|
-
const
|
|
36
|
-
const rooms = roomStreams('site');
|
|
36
|
+
const chunked = new Map();
|
|
37
37
|
function fileRoute(request) {
|
|
38
38
|
const entry = tracked.get(request.locator);
|
|
39
39
|
if (entry === undefined)
|
|
40
40
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
41
41
|
return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
|
|
42
42
|
}
|
|
43
|
-
async function
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
const head = await
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
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);
|
|
52
51
|
return head;
|
|
53
52
|
}
|
|
54
|
-
async function
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
bytes: part.bytes,
|
|
64
|
-
};
|
|
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);
|
|
65
62
|
}
|
|
66
63
|
async function discovered() {
|
|
67
64
|
const answer = await transport.read(houseSiteRoute('discover'));
|
|
@@ -82,6 +79,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
82
79
|
localSaves: true,
|
|
83
80
|
roomTypes: HOUSE_ROOM_TYPES,
|
|
84
81
|
nameableRoomTypes: HOUSE_NAMEABLE_ROOM_TYPES,
|
|
82
|
+
typedPaths: HOUSE_TYPED_PATHS,
|
|
85
83
|
async authorize() {
|
|
86
84
|
return {};
|
|
87
85
|
},
|
|
@@ -90,8 +88,8 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
90
88
|
if (entry === undefined)
|
|
91
89
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
92
90
|
return request.pageToken === undefined
|
|
93
|
-
?
|
|
94
|
-
:
|
|
91
|
+
? listedRoom(entry)
|
|
92
|
+
: chunkPage(entry, request.pageToken, request.arriving);
|
|
95
93
|
},
|
|
96
94
|
...(snapshot
|
|
97
95
|
? {
|
|
@@ -145,7 +143,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
145
143
|
return followsVersion(version, next);
|
|
146
144
|
},
|
|
147
145
|
async action(_authorization, request) {
|
|
148
|
-
if (request.name !==
|
|
146
|
+
if (request.name !== SITES_SUBMISSIONS_CREATE) {
|
|
149
147
|
return {
|
|
150
148
|
kind: 'rejected',
|
|
151
149
|
code: 'action-unimplemented',
|
|
@@ -155,18 +153,12 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
155
153
|
}
|
|
156
154
|
if (!transport.online())
|
|
157
155
|
return UNCERTAIN;
|
|
158
|
-
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);
|
|
159
157
|
},
|
|
160
158
|
roomStream: snapshot
|
|
161
159
|
? undefined
|
|
162
160
|
: {
|
|
163
|
-
hold
|
|
164
|
-
notifications.send(rooms.flatMap((room) => {
|
|
165
|
-
const entry = tracked.get(room.locator);
|
|
166
|
-
const at = logPosition(room.roomVersion);
|
|
167
|
-
return entry === undefined || at === null ? [] : [presented(entry.authority, at)];
|
|
168
|
-
}));
|
|
169
|
-
},
|
|
161
|
+
hold: notifications.send,
|
|
170
162
|
observe: notifications.observe,
|
|
171
163
|
},
|
|
172
164
|
serviceMode: notifications.serviceMode,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SpaceSchemas = {
|
|
2
|
+
held(space: string, revision: string): string | undefined;
|
|
3
|
+
keep(space: string, revision: string, text: string): void;
|
|
4
|
+
};
|
|
5
|
+
export declare function spaceSchemas(): SpaceSchemas;
|
|
6
|
+
export declare function spaceIdentity(space: string): string;
|
|
7
|
+
//# sourceMappingURL=space-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-schema.d.ts","sourceRoot":"","sources":["../src/space-schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF,wBAAgB,YAAY,IAAI,YAAY,CAY3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const HELD_TEXTS = 16;
|
|
2
|
+
export function spaceSchemas() {
|
|
3
|
+
const texts = new Map();
|
|
4
|
+
const key = (space, revision) => `${space} ${revision}`;
|
|
5
|
+
return {
|
|
6
|
+
held: (space, revision) => texts.get(key(space, revision)),
|
|
7
|
+
keep(space, revision, text) {
|
|
8
|
+
const named = key(space, revision);
|
|
9
|
+
texts.delete(named);
|
|
10
|
+
texts.set(named, text);
|
|
11
|
+
if (texts.size > HELD_TEXTS)
|
|
12
|
+
texts.delete(texts.keys().next().value);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function spaceIdentity(space) {
|
|
17
|
+
return `space:${space}`;
|
|
18
|
+
}
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,6 +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
|
-
import
|
|
3
|
+
import type { SpaceSchemas } from './space-schema.js';
|
|
4
|
+
import { type HouseDoor, type HouseMode, type HouseStreamFrame } from './transport.js';
|
|
4
5
|
export type HouseOpeningFrame = Extract<HouseStreamFrame, {
|
|
5
6
|
type: 'opening';
|
|
6
7
|
}>;
|
|
@@ -10,14 +11,15 @@ export type HouseAuthorityChangedFrame = Extract<HouseStreamFrame, {
|
|
|
10
11
|
export type HouseDiscovering = {
|
|
11
12
|
opened(frame: HouseOpeningFrame | null): Promise<Discovery | null>;
|
|
12
13
|
changed(frame: HouseAuthorityChangedFrame): AuthorityChange | null;
|
|
14
|
+
expired?(authorities: readonly string[]): void;
|
|
13
15
|
};
|
|
14
16
|
export type HouseNotifications = {
|
|
15
17
|
runtime: string;
|
|
16
18
|
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
17
|
-
send(rooms: readonly
|
|
19
|
+
send(rooms: readonly HeldRoom[]): void;
|
|
18
20
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
19
21
|
conversations: ConversationStream;
|
|
20
22
|
serviceMode: ServiceModeSignal;
|
|
21
23
|
};
|
|
22
|
-
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode, discovering: HouseDiscovering): HouseNotifications;
|
|
24
|
+
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode, discovering: HouseDiscovering, spaces: SpaceSchemas): HouseNotifications;
|
|
23
25
|
//# sourceMappingURL=stream.d.ts.map
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,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;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWtD,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EAGd,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAaxB,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAAC;AAElG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,KAAK,EAAE,0BAA0B,GAAG,eAAe,GAAG,IAAI,CAAC;IACnE,OAAO,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IACvC,KAAK,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtD,aAAa,EAAE,kBAAkB,CAAC;IAClC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AA6FF,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,YAAY,GACnB,kBAAkB,CA8XpB"}
|
package/dist/stream.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
2
|
import { acceptedMessage, cursorPosition, houseHistory } from './history.js';
|
|
3
|
-
import { streamedModels } from './model.js';
|
|
4
|
-
import { answered, answering, binaryFileOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
3
|
+
import { keptSpaceSchemas, streamedModels } from './model.js';
|
|
4
|
+
import { answered, answering, binaryFileOf, createdOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
5
5
|
import { houseDoorRoute, } from './transport.js';
|
|
6
|
-
import { DECIMAL, roomVersion } from './version.js';
|
|
6
|
+
import { DECIMAL, logPosition, presented, roomVersion } from './version.js';
|
|
7
7
|
function turnOperation(frame) {
|
|
8
8
|
const { type: _type, conversation_id: _conversation, turn_id: _turn, ...operation } = frame;
|
|
9
9
|
return structuredClone(operation);
|
|
10
10
|
}
|
|
11
11
|
async function houseAgents(transport) {
|
|
12
|
-
const answer = await transport.door(houseDoorRoute('agents/
|
|
12
|
+
const answer = await transport.door(houseDoorRoute('agents/list'), {});
|
|
13
13
|
const agents = answer.status === 200 ? answer.body?.agents : null;
|
|
14
14
|
if (!Array.isArray(agents))
|
|
15
15
|
return null;
|
|
@@ -32,6 +32,7 @@ function listedConversation(listed) {
|
|
|
32
32
|
outcome: listed.outcome,
|
|
33
33
|
waiting: listed.waiting,
|
|
34
34
|
newest: listed.newest === null ? null : cursorPosition(listed.newest),
|
|
35
|
+
processEnded: listed.process_ended_at,
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
function position(value) {
|
|
@@ -50,6 +51,10 @@ function* changed(tracked, entries, version, schemas) {
|
|
|
50
51
|
if (entry.path === tracked.schema)
|
|
51
52
|
schemas.set(entry.path, entry);
|
|
52
53
|
forgotten(answer, entry.path);
|
|
54
|
+
if (entry.space !== undefined) {
|
|
55
|
+
answer.removals.add(entry.path);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
53
58
|
if (entry.kind === 'removed') {
|
|
54
59
|
answer.removals.add(entry.path);
|
|
55
60
|
continue;
|
|
@@ -59,38 +64,51 @@ function* changed(tracked, entries, version, schemas) {
|
|
|
59
64
|
answer.documents.set(entry.path, entry.text ?? '');
|
|
60
65
|
else if (binary !== null)
|
|
61
66
|
answer.binaryFiles.set(entry.path, binary);
|
|
67
|
+
if (binary === undefined && entry.facts !== undefined)
|
|
68
|
+
answer.facts.set(entry.path, entry.facts);
|
|
62
69
|
const revision = entry.revision ?? binary?.sha256;
|
|
63
70
|
if (revision !== undefined)
|
|
64
71
|
revised(answer, entry.path, revision);
|
|
65
72
|
const head = headChange(entry);
|
|
66
73
|
if (head)
|
|
67
74
|
answer.changes.set(entry.path, head);
|
|
75
|
+
const created = createdOf(entry);
|
|
76
|
+
if (created)
|
|
77
|
+
answer.created.set(entry.path, created);
|
|
68
78
|
}
|
|
69
79
|
return { kind: 'net-advancement', roomVersion: version, ...(yield* answered(answer)) };
|
|
70
80
|
}
|
|
71
|
-
async function changePage(tracked, entries, version, mode) {
|
|
81
|
+
async function changePage(tracked, entries, version, mode, spaces, whole) {
|
|
72
82
|
const schemas = new Map();
|
|
73
83
|
const page = await stepped(changed(tracked, entries, version, schemas));
|
|
74
|
-
const models = await streamedModels(schemas, tracked, mode);
|
|
84
|
+
const models = await streamedModels(schemas, tracked, mode, spaces, whole);
|
|
75
85
|
return models === undefined ? page : { ...page, models };
|
|
76
86
|
}
|
|
77
|
-
export function houseNotifications(transport, mode, discovering) {
|
|
87
|
+
export function houseNotifications(transport, mode, discovering, spaces) {
|
|
78
88
|
const stream = transport.stream;
|
|
79
89
|
const staged = new Map();
|
|
80
90
|
let socket = null;
|
|
81
91
|
const tracking = new Map();
|
|
82
92
|
const observers = new Set();
|
|
93
|
+
const replaying = new Map();
|
|
83
94
|
const conversationObservers = new Set();
|
|
84
95
|
const modeObservers = new Set();
|
|
85
96
|
let replicated = [];
|
|
86
97
|
let listedCursor = null;
|
|
98
|
+
const unanswered = [];
|
|
99
|
+
const heldAtZero = new Set();
|
|
87
100
|
const live = new Set();
|
|
88
101
|
let opening = null;
|
|
89
102
|
let announced = null;
|
|
90
103
|
const runtime = crypto.randomUUID();
|
|
91
104
|
function emit(event) {
|
|
92
|
-
for (const observer of observers)
|
|
93
|
-
observer
|
|
105
|
+
for (const observer of observers) {
|
|
106
|
+
const held = replaying.get(observer);
|
|
107
|
+
if (held === undefined)
|
|
108
|
+
observer(event);
|
|
109
|
+
else
|
|
110
|
+
held.push(event);
|
|
111
|
+
}
|
|
94
112
|
}
|
|
95
113
|
function emitConversation(event) {
|
|
96
114
|
if (event.kind === 'turn' ||
|
|
@@ -112,6 +130,8 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
112
130
|
announced = null;
|
|
113
131
|
socket = next;
|
|
114
132
|
staged.clear();
|
|
133
|
+
unanswered.length = 0;
|
|
134
|
+
heldAtZero.clear();
|
|
115
135
|
const gapped = new Set([...replicated, ...live]);
|
|
116
136
|
live.clear();
|
|
117
137
|
for (const conversation of gapped)
|
|
@@ -213,6 +233,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
213
233
|
}
|
|
214
234
|
}
|
|
215
235
|
const next = held ?? { authority: frame.authority, parts: 0, entries: [] };
|
|
236
|
+
keptSpaceSchemas(frame.entries, spaces);
|
|
216
237
|
next.entries.push(...frame.entries);
|
|
217
238
|
next.parts += 1;
|
|
218
239
|
staged.set(frame.carry, next);
|
|
@@ -240,9 +261,13 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
240
261
|
return;
|
|
241
262
|
}
|
|
242
263
|
if (frame.type === 'caught_up') {
|
|
264
|
+
discovering.expired?.(frame.expired);
|
|
243
265
|
emit({
|
|
244
266
|
kind: 'caught-up',
|
|
245
|
-
expired:
|
|
267
|
+
expired: [
|
|
268
|
+
...frame.expired.flatMap((authority) => (tracking.get(authority) ?? []).map((tracked) => tracked.locator)),
|
|
269
|
+
...(unanswered.shift() ?? []),
|
|
270
|
+
],
|
|
246
271
|
});
|
|
247
272
|
return;
|
|
248
273
|
}
|
|
@@ -293,7 +318,9 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
293
318
|
const after = position(frame.after);
|
|
294
319
|
if (at === null || after === null || after >= at)
|
|
295
320
|
return;
|
|
296
|
-
const from =
|
|
321
|
+
const from = after === 0n && !heldAtZero.has(frame.authority)
|
|
322
|
+
? null
|
|
323
|
+
: roomVersion({ position: frame.after, logEpoch: frame.log_epoch });
|
|
297
324
|
const version = roomVersion({ position: frame.position, logEpoch: frame.log_epoch });
|
|
298
325
|
for (const tracked of tracking.get(frame.authority) ?? []) {
|
|
299
326
|
emit({
|
|
@@ -301,18 +328,20 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
301
328
|
locator: tracked.locator,
|
|
302
329
|
from,
|
|
303
330
|
roomVersion: version,
|
|
304
|
-
read: () => changePage(tracked, entries, version, mode),
|
|
331
|
+
read: () => changePage(tracked, entries, version, mode, spaces, from === null),
|
|
305
332
|
});
|
|
306
333
|
}
|
|
307
334
|
}
|
|
308
335
|
stream.observe((frame) => handle(frame, socket));
|
|
309
336
|
stream.opened(reopened);
|
|
310
|
-
stream.closed(({ revoked, lost }) => {
|
|
337
|
+
stream.closed(({ revoked, lost, authorityChanged }) => {
|
|
311
338
|
opening = null;
|
|
312
339
|
announced = null;
|
|
313
340
|
socket = null;
|
|
314
341
|
staged.clear();
|
|
315
|
-
|
|
342
|
+
unanswered.length = 0;
|
|
343
|
+
heldAtZero.clear();
|
|
344
|
+
emit({ kind: 'closed', revoked, lost, authorityChanged });
|
|
316
345
|
});
|
|
317
346
|
return {
|
|
318
347
|
runtime,
|
|
@@ -346,11 +375,15 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
346
375
|
},
|
|
347
376
|
observe(notify) {
|
|
348
377
|
observers.add(notify);
|
|
349
|
-
|
|
350
|
-
|
|
378
|
+
if (opening !== null) {
|
|
379
|
+
const replayed = [{ kind: 'opened' }];
|
|
380
|
+
if (announced !== null)
|
|
381
|
+
replayed.push(announced);
|
|
382
|
+
replaying.set(notify, replayed);
|
|
351
383
|
queueMicrotask(() => {
|
|
384
|
+
replaying.delete(notify);
|
|
352
385
|
for (const event of replayed)
|
|
353
|
-
if (
|
|
386
|
+
if (observers.has(notify))
|
|
354
387
|
notify(event);
|
|
355
388
|
});
|
|
356
389
|
}
|
|
@@ -361,7 +394,47 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
361
394
|
send(rooms) {
|
|
362
395
|
opening = null;
|
|
363
396
|
announced = null;
|
|
364
|
-
socket
|
|
397
|
+
if (socket === null)
|
|
398
|
+
return;
|
|
399
|
+
const entries = new Map([...tracking.values()].flat().map((tracked) => [tracked.locator, tracked]));
|
|
400
|
+
const named = rooms.flatMap((room) => {
|
|
401
|
+
const entry = entries.get(room.locator);
|
|
402
|
+
const at = room.roomVersion === null ? null : logPosition(room.roomVersion);
|
|
403
|
+
return entry === undefined || at === null ? [] : [{ entry, at }];
|
|
404
|
+
});
|
|
405
|
+
const unheld = rooms.flatMap((room) => {
|
|
406
|
+
const entry = entries.get(room.locator);
|
|
407
|
+
return entry === undefined || room.roomVersion !== null ? [] : [entry];
|
|
408
|
+
});
|
|
409
|
+
for (const { entry, at } of named) {
|
|
410
|
+
if (at.position === '0')
|
|
411
|
+
heldAtZero.add(entry.authority);
|
|
412
|
+
else
|
|
413
|
+
heldAtZero.delete(entry.authority);
|
|
414
|
+
}
|
|
415
|
+
for (const entry of unheld)
|
|
416
|
+
heldAtZero.delete(entry.authority);
|
|
417
|
+
const site = mode === 'site';
|
|
418
|
+
unanswered.push(site ? unheld.map((entry) => entry.locator) : []);
|
|
419
|
+
socket.hold([
|
|
420
|
+
...named.map(({ entry, at }) => presented(entry.authority, at)),
|
|
421
|
+
...(site ? [] : unheld).map((entry) => presented(entry.authority, { position: '0', logEpoch: entry.logEpoch })),
|
|
422
|
+
], runtime, listedCursor);
|
|
423
|
+
if (site)
|
|
424
|
+
return;
|
|
425
|
+
const made = unheld.filter((entry) => entry.position === '0');
|
|
426
|
+
queueMicrotask(() => {
|
|
427
|
+
for (const entry of made) {
|
|
428
|
+
const version = roomVersion(entry);
|
|
429
|
+
emit({
|
|
430
|
+
kind: 'room-change',
|
|
431
|
+
locator: entry.locator,
|
|
432
|
+
from: null,
|
|
433
|
+
roomVersion: version,
|
|
434
|
+
read: () => changePage(entry, [], version, mode, spaces, true),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
});
|
|
365
438
|
},
|
|
366
439
|
track(entries) {
|
|
367
440
|
tracking.clear();
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { ConversationEvent, TurnOperation } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { ConversationEvent, SavedFacts, TurnOperation } from '@agentshouse/mdruntime';
|
|
2
2
|
export declare const HOUSE_RUNTIME_READS: {
|
|
3
|
-
readonly acts: readonly ['account/push', 'agents/
|
|
3
|
+
readonly acts: readonly ['account/push/set', 'agents/list', 'apps/features/set', 'apps/source/download', 'apps/source/top/read', 'conversations/history/list', 'files/attach', 'files/batch', 'files/batch-upload', 'files/finish', 'files/read', 'files/revisions/list', 'room-chunks/list', 'rooms/discover', 'rooms/search', 'sites/screenshot/read'];
|
|
4
4
|
readonly frames: readonly ['app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'link', 'message', 'opening', 'options', 'part', 'process', 'received', 'signal', 'site', 'starting', 'subagents', 'tab-icon', 'turn'];
|
|
5
5
|
};
|
|
6
6
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
7
7
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
8
8
|
export declare function houseDoorRoute(act: HouseRuntimeAct): string;
|
|
9
|
-
export declare function houseSiteRoute(act:
|
|
10
|
-
export declare const
|
|
9
|
+
export declare function houseSiteRoute(act: 'chunks' | 'discover'): string;
|
|
10
|
+
export declare const SITES_SUBMISSIONS_CREATE = "sites/submissions/create";
|
|
11
11
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
12
12
|
export type HouseMode = 'credential' | 'site';
|
|
13
13
|
export type HouseDoorAnswer = {
|
|
@@ -42,7 +42,10 @@ export type HouseStreamEntry = {
|
|
|
42
42
|
site: string;
|
|
43
43
|
name: string;
|
|
44
44
|
};
|
|
45
|
+
changed_at?: string;
|
|
45
46
|
created_at?: string;
|
|
47
|
+
facts?: SavedFacts;
|
|
48
|
+
space?: string;
|
|
46
49
|
};
|
|
47
50
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
48
51
|
kind: K;
|
|
@@ -61,6 +64,7 @@ export type HouseListedConversation = {
|
|
|
61
64
|
accepted_at: string;
|
|
62
65
|
message_id: string;
|
|
63
66
|
} | null;
|
|
67
|
+
process_ended_at: string | null;
|
|
64
68
|
};
|
|
65
69
|
type Listed<Frame extends {
|
|
66
70
|
readonly type: HouseRuntimeFrame;
|
|
@@ -84,7 +88,8 @@ export type HouseStreamFrame = Listed<{
|
|
|
84
88
|
member: unknown;
|
|
85
89
|
bounds: unknown;
|
|
86
90
|
actions: readonly unknown[];
|
|
87
|
-
|
|
91
|
+
shapes: readonly unknown[];
|
|
92
|
+
rooms: readonly unknown[];
|
|
88
93
|
} | {
|
|
89
94
|
type: 'caught_up';
|
|
90
95
|
expired: readonly string[];
|
|
@@ -162,21 +167,18 @@ export type HouseOpening = {
|
|
|
162
167
|
export type HouseClosing = {
|
|
163
168
|
revoked: boolean;
|
|
164
169
|
lost: boolean;
|
|
170
|
+
authorityChanged: boolean;
|
|
165
171
|
};
|
|
166
172
|
export type HouseStream = {
|
|
167
173
|
observe(receive: (frame: HouseStreamFrame) => void): () => void;
|
|
168
174
|
opened(notify: (opening: HouseOpening) => void): () => void;
|
|
169
175
|
closed(notify: (closing: HouseClosing) => void): () => void;
|
|
170
176
|
};
|
|
171
|
-
export type HouseStreamed = HouseDoorAnswer & {
|
|
172
|
-
room: ReadableStream<Uint8Array> | null;
|
|
173
|
-
};
|
|
174
177
|
export type HouseDoor = {
|
|
175
178
|
door(route: string, body: unknown): Promise<HouseDoorAnswer>;
|
|
176
179
|
stream: HouseStream;
|
|
177
180
|
};
|
|
178
181
|
export type HouseTransport = HouseDoor & {
|
|
179
|
-
streamed(route: string, body: unknown, signal: AbortSignal): Promise<HouseStreamed>;
|
|
180
182
|
transfer(request: HouseByteTransfer): Promise<HouseDoorAnswer>;
|
|
181
183
|
put(url: string, body: Blob, headers: Readonly<Record<string, string>>): Promise<number>;
|
|
182
184
|
download(url: string): Promise<HouseBytesAnswer>;
|
|
@@ -184,7 +186,6 @@ export type HouseTransport = HouseDoor & {
|
|
|
184
186
|
export type HouseSiteTransport = HouseDoor & {
|
|
185
187
|
online(): boolean;
|
|
186
188
|
read(route: string): Promise<HouseDoorAnswer>;
|
|
187
|
-
streamed(route: string, signal: AbortSignal): Promise<HouseStreamed>;
|
|
188
189
|
download(route: string): Promise<HouseBytesAnswer>;
|
|
189
190
|
};
|
|
190
191
|
export {};
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE3F,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,uBAAuB;aAEzB,MAAM,YACJ,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM;CAEA,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OA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CAAC,MAAM,CAAC,CAAC;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,MAAM,IAAI,OAAO,CAAC;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
|
package/dist/transport.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
export const HOUSE_RUNTIME_READS = {
|
|
2
2
|
acts: [
|
|
3
|
-
'account/push',
|
|
4
|
-
'agents/
|
|
3
|
+
'account/push/set',
|
|
4
|
+
'agents/list',
|
|
5
5
|
'apps/features/set',
|
|
6
6
|
'apps/source/download',
|
|
7
|
-
'apps/source/top',
|
|
8
|
-
'
|
|
9
|
-
'batch-upload',
|
|
10
|
-
'bootstrap',
|
|
11
|
-
'conversations/history',
|
|
12
|
-
'discover',
|
|
7
|
+
'apps/source/top/read',
|
|
8
|
+
'conversations/history/list',
|
|
13
9
|
'files/attach',
|
|
10
|
+
'files/batch',
|
|
11
|
+
'files/batch-upload',
|
|
14
12
|
'files/finish',
|
|
15
|
-
'files/
|
|
16
|
-
'revisions',
|
|
13
|
+
'files/read',
|
|
14
|
+
'files/revisions/list',
|
|
15
|
+
'room-chunks/list',
|
|
16
|
+
'rooms/discover',
|
|
17
|
+
'rooms/search',
|
|
17
18
|
'sites/screenshot/read',
|
|
18
19
|
],
|
|
19
20
|
frames: [
|
|
@@ -50,6 +51,6 @@ export function houseDoorRoute(act) {
|
|
|
50
51
|
export function houseSiteRoute(act) {
|
|
51
52
|
return `/_house/door/${act}`;
|
|
52
53
|
}
|
|
53
|
-
export const
|
|
54
|
+
export const SITES_SUBMISSIONS_CREATE = 'sites/submissions/create';
|
|
54
55
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
55
56
|
export const SITE_FILES = '/_house/files/';
|
package/dist/write.d.ts
CHANGED
|
@@ -17,10 +17,11 @@ export declare function houseParts(saved: readonly {
|
|
|
17
17
|
export declare function houseMove(batch: ChangeBatch, source: string, destination: string): ChangeMapping;
|
|
18
18
|
export type OperationHead = {
|
|
19
19
|
readonly operation_id: string;
|
|
20
|
+
readonly room_ref: string;
|
|
20
21
|
readonly app_ref?: string;
|
|
21
22
|
readonly release?: string;
|
|
22
23
|
};
|
|
23
|
-
export declare function operationHead(batch: ChangeBatch): OperationHead;
|
|
24
|
+
export declare function operationHead(batch: ChangeBatch, room: string): OperationHead;
|
|
24
25
|
export declare function batchPaths(changes: readonly HouseOperation[]): readonly string[];
|
|
25
26
|
export declare function deltaBody(changes: readonly HouseOperation[]): string;
|
|
26
27
|
export declare function deltaBytes(delta: string): number;
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAwHrD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAQ9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