@agentshouse/mdruntime-adapter 0.1.0-c258826147319 → 0.1.0-c271876d9f81d
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 +39 -18
- package/dist/actions.d.ts +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +3 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +10 -9
- package/dist/discovery.d.ts +3 -4
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +21 -12
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +15 -5
- package/dist/read.d.ts +1 -0
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +4 -2
- package/dist/refusal.d.ts +1 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +26 -12
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +5 -4
- package/dist/stream.d.ts +1 -0
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +5 -0
- package/dist/transport.d.ts +1 -1
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +0 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +10 -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,
|
|
@@ -57,7 +57,10 @@ effect the Provider places in a Room carries `at`, that Room and Room Version;
|
|
|
57
57
|
reached it, and the MD Runtime keeps refreshing that Room until it has;
|
|
58
58
|
`reached(room, roomVersion, path)` answers whether the held confirmed copy of
|
|
59
59
|
that document was written at a later Room Version. Each History revision
|
|
60
|
-
names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`.
|
|
60
|
+
names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`.
|
|
61
|
+
History of a Path no current document holds answers the removed document's
|
|
62
|
+
revisions with `deleted: true`, newest first; that revision is what a link to
|
|
63
|
+
the Path opens. Every
|
|
61
64
|
member of the
|
|
62
65
|
client is asynchronous. Results are detached snapshots. Nothing in this
|
|
63
66
|
surface returns the authorization, performs a request the App's code
|
|
@@ -66,6 +69,15 @@ composes, or exposes the browser store.
|
|
|
66
69
|
Read the deployment facts with `observe('deployment-facts')`. Interpret the
|
|
67
70
|
opaque value using the host's contract.
|
|
68
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
|
+
|
|
69
81
|
The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
|
|
70
82
|
ships in no bundle.
|
|
71
83
|
|
|
@@ -79,22 +91,28 @@ data:
|
|
|
79
91
|
- **Filter.** `rooms` names Room locators and defaults to every Room. `types`
|
|
80
92
|
names MD Types, and `any` names untyped Markdown Documents. `pathPrefix` is a
|
|
81
93
|
directory: `notes` keeps `notes/a.md` and not `notes2/a.md`.
|
|
82
|
-
- **Fields.**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
- **Fields.** Every frontmatter value is named by JSON Pointer: `/status`,
|
|
95
|
+
`/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that
|
|
96
|
+
meets a list applies to every item and a number names one item. `where` names
|
|
97
|
+
pointers, ANDs them, and nests `$and` and `$or`; a pointer through a list holds
|
|
98
|
+
when any item satisfies it. A bare value is equality; the operators are `$eq`,
|
|
99
|
+
`$ne`, `$in`, `$nin`, `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size` and
|
|
100
|
+
`$exists`. Equality on a list asks whether it contains the value. Missing, null and empty differ:
|
|
86
101
|
`$exists: false` keeps a missing field, `null` an explicit null, `''` empty
|
|
87
102
|
text and `$size: 0` an empty list. A date compares in calendar order and never
|
|
88
103
|
with a date-time. A reference compares by the Room Path it resolves to.
|
|
89
|
-
Untyped frontmatter
|
|
104
|
+
Untyped frontmatter, and a value under `oneOf` or a conditional, is plain
|
|
105
|
+
values. There is no text containment or regular
|
|
90
106
|
expression.
|
|
91
107
|
- **Relations.** `hop: { field, types, where, pathPrefix }` keeps Documents whose
|
|
92
|
-
reference `field
|
|
93
|
-
`backlinks: { field, types, where, pathPrefix }` keeps Documents that a
|
|
108
|
+
reference at pointer `field`, at any depth, points to a matching Document of the
|
|
109
|
+
same Room. `backlinks: { field, types, where, pathPrefix }` keeps Documents that a
|
|
94
110
|
matching Document of the same Room references. Each keeps a Document once.
|
|
95
111
|
- **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
|
|
96
|
-
`preamble`, `markdown`, `backlinks` and `change`, where `fields`
|
|
97
|
-
|
|
112
|
+
`preamble`, `markdown`, `backlinks` and `change`, where `fields` is `'all'` or a
|
|
113
|
+
list of pointers and `sections` `'all'` or a list of names. Selected pointers
|
|
114
|
+
return the frontmatter holding only them, nested as written. A backlink names
|
|
115
|
+
the referring Path, MD Type and the pointer it came from as `field`. Room and Path always return; a Markdown
|
|
98
116
|
Document also returns its MD Type. A non-Markdown Document or binary link
|
|
99
117
|
target returns only Room and Path. An unselected part is absent. Select only
|
|
100
118
|
what a screen shows: a list that selects the Markdown hears every edit of it.
|
|
@@ -103,13 +121,13 @@ data:
|
|
|
103
121
|
or `null` for a write the Provider made itself, and `time` is the Provider's
|
|
104
122
|
ISO 8601 change time. It is `null` where the Provider delivered no time, as at
|
|
105
123
|
a Site. An unsent edit or move keeps it, an unsent creation has none, and a
|
|
106
|
-
saved write takes the Provider's own once it is Accepted
|
|
124
|
+
saved write takes the Provider's own once it is Accepted. A
|
|
107
125
|
Room's last change is its Document with the latest `time`.
|
|
108
126
|
- **Order and groups.** `orderBy` sorts by `room`, `path`, `type` or `{ field }`
|
|
109
127
|
with TanStack DB's own options, and ties end with Room, then Path. `groupBy` by
|
|
110
128
|
`room`, `type` or `{ field }` answers `{ groups: [{ key, count }] }`, counted
|
|
111
|
-
over every match and ordered by `count` or a key.
|
|
112
|
-
or the groups.
|
|
129
|
+
over every match and ordered by `count` or a key. A sort or group takes only a
|
|
130
|
+
pointer that holds one value. `limit` bounds the Documents or the groups.
|
|
113
131
|
- **Results and errors.** A result carries no Room Version: read freshness from
|
|
114
132
|
Rooms and Sync Status. An invalid query fails with `invalid-query`,
|
|
115
133
|
`unknown-type`, `unknown-field` or `wrong-kind`, naming where, and never
|
|
@@ -218,13 +236,16 @@ served App does not.
|
|
|
218
236
|
|
|
219
237
|
A React App may observe and save through `@agentshouse/mdruntime/react`, which
|
|
220
238
|
names React as a peer dependency. `useObserve(client, topic, ...input)` takes
|
|
221
|
-
the arguments of `observe` and returns the topic's
|
|
222
|
-
|
|
223
|
-
nothing. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
|
|
239
|
+
the arguments of `observe` and returns `{ state: 'loading' }` until the topic's
|
|
240
|
+
first value arrives, then `{ state: 'ready', value }`, re-rendering on each
|
|
241
|
+
change; a `null` client observes nothing and stays loading. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
|
|
224
242
|
`save(room, roomDrafts)`, which writes each Path's parts onto the Room Draft
|
|
225
243
|
already there, keeping the bases its parts have, or onto a new one, and saves
|
|
226
244
|
them together. A refused Save leaves the Room Drafts for the App to save again
|
|
227
|
-
or discard; a failure is recorded and rejects.
|
|
245
|
+
or discard; a failure is recorded and rejects. `saveRoomDrafts(client, room,
|
|
246
|
+
roomDrafts)` is that save outside a component. A react-admin or Refine App
|
|
247
|
+
reads and writes its Rooms through the data providers of
|
|
248
|
+
`@agentshouse/mdruntime-families`.
|
|
228
249
|
|
|
229
250
|
## What an agent must never do
|
|
230
251
|
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
|
3
|
+
export declare function houseConversationAgents(locator: string): 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;
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -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,kBAAkB,EAGxB,MAAM,wBAAwB,CAAC;
|
|
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;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAkBtE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAE3E;AAED,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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { changeBatchIdentity, } from '@agentshouse/mdruntime';
|
|
2
2
|
import { doorRefusal } from './refusal.js';
|
|
3
|
-
import { PRIVATE_LOCATOR } from './transport.js';
|
|
4
3
|
const HISTORY_PAGE = 100;
|
|
5
4
|
const HISTORY_CONVERSATIONS = 64;
|
|
6
5
|
const OCTET_STREAM = 'application/octet-stream';
|
|
@@ -13,12 +12,9 @@ const CONVERSATION_ROUTES = new Map([
|
|
|
13
12
|
['conversation.delete', '/door/conversations/delete'],
|
|
14
13
|
['conversation.history', '/door/conversations/history'],
|
|
15
14
|
]);
|
|
16
|
-
export
|
|
17
|
-
locator:
|
|
18
|
-
|
|
19
|
-
identity: 'agent',
|
|
20
|
-
name: 'name',
|
|
21
|
-
};
|
|
15
|
+
export function houseConversationAgents(locator) {
|
|
16
|
+
return { locator, type: 'house-agent', identity: 'agent', name: 'name' };
|
|
17
|
+
}
|
|
22
18
|
export function declaredActions(routes) {
|
|
23
19
|
const mapped = new Map([...CONVERSATION_ROUTES].map(([name, route]) => [route.slice('/door/'.length), name]));
|
|
24
20
|
return routes.map((route) => ({
|
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,
|
|
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
|
@@ -7,7 +7,7 @@ import { acceptedLinks, enumeratedLinks, heldLinks, scopeLinks, streamedLinks, }
|
|
|
7
7
|
import { houseAction } from './actions.js';
|
|
8
8
|
import { classifyDoor, classifyRead, discoveryFailure, doorRefusal } from './refusal.js';
|
|
9
9
|
import { houseNotifications } from './stream.js';
|
|
10
|
-
import { DOOR_BATCH, DOOR_BATCH_UPLOAD, DOOR_BOOTSTRAP, DOOR_DISCOVER, DOOR_ENUMERATE, DOOR_REVISIONS,
|
|
10
|
+
import { DOOR_BATCH, DOOR_BATCH_UPLOAD, DOOR_BOOTSTRAP, DOOR_DISCOVER, DOOR_ENUMERATE, DOOR_REVISIONS, } from './transport.js';
|
|
11
11
|
import { batchPaths, deltaBody, deltaBytes, deltaDigest, historyOutcome, houseChanges, mutationOutcome, operationHead, rejectedMapping, revisionBody, uploadable, } from './write.js';
|
|
12
12
|
import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
|
|
13
13
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
@@ -104,9 +104,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
104
104
|
const { authority, position, log_epoch: logEpoch } = body;
|
|
105
105
|
if (typeof position !== 'string' || typeof logEpoch !== 'string')
|
|
106
106
|
return result;
|
|
107
|
-
const locator = authority ===
|
|
108
|
-
? PRIVATE_LOCATOR
|
|
109
|
-
: [...tracked.values()].find((entry) => entry.authority === authority)?.locator;
|
|
107
|
+
const locator = [...tracked.values()].find((entry) => entry.authority === authority)?.locator;
|
|
110
108
|
if (locator === undefined)
|
|
111
109
|
return result;
|
|
112
110
|
return { ...result, at: { locator, roomVersion: roomVersion({ position, logEpoch }) } };
|
|
@@ -239,9 +237,9 @@ export function createAgentsHouseAdapter(options) {
|
|
|
239
237
|
},
|
|
240
238
|
async discover(_authorization) {
|
|
241
239
|
const answer = await transport.door(DOOR_DISCOVER, { prefixes: [...DISCOVER_PREFIXES] });
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
return
|
|
240
|
+
const failed = discoveryFailure(answer.status, answer.body);
|
|
241
|
+
if (failed !== null)
|
|
242
|
+
return failed;
|
|
245
243
|
const document = parseDiscovery(answer.body);
|
|
246
244
|
if (document === null)
|
|
247
245
|
return { kind: 'transport-uncertainty' };
|
|
@@ -254,7 +252,10 @@ export function createAgentsHouseAdapter(options) {
|
|
|
254
252
|
if (!tracked.has(locator))
|
|
255
253
|
handed.delete(locator);
|
|
256
254
|
notifications.track(entries);
|
|
257
|
-
return
|
|
255
|
+
return {
|
|
256
|
+
...mapDiscovery(document, document.authorities.map((authority) => discoveredRoom(authority)), capabilities(document)),
|
|
257
|
+
member: document.member,
|
|
258
|
+
};
|
|
258
259
|
},
|
|
259
260
|
async bootstrap(_authorization, request) {
|
|
260
261
|
const entry = authorityFor(request.locator);
|
|
@@ -318,7 +319,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
318
319
|
async action(_authorization, request) {
|
|
319
320
|
return withAt(await houseAction(transport, request));
|
|
320
321
|
},
|
|
321
|
-
roomStream: { hold: held, observe: notifications.observe },
|
|
322
|
+
roomStream: { hold: held, reopen: notifications.reopen, observe: notifications.observe },
|
|
322
323
|
conversations: notifications.conversations,
|
|
323
324
|
serviceMode: notifications.serviceMode,
|
|
324
325
|
};
|
package/dist/discovery.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
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[];
|
|
5
|
-
export declare const PRIVATE_HANDLE = "private";
|
|
6
5
|
export type HouseBounds = {
|
|
7
6
|
max_authored_file_bytes: number;
|
|
8
7
|
max_batch_operations: number;
|
|
@@ -38,6 +37,7 @@ export type HouseAuthority = LogPosition & {
|
|
|
38
37
|
operations: HouseOperations;
|
|
39
38
|
};
|
|
40
39
|
export type HouseDiscoveryDocument = {
|
|
40
|
+
member: Member;
|
|
41
41
|
bounds: HouseBounds;
|
|
42
42
|
authorities: readonly HouseAuthority[];
|
|
43
43
|
actions: readonly string[];
|
|
@@ -62,11 +62,10 @@ export type HouseSiteDiscovery = {
|
|
|
62
62
|
export declare function parseDiscovery(body: unknown): HouseDiscoveryDocument | null;
|
|
63
63
|
export declare function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null;
|
|
64
64
|
export declare function siteTracked(document: HouseSiteDiscovery): TrackedAuthority[];
|
|
65
|
-
export declare function locatorOf(authority: HouseAuthority): string;
|
|
66
65
|
export declare function trackedFrom(document: HouseDiscoveryDocument): TrackedAuthority[];
|
|
67
66
|
export declare function providerLimits(bounds: HouseBounds): readonly ProviderLimit[];
|
|
68
67
|
export declare function declaredRetention(bounds: HouseBounds): Retention;
|
|
69
|
-
export declare function capabilities(
|
|
68
|
+
export declare function capabilities(document: HouseDiscoveryDocument): readonly Capability[];
|
|
70
69
|
export declare function siteCapabilities(): readonly Capability[];
|
|
71
70
|
export declare function discoveredRoom(authority: HouseAuthority): DiscoveredRoom;
|
|
72
71
|
export declare function mapDiscovery(document: Pick<HouseDiscoveryDocument, 'bounds'>, rooms: readonly DiscoveredRoom[], declared: readonly Capability[]): Discovery;
|
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;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,MAAM,EACN,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;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAA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AAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC5C,CAAC;AA8FF,wBAAgB,cAAc,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
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { declaredActions,
|
|
2
|
-
import { PRIVATE_LOCATOR } from './transport.js';
|
|
1
|
+
import { declaredActions, houseConversationAgents } from './actions.js';
|
|
3
2
|
import { readPosition, roomVersion } from './version.js';
|
|
4
3
|
export const PROVIDER_ACTIONS = 'provider-actions';
|
|
5
4
|
export const DISCOVER_PREFIXES = ['/'];
|
|
6
|
-
export const PRIVATE_HANDLE = 'private';
|
|
7
5
|
const BOUND_KEYS = [
|
|
8
6
|
'max_authored_file_bytes',
|
|
9
7
|
'max_batch_operations',
|
|
@@ -48,6 +46,14 @@ function parseHouseModel(value) {
|
|
|
48
46
|
return undefined;
|
|
49
47
|
return { root: held.root, paths };
|
|
50
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
|
+
}
|
|
51
57
|
function parseOperations(value) {
|
|
52
58
|
if (typeof value !== 'object' || value === null)
|
|
53
59
|
return null;
|
|
@@ -100,6 +106,9 @@ export function parseDiscovery(body) {
|
|
|
100
106
|
if (typeof body !== 'object' || body === null)
|
|
101
107
|
return null;
|
|
102
108
|
const held = body;
|
|
109
|
+
const member = parseMember(held.member);
|
|
110
|
+
if (member === null)
|
|
111
|
+
return null;
|
|
103
112
|
const bounds = parseBounds(held.bounds);
|
|
104
113
|
if (bounds === null)
|
|
105
114
|
return null;
|
|
@@ -117,7 +126,7 @@ export function parseDiscovery(body) {
|
|
|
117
126
|
return null;
|
|
118
127
|
authorities.push(authority);
|
|
119
128
|
}
|
|
120
|
-
return { bounds, authorities, actions };
|
|
129
|
+
return { member, bounds, authorities, actions };
|
|
121
130
|
}
|
|
122
131
|
function parseSiteAuthority(value) {
|
|
123
132
|
if (typeof value !== 'object' || value === null)
|
|
@@ -171,9 +180,6 @@ export function siteTracked(document) {
|
|
|
171
180
|
logEpoch: authority.logEpoch,
|
|
172
181
|
}));
|
|
173
182
|
}
|
|
174
|
-
export function locatorOf(authority) {
|
|
175
|
-
return authority.roomHandle === PRIVATE_HANDLE ? PRIVATE_LOCATOR : authority.roomRef;
|
|
176
|
-
}
|
|
177
183
|
function schemasOf(authority) {
|
|
178
184
|
return authority.houseModel === null
|
|
179
185
|
? [authority.schema]
|
|
@@ -181,7 +187,7 @@ function schemasOf(authority) {
|
|
|
181
187
|
}
|
|
182
188
|
export function trackedFrom(document) {
|
|
183
189
|
return document.authorities.map((authority) => ({
|
|
184
|
-
locator:
|
|
190
|
+
locator: authority.roomRef,
|
|
185
191
|
authority: authority.roomRef,
|
|
186
192
|
handle: authority.roomHandle,
|
|
187
193
|
schema: authority.schema,
|
|
@@ -209,12 +215,15 @@ export function declaredRetention(bounds) {
|
|
|
209
215
|
refreshHorizon: bounds.change_retention_seconds,
|
|
210
216
|
};
|
|
211
217
|
}
|
|
212
|
-
export function capabilities(
|
|
218
|
+
export function capabilities(document) {
|
|
219
|
+
const house = document.authorities.find((authority) => authority.houseModel !== null);
|
|
213
220
|
return [
|
|
214
221
|
{
|
|
215
222
|
name: PROVIDER_ACTIONS,
|
|
216
|
-
actions: declaredActions(actions),
|
|
217
|
-
|
|
223
|
+
actions: declaredActions(document.actions),
|
|
224
|
+
...(house === undefined
|
|
225
|
+
? {}
|
|
226
|
+
: { conversationAgents: houseConversationAgents(house.roomRef) }),
|
|
218
227
|
},
|
|
219
228
|
];
|
|
220
229
|
}
|
|
@@ -224,7 +233,7 @@ export function siteCapabilities() {
|
|
|
224
233
|
];
|
|
225
234
|
}
|
|
226
235
|
export function discoveredRoom(authority) {
|
|
227
|
-
const locator =
|
|
236
|
+
const locator = authority.roomRef;
|
|
228
237
|
return {
|
|
229
238
|
name: authority.name,
|
|
230
239
|
locator,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
|
-
export { PRIVATE_LOCATOR } from './transport.js';
|
|
3
2
|
export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,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,12 +1,15 @@
|
|
|
1
1
|
import { sha256Hex } from './digest.js';
|
|
2
2
|
import { schemaOf, schemaPath } from './read.js';
|
|
3
3
|
const MODEL_ABSENT = { kind: 'model-unavailable', reason: 'not-readable' };
|
|
4
|
-
const ABSENT_SCHEMA = { schema: null, version: null };
|
|
4
|
+
const ABSENT_SCHEMA = { schema: null, version: null, revision: null };
|
|
5
5
|
async function heldModel(read, identity) {
|
|
6
6
|
if (read === null)
|
|
7
7
|
return MODEL_ABSENT;
|
|
8
8
|
const version = await sha256Hex(JSON.stringify(read.version));
|
|
9
|
-
return {
|
|
9
|
+
return {
|
|
10
|
+
kind: 'model',
|
|
11
|
+
snapshot: { identity, version, schema: read.schema, revision: read.revision },
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
14
|
async function modelsOf(tracked, read) {
|
|
12
15
|
const models = {};
|
|
@@ -33,8 +36,13 @@ export function viewModels(view, tracked) {
|
|
|
33
36
|
return undefined;
|
|
34
37
|
if ('removed' in change)
|
|
35
38
|
return ABSENT_SCHEMA;
|
|
36
|
-
if ('content' in change)
|
|
37
|
-
return {
|
|
39
|
+
if ('content' in change) {
|
|
40
|
+
return {
|
|
41
|
+
schema: change.content,
|
|
42
|
+
version: change.version,
|
|
43
|
+
revision: change.revision ?? null,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
38
46
|
return null;
|
|
39
47
|
});
|
|
40
48
|
}
|
|
@@ -48,6 +56,8 @@ export function streamedModels(schemas, tracked, mode) {
|
|
|
48
56
|
if (entry.text === undefined)
|
|
49
57
|
return null;
|
|
50
58
|
const version = mode === 'site' ? entry.sha256 : entry.revision;
|
|
51
|
-
return version === undefined
|
|
59
|
+
return version === undefined
|
|
60
|
+
? null
|
|
61
|
+
: { schema: entry.text, version, revision: mode === 'site' ? null : version };
|
|
52
62
|
});
|
|
53
63
|
}
|
package/dist/read.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export declare function bootstrapOf(scope: HouseScope): BootstrapPage;
|
|
|
71
71
|
export type HouseSchema = {
|
|
72
72
|
schema: string | null;
|
|
73
73
|
version: string | null;
|
|
74
|
+
revision: string | null;
|
|
74
75
|
};
|
|
75
76
|
export declare function schemaOf(scope: HouseScope, schema: string): HouseSchema | null;
|
|
76
77
|
export declare function viewOf(enumeration: HouseEnumeration, tracked: TrackedAuthority): HouseView | undefined;
|
package/dist/read.d.ts.map
CHANGED
|
@@ -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,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,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,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|
const file = scope.files.find((entry) => entry.path === schema);
|
|
290
290
|
if (file === undefined)
|
|
291
|
-
return { schema: null, version: null };
|
|
291
|
+
return { schema: null, version: null, revision: null };
|
|
292
292
|
const content = scope.contents.find((entry) => entry.path === schema);
|
|
293
|
-
return content === undefined
|
|
293
|
+
return content === undefined
|
|
294
|
+
? null
|
|
295
|
+
: { schema: content.content, version: file.version, revision: file.revision ?? null };
|
|
294
296
|
}
|
|
295
297
|
export function viewOf(enumeration, tracked) {
|
|
296
298
|
return enumeration.authorities.find((entry) => entry.authority === tracked.authority);
|
package/dist/refusal.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export declare function classifyDoor(status: number, body: unknown, locator: str
|
|
|
8
8
|
export declare function classifyRead(status: number, body: unknown, locator: string): AdapterFailure | {
|
|
9
9
|
kind: 'beyond-horizon';
|
|
10
10
|
} | null;
|
|
11
|
-
export declare function discoveryFailure(
|
|
11
|
+
export declare function discoveryFailure(status: number, body: unknown): DiscoverResult | null;
|
|
12
12
|
//# sourceMappingURL=refusal.d.ts.map
|
package/dist/refusal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../src/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAO7D;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,WAAW,GACnB,aAAa,CAEf;
|
|
1
|
+
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../src/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAO7D;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,WAAW,GACnB,aAAa,CAEf;AAmBD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,cAAc,GAAG,IAAI,CAMvB;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,cAAc,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAAG,IAAI,CAGpD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAYrF"}
|
package/dist/refusal.js
CHANGED
|
@@ -12,7 +12,7 @@ export function doorRefusal(body) {
|
|
|
12
12
|
export function scopedRefusal(locator, scope, refusal) {
|
|
13
13
|
return { kind: 'scoped-refusal', locator, scope, code: refusal.code, fields: refusal.fields };
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
function doorFailure(status, body) {
|
|
16
16
|
if (status === 0)
|
|
17
17
|
return { kind: 'transport-uncertainty' };
|
|
18
18
|
const refusal = doorRefusal(body);
|
|
@@ -20,27 +20,41 @@ export function classifyDoor(status, body, locator) {
|
|
|
20
20
|
return { kind: 'revoked-authorization' };
|
|
21
21
|
if (refusal?.retryable === true)
|
|
22
22
|
return { kind: 'transport-uncertainty' };
|
|
23
|
-
if (status === 404 || refusal?.code === 'room_not_found')
|
|
24
|
-
return { kind: 'room-not-readable'
|
|
25
|
-
}
|
|
23
|
+
if (status === 404 || refusal?.code === 'room_not_found')
|
|
24
|
+
return { kind: 'room-not-readable' };
|
|
26
25
|
if (status < 400)
|
|
27
26
|
return null;
|
|
28
27
|
if (refusal === null)
|
|
29
28
|
return { kind: 'transport-uncertainty' };
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
return { kind: 'refused', scope: status === 403 ? 'operation' : 'undisclosed', refusal };
|
|
30
|
+
}
|
|
31
|
+
export function classifyDoor(status, body, locator) {
|
|
32
|
+
const failure = doorFailure(status, body);
|
|
33
|
+
if (failure === null)
|
|
34
|
+
return null;
|
|
35
|
+
if (failure.kind === 'room-not-readable')
|
|
36
|
+
return { kind: 'room-not-readable', locator };
|
|
37
|
+
if (failure.kind === 'refused')
|
|
38
|
+
return scopedRefusal(locator, failure.scope, failure.refusal);
|
|
39
|
+
return failure;
|
|
33
40
|
}
|
|
34
41
|
export function classifyRead(status, body, locator) {
|
|
35
42
|
if (doorRefusal(body)?.code === 'expired')
|
|
36
43
|
return { kind: 'beyond-horizon' };
|
|
37
44
|
return classifyDoor(status, body, locator);
|
|
38
45
|
}
|
|
39
|
-
export function discoveryFailure(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
export function discoveryFailure(status, body) {
|
|
47
|
+
const failure = doorFailure(status, body);
|
|
48
|
+
if (failure === null)
|
|
49
|
+
return null;
|
|
50
|
+
if (failure.kind === 'revoked-authorization')
|
|
51
|
+
return failure;
|
|
52
|
+
if (failure.kind === 'refused') {
|
|
53
|
+
return {
|
|
54
|
+
kind: 'contract-unavailable',
|
|
55
|
+
code: failure.refusal.code,
|
|
56
|
+
fields: failure.refusal.fields,
|
|
57
|
+
};
|
|
44
58
|
}
|
|
45
59
|
return { kind: 'transport-uncertainty' };
|
|
46
60
|
}
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,wBAAwB,CAAC;AAsBhC,OAAO,
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,wBAAwB,CAAC;AAsBhC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAgCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,GAAG,OAAO,CAkIxE"}
|
package/dist/site.js
CHANGED
|
@@ -4,7 +4,7 @@ import { scopeModels, streamedModels, viewModels } from './model.js';
|
|
|
4
4
|
import { advancedScope, bootstrapOf, parseEnumeration, parseSiteBootstrap, refreshFrom, viewOf, } from './read.js';
|
|
5
5
|
import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
|
|
6
6
|
import { houseNotifications } from './stream.js';
|
|
7
|
-
import {
|
|
7
|
+
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, } from './transport.js';
|
|
8
8
|
import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
|
|
9
9
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
10
10
|
function siteRoom(tracked) {
|
|
@@ -79,9 +79,9 @@ export function createSiteAdapter(transport) {
|
|
|
79
79
|
},
|
|
80
80
|
async discover() {
|
|
81
81
|
const answer = await transport.read(SITE_DOOR_DISCOVER);
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
82
|
+
const failed = discoveryFailure(answer.status, answer.body);
|
|
83
|
+
if (failed !== null)
|
|
84
|
+
return failed;
|
|
85
85
|
const document = parseSiteDiscovery(answer.body);
|
|
86
86
|
if (document === null)
|
|
87
87
|
return UNCERTAIN;
|
|
@@ -144,6 +144,7 @@ export function createSiteAdapter(transport) {
|
|
|
144
144
|
return [presented(entry.authority, at)];
|
|
145
145
|
}));
|
|
146
146
|
},
|
|
147
|
+
reopen: notifications.reopen,
|
|
147
148
|
observe: notifications.observe,
|
|
148
149
|
},
|
|
149
150
|
serviceMode: notifications.serviceMode,
|
package/dist/stream.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type HouseNotifications = {
|
|
|
12
12
|
runtime: string;
|
|
13
13
|
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
14
14
|
send(rooms: readonly HouseHeldRoom[]): void;
|
|
15
|
+
reopen(): void;
|
|
15
16
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
16
17
|
reach(authority: string, at: LogPosition): void;
|
|
17
18
|
advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): StreamedAdvancement | null;
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAElB,WAAW,EACX,eAAe,EAEf,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAEb,SAAS,EAET,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAgB7D,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB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,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IAC5C,MAAM,IAAI,IAAI,CAAC;IACf,KAAK,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,OAAO,CACL,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,WAAW,EACjB,KAAK,CAAC,EAAE,YAAY,GACnB,mBAAmB,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,kBAAkB,CAAC;IAClC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAuBF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,kBAAkB,CAyS5F"}
|
package/dist/stream.js
CHANGED
|
@@ -222,6 +222,11 @@ export function houseNotifications(transport, mode) {
|
|
|
222
222
|
opening = null;
|
|
223
223
|
current?.hold(rooms, runtime);
|
|
224
224
|
},
|
|
225
|
+
reopen() {
|
|
226
|
+
const current = opening;
|
|
227
|
+
opening = null;
|
|
228
|
+
current?.close();
|
|
229
|
+
},
|
|
225
230
|
track(entries) {
|
|
226
231
|
locators.clear();
|
|
227
232
|
for (const entry of entries) {
|
package/dist/transport.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export declare const SITE_DOOR_DISCOVER = "/_house/door/discover";
|
|
|
9
9
|
export declare const SITE_DOOR_BOOTSTRAP = "/_house/door/bootstrap/";
|
|
10
10
|
export declare const SITE_DOOR_ENUMERATE = "/_house/door/enumerate";
|
|
11
11
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
12
|
-
export declare const PRIVATE_LOCATOR = "private";
|
|
13
12
|
export type HouseMode = 'credential' | 'site';
|
|
14
13
|
export type HouseDoorAnswer = {
|
|
15
14
|
status: number;
|
|
@@ -106,6 +105,7 @@ export type HouseHeldRoom = {
|
|
|
106
105
|
};
|
|
107
106
|
export type HouseOpening = {
|
|
108
107
|
hold(rooms: readonly HouseHeldRoom[], runtime: string): void;
|
|
108
|
+
close(): void;
|
|
109
109
|
};
|
|
110
110
|
export type HouseStream = {
|
|
111
111
|
observe(receive: (frame: HouseStreamFrame) => void): () => void;
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E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YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5D,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7D,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,MAAM,IAAI,OAAO,CAAC;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC/C,CAAC"}
|
package/dist/transport.js
CHANGED
|
@@ -8,4 +8,3 @@ export const SITE_DOOR_DISCOVER = '/_house/door/discover';
|
|
|
8
8
|
export const SITE_DOOR_BOOTSTRAP = '/_house/door/bootstrap/';
|
|
9
9
|
export const SITE_DOOR_ENUMERATE = '/_house/door/enumerate';
|
|
10
10
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
11
|
-
export const PRIVATE_LOCATOR = 'private';
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EAEX,aAAa,EAEb,cAAc,EAEd,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,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D,MAAM,MAAM,gBAAgB,GACxB,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GAC7C,CAAC,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GAAG;IAAE,SAAS,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,CAAC,CAAC;AAE/F,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,gBAAgB,CA4DlB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;IAEjF,IAAI,EAAE,UAAU;IAChB,QAAQ;IACR,IAAI;IACJ,MAAM;QAAI,IAAI;;EAEjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM1B;AAeD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,aAAa,CAgDf"}
|
package/dist/write.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseOriginals } from './read.js';
|
|
1
|
+
import { headChange, parseOriginals } from './read.js';
|
|
2
2
|
import { sha256Hex, textBytes } from './digest.js';
|
|
3
3
|
import { nativePath, roomLocalPath } from './map.js';
|
|
4
4
|
import { classifyDoor, doorRefusal, scopedRefusal } from './refusal.js';
|
|
@@ -138,6 +138,9 @@ function material(value, handle) {
|
|
|
138
138
|
return null;
|
|
139
139
|
if (file.revision !== null && file.revision !== undefined && typeof file.revision !== 'string')
|
|
140
140
|
return null;
|
|
141
|
+
const head = headChange(file);
|
|
142
|
+
if (head === null)
|
|
143
|
+
return null;
|
|
141
144
|
let path;
|
|
142
145
|
try {
|
|
143
146
|
path = roomLocalPath(file.path, handle);
|
|
@@ -149,6 +152,7 @@ function material(value, handle) {
|
|
|
149
152
|
path,
|
|
150
153
|
content: file.content,
|
|
151
154
|
revision: typeof file.revision === 'string' ? file.revision : null,
|
|
155
|
+
...(head === undefined ? {} : { head }),
|
|
152
156
|
});
|
|
153
157
|
}
|
|
154
158
|
return held;
|
|
@@ -205,6 +209,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
205
209
|
return { kind: 'transport-uncertainty' };
|
|
206
210
|
const documents = {};
|
|
207
211
|
const revisions = {};
|
|
212
|
+
const changes = {};
|
|
208
213
|
const removals = [];
|
|
209
214
|
for (const entry of contents) {
|
|
210
215
|
if (entry.content === null || entry.revision === null) {
|
|
@@ -213,12 +218,15 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
213
218
|
}
|
|
214
219
|
documents[entry.path] = entry.content;
|
|
215
220
|
revisions[entry.path] = entry.revision;
|
|
221
|
+
if (entry.head !== undefined)
|
|
222
|
+
changes[entry.path] = entry.head;
|
|
216
223
|
}
|
|
217
224
|
return {
|
|
218
225
|
kind: 'accepted',
|
|
219
226
|
roomVersion: roomVersion(at),
|
|
220
227
|
documents,
|
|
221
228
|
revisions,
|
|
229
|
+
changes,
|
|
222
230
|
removals: removals.sort(),
|
|
223
231
|
originals,
|
|
224
232
|
};
|
|
@@ -300,5 +308,6 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
300
308
|
kind: 'history',
|
|
301
309
|
revisions,
|
|
302
310
|
...(typeof next === 'number' ? { pageToken: String(next) } : {}),
|
|
311
|
+
...(held.deleted === true ? { deleted: true } : {}),
|
|
303
312
|
};
|
|
304
313
|
}
|
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-c271876d9f81d",
|
|
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-c7274d650bd05"
|
|
30
30
|
}
|
|
31
31
|
}
|