@agentshouse/mdruntime-adapter 0.1.0-c26cd225263b7 → 0.1.0-c55b0f26f7582

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
@@ -201,13 +201,25 @@ an App's override respected. What an App Creator's agent adds carries none
201
201
  of these promises by itself. Reading, querying and searching never wait for
202
202
  the network. Data lives only in the App Creator's browser and with the Provider.
203
203
 
204
- ## App code imports only the client entry and never constructs a Runtime
205
-
206
- App code imports only `@agentshouse/mdruntime/client` and calls
207
- `connectMdRuntime` on the port the host hands it. It never constructs a
208
- Runtime. It does not import the package main, the host entry, or the Adapter
209
- package, and it does not call `serveMdRuntime`. Hosts
210
- and tests use those entries; the served App does not.
204
+ ## App code takes the client its host hands it and never constructs a Runtime
205
+
206
+ App code takes the client its host hands it: in House,
207
+ `connectHouseBridge().runtime` from `@agentshouse/app-bridge` resolves to the
208
+ client House built into the page. It never constructs a Runtime or a client.
209
+ It imports only types from `@agentshouse/mdruntime/client`, does not call
210
+ `connectMdRuntime` or `serveMdRuntime`, and does not import the package main,
211
+ the host entry, or the Adapter package. Hosts and tests use those entries; the
212
+ served App does not.
213
+
214
+ A React App may observe and save through `@agentshouse/mdruntime/react`, which
215
+ names React as a peer dependency. `useObserve(client, topic, ...input)` takes
216
+ the arguments of `observe` and returns the topic's current value, `undefined`
217
+ until it arrives, re-rendering on each change; a `null` client observes
218
+ nothing. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
219
+ `save(room, roomDrafts)`, which writes each Path's parts onto the Room Draft
220
+ already there, keeping the bases its parts have, or onto a new one, and saves
221
+ them together. A refused Save leaves the Room Drafts for the App to save again
222
+ or discard; a failure is recorded and rejects.
211
223
 
212
224
  ## What an agent must never do
213
225
 
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
@@ -1,10 +1,6 @@
1
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;
@@ -75,5 +69,5 @@ 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
71
  export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
78
- export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds' | 'mdModelVersion'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
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,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,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,CAAC;IACjC,2BAA2B,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,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C,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
1
  import { declaredActions, HOUSE_CONVERSATION_CARDS } 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,18 +211,15 @@ 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
217
  conversationCards: HOUSE_CONVERSATION_CARDS,
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
  }
@@ -256,8 +245,6 @@ export function discoveredRoom(authority) {
256
245
  export function mapDiscovery(document, rooms, declared) {
257
246
  return {
258
247
  kind: 'discovery',
259
- supportedVersions: [ROOM_CONTRACT_VERSION],
260
- mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },
261
248
  rooms,
262
249
  capabilities: declared,
263
250
  providerLimits: providerLimits(document.bounds),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdruntime-adapter",
3
- "version": "0.1.0-c26cd225263b7",
3
+ "version": "0.1.0-c55b0f26f7582",
4
4
  "description": "Agents House Adapter for the MD Runtime",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,6 +26,6 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@agentshouse/mdmodel": "0.1.0-c6b0c6dc1a195",
29
- "@agentshouse/mdruntime": "0.1.0-ca7c26c6bc27e"
29
+ "@agentshouse/mdruntime": "0.1.0-c1954630fadb6"
30
30
  }
31
31
  }