@agentshouse/mdruntime-adapter 0.1.0-alpha.4 → 0.1.0-alpha.40

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 (50) hide show
  1. package/AGENTS.md +136 -23
  2. package/README.md +32 -0
  3. package/dist/actions.d.ts +3 -11
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +176 -236
  6. package/dist/actions.js.map +1 -1
  7. package/dist/adapter.d.ts +3 -1
  8. package/dist/adapter.d.ts.map +1 -1
  9. package/dist/adapter.js +78 -137
  10. package/dist/adapter.js.map +1 -1
  11. package/dist/discovery.d.ts +39 -11
  12. package/dist/discovery.d.ts.map +1 -1
  13. package/dist/discovery.js +153 -39
  14. package/dist/discovery.js.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/model.d.ts +19 -0
  19. package/dist/model.d.ts.map +1 -0
  20. package/dist/model.js +64 -0
  21. package/dist/model.js.map +1 -0
  22. package/dist/read.d.ts +24 -19
  23. package/dist/read.d.ts.map +1 -1
  24. package/dist/read.js +126 -55
  25. package/dist/read.js.map +1 -1
  26. package/dist/refusal.d.ts +4 -1
  27. package/dist/refusal.d.ts.map +1 -1
  28. package/dist/refusal.js +13 -1
  29. package/dist/refusal.js.map +1 -1
  30. package/dist/site.d.ts +4 -0
  31. package/dist/site.d.ts.map +1 -0
  32. package/dist/site.js +206 -0
  33. package/dist/site.js.map +1 -0
  34. package/dist/stream.d.ts +8 -5
  35. package/dist/stream.d.ts.map +1 -1
  36. package/dist/stream.js +232 -135
  37. package/dist/stream.js.map +1 -1
  38. package/dist/transport.d.ts +39 -29
  39. package/dist/transport.d.ts.map +1 -1
  40. package/dist/transport.js +5 -1
  41. package/dist/transport.js.map +1 -1
  42. package/dist/version.d.ts +14 -0
  43. package/dist/version.d.ts.map +1 -0
  44. package/dist/version.js +29 -0
  45. package/dist/version.js.map +1 -0
  46. package/dist/write.d.ts +6 -0
  47. package/dist/write.d.ts.map +1 -1
  48. package/dist/write.js +51 -9
  49. package/dist/write.js.map +1 -1
  50. package/package.json +4 -12
package/dist/discovery.js CHANGED
@@ -1,20 +1,25 @@
1
1
  import { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';
2
- import { PRIVATE_AUTHORITY } from './transport.js';
2
+ import { PRIVATE_LOCATOR } from './transport.js';
3
+ import { readPosition, roomVersion } from './version.js';
3
4
  export const ROOM_CONTRACT_VERSION = 1;
4
5
  export const MD_MODEL_IDENTITY = '@agentshouse/mdmodel';
5
6
  export const ROOM_VERSION_NOTIFICATIONS = 'room-version-notifications';
6
7
  export const PROVIDER_ACTIONS = 'provider-actions';
8
+ export const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';
7
9
  export const DISCOVER_PREFIXES = [
8
10
  '/'
9
11
  ];
10
12
  export const PROVIDER_SELECTION_ROOTS = [
11
13
  'agents',
12
- 'house'
14
+ 'house',
15
+ 'settings/apps',
16
+ 'settings/panel.md'
13
17
  ];
14
- export const PROVIDER_SELECTION_MODEL_ROOT = 'house/settings/model';
18
+ export const HOUSE_SCHEMA = 'house/schema.yaml';
15
19
  const BOUND_KEYS = [
16
20
  'max_authored_file_bytes',
17
21
  'max_batch_operations',
22
+ 'max_batch_documents',
18
23
  'max_path_length',
19
24
  'max_path_depth',
20
25
  'max_mount_files',
@@ -57,43 +62,28 @@ function parseOperations(value) {
57
62
  function parseAuthority(value) {
58
63
  if (typeof value !== 'object' || value === null) return null;
59
64
  const held = value;
60
- if (held.kind !== 'room' && held.kind !== 'private') return null;
65
+ if (held.kind !== 'room') return null;
61
66
  if (typeof held.name !== 'string' || held.name.length === 0) return null;
62
67
  if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;
63
68
  if (held.managed_replication !== 'admitted' && held.managed_replication !== 'unavailable') {
64
69
  return null;
65
70
  }
66
- if (typeof held.position !== 'string' || held.position.length === 0) return null;
71
+ const at = readPosition(held);
67
72
  const protectedPaths = stringList(held.protected_paths);
68
73
  const operations = parseOperations(held.operations);
69
- if (protectedPaths === null || operations === null) return null;
70
- if (held.kind === 'private') {
71
- return {
72
- kind: 'private',
73
- roomRef: PRIVATE_AUTHORITY,
74
- roomHandle: null,
75
- name: held.name,
76
- collectionRoot: held.collection_root,
77
- modelRoot: held.model_root,
78
- managedReplication: held.managed_replication,
79
- protectedPaths,
80
- operations,
81
- position: held.position
82
- };
83
- }
74
+ if (at === null || protectedPaths === null || operations === null) return null;
84
75
  if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
85
- if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;
76
+ if (held.room_handle !== null && (typeof held.room_handle !== 'string' || held.room_handle.length === 0)) return null;
86
77
  return {
87
- kind: 'room',
88
78
  roomRef: held.room_ref,
89
79
  roomHandle: held.room_handle,
90
80
  name: held.name,
91
81
  collectionRoot: held.collection_root,
92
- modelRoot: held.model_root,
82
+ schema: held.model_root,
93
83
  managedReplication: held.managed_replication,
94
84
  protectedPaths,
95
85
  operations,
96
- position: held.position
86
+ ...at
97
87
  };
98
88
  }
99
89
  export function parseDiscovery(body) {
@@ -102,6 +92,8 @@ export function parseDiscovery(body) {
102
92
  const bounds = parseBounds(held.bounds);
103
93
  if (bounds === null) return null;
104
94
  if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;
95
+ const actions = stringList(held.actions);
96
+ if (actions === null || new Set(actions).size !== actions.length || actions.some((name)=>name.length === 0)) return null;
105
97
  if (!Array.isArray(held.authorities)) return null;
106
98
  const authorities = [];
107
99
  for (const entry of held.authorities){
@@ -112,11 +104,112 @@ export function parseDiscovery(body) {
112
104
  return {
113
105
  bounds,
114
106
  mdModelVersion: held.md_model_version,
107
+ authorities,
108
+ actions
109
+ };
110
+ }
111
+ function parseSiteEntry(value) {
112
+ if (typeof value !== 'object' || value === null) return null;
113
+ const held = value;
114
+ if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
115
+ if (typeof held.segment !== 'string' || held.segment.length === 0) return null;
116
+ return {
117
+ roomRef: held.room_ref,
118
+ segment: held.segment
119
+ };
120
+ }
121
+ function parseSiteSlot(value) {
122
+ if (typeof value !== 'object' || value === null) return null;
123
+ const held = value;
124
+ if (typeof held.slot !== 'string' || held.slot.length === 0) return null;
125
+ if (!Array.isArray(held.entries)) return null;
126
+ const entries = [];
127
+ for (const entry of held.entries){
128
+ const parsed = parseSiteEntry(entry);
129
+ if (parsed === null) return null;
130
+ entries.push(parsed);
131
+ }
132
+ return {
133
+ slot: held.slot,
134
+ entries
135
+ };
136
+ }
137
+ function parseSiteAuthority(value) {
138
+ if (typeof value !== 'object' || value === null) return null;
139
+ const held = value;
140
+ if (held.kind !== 'room') return null;
141
+ if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;
142
+ if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;
143
+ if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;
144
+ const at = readPosition(held);
145
+ if (at === null) return null;
146
+ return {
147
+ roomRef: held.room_ref,
148
+ roomHandle: held.room_handle,
149
+ collectionRoot: held.collection_root,
150
+ schema: held.model_root,
151
+ ...at
152
+ };
153
+ }
154
+ export function parseSiteDiscovery(body) {
155
+ if (typeof body !== 'object' || body === null) return null;
156
+ const held = body;
157
+ const bounds = parseBounds(held.bounds);
158
+ if (bounds === null) return null;
159
+ if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;
160
+ if (!Array.isArray(held.slots) || !Array.isArray(held.authorities)) return null;
161
+ const slots = [];
162
+ for (const entry of held.slots){
163
+ const slot = parseSiteSlot(entry);
164
+ if (slot === null) return null;
165
+ slots.push(slot);
166
+ }
167
+ const authorities = [];
168
+ for (const entry of held.authorities){
169
+ const authority = parseSiteAuthority(entry);
170
+ if (authority === null) return null;
171
+ authorities.push(authority);
172
+ }
173
+ return {
174
+ bounds,
175
+ mdModelVersion: held.md_model_version,
176
+ slots,
115
177
  authorities
116
178
  };
117
179
  }
180
+ export function siteTracked(document) {
181
+ return document.authorities.map((authority)=>({
182
+ locator: authority.roomRef,
183
+ authority: authority.roomRef,
184
+ handle: authority.roomHandle,
185
+ collectionRoot: authority.collectionRoot,
186
+ schema: authority.schema,
187
+ schemas: [
188
+ authority.schema
189
+ ],
190
+ position: authority.position,
191
+ logEpoch: authority.logEpoch
192
+ }));
193
+ }
194
+ export function siteSlots(document) {
195
+ return document.slots.map(({ slot, entries })=>({
196
+ slot,
197
+ entries: entries.map(({ roomRef, segment })=>({
198
+ locator: roomRef,
199
+ segment
200
+ }))
201
+ }));
202
+ }
118
203
  export function locatorOf(authority) {
119
- return authority.roomHandle ?? PRIVATE_AUTHORITY;
204
+ return authority.roomHandle === null ? PRIVATE_LOCATOR : authority.roomRef;
205
+ }
206
+ function schemasOf(authority) {
207
+ return authority.roomHandle === null ? [
208
+ authority.schema,
209
+ HOUSE_SCHEMA
210
+ ] : [
211
+ authority.schema
212
+ ];
120
213
  }
121
214
  export function trackedFrom(document) {
122
215
  return document.authorities.map((authority)=>({
@@ -124,14 +217,10 @@ export function trackedFrom(document) {
124
217
  authority: authority.roomRef,
125
218
  handle: authority.roomHandle ?? undefined,
126
219
  collectionRoot: authority.collectionRoot,
127
- modelRoot: authority.modelRoot,
128
- modelRoots: authority.kind === 'private' ? [
129
- authority.modelRoot,
130
- PROVIDER_SELECTION_MODEL_ROOT
131
- ] : [
132
- authority.modelRoot
133
- ],
134
- roomVersion: authority.position
220
+ schema: authority.schema,
221
+ schemas: schemasOf(authority),
222
+ position: authority.position,
223
+ logEpoch: authority.logEpoch
135
224
  }));
136
225
  }
137
226
  export function providerLimits(bounds) {
@@ -144,6 +233,10 @@ export function providerLimits(bounds) {
144
233
  name: 'change-batch-operations',
145
234
  value: bounds.max_batch_operations
146
235
  },
236
+ {
237
+ name: 'change-documents',
238
+ value: bounds.max_batch_documents
239
+ },
147
240
  {
148
241
  name: 'path-length',
149
242
  value: bounds.max_path_length
@@ -169,15 +262,35 @@ export function declaredRetention(bounds) {
169
262
  refreshHorizon: bounds.change_retention_seconds
170
263
  };
171
264
  }
172
- export function capabilities() {
265
+ export function capabilities(actions) {
173
266
  return [
174
267
  {
175
268
  name: ROOM_VERSION_NOTIFICATIONS
176
269
  },
177
270
  {
178
271
  name: PROVIDER_ACTIONS,
179
- actions: declaredActions(),
272
+ actions: declaredActions(actions),
180
273
  conversationCards: HOUSE_CONVERSATION_CARDS
274
+ },
275
+ {
276
+ name: MOVE_REFERENCE_REWRITES
277
+ }
278
+ ];
279
+ }
280
+ export function siteCapabilities() {
281
+ return [
282
+ {
283
+ name: ROOM_VERSION_NOTIFICATIONS
284
+ },
285
+ {
286
+ name: PROVIDER_ACTIONS,
287
+ actions: [
288
+ {
289
+ name: 'submit',
290
+ inputShape: {},
291
+ resultKind: 'house'
292
+ }
293
+ ]
181
294
  }
182
295
  ];
183
296
  }
@@ -194,7 +307,7 @@ export function discoveredRoom(authority, attachedModel, typedSelection) {
194
307
  name: authority.name,
195
308
  locator: locatorOf(authority),
196
309
  collectionRoot: authority.collectionRoot,
197
- roomVersion: authority.position,
310
+ roomVersion: roomVersion(authority),
198
311
  operations: {
199
312
  read: [
200
313
  ...authority.operations.read
@@ -218,11 +331,12 @@ export function discoveredRoom(authority, attachedModel, typedSelection) {
218
331
  typedSelection
219
332
  },
220
333
  providerOwnedPaths: [
221
- ...authority.protectedPaths
334
+ ...authority.protectedPaths,
335
+ ...schemasOf(authority)
222
336
  ]
223
337
  };
224
338
  }
225
- export function mapDiscovery(document, rooms) {
339
+ export function mapDiscovery(document, rooms, declared) {
226
340
  return {
227
341
  kind: 'discovery',
228
342
  supportedVersions: [
@@ -233,7 +347,7 @@ export function mapDiscovery(document, rooms) {
233
347
  version: document.mdModelVersion
234
348
  },
235
349
  rooms,
236
- capabilities: capabilities(),
350
+ capabilities: declared,
237
351
  providerLimits: providerLimits(document.bounds),
238
352
  retention: declaredRetention(document.bounds)
239
353
  };
@@ -1 +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';\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 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 = {\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 position: string;\n};\n\nexport type HouseDiscoveryDocument = {\n bounds: HouseBounds;\n mdModelVersion: string;\n authorities: readonly HouseAuthority[];\n};\n\nexport type TrackedAuthority = {\n locator: string;\n authority: string;\n handle: string | undefined;\n collectionRoot: string;\n modelRoot: string;\n modelRoots: readonly string[];\n roomVersion: string;\n};\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 if (typeof held.position !== 'string' || held.position.length === 0) return null;\n const protectedPaths = stringList(held.protected_paths);\n const operations = parseOperations(held.operations);\n if (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 position: held.position,\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 position: held.position,\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\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 roomVersion: authority.position,\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 ];\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: authority.position,\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: HouseDiscoveryDocument,\n rooms: readonly DiscoveredRoom[],\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: capabilities(),\n providerLimits: providerLimits(document.bounds),\n retention: declaredRetention(document.bounds),\n };\n}\n"],"names":["declaredActions","HOUSE_CONVERSATION_CARDS","PRIVATE_AUTHORITY","ROOM_CONTRACT_VERSION","MD_MODEL_IDENTITY","ROOM_VERSION_NOTIFICATIONS","PROVIDER_ACTIONS","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","position","protectedPaths","protected_paths","roomRef","roomHandle","collectionRoot","modelRoot","managedReplication","room_ref","room_handle","parseDiscovery","body","md_model_version","authorities","authority","push","mdModelVersion","locatorOf","trackedFrom","document","map","locator","handle","undefined","modelRoots","roomVersion","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","providerSelection","attachedModel","roots","discoveredRoom","typedSelection","read","sync","write","delete","replica","selection","admission","providerOwnedPaths","mapDiscovery","rooms","supportedVersions","mdModel","identity","version","retention"],"mappings":"AAQA,SAASA,eAAe,EAAEC,wBAAwB,QAAQ,eAAe;AACzE,SAASC,iBAAiB,QAAQ,iBAAiB;AAEnD,OAAO,MAAMC,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,oBAAoB,uBAAuB;AAExD,OAAO,MAAMC,6BAA6B,6BAA6B;AAEvE,OAAO,MAAMC,mBAAmB,mBAAmB;AAEnD,OAAO,MAAMC,oBAAuC;IAAC;CAAI,CAAC;AAE1D,OAAO,MAAMC,2BAA8C;IAAC;IAAU;CAAQ,CAAC;AAE/E,OAAO,MAAMC,gCAAgC,uBAAuB;AAiDpE,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,IAAI,OAAOA,UAAU,YAAYA,UAAU,MAAM,OAAO;IACxD,MAAMM,OAAON;IACb,MAAMO,SAA+B,CAAC;IACtC,KAAK,MAAMC,OAAOX,WAAY;QAC5B,MAAMY,SAASH,IAAI,CAACE,IAAI;QACxB,IAAI,OAAOC,WAAW,YAAY,CAACC,OAAOC,QAAQ,CAACF,SAAS,OAAO;QACnEF,MAAM,CAACC,IAAI,GAAGC;IAChB;IACA,OAAOF;AAC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I/B,UAAUvB,UAAU,CAACsD,IAAI;aAAC;YACpCC,MAAM;mBAAIhC,UAAUvB,UAAU,CAACuD,IAAI;aAAC;YACpCC,OAAO;mBAAIjC,UAAUvB,UAAU,CAACwD,KAAK;aAAC;YACtCC,QAAQ;mBAAIlC,UAAUvB,UAAU,CAACyD,MAAM;aAAC;QAC1C;QACAC,SAAS;YAAEC,WAAWjC,UAAUH;YAAYqC,WAAWrC,UAAUP,kBAAkB;QAAC;QACpFkC;QACA,GAAIG,mBAAmBrB,YAAY,CAAC,IAAI;YAAEqB;QAAe,CAAC;QAC1DQ,oBAAoB;eAAItC,UAAUb,cAAc;SAAC;IACnD;AACF;AAEA,OAAO,SAASoD,aACdlC,QAAgC,EAChCmC,KAAgC;IAEhC,OAAO;QACL5D,MAAM;QACN6D,mBAAmB;YAACvF;SAAsB;QAC1CwF,SAAS;YAAEC,UAAUxF;YAAmByF,SAASvC,SAASH,cAAc;QAAC;QACzEsC;QACAjB,cAAcA;QACdX,gBAAgBA,eAAeP,SAASlC,MAAM;QAC9C0E,WAAW5B,kBAAkBZ,SAASlC,MAAM;IAC9C;AACF"}
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_LOCATOR } 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[] = [\n 'agents',\n 'house',\n 'settings/apps',\n 'settings/panel.md',\n];\n\nexport const HOUSE_SCHEMA = 'house/schema.yaml';\n\nexport type HouseBounds = {\n max_authored_file_bytes: number;\n max_batch_operations: number;\n max_batch_documents: 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 roomRef: string;\n roomHandle: string | null;\n name: string;\n collectionRoot: string;\n schema: 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 actions: readonly string[];\n};\n\nexport type TrackedAuthority = LogPosition & {\n locator: string;\n authority: string;\n handle: string | undefined;\n collectionRoot: string;\n schema: string;\n schemas: 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 schema: 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_batch_documents',\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') 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 (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (\n held.room_handle !== null &&\n (typeof held.room_handle !== 'string' || held.room_handle.length === 0)\n )\n return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n name: held.name,\n collectionRoot: held.collection_root,\n schema: 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 const actions = stringList(held.actions);\n if (\n actions === null ||\n new Set(actions).size !== actions.length ||\n actions.some((name) => name.length === 0)\n )\n 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, actions };\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 schema: 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 schema: authority.schema,\n schemas: [authority.schema],\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 === null ? PRIVATE_LOCATOR : authority.roomRef;\n}\n\nfunction schemasOf(authority: HouseAuthority): readonly string[] {\n return authority.roomHandle === null ? [authority.schema, HOUSE_SCHEMA] : [authority.schema];\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 schema: authority.schema,\n schemas: schemasOf(authority),\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: 'change-documents', value: bounds.max_batch_documents },\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(actions: readonly string[]): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n {\n name: PROVIDER_ACTIONS,\n actions: declaredActions(actions),\n conversationCards: HOUSE_CONVERSATION_CARDS,\n },\n { name: MOVE_REFERENCE_REWRITES },\n ];\n}\n\nexport function siteCapabilities(): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n { name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },\n ];\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, ...schemasOf(authority)],\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_LOCATOR","readPosition","roomVersion","ROOM_CONTRACT_VERSION","MD_MODEL_IDENTITY","ROOM_VERSION_NOTIFICATIONS","PROVIDER_ACTIONS","MOVE_REFERENCE_REWRITES","DISCOVER_PREFIXES","PROVIDER_SELECTION_ROOTS","HOUSE_SCHEMA","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","room_ref","room_handle","roomRef","roomHandle","collectionRoot","schema","managedReplication","parseDiscovery","body","md_model_version","actions","Set","size","some","authorities","authority","push","mdModelVersion","parseSiteEntry","segment","parseSiteSlot","slot","entries","parsed","parseSiteAuthority","parseSiteDiscovery","slots","siteTracked","document","map","locator","handle","schemas","position","logEpoch","siteSlots","locatorOf","schemasOf","trackedFrom","undefined","providerLimits","max_authored_file_bytes","max_batch_operations","max_batch_documents","max_path_length","max_path_depth","declaredRetention","history","outcome","operation_retention_seconds","refreshHorizon","change_retention_seconds","capabilities","conversationCards","siteCapabilities","inputShape","resultKind","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,eAAe,QAAQ,iBAAiB;AACjD,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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;eAAIzF;SAAyB;QAAEwF;IAAc;AAC/D;AAEA,OAAO,SAASE,eACd7C,SAAyB,EACzB2C,aAA8C,EAC9CG,cAA0C;IAE1C,OAAO;QACLrE,MAAMuB,UAAUvB,IAAI;QACpBsC,SAASM,UAAUrB;QACnBX,gBAAgBW,UAAUX,cAAc;QACxCzC,aAAaA,YAAYoD;QACzB3B,YAAY;YACV0E,MAAM;mBAAI/C,UAAU3B,UAAU,CAAC0E,IAAI;aAAC;YACpCC,MAAM;mBAAIhD,UAAU3B,UAAU,CAAC2E,IAAI;aAAC;YACpCC,OAAO;mBAAIjD,UAAU3B,UAAU,CAAC4E,KAAK;aAAC;YACtCC,QAAQ;mBAAIlD,UAAU3B,UAAU,CAAC6E,MAAM;aAAC;QAC1C;QACAC,SAAS;YAAEC,WAAW/B,UAAUrB;YAAYqD,WAAWrD,UAAUT,kBAAkB;QAAC;QACpFoD;QACA,GAAIG,mBAAmBtB,YAAY,CAAC,IAAI;YAAEsB;QAAe,CAAC;QAC1DQ,oBAAoB;eAAItD,UAAUjB,cAAc;eAAKuC,UAAUtB;SAAW;IAC5E;AACF;AAEA,OAAO,SAASuD,aACd1C,QAAmE,EACnE2C,KAAgC,EAChCC,QAA+B;IAE/B,OAAO;QACLjF,MAAM;QACNkF,mBAAmB;YAAC7G;SAAsB;QAC1C8G,SAAS;YAAEC,UAAU9G;YAAmB+G,SAAShD,SAASX,cAAc;QAAC;QACzEsD;QACAnB,cAAcoB;QACdhC,gBAAgBA,eAAeZ,SAAS9C,MAAM;QAC9C+F,WAAW/B,kBAAkBlB,SAAS9C,MAAM;IAC9C;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
2
2
  export { nativePath, roomLocalPath } from './map.js';
3
- export type { HouseByteAct, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamAuthority, HouseStreamEntry, HouseStreamFrame, HouseTransport, } from './transport.js';
3
+ export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
4
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,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,cAAc,GACf,MAAM,gBAAgB,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,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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 HouseTransport,\n} from './transport.js';\n"],"names":["createAgentsHouseAdapter","nativePath","roomLocalPath"],"mappings":"AAAA,SAASA,wBAAwB,QAAwC,eAAe;AACxF,SAASC,UAAU,EAAEC,aAAa,QAAQ,WAAW"}
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 HouseByteAnswer,\n HouseByteTransfer,\n HouseDoorAnswer,\n HouseStream,\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"}
@@ -0,0 +1,19 @@
1
+ import type { AdapterFailure, ModelIdentity, ModelRequest, ModelResult } from '@agentshouse/mdruntime';
2
+ import type { HouseSchema } 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: HouseSchema | 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,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,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,WAAW,GAAG,IAAI,EACxB,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.version));
24
+ return {
25
+ snapshot: {
26
+ kind: 'model',
27
+ snapshot: {
28
+ identity,
29
+ version,
30
+ schema: read.schema
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 { HouseSchema } 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: HouseSchema | 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.version));\n return {\n snapshot: { kind: 'model', snapshot: { identity, version, schema: read.schema } },\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","schema","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,IAAwB,EACxBC,QAAgB,EAChBN,OAAoB;IAEpB,IAAIK,SAAS,MAAM,OAAO;QAAEE,UAAUP;QAASM,UAAU;IAAK;IAC9D,MAAME,UAAU,MAAMb,UAAUc,KAAKC,SAAS,CAACL,KAAKG,OAAO;IAC3D,OAAO;QACLD,UAAU;YAAEV,MAAM;YAASU,UAAU;gBAAED;gBAAUE;gBAASG,QAAQN,KAAKM,MAAM;YAAC;QAAE;QAChFL,UAAU;YAAEA;YAAUE;QAAQ;IAChC;AACF;AAQA,OAAO,SAASI;IACd,MAAMC,SAAS,IAAIC;IACnB,OAAO;QACLC,QAAOC,GAAG,EAAEC,QAAQ;YAClB,IAAIA,aAAaC,WAAW,OAAOL,OAAOM,GAAG,CAACH;YAC9C,IAAIC,SAASV,QAAQ,CAACV,IAAI,KAAK,yBAAyB;gBACtD,MAAMuB,WAAWP,OAAOM,GAAG,CAACH;gBAC5B,IAAII,aAAaF,aAAaE,SAASd,QAAQ,KAAK,MAAM,OAAOc;YACnE;YACAP,OAAOQ,GAAG,CAACL,KAAKC;YAChB,OAAOA;QACT;QACAK,QAAOC,OAAO;YACZ,OAAOV,OAAOM,GAAG,CAAClB,SAASsB,QAAQrB,OAAO,EAAEqB,QAAQpB,QAAQ,IAAII,YAAYX;QAC9E;QACA4B,MAAKC,QAAQ;YACX,KAAK,MAAMT,OAAO;mBAAIH,OAAOa,IAAI;aAAG,CAAE;gBACpC,IAAI,CAACD,SAASE,IAAI,CAAC,CAACzB,UAAYc,IAAIY,UAAU,CAAC,GAAG1B,QAAQ,CAAC,CAAC,IAAIW,OAAOgB,MAAM,CAACb;YAChF;QACF;IACF;AACF"}
package/dist/read.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import type { BootstrapResult, RefreshResult } from '@agentshouse/mdruntime';
1
+ import type { BootstrapPage, BootstrapResult, RefreshResult } from '@agentshouse/mdruntime';
2
2
  import { type TrackedAuthority } from './discovery.js';
3
+ import type { HouseMode } from './transport.js';
4
+ import { type LogPosition } from './version.js';
3
5
  export type HouseManifestFile = {
4
6
  path: string;
5
- revision: string;
7
+ revision: string | undefined;
8
+ version: string;
6
9
  };
7
10
  export type HouseContent = {
8
11
  path: string;
9
12
  content: string;
10
13
  };
11
- export type HouseScope = {
12
- scope: 'room' | 'private';
14
+ export type HouseScope = LogPosition & {
13
15
  anchor: string;
14
- roomHandle: string | undefined;
15
- position: string;
16
16
  files: readonly HouseManifestFile[];
17
17
  contents: readonly HouseContent[];
18
18
  };
@@ -20,7 +20,10 @@ export type HouseEnvelope = {
20
20
  scopes: readonly HouseScope[];
21
21
  };
22
22
  export type HouseGrant = {
23
- method: 'GET' | 'POST';
23
+ method: 'GET';
24
+ url: string;
25
+ } | {
26
+ method: 'POST';
24
27
  operation: string;
25
28
  url: string;
26
29
  };
@@ -30,7 +33,8 @@ export type HouseChange = {
30
33
  } | {
31
34
  path: string;
32
35
  content: string;
33
- revision: string;
36
+ revision: string | undefined;
37
+ version: string;
34
38
  } | {
35
39
  path: string;
36
40
  reference: {
@@ -38,30 +42,31 @@ export type HouseChange = {
38
42
  };
39
43
  };
40
44
  export type HouseEnumeration = {
41
- authorities: readonly {
45
+ authorities: readonly (LogPosition & {
42
46
  authority: string;
43
- position: string;
44
47
  changes: readonly HouseChange[];
45
- }[];
48
+ })[];
46
49
  };
47
50
  export declare function authorityRoot(handle: string | undefined): string;
48
51
  export declare const ROOM_README = "ROOM.md";
49
52
  export declare function selectionRoots(tracked: TrackedAuthority): readonly string[];
50
53
  export declare function contentPrefixes(tracked: TrackedAuthority): readonly string[];
51
- export declare function modelPrefix(tracked: TrackedAuthority, modelRoot: string): string;
54
+ export declare function schemaPath(handle: string | undefined, schema: string): string;
52
55
  export declare function parseGrant(body: unknown): HouseGrant | null;
53
56
  export declare function parseEnvelope(body: unknown): HouseEnvelope | null;
54
- export declare function parseEnumeration(body: unknown): HouseEnumeration | null;
57
+ export declare function parseSiteBootstrap(body: unknown): HouseScope | null;
58
+ export declare function parseEnumeration(body: unknown, mode: HouseMode): HouseEnumeration | null;
59
+ export declare function advancedScope(scope: HouseScope, view: HouseEnumeration['authorities'][number]): HouseScope;
55
60
  export declare function matchesScope(scope: HouseScope, tracked: TrackedAuthority): boolean;
56
61
  export declare function withinRoot(path: string, root: string): boolean;
57
62
  export declare function selects(tracked: TrackedAuthority, path: string): boolean;
58
63
  export declare function bootstrapFrom(envelope: HouseEnvelope, tracked: TrackedAuthority): BootstrapResult;
59
- export type HouseDefinitions = {
60
- definitions: Readonly<Record<string, string>>;
61
- revisions: readonly string[];
64
+ export declare function bootstrapOf(scope: HouseScope, tracked: TrackedAuthority): BootstrapPage;
65
+ export type HouseSchema = {
66
+ schema: string | null;
67
+ version: string | null;
62
68
  };
63
- export declare const MODEL_DEFINITION_ADDRESS = "types";
64
- export declare function definitionAddress(path: string): string;
65
- export declare function definitionsFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, modelRoot: string): HouseDefinitions | null;
69
+ export declare function schemaFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, schema: string): HouseSchema | null;
70
+ export declare function schemaOf(scope: HouseScope, schema: string): HouseSchema | null;
66
71
  export declare function refreshFrom(enumeration: HouseEnumeration, tracked: TrackedAuthority, fromRoomVersion: string): RefreshResult;
67
72
  //# sourceMappingURL=read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC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