@agentshouse/mdruntime-adapter 0.1.0-cd028205a5103 → 0.1.0-cea44707d3919
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 +10 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +4 -1
- package/dist/discovery.d.ts +2 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +12 -1
- package/package.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -10,7 +10,7 @@ App code reaches the MD Runtime through the remote client. The surfaces are
|
|
|
10
10
|
Rooms, Query, Search, Observe, Types, Room Draft, Save, History, Call, Reached, Log,
|
|
11
11
|
the reported persistence answer, reauthorization, conversation, the chat draft,
|
|
12
12
|
and Presentation State. Sync Status, the Service Mode, the storage-loss
|
|
13
|
-
statement
|
|
13
|
+
statement, the deployment facts and the signed-in member are observations only.
|
|
14
14
|
|
|
15
15
|
The host attaches each port with its reach, and every member and observation
|
|
16
16
|
answers within it: a Room outside it answers as one the replica does not hold,
|
|
@@ -69,6 +69,15 @@ composes, or exposes the browser store.
|
|
|
69
69
|
Read the deployment facts with `observe('deployment-facts')`. Interpret the
|
|
70
70
|
opaque value using the host's contract.
|
|
71
71
|
|
|
72
|
+
`observe('member')` answers who uses the App: the User the Provider signed in,
|
|
73
|
+
`{ kind: 'user', id, name }` in the shape of a change's `author`, so a Document
|
|
74
|
+
whose `change.author.id` equals its `id` is that User's own. It is `null` until
|
|
75
|
+
the Provider first names one, and where it names none, such as a Site. The
|
|
76
|
+
MD Runtime keeps it with the Local Replicas, so it answers offline once known,
|
|
77
|
+
and every port hears the next member the Provider names; signing out answers
|
|
78
|
+
`null`, then ends the observation with the authorization. It is the only way App code learns who
|
|
79
|
+
uses it.
|
|
80
|
+
|
|
72
81
|
The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
|
|
73
82
|
ships in no bundle.
|
|
74
83
|
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,EAOL,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,
|
|
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,EAOL,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
|
@@ -252,7 +252,10 @@ export function createAgentsHouseAdapter(options) {
|
|
|
252
252
|
if (!tracked.has(locator))
|
|
253
253
|
handed.delete(locator);
|
|
254
254
|
notifications.track(entries);
|
|
255
|
-
return
|
|
255
|
+
return {
|
|
256
|
+
...mapDiscovery(document, document.authorities.map((authority) => discoveredRoom(authority)), capabilities(document)),
|
|
257
|
+
member: document.member,
|
|
258
|
+
};
|
|
256
259
|
},
|
|
257
260
|
async bootstrap(_authorization, request) {
|
|
258
261
|
const entry = authorityFor(request.locator);
|
package/dist/discovery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Capability, DiscoveredRoom, Discovery, ProviderLimit, Retention } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { Capability, DiscoveredRoom, Discovery, Member, ProviderLimit, Retention } from '@agentshouse/mdruntime';
|
|
2
2
|
import { type LogPosition } from './version.js';
|
|
3
3
|
export declare const PROVIDER_ACTIONS = "provider-actions";
|
|
4
4
|
export declare const DISCOVER_PREFIXES: readonly string[];
|
|
@@ -37,6 +37,7 @@ export type HouseAuthority = LogPosition & {
|
|
|
37
37
|
operations: HouseOperations;
|
|
38
38
|
};
|
|
39
39
|
export type HouseDiscoveryDocument = {
|
|
40
|
+
member: Member;
|
|
40
41
|
bounds: HouseBounds;
|
|
41
42
|
authorities: readonly HouseAuthority[];
|
|
42
43
|
actions: readonly string[];
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -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;AAEhC,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAU,CAAC;AAE1D,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;IAC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CAAC,IAAI,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAsB3E;AAmBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAa3E;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,kBAAkB,GAAG,gBAAgB,EAAE,CAW5E;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,QAAQ,EAAE,sBAAsB,GAAG,SAAS,UAAU,EAAE,CAWpF;AAED,wBAAgB,gBAAgB,IAAI,SAAS,UAAU,EAAE,CAIxD;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAmBxE;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
|
@@ -46,6 +46,14 @@ function parseHouseModel(value) {
|
|
|
46
46
|
return undefined;
|
|
47
47
|
return { root: held.root, paths };
|
|
48
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
|
+
}
|
|
49
57
|
function parseOperations(value) {
|
|
50
58
|
if (typeof value !== 'object' || value === null)
|
|
51
59
|
return null;
|
|
@@ -98,6 +106,9 @@ export function parseDiscovery(body) {
|
|
|
98
106
|
if (typeof body !== 'object' || body === null)
|
|
99
107
|
return null;
|
|
100
108
|
const held = body;
|
|
109
|
+
const member = parseMember(held.member);
|
|
110
|
+
if (member === null)
|
|
111
|
+
return null;
|
|
101
112
|
const bounds = parseBounds(held.bounds);
|
|
102
113
|
if (bounds === null)
|
|
103
114
|
return null;
|
|
@@ -115,7 +126,7 @@ export function parseDiscovery(body) {
|
|
|
115
126
|
return null;
|
|
116
127
|
authorities.push(authority);
|
|
117
128
|
}
|
|
118
|
-
return { bounds, authorities, actions };
|
|
129
|
+
return { member, bounds, authorities, actions };
|
|
119
130
|
}
|
|
120
131
|
function parseSiteAuthority(value) {
|
|
121
132
|
if (typeof value !== 'object' || value === null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/mdruntime-adapter",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-cea44707d3919",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentshouse/mdmodel": "0.1.0-
|
|
29
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
28
|
+
"@agentshouse/mdmodel": "0.1.0-c0d316445d94f",
|
|
29
|
+
"@agentshouse/mdruntime": "0.1.0-c7f1d9323e816"
|
|
30
30
|
}
|
|
31
31
|
}
|