@agentshouse/mdruntime-adapter 0.1.0-cb5eef5f389d7 → 0.1.0-cb6436097e8a2
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 +258 -268
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +25 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/read.d.ts +3 -0
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +10 -0
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +1 -1
- package/dist/stream.d.ts +2 -2
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +4 -3
- package/dist/transport.d.ts +5 -1
- package/dist/transport.d.ts.map +1 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +2 -1
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -5,305 +5,295 @@ Repository, change it, build, and push. They are documentation, not enforcement.
|
|
|
5
5
|
|
|
6
6
|
## The MD Runtime API
|
|
7
7
|
|
|
8
|
-
App code reaches the MD Runtime through the remote client. The surfaces are
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`observe('
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`{ state: '
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Provider
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
answer
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
the
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
none, such as a Site. The MD Runtime keeps it with the Local Replicas, so it
|
|
93
|
-
answers offline once known, and every port hears the next member the Provider
|
|
94
|
-
names; signing out answers `null`, then ends the observation with the
|
|
95
|
-
authorization. It is the only way App code learns who uses it.
|
|
8
|
+
App code reaches the MD Runtime through the remote client. The surfaces are Rooms,
|
|
9
|
+
Query, Search, Observe, Types, Room Draft, Save, History, the binary file reads, Call,
|
|
10
|
+
Reached, Log, the reported persistence answer, reauthorization, conversation, the chat
|
|
11
|
+
draft, and Presentation State. Sync Status, readiness, the Service Mode, the storage-loss
|
|
12
|
+
statement, the deployment facts and the signed-in member are observations only.
|
|
13
|
+
|
|
14
|
+
The host attaches each port with its reach, and every member and observation answers
|
|
15
|
+
within it: a Room outside it answers as one the replica does not hold, Rooms lists only
|
|
16
|
+
the Rooms reached whole, a Room reached for single Documents shows only those Documents
|
|
17
|
+
and the Types of the models that govern them, and without conversations the conversation
|
|
18
|
+
members, the chat draft and the conversation observation hold none. A change of the
|
|
19
|
+
reach reaches every open observation as its new value.
|
|
20
|
+
|
|
21
|
+
Every `observe` resolves, once its first value has arrived, to a handle: `current()` is
|
|
22
|
+
the latest complete value, `subscribe(listener)` hears each later value whole and returns
|
|
23
|
+
its unsubscribe, and `close()` ends the observation. Closing the port ends every handle
|
|
24
|
+
and rejects every pending call and observation; a client that reconnects observes again.
|
|
25
|
+
|
|
26
|
+
`observe('agents')` answers every Agent a new conversation can go to, each `{ identity,
|
|
27
|
+
name }`, whether or not it has a conversation yet. Each conversation the Provider's
|
|
28
|
+
conversation list names is held complete in the browser. `conversation.list()` and
|
|
29
|
+
`observe('conversations')` answer each with its Agent's identity and name, its name,
|
|
30
|
+
created and finished times, last outcome and live `state`: `asking` while a question
|
|
31
|
+
waits, `working` while a turn runs, else `idle`, and `started`, when the running turn
|
|
32
|
+
began, or `null`. Observe one with `observe('conversation', id, { limit })`: the view
|
|
33
|
+
holds a window of its latest `limit` messages, or all of them, oldest first, its chat
|
|
34
|
+
draft, and what the Provider streams for it whether or not anything views it: the
|
|
35
|
+
running `turn` with its message parts and its context in use and window, the open
|
|
36
|
+
questions, the process state, and the CLI's commands and options. These live only in
|
|
37
|
+
memory: the message accepted under the turn's id replaces the running turn, and none of
|
|
38
|
+
them is stored or searchable. `chatDraft.write` and `chatDraft.discard` keep what the
|
|
39
|
+
App Creator composes; sending it is a Provider Action that needs the Provider reachable
|
|
40
|
+
and is never queued. A new conversation's chat draft is the one keyed `new:<Agent
|
|
41
|
+
identity>`: no conversation list removes it, a retired Agent's goes, and the first answer
|
|
42
|
+
to `conversation.create({ agent_id, operation_id })` moves it to the created conversation,
|
|
43
|
+
where `conversation.send(conversation)` sends it; a replay of that create moves nothing.
|
|
44
|
+
|
|
45
|
+
A binary file at a Path is a binary Path entry. Query lists it by `path`, and History
|
|
46
|
+
each of its revisions, with its `binaryFile` record and never its bytes: `{ state:
|
|
47
|
+
'accepted', revision, path, fileRef, byteLength, mediaType, sha256 }`, or, from a Save
|
|
48
|
+
until the Provider accepts it, `{ state: 'pending', localId, path, byteLength, mediaType,
|
|
49
|
+
sha256 }`. Write one with a Room Draft whose only part is `file: { blob }`, the `Blob`'s
|
|
50
|
+
`type` its media type: Save keeps the bytes in its Pending Change, offline too, and
|
|
51
|
+
acceptance gives the record the Provider's revision. Move or remove one as a Document, a
|
|
52
|
+
pending one before or after Save too, its bytes following; once its Pending Change has
|
|
53
|
+
gone to the Provider, Save refuses that as `unknown-revision` until it is accepted.
|
|
54
|
+
`binaryFile.read(room, path, revision?)` answers a pending record's saved bytes, or asks
|
|
55
|
+
the Provider on every read of an accepted one or a History revision, a removed file's
|
|
56
|
+
last included, keeping nothing. Text, a Record attachment or a conversation message may
|
|
57
|
+
name a file by its `fileRef`; read it with `binaryFile.readReference({ fileRef, referrer
|
|
58
|
+
})`, the `referrer` the Provider gave beside it, or `{ room, path }` of the document
|
|
59
|
+
whose text names it. Both answer `{ kind: 'binary', blob }` or a refusal or failure.
|
|
60
|
+
|
|
61
|
+
Rooms, Query, Search, Observe, Types, Room Draft, Save, and Reached never touch the
|
|
62
|
+
network. History, the binary file reads and Call go to the Provider through the Adapter.
|
|
63
|
+
Call takes the Action names the Adapter declares; any other name answers `undeclared`
|
|
64
|
+
without reaching the Provider. A Call result whose effect the Provider places in a Room
|
|
65
|
+
carries `at`, that Room and Room Version; `reached(room, roomVersion)` answers whether
|
|
66
|
+
the Room's confirmed state has reached it, and the MD Runtime keeps refreshing that Room
|
|
67
|
+
until it has; `reached(room, roomVersion, path)` answers whether the held confirmed copy
|
|
68
|
+
of that document was written at a later Room Version. Each History revision names its
|
|
69
|
+
author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`. History of a Path no
|
|
70
|
+
current document holds answers the removed document's revisions with `deleted: true`,
|
|
71
|
+
newest first; that revision is what a link to the Path opens. Every member of the client
|
|
72
|
+
is asynchronous. Results are detached snapshots. Nothing in this surface returns the
|
|
73
|
+
authorization, performs a request the App's code composes, or exposes the browser store.
|
|
74
|
+
|
|
75
|
+
Every refusal and failure carries `code` and `retryable`: each Call and History answer
|
|
76
|
+
other than its result, a refused Save or Room Draft write, a returned Room Draft's
|
|
77
|
+
reason, a Room's refusal and the Connection Refusal, and every error a member rejects
|
|
78
|
+
with, beside its message. A Provider refusal carries the Provider's own `retryable`.
|
|
79
|
+
Every code and every value the API answers is open: handle one you do not know by its
|
|
80
|
+
`code` and `retryable`. Only a tag telling which fields a value carries, such as an
|
|
81
|
+
answer's `kind`, is closed so it narrows: keep a branch for a tag you do not know. A
|
|
82
|
+
model with no usable types answers `types: null`, whatever its `status`.
|
|
83
|
+
|
|
84
|
+
Read the deployment facts with `observe('deployment-facts')`, an opaque value the host's
|
|
85
|
+
contract interprets. `observe('member')` answers who uses the App: the User the Provider
|
|
86
|
+
signed in, `{ kind: 'user', id, name }` in the shape of a change's `author`, so a
|
|
87
|
+
Document whose `change.author.id` equals its `id` is that User's own. It is `null` until
|
|
88
|
+
the Provider first names one, and where it names none, such as a Site. The MD Runtime
|
|
89
|
+
keeps it with the Local Replicas, so it answers offline once known, and every port hears
|
|
90
|
+
the next member the Provider names; signing out answers `null`, then ends the
|
|
91
|
+
observation with the authorization. It is the only way App code learns who uses it.
|
|
96
92
|
|
|
97
93
|
## Local Query rules
|
|
98
94
|
|
|
99
|
-
`query(q)` answers once from local state; `observe('query', q)` holds the whole
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
directory: `notes` keeps `notes/a.md` and not `notes2/a.md`.
|
|
95
|
+
`query(q)` answers once from local state; `observe('query', q)` holds the whole result
|
|
96
|
+
and hears it again only when it changes, keeping every unchanged Document the same
|
|
97
|
+
object, so a component can tell what changed by identity. An answer is complete or
|
|
98
|
+
pending: `{ documents, coverage }` or `{ groups, coverage }` is complete for the Rooms
|
|
99
|
+
its `coverage` names, and `{ pending }` names each Room not yet acquired or prepared,
|
|
100
|
+
`[{ room, awaits }]`. Never read a pending answer as empty: draw it as loading, and
|
|
101
|
+
observe the query to hear the complete one. A query is data:
|
|
102
|
+
|
|
103
|
+
- **Filter.** `rooms` names Room locators and defaults to every Room. `types` names MD
|
|
104
|
+
Types, and `any` names untyped Markdown Documents. `pathPrefix` is a directory:
|
|
105
|
+
`notes` keeps `notes/a.md` and not `notes2/a.md`.
|
|
111
106
|
- **Fields.** Every frontmatter value is named by JSON Pointer: `/status`,
|
|
112
|
-
`/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
`$
|
|
117
|
-
|
|
118
|
-
null
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Path it resolves to. Untyped frontmatter, and a value under `oneOf` or a
|
|
107
|
+
`/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that meets a
|
|
108
|
+
list applies to every item and a number names one item. `where` names pointers, ANDs
|
|
109
|
+
them, and nests `$and` and `$or`; a pointer through a list holds if any item satisfies
|
|
110
|
+
it. A bare value is equality; the operators are `$eq`, `$ne`, `$in`, `$nin`, `$gt`,
|
|
111
|
+
`$gte`, `$lt`, `$lte`, `$all`, `$size` and `$exists`. Equality on a list asks if it
|
|
112
|
+
contains the value. Missing, null and empty differ: `$exists: false` keeps a missing
|
|
113
|
+
field, `null` an explicit null, `''` empty text and `$size: 0` an empty list. A date
|
|
114
|
+
compares in calendar order and never with a date-time. A reference compares by the
|
|
115
|
+
Room Path it resolves to. Untyped frontmatter, and a value under `oneOf` or a
|
|
122
116
|
conditional, is plain values. There is no text containment or regular expression.
|
|
123
117
|
- **Relations.** `hop: { field, types, where, pathPrefix }` keeps Documents whose
|
|
124
|
-
reference at pointer `field`, at any depth, points to a matching Document of the
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
reference at pointer `field`, at any depth, points to a matching Document of the same
|
|
119
|
+
Room. `backlinks: { field, types, where, pathPrefix }` keeps Documents that a matching
|
|
120
|
+
Document of the same Room references. Each keeps a Document once.
|
|
127
121
|
- **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
|
|
128
|
-
`preamble`, `markdown`, `backlinks` and `
|
|
129
|
-
list of pointers and `sections` `'all'` or a list of names. Selected pointers
|
|
130
|
-
return the frontmatter holding only them, nested as written. A backlink names
|
|
131
|
-
|
|
132
|
-
Document also returns its MD Type. A non-Markdown Document returns
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- **Change.** `change` is `{ author, time }` of the Document's head revision as
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
`
|
|
153
|
-
`
|
|
154
|
-
|
|
122
|
+
`preamble`, `markdown`, `backlinks`, `change` and `fileId`, where `fields` is `'all'`
|
|
123
|
+
or a list of pointers and `sections` `'all'` or a list of names. Selected pointers
|
|
124
|
+
return the frontmatter holding only them, nested as written. A backlink names the
|
|
125
|
+
referring Path, MD Type and the pointer it came from as `field`. Room and Path always
|
|
126
|
+
return; a Markdown Document also returns its MD Type. A non-Markdown Document returns
|
|
127
|
+
only Room, Path and a selected `fileId`, and a binary Path entry its `binaryFile`
|
|
128
|
+
record too. An unselected part is absent. Select only what a screen shows: a list that
|
|
129
|
+
selects the Markdown hears every edit of it.
|
|
130
|
+
- **Change.** `change` is `{ author, time }` of the Document's head revision as the
|
|
131
|
+
Provider last delivered it: `author` is `{ kind: 'user' | 'site', id, name }` or `null`
|
|
132
|
+
for a write the Provider made itself, and `time` is the Provider's ISO 8601 change
|
|
133
|
+
time. It is `null` where the Provider delivered no time, as at a Site. An unsent edit
|
|
134
|
+
or move keeps it, an unsent creation has none, and a saved write takes the Provider's
|
|
135
|
+
own once it is Accepted. A Room's last change is its Document with the latest `time`.
|
|
136
|
+
- **File ID.** `fileId` is the Provider's Stable File ID of the file at the Path, or
|
|
137
|
+
`null` where the Provider supplies none. An unsent edit keeps it, an unsent move
|
|
138
|
+
carries it to the new Path, and an unsent creation has none until it is Accepted, so a
|
|
139
|
+
file ID that leaves one Path for another is the same file moved.
|
|
140
|
+
- **Order and groups.** `orderBy` sorts by `room`, `path`, `type` or `{ field }` with
|
|
141
|
+
TanStack DB's own options, and ties end with Room, then Path. `groupBy` by `room`,
|
|
142
|
+
`type` or `{ field }` answers `{ groups: [{ key, count }] }`, counted over every match
|
|
143
|
+
and ordered by `count` or a key. A sort or group takes only a pointer that holds one
|
|
144
|
+
value. `limit` bounds the Documents or the groups.
|
|
145
|
+
- **Results and errors.** A result carries no Room Version: read freshness from Rooms
|
|
146
|
+
and Sync Status. `coverage` names each Room read as `{ room, generation, current }`,
|
|
147
|
+
`current` false while a newer copy of that Room is being fetched, and the queued
|
|
148
|
+
changes it includes as `overlay`; a Save in a Room changes the `overlay` of every
|
|
149
|
+
query over it. An invalid query fails with the `code` `invalid-query`, `unknown-type`,
|
|
150
|
+
`unknown-field` or `wrong-kind`, naming where, and never answers empty in its place.
|
|
155
151
|
|
|
156
152
|
## Local Search rules
|
|
157
153
|
|
|
158
|
-
`search({ text, documents, conversations, limit })` answers once, by words, from
|
|
159
|
-
|
|
154
|
+
`search({ text, documents, conversations, limit })` answers once, by words, from local
|
|
155
|
+
state, with MiniSearch's defaults. There is no observed search.
|
|
160
156
|
|
|
161
|
-
- **
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
- **Declaration.** Only an App whose release declares Local Search searches, its first
|
|
158
|
+
readiness waiting for its index; any other App's `search` answers the never retryable
|
|
159
|
+
`undeclared` refusal `search-undeclared`, its `fields` naming `local_search`.
|
|
160
|
+
- **What is found.** A Document by its field values, its sections' headings and text,
|
|
161
|
+
its preamble and its Path; a message by its text. Frontmatter keys, Room Drafts, chat
|
|
162
|
+
drafts and a running turn's parts are never found. There are no phrases, word forms,
|
|
163
|
+
typo tolerance or prefix matching.
|
|
165
164
|
- **Narrowing.** `documents` is a Local Query filter: `rooms`, `types`, `where`,
|
|
166
|
-
`pathPrefix`, `hop` and `backlinks`. `conversations` names conversations. Both
|
|
167
|
-
|
|
168
|
-
- **Results.** `{ documents, messages, coverage }`, or
|
|
169
|
-
Room or conversation the search waits for while its index is prepared:
|
|
170
|
-
again, and never read pending as no hits. `coverage` names the Rooms and
|
|
171
|
-
conversations searched. Each list is ranked by `score`,
|
|
172
|
-
|
|
173
|
-
`
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
show. An invalid filter fails with its Local Query error.
|
|
165
|
+
`pathPrefix`, `hop` and `backlinks`. `conversations` names conversations. Both apply
|
|
166
|
+
before `limit`, which bounds each list; without it every hit returns.
|
|
167
|
+
- **Results.** `{ documents, messages, coverage }`, or the same with `pending` naming
|
|
168
|
+
each Room or conversation the search waits for while its index is prepared: show its
|
|
169
|
+
hits, ask again, and never read pending as no hits. `coverage` names the Rooms and
|
|
170
|
+
conversations searched. Each list is ranked by `score`, comparable only within that
|
|
171
|
+
list. A Document hit names its `room`, `path` and `type`, a message hit its
|
|
172
|
+
`conversation` and `identity`; `matches` maps each matched word to the parts it matched
|
|
173
|
+
in: `fields`, `sections`, `preamble`, `path` or `text`. A hit carries no position: mark
|
|
174
|
+
the words in the text you show. An invalid filter fails with its Local Query error.
|
|
177
175
|
|
|
178
176
|
## Room Draft, Save, and outcome rules
|
|
179
177
|
|
|
180
|
-
The MD Runtime owns one Room Draft per Room and Path, shared by every App and tab.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
it
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
`
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
that refusal to its caller. Show the Provider as read-only instead of retrying.
|
|
178
|
+
The MD Runtime owns one Room Draft per Room and Path, shared by every App and tab. It is
|
|
179
|
+
durable: it survives reload and navigation. A Room the Provider reports lost takes its
|
|
180
|
+
Room Drafts and its queue with it. Write a Room Draft with `roomDraft.write(room, path,
|
|
181
|
+
revision, parts)`, naming the revision you read, or `null` when there was none, and every
|
|
182
|
+
part it should now change: fields, sections and the preamble, or the whole Markdown, a
|
|
183
|
+
creation, a move, or a removal. A part new to the Room Draft names its base, the value
|
|
184
|
+
you showed when it was opened; the MD Runtime keeps a part's first base; a binary Path
|
|
185
|
+
entry's move or removal takes `null` as its base. A write or a discard from an older
|
|
186
|
+
revision is refused as `stale` with the current Room Draft; read it and write again.
|
|
187
|
+
|
|
188
|
+
Save takes one Room and the Room Drafts of it to save, each with its revision, validates
|
|
189
|
+
locally, and on success appends one Change Batch to that Room's queue and removes those
|
|
190
|
+
Room Drafts. It is refused with the `code` `stale`, `changed-underneath` naming each
|
|
191
|
+
part whose base no longer matches the visible state, or a local validation rule, and
|
|
192
|
+
then creates nothing and leaves every Room Draft in place. A directory move or removal
|
|
193
|
+
is that part on each Document and binary Path entry beneath it, saved together.
|
|
194
|
+
|
|
195
|
+
Outcomes follow the Provider's answer. An Accepted Change Batch stays in the queue, drawn
|
|
196
|
+
over the confirmed layer, until that layer reaches the Room Version it was accepted at,
|
|
197
|
+
then leaves it. Conflicted and Rejected, an expired operation, and a change that no
|
|
198
|
+
longer applies over the Room each leave the queue and return as Room Drafts on their
|
|
199
|
+
Documents, marked with why: the Provider's structured refusal code and fields as
|
|
200
|
+
returned, not known to have applied, or withdrawn locally. The rest of the queue keeps
|
|
201
|
+
synchronizing, and Sync Status requires attention until each returned Room Draft is saved
|
|
202
|
+
or discarded. A Change Batch keeps no outcome once it leaves the queue; `observe('queue',
|
|
203
|
+
room)` shows each Pending one. Transport failure and Provider unavailability keep work
|
|
204
|
+
Pending, as does a refusal the Provider marks retryable until the reset it names; the MD
|
|
205
|
+
Runtime retries the same Change Batch identity and payload, never infers an outcome from
|
|
206
|
+
transport uncertainty, and never combines, reorders, or rebases.
|
|
207
|
+
|
|
208
|
+
On a Site, every Save stays in the visitor's browser. Write grants and revisions do not
|
|
209
|
+
refuse it, and its Pending Change shows in every query and across reloads until the
|
|
210
|
+
browser's storage is cleared. It is never sent: `observe('queue', room)` shows it
|
|
211
|
+
`local`, and Sync Status never waits on it. Once the Room changes so that it no longer
|
|
212
|
+
applies, it leaves the queue and returns no Room Draft.
|
|
213
|
+
|
|
214
|
+
`observe('service-mode')` answers the Provider's Service Mode, `open` or `write-halted`.
|
|
215
|
+
While writes are halted, Save still succeeds, its Change Batch waits unsent, and the
|
|
216
|
+
queue is submitted in order once the Provider reopens writes. An Action is never held: a
|
|
217
|
+
write the Provider refuses for the halt returns that refusal to its caller. Show the
|
|
218
|
+
Provider as read-only instead of retrying.
|
|
219
|
+
|
|
220
|
+
`observe('readiness')` tells whether the App's code and bound Rooms are held locally
|
|
221
|
+
(`ready`), each Room's state, each refused Room's file and rule, the persistence answer
|
|
222
|
+
and a paused preparation's `capacity` cause; `retry()` resumes a paused preparation.
|
|
226
223
|
|
|
227
224
|
## The neutrality rule
|
|
228
225
|
|
|
229
|
-
No module outside an Adapter package imports, names, or special-cases a
|
|
230
|
-
|
|
226
|
+
No module outside an Adapter package imports, names, or special-cases a Provider. MD UI
|
|
227
|
+
and every App reach data only through the client entry.
|
|
231
228
|
|
|
232
229
|
## Content-safety rules
|
|
233
230
|
|
|
234
|
-
The Provider authorization belongs to the Runtime host and is never readable
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
details and summary elements, and loads images and other resources only from
|
|
240
|
-
origins the Provider's policy allows.
|
|
231
|
+
The Provider authorization belongs to the Runtime host and is never readable by the App's
|
|
232
|
+
code. The App's code reaches the network only at the external origins its manifest
|
|
233
|
+
declares, empty by default, and the Provider enforces that set. Rendered Markdown never
|
|
234
|
+
executes scripts, renders raw HTML only for the details and summary elements, and loads
|
|
235
|
+
images and other resources only from origins the Provider's policy allows.
|
|
241
236
|
|
|
242
237
|
## Launch promises MD UI keeps
|
|
243
238
|
|
|
244
|
-
MD UI uses semantic HTML, is fully operable from a keyboard with visible
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
of these promises by itself. Reading, querying and searching never wait for
|
|
251
|
-
the network. Data lives only in the App Creator's browser and with the Provider.
|
|
239
|
+
MD UI uses semantic HTML, is fully operable from a keyboard with visible focus and
|
|
240
|
+
labelled controls, and lays out from a 360 pixel wide viewport to a desktop. Its strings
|
|
241
|
+
are English only, dates and numbers follow the browser locale, and content is never
|
|
242
|
+
translated. Light and dark themes come from CSS custom properties, defaulting to the
|
|
243
|
+
browser's preference and respecting an App's override. What an agent adds carries none of
|
|
244
|
+
these promises by itself. Data lives only in the App Creator's browser and the Provider.
|
|
252
245
|
|
|
253
246
|
## App code takes the client its host hands it and never constructs a Runtime
|
|
254
247
|
|
|
255
|
-
App code takes the client its host hands it: in House, `houseBridge().runtime`
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
`
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
A React App may observe and save through `@agentshouse/mdruntime/react`, which
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
through the data providers of `@agentshouse/mdruntime-families`.
|
|
248
|
+
App code takes the client its host hands it: in House, `houseBridge().runtime` from
|
|
249
|
+
`@agentshouse/app-bridge` resolves to the client House built into the page. It imports
|
|
250
|
+
only types from `@agentshouse/mdruntime/client`, never calls `connectMdRuntime` or
|
|
251
|
+
`serveMdRuntime`, and never imports the package main, the host entry or the Adapter
|
|
252
|
+
package, which hosts and tests use. The in-memory Adapter at
|
|
253
|
+
`@agentshouse/mdruntime/memory` is for tests and ships in no bundle. A Site's page fills
|
|
254
|
+
its Entry Data Contract's `{"$param": name}` arguments with `boundQuery` from
|
|
255
|
+
`@agentshouse/mdruntime/entry`, as House did for its HTML.
|
|
256
|
+
|
|
257
|
+
A React App may observe and save through `@agentshouse/mdruntime/react`, which names
|
|
258
|
+
React as a peer dependency. `useObserve(client, topic, ...input)` takes the arguments of
|
|
259
|
+
`observe` and returns `{ state: 'loading' }` until the topic's first value arrives, then
|
|
260
|
+
`{ state: 'ready', value }`, re-rendering on each change; a `null` client observes
|
|
261
|
+
nothing and stays loading. `useSave(client)` returns `busy`, the last `outcome` or
|
|
262
|
+
`failure`, and `save(room, roomDrafts)`, which writes each Path's parts onto the Room
|
|
263
|
+
Draft already there, keeping the bases its parts have, or onto a new one, and saves them
|
|
264
|
+
together. A refused Save leaves the Room Drafts for the App to save again or discard; a
|
|
265
|
+
failure is recorded and rejects. `saveRoomDrafts(client, room, roomDrafts)` is that save
|
|
266
|
+
outside a component. A react-admin or Refine App reads and writes its Rooms through the
|
|
267
|
+
data providers of `@agentshouse/mdruntime-families`.
|
|
276
268
|
|
|
277
269
|
## The Chat
|
|
278
270
|
|
|
279
|
-
`@agentshouse/mdruntime/chat` holds the Chat, one data layer for every App; add
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
Place the ready chat with `<Chat client={runtime} conversation={id}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
`--chat-text`, `--chat-text-muted`, `--chat-accent`, `--chat-line`,
|
|
271
|
+
`@agentshouse/mdruntime/chat` holds the Chat, one data layer for every App; add React as
|
|
272
|
+
a dependency in any App, with React DOM and `@assistant-ui/react`.
|
|
273
|
+
|
|
274
|
+
Place the ready chat with `<Chat client={runtime} conversation={id} agent={agent}
|
|
275
|
+
width="1/3" showChats />`: `conversation` opens one, `null` for a new chat, `agent` is
|
|
276
|
+
the Agent a new chat goes to, `onOpen` hears each one it opens, and `width` is `full`
|
|
277
|
+
(the place you give it), or `3/4`, `1/2` or `1/3` of the window docked at its right
|
|
278
|
+
edge, whole on a narrow window. `showChats` adds its conversation list; or draw your own
|
|
279
|
+
inside a `ChatProvider` around a `<Chat />` with no `client`. It carries its own styles;
|
|
280
|
+
theme it with CSS custom properties on it or an ancestor: `--chat-background`,
|
|
281
|
+
`--chat-surface`, `--chat-text`, `--chat-text-muted`, `--chat-accent`, `--chat-line`,
|
|
291
282
|
`--chat-attention`, `--chat-danger`, `--chat-font`, `--chat-font-mono`,
|
|
292
|
-
`--chat-font-size`, `--chat-radius` and `--chat-density` (a factor for spacing);
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
Mix `ChatMessageList` (`components` takes your `UserMessage` and
|
|
297
|
-
`
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
`@agentshouse/mdruntime/client`. `Markdown` draws Markdown safely.
|
|
283
|
+
`--chat-font-size`, `--chat-radius` and `--chat-density` (a factor for spacing); an
|
|
284
|
+
unset one keeps House's light or dark look. `mountChat(element, { client })` places it
|
|
285
|
+
outside React and returns `update(props)` and `unmount()`.
|
|
286
|
+
|
|
287
|
+
Mix `ChatMessageList` (`components` takes your `UserMessage` and `AssistantMessage`),
|
|
288
|
+
`ChatInput` and `ChatQuestionCard` with your own design inside a `ChatProvider`, or
|
|
289
|
+
compose assistant-ui's primitives there; `useChat()` gives `send`, the conversations,
|
|
290
|
+
the Agents, questions to `answer`, `options` to `choose`, `commands`, the queue to
|
|
291
|
+
`edit` or `unqueue`, `stop`, `kill` and outcomes; never replace its messages, sending or
|
|
292
|
+
store. A secret question is never answered here; typed answers live in Presentation
|
|
293
|
+
State's `typed` key: keep it, and change Presentation State only inside `inTurn(client,
|
|
294
|
+
work)` from `@agentshouse/mdruntime/client`. `Markdown` draws Markdown safely.
|
|
305
295
|
|
|
306
296
|
## What an agent must never do
|
|
307
297
|
|
|
308
|
-
An agent must never read the authorization, load code from a Room, call the
|
|
309
|
-
|
|
298
|
+
An agent must never read the authorization, load code from a Room, call the Provider
|
|
299
|
+
directly, or rebase a refused Change Batch.
|
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,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,OAAO,EACP,aAAa,EAiBd,MAAM,wBAAwB,CAAC;AA4ChC,OAAO,EASL,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,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAsErD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CA0hBpF"}
|
package/dist/adapter.js
CHANGED
|
@@ -134,7 +134,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
134
134
|
const models = await streamedModels(advanced.schemas, entry, 'credential');
|
|
135
135
|
return models === undefined ? advanced.page : { ...advanced.page, models };
|
|
136
136
|
}
|
|
137
|
-
function held(rooms) {
|
|
137
|
+
function held(rooms, demand) {
|
|
138
138
|
const kept = rooms.flatMap((room) => {
|
|
139
139
|
const entry = tracked.get(room.locator);
|
|
140
140
|
const at = logPosition(room.roomVersion);
|
|
@@ -144,7 +144,15 @@ export function createAgentsHouseAdapter(options) {
|
|
|
144
144
|
notifications.reach(entry.authority, at);
|
|
145
145
|
return [presented(entry.authority, at)];
|
|
146
146
|
});
|
|
147
|
-
notifications.send(kept
|
|
147
|
+
notifications.send(kept, demand === null
|
|
148
|
+
? null
|
|
149
|
+
: {
|
|
150
|
+
rooms: demand.rooms.flatMap((locator) => {
|
|
151
|
+
const entry = tracked.get(locator);
|
|
152
|
+
return entry === undefined ? [] : [entry.authority];
|
|
153
|
+
}),
|
|
154
|
+
conversations: demand.conversations,
|
|
155
|
+
});
|
|
148
156
|
}
|
|
149
157
|
function adopted(entry, outcome) {
|
|
150
158
|
if (outcome.kind !== 'accepted')
|
|
@@ -242,46 +250,47 @@ export function createAgentsHouseAdapter(options) {
|
|
|
242
250
|
const depths = new Map();
|
|
243
251
|
const layers = [];
|
|
244
252
|
for (const ask of asks) {
|
|
245
|
-
const depth = depths.get(ask.entry.authority) ?? 0;
|
|
246
|
-
depths.set(ask.entry.authority, depth + 1);
|
|
253
|
+
const depth = depths.get(ask.ask.entry.authority) ?? 0;
|
|
254
|
+
depths.set(ask.ask.entry.authority, depth + 1);
|
|
247
255
|
(layers[depth] ??= []).push(ask);
|
|
248
256
|
}
|
|
249
257
|
return layers;
|
|
250
258
|
}
|
|
251
259
|
async function enumerated(asks) {
|
|
252
|
-
const answers =
|
|
253
|
-
const parts = layered(asks).flatMap((layer) => selections(layer, (ask) => weight(ask.entry), declared().max_prefixes));
|
|
260
|
+
const answers = [];
|
|
261
|
+
const parts = layered(asks.map((ask, index) => ({ ask, index }))).flatMap((layer) => selections(layer, ({ ask }) => weight(ask.entry), declared().max_prefixes));
|
|
254
262
|
for (const part of parts) {
|
|
255
263
|
let open = [...part];
|
|
256
264
|
while (open.length > 0) {
|
|
257
265
|
const answer = await transport.door(DOOR_ENUMERATE, {
|
|
258
|
-
prefixes: open.flatMap((ask) => contentPrefixes(ask.entry)),
|
|
259
|
-
positions: open.map((ask) => presented(ask.entry.authority, ask.from)),
|
|
266
|
+
prefixes: open.flatMap(({ ask }) => contentPrefixes(ask.entry)),
|
|
267
|
+
positions: open.map(({ ask }) => presented(ask.entry.authority, ask.from)),
|
|
260
268
|
});
|
|
261
|
-
const classified = open.map((ask) => classifyRead(answer.status, answer.body, ask.entry.locator));
|
|
269
|
+
const classified = open.map(({ ask }) => classifyRead(answer.status, answer.body, ask.entry.locator));
|
|
262
270
|
if (classified[0]?.kind === 'beyond-horizon') {
|
|
263
271
|
const named = doorRefusal(answer.body)?.fields.authority;
|
|
264
|
-
const expired = open.filter((ask) => ask.entry.authority === named);
|
|
272
|
+
const expired = open.filter(({ ask }) => ask.entry.authority === named);
|
|
265
273
|
const answered = expired.length === 0 ? UNCERTAIN_READ : { kind: 'beyond-horizon' };
|
|
266
274
|
const gone = expired.length === 0 ? open : expired;
|
|
267
275
|
for (const ask of gone)
|
|
268
|
-
answers.
|
|
276
|
+
answers[ask.index] = answered;
|
|
269
277
|
open = open.filter((ask) => !gone.includes(ask));
|
|
270
278
|
continue;
|
|
271
279
|
}
|
|
272
280
|
const enumeration = classified[0] === null ? parseEnumeration(answer.body, 'credential') : null;
|
|
273
|
-
for (const [
|
|
274
|
-
const failure = classified[
|
|
281
|
+
for (const [answerIndex, { ask, index }] of open.entries()) {
|
|
282
|
+
const failure = classified[answerIndex];
|
|
275
283
|
if (failure !== null && failure !== undefined) {
|
|
276
|
-
answers
|
|
284
|
+
answers[index] = failure;
|
|
277
285
|
continue;
|
|
278
286
|
}
|
|
279
|
-
answers
|
|
287
|
+
answers[index] =
|
|
288
|
+
enumeration === null ? UNCERTAIN_READ : await enumeratedRoom(enumeration, ask);
|
|
280
289
|
}
|
|
281
290
|
open = [];
|
|
282
291
|
}
|
|
283
292
|
}
|
|
284
|
-
return
|
|
293
|
+
return answers;
|
|
285
294
|
}
|
|
286
295
|
const bootstrapTogether = gatheredEach(bootstrapped);
|
|
287
296
|
const enumerateTogether = gathered(enumerated);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
2
|
export { HOUSE_APP_ACTS, HOUSE_APP_BATCHES, HOUSE_SITE_ACTS } from './actions.js';
|
|
3
|
-
export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
|
3
|
+
export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, HouseDemand, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
|
4
4
|
//# 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,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/read.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { TrackedAuthority } from './discovery.js';
|
|
|
3
3
|
import type { HouseMode } from './transport.js';
|
|
4
4
|
import { type LogPosition } from './version.js';
|
|
5
5
|
export type HeadChange = BootstrapPage['changes'][string];
|
|
6
|
+
export declare function identities(revisions: Readonly<Record<string, string>>): {
|
|
7
|
+
fileIds?: Record<string, string>;
|
|
8
|
+
};
|
|
6
9
|
export type HouseManifestFile = {
|
|
7
10
|
path: string;
|
|
8
11
|
revision: string | 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,cAAc,EACd,UAAU,EACV,aAAa,EAEb,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpF,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,aAAa,EAEb,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KA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,GAAG,UAAU,CAuB5E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAElF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAsB5D;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAO9E;AAED,wBAAgB,MAAM,CACpB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,SAAS,GAAG,SAAS,CAEvB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,aAAa,CA2BnF"}
|
package/dist/read.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { DECIMAL, readPosition, roomVersion } from './version.js';
|
|
2
|
+
const REVISION_FILE = /^fr_([0-9a-z]+)\.[0-9a-z]+\.[0-9a-z]$/u;
|
|
3
|
+
export function identities(revisions) {
|
|
4
|
+
const fileIds = Object.fromEntries(Object.entries(revisions).flatMap(([path, revision]) => {
|
|
5
|
+
const file = REVISION_FILE.exec(revision)?.[1];
|
|
6
|
+
return file === undefined ? [] : [[path, file]];
|
|
7
|
+
}));
|
|
8
|
+
return Object.keys(fileIds).length === 0 ? {} : { fileIds };
|
|
9
|
+
}
|
|
2
10
|
export function authorityRoot(handle) {
|
|
3
11
|
return `/rooms/${handle}`;
|
|
4
12
|
}
|
|
@@ -353,6 +361,7 @@ export function bootstrapOf(scope) {
|
|
|
353
361
|
roomVersion: roomVersion(scope),
|
|
354
362
|
documents,
|
|
355
363
|
revisions,
|
|
364
|
+
...identities(revisions),
|
|
356
365
|
changes,
|
|
357
366
|
binaryFiles,
|
|
358
367
|
};
|
|
@@ -396,6 +405,7 @@ export function refreshFrom(view, fromRoomVersion) {
|
|
|
396
405
|
roomVersion: roomVersion(view),
|
|
397
406
|
documents,
|
|
398
407
|
revisions,
|
|
408
|
+
...identities(revisions),
|
|
399
409
|
changes,
|
|
400
410
|
binaryFiles,
|
|
401
411
|
removals: removals.sort(),
|
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,EAOR,MAAM,wBAAwB,CAAC;AA2BhC,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAmCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAOR,MAAM,wBAAwB,CAAC;AA2BhC,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAmCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CA+Q1F"}
|
package/dist/site.js
CHANGED
|
@@ -253,7 +253,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
253
253
|
return [];
|
|
254
254
|
notifications.reach(entry.authority, at);
|
|
255
255
|
return [presented(entry.authority, at)];
|
|
256
|
-
}));
|
|
256
|
+
}), null);
|
|
257
257
|
},
|
|
258
258
|
reopen: notifications.reopen,
|
|
259
259
|
observe: notifications.observe,
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConversationStream, RefreshPage, RoomStreamEvent, ServiceModeSignal, StreamReceipts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
-
import type { HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
|
|
3
|
+
import type { HouseDemand, HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
|
|
4
4
|
import { type LogPosition } from './version.js';
|
|
5
5
|
export type HeldRevision = (path: string, revision: string) => boolean;
|
|
6
6
|
export type StreamedAdvancement = {
|
|
@@ -11,7 +11,7 @@ export type StreamedAdvancement = {
|
|
|
11
11
|
export type HouseNotifications = {
|
|
12
12
|
runtime: string;
|
|
13
13
|
observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
|
|
14
|
-
send(rooms: readonly HouseHeldRoom[]): void;
|
|
14
|
+
send(rooms: readonly HouseHeldRoom[], demand: HouseDemand | null): void;
|
|
15
15
|
published(locator: string, at: LogPosition): void;
|
|
16
16
|
reopen(): void;
|
|
17
17
|
track(authorities: readonly TrackedAuthority[]): void;
|
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,EAGV,kBAAkB,EAElB,WAAW,EACX,eAAe,EAEf,iBAAiB,EACjB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAGhC,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;AA0C7D,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EA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,IAAI,CAAC;IACxF,IAAI,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACxE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAClD,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;AAkFF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,kBAAkB,CAohB5F"}
|
package/dist/stream.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { acceptedMessage } from './actions.js';
|
|
2
2
|
import { sha256Hex } from './digest.js';
|
|
3
|
-
import { binaryFileOf, headChange } from './read.js';
|
|
3
|
+
import { binaryFileOf, headChange, identities } from './read.js';
|
|
4
4
|
import { roomVersion } from './version.js';
|
|
5
5
|
const HELD_FRAMES_MAX = 256;
|
|
6
6
|
function turnOperation(frame) {
|
|
@@ -463,7 +463,7 @@ export function houseNotifications(transport, mode) {
|
|
|
463
463
|
observers.delete(notify);
|
|
464
464
|
};
|
|
465
465
|
},
|
|
466
|
-
send(rooms) {
|
|
466
|
+
send(rooms, demand) {
|
|
467
467
|
for (const room of rooms) {
|
|
468
468
|
const line = lines.get(room.authority);
|
|
469
469
|
const held = position(room.position);
|
|
@@ -478,7 +478,7 @@ export function houseNotifications(transport, mode) {
|
|
|
478
478
|
void loaded
|
|
479
479
|
.then(() => Promise.all(rooms.map(restored)))
|
|
480
480
|
.then((presented) => {
|
|
481
|
-
current.hold(presented, runtime);
|
|
481
|
+
current.hold(presented, runtime, demand);
|
|
482
482
|
for (const [index, room] of presented.entries()) {
|
|
483
483
|
if (room.position === rooms[index].position)
|
|
484
484
|
continue;
|
|
@@ -601,6 +601,7 @@ export function houseNotifications(transport, mode) {
|
|
|
601
601
|
roomVersion: roomVersion({ position: last.position.toString(), logEpoch: line.logEpoch }),
|
|
602
602
|
documents,
|
|
603
603
|
revisions,
|
|
604
|
+
...identities(revisions),
|
|
604
605
|
changes,
|
|
605
606
|
binaryFiles,
|
|
606
607
|
removals: removals.sort(),
|
package/dist/transport.d.ts
CHANGED
|
@@ -134,8 +134,12 @@ export type HouseHeldRoom = {
|
|
|
134
134
|
log_epoch: string;
|
|
135
135
|
carry?: HouseHeldCarry;
|
|
136
136
|
};
|
|
137
|
+
export type HouseDemand = {
|
|
138
|
+
rooms: readonly string[];
|
|
139
|
+
conversations: boolean;
|
|
140
|
+
};
|
|
137
141
|
export type HouseOpening = {
|
|
138
|
-
hold(rooms: readonly HouseHeldRoom[], runtime: string): void;
|
|
142
|
+
hold(rooms: readonly HouseHeldRoom[], runtime: string, demand: HouseDemand | null): void;
|
|
139
143
|
received(authority: string, carry: string, index: number): void;
|
|
140
144
|
close(): void;
|
|
141
145
|
};
|
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,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AAE,MAAM,CAAA;CAAE,GAC3C,aAAa,CAyDf"}
|
package/dist/write.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { departure, } from '@agentshouse/mdruntime';
|
|
2
|
-
import { binaryFileOf, headChange } from './read.js';
|
|
2
|
+
import { binaryFileOf, headChange, identities } from './read.js';
|
|
3
3
|
import { sha256Hex, textBytes } from './digest.js';
|
|
4
4
|
import { nativePath, roomLocalPath } from './map.js';
|
|
5
5
|
import { classifyDoor, doorRefusal, scopedRefusal } from './refusal.js';
|
|
@@ -272,6 +272,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
272
272
|
roomVersion: roomVersion(at),
|
|
273
273
|
documents,
|
|
274
274
|
revisions,
|
|
275
|
+
...identities(revisions),
|
|
275
276
|
changes,
|
|
276
277
|
removals: removals.sort(),
|
|
277
278
|
...(Object.keys(binaryFiles).length === 0 ? {} : { binaryFiles }),
|
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-cb6436097e8a2",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
28
|
+
"@agentshouse/mdruntime": "0.1.0-c5d3fa6fb67bc"
|
|
29
29
|
}
|
|
30
30
|
}
|