@agentshouse/mdruntime-adapter 0.1.0-c38cdd8a6d962 → 0.1.0-c392f202fd8ec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/actions.d.ts +163 -3
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +121 -219
- package/dist/adapter.d.ts +1 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +279 -208
- package/dist/app-reference.d.ts +2 -0
- package/dist/app-reference.d.ts.map +1 -0
- package/dist/app-reference.js +2 -0
- package/dist/crockford.d.ts +4 -0
- package/dist/crockford.d.ts.map +1 -0
- package/dist/crockford.js +3 -0
- package/dist/discovery.d.ts +16 -15
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +75 -52
- package/dist/house-model.d.ts +2983 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +1643 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/model.d.ts +6 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +23 -28
- package/dist/part.d.ts +14 -0
- package/dist/part.d.ts.map +1 -0
- package/dist/part.js +90 -0
- package/dist/read.d.ts +52 -41
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +248 -234
- package/dist/refusal.d.ts +3 -9
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +25 -19
- 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 +7 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +126 -0
- package/dist/site.d.ts +1 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +129 -106
- package/dist/stream.d.ts +12 -11
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +174 -145
- package/dist/transport.d.ts +79 -23
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +51 -10
- package/dist/upload.d.ts +12 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +63 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/write.d.ts +18 -9
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +165 -41
- package/package.json +9 -6
- package/AGENTS.md +0 -238
- package/dist/gather.d.ts +0 -3
- package/dist/gather.d.ts.map +0 -1
- package/dist/gather.js +0 -40
- package/dist/links.d.ts +0 -20
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -104
package/dist/discovery.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Capability, DiscoveredRoom, Discovery, ProviderLimit, Retention } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { Capability, DiscoveredRoom, Discovery, Member, ProviderLimit, Retention } from '@agentshouse/mdruntime';
|
|
2
2
|
import { type LogPosition } from './version.js';
|
|
3
3
|
export declare const PROVIDER_ACTIONS = "provider-actions";
|
|
4
|
-
export declare const DISCOVER_PREFIXES: readonly string[];
|
|
5
|
-
export declare const PRIVATE_HANDLE = "private";
|
|
6
4
|
export type HouseBounds = {
|
|
7
5
|
max_authored_file_bytes: number;
|
|
8
6
|
max_batch_operations: number;
|
|
@@ -14,41 +12,44 @@ export type HouseBounds = {
|
|
|
14
12
|
max_inline_body_bytes: number;
|
|
15
13
|
max_upload_bytes: number;
|
|
16
14
|
max_prefixes: number;
|
|
15
|
+
max_held_files: number;
|
|
17
16
|
change_retention_seconds: number;
|
|
18
17
|
operation_retention_seconds: number;
|
|
18
|
+
max_move_documents?: number;
|
|
19
19
|
};
|
|
20
20
|
export type HouseOperations = {
|
|
21
|
-
read: readonly string[];
|
|
22
|
-
sync: readonly string[];
|
|
23
21
|
write: readonly string[];
|
|
24
22
|
delete: readonly string[];
|
|
25
23
|
};
|
|
26
|
-
export type
|
|
27
|
-
root: string;
|
|
28
|
-
paths: readonly string[];
|
|
29
|
-
};
|
|
24
|
+
export type HouseAccessLevel = 'search' | 'open' | 'keep';
|
|
30
25
|
export type HouseAuthority = LogPosition & {
|
|
31
26
|
roomRef: string;
|
|
32
27
|
roomHandle: string;
|
|
33
28
|
name: string;
|
|
34
29
|
schema: string;
|
|
35
|
-
|
|
30
|
+
typedSelection: readonly string[] | null;
|
|
36
31
|
managedReplication: 'admitted' | 'unavailable';
|
|
37
32
|
protectedPaths: readonly string[];
|
|
33
|
+
level: HouseAccessLevel;
|
|
38
34
|
operations: HouseOperations;
|
|
39
35
|
};
|
|
40
36
|
export type HouseDiscoveryDocument = {
|
|
37
|
+
member: Member;
|
|
41
38
|
bounds: HouseBounds;
|
|
42
39
|
authorities: readonly HouseAuthority[];
|
|
43
40
|
actions: readonly string[];
|
|
44
41
|
};
|
|
42
|
+
export type HouseAuthorityChange = {
|
|
43
|
+
member: Member;
|
|
44
|
+
authorities: readonly HouseAuthority[];
|
|
45
|
+
left: readonly string[];
|
|
46
|
+
};
|
|
45
47
|
export type TrackedAuthority = LogPosition & {
|
|
46
48
|
locator: string;
|
|
47
49
|
authority: string;
|
|
48
50
|
handle: string;
|
|
49
51
|
schema: string;
|
|
50
|
-
|
|
51
|
-
schemas: readonly string[];
|
|
52
|
+
typedSelection: readonly string[] | null;
|
|
52
53
|
};
|
|
53
54
|
export type HouseSiteAuthority = LogPosition & {
|
|
54
55
|
roomRef: string;
|
|
@@ -60,13 +61,13 @@ export type HouseSiteDiscovery = {
|
|
|
60
61
|
authorities: readonly HouseSiteAuthority[];
|
|
61
62
|
};
|
|
62
63
|
export declare function parseDiscovery(body: unknown): HouseDiscoveryDocument | null;
|
|
64
|
+
export declare function parseAuthorityChange(body: unknown): HouseAuthorityChange | null;
|
|
63
65
|
export declare function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null;
|
|
64
66
|
export declare function siteTracked(document: HouseSiteDiscovery): TrackedAuthority[];
|
|
65
|
-
export declare function
|
|
66
|
-
export declare function trackedFrom(document: HouseDiscoveryDocument): TrackedAuthority[];
|
|
67
|
+
export declare function trackedFrom(document: Pick<HouseDiscoveryDocument, 'authorities'>): TrackedAuthority[];
|
|
67
68
|
export declare function providerLimits(bounds: HouseBounds): readonly ProviderLimit[];
|
|
68
69
|
export declare function declaredRetention(bounds: HouseBounds): Retention;
|
|
69
|
-
export declare function capabilities(actions:
|
|
70
|
+
export declare function capabilities(actions: HouseDiscoveryDocument['actions']): readonly Capability[];
|
|
70
71
|
export declare function siteCapabilities(): readonly Capability[];
|
|
71
72
|
export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
|
|
72
73
|
export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
|
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,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;
|
|
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;AAEhC,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,CAAC;IACxB,eAAe,EAA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AgB,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
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { declaredActions,
|
|
2
|
-
import { PRIVATE_LOCATOR } from './transport.js';
|
|
1
|
+
import { declaredActions, SITE_SUBMIT } from './actions.js';
|
|
3
2
|
import { readPosition, roomVersion } from './version.js';
|
|
4
3
|
export const PROVIDER_ACTIONS = 'provider-actions';
|
|
5
|
-
export const DISCOVER_PREFIXES = ['/'];
|
|
6
|
-
export const PRIVATE_HANDLE = 'private';
|
|
7
4
|
const BOUND_KEYS = [
|
|
8
5
|
'max_authored_file_bytes',
|
|
9
6
|
'max_batch_operations',
|
|
@@ -15,10 +12,12 @@ const BOUND_KEYS = [
|
|
|
15
12
|
'max_inline_body_bytes',
|
|
16
13
|
'max_upload_bytes',
|
|
17
14
|
'max_prefixes',
|
|
15
|
+
'max_held_files',
|
|
18
16
|
'change_retention_seconds',
|
|
19
17
|
'operation_retention_seconds',
|
|
20
18
|
];
|
|
21
|
-
const OPERATION_KEYS = ['
|
|
19
|
+
const OPERATION_KEYS = ['write', 'delete'];
|
|
20
|
+
const ACCESS_LEVELS = ['search', 'open', 'keep'];
|
|
22
21
|
function stringList(value) {
|
|
23
22
|
if (!Array.isArray(value))
|
|
24
23
|
return null;
|
|
@@ -35,18 +34,26 @@ function parseBounds(value) {
|
|
|
35
34
|
return null;
|
|
36
35
|
bounds[key] = amount;
|
|
37
36
|
}
|
|
37
|
+
const moves = held.max_move_documents;
|
|
38
|
+
if (moves !== undefined) {
|
|
39
|
+
if (typeof moves !== 'number' || !Number.isFinite(moves))
|
|
40
|
+
return null;
|
|
41
|
+
bounds.max_move_documents = moves;
|
|
42
|
+
}
|
|
38
43
|
return bounds;
|
|
39
44
|
}
|
|
40
|
-
function
|
|
45
|
+
function parseTypedSelection(value) {
|
|
41
46
|
if (value === undefined)
|
|
42
47
|
return null;
|
|
48
|
+
return stringList(value) ?? undefined;
|
|
49
|
+
}
|
|
50
|
+
function parseMember(value) {
|
|
43
51
|
if (typeof value !== 'object' || value === null)
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return { root: held.root, paths };
|
|
52
|
+
return null;
|
|
53
|
+
const { user, name } = value;
|
|
54
|
+
if (typeof user !== 'string' || typeof name !== 'string')
|
|
55
|
+
return null;
|
|
56
|
+
return { kind: 'user', id: user, name };
|
|
50
57
|
}
|
|
51
58
|
function parseOperations(value) {
|
|
52
59
|
if (typeof value !== 'object' || value === null)
|
|
@@ -75,10 +82,15 @@ function parseAuthority(value) {
|
|
|
75
82
|
return null;
|
|
76
83
|
}
|
|
77
84
|
const at = readPosition(held);
|
|
78
|
-
const
|
|
85
|
+
const typedSelection = parseTypedSelection(held.typed_selection);
|
|
79
86
|
const protectedPaths = stringList(held.protected_paths);
|
|
80
87
|
const operations = parseOperations(held.operations);
|
|
81
|
-
|
|
88
|
+
const level = ACCESS_LEVELS.find((one) => one === held.level);
|
|
89
|
+
if (at === null ||
|
|
90
|
+
typedSelection === undefined ||
|
|
91
|
+
protectedPaths === null ||
|
|
92
|
+
level === undefined ||
|
|
93
|
+
operations === null)
|
|
82
94
|
return null;
|
|
83
95
|
if (typeof held.room_ref !== 'string' || held.room_ref.length === 0)
|
|
84
96
|
return null;
|
|
@@ -89,17 +101,33 @@ function parseAuthority(value) {
|
|
|
89
101
|
roomHandle: held.room_handle,
|
|
90
102
|
name: held.name,
|
|
91
103
|
schema: held.model_root,
|
|
92
|
-
|
|
104
|
+
typedSelection,
|
|
93
105
|
managedReplication: held.managed_replication,
|
|
94
106
|
protectedPaths,
|
|
107
|
+
level,
|
|
95
108
|
operations,
|
|
96
109
|
...at,
|
|
97
110
|
};
|
|
98
111
|
}
|
|
112
|
+
function parseAuthorities(value) {
|
|
113
|
+
if (!Array.isArray(value))
|
|
114
|
+
return null;
|
|
115
|
+
const authorities = [];
|
|
116
|
+
for (const entry of value) {
|
|
117
|
+
const authority = parseAuthority(entry);
|
|
118
|
+
if (authority === null)
|
|
119
|
+
return null;
|
|
120
|
+
authorities.push(authority);
|
|
121
|
+
}
|
|
122
|
+
return authorities;
|
|
123
|
+
}
|
|
99
124
|
export function parseDiscovery(body) {
|
|
100
125
|
if (typeof body !== 'object' || body === null)
|
|
101
126
|
return null;
|
|
102
127
|
const held = body;
|
|
128
|
+
const member = parseMember(held.member);
|
|
129
|
+
if (member === null)
|
|
130
|
+
return null;
|
|
103
131
|
const bounds = parseBounds(held.bounds);
|
|
104
132
|
if (bounds === null)
|
|
105
133
|
return null;
|
|
@@ -108,16 +136,19 @@ export function parseDiscovery(body) {
|
|
|
108
136
|
new Set(actions).size !== actions.length ||
|
|
109
137
|
actions.some((name) => name.length === 0))
|
|
110
138
|
return null;
|
|
111
|
-
|
|
139
|
+
const authorities = parseAuthorities(held.authorities);
|
|
140
|
+
return authorities === null ? null : { member, bounds, authorities, actions };
|
|
141
|
+
}
|
|
142
|
+
export function parseAuthorityChange(body) {
|
|
143
|
+
if (typeof body !== 'object' || body === null)
|
|
112
144
|
return null;
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
return { bounds, authorities, actions };
|
|
145
|
+
const held = body;
|
|
146
|
+
const member = parseMember(held.member);
|
|
147
|
+
const authorities = parseAuthorities(held.authorities);
|
|
148
|
+
const left = stringList(held.left);
|
|
149
|
+
if (member === null || authorities === null || left === null)
|
|
150
|
+
return null;
|
|
151
|
+
return { member, authorities, left };
|
|
121
152
|
}
|
|
122
153
|
function parseSiteAuthority(value) {
|
|
123
154
|
if (typeof value !== 'object' || value === null)
|
|
@@ -165,28 +196,18 @@ export function siteTracked(document) {
|
|
|
165
196
|
authority: authority.roomRef,
|
|
166
197
|
handle: authority.roomHandle,
|
|
167
198
|
schema: authority.schema,
|
|
168
|
-
|
|
169
|
-
schemas: [authority.schema],
|
|
199
|
+
typedSelection: null,
|
|
170
200
|
position: authority.position,
|
|
171
201
|
logEpoch: authority.logEpoch,
|
|
172
202
|
}));
|
|
173
203
|
}
|
|
174
|
-
export function locatorOf(authority) {
|
|
175
|
-
return authority.roomHandle === PRIVATE_HANDLE ? PRIVATE_LOCATOR : authority.roomRef;
|
|
176
|
-
}
|
|
177
|
-
function schemasOf(authority) {
|
|
178
|
-
return authority.houseModel === null
|
|
179
|
-
? [authority.schema]
|
|
180
|
-
: [authority.schema, authority.houseModel.root];
|
|
181
|
-
}
|
|
182
204
|
export function trackedFrom(document) {
|
|
183
205
|
return document.authorities.map((authority) => ({
|
|
184
|
-
locator:
|
|
206
|
+
locator: authority.roomRef,
|
|
185
207
|
authority: authority.roomRef,
|
|
186
208
|
handle: authority.roomHandle,
|
|
187
209
|
schema: authority.schema,
|
|
188
|
-
|
|
189
|
-
schemas: schemasOf(authority),
|
|
210
|
+
typedSelection: authority.typedSelection,
|
|
190
211
|
position: authority.position,
|
|
191
212
|
logEpoch: authority.logEpoch,
|
|
192
213
|
}));
|
|
@@ -198,8 +219,11 @@ export function providerLimits(bounds) {
|
|
|
198
219
|
{ name: 'change-documents', value: bounds.max_batch_documents },
|
|
199
220
|
{ name: 'path-length', value: bounds.max_path_length },
|
|
200
221
|
{ name: 'path-depth', value: bounds.max_path_depth },
|
|
222
|
+
...(bounds.max_move_documents === undefined
|
|
223
|
+
? []
|
|
224
|
+
: [{ name: 'move-documents', value: bounds.max_move_documents }]),
|
|
201
225
|
{ name: 'write-rate' },
|
|
202
|
-
{ name: '
|
|
226
|
+
{ name: 'storage-limit' },
|
|
203
227
|
];
|
|
204
228
|
}
|
|
205
229
|
export function declaredRetention(bounds) {
|
|
@@ -210,37 +234,36 @@ export function declaredRetention(bounds) {
|
|
|
210
234
|
};
|
|
211
235
|
}
|
|
212
236
|
export function capabilities(actions) {
|
|
237
|
+
return [{ name: PROVIDER_ACTIONS, actions: declaredActions(actions) }];
|
|
238
|
+
}
|
|
239
|
+
export function siteCapabilities() {
|
|
213
240
|
return [
|
|
214
241
|
{
|
|
215
242
|
name: PROVIDER_ACTIONS,
|
|
216
|
-
actions:
|
|
217
|
-
conversationAgents: HOUSE_CONVERSATION_AGENTS,
|
|
243
|
+
actions: [{ name: SITE_SUBMIT, inputShape: {}, resultKind: 'house' }],
|
|
218
244
|
},
|
|
219
245
|
];
|
|
220
246
|
}
|
|
221
|
-
export function siteCapabilities() {
|
|
222
|
-
return [
|
|
223
|
-
{ name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },
|
|
224
|
-
];
|
|
225
|
-
}
|
|
226
247
|
export function discoveredRoom(authority) {
|
|
227
|
-
const locator =
|
|
248
|
+
const locator = authority.roomRef;
|
|
228
249
|
return {
|
|
229
250
|
name: authority.name,
|
|
230
251
|
locator,
|
|
231
252
|
handle: authority.roomHandle,
|
|
232
253
|
roomVersion: roomVersion(authority),
|
|
233
254
|
operations: {
|
|
234
|
-
read: [...authority.operations.read],
|
|
235
|
-
sync: [...authority.operations.sync],
|
|
236
255
|
write: [...authority.operations.write],
|
|
237
256
|
delete: [...authority.operations.delete],
|
|
238
257
|
},
|
|
239
|
-
replica: {
|
|
240
|
-
|
|
258
|
+
replica: {
|
|
259
|
+
selection: locator,
|
|
260
|
+
admission: authority.managedReplication,
|
|
261
|
+
offline: authority.level === 'open' ? 'locked' : 'open',
|
|
262
|
+
},
|
|
263
|
+
...(authority.typedSelection === null
|
|
241
264
|
? {}
|
|
242
|
-
: { typedSelection: { roots: [...authority.
|
|
243
|
-
providerOwnedPaths: [...authority.protectedPaths,
|
|
265
|
+
: { typedSelection: { roots: [...authority.typedSelection] } }),
|
|
266
|
+
providerOwnedPaths: [...authority.protectedPaths, authority.schema],
|
|
244
267
|
};
|
|
245
268
|
}
|
|
246
269
|
export function mapDiscovery(document, rooms, declared) {
|