@agentshouse/mdruntime-adapter 0.1.0-cf059d0c8e9c0 → 0.1.0-cf1ebfb67feeb
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 +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -3
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +8 -1
- package/dist/discovery.d.ts +9 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +30 -3
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +2 -1
- package/dist/house-model.d.ts +332 -1862
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +46 -890
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/read.d.ts +9 -1
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +11 -0
- package/dist/room-types.d.ts +2 -2
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +6 -9
- 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 +3 -1
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +5 -2
- package/dist/transport.d.ts +7 -3
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +1 -0
- 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/actions.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { HouseDoorAnswer, HouseTransport } from './transport.js';
|
|
|
3
3
|
export type HouseActDoor = Pick<HouseTransport, 'door'>;
|
|
4
4
|
export declare function declaredActions(routes: readonly string[]): readonly ActionDeclaration[];
|
|
5
5
|
export declare function houseAction(transport: HouseActDoor, request: ActionRequest): Promise<ActionResult>;
|
|
6
|
-
export declare function actionOutcome(answer: HouseDoorAnswer, name: string): ActionResult;
|
|
6
|
+
export declare function actionOutcome(answer: HouseDoorAnswer, name: string, input: unknown): ActionResult;
|
|
7
7
|
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7F,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAExD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CAEvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAIvB;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7F,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAExD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CAEvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAIvB;AAwBD,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY,CAUjG"}
|
package/dist/actions.js
CHANGED
|
@@ -25,12 +25,16 @@ function malformed() {
|
|
|
25
25
|
function unimplemented(name) {
|
|
26
26
|
return { kind: 'rejected', code: 'action-unimplemented', fields: { name }, retryable: false };
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
function numbered(input) {
|
|
29
|
+
return typeof input?.operation_id === 'string';
|
|
30
|
+
}
|
|
31
|
+
export function actionOutcome(answer, name, input) {
|
|
29
32
|
if (answer.status === 401)
|
|
30
33
|
return { kind: 'revoked-authorization' };
|
|
31
34
|
const refusal = doorRefusal(answer.body);
|
|
32
|
-
if (refusal?.code === 'operation_contended')
|
|
35
|
+
if (refusal?.code === 'operation_contended' && numbered(input)) {
|
|
33
36
|
return { kind: 'transport-uncertainty' };
|
|
37
|
+
}
|
|
34
38
|
if (refusal !== null)
|
|
35
39
|
return { kind: 'rejected', ...refusal };
|
|
36
40
|
if (answer.status === 404)
|
|
@@ -40,5 +44,5 @@ export function actionOutcome(answer, name) {
|
|
|
40
44
|
return { kind: 'action', result: answer.body };
|
|
41
45
|
}
|
|
42
46
|
async function carry(transport, route, name, input) {
|
|
43
|
-
return actionOutcome(await transport.door(route, input), name);
|
|
47
|
+
return actionOutcome(await transport.door(route, input), name, input);
|
|
44
48
|
}
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,OAAO,EAIP,aAAa,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,OAAO,EAIP,aAAa,EAgBd,MAAM,wBAAwB,CAAC;AAgChC,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAoBxB,MAAM,MAAM,yBAAyB,GACjC;IACE,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACrC,GACD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA6DrD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CA+ZpF"}
|
package/dist/adapter.js
CHANGED
|
@@ -6,10 +6,12 @@ import { roomStreams } from './room-stream.js';
|
|
|
6
6
|
import { sha256Hex } from './digest.js';
|
|
7
7
|
import { finishedUpload, houseUpload } from './upload.js';
|
|
8
8
|
import { houseAction } from './actions.js';
|
|
9
|
+
import { houseSearch } from './search.js';
|
|
9
10
|
import { classifyDoor, doorRefusal } from './refusal.js';
|
|
10
11
|
import { houseNotifications, } from './stream.js';
|
|
11
12
|
import { houseDoorRoute, } from './transport.js';
|
|
12
13
|
import { batchPaths, deltaBody, deltaBytes, deltaDigest, historyOutcome, houseChanges, houseMove, mutationOutcome, operationHead, rejectedMapping, revisionBody, uploadable, } from './write.js';
|
|
14
|
+
import { HOUSE_TYPED_PATHS } from './house-model.js';
|
|
13
15
|
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
14
16
|
import { followsVersion, logPosition, presented, reachedVersion, roomVersion } from './version.js';
|
|
15
17
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
@@ -114,6 +116,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
114
116
|
? null
|
|
115
117
|
: await heldFiles(entry.authority, reusing, declared().max_held_files);
|
|
116
118
|
const answered = await transport.streamed(houseDoorRoute('bootstrap'), {
|
|
119
|
+
room_ref: entry.authority,
|
|
117
120
|
prefixes: [authorityRoot(entry.handle)],
|
|
118
121
|
...(files === null ? {} : { held: [files] }),
|
|
119
122
|
}, request.signal ?? new AbortController().signal);
|
|
@@ -285,6 +288,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
285
288
|
return {
|
|
286
289
|
roomTypes: HOUSE_ROOM_TYPES,
|
|
287
290
|
nameableRoomTypes: HOUSE_NAMEABLE_ROOM_TYPES,
|
|
291
|
+
typedPaths: HOUSE_TYPED_PATHS,
|
|
288
292
|
async authorize() {
|
|
289
293
|
return options.authorize();
|
|
290
294
|
},
|
|
@@ -311,7 +315,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
311
315
|
: houseMove(batch, entry.handle, into.handle);
|
|
312
316
|
if (mapped.kind === 'unmapped')
|
|
313
317
|
return rejectedMapping(mapped);
|
|
314
|
-
const head = operationHead(batch);
|
|
318
|
+
const head = operationHead(batch, entry.authority);
|
|
315
319
|
const delta = deltaBody(mapped.changes);
|
|
316
320
|
const bytes = deltaBytes(delta);
|
|
317
321
|
const handed = request.upload;
|
|
@@ -386,6 +390,9 @@ export function createAgentsHouseAdapter(options) {
|
|
|
386
390
|
async action(_authorization, request) {
|
|
387
391
|
return withAt(await houseAction(transport, request));
|
|
388
392
|
},
|
|
393
|
+
search(_authorization, request) {
|
|
394
|
+
return houseSearch(transport, [...tracked.values()], request);
|
|
395
|
+
},
|
|
389
396
|
roomStream: {
|
|
390
397
|
hold: held,
|
|
391
398
|
observe: notifications.observe,
|
package/dist/discovery.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export type HouseBounds = {
|
|
|
14
14
|
max_prefixes: number;
|
|
15
15
|
max_held_files: number;
|
|
16
16
|
change_retention_seconds: number;
|
|
17
|
-
operation_retention_seconds: number;
|
|
18
17
|
max_move_documents?: number;
|
|
19
18
|
};
|
|
20
19
|
export type HouseOperations = {
|
|
@@ -60,6 +59,14 @@ export type HouseSiteDiscovery = {
|
|
|
60
59
|
bounds: HouseBounds;
|
|
61
60
|
authorities: readonly HouseSiteAuthority[];
|
|
62
61
|
};
|
|
62
|
+
type RoomOwn = 'room_ref' | 'room_handle' | 'name' | 'position';
|
|
63
|
+
type Folded<A extends Record<RoomOwn, unknown>> = {
|
|
64
|
+
readonly shapes: readonly Omit<A, RoomOwn>[];
|
|
65
|
+
readonly rooms: readonly (Pick<A, RoomOwn> & {
|
|
66
|
+
readonly shape: number;
|
|
67
|
+
})[];
|
|
68
|
+
};
|
|
69
|
+
export declare function foldedAuthorities<A extends Record<RoomOwn, unknown>>(authorities: readonly A[]): Folded<A>;
|
|
63
70
|
export declare function parseDiscovery(body: unknown): HouseDiscoveryDocument | null;
|
|
64
71
|
export declare function parseAuthorityChange(body: unknown): HouseAuthorityChange | null;
|
|
65
72
|
export declare function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null;
|
|
@@ -71,4 +78,5 @@ export declare function capabilities(actions: HouseDiscoveryDocument['actions'])
|
|
|
71
78
|
export declare function siteCapabilities(): readonly Capability[];
|
|
72
79
|
export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
|
|
73
80
|
export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
|
|
81
|
+
export {};
|
|
74
82
|
//# 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,EACV,cAAc,EACd,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM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BxE;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,EAChD,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,SAAS,CAQX"}
|
package/dist/discovery.js
CHANGED
|
@@ -15,7 +15,6 @@ const BOUND_KEYS = [
|
|
|
15
15
|
'max_prefixes',
|
|
16
16
|
'max_held_files',
|
|
17
17
|
'change_retention_seconds',
|
|
18
|
-
'operation_retention_seconds',
|
|
19
18
|
];
|
|
20
19
|
const OPERATION_KEYS = ['write', 'delete'];
|
|
21
20
|
const ACCESS_LEVELS = ['search', 'open', 'keep'];
|
|
@@ -122,6 +121,35 @@ function parseAuthorities(value) {
|
|
|
122
121
|
}
|
|
123
122
|
return authorities;
|
|
124
123
|
}
|
|
124
|
+
export function foldedAuthorities(authorities) {
|
|
125
|
+
const shapes = [];
|
|
126
|
+
const known = new Map();
|
|
127
|
+
const rooms = authorities.map(({ room_ref, room_handle, name, position, ...shape }) => {
|
|
128
|
+
const key = JSON.stringify(shape);
|
|
129
|
+
let held = known.get(key);
|
|
130
|
+
if (held === undefined) {
|
|
131
|
+
held = shapes.push(shape) - 1;
|
|
132
|
+
known.set(key, held);
|
|
133
|
+
}
|
|
134
|
+
return { room_ref, room_handle, name, position, shape: held };
|
|
135
|
+
});
|
|
136
|
+
return { shapes, rooms };
|
|
137
|
+
}
|
|
138
|
+
function unfolded(shapes, rooms) {
|
|
139
|
+
if (!Array.isArray(shapes) || !Array.isArray(rooms))
|
|
140
|
+
return null;
|
|
141
|
+
const authorities = [];
|
|
142
|
+
for (const room of rooms) {
|
|
143
|
+
if (typeof room !== 'object' || room === null)
|
|
144
|
+
return null;
|
|
145
|
+
const { shape, ...own } = room;
|
|
146
|
+
const held = typeof shape === 'number' ? shapes[shape] : undefined;
|
|
147
|
+
if (typeof held !== 'object' || held === null)
|
|
148
|
+
return null;
|
|
149
|
+
authorities.push({ ...held, ...own });
|
|
150
|
+
}
|
|
151
|
+
return authorities;
|
|
152
|
+
}
|
|
125
153
|
export function parseDiscovery(body) {
|
|
126
154
|
if (typeof body !== 'object' || body === null)
|
|
127
155
|
return null;
|
|
@@ -137,7 +165,7 @@ export function parseDiscovery(body) {
|
|
|
137
165
|
new Set(actions).size !== actions.length ||
|
|
138
166
|
actions.some((name) => name.length === 0))
|
|
139
167
|
return null;
|
|
140
|
-
const authorities = parseAuthorities(held.
|
|
168
|
+
const authorities = parseAuthorities(unfolded(held.shapes, held.rooms));
|
|
141
169
|
return authorities === null ? null : { member, bounds, authorities, actions };
|
|
142
170
|
}
|
|
143
171
|
export function parseAuthorityChange(body) {
|
|
@@ -230,7 +258,6 @@ export function providerLimits(bounds) {
|
|
|
230
258
|
export function declaredRetention(bounds) {
|
|
231
259
|
return {
|
|
232
260
|
history: { kind: 'no-declared-time-bound' },
|
|
233
|
-
outcome: bounds.operation_retention_seconds,
|
|
234
261
|
refreshHorizon: bounds.change_retention_seconds,
|
|
235
262
|
};
|
|
236
263
|
}
|
package/dist/history.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAGZ,0BAA0B,EAC3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,YAAY,MAAM,CAAC;AAIhC,KAAK,aAAa,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBjE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE5D;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAUtE;AA8BD,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAGZ,0BAA0B,EAC3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,YAAY,MAAM,CAAC;AAIhC,KAAK,aAAa,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBjE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE5D;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAUtE;AA8BD,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,YAAY,CAAC,CAqBvB"}
|
package/dist/history.js
CHANGED
|
@@ -73,7 +73,8 @@ export async function houseHistory(transport, request) {
|
|
|
73
73
|
const asks = historyAsks(request);
|
|
74
74
|
if (asks === null)
|
|
75
75
|
return { kind: 'rejected', code: 'invalid_request', fields: {}, retryable: false };
|
|
76
|
-
const
|
|
76
|
+
const asked = { conversations: asks, limit: HISTORY_PAGE };
|
|
77
|
+
const outcome = actionOutcome(await transport.door(houseDoorRoute(HISTORY), asked), HISTORY, asked);
|
|
77
78
|
if (outcome.kind !== 'action')
|
|
78
79
|
return outcome;
|
|
79
80
|
const answered = record(outcome.result).histories;
|