@agentshouse/mdruntime-adapter 0.1.0-cc7fa1e066844 → 0.1.0-cca5d676bc88e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -12,13 +12,25 @@ the reported persistence answer, reauthorization, conversation, the chat draft,
12
12
  and Presentation State. Sync Status, the Service Mode, the storage-loss
13
13
  statement and the deployment facts are observations only.
14
14
 
15
+ The host attaches each port with its reach, and every member and observation
16
+ answers within it: a Room outside it answers as one the replica does not hold, a
17
+ Room reached for single Documents shows only those Documents, the Types of the
18
+ models that govern them and no attachments, and without conversations the
19
+ conversation members, the chat draft and the conversation observation hold none.
20
+ A change of the reach reaches every open observation as its new value, a query
21
+ keeping every unchanged Document the same object.
22
+
15
23
  Every `observe` resolves, once its first value has arrived, to a handle:
16
24
  `current()` is the latest complete value, `subscribe(listener)` hears each later
17
25
  value whole and returns its unsubscribe, and `close()` ends the observation.
18
26
  Closing the port ends every handle and rejects every pending call and
19
27
  observation; a client that reconnects observes again.
20
28
 
21
- Each conversation a Provider card names is held complete in the browser.
29
+ Each conversation the Provider's conversation list names is held complete in the
30
+ browser. `conversation.list()` and `observe('conversations')` answer each with its
31
+ Agent's identity and name, its name, created and finished times, last outcome and live
32
+ `state`: `asking` while a question waits, `working` while a turn runs, else `idle`,
33
+ and `started`, when the running turn began, or `null`.
22
34
  Observe one with `observe('conversation', id, { limit })`: the view
23
35
  holds its latest `limit` messages, or all of them, oldest first, its chat
24
36
  draft, and what the Provider streams for it whether or not anything views it:
@@ -193,13 +205,25 @@ an App's override respected. What an App Creator's agent adds carries none
193
205
  of these promises by itself. Reading, querying and searching never wait for
194
206
  the network. Data lives only in the App Creator's browser and with the Provider.
195
207
 
196
- ## App code imports only the client entry and never constructs a Runtime
197
-
198
- App code imports only `@agentshouse/mdruntime/client` and calls
199
- `connectMdRuntime` on the port the host hands it. It never constructs a
200
- Runtime. It does not import the package main, the host entry, or the Adapter
201
- package, and it does not call `serveMdRuntime`. Hosts
202
- and tests use those entries; the served App does not.
208
+ ## App code takes the client its host hands it and never constructs a Runtime
209
+
210
+ App code takes the client its host hands it: in House,
211
+ `connectHouseBridge().runtime` from `@agentshouse/app-bridge` resolves to the
212
+ client House built into the page. It never constructs a Runtime or a client.
213
+ It imports only types from `@agentshouse/mdruntime/client`, does not call
214
+ `connectMdRuntime` or `serveMdRuntime`, and does not import the package main,
215
+ the host entry, or the Adapter package. Hosts and tests use those entries; the
216
+ served App does not.
217
+
218
+ A React App may observe and save through `@agentshouse/mdruntime/react`, which
219
+ names React as a peer dependency. `useObserve(client, topic, ...input)` takes
220
+ the arguments of `observe` and returns the topic's current value, `undefined`
221
+ until it arrives, re-rendering on each change; a `null` client observes
222
+ nothing. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
223
+ `save(room, roomDrafts)`, which writes each Path's parts onto the Room Draft
224
+ already there, keeping the bases its parts have, or onto a new one, and saves
225
+ them together. A refused Save leaves the Room Drafts for the App to save again
226
+ or discard; a failure is recorded and rejects.
203
227
 
204
228
  ## What an agent must never do
205
229
 
package/README.md CHANGED
@@ -19,12 +19,12 @@ import { serveMdRuntime } from '@agentshouse/mdruntime/host';
19
19
  import { createAgentsHouseAdapter } from '@agentshouse/mdruntime-adapter';
20
20
 
21
21
  const adapter = createAgentsHouseAdapter({ transport, authorize });
22
- const host = serveMdRuntime({ adapter, shell, requiredGuarantees: [] });
22
+ const host = serveMdRuntime({ adapter, shell });
23
23
  host.attach(port, 'my-app');
24
24
  ```
25
25
 
26
- App code never imports this package; it reaches the Runtime only through
27
- `@agentshouse/mdruntime/client`. The rules an App's agent follows are in the
26
+ App code never imports this package; it reaches the Runtime only through the
27
+ client its host hands it. The rules an App's agent follows are in the
28
28
  package's `AGENTS.md`.
29
29
 
30
30
  ## License
package/dist/actions.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { type AcceptedMessage, type ActionDeclaration, type ActionRequest, type ActionResult, type ConversationCards } from '@agentshouse/mdruntime';
1
+ import { type AcceptedMessage, type ActionDeclaration, type ActionRequest, type ActionResult, type ConversationAgents } from '@agentshouse/mdruntime';
2
2
  import type { HouseDoorAnswer, HouseTransport } from './transport.js';
3
- export declare const HOUSE_CONVERSATION_CARDS: ConversationCards;
3
+ export declare const HOUSE_CONVERSATION_AGENTS: ConversationAgents;
4
4
  export declare function declaredActions(routes: readonly string[]): readonly ActionDeclaration[];
5
5
  export declare function houseAction(transport: HouseTransport, request: ActionRequest): Promise<ActionResult>;
6
6
  export declare function actionOutcome(answer: HouseDoorAnswer, name: string): ActionResult;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAGvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAkBtE,eAAO,MAAM,wBAAwB,EAAE,iBAKtC,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CASvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAQvB;AA4DD,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAWjF;AAuLD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAUtE"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAkBtE,eAAO,MAAM,yBAAyB,EAAE,kBAKvC,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CASvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAQvB;AA4DD,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAWjF;AAuLD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAUtE"}
package/dist/actions.js CHANGED
@@ -13,11 +13,11 @@ const CONVERSATION_ROUTES = new Map([
13
13
  ['conversation.delete', '/door/conversations/delete'],
14
14
  ['conversation.history', '/door/conversations/history'],
15
15
  ]);
16
- export const HOUSE_CONVERSATION_CARDS = {
16
+ export const HOUSE_CONVERSATION_AGENTS = {
17
17
  locator: PRIVATE_LOCATOR,
18
- type: 'house-conversation',
19
- identity: 'conversation',
20
- agent: 'agent',
18
+ type: 'house-agent',
19
+ identity: 'agent',
20
+ name: 'name',
21
21
  };
22
22
  export function declaredActions(routes) {
23
23
  const mapped = new Map([...CONVERSATION_ROUTES].map(([name, route]) => [route.slice('/door/'.length), name]));
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,OAAO,EACP,aAAa,EAad,MAAM,wBAAwB,CAAC;AAyChC,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAuBxB,MAAM,MAAM,yBAAyB,GACjC;IACE,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACrC,GACD;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAiCjC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CA2ZpF"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,OAAO,EACP,aAAa,EAWd,MAAM,wBAAwB,CAAC;AAqChC,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAyBxB,MAAM,MAAM,yBAAyB,GACjC;IACE,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACrC,GACD;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAsBjC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CA0WpF"}
package/dist/adapter.js CHANGED
@@ -1,26 +1,20 @@
1
- import { DISCOVER_PREFIXES, capabilities, discoveredRoom, locatorOf, mapDiscovery, parseDiscovery, trackedFrom, } from './discovery.js';
2
- import { MODEL_ABSENT, failedModel, heldModel, modelKey, modelShelf, } from './model.js';
1
+ import { DISCOVER_PREFIXES, capabilities, discoveredRoom, mapDiscovery, parseDiscovery, trackedFrom, } from './discovery.js';
2
+ import { scopeModels, streamedModels, viewModels } from './model.js';
3
3
  import { gathered, selections } from './gather.js';
4
4
  import { createSiteAdapter } from './site.js';
5
- import { bootstrapOf, contentPrefixes, matchesScope, parseEnumeration, parseEnvelope, parseGrant, refreshFrom, schemaFrom, schemaPath, viewOf, } from './read.js';
6
- import { enumeratedLinks, scopeLinks, streamedLinks } from './links.js';
5
+ import { bootstrapOf, contentPrefixes, matchesScope, parseEnumeration, parseEnvelope, parseGrant, refreshFrom, viewOf, } from './read.js';
6
+ import { acceptedLinks, enumeratedLinks, heldLinks, scopeLinks, streamedLinks, } from './links.js';
7
7
  import { houseAction } from './actions.js';
8
8
  import { classifyDoor, discoveryFailure, doorRefusal } from './refusal.js';
9
9
  import { houseNotifications } from './stream.js';
10
10
  import { DOOR_BATCH, DOOR_BATCH_UPLOAD, DOOR_BOOTSTRAP, DOOR_DISCOVER, DOOR_ENUMERATE, DOOR_REVISIONS, PRIVATE_LOCATOR, } from './transport.js';
11
11
  import { batchPaths, deltaBody, deltaBytes, deltaDigest, historyOutcome, houseChanges, mutationOutcome, operationHead, rejectedMapping, revisionBody, uploadable, } from './write.js';
12
- import { logPosition, presented, reachedVersion, roomVersion, } from './version.js';
12
+ import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
13
13
  const UNCERTAIN = { kind: 'transport-uncertainty' };
14
14
  const UNCERTAIN_READ = { kind: 'transport-uncertainty' };
15
15
  function lapsedGrant(outcome) {
16
16
  return outcome.kind === 'rejected' && outcome.code === 'upload_unavailable';
17
17
  }
18
- function modelFailure(classified, envelope) {
19
- if (classified === null) {
20
- return envelope === null ? { kind: 'transport-uncertainty' } : MODEL_ABSENT;
21
- }
22
- return failedModel(classified);
23
- }
24
18
  export function createAgentsHouseAdapter(options) {
25
19
  if ('site' in options)
26
20
  return createSiteAdapter(options.site);
@@ -28,80 +22,75 @@ export function createAgentsHouseAdapter(options) {
28
22
  const notifications = houseNotifications(transport, 'credential');
29
23
  const tracked = new Map();
30
24
  const handed = new Map();
31
- const models = modelShelf();
32
25
  let bounds;
33
26
  function declared() {
34
27
  if (bounds === undefined)
35
28
  throw new Error('no Discovery declared the bounds');
36
29
  return bounds;
37
30
  }
38
- function bootstrappedRoom(envelope, entry) {
31
+ async function bootstrappedRoom(envelope, entry) {
39
32
  const scope = envelope.scopes.find((candidate) => matchesScope(candidate, entry));
40
33
  if (scope === undefined)
41
34
  return { kind: 'room-not-readable', locator: entry.locator };
42
35
  handed.set(entry.locator, scopeLinks(scope));
43
- notifications.hold(entry.authority, scope);
44
- return bootstrapOf(scope);
36
+ notifications.reach(entry.authority, scope);
37
+ const models = await scopeModels(scope, entry);
38
+ return { ...bootstrapOf(scope), ...(models === undefined ? {} : { models }) };
45
39
  }
46
- function enumeratedRoom(enumeration, ask) {
40
+ async function enumeratedRoom(enumeration, ask) {
47
41
  const view = viewOf(enumeration, ask.entry);
48
42
  if (view === undefined)
49
43
  return { kind: 'room-not-readable', locator: ask.entry.locator };
50
- notifications.hold(ask.entry.authority, view);
44
+ notifications.reach(ask.entry.authority, view);
51
45
  const answer = refreshFrom(view, ask.fromRoomVersion);
52
- if (answer.kind === 'net-advancement') {
53
- handed.set(ask.entry.locator, enumeratedLinks(view, handed.get(ask.entry.locator)));
54
- }
55
- return answer;
46
+ if (answer.kind !== 'net-advancement')
47
+ return answer;
48
+ handed.set(ask.entry.locator, enumeratedLinks(view, handed.get(ask.entry.locator)));
49
+ const models = await viewModels(view, ask.entry);
50
+ return models === undefined ? answer : { ...answer, models };
56
51
  }
57
- function streamed(entry, request, from) {
52
+ async function streamed(entry, request, from) {
58
53
  const links = handed.get(entry.locator);
59
54
  if (links?.roomVersion !== request.fromRoomVersion)
60
55
  return null;
61
56
  const advanced = notifications.advance(entry, from, (path, revision) => links.revisions.get(path) === revision);
62
57
  if (advanced === null)
63
58
  return null;
64
- if (request.minPosition !== undefined &&
65
- !reachedVersion(advanced.page.roomVersion, request.minPosition, entry.logEpoch))
66
- return null;
67
59
  const relinked = streamedLinks(links, advanced);
68
60
  if (relinked === null)
69
61
  return null;
70
62
  handed.set(entry.locator, relinked);
71
- return advanced.page;
63
+ const models = await streamedModels(advanced.schemas, entry, 'credential');
64
+ return models === undefined ? advanced.page : { ...advanced.page, models };
72
65
  }
73
- function held(envelope, entry, schema, failure) {
74
- return heldModel(envelope === null ? null : schemaFrom(envelope, entry, schema), schemaPath(entry.handle, schema), failure);
75
- }
76
- function modelPrefixes(entry) {
77
- return entry.schemas.map((schema) => schemaPath(entry.handle, schema));
78
- }
79
- async function acquireModels(entries) {
80
- const acquired = new Map();
81
- for (const part of selections(entries, (entry) => modelPrefixes(entry).length, declared().max_prefixes)) {
82
- const answer = await transport.door(DOOR_BOOTSTRAP, {
83
- prefixes: part.flatMap((entry) => modelPrefixes(entry)),
84
- });
85
- const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);
86
- const envelope = classified === null ? parseEnvelope(await bundled(answer.body)) : null;
87
- const failure = modelFailure(classified, envelope);
88
- for (const entry of part) {
89
- acquired.set(modelKey(entry.locator, 'collection'), await held(envelope, entry, entry.schema, failure));
90
- if (entry.houseModel === null)
91
- continue;
92
- acquired.set(modelKey(entry.locator, 'typed-selection'), await held(envelope, entry, entry.houseModel.root, failure));
93
- }
94
- }
95
- return acquired;
66
+ function held(rooms) {
67
+ const kept = rooms.flatMap((room) => {
68
+ const entry = tracked.get(room.locator);
69
+ const at = logPosition(room.roomVersion);
70
+ if (entry === undefined || at === null)
71
+ return [];
72
+ handed.set(room.locator, heldLinks(room));
73
+ notifications.reach(entry.authority, at);
74
+ return [presented(entry.authority, at)];
75
+ });
76
+ notifications.send(kept);
96
77
  }
97
- function roomOf(authority, acquired) {
98
- const locator = locatorOf(authority);
99
- const key = modelKey(locator, 'collection');
100
- const collection = models.retain(key, acquired.get(key));
101
- const selection = authority.houseModel === null
102
- ? undefined
103
- : models.retain(modelKey(locator, 'typed-selection'), acquired.get(modelKey(locator, 'typed-selection')));
104
- return discoveredRoom(authority, collection?.identity ?? null, selection?.identity ?? null);
78
+ function adopted(entry, outcome) {
79
+ if (outcome.kind !== 'accepted')
80
+ return outcome;
81
+ const { originals, ...accepted } = outcome;
82
+ const links = handed.get(entry.locator);
83
+ if (links === undefined)
84
+ return accepted;
85
+ const follows = followsVersion(links.roomVersion, accepted.roomVersion);
86
+ const relinked = acceptedLinks(links, accepted, follows ? accepted.roomVersion : links.roomVersion, originals);
87
+ handed.set(entry.locator, relinked.links);
88
+ const at = logPosition(accepted.roomVersion);
89
+ if (follows && at !== null)
90
+ notifications.reach(entry.authority, at);
91
+ return relinked.attachments === undefined
92
+ ? accepted
93
+ : { ...accepted, attachments: relinked.attachments };
105
94
  }
106
95
  function authorityFor(locator) {
107
96
  return tracked.get(locator);
@@ -147,14 +136,14 @@ export function createAgentsHouseAdapter(options) {
147
136
  });
148
137
  const classified = part.map((entry) => classifyDoor(answer.status, answer.body, entry.locator));
149
138
  const envelope = classified[0] === null ? parseEnvelope(await bundled(answer.body)) : null;
150
- part.forEach((entry, index) => {
139
+ for (const [index, entry] of part.entries()) {
151
140
  const failure = classified[index];
152
141
  if (failure === null || failure === undefined) {
153
- answers.push(envelope === null ? UNCERTAIN_READ : bootstrappedRoom(envelope, entry));
154
- return;
142
+ answers.push(envelope === null ? UNCERTAIN_READ : await bootstrappedRoom(envelope, entry));
143
+ continue;
155
144
  }
156
145
  answers.push(failure.kind === 'beyond-horizon' ? UNCERTAIN_READ : failure);
157
- });
146
+ }
158
147
  }
159
148
  return answers;
160
149
  }
@@ -176,23 +165,8 @@ export function createAgentsHouseAdapter(options) {
176
165
  while (open.length > 0) {
177
166
  const answer = await transport.door(DOOR_ENUMERATE, {
178
167
  prefixes: open.flatMap((ask) => contentPrefixes(ask.entry)),
179
- positions: open.map((ask) => ({
180
- ...presented(ask.entry.authority, ask.from),
181
- ...(ask.minPosition === undefined ? {} : { min_position: ask.minPosition }),
182
- })),
168
+ positions: open.map((ask) => presented(ask.entry.authority, ask.from)),
183
169
  });
184
- const refusal = doorRefusal(answer.body);
185
- if (refusal?.code === 'replica_behind') {
186
- const named = open.filter((ask) => ask.entry.authority === refusal.fields.authority);
187
- const behind = named.length === 0 ? open : named;
188
- for (const ask of behind) {
189
- answers.set(ask, refusal.retryable
190
- ? { kind: 'retryable-refusal', code: refusal.code, fields: refusal.fields }
191
- : (classifyDoor(answer.status, answer.body, ask.entry.locator) ?? UNCERTAIN_READ));
192
- }
193
- open = open.filter((ask) => !behind.includes(ask));
194
- continue;
195
- }
196
170
  const classified = open.map((ask) => classifyDoor(answer.status, answer.body, ask.entry.locator));
197
171
  if (classified[0]?.kind === 'beyond-horizon') {
198
172
  const named = doorRefusal(answer.body)?.fields.authority;
@@ -205,14 +179,14 @@ export function createAgentsHouseAdapter(options) {
205
179
  continue;
206
180
  }
207
181
  const enumeration = classified[0] === null ? parseEnumeration(answer.body, 'credential') : null;
208
- open.forEach((ask, index) => {
182
+ for (const [index, ask] of open.entries()) {
209
183
  const failure = classified[index];
210
184
  if (failure !== null && failure !== undefined) {
211
185
  answers.set(ask, failure);
212
- return;
186
+ continue;
213
187
  }
214
- answers.set(ask, enumeration === null ? UNCERTAIN_READ : enumeratedRoom(enumeration, ask));
215
- });
188
+ answers.set(ask, enumeration === null ? UNCERTAIN_READ : await enumeratedRoom(enumeration, ask));
189
+ }
216
190
  open = [];
217
191
  }
218
192
  }
@@ -224,7 +198,7 @@ export function createAgentsHouseAdapter(options) {
224
198
  const paths = batchPaths(changes);
225
199
  const sha256 = await deltaDigest(delta);
226
200
  if (handed !== undefined && handed.sha256 === sha256) {
227
- return { body: { ...head, paths, upload: handed } };
201
+ return { body: { ...head, paths, upload: handed, runtime: notifications.runtime } };
228
202
  }
229
203
  const minted = await transport.door(DOOR_BATCH_UPLOAD, { ...head, paths, bytes, sha256 });
230
204
  if (minted.status !== 200) {
@@ -247,10 +221,10 @@ export function createAgentsHouseAdapter(options) {
247
221
  return { outcome: UNCERTAIN };
248
222
  const upload = { url: holding.url, operation: holding.operation, bytes, sha256 };
249
223
  await keep(upload);
250
- return { body: { ...head, paths, upload } };
224
+ return { body: { ...head, paths, upload, runtime: notifications.runtime } };
251
225
  }
252
226
  async function submit(head, changes, delta, bytes, entry, handed, keep) {
253
- const inline = { ...head, changes };
227
+ const inline = { ...head, changes, runtime: notifications.runtime };
254
228
  const prepared = uploadable(inline, bytes, declared())
255
229
  ? await uploaded(head, changes, delta, bytes, entry, handed, keep)
256
230
  : { body: inline };
@@ -263,9 +237,6 @@ export function createAgentsHouseAdapter(options) {
263
237
  async authorize() {
264
238
  return options.authorize();
265
239
  },
266
- async model(_authorization, request) {
267
- return models.answer(request);
268
- },
269
240
  async discover(_authorization) {
270
241
  const answer = await transport.door(DOOR_DISCOVER, { prefixes: [...DISCOVER_PREFIXES] });
271
242
  const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);
@@ -283,9 +254,7 @@ export function createAgentsHouseAdapter(options) {
283
254
  if (!tracked.has(locator))
284
255
  handed.delete(locator);
285
256
  notifications.track(entries);
286
- const acquired = await acquireModels(entries);
287
- models.keep(entries.map((entry) => entry.locator));
288
- return mapDiscovery(document, document.authorities.map((authority) => roomOf(authority, acquired)), capabilities(document.actions));
257
+ return mapDiscovery(document, document.authorities.map((authority) => discoveredRoom(authority)), capabilities(document.actions));
289
258
  },
290
259
  async bootstrap(_authorization, request) {
291
260
  const entry = authorityFor(request.locator);
@@ -304,16 +273,10 @@ export function createAgentsHouseAdapter(options) {
304
273
  const from = logPosition(request.fromRoomVersion);
305
274
  if (from === null)
306
275
  return { kind: 'beyond-horizon' };
307
- const answered = streamed(entry, request, from);
276
+ const answered = await streamed(entry, request, from);
308
277
  if (answered !== null)
309
278
  return answered;
310
- const minPosition = request.minPosition === undefined ? null : logPosition(request.minPosition);
311
- return enumerateTogether({
312
- entry,
313
- from,
314
- fromRoomVersion: request.fromRoomVersion,
315
- ...(minPosition?.logEpoch === from.logEpoch ? { minPosition: minPosition.position } : {}),
316
- });
279
+ return enumerateTogether({ entry, from, fromRoomVersion: request.fromRoomVersion });
317
280
  },
318
281
  async mutate(_authorization, request, keep) {
319
282
  const entry = authorityFor(request.locator);
@@ -328,8 +291,8 @@ export function createAgentsHouseAdapter(options) {
328
291
  const handed = request.upload;
329
292
  const outcome = await submit(head, mapped.changes, delta, bytes, entry, handed, keep);
330
293
  if (handed === undefined || !lapsedGrant(outcome))
331
- return outcome;
332
- return submit(head, mapped.changes, delta, bytes, entry, undefined, keep);
294
+ return adopted(entry, outcome);
295
+ return adopted(entry, await submit(head, mapped.changes, delta, bytes, entry, undefined, keep));
333
296
  },
334
297
  async history(_authorization, request) {
335
298
  const entry = authorityFor(request.locator);
@@ -349,10 +312,13 @@ export function createAgentsHouseAdapter(options) {
349
312
  reached(locator, version, target) {
350
313
  return reachedVersion(version, target, authorityFor(locator)?.logEpoch);
351
314
  },
315
+ follows(_locator, version, next) {
316
+ return followsVersion(version, next);
317
+ },
352
318
  async action(_authorization, request) {
353
319
  return withAt(await houseAction(transport, request));
354
320
  },
355
- roomVersions: notifications,
321
+ roomStream: { hold: held, observe: notifications.observe },
356
322
  conversations: notifications.conversations,
357
323
  serviceMode: notifications.serviceMode,
358
324
  };
@@ -1,10 +1,6 @@
1
- import type { Capability, DiscoveredRoom, Discovery, ModelIdentity, ProviderLimit, Retention } from '@agentshouse/mdruntime';
1
+ import type { Capability, DiscoveredRoom, Discovery, ProviderLimit, Retention } from '@agentshouse/mdruntime';
2
2
  import { type LogPosition } from './version.js';
3
- export declare const ROOM_CONTRACT_VERSION = 1;
4
- export declare const MD_MODEL_IDENTITY = "@agentshouse/mdmodel";
5
- export declare const ROOM_VERSION_NOTIFICATIONS = "room-version-notifications";
6
3
  export declare const PROVIDER_ACTIONS = "provider-actions";
7
- export declare const MOVE_REFERENCE_REWRITES = "move-reference-rewrites";
8
4
  export declare const DISCOVER_PREFIXES: readonly string[];
9
5
  export declare const PRIVATE_HANDLE = "private";
10
6
  export type HouseBounds = {
@@ -43,7 +39,6 @@ export type HouseAuthority = LogPosition & {
43
39
  };
44
40
  export type HouseDiscoveryDocument = {
45
41
  bounds: HouseBounds;
46
- mdModelVersion: string;
47
42
  authorities: readonly HouseAuthority[];
48
43
  actions: readonly string[];
49
44
  };
@@ -62,7 +57,6 @@ export type HouseSiteAuthority = LogPosition & {
62
57
  };
63
58
  export type HouseSiteDiscovery = {
64
59
  bounds: HouseBounds;
65
- mdModelVersion: string;
66
60
  authorities: readonly HouseSiteAuthority[];
67
61
  };
68
62
  export declare function parseDiscovery(body: unknown): HouseDiscoveryDocument | null;
@@ -74,6 +68,6 @@ export declare function providerLimits(bounds: HouseBounds): readonly ProviderLi
74
68
  export declare function declaredRetention(bounds: HouseBounds): Retention;
75
69
  export declare function capabilities(actions: readonly string[]): readonly Capability[];
76
70
  export declare function siteCapabilities(): readonly Capability[];
77
- export declare function discoveredRoom(authority: HouseAuthority, attachedModel: DiscoveredRoom['attachedModel'], selectionModel: ModelIdentity | null): DiscoveredRoom;
78
- export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds' | 'mdModelVersion'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
71
+ export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
72
+ export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
79
73
  //# sourceMappingURL=discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAU,CAAC;AAE1D,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,e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B,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAa3E;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,kBAAkB,GAAG,gBAAgB,EAAE,CAW5E;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAE3D;AAQD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,sBAAsB,GAAG,gBAAgB,EAAE,CAWhF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,aAAa,EAAE,CAU5E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAMhE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,UAAU,EAAE,CAQ9E;AAED,wBAAgB,gBAAgB,IAAI,SAAS,UAAU,EAAE,CAIxD;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAkBxE;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,EAChD,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,SAAS,CAQX"}
package/dist/discovery.js CHANGED
@@ -1,11 +1,7 @@
1
- import { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';
1
+ import { declaredActions, HOUSE_CONVERSATION_AGENTS } from './actions.js';
2
2
  import { PRIVATE_LOCATOR } from './transport.js';
3
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
4
  export const PROVIDER_ACTIONS = 'provider-actions';
8
- export const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';
9
5
  export const DISCOVER_PREFIXES = ['/'];
10
6
  export const PRIVATE_HANDLE = 'private';
11
7
  const BOUND_KEYS = [
@@ -107,8 +103,6 @@ export function parseDiscovery(body) {
107
103
  const bounds = parseBounds(held.bounds);
108
104
  if (bounds === null)
109
105
  return null;
110
- if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0)
111
- return null;
112
106
  const actions = stringList(held.actions);
113
107
  if (actions === null ||
114
108
  new Set(actions).size !== actions.length ||
@@ -123,7 +117,7 @@ export function parseDiscovery(body) {
123
117
  return null;
124
118
  authorities.push(authority);
125
119
  }
126
- return { bounds, mdModelVersion: held.md_model_version, authorities, actions };
120
+ return { bounds, authorities, actions };
127
121
  }
128
122
  function parseSiteAuthority(value) {
129
123
  if (typeof value !== 'object' || value === null)
@@ -154,8 +148,6 @@ export function parseSiteDiscovery(body) {
154
148
  const bounds = parseBounds(held.bounds);
155
149
  if (bounds === null)
156
150
  return null;
157
- if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0)
158
- return null;
159
151
  if (!Array.isArray(held.authorities))
160
152
  return null;
161
153
  const authorities = [];
@@ -165,7 +157,7 @@ export function parseSiteDiscovery(body) {
165
157
  return null;
166
158
  authorities.push(authority);
167
159
  }
168
- return { bounds, mdModelVersion: held.md_model_version, authorities };
160
+ return { bounds, authorities };
169
161
  }
170
162
  export function siteTracked(document) {
171
163
  return document.authorities.map((authority) => ({
@@ -219,25 +211,23 @@ export function declaredRetention(bounds) {
219
211
  }
220
212
  export function capabilities(actions) {
221
213
  return [
222
- { name: ROOM_VERSION_NOTIFICATIONS },
223
214
  {
224
215
  name: PROVIDER_ACTIONS,
225
216
  actions: declaredActions(actions),
226
- conversationCards: HOUSE_CONVERSATION_CARDS,
217
+ conversationAgents: HOUSE_CONVERSATION_AGENTS,
227
218
  },
228
- { name: MOVE_REFERENCE_REWRITES },
229
219
  ];
230
220
  }
231
221
  export function siteCapabilities() {
232
222
  return [
233
- { name: ROOM_VERSION_NOTIFICATIONS },
234
223
  { name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },
235
224
  ];
236
225
  }
237
- export function discoveredRoom(authority, attachedModel, selectionModel) {
226
+ export function discoveredRoom(authority) {
227
+ const locator = locatorOf(authority);
238
228
  return {
239
229
  name: authority.name,
240
- locator: locatorOf(authority),
230
+ locator,
241
231
  roomVersion: roomVersion(authority),
242
232
  operations: {
243
233
  read: [...authority.operations.read],
@@ -245,24 +235,16 @@ export function discoveredRoom(authority, attachedModel, selectionModel) {
245
235
  write: [...authority.operations.write],
246
236
  delete: [...authority.operations.delete],
247
237
  },
248
- replica: { selection: locatorOf(authority), admission: authority.managedReplication },
249
- attachedModel,
238
+ replica: { selection: locator, admission: authority.managedReplication },
250
239
  ...(authority.houseModel === null
251
240
  ? {}
252
- : {
253
- typedSelection: {
254
- roots: [...authority.houseModel.paths],
255
- attachedModel: selectionModel,
256
- },
257
- }),
241
+ : { typedSelection: { roots: [...authority.houseModel.paths] } }),
258
242
  providerOwnedPaths: [...authority.protectedPaths, ...schemasOf(authority)],
259
243
  };
260
244
  }
261
245
  export function mapDiscovery(document, rooms, declared) {
262
246
  return {
263
247
  kind: 'discovery',
264
- supportedVersions: [ROOM_CONTRACT_VERSION],
265
- mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },
266
248
  rooms,
267
249
  capabilities: declared,
268
250
  providerLimits: providerLimits(document.bounds),
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
2
- export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
2
+ export { PRIVATE_LOCATOR } from './transport.js';
3
+ export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
3
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,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,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,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 +1,2 @@
1
1
  export { createAgentsHouseAdapter } from './adapter.js';
2
+ export { PRIVATE_LOCATOR } from './transport.js';
package/dist/links.d.ts CHANGED
@@ -1,12 +1,20 @@
1
+ import type { HeldRoom, MutationResult, RoomAttachment } from '@agentshouse/mdruntime';
1
2
  import type { HouseScope, HouseView } from './read.js';
2
3
  import type { StreamedAdvancement } from './stream.js';
3
4
  export type RoomLinks = {
4
5
  roomVersion: string;
5
- handed: ReadonlySet<string>;
6
+ handed: ReadonlyMap<string, RoomAttachment>;
6
7
  paths: ReadonlyMap<string, ReadonlySet<string>>;
7
8
  revisions: ReadonlyMap<string, string>;
8
9
  };
9
10
  export declare function scopeLinks(scope: HouseScope): RoomLinks;
11
+ export declare function heldLinks(held: HeldRoom): RoomLinks;
12
+ export declare function acceptedLinks(held: RoomLinks, accepted: Extract<MutationResult, {
13
+ kind: 'accepted';
14
+ }>, roomVersion: string, originals: readonly RoomAttachment[]): {
15
+ links: RoomLinks;
16
+ attachments?: readonly RoomAttachment[];
17
+ };
10
18
  export declare function enumeratedLinks(view: HouseView, earlier: RoomLinks | undefined): RoomLinks;
11
19
  export declare function streamedLinks(held: RoomLinks, advanced: StreamedAdvancement): RoomLinks | null;
12
20
  //# sourceMappingURL=links.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAOvD,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAYF,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAWvD;AAOD,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAgB1F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI,CAoB9F"}
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB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