@agentshouse/mdruntime-adapter 0.1.0-c96ce90a9df53 → 0.1.0-ca3a44982cbe7
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 +95 -114
- package/dist/actions.d.ts +3 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +8 -2
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +5 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/site.js +3 -3
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +8 -7
- package/package.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
# Instructions for the App Creator's agent
|
|
2
2
|
|
|
3
|
-
These instructions address an agent in an environment with Git. Obtain the
|
|
4
|
-
|
|
3
|
+
These instructions address an agent in an environment with Git. Obtain the App
|
|
4
|
+
Repository, change it, build, and push. They are documentation, not enforcement.
|
|
5
5
|
|
|
6
6
|
## The MD Runtime API
|
|
7
7
|
|
|
8
8
|
App code reaches the MD Runtime through the remote client. The surfaces are
|
|
9
9
|
Rooms, Query, Search, Observe, Types, Room Draft, Save, History, the binary file
|
|
10
|
-
reads, Call, Reached, Log,
|
|
11
|
-
the
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
reads, Call, Reached, Log, the reported persistence answer, reauthorization,
|
|
11
|
+
conversation, the chat draft, and Presentation State. Sync Status, the Service
|
|
12
|
+
Mode, the storage-loss statement, the deployment facts and the signed-in member
|
|
13
|
+
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,
|
|
17
17
|
Rooms lists only the Rooms reached whole, a Room reached for single Documents
|
|
18
18
|
shows only those Documents and the Types of the models that govern them, and
|
|
19
19
|
without conversations the conversation members, the chat draft and the
|
|
20
|
-
conversation observation hold none.
|
|
21
|
-
|
|
22
|
-
keeping every unchanged Document the same object.
|
|
20
|
+
conversation observation hold none. A change of the reach reaches every open
|
|
21
|
+
observation as its new value, a query keeping unchanged Documents the same objects.
|
|
23
22
|
|
|
24
23
|
Every `observe` resolves, once its first value has arrived, to a handle:
|
|
25
24
|
`current()` is the latest complete value, `subscribe(listener)` hears each later
|
|
@@ -28,51 +27,44 @@ Closing the port ends every handle and rejects every pending call and
|
|
|
28
27
|
observation; a client that reconnects observes again.
|
|
29
28
|
|
|
30
29
|
`observe('agents')` answers every Agent a new conversation can go to, each
|
|
31
|
-
`{ identity, name }`, whether or not it has a conversation yet.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`state`: `asking` while a question waits, `working` while a turn runs, else
|
|
36
|
-
and `started`, when the running turn began, or `null`.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
message may name a file directly by its `fileRef`; read that file with
|
|
65
|
-
`binaryFile.readReference({ fileRef, referrer })`, where the referrer is the
|
|
66
|
-
`referrer` the Provider gave beside the reference, or `{ room, path }` of the
|
|
67
|
-
document whose text names it. Both answer `{ kind: 'binary', blob }` or a
|
|
68
|
-
refusal or failure. History of a binary Path lists each revision's
|
|
69
|
-
`binaryFile` metadata without bytes.
|
|
30
|
+
`{ identity, name }`, whether or not it has a conversation yet. Each conversation
|
|
31
|
+
the Provider's conversation list names is held complete in the browser.
|
|
32
|
+
`conversation.list()` and `observe('conversations')` answer each with its Agent's
|
|
33
|
+
identity and name, its name, created and finished times, last outcome and live
|
|
34
|
+
`state`: `asking` while a question waits, `working` while a turn runs, else
|
|
35
|
+
`idle`, and `started`, when the running turn began, or `null`. Observe one with
|
|
36
|
+
`observe('conversation', id, { limit })`: the view holds its latest `limit`
|
|
37
|
+
messages, or all of them, oldest first, its chat draft, and what the Provider
|
|
38
|
+
streams for it whether or not anything views it: the running `turn` with its
|
|
39
|
+
message parts and its context in use and window, the open questions, the process
|
|
40
|
+
state, and the CLI's commands and options. These live only in memory: the
|
|
41
|
+
message accepted under the turn's id replaces the running turn, and none of them
|
|
42
|
+
is stored or searchable. `chatDraft.write` and `chatDraft.discard` keep what the
|
|
43
|
+
App Creator composes; sending it is a Provider Action that needs the Provider
|
|
44
|
+
reachable and is never queued.
|
|
45
|
+
|
|
46
|
+
A binary file at a Path is a binary Path entry. Query lists it by `path`, and
|
|
47
|
+
History each of its revisions, with its `binaryFile` record and never its bytes:
|
|
48
|
+
`{ state: 'accepted', revision, path, fileRef, byteLength, mediaType, sha256 }`,
|
|
49
|
+
or, from a Save until the Provider accepts it, `{ state: 'pending', localId,
|
|
50
|
+
path, byteLength, mediaType, sha256 }`. Write one with a Room Draft whose only
|
|
51
|
+
part is `file: { blob }`, the `Blob`'s `type` its media type: Save keeps the
|
|
52
|
+
bytes in its Pending Change, offline too, and acceptance gives the record the
|
|
53
|
+
Provider's revision. Move or remove one as a Document, a pending one before or
|
|
54
|
+
after Save too, its bytes following; once its Pending Change has gone to the
|
|
55
|
+
Provider, Save refuses that as `unknown-revision` until it is accepted.
|
|
56
|
+
`binaryFile.read(room, path, revision?)` answers a pending record's saved bytes,
|
|
57
|
+
or asks the Provider again on every read of an accepted one or of a History
|
|
58
|
+
revision, a removed file's last included, keeping nothing. Text, a Record
|
|
59
|
+
attachment or a conversation message may name a file by its `fileRef`; read it
|
|
60
|
+
with `binaryFile.readReference({ fileRef, referrer })`, the referrer being the
|
|
61
|
+
`referrer` the Provider gave beside it, or `{ room, path }` of the document whose
|
|
62
|
+
text names it. Both answer `{ kind: 'binary', blob }` or a refusal or failure.
|
|
70
63
|
|
|
71
64
|
Rooms, Query, Search, Observe, Types, Room Draft, Save, and Reached never
|
|
72
|
-
touch the network.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Provider. A Call result whose
|
|
65
|
+
touch the network. History, the binary file reads and Call go to the Provider
|
|
66
|
+
through the Adapter. Call takes the Action names the Adapter declares; any other
|
|
67
|
+
name answers `undeclared` without reaching the Provider. A Call result whose
|
|
76
68
|
effect the Provider places in a Room carries `at`, that Room and Room Version;
|
|
77
69
|
`reached(room, roomVersion)` answers whether the Room's confirmed state has
|
|
78
70
|
reached it, and the MD Runtime keeps refreshing that Room until it has;
|
|
@@ -81,33 +73,26 @@ that document was written at a later Room Version. Each History revision
|
|
|
81
73
|
names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`.
|
|
82
74
|
History of a Path no current document holds answers the removed document's
|
|
83
75
|
revisions with `deleted: true`, newest first; that revision is what a link to
|
|
84
|
-
the Path opens. Every
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
MD Runtime keeps it with the Local Replicas, so it answers offline once known,
|
|
105
|
-
and every port hears the next member the Provider names; signing out answers
|
|
106
|
-
`null`, then ends the observation with the authorization. It is the only way App code learns who
|
|
107
|
-
uses it.
|
|
108
|
-
|
|
109
|
-
The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
|
|
110
|
-
ships in no bundle.
|
|
76
|
+
the Path opens. Every member of the client is asynchronous. Results are
|
|
77
|
+
detached snapshots. Nothing in this surface returns the authorization, performs
|
|
78
|
+
a request the App's code composes, or exposes the browser store.
|
|
79
|
+
|
|
80
|
+
Every refusal and failure carries `code` and `retryable`: each Call and History
|
|
81
|
+
answer other than its result, a refused Save or Room Draft write, a returned Room
|
|
82
|
+
Draft's reason, a Room's refusal and the Connection Refusal, and every error a
|
|
83
|
+
member rejects with, beside its message. A Provider refusal carries the
|
|
84
|
+
Provider's own `retryable`. Every code and every value the API answers is open:
|
|
85
|
+
handle one you do not know by its `code` and `retryable`.
|
|
86
|
+
|
|
87
|
+
Read the deployment facts with `observe('deployment-facts')`, an opaque value
|
|
88
|
+
the host's contract interprets. `observe('member')` answers who uses the App:
|
|
89
|
+
the User the Provider signed in, `{ kind: 'user', id, name }` in the shape of a
|
|
90
|
+
change's `author`, so a Document whose `change.author.id` equals its `id` is that
|
|
91
|
+
User's own. It is `null` until the Provider first names one, and where it names
|
|
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.
|
|
111
96
|
|
|
112
97
|
## Local Query rules
|
|
113
98
|
|
|
@@ -125,13 +110,12 @@ data:
|
|
|
125
110
|
pointers, ANDs them, and nests `$and` and `$or`; a pointer through a list holds
|
|
126
111
|
when any item satisfies it. A bare value is equality; the operators are `$eq`,
|
|
127
112
|
`$ne`, `$in`, `$nin`, `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size` and
|
|
128
|
-
`$exists`. Equality on a list asks whether it contains the value. Missing,
|
|
129
|
-
`$exists: false` keeps a missing field, `null` an
|
|
130
|
-
text and `$size: 0` an empty list. A date compares
|
|
131
|
-
with a date-time. A reference compares by the Room
|
|
132
|
-
Untyped frontmatter, and a value under `oneOf` or a
|
|
133
|
-
values. There is no text containment or regular
|
|
134
|
-
expression.
|
|
113
|
+
`$exists`. Equality on a list asks whether it contains the value. Missing,
|
|
114
|
+
null and empty differ: `$exists: false` keeps a missing field, `null` an
|
|
115
|
+
explicit null, `''` empty text and `$size: 0` an empty list. A date compares
|
|
116
|
+
in calendar order and never with a date-time. A reference compares by the Room
|
|
117
|
+
Path it resolves to. Untyped frontmatter, and a value under `oneOf` or a
|
|
118
|
+
conditional, is plain values. There is no text containment or regular expression.
|
|
135
119
|
- **Relations.** `hop: { field, types, where, pathPrefix }` keeps Documents whose
|
|
136
120
|
reference at pointer `field`, at any depth, points to a matching Document of the
|
|
137
121
|
same Room. `backlinks: { field, types, where, pathPrefix }` keeps Documents that a
|
|
@@ -184,17 +168,16 @@ search.
|
|
|
184
168
|
|
|
185
169
|
## Room Draft, Save, and outcome rules
|
|
186
170
|
|
|
187
|
-
The MD Runtime owns one Room Draft per Room and Path, shared by every App and
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
base. A
|
|
196
|
-
`
|
|
197
|
-
the current Room Draft; read it and write again.
|
|
171
|
+
The MD Runtime owns one Room Draft per Room and Path, shared by every App and tab.
|
|
172
|
+
It is durable: it survives reload and navigation. A Room that Discovery stops
|
|
173
|
+
listing takes its Room Drafts and its queue with it. Write a Room Draft with
|
|
174
|
+
`roomDraft.write(room, path, revision, parts)`, naming the revision you read, or
|
|
175
|
+
`null` when there was none, and every part it should now change: fields, sections
|
|
176
|
+
and the preamble, or the whole Markdown, a creation, a move, or a removal. A part
|
|
177
|
+
new to the Room Draft names its base, the value you showed when it was opened; the
|
|
178
|
+
MD Runtime keeps a part's first base; a binary Path entry's move or removal takes
|
|
179
|
+
`null` as its base. A write or a discard from an older revision is refused as
|
|
180
|
+
`stale` with the current Room Draft; read it and write again.
|
|
198
181
|
|
|
199
182
|
Save takes one Room and the Room Drafts of it to save, each with its revision,
|
|
200
183
|
validates locally, and on success appends one Change Batch to that Room's
|
|
@@ -202,7 +185,7 @@ queue and removes those Room Drafts. It is refused with the `code` `stale`,
|
|
|
202
185
|
`changed-underneath` naming each part whose base no longer matches the visible
|
|
203
186
|
state, or a local validation rule, and then creates nothing and leaves every
|
|
204
187
|
Room Draft in place. A directory move or removal is a move or removal part on
|
|
205
|
-
each Document and binary
|
|
188
|
+
each Document and binary Path entry beneath it, saved together.
|
|
206
189
|
|
|
207
190
|
Outcomes follow the Provider's answer. An Accepted Change Batch stays in the
|
|
208
191
|
queue, drawn over the confirmed layer, until the confirmed layer reaches the
|
|
@@ -220,19 +203,17 @@ it names; the MD Runtime retries the same Change Batch identity and payload and
|
|
|
220
203
|
never infers an outcome from transport uncertainty. The MD Runtime never
|
|
221
204
|
combines, reorders, or rebases.
|
|
222
205
|
|
|
223
|
-
On a Site, every Save stays in the visitor's browser. Write grants and
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
returns no Room Draft.
|
|
206
|
+
On a Site, every Save stays in the visitor's browser. Write grants and revisions
|
|
207
|
+
do not refuse it, and its Pending Change shows in every query and across reloads
|
|
208
|
+
until the browser's storage is cleared. It is never sent: `observe('queue', room)`
|
|
209
|
+
shows it `local`, and Sync Status never waits on it. Once the Room changes so that
|
|
210
|
+
it no longer applies, it leaves the queue and returns no Room Draft.
|
|
229
211
|
|
|
230
|
-
`observe('service-mode')` answers the Provider's Service
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
instead of retrying.
|
|
212
|
+
`observe('service-mode')` answers the Provider's Service Mode, `open` or
|
|
213
|
+
`write-halted`. While writes are halted, Save still succeeds, its Change Batch
|
|
214
|
+
waits unsent, and the queue is submitted in order once the Provider reopens
|
|
215
|
+
writes. An Action is never held: a write the Provider refuses for the halt returns
|
|
216
|
+
that refusal to its caller. Show the Provider as read-only instead of retrying.
|
|
236
217
|
|
|
237
218
|
## The neutrality rule
|
|
238
219
|
|
|
@@ -264,10 +245,10 @@ the network. Data lives only in the App Creator's browser and with the Provider.
|
|
|
264
245
|
|
|
265
246
|
App code takes the client its host hands it: in House, `houseBridge().runtime`
|
|
266
247
|
from `@agentshouse/app-bridge` resolves to the client House built into the page.
|
|
267
|
-
It
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
Adapter
|
|
248
|
+
It imports only types from `@agentshouse/mdruntime/client`, never calls
|
|
249
|
+
`connectMdRuntime` or `serveMdRuntime`, and never imports the package main, the
|
|
250
|
+
host entry or the Adapter package, which hosts and tests use. The in-memory
|
|
251
|
+
Adapter at `@agentshouse/mdruntime/memory` is for tests and ships in no bundle.
|
|
271
252
|
|
|
272
253
|
A React App may observe and save through `@agentshouse/mdruntime/react`, which
|
|
273
254
|
names React as a peer dependency. `useObserve(client, topic, ...input)` takes
|
package/dist/actions.d.ts
CHANGED
|
@@ -37,6 +37,9 @@ export type AppAnswerAdditions = {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
export declare const HOUSE_APP_ACTS: Readonly<Record<string, string>>;
|
|
40
|
+
export declare const SITE_SUBMIT = "submit";
|
|
41
|
+
export declare const HOUSE_SITE_ACTS: Readonly<Record<string, string>>;
|
|
42
|
+
export declare const HOUSE_APP_BATCHES: Readonly<Partial<Record<string, readonly string[]>>>;
|
|
40
43
|
export declare function houseConversationAgents(locator: string): ConversationAgents;
|
|
41
44
|
export declare function declaredActions(routes: readonly string[]): readonly ActionDeclaration[];
|
|
42
45
|
export declare function houseAction(transport: HouseTransport, request: ActionRequest): Promise<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,EACvB,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQtE,KAAK,QAAQ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Q,EAAE,CAAC;KACtC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,mBAAmB,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD,CAAC;AAwEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE3D,CAAC;AAEF,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE5D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAKhF,CAAC;AAMJ,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAE3E;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CAMvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAQvB;AAwED,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAOjF;AAkLD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAiBtE"}
|
package/dist/actions.js
CHANGED
|
@@ -11,9 +11,10 @@ function mapped(door, input = (given) => given) {
|
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function carried(door, carry) {
|
|
14
|
+
function carried(door, carry, batched) {
|
|
15
15
|
return {
|
|
16
16
|
door,
|
|
17
|
+
...(batched === undefined ? {} : { batched }),
|
|
17
18
|
carry: (transport, input, name) => carry(transport, `/door/${door}`, input, name),
|
|
18
19
|
};
|
|
19
20
|
}
|
|
@@ -22,7 +23,7 @@ const APP_ACTS = {
|
|
|
22
23
|
'conversation.answer': mapped('conversations/interaction/answer', answerBody),
|
|
23
24
|
'conversation.create': carried('conversations/create', createAction),
|
|
24
25
|
'conversation.delete': mapped('conversations/delete', controlBody),
|
|
25
|
-
'conversation.history': carried('conversations/history', historyAction),
|
|
26
|
+
'conversation.history': carried('conversations/history', historyAction, ['conversations']),
|
|
26
27
|
'conversation.interrupt': mapped('conversations/interrupt', controlBody),
|
|
27
28
|
'conversation.kill': mapped('conversations/kill', controlBody),
|
|
28
29
|
'conversation.markDone': mapped('conversations/done'),
|
|
@@ -46,6 +47,11 @@ const APP_ACTS = {
|
|
|
46
47
|
'triggerOccurrence.list': mapped('triggers/fired'),
|
|
47
48
|
};
|
|
48
49
|
export const HOUSE_APP_ACTS = Object.fromEntries(Object.entries(APP_ACTS).map(([name, act]) => [name, act.door]));
|
|
50
|
+
export const SITE_SUBMIT = 'submit';
|
|
51
|
+
export const HOUSE_SITE_ACTS = {
|
|
52
|
+
[SITE_SUBMIT]: 'site/submission',
|
|
53
|
+
};
|
|
54
|
+
export const HOUSE_APP_BATCHES = Object.fromEntries(Object.entries(APP_ACTS).flatMap(([name, act]) => act.batched === undefined ? [] : [[name, act.batched]]));
|
|
49
55
|
const APP_NAMES = new Map(Object.entries(APP_ACTS).map(([name, act]) => [act.door, name]));
|
|
50
56
|
export function houseConversationAgents(locator) {
|
|
51
57
|
return { locator, type: 'house-agent', identity: 'agent', name: 'name', retired: 'retired' };
|
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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W,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,CAOxD;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,4 +1,4 @@
|
|
|
1
|
-
import { declaredActions, houseConversationAgents } from './actions.js';
|
|
1
|
+
import { declaredActions, houseConversationAgents, SITE_SUBMIT } from './actions.js';
|
|
2
2
|
import { readPosition, roomVersion } from './version.js';
|
|
3
3
|
export const PROVIDER_ACTIONS = 'provider-actions';
|
|
4
4
|
export const DISCOVER_PREFIXES = ['/'];
|
|
@@ -229,7 +229,10 @@ export function capabilities(document) {
|
|
|
229
229
|
}
|
|
230
230
|
export function siteCapabilities() {
|
|
231
231
|
return [
|
|
232
|
-
{
|
|
232
|
+
{
|
|
233
|
+
name: PROVIDER_ACTIONS,
|
|
234
|
+
actions: [{ name: SITE_SUBMIT, inputShape: {}, resultKind: 'house' }],
|
|
235
|
+
},
|
|
233
236
|
];
|
|
234
237
|
}
|
|
235
238
|
export function discoveredRoom(authority) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
|
-
export { HOUSE_APP_ACTS } from './actions.js';
|
|
2
|
+
export { HOUSE_APP_ACTS, HOUSE_APP_BATCHES, HOUSE_SITE_ACTS } from './actions.js';
|
|
3
3
|
export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, 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,MAAM,cAAc,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,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter } from './adapter.js';
|
|
2
|
-
export { HOUSE_APP_ACTS } from './actions.js';
|
|
2
|
+
export { HOUSE_APP_ACTS, HOUSE_APP_BATCHES, HOUSE_SITE_ACTS } from './actions.js';
|
package/dist/site.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { actionOutcome } from './actions.js';
|
|
1
|
+
import { actionOutcome, SITE_SUBMIT } from './actions.js';
|
|
2
2
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
3
3
|
import { scopeModels, streamedModels, viewModels } from './model.js';
|
|
4
4
|
import { advancedScope, bootstrapOf, parseEnumeration, parseSiteBootstrap, refreshFrom, viewOf, } from './read.js';
|
|
@@ -158,7 +158,7 @@ export function createSiteAdapter(transport) {
|
|
|
158
158
|
return followsVersion(version, next);
|
|
159
159
|
},
|
|
160
160
|
async action(_authorization, request) {
|
|
161
|
-
if (request.name !==
|
|
161
|
+
if (request.name !== SITE_SUBMIT) {
|
|
162
162
|
return {
|
|
163
163
|
kind: 'rejected',
|
|
164
164
|
code: 'action-unimplemented',
|
|
@@ -168,7 +168,7 @@ export function createSiteAdapter(transport) {
|
|
|
168
168
|
}
|
|
169
169
|
if (!transport.online())
|
|
170
170
|
return UNCERTAIN;
|
|
171
|
-
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input),
|
|
171
|
+
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITE_SUBMIT);
|
|
172
172
|
},
|
|
173
173
|
roomStream: {
|
|
174
174
|
hold(rooms) {
|
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,EAIL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,EAEpB,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,CAAC;AAE/D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,C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OAAO,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CA8EhB;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;;IACd,SAAS;EAEZ;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;AA4BD,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,CAyDf"}
|
package/dist/write.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { departure, } from '@agentshouse/mdruntime';
|
|
2
|
-
import { headChange } from './read.js';
|
|
2
|
+
import { binaryFileOf, headChange } 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';
|
|
@@ -158,7 +158,8 @@ function material(value, handle) {
|
|
|
158
158
|
return null;
|
|
159
159
|
if (file.revision !== null && file.revision !== undefined && typeof file.revision !== 'string')
|
|
160
160
|
return null;
|
|
161
|
-
|
|
161
|
+
const binary = binaryFileOf(file);
|
|
162
|
+
if (binary === null)
|
|
162
163
|
return null;
|
|
163
164
|
const head = headChange(file);
|
|
164
165
|
if (head === null)
|
|
@@ -174,7 +175,7 @@ function material(value, handle) {
|
|
|
174
175
|
path,
|
|
175
176
|
content: file.content,
|
|
176
177
|
revision: typeof file.revision === 'string' ? file.revision : null,
|
|
177
|
-
|
|
178
|
+
...(binary === undefined ? {} : { binary }),
|
|
178
179
|
...(head === undefined ? {} : { head }),
|
|
179
180
|
});
|
|
180
181
|
}
|
|
@@ -248,7 +249,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
248
249
|
const documents = {};
|
|
249
250
|
const revisions = {};
|
|
250
251
|
const changes = {};
|
|
251
|
-
const
|
|
252
|
+
const binaryFiles = {};
|
|
252
253
|
const removals = [];
|
|
253
254
|
for (const entry of contents) {
|
|
254
255
|
if (entry.revision === null) {
|
|
@@ -257,8 +258,8 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
257
258
|
}
|
|
258
259
|
if (entry.content !== null)
|
|
259
260
|
documents[entry.path] = entry.content;
|
|
260
|
-
if (entry.
|
|
261
|
-
|
|
261
|
+
if (entry.binary !== undefined)
|
|
262
|
+
binaryFiles[entry.path] = entry.binary;
|
|
262
263
|
revisions[entry.path] = entry.revision;
|
|
263
264
|
if (entry.head !== undefined)
|
|
264
265
|
changes[entry.path] = entry.head;
|
|
@@ -270,7 +271,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
270
271
|
revisions,
|
|
271
272
|
changes,
|
|
272
273
|
removals: removals.sort(),
|
|
273
|
-
...(Object.keys(
|
|
274
|
+
...(Object.keys(binaryFiles).length === 0 ? {} : { binaryFiles }),
|
|
274
275
|
};
|
|
275
276
|
}
|
|
276
277
|
export function rejectedMapping(mapping) {
|
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-ca3a44982cbe7",
|
|
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-c6e675bb19980",
|
|
29
|
+
"@agentshouse/mdruntime": "0.1.0-c8ca66ac9e99d"
|
|
30
30
|
}
|
|
31
31
|
}
|