@agentshouse/mdruntime-adapter 0.1.0-c9f1e531ad7c8 → 0.1.0-ca3a44982cbe7

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 (49) hide show
  1. package/AGENTS.md +181 -92
  2. package/README.md +3 -3
  3. package/dist/actions.d.ts +43 -2
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +141 -123
  6. package/dist/adapter.d.ts.map +1 -1
  7. package/dist/adapter.js +231 -156
  8. package/dist/discovery.d.ts +14 -27
  9. package/dist/discovery.d.ts.map +1 -1
  10. package/dist/discovery.js +56 -102
  11. package/dist/gather.d.ts +1 -0
  12. package/dist/gather.d.ts.map +1 -1
  13. package/dist/gather.js +11 -6
  14. package/dist/handed.d.ts +15 -0
  15. package/dist/handed.d.ts.map +1 -0
  16. package/dist/handed.js +38 -0
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/model.d.ts +8 -18
  21. package/dist/model.d.ts.map +1 -1
  22. package/dist/model.js +63 -39
  23. package/dist/read.d.ts +16 -11
  24. package/dist/read.d.ts.map +1 -1
  25. package/dist/read.js +80 -106
  26. package/dist/referrer.d.ts +7 -0
  27. package/dist/referrer.d.ts.map +1 -0
  28. package/dist/referrer.js +35 -0
  29. package/dist/refusal.d.ts +5 -7
  30. package/dist/refusal.d.ts.map +1 -1
  31. package/dist/refusal.js +31 -32
  32. package/dist/site.d.ts.map +1 -1
  33. package/dist/site.js +89 -84
  34. package/dist/stream.d.ts +9 -4
  35. package/dist/stream.d.ts.map +1 -1
  36. package/dist/stream.js +115 -77
  37. package/dist/transport.d.ts +50 -20
  38. package/dist/transport.d.ts.map +1 -1
  39. package/dist/transport.js +3 -2
  40. package/dist/version.d.ts +1 -0
  41. package/dist/version.d.ts.map +1 -1
  42. package/dist/version.js +9 -0
  43. package/dist/write.d.ts +4 -5
  44. package/dist/write.d.ts.map +1 -1
  45. package/dist/write.js +98 -25
  46. package/package.json +4 -4
  47. package/dist/links.d.ts +0 -12
  48. package/dist/links.d.ts.map +0 -1
  49. package/dist/links.js +0 -66
package/dist/discovery.js CHANGED
@@ -1,35 +1,7 @@
1
- import { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';
2
- import { PRIVATE_LOCATOR } from './transport.js';
1
+ import { declaredActions, houseConversationAgents, SITE_SUBMIT } from './actions.js';
3
2
  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
3
  export const PROVIDER_ACTIONS = 'provider-actions';
8
- export const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';
9
4
  export const DISCOVER_PREFIXES = ['/'];
10
- export const PROVIDER_SELECTION_ROOTS = [
11
- 'agents',
12
- 'collaboration/routines',
13
- 'house',
14
- 'settings/apps',
15
- 'settings/panel.md',
16
- ];
17
- export const UNTYPED_FOLDERS = ['capture'];
18
- export const RESERVED_NAMES = [
19
- 'ROOM.md',
20
- 'capture',
21
- 'settings',
22
- 'collaboration',
23
- 'rooms',
24
- 'agents',
25
- 'house',
26
- 'work',
27
- 'entities',
28
- 'schema',
29
- 'commitments',
30
- ];
31
- export const HOUSE_SCHEMA = 'house/schema.yaml';
32
- export const PRIVATE_HANDLE = 'private';
33
5
  const BOUND_KEYS = [
34
6
  'max_authored_file_bytes',
35
7
  'max_batch_operations',
@@ -38,6 +10,9 @@ const BOUND_KEYS = [
38
10
  'max_path_depth',
39
11
  'max_mount_files',
40
12
  'max_mount_bytes',
13
+ 'max_inline_body_bytes',
14
+ 'max_upload_bytes',
15
+ 'max_prefixes',
41
16
  'change_retention_seconds',
42
17
  'operation_retention_seconds',
43
18
  ];
@@ -60,6 +35,25 @@ function parseBounds(value) {
60
35
  }
61
36
  return bounds;
62
37
  }
38
+ function parseHouseModel(value) {
39
+ if (value === undefined)
40
+ return null;
41
+ if (typeof value !== 'object' || value === null)
42
+ return undefined;
43
+ const held = value;
44
+ const paths = stringList(held.paths);
45
+ if (typeof held.root !== 'string' || held.root.length === 0 || paths === null)
46
+ return undefined;
47
+ return { root: held.root, paths };
48
+ }
49
+ function parseMember(value) {
50
+ if (typeof value !== 'object' || value === null)
51
+ return null;
52
+ const { user, name } = value;
53
+ if (typeof user !== 'string' || typeof name !== 'string')
54
+ return null;
55
+ return { kind: 'user', id: user, name };
56
+ }
63
57
  function parseOperations(value) {
64
58
  if (typeof value !== 'object' || value === null)
65
59
  return null;
@@ -87,9 +81,10 @@ function parseAuthority(value) {
87
81
  return null;
88
82
  }
89
83
  const at = readPosition(held);
84
+ const houseModel = parseHouseModel(held.house_model);
90
85
  const protectedPaths = stringList(held.protected_paths);
91
86
  const operations = parseOperations(held.operations);
92
- if (at === null || protectedPaths === null || operations === null)
87
+ if (at === null || houseModel === undefined || protectedPaths === null || operations === null)
93
88
  return null;
94
89
  if (typeof held.room_ref !== 'string' || held.room_ref.length === 0)
95
90
  return null;
@@ -100,6 +95,7 @@ function parseAuthority(value) {
100
95
  roomHandle: held.room_handle,
101
96
  name: held.name,
102
97
  schema: held.model_root,
98
+ houseModel,
103
99
  managedReplication: held.managed_replication,
104
100
  protectedPaths,
105
101
  operations,
@@ -110,11 +106,12 @@ export function parseDiscovery(body) {
110
106
  if (typeof body !== 'object' || body === null)
111
107
  return null;
112
108
  const held = body;
109
+ const member = parseMember(held.member);
110
+ if (member === null)
111
+ return null;
113
112
  const bounds = parseBounds(held.bounds);
114
113
  if (bounds === null)
115
114
  return null;
116
- if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0)
117
- return null;
118
115
  const actions = stringList(held.actions);
119
116
  if (actions === null ||
120
117
  new Set(actions).size !== actions.length ||
@@ -129,34 +126,7 @@ export function parseDiscovery(body) {
129
126
  return null;
130
127
  authorities.push(authority);
131
128
  }
132
- return { bounds, mdModelVersion: held.md_model_version, authorities, actions };
133
- }
134
- function parseSiteEntry(value) {
135
- if (typeof value !== 'object' || value === null)
136
- return null;
137
- const held = value;
138
- if (typeof held.room_ref !== 'string' || held.room_ref.length === 0)
139
- return null;
140
- if (typeof held.segment !== 'string' || held.segment.length === 0)
141
- return null;
142
- return { roomRef: held.room_ref, segment: held.segment };
143
- }
144
- function parseSiteSlot(value) {
145
- if (typeof value !== 'object' || value === null)
146
- return null;
147
- const held = value;
148
- if (typeof held.slot !== 'string' || held.slot.length === 0)
149
- return null;
150
- if (!Array.isArray(held.entries))
151
- return null;
152
- const entries = [];
153
- for (const entry of held.entries) {
154
- const parsed = parseSiteEntry(entry);
155
- if (parsed === null)
156
- return null;
157
- entries.push(parsed);
158
- }
159
- return { slot: held.slot, entries };
129
+ return { member, bounds, authorities, actions };
160
130
  }
161
131
  function parseSiteAuthority(value) {
162
132
  if (typeof value !== 'object' || value === null)
@@ -187,17 +157,8 @@ export function parseSiteDiscovery(body) {
187
157
  const bounds = parseBounds(held.bounds);
188
158
  if (bounds === null)
189
159
  return null;
190
- if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0)
191
- return null;
192
- if (!Array.isArray(held.slots) || !Array.isArray(held.authorities))
160
+ if (!Array.isArray(held.authorities))
193
161
  return null;
194
- const slots = [];
195
- for (const entry of held.slots) {
196
- const slot = parseSiteSlot(entry);
197
- if (slot === null)
198
- return null;
199
- slots.push(slot);
200
- }
201
162
  const authorities = [];
202
163
  for (const entry of held.authorities) {
203
164
  const authority = parseSiteAuthority(entry);
@@ -205,7 +166,7 @@ export function parseSiteDiscovery(body) {
205
166
  return null;
206
167
  authorities.push(authority);
207
168
  }
208
- return { bounds, mdModelVersion: held.md_model_version, slots, authorities };
169
+ return { bounds, authorities };
209
170
  }
210
171
  export function siteTracked(document) {
211
172
  return document.authorities.map((authority) => ({
@@ -213,31 +174,24 @@ export function siteTracked(document) {
213
174
  authority: authority.roomRef,
214
175
  handle: authority.roomHandle,
215
176
  schema: authority.schema,
177
+ houseModel: null,
216
178
  schemas: [authority.schema],
217
179
  position: authority.position,
218
180
  logEpoch: authority.logEpoch,
219
181
  }));
220
182
  }
221
- export function siteSlots(document) {
222
- return document.slots.map(({ slot, entries }) => ({
223
- slot,
224
- entries: entries.map(({ roomRef, segment }) => ({ locator: roomRef, segment })),
225
- }));
226
- }
227
- export function locatorOf(authority) {
228
- return authority.roomHandle === PRIVATE_HANDLE ? PRIVATE_LOCATOR : authority.roomRef;
229
- }
230
183
  function schemasOf(authority) {
231
- return authority.roomHandle === PRIVATE_HANDLE
232
- ? [authority.schema, HOUSE_SCHEMA]
233
- : [authority.schema];
184
+ return authority.houseModel === null
185
+ ? [authority.schema]
186
+ : [authority.schema, authority.houseModel.root];
234
187
  }
235
188
  export function trackedFrom(document) {
236
189
  return document.authorities.map((authority) => ({
237
- locator: locatorOf(authority),
190
+ locator: authority.roomRef,
238
191
  authority: authority.roomRef,
239
192
  handle: authority.roomHandle,
240
193
  schema: authority.schema,
194
+ houseModel: authority.houseModel,
241
195
  schemas: schemasOf(authority),
242
196
  position: authority.position,
243
197
  logEpoch: authority.logEpoch,
@@ -261,30 +215,32 @@ export function declaredRetention(bounds) {
261
215
  refreshHorizon: bounds.change_retention_seconds,
262
216
  };
263
217
  }
264
- export function capabilities(actions) {
218
+ export function capabilities(document) {
219
+ const house = document.authorities.find((authority) => authority.houseModel !== null);
265
220
  return [
266
- { name: ROOM_VERSION_NOTIFICATIONS },
267
221
  {
268
222
  name: PROVIDER_ACTIONS,
269
- actions: declaredActions(actions),
270
- conversationCards: HOUSE_CONVERSATION_CARDS,
223
+ actions: declaredActions(document.actions),
224
+ ...(house === undefined
225
+ ? {}
226
+ : { conversationAgents: houseConversationAgents(house.roomRef) }),
271
227
  },
272
- { name: MOVE_REFERENCE_REWRITES },
273
228
  ];
274
229
  }
275
230
  export function siteCapabilities() {
276
231
  return [
277
- { name: ROOM_VERSION_NOTIFICATIONS },
278
- { name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },
232
+ {
233
+ name: PROVIDER_ACTIONS,
234
+ actions: [{ name: SITE_SUBMIT, inputShape: {}, resultKind: 'house' }],
235
+ },
279
236
  ];
280
237
  }
281
- export function providerSelection(attachedModel) {
282
- return { roots: [...PROVIDER_SELECTION_ROOTS], attachedModel };
283
- }
284
- export function discoveredRoom(authority, attachedModel, typedSelection) {
238
+ export function discoveredRoom(authority) {
239
+ const locator = authority.roomRef;
285
240
  return {
286
241
  name: authority.name,
287
- locator: locatorOf(authority),
242
+ locator,
243
+ handle: authority.roomHandle,
288
244
  roomVersion: roomVersion(authority),
289
245
  operations: {
290
246
  read: [...authority.operations.read],
@@ -292,18 +248,16 @@ export function discoveredRoom(authority, attachedModel, typedSelection) {
292
248
  write: [...authority.operations.write],
293
249
  delete: [...authority.operations.delete],
294
250
  },
295
- replica: { selection: locatorOf(authority), admission: authority.managedReplication },
296
- attachedModel,
297
- ...(typedSelection === undefined ? {} : { typedSelection }),
298
- untypedFolders: [...UNTYPED_FOLDERS],
251
+ replica: { selection: locator, admission: authority.managedReplication },
252
+ ...(authority.houseModel === null
253
+ ? {}
254
+ : { typedSelection: { roots: [...authority.houseModel.paths] } }),
299
255
  providerOwnedPaths: [...authority.protectedPaths, ...schemasOf(authority)],
300
256
  };
301
257
  }
302
258
  export function mapDiscovery(document, rooms, declared) {
303
259
  return {
304
260
  kind: 'discovery',
305
- supportedVersions: [ROOM_CONTRACT_VERSION],
306
- mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },
307
261
  rooms,
308
262
  capabilities: declared,
309
263
  providerLimits: providerLimits(document.bounds),
package/dist/gather.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export declare function gatheredEach<A, R>(send: (asks: readonly A[], answer: (ask: number, result: R) => void) => Promise<void>): (ask: A) => Promise<R>;
1
2
  export declare function gathered<A, R>(send: (asks: readonly A[]) => Promise<readonly R[]>): (ask: A) => Promise<R>;
2
3
  export declare function selections<T>(items: readonly T[], weight: (item: T) => number, limit: number): readonly (readonly T[])[];
3
4
  //# sourceMappingURL=gather.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gather.d.ts","sourceRoot":"","sources":["../src/gather.ts"],"names":[],"mappings":"AAMA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,GAClD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CA0BxB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC3B,KAAK,EAAE,MAAM,GACZ,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAgB3B"}
1
+ {"version":3,"file":"gather.d.ts","sourceRoot":"","sources":["../src/gather.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GACpF,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAwBxB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,GAClD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAMxB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC3B,KAAK,EAAE,MAAM,GACZ,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAgB3B"}
package/dist/gather.js CHANGED
@@ -1,13 +1,11 @@
1
- export function gathered(send) {
1
+ export function gatheredEach(send) {
2
2
  let held = [];
3
3
  function flush() {
4
4
  const taken = held;
5
5
  held = [];
6
- send(taken.map((entry) => entry.ask)).then((answers) => {
7
- taken.forEach((entry, index) => {
8
- entry.resolve(answers[index]);
9
- });
10
- }, (reason) => {
6
+ send(taken.map((entry) => entry.ask), (ask, result) => {
7
+ taken[ask]?.resolve(result);
8
+ }).catch((reason) => {
11
9
  for (const entry of taken)
12
10
  entry.reject(reason);
13
11
  });
@@ -20,6 +18,13 @@ export function gathered(send) {
20
18
  held.push({ ask, resolve, reject });
21
19
  });
22
20
  }
21
+ export function gathered(send) {
22
+ return gatheredEach(async (asks, answer) => {
23
+ (await send(asks)).forEach((result, ask) => {
24
+ answer(ask, result);
25
+ });
26
+ });
27
+ }
23
28
  export function selections(items, weight, limit) {
24
29
  const parts = [];
25
30
  let part = [];
@@ -0,0 +1,15 @@
1
+ import type { HeldRoom, MutationResult } from '@agentshouse/mdruntime';
2
+ import type { HouseScope, HouseView } from './read.js';
3
+ import type { StreamedAdvancement } from './stream.js';
4
+ export type HandedRoom = {
5
+ roomVersion: string;
6
+ revisions: ReadonlyMap<string, string>;
7
+ };
8
+ export declare function scopeHanded(scope: HouseScope): HandedRoom;
9
+ export declare function heldHanded(held: HeldRoom): HandedRoom;
10
+ export declare function acceptedHanded(held: HandedRoom, accepted: Extract<MutationResult, {
11
+ kind: 'accepted';
12
+ }>, roomVersion: string): HandedRoom;
13
+ export declare function enumeratedHanded(view: HouseView, earlier: HandedRoom | undefined): HandedRoom;
14
+ export declare function streamedHanded(held: HandedRoom, advanced: StreamedAdvancement): HandedRoom;
15
+ //# sourceMappingURL=handed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handed.d.ts","sourceRoot":"","sources":["../src/handed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CASzD;AAOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAErD;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EACvD,WAAW,EAAE,MAAM,GAClB,UAAU,CAKZ;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAM7F;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,GAAG,UAAU,CAM1F"}
package/dist/handed.js ADDED
@@ -0,0 +1,38 @@
1
+ import { roomVersion } from './version.js';
2
+ export function scopeHanded(scope) {
3
+ return {
4
+ roomVersion: roomVersion(scope),
5
+ revisions: new Map(scope.files.flatMap(({ path, revision }) => revision === undefined ? [] : [[path, revision]])),
6
+ };
7
+ }
8
+ function revised(revisions, path, revision) {
9
+ if (revision === undefined)
10
+ revisions.delete(path);
11
+ else
12
+ revisions.set(path, revision);
13
+ }
14
+ export function heldHanded(held) {
15
+ return { roomVersion: held.roomVersion, revisions: new Map(Object.entries(held.revisions)) };
16
+ }
17
+ export function acceptedHanded(held, accepted, roomVersion) {
18
+ const revisions = new Map(held.revisions);
19
+ for (const [path, revision] of Object.entries(accepted.revisions))
20
+ revisions.set(path, revision);
21
+ for (const path of accepted.removals)
22
+ revisions.delete(path);
23
+ return { roomVersion, revisions };
24
+ }
25
+ export function enumeratedHanded(view, earlier) {
26
+ const revisions = new Map(earlier?.revisions);
27
+ for (const change of view.changes) {
28
+ revised(revisions, change.path, 'removed' in change ? undefined : change.revision);
29
+ }
30
+ return { roomVersion: roomVersion(view), revisions };
31
+ }
32
+ export function streamedHanded(held, advanced) {
33
+ const revisions = new Map(held.revisions);
34
+ for (const entry of advanced.entries) {
35
+ revised(revisions, entry.path, entry.kind === 'removed' ? undefined : entry.revision);
36
+ }
37
+ return { roomVersion: advanced.page.roomVersion, revisions };
38
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
2
- export { nativePath, roomLocalPath } from './map.js';
3
- export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
2
+ export { HOUSE_APP_ACTS, HOUSE_APP_BATCHES, HOUSE_SITE_ACTS } from './actions.js';
3
+ export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, HouseDoorAnswer, HouseHeldRoom, HouseOpening, 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,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,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,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { createAgentsHouseAdapter } from './adapter.js';
2
- export { nativePath, roomLocalPath } from './map.js';
2
+ export { HOUSE_APP_ACTS, HOUSE_APP_BATCHES, HOUSE_SITE_ACTS } from './actions.js';
package/dist/model.d.ts CHANGED
@@ -1,19 +1,9 @@
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;
1
+ import type { RoomModels } from '@agentshouse/mdruntime';
2
+ import type { TrackedAuthority } from './discovery.js';
3
+ import { type HouseScope, type HouseView } from './read.js';
4
+ import type { HouseMode, HouseStreamEntry } from './transport.js';
5
+ export declare function partModels(scope: HouseScope, tracked: TrackedAuthority, seen: ReadonlySet<string>, final: boolean): Promise<RoomModels | undefined>;
6
+ export declare function scopeModels(scope: HouseScope, tracked: TrackedAuthority): Promise<RoomModels | undefined>;
7
+ export declare function viewModels(view: HouseView, tracked: TrackedAuthority): Promise<RoomModels | undefined>;
8
+ export declare function streamedModels(schemas: ReadonlyMap<string, HouseStreamEntry>, tracked: TrackedAuthority, mode: HouseMode): Promise<RoomModels | undefined>;
19
9
  //# sourceMappingURL=model.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAA0C,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoClE,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAKjC;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAEjC;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAcjC;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC9C,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAWjC"}
package/dist/model.js CHANGED
@@ -1,46 +1,70 @@
1
1
  import { sha256Hex } from './digest.js';
2
- export const MODEL_ABSENT = { kind: 'model-unavailable', reason: 'not-readable' };
3
- export function failedModel(failure) {
4
- if (failure.kind === 'revoked-authorization')
5
- return { kind: 'revoked-authorization' };
6
- if (failure.kind === 'transport-uncertainty')
7
- return { kind: 'transport-uncertainty' };
8
- return MODEL_ABSENT;
9
- }
10
- export function modelKey(locator, attached) {
11
- return `${locator} ${attached}`;
12
- }
13
- export async function heldModel(read, identity, failure) {
2
+ import { schemaOf, schemaPath } from './read.js';
3
+ const MODEL_ABSENT = { kind: 'model-unavailable', reason: 'not-readable' };
4
+ const ABSENT_SCHEMA = { schema: null, version: null, revision: null };
5
+ async function heldModel(read, identity) {
14
6
  if (read === null)
15
- return { snapshot: failure, identity: null };
7
+ return MODEL_ABSENT;
16
8
  const version = await sha256Hex(JSON.stringify(read.version));
17
9
  return {
18
- snapshot: { kind: 'model', snapshot: { identity, version, schema: read.schema } },
19
- identity: { identity, version },
10
+ kind: 'model',
11
+ snapshot: { identity, version, schema: read.schema, revision: read.revision },
20
12
  };
21
13
  }
22
- export function modelShelf() {
23
- const models = new Map();
24
- return {
25
- retain(key, acquired) {
26
- if (acquired === undefined)
27
- return models.get(key);
28
- if (acquired.snapshot.kind === 'transport-uncertainty') {
29
- const previous = models.get(key);
30
- if (previous !== undefined && previous.identity !== null)
31
- return previous;
32
- }
33
- models.set(key, acquired);
34
- return acquired;
35
- },
36
- answer(request) {
37
- return models.get(modelKey(request.locator, request.attached))?.snapshot ?? MODEL_ABSENT;
38
- },
39
- keep(locators) {
40
- for (const key of [...models.keys()]) {
41
- if (!locators.some((locator) => key.startsWith(`${locator} `)))
42
- models.delete(key);
43
- }
44
- },
45
- };
14
+ async function modelsOf(tracked, read) {
15
+ const models = {};
16
+ const collection = read(tracked.schema);
17
+ if (collection !== undefined) {
18
+ models.collection = await heldModel(collection, schemaPath(tracked.handle, tracked.schema));
19
+ }
20
+ if (tracked.houseModel !== null) {
21
+ const root = tracked.houseModel.root;
22
+ const selection = read(root);
23
+ if (selection !== undefined) {
24
+ models.selection = await heldModel(selection, schemaPath(tracked.handle, root));
25
+ }
26
+ }
27
+ return models.collection === undefined && models.selection === undefined ? undefined : models;
28
+ }
29
+ export function partModels(scope, tracked, seen, final) {
30
+ return modelsOf(tracked, (schema) => {
31
+ if (scope.files.some((file) => file.path === schema))
32
+ return schemaOf(scope, schema);
33
+ return final && !seen.has(schema) ? ABSENT_SCHEMA : undefined;
34
+ });
35
+ }
36
+ export function scopeModels(scope, tracked) {
37
+ return partModels(scope, tracked, new Set(), true);
38
+ }
39
+ export function viewModels(view, tracked) {
40
+ return modelsOf(tracked, (schema) => {
41
+ const change = view.changes.find((candidate) => candidate.path === schema);
42
+ if (change === undefined)
43
+ return undefined;
44
+ if ('removed' in change)
45
+ return ABSENT_SCHEMA;
46
+ if ('content' in change) {
47
+ return {
48
+ schema: change.content,
49
+ version: change.version,
50
+ revision: change.revision ?? null,
51
+ };
52
+ }
53
+ return null;
54
+ });
55
+ }
56
+ export function streamedModels(schemas, tracked, mode) {
57
+ return modelsOf(tracked, (schema) => {
58
+ const entry = schemas.get(schema);
59
+ if (entry === undefined)
60
+ return undefined;
61
+ if (entry.kind === 'removed')
62
+ return ABSENT_SCHEMA;
63
+ if (entry.text === undefined)
64
+ return null;
65
+ const version = mode === 'site' ? entry.sha256 : entry.revision;
66
+ return version === undefined
67
+ ? null
68
+ : { schema: entry.text, version, revision: mode === 'site' ? null : version };
69
+ });
46
70
  }
package/dist/read.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { BootstrapPage, RefreshResult, RoomAttachment } from '@agentshouse/mdruntime';
2
- import { type TrackedAuthority } from './discovery.js';
1
+ import type { BinaryFile, BootstrapPage, RefreshResult } from '@agentshouse/mdruntime';
2
+ import type { TrackedAuthority } from './discovery.js';
3
3
  import type { HouseMode } from './transport.js';
4
4
  import { type LogPosition } from './version.js';
5
5
  export type HeadChange = BootstrapPage['changes'][string];
@@ -8,6 +8,7 @@ export type HouseManifestFile = {
8
8
  revision: string | undefined;
9
9
  version: string;
10
10
  head?: HeadChange;
11
+ binary?: BinaryFile;
11
12
  };
12
13
  export type HouseContent = {
13
14
  path: string;
@@ -17,10 +18,14 @@ export type HouseScope = LogPosition & {
17
18
  anchor: string;
18
19
  files: readonly HouseManifestFile[];
19
20
  contents: readonly HouseContent[];
20
- attachments?: readonly RoomAttachment[];
21
+ };
22
+ export type HouseCursor = {
23
+ room: string;
24
+ path: string | null;
21
25
  };
22
26
  export type HouseEnvelope = {
23
27
  scopes: readonly HouseScope[];
28
+ next?: HouseCursor;
24
29
  };
25
30
  export type HouseGrant = {
26
31
  method: 'GET';
@@ -41,14 +46,14 @@ export type HouseChange = {
41
46
  head?: HeadChange;
42
47
  } | {
43
48
  path: string;
44
- reference: {
45
- revision: string;
46
- };
49
+ binary: BinaryFile;
50
+ revision: string | undefined;
51
+ version: string;
52
+ head?: HeadChange;
47
53
  };
48
54
  export type HouseView = LogPosition & {
49
55
  authority: string;
50
56
  changes: readonly HouseChange[];
51
- attachments?: readonly RoomAttachment[];
52
57
  };
53
58
  export type HouseEnumeration = {
54
59
  authorities: readonly HouseView[];
@@ -61,19 +66,19 @@ export declare function headChange(held: {
61
66
  readonly author?: unknown;
62
67
  readonly created_at?: unknown;
63
68
  }): HeadChange | undefined | null;
69
+ export declare function binaryFileOf(held: Readonly<Record<string, unknown>>): BinaryFile | undefined | null;
64
70
  export declare function parseEnvelope(body: unknown): HouseEnvelope | null;
65
71
  export declare function parseSiteBootstrap(body: unknown): HouseScope | null;
66
72
  export declare function parseEnumeration(body: unknown, mode: HouseMode): HouseEnumeration | null;
67
73
  export declare function advancedScope(scope: HouseScope, view: HouseView): HouseScope;
68
74
  export declare function matchesScope(scope: HouseScope, tracked: TrackedAuthority): boolean;
69
- export declare function selects(tracked: TrackedAuthority, path: string): boolean;
70
- export declare function bootstrapOf(scope: HouseScope, tracked: TrackedAuthority): BootstrapPage;
75
+ export declare function bootstrapOf(scope: HouseScope): BootstrapPage;
71
76
  export type HouseSchema = {
72
77
  schema: string | null;
73
78
  version: string | null;
79
+ revision: string | null;
74
80
  };
75
- export declare function schemaFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, schema: string): HouseSchema | null;
76
81
  export declare function schemaOf(scope: HouseScope, schema: string): HouseSchema | null;
77
82
  export declare function viewOf(enumeration: HouseEnumeration, tracked: TrackedAuthority): HouseView | undefined;
78
- export declare function refreshFrom(view: HouseView, tracked: TrackedAuthority, fromRoomVersion: string): RefreshResult;
83
+ export declare function refreshFrom(view: HouseView, fromRoomVersion: string): RefreshResult;
79
84
  //# sourceMappingURL=read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;I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