@agentshouse/mdruntime-adapter 0.1.0-alpha.1 → 0.1.0-alpha.10

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.
Files changed (58) hide show
  1. package/AGENTS.md +82 -0
  2. package/dist/actions.d.ts +16 -0
  3. package/dist/actions.d.ts.map +1 -0
  4. package/dist/actions.js +454 -0
  5. package/dist/actions.js.map +1 -0
  6. package/dist/adapter.d.ts +10 -0
  7. package/dist/adapter.d.ts.map +1 -0
  8. package/dist/adapter.js +285 -0
  9. package/dist/adapter.js.map +1 -0
  10. package/dist/digest.d.ts +3 -0
  11. package/dist/digest.d.ts.map +1 -0
  12. package/dist/digest.js +11 -0
  13. package/dist/digest.js.map +1 -0
  14. package/dist/discovery.d.ts +87 -0
  15. package/dist/discovery.d.ts.map +1 -0
  16. package/dist/discovery.js +347 -0
  17. package/dist/discovery.js.map +1 -0
  18. package/dist/index.d.ts +3 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/map.d.ts +3 -0
  23. package/dist/map.d.ts.map +1 -0
  24. package/dist/map.js +15 -0
  25. package/dist/map.js.map +1 -0
  26. package/dist/model.d.ts +19 -0
  27. package/dist/model.d.ts.map +1 -0
  28. package/dist/model.js +64 -0
  29. package/dist/model.js.map +1 -0
  30. package/dist/read.d.ts +73 -0
  31. package/dist/read.d.ts.map +1 -0
  32. package/dist/read.js +326 -0
  33. package/dist/read.js.map +1 -0
  34. package/dist/refusal.d.ts +11 -0
  35. package/dist/refusal.d.ts.map +1 -0
  36. package/dist/refusal.js +78 -0
  37. package/dist/refusal.js.map +1 -0
  38. package/dist/site.d.ts +4 -0
  39. package/dist/site.d.ts.map +1 -0
  40. package/dist/site.js +200 -0
  41. package/dist/site.js.map +1 -0
  42. package/dist/stream.d.ts +12 -0
  43. package/dist/stream.d.ts.map +1 -0
  44. package/dist/stream.js +298 -0
  45. package/dist/stream.js.map +1 -0
  46. package/dist/transport.d.ts +88 -0
  47. package/dist/transport.d.ts.map +1 -0
  48. package/dist/transport.js +12 -0
  49. package/dist/transport.js.map +1 -0
  50. package/dist/version.d.ts +14 -0
  51. package/dist/version.d.ts.map +1 -0
  52. package/dist/version.js +29 -0
  53. package/dist/version.js.map +1 -0
  54. package/dist/write.d.ts +47 -0
  55. package/dist/write.d.ts.map +1 -0
  56. package/dist/write.js +389 -0
  57. package/dist/write.js.map +1 -0
  58. package/package.json +7 -2
@@ -0,0 +1,347 @@
1
+ import { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';
2
+ import { PRIVATE_AUTHORITY } from './transport.js';
3
+ import { readPosition, roomVersion } from './version.js';
4
+ export const ROOM_CONTRACT_VERSION = 1;
5
+ export const MD_MODEL_IDENTITY = '@agentshouse/mdmodel';
6
+ export const ROOM_VERSION_NOTIFICATIONS = 'room-version-notifications';
7
+ export const PROVIDER_ACTIONS = 'provider-actions';
8
+ export const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';
9
+ export const DISCOVER_PREFIXES = [
10
+ '/'
11
+ ];
12
+ export const PROVIDER_SELECTION_ROOTS = [
13
+ 'agents',
14
+ 'house'
15
+ ];
16
+ export const PROVIDER_SELECTION_MODEL_ROOT = 'house/settings/model';
17
+ const BOUND_KEYS = [
18
+ 'max_authored_file_bytes',
19
+ 'max_batch_operations',
20
+ 'max_path_length',
21
+ 'max_path_depth',
22
+ 'max_mount_files',
23
+ 'max_mount_bytes',
24
+ 'change_retention_seconds',
25
+ 'operation_retention_seconds'
26
+ ];
27
+ const OPERATION_KEYS = [
28
+ 'read',
29
+ 'sync',
30
+ 'write',
31
+ 'delete'
32
+ ];
33
+ function stringList(value) {
34
+ if (!Array.isArray(value)) return null;
35
+ return value.every((entry)=>typeof entry === 'string') ? value : null;
36
+ }
37
+ function parseBounds(value) {
38
+ if (typeof value !== 'object' || value === null) return null;
39
+ const held = value;
40
+ const bounds = {};
41
+ for (const key of BOUND_KEYS){
42
+ const amount = held[key];
43
+ if (typeof amount !== 'number' || !Number.isFinite(amount)) return null;
44
+ bounds[key] = amount;
45
+ }
46
+ return bounds;
47
+ }
48
+ function parseOperations(value) {
49
+ if (typeof value !== 'object' || value === null) return null;
50
+ const held = value;
51
+ const operations = {};
52
+ for (const key of OPERATION_KEYS){
53
+ const scopes = stringList(held[key]);
54
+ if (scopes === null) return null;
55
+ operations[key] = scopes;
56
+ }
57
+ return operations;
58
+ }
59
+ function parseAuthority(value) {
60
+ if (typeof value !== 'object' || value === null) return null;
61
+ const held = value;
62
+ if (held.kind !== 'room' && held.kind !== 'private') return null;
63
+ if (typeof held.name !== 'string' || held.name.length === 0) return null;
64
+ if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;
65
+ if (held.managed_replication !== 'admitted' && held.managed_replication !== 'unavailable') {
66
+ return null;
67
+ }
68
+ const at = readPosition(held);
69
+ const protectedPaths = stringList(held.protected_paths);
70
+ const operations = parseOperations(held.operations);
71
+ if (at === null || protectedPaths === null || operations === null) return null;
72
+ if (held.kind === 'private') {
73
+ return {
74
+ kind: 'private',
75
+ roomRef: PRIVATE_AUTHORITY,
76
+ roomHandle: null,
77
+ name: held.name,
78
+ collectionRoot: held.collection_root,
79
+ modelRoot: held.model_root,
80
+ managedReplication: held.managed_replication,
81
+ protectedPaths,
82
+ operations,
83
+ ...at
84
+ };
85
+ }
86
+ if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
87
+ if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;
88
+ return {
89
+ kind: 'room',
90
+ roomRef: held.room_ref,
91
+ roomHandle: held.room_handle,
92
+ name: held.name,
93
+ collectionRoot: held.collection_root,
94
+ modelRoot: held.model_root,
95
+ managedReplication: held.managed_replication,
96
+ protectedPaths,
97
+ operations,
98
+ ...at
99
+ };
100
+ }
101
+ export function parseDiscovery(body) {
102
+ if (typeof body !== 'object' || body === null) return null;
103
+ const held = body;
104
+ const bounds = parseBounds(held.bounds);
105
+ if (bounds === null) return null;
106
+ if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;
107
+ if (!Array.isArray(held.authorities)) return null;
108
+ const authorities = [];
109
+ for (const entry of held.authorities){
110
+ const authority = parseAuthority(entry);
111
+ if (authority === null) return null;
112
+ authorities.push(authority);
113
+ }
114
+ return {
115
+ bounds,
116
+ mdModelVersion: held.md_model_version,
117
+ authorities
118
+ };
119
+ }
120
+ function parseSiteEntry(value) {
121
+ if (typeof value !== 'object' || value === null) return null;
122
+ const held = value;
123
+ if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
124
+ if (typeof held.segment !== 'string' || held.segment.length === 0) return null;
125
+ return {
126
+ roomRef: held.room_ref,
127
+ segment: held.segment
128
+ };
129
+ }
130
+ function parseSiteSlot(value) {
131
+ if (typeof value !== 'object' || value === null) return null;
132
+ const held = value;
133
+ if (typeof held.slot !== 'string' || held.slot.length === 0) return null;
134
+ if (!Array.isArray(held.entries)) return null;
135
+ const entries = [];
136
+ for (const entry of held.entries){
137
+ const parsed = parseSiteEntry(entry);
138
+ if (parsed === null) return null;
139
+ entries.push(parsed);
140
+ }
141
+ return {
142
+ slot: held.slot,
143
+ entries
144
+ };
145
+ }
146
+ function parseSiteAuthority(value) {
147
+ if (typeof value !== 'object' || value === null) return null;
148
+ const held = value;
149
+ if (held.kind !== 'room') return null;
150
+ if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
151
+ if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;
152
+ if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;
153
+ const at = readPosition(held);
154
+ if (at === null) return null;
155
+ return {
156
+ roomRef: held.room_ref,
157
+ roomHandle: held.room_handle,
158
+ collectionRoot: held.collection_root,
159
+ modelRoot: held.model_root,
160
+ ...at
161
+ };
162
+ }
163
+ export function parseSiteDiscovery(body) {
164
+ if (typeof body !== 'object' || body === null) return null;
165
+ const held = body;
166
+ const bounds = parseBounds(held.bounds);
167
+ if (bounds === null) return null;
168
+ if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;
169
+ if (!Array.isArray(held.slots) || !Array.isArray(held.authorities)) return null;
170
+ const slots = [];
171
+ for (const entry of held.slots){
172
+ const slot = parseSiteSlot(entry);
173
+ if (slot === null) return null;
174
+ slots.push(slot);
175
+ }
176
+ const authorities = [];
177
+ for (const entry of held.authorities){
178
+ const authority = parseSiteAuthority(entry);
179
+ if (authority === null) return null;
180
+ authorities.push(authority);
181
+ }
182
+ return {
183
+ bounds,
184
+ mdModelVersion: held.md_model_version,
185
+ slots,
186
+ authorities
187
+ };
188
+ }
189
+ export function siteTracked(document) {
190
+ return document.authorities.map((authority)=>({
191
+ locator: authority.roomRef,
192
+ authority: authority.roomRef,
193
+ handle: authority.roomHandle,
194
+ collectionRoot: authority.collectionRoot,
195
+ modelRoot: authority.modelRoot,
196
+ modelRoots: [
197
+ authority.modelRoot
198
+ ],
199
+ position: authority.position,
200
+ logEpoch: authority.logEpoch
201
+ }));
202
+ }
203
+ export function siteSlots(document) {
204
+ return document.slots.map(({ slot, entries })=>({
205
+ slot,
206
+ entries: entries.map(({ roomRef, segment })=>({
207
+ locator: roomRef,
208
+ segment
209
+ }))
210
+ }));
211
+ }
212
+ export function locatorOf(authority) {
213
+ return authority.roomHandle ?? PRIVATE_AUTHORITY;
214
+ }
215
+ export function trackedFrom(document) {
216
+ return document.authorities.map((authority)=>({
217
+ locator: locatorOf(authority),
218
+ authority: authority.roomRef,
219
+ handle: authority.roomHandle ?? undefined,
220
+ collectionRoot: authority.collectionRoot,
221
+ modelRoot: authority.modelRoot,
222
+ modelRoots: authority.kind === 'private' ? [
223
+ authority.modelRoot,
224
+ PROVIDER_SELECTION_MODEL_ROOT
225
+ ] : [
226
+ authority.modelRoot
227
+ ],
228
+ position: authority.position,
229
+ logEpoch: authority.logEpoch
230
+ }));
231
+ }
232
+ export function providerLimits(bounds) {
233
+ return [
234
+ {
235
+ name: 'document-size',
236
+ value: bounds.max_authored_file_bytes
237
+ },
238
+ {
239
+ name: 'change-batch-operations',
240
+ value: bounds.max_batch_operations
241
+ },
242
+ {
243
+ name: 'path-length',
244
+ value: bounds.max_path_length
245
+ },
246
+ {
247
+ name: 'path-depth',
248
+ value: bounds.max_path_depth
249
+ },
250
+ {
251
+ name: 'write-rate'
252
+ },
253
+ {
254
+ name: 'content-ceiling'
255
+ }
256
+ ];
257
+ }
258
+ export function declaredRetention(bounds) {
259
+ return {
260
+ history: {
261
+ kind: 'no-declared-time-bound'
262
+ },
263
+ outcome: bounds.operation_retention_seconds,
264
+ refreshHorizon: bounds.change_retention_seconds
265
+ };
266
+ }
267
+ export function capabilities() {
268
+ return [
269
+ {
270
+ name: ROOM_VERSION_NOTIFICATIONS
271
+ },
272
+ {
273
+ name: PROVIDER_ACTIONS,
274
+ actions: declaredActions(),
275
+ conversationCards: HOUSE_CONVERSATION_CARDS
276
+ },
277
+ {
278
+ name: MOVE_REFERENCE_REWRITES
279
+ }
280
+ ];
281
+ }
282
+ export function siteCapabilities() {
283
+ return [
284
+ {
285
+ name: ROOM_VERSION_NOTIFICATIONS
286
+ }
287
+ ];
288
+ }
289
+ export function providerSelection(attachedModel) {
290
+ return {
291
+ roots: [
292
+ ...PROVIDER_SELECTION_ROOTS
293
+ ],
294
+ attachedModel
295
+ };
296
+ }
297
+ export function discoveredRoom(authority, attachedModel, typedSelection) {
298
+ return {
299
+ name: authority.name,
300
+ locator: locatorOf(authority),
301
+ collectionRoot: authority.collectionRoot,
302
+ roomVersion: roomVersion(authority),
303
+ operations: {
304
+ read: [
305
+ ...authority.operations.read
306
+ ],
307
+ sync: [
308
+ ...authority.operations.sync
309
+ ],
310
+ write: [
311
+ ...authority.operations.write
312
+ ],
313
+ delete: [
314
+ ...authority.operations.delete
315
+ ]
316
+ },
317
+ replica: {
318
+ selection: locatorOf(authority),
319
+ admission: authority.managedReplication
320
+ },
321
+ attachedModel,
322
+ ...typedSelection === undefined ? {} : {
323
+ typedSelection
324
+ },
325
+ providerOwnedPaths: [
326
+ ...authority.protectedPaths
327
+ ]
328
+ };
329
+ }
330
+ export function mapDiscovery(document, rooms, declared) {
331
+ return {
332
+ kind: 'discovery',
333
+ supportedVersions: [
334
+ ROOM_CONTRACT_VERSION
335
+ ],
336
+ mdModel: {
337
+ identity: MD_MODEL_IDENTITY,
338
+ version: document.mdModelVersion
339
+ },
340
+ rooms,
341
+ capabilities: declared,
342
+ providerLimits: providerLimits(document.bounds),
343
+ retention: declaredRetention(document.bounds)
344
+ };
345
+ }
346
+
347
+ //# sourceMappingURL=discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/discovery.ts"],"sourcesContent":["import type {\n Capability,\n DiscoveredRoom,\n Discovery,\n ProviderLimit,\n Retention,\n TypedSelection,\n} from '@agentshouse/mdruntime';\nimport { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';\nimport { PRIVATE_AUTHORITY } from './transport.js';\nimport { readPosition, roomVersion, type LogPosition } from './version.js';\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const MD_MODEL_IDENTITY = '@agentshouse/mdmodel';\n\nexport const ROOM_VERSION_NOTIFICATIONS = 'room-version-notifications';\n\nexport const PROVIDER_ACTIONS = 'provider-actions';\n\nexport const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';\n\nexport const DISCOVER_PREFIXES: readonly string[] = ['/'];\n\nexport const PROVIDER_SELECTION_ROOTS: readonly string[] = ['agents', 'house'];\n\nexport const PROVIDER_SELECTION_MODEL_ROOT = 'house/settings/model';\n\nexport type HouseBounds = {\n max_authored_file_bytes: number;\n max_batch_operations: number;\n max_path_length: number;\n max_path_depth: number;\n max_mount_files: number;\n max_mount_bytes: number;\n change_retention_seconds: number;\n operation_retention_seconds: number;\n};\n\nexport type HouseOperations = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\n\nexport type HouseAuthority = LogPosition & {\n kind: 'room' | 'private';\n roomRef: string;\n roomHandle: string | null;\n name: string;\n collectionRoot: string;\n modelRoot: string;\n managedReplication: 'admitted' | 'unavailable';\n protectedPaths: readonly string[];\n operations: HouseOperations;\n};\n\nexport type HouseDiscoveryDocument = {\n bounds: HouseBounds;\n mdModelVersion: string;\n authorities: readonly HouseAuthority[];\n};\n\nexport type TrackedAuthority = LogPosition & {\n locator: string;\n authority: string;\n handle: string | undefined;\n collectionRoot: string;\n modelRoot: string;\n modelRoots: readonly string[];\n};\n\nexport type HouseSiteEntry = {\n roomRef: string;\n segment: string;\n};\n\nexport type HouseSiteSlot = {\n slot: string;\n entries: readonly HouseSiteEntry[];\n};\n\nexport type HouseSiteAuthority = LogPosition & {\n roomRef: string;\n roomHandle: string;\n collectionRoot: string;\n modelRoot: string;\n};\n\nexport type HouseSiteDiscovery = {\n bounds: HouseBounds;\n mdModelVersion: string;\n slots: readonly HouseSiteSlot[];\n authorities: readonly HouseSiteAuthority[];\n};\n\nexport type SiteTracked = TrackedAuthority & { handle: string };\n\nconst BOUND_KEYS: readonly (keyof HouseBounds)[] = [\n 'max_authored_file_bytes',\n 'max_batch_operations',\n 'max_path_length',\n 'max_path_depth',\n 'max_mount_files',\n 'max_mount_bytes',\n 'change_retention_seconds',\n 'operation_retention_seconds',\n];\n\nconst OPERATION_KEYS: readonly (keyof HouseOperations)[] = ['read', 'sync', 'write', 'delete'];\n\nfunction stringList(value: unknown): readonly string[] | null {\n if (!Array.isArray(value)) return null;\n return value.every((entry) => typeof entry === 'string') ? (value as string[]) : null;\n}\n\nfunction parseBounds(value: unknown): HouseBounds | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const bounds: Partial<HouseBounds> = {};\n for (const key of BOUND_KEYS) {\n const amount = held[key];\n if (typeof amount !== 'number' || !Number.isFinite(amount)) return null;\n bounds[key] = amount;\n }\n return bounds as HouseBounds;\n}\n\nfunction parseOperations(value: unknown): HouseOperations | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const operations: Partial<Record<keyof HouseOperations, readonly string[]>> = {};\n for (const key of OPERATION_KEYS) {\n const scopes = stringList(held[key]);\n if (scopes === null) return null;\n operations[key] = scopes;\n }\n return operations as HouseOperations;\n}\n\nfunction parseAuthority(value: unknown): HouseAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room' && held.kind !== 'private') return null;\n if (typeof held.name !== 'string' || held.name.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n if (held.managed_replication !== 'admitted' && held.managed_replication !== 'unavailable') {\n return null;\n }\n const at = readPosition(held);\n const protectedPaths = stringList(held.protected_paths);\n const operations = parseOperations(held.operations);\n if (at === null || protectedPaths === null || operations === null) return null;\n if (held.kind === 'private') {\n return {\n kind: 'private',\n roomRef: PRIVATE_AUTHORITY,\n roomHandle: null,\n name: held.name,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n managedReplication: held.managed_replication,\n protectedPaths,\n operations,\n ...at,\n };\n }\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;\n return {\n kind: 'room',\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n name: held.name,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n managedReplication: held.managed_replication,\n protectedPaths,\n operations,\n ...at,\n };\n}\n\nexport function parseDiscovery(body: unknown): HouseDiscoveryDocument | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n if (!Array.isArray(held.authorities)) return null;\n const authorities: HouseAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, authorities };\n}\n\nfunction parseSiteEntry(value: unknown): HouseSiteEntry | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.segment !== 'string' || held.segment.length === 0) return null;\n return { roomRef: held.room_ref, segment: held.segment };\n}\n\nfunction parseSiteSlot(value: unknown): HouseSiteSlot | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.slot !== 'string' || held.slot.length === 0) return null;\n if (!Array.isArray(held.entries)) return null;\n const entries: HouseSiteEntry[] = [];\n for (const entry of held.entries) {\n const parsed = parseSiteEntry(entry);\n if (parsed === null) return null;\n entries.push(parsed);\n }\n return { slot: held.slot, entries };\n}\n\nfunction parseSiteAuthority(value: unknown): HouseSiteAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room') return null;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n const at = readPosition(held);\n if (at === null) return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n ...at,\n };\n}\n\nexport function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n if (!Array.isArray(held.slots) || !Array.isArray(held.authorities)) return null;\n const slots: HouseSiteSlot[] = [];\n for (const entry of held.slots) {\n const slot = parseSiteSlot(entry);\n if (slot === null) return null;\n slots.push(slot);\n }\n const authorities: HouseSiteAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseSiteAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, slots, authorities };\n}\n\nexport function siteTracked(document: HouseSiteDiscovery): SiteTracked[] {\n return document.authorities.map((authority) => ({\n locator: authority.roomRef,\n authority: authority.roomRef,\n handle: authority.roomHandle,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots: [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function siteSlots(document: HouseSiteDiscovery): Discovery['slots'] {\n return document.slots.map(({ slot, entries }) => ({\n slot,\n entries: entries.map(({ roomRef, segment }) => ({ locator: roomRef, segment })),\n }));\n}\n\nexport function locatorOf(authority: HouseAuthority): string {\n return authority.roomHandle ?? PRIVATE_AUTHORITY;\n}\n\nexport function trackedFrom(document: HouseDiscoveryDocument): TrackedAuthority[] {\n return document.authorities.map((authority) => ({\n locator: locatorOf(authority),\n authority: authority.roomRef,\n handle: authority.roomHandle ?? undefined,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots:\n authority.kind === 'private'\n ? [authority.modelRoot, PROVIDER_SELECTION_MODEL_ROOT]\n : [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function providerLimits(bounds: HouseBounds): readonly ProviderLimit[] {\n return [\n { name: 'document-size', value: bounds.max_authored_file_bytes },\n { name: 'change-batch-operations', value: bounds.max_batch_operations },\n { name: 'path-length', value: bounds.max_path_length },\n { name: 'path-depth', value: bounds.max_path_depth },\n { name: 'write-rate' },\n { name: 'content-ceiling' },\n ];\n}\n\nexport function declaredRetention(bounds: HouseBounds): Retention {\n return {\n history: { kind: 'no-declared-time-bound' },\n outcome: bounds.operation_retention_seconds,\n refreshHorizon: bounds.change_retention_seconds,\n };\n}\n\nexport function capabilities(): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n {\n name: PROVIDER_ACTIONS,\n actions: declaredActions(),\n conversationCards: HOUSE_CONVERSATION_CARDS,\n },\n { name: MOVE_REFERENCE_REWRITES },\n ];\n}\n\nexport function siteCapabilities(): readonly Capability[] {\n return [{ name: ROOM_VERSION_NOTIFICATIONS }];\n}\n\nexport function providerSelection(attachedModel: TypedSelection['attachedModel']): TypedSelection {\n return { roots: [...PROVIDER_SELECTION_ROOTS], attachedModel };\n}\n\nexport function discoveredRoom(\n authority: HouseAuthority,\n attachedModel: DiscoveredRoom['attachedModel'],\n typedSelection: TypedSelection | undefined,\n): DiscoveredRoom {\n return {\n name: authority.name,\n locator: locatorOf(authority),\n collectionRoot: authority.collectionRoot,\n roomVersion: roomVersion(authority),\n operations: {\n read: [...authority.operations.read],\n sync: [...authority.operations.sync],\n write: [...authority.operations.write],\n delete: [...authority.operations.delete],\n },\n replica: { selection: locatorOf(authority), admission: authority.managedReplication },\n attachedModel,\n ...(typedSelection === undefined ? {} : { typedSelection }),\n providerOwnedPaths: [...authority.protectedPaths],\n };\n}\n\nexport function mapDiscovery(\n document: Pick<HouseDiscoveryDocument, 'bounds' | 'mdModelVersion'>,\n rooms: readonly DiscoveredRoom[],\n declared: readonly Capability[],\n): Discovery {\n return {\n kind: 'discovery',\n supportedVersions: [ROOM_CONTRACT_VERSION],\n mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },\n rooms,\n capabilities: declared,\n providerLimits: providerLimits(document.bounds),\n retention: declaredRetention(document.bounds),\n };\n}\n"],"names":["declaredActions","HOUSE_CONVERSATION_CARDS","PRIVATE_AUTHORITY","readPosition","roomVersion","ROOM_CONTRACT_VERSION","MD_MODEL_IDENTITY","ROOM_VERSION_NOTIFICATIONS","PROVIDER_ACTIONS","MOVE_REFERENCE_REWRITES","DISCOVER_PREFIXES","PROVIDER_SELECTION_ROOTS","PROVIDER_SELECTION_MODEL_ROOT","BOUND_KEYS","OPERATION_KEYS","stringList","value","Array","isArray","every","entry","parseBounds","held","bounds","key","amount","Number","isFinite","parseOperations","operations","scopes","parseAuthority","kind","name","length","collection_root","model_root","managed_replication","at","protectedPaths","protected_paths","roomRef","roomHandle","collectionRoot","modelRoot","managedReplication","room_ref","room_handle","parseDiscovery","body","md_model_version","authorities","authority","push","mdModelVersion","parseSiteEntry","segment","parseSiteSlot","slot","entries","parsed","parseSiteAuthority","parseSiteDiscovery","slots","siteTracked","document","map","locator","handle","modelRoots","position","logEpoch","siteSlots","locatorOf","trackedFrom","undefined","providerLimits","max_authored_file_bytes","max_batch_operations","max_path_length","max_path_depth","declaredRetention","history","outcome","operation_retention_seconds","refreshHorizon","change_retention_seconds","capabilities","actions","conversationCards","siteCapabilities","providerSelection","attachedModel","roots","discoveredRoom","typedSelection","read","sync","write","delete","replica","selection","admission","providerOwnedPaths","mapDiscovery","rooms","declared","supportedVersions","mdModel","identity","version","retention"],"mappings":"AAQA,SAASA,eAAe,EAAEC,wBAAwB,QAAQ,eAAe;AACzE,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,YAAY,EAAEC,WAAW,QAA0B,eAAe;AAE3E,OAAO,MAAMC,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,oBAAoB,uBAAuB;AAExD,OAAO,MAAMC,6BAA6B,6BAA6B;AAEvE,OAAO,MAAMC,mBAAmB,mBAAmB;AAEnD,OAAO,MAAMC,0BAA0B,0BAA0B;AAEjE,OAAO,MAAMC,oBAAuC;IAAC;CAAI,CAAC;AAE1D,OAAO,MAAMC,2BAA8C;IAAC;IAAU;CAAQ,CAAC;AAE/E,OAAO,MAAMC,gCAAgC,uBAAuB;AAyEpE,MAAMC,aAA6C;IACjD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,iBAAqD;IAAC;IAAQ;IAAQ;IAAS;CAAS;AAE9F,SAASC,WAAWC,KAAc;IAChC,IAAI,CAACC,MAAMC,OAAO,CAACF,QAAQ,OAAO;IAClC,OAAOA,MAAMG,KAAK,CAAC,CAACC,QAAU,OAAOA,UAAU,YAAaJ,QAAqB;AACnF;AAEA,SAASK,YAAYL,KAAc;IACjC,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;SAAC;IACnD;AACF;AAEA,OAAO,SAASiE,aACdvC,QAAmE,EACnEwC,KAAgC,EAChCC,QAA+B;IAE/B,OAAO;QACL1E,MAAM;QACN2E,mBAAmB;YAACtG;SAAsB;QAC1CuG,SAAS;YAAEC,UAAUvG;YAAmBwG,SAAS7C,SAASX,cAAc;QAAC;QACzEmD;QACAlB,cAAcmB;QACd9B,gBAAgBA,eAAeX,SAAS1C,MAAM;QAC9CwF,WAAW9B,kBAAkBhB,SAAS1C,MAAM;IAC9C;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export {};
1
+ export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
2
+ export { nativePath, roomLocalPath } from './map.js';
3
+ export type { HouseByteAct, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamAuthority, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
- export { };
1
+ export { createAgentsHouseAdapter } from './adapter.js';
2
+ export { nativePath, roomLocalPath } from './map.js';
2
3
 
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/index.ts"],"sourcesContent":["export {};\n"],"names":[],"mappings":"AAAA,WAAU"}
1
+ {"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/index.ts"],"sourcesContent":["export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';\nexport { nativePath, roomLocalPath } from './map.js';\nexport type {\n HouseByteAct,\n HouseByteTransfer,\n HouseDoorAnswer,\n HouseStream,\n HouseStreamAuthority,\n HouseStreamEntry,\n HouseStreamFrame,\n HouseSiteTransport,\n HouseTransport,\n} from './transport.js';\n"],"names":["createAgentsHouseAdapter","nativePath","roomLocalPath"],"mappings":"AAAA,SAASA,wBAAwB,QAAwC,eAAe;AACxF,SAASC,UAAU,EAAEC,aAAa,QAAQ,WAAW"}
package/dist/map.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare function roomLocalPath(path: string, handle?: string): string;
2
+ export declare function nativePath(path: string, handle?: string): string;
3
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAUnE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhE"}
package/dist/map.js ADDED
@@ -0,0 +1,15 @@
1
+ export function roomLocalPath(path, handle) {
2
+ const prefix = handle === undefined ? '/private/' : `/rooms/${handle}/`;
3
+ const local = path.startsWith(prefix) ? path.slice(prefix.length) : path;
4
+ if (local === '' || local.split('/').some((part)=>part === '' || part === '.' || part === '..')) {
5
+ throw new Error('invalid authority-relative path');
6
+ }
7
+ return local;
8
+ }
9
+ export function nativePath(path, handle) {
10
+ if (path.startsWith('/')) throw new Error('canonical Room path required');
11
+ const local = roomLocalPath(path);
12
+ return handle === undefined ? `/private/${local}` : `/rooms/${handle}/${local}`;
13
+ }
14
+
15
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/map.ts"],"sourcesContent":["export function roomLocalPath(path: string, handle?: string): string {\n const prefix = handle === undefined ? '/private/' : `/rooms/${handle}/`;\n const local = path.startsWith(prefix) ? path.slice(prefix.length) : path;\n if (\n local === '' ||\n local.split('/').some((part) => part === '' || part === '.' || part === '..')\n ) {\n throw new Error('invalid authority-relative path');\n }\n return local;\n}\n\nexport function nativePath(path: string, handle?: string): string {\n if (path.startsWith('/')) throw new Error('canonical Room path required');\n const local = roomLocalPath(path);\n return handle === undefined ? `/private/${local}` : `/rooms/${handle}/${local}`;\n}\n"],"names":["roomLocalPath","path","handle","prefix","undefined","local","startsWith","slice","length","split","some","part","Error","nativePath"],"mappings":"AAAA,OAAO,SAASA,cAAcC,IAAY,EAAEC,MAAe;IACzD,MAAMC,SAASD,WAAWE,YAAY,cAAc,CAAC,OAAO,EAAEF,OAAO,CAAC,CAAC;IACvE,MAAMG,QAAQJ,KAAKK,UAAU,CAACH,UAAUF,KAAKM,KAAK,CAACJ,OAAOK,MAAM,IAAIP;IACpE,IACEI,UAAU,MACVA,MAAMI,KAAK,CAAC,KAAKC,IAAI,CAAC,CAACC,OAASA,SAAS,MAAMA,SAAS,OAAOA,SAAS,OACxE;QACA,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOP;AACT;AAEA,OAAO,SAASQ,WAAWZ,IAAY,EAAEC,MAAe;IACtD,IAAID,KAAKK,UAAU,CAAC,MAAM,MAAM,IAAIM,MAAM;IAC1C,MAAMP,QAAQL,cAAcC;IAC5B,OAAOC,WAAWE,YAAY,CAAC,SAAS,EAAEC,OAAO,GAAG,CAAC,OAAO,EAAEH,OAAO,CAAC,EAAEG,OAAO;AACjF"}
@@ -0,0 +1,19 @@
1
+ import type { AdapterFailure, ModelIdentity, ModelRequest, ModelResult } from '@agentshouse/mdruntime';
2
+ import type { HouseDefinitions } from './read.js';
3
+ export type HeldModel = {
4
+ snapshot: ModelResult;
5
+ identity: ModelIdentity | null;
6
+ };
7
+ export declare const MODEL_ABSENT: ModelResult;
8
+ export declare function failedModel(failure: AdapterFailure | {
9
+ kind: 'beyond-horizon';
10
+ }): ModelResult;
11
+ export declare function modelKey(locator: string, attached: ModelRequest['attached']): string;
12
+ export declare function heldModel(read: HouseDefinitions | null, identity: string, failure: ModelResult): Promise<HeldModel>;
13
+ export type ModelShelf = {
14
+ retain(key: string, acquired: HeldModel | undefined): HeldModel | undefined;
15
+ answer(request: ModelRequest): ModelResult;
16
+ keep(locators: readonly string[]): void;
17
+ };
18
+ export declare function modelShelf(): ModelShelf;
19
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,CAAC;AAElF,eAAO,MAAM,YAAY,EAAE,WAAmE,CAAC;AAE/F,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAAG,WAAW,CAI7F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,MAAM,CAEpF;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,CAAC,CAOpB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5E,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,UAAU,IAAI,UAAU,CAqBvC"}
package/dist/model.js ADDED
@@ -0,0 +1,64 @@
1
+ import { sha256Hex } from './digest.js';
2
+ export const MODEL_ABSENT = {
3
+ kind: 'model-unavailable',
4
+ reason: 'not-readable'
5
+ };
6
+ export function failedModel(failure) {
7
+ if (failure.kind === 'revoked-authorization') return {
8
+ kind: 'revoked-authorization'
9
+ };
10
+ if (failure.kind === 'transport-uncertainty') return {
11
+ kind: 'transport-uncertainty'
12
+ };
13
+ return MODEL_ABSENT;
14
+ }
15
+ export function modelKey(locator, attached) {
16
+ return `${locator} ${attached}`;
17
+ }
18
+ export async function heldModel(read, identity, failure) {
19
+ if (read === null) return {
20
+ snapshot: failure,
21
+ identity: null
22
+ };
23
+ const version = await sha256Hex(JSON.stringify(read.versions));
24
+ return {
25
+ snapshot: {
26
+ kind: 'model',
27
+ snapshot: {
28
+ identity,
29
+ version,
30
+ definitions: read.definitions
31
+ }
32
+ },
33
+ identity: {
34
+ identity,
35
+ version
36
+ }
37
+ };
38
+ }
39
+ export function modelShelf() {
40
+ const models = new Map();
41
+ return {
42
+ retain (key, acquired) {
43
+ if (acquired === undefined) return models.get(key);
44
+ if (acquired.snapshot.kind === 'transport-uncertainty') {
45
+ const previous = models.get(key);
46
+ if (previous !== undefined && previous.identity !== null) return previous;
47
+ }
48
+ models.set(key, acquired);
49
+ return acquired;
50
+ },
51
+ answer (request) {
52
+ return models.get(modelKey(request.locator, request.attached))?.snapshot ?? MODEL_ABSENT;
53
+ },
54
+ keep (locators) {
55
+ for (const key of [
56
+ ...models.keys()
57
+ ]){
58
+ if (!locators.some((locator)=>key.startsWith(`${locator} `))) models.delete(key);
59
+ }
60
+ }
61
+ };
62
+ }
63
+
64
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/model.ts"],"sourcesContent":["import type {\n AdapterFailure,\n ModelIdentity,\n ModelRequest,\n ModelResult,\n} from '@agentshouse/mdruntime';\nimport { sha256Hex } from './digest.js';\nimport type { HouseDefinitions } from './read.js';\n\nexport type HeldModel = { snapshot: ModelResult; identity: ModelIdentity | null };\n\nexport const MODEL_ABSENT: ModelResult = { kind: 'model-unavailable', reason: 'not-readable' };\n\nexport function failedModel(failure: AdapterFailure | { kind: 'beyond-horizon' }): ModelResult {\n if (failure.kind === 'revoked-authorization') return { kind: 'revoked-authorization' };\n if (failure.kind === 'transport-uncertainty') return { kind: 'transport-uncertainty' };\n return MODEL_ABSENT;\n}\n\nexport function modelKey(locator: string, attached: ModelRequest['attached']): string {\n return `${locator} ${attached}`;\n}\n\nexport async function heldModel(\n read: HouseDefinitions | null,\n identity: string,\n failure: ModelResult,\n): Promise<HeldModel> {\n if (read === null) return { snapshot: failure, identity: null };\n const version = await sha256Hex(JSON.stringify(read.versions));\n return {\n snapshot: { kind: 'model', snapshot: { identity, version, definitions: read.definitions } },\n identity: { identity, version },\n };\n}\n\nexport type ModelShelf = {\n retain(key: string, acquired: HeldModel | undefined): HeldModel | undefined;\n answer(request: ModelRequest): ModelResult;\n keep(locators: readonly string[]): void;\n};\n\nexport function modelShelf(): ModelShelf {\n const models = new Map<string, HeldModel>();\n return {\n retain(key, acquired) {\n if (acquired === undefined) return models.get(key);\n if (acquired.snapshot.kind === 'transport-uncertainty') {\n const previous = models.get(key);\n if (previous !== undefined && previous.identity !== null) return previous;\n }\n models.set(key, acquired);\n return acquired;\n },\n answer(request) {\n return models.get(modelKey(request.locator, request.attached))?.snapshot ?? MODEL_ABSENT;\n },\n keep(locators) {\n for (const key of [...models.keys()]) {\n if (!locators.some((locator) => key.startsWith(`${locator} `))) models.delete(key);\n }\n },\n };\n}\n"],"names":["sha256Hex","MODEL_ABSENT","kind","reason","failedModel","failure","modelKey","locator","attached","heldModel","read","identity","snapshot","version","JSON","stringify","versions","definitions","modelShelf","models","Map","retain","key","acquired","undefined","get","previous","set","answer","request","keep","locators","keys","some","startsWith","delete"],"mappings":"AAMA,SAASA,SAAS,QAAQ,cAAc;AAKxC,OAAO,MAAMC,eAA4B;IAAEC,MAAM;IAAqBC,QAAQ;AAAe,EAAE;AAE/F,OAAO,SAASC,YAAYC,OAAoD;IAC9E,IAAIA,QAAQH,IAAI,KAAK,yBAAyB,OAAO;QAAEA,MAAM;IAAwB;IACrF,IAAIG,QAAQH,IAAI,KAAK,yBAAyB,OAAO;QAAEA,MAAM;IAAwB;IACrF,OAAOD;AACT;AAEA,OAAO,SAASK,SAASC,OAAe,EAAEC,QAAkC;IAC1E,OAAO,GAAGD,QAAQ,CAAC,EAAEC,UAAU;AACjC;AAEA,OAAO,eAAeC,UACpBC,IAA6B,EAC7BC,QAAgB,EAChBN,OAAoB;IAEpB,IAAIK,SAAS,MAAM,OAAO;QAAEE,UAAUP;QAASM,UAAU;IAAK;IAC9D,MAAME,UAAU,MAAMb,UAAUc,KAAKC,SAAS,CAACL,KAAKM,QAAQ;IAC5D,OAAO;QACLJ,UAAU;YAAEV,MAAM;YAASU,UAAU;gBAAED;gBAAUE;gBAASI,aAAaP,KAAKO,WAAW;YAAC;QAAE;QAC1FN,UAAU;YAAEA;YAAUE;QAAQ;IAChC;AACF;AAQA,OAAO,SAASK;IACd,MAAMC,SAAS,IAAIC;IACnB,OAAO;QACLC,QAAOC,GAAG,EAAEC,QAAQ;YAClB,IAAIA,aAAaC,WAAW,OAAOL,OAAOM,GAAG,CAACH;YAC9C,IAAIC,SAASX,QAAQ,CAACV,IAAI,KAAK,yBAAyB;gBACtD,MAAMwB,WAAWP,OAAOM,GAAG,CAACH;gBAC5B,IAAII,aAAaF,aAAaE,SAASf,QAAQ,KAAK,MAAM,OAAOe;YACnE;YACAP,OAAOQ,GAAG,CAACL,KAAKC;YAChB,OAAOA;QACT;QACAK,QAAOC,OAAO;YACZ,OAAOV,OAAOM,GAAG,CAACnB,SAASuB,QAAQtB,OAAO,EAAEsB,QAAQrB,QAAQ,IAAII,YAAYX;QAC9E;QACA6B,MAAKC,QAAQ;YACX,KAAK,MAAMT,OAAO;mBAAIH,OAAOa,IAAI;aAAG,CAAE;gBACpC,IAAI,CAACD,SAASE,IAAI,CAAC,CAAC1B,UAAYe,IAAIY,UAAU,CAAC,GAAG3B,QAAQ,CAAC,CAAC,IAAIY,OAAOgB,MAAM,CAACb;YAChF;QACF;IACF;AACF"}
package/dist/read.d.ts ADDED
@@ -0,0 +1,73 @@
1
+ import type { BootstrapPage, BootstrapResult, RefreshResult } from '@agentshouse/mdruntime';
2
+ import { type TrackedAuthority } from './discovery.js';
3
+ import type { HouseMode } from './transport.js';
4
+ import { type LogPosition } from './version.js';
5
+ export type HouseManifestFile = {
6
+ path: string;
7
+ revision: string | undefined;
8
+ version: string;
9
+ };
10
+ export type HouseContent = {
11
+ path: string;
12
+ content: string;
13
+ };
14
+ export type HouseScope = LogPosition & {
15
+ scope: 'room' | 'private';
16
+ anchor: string;
17
+ roomHandle: string | undefined;
18
+ files: readonly HouseManifestFile[];
19
+ contents: readonly HouseContent[];
20
+ };
21
+ export type HouseEnvelope = {
22
+ scopes: readonly HouseScope[];
23
+ };
24
+ export type HouseGrant = {
25
+ method: 'GET' | 'POST';
26
+ operation: string;
27
+ url: string;
28
+ };
29
+ export type HouseChange = {
30
+ path: string;
31
+ removed: true;
32
+ } | {
33
+ path: string;
34
+ content: string;
35
+ revision: string | undefined;
36
+ version: string;
37
+ } | {
38
+ path: string;
39
+ reference: {
40
+ revision: string;
41
+ };
42
+ };
43
+ export type HouseEnumeration = {
44
+ authorities: readonly (LogPosition & {
45
+ authority: string;
46
+ changes: readonly HouseChange[];
47
+ })[];
48
+ };
49
+ export declare function authorityRoot(handle: string | undefined): string;
50
+ export declare const ROOM_README = "ROOM.md";
51
+ export declare function selectionRoots(tracked: TrackedAuthority): readonly string[];
52
+ export declare function contentPrefixes(tracked: TrackedAuthority): readonly string[];
53
+ export declare function modelPrefix(tracked: TrackedAuthority, modelRoot: string): string;
54
+ export declare function parseGrant(body: unknown): HouseGrant | null;
55
+ export declare function parseEnvelope(body: unknown): HouseEnvelope | null;
56
+ export declare function parseSiteBootstrap(body: unknown): HouseScope | null;
57
+ export declare function parseEnumeration(body: unknown, mode: HouseMode): HouseEnumeration | null;
58
+ export declare function advancedScope(scope: HouseScope, view: HouseEnumeration['authorities'][number]): HouseScope;
59
+ export declare function matchesScope(scope: HouseScope, tracked: TrackedAuthority): boolean;
60
+ export declare function withinRoot(path: string, root: string): boolean;
61
+ export declare function selects(tracked: TrackedAuthority, path: string): boolean;
62
+ export declare function bootstrapFrom(envelope: HouseEnvelope, tracked: TrackedAuthority): BootstrapResult;
63
+ export declare function bootstrapOf(scope: HouseScope, tracked: TrackedAuthority): BootstrapPage;
64
+ export type HouseDefinitions = {
65
+ definitions: Readonly<Record<string, string>>;
66
+ versions: readonly string[];
67
+ };
68
+ export declare const MODEL_DEFINITION_ADDRESS = "types";
69
+ export declare function definitionAddress(path: string): string;
70
+ export declare function definitionsFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, modelRoot: string): HouseDefinitions | null;
71
+ export declare function definitionsOf(scope: HouseScope, modelRoot: string): HouseDefinitions | null;
72
+ export declare function refreshFrom(enumeration: HouseEnumeration, tracked: TrackedAuthority, fromRoomVersion: string): RefreshResult;
73
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wB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