@agentshouse/mdruntime-adapter 0.1.0-cc449e4611fbd → 0.1.0-cc65657e82614
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/README.md +2 -2
- package/dist/actions.d.ts +2 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +15 -3
- package/dist/adapter.d.ts +0 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +72 -88
- package/dist/app-reference.d.ts +0 -1
- package/dist/authored-path.d.ts +10 -0
- package/dist/authored-path.d.ts.map +1 -0
- package/dist/authored-path.js +35 -0
- package/dist/chunks.d.ts +37 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +247 -0
- package/dist/crockford.d.ts +0 -1
- package/dist/digest.d.ts +0 -1
- package/dist/discovery.d.ts +11 -6
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +39 -13
- package/dist/history.d.ts +1 -7
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +19 -27
- package/dist/house-model.d.ts +252 -314
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +234 -251
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/map.d.ts +0 -1
- package/dist/model.d.ts +5 -8
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +30 -18
- package/dist/read.d.ts +19 -14
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +46 -169
- package/dist/refusal.d.ts +1 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -1
- package/dist/room-types.d.ts +0 -3
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +50 -40
- package/dist/search.d.ts +0 -1
- package/dist/search.js +1 -1
- package/dist/session-content/bounds.d.ts +7 -0
- package/dist/session-content/check.d.ts +18 -0
- package/dist/session-content/index.d.ts +7 -0
- package/dist/session-content/parts.d.ts +102 -0
- package/dist/session-content/state.d.ts +61 -0
- package/dist/session-content/turn.d.ts +328 -0
- package/dist/site.d.ts +0 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +38 -50
- package/dist/space-schema.d.ts +6 -0
- package/dist/space-schema.d.ts.map +1 -0
- package/dist/space-schema.js +18 -0
- package/dist/stream.d.ts +6 -5
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +131 -42
- package/dist/transport.d.ts +24 -23
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +13 -14
- package/dist/upload.d.ts +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/write.d.ts +0 -2
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +4 -11
- package/package.json +2 -2
- package/dist/part.d.ts +0 -14
- package/dist/part.d.ts.map +0 -1
- package/dist/part.js +0 -90
- package/dist/room-stream.d.ts +0 -20
- package/dist/room-stream.d.ts.map +0 -1
- package/dist/room-stream.js +0 -78
package/dist/stream.js
CHANGED
|
@@ -1,22 +1,42 @@
|
|
|
1
1
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
|
-
import { acceptedMessage,
|
|
3
|
-
import { streamedModels } from './model.js';
|
|
4
|
-
import { answered, answering, binaryFileOf, folded, forgotten, headChange,
|
|
2
|
+
import { acceptedMessage, changeCursor, houseHistory } from './history.js';
|
|
3
|
+
import { keptSpaceSchemas, streamedModels } from './model.js';
|
|
4
|
+
import { answered, answering, binaryFileOf, createdOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
5
|
+
import { classifyDoor } from './refusal.js';
|
|
5
6
|
import { houseDoorRoute, } from './transport.js';
|
|
6
|
-
import { DECIMAL, roomVersion } from './version.js';
|
|
7
|
+
import { DECIMAL, logPosition, presented, roomVersion } from './version.js';
|
|
7
8
|
function turnOperation(frame) {
|
|
8
|
-
|
|
9
|
-
return structuredClone(operation);
|
|
9
|
+
return 'at' in frame ? { op: 'begin', at: frame.at } : structuredClone(frame.operation);
|
|
10
10
|
}
|
|
11
11
|
async function houseAgents(transport) {
|
|
12
|
-
const answer = await transport.door(houseDoorRoute('agents/
|
|
12
|
+
const answer = await transport.door(houseDoorRoute('agents/list'), {});
|
|
13
|
+
if (classifyDoor(answer.status, answer.body, 'agents/list')?.kind === 'transport-uncertainty') {
|
|
14
|
+
throw new Error();
|
|
15
|
+
}
|
|
13
16
|
const agents = answer.status === 200 ? answer.body?.agents : null;
|
|
14
17
|
if (!Array.isArray(agents))
|
|
15
18
|
return null;
|
|
16
19
|
return agents.flatMap((one) => {
|
|
17
|
-
const { id, name, retired_at: retired } = (one ?? {});
|
|
18
|
-
return typeof id === 'string' &&
|
|
19
|
-
|
|
20
|
+
const { id, name, cli, environment, environment_name: environmentName, environment_connected: connected, retired_at: retired, } = (one ?? {});
|
|
21
|
+
return typeof id === 'string' &&
|
|
22
|
+
typeof name === 'string' &&
|
|
23
|
+
typeof cli === 'string' &&
|
|
24
|
+
typeof environment === 'string' &&
|
|
25
|
+
typeof environmentName === 'string' &&
|
|
26
|
+
typeof connected === 'boolean'
|
|
27
|
+
? [
|
|
28
|
+
{
|
|
29
|
+
agent: id,
|
|
30
|
+
name,
|
|
31
|
+
retired: retired !== null && retired !== undefined,
|
|
32
|
+
cli,
|
|
33
|
+
environment: {
|
|
34
|
+
identity: environment,
|
|
35
|
+
name: environmentName,
|
|
36
|
+
state: connected ? 'online' : 'offline',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
]
|
|
20
40
|
: [];
|
|
21
41
|
});
|
|
22
42
|
}
|
|
@@ -31,7 +51,8 @@ function listedConversation(listed) {
|
|
|
31
51
|
finished: listed.finished_at,
|
|
32
52
|
outcome: listed.outcome,
|
|
33
53
|
waiting: listed.waiting,
|
|
34
|
-
newest: listed.newest === null ? null :
|
|
54
|
+
newest: listed.newest === null ? null : changeCursor(listed.newest),
|
|
55
|
+
processEnded: listed.process_ended_at,
|
|
35
56
|
};
|
|
36
57
|
}
|
|
37
58
|
function position(value) {
|
|
@@ -50,52 +71,64 @@ function* changed(tracked, entries, version, schemas) {
|
|
|
50
71
|
if (entry.path === tracked.schema)
|
|
51
72
|
schemas.set(entry.path, entry);
|
|
52
73
|
forgotten(answer, entry.path);
|
|
74
|
+
if (entry.space !== undefined) {
|
|
75
|
+
answer.removals.add(entry.path);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
53
78
|
if (entry.kind === 'removed') {
|
|
54
79
|
answer.removals.add(entry.path);
|
|
55
80
|
continue;
|
|
56
81
|
}
|
|
57
82
|
const binary = binaryFileOf(entry);
|
|
58
|
-
|
|
59
|
-
if (binary !== undefined) {
|
|
60
|
-
if (binary !== null)
|
|
61
|
-
answer.binaryFiles.set(entry.path, binary);
|
|
62
|
-
}
|
|
63
|
-
else if (outline !== undefined && outline !== null)
|
|
64
|
-
answer.outlines.set(entry.path, outline);
|
|
65
|
-
else
|
|
83
|
+
if (binary === undefined)
|
|
66
84
|
answer.documents.set(entry.path, entry.text ?? '');
|
|
67
|
-
|
|
85
|
+
else if (binary !== null)
|
|
86
|
+
answer.binaryFiles.set(entry.path, binary);
|
|
87
|
+
if (binary === undefined && entry.facts !== undefined)
|
|
88
|
+
answer.facts.set(entry.path, entry.facts);
|
|
89
|
+
const revision = entry.revision ?? binary?.sha256;
|
|
68
90
|
if (revision !== undefined)
|
|
69
91
|
revised(answer, entry.path, revision);
|
|
70
92
|
const head = headChange(entry);
|
|
71
93
|
if (head)
|
|
72
94
|
answer.changes.set(entry.path, head);
|
|
95
|
+
const created = createdOf(entry);
|
|
96
|
+
if (created)
|
|
97
|
+
answer.created.set(entry.path, created);
|
|
73
98
|
}
|
|
74
99
|
return { kind: 'net-advancement', roomVersion: version, ...(yield* answered(answer)) };
|
|
75
100
|
}
|
|
76
|
-
async function changePage(tracked, entries, version, mode) {
|
|
101
|
+
async function changePage(tracked, entries, version, mode, spaces, whole) {
|
|
77
102
|
const schemas = new Map();
|
|
78
103
|
const page = await stepped(changed(tracked, entries, version, schemas));
|
|
79
|
-
const models = await streamedModels(schemas, tracked, mode);
|
|
104
|
+
const models = await streamedModels(schemas, tracked, mode, spaces, whole);
|
|
80
105
|
return models === undefined ? page : { ...page, models };
|
|
81
106
|
}
|
|
82
|
-
export function houseNotifications(transport, mode, discovering) {
|
|
107
|
+
export function houseNotifications(transport, mode, discovering, spaces) {
|
|
83
108
|
const stream = transport.stream;
|
|
84
109
|
const staged = new Map();
|
|
85
110
|
let socket = null;
|
|
86
111
|
const tracking = new Map();
|
|
87
112
|
const observers = new Set();
|
|
113
|
+
const replaying = new Map();
|
|
88
114
|
const conversationObservers = new Set();
|
|
89
115
|
const modeObservers = new Set();
|
|
90
116
|
let replicated = [];
|
|
91
117
|
let listedCursor = null;
|
|
118
|
+
const unanswered = [];
|
|
119
|
+
const heldAtZero = new Set();
|
|
92
120
|
const live = new Set();
|
|
93
121
|
let opening = null;
|
|
94
122
|
let announced = null;
|
|
95
123
|
const runtime = crypto.randomUUID();
|
|
96
124
|
function emit(event) {
|
|
97
|
-
for (const observer of observers)
|
|
98
|
-
observer
|
|
125
|
+
for (const observer of observers) {
|
|
126
|
+
const held = replaying.get(observer);
|
|
127
|
+
if (held === undefined)
|
|
128
|
+
observer(event);
|
|
129
|
+
else
|
|
130
|
+
held.push(event);
|
|
131
|
+
}
|
|
99
132
|
}
|
|
100
133
|
function emitConversation(event) {
|
|
101
134
|
if (event.kind === 'turn' ||
|
|
@@ -104,7 +137,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
104
137
|
event.kind === 'commands' ||
|
|
105
138
|
event.kind === 'options' ||
|
|
106
139
|
event.kind === 'starting' ||
|
|
107
|
-
event.kind === '
|
|
140
|
+
event.kind === 'state' ||
|
|
108
141
|
event.kind === 'link' ||
|
|
109
142
|
event.kind === 'deliveries') {
|
|
110
143
|
live.add(event.conversation);
|
|
@@ -117,6 +150,8 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
117
150
|
announced = null;
|
|
118
151
|
socket = next;
|
|
119
152
|
staged.clear();
|
|
153
|
+
unanswered.length = 0;
|
|
154
|
+
heldAtZero.clear();
|
|
120
155
|
const gapped = new Set([...replicated, ...live]);
|
|
121
156
|
live.clear();
|
|
122
157
|
for (const conversation of gapped)
|
|
@@ -157,7 +192,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
157
192
|
return;
|
|
158
193
|
emitConversation({ kind: 'commands', conversation, commands: [] });
|
|
159
194
|
emitConversation({ kind: 'options', conversation, options: [] });
|
|
160
|
-
emitConversation({ kind: '
|
|
195
|
+
emitConversation({ kind: 'state', conversation, state: null });
|
|
161
196
|
return;
|
|
162
197
|
}
|
|
163
198
|
if (frame.type === 'commands') {
|
|
@@ -176,12 +211,8 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
176
211
|
emitConversation({ kind: 'starting', conversation, step: frame.step });
|
|
177
212
|
return;
|
|
178
213
|
}
|
|
179
|
-
if (frame.type === '
|
|
180
|
-
emitConversation({
|
|
181
|
-
kind: 'subagents',
|
|
182
|
-
conversation,
|
|
183
|
-
subagents: structuredClone(frame.subagents),
|
|
184
|
-
});
|
|
214
|
+
if (frame.type === 'state') {
|
|
215
|
+
emitConversation({ kind: 'state', conversation, state: structuredClone(frame.state) });
|
|
185
216
|
return;
|
|
186
217
|
}
|
|
187
218
|
if (frame.type === 'link') {
|
|
@@ -189,7 +220,12 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
189
220
|
return;
|
|
190
221
|
}
|
|
191
222
|
if (frame.type === 'deliveries') {
|
|
192
|
-
emitConversation({
|
|
223
|
+
emitConversation({
|
|
224
|
+
kind: 'deliveries',
|
|
225
|
+
conversation,
|
|
226
|
+
waiting: [...frame.waiting],
|
|
227
|
+
unknown: [...frame.unknown],
|
|
228
|
+
});
|
|
193
229
|
return;
|
|
194
230
|
}
|
|
195
231
|
if (frame.type === 'interactions') {
|
|
@@ -218,6 +254,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
218
254
|
}
|
|
219
255
|
}
|
|
220
256
|
const next = held ?? { authority: frame.authority, parts: 0, entries: [] };
|
|
257
|
+
keptSpaceSchemas(frame.entries, spaces);
|
|
221
258
|
next.entries.push(...frame.entries);
|
|
222
259
|
next.parts += 1;
|
|
223
260
|
staged.set(frame.carry, next);
|
|
@@ -245,9 +282,13 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
245
282
|
return;
|
|
246
283
|
}
|
|
247
284
|
if (frame.type === 'caught_up') {
|
|
285
|
+
discovering.expired?.(frame.expired);
|
|
248
286
|
emit({
|
|
249
287
|
kind: 'caught-up',
|
|
250
|
-
expired:
|
|
288
|
+
expired: [
|
|
289
|
+
...frame.expired.flatMap((authority) => (tracking.get(authority) ?? []).map((tracked) => tracked.locator)),
|
|
290
|
+
...(unanswered.shift() ?? []),
|
|
291
|
+
],
|
|
251
292
|
});
|
|
252
293
|
return;
|
|
253
294
|
}
|
|
@@ -280,7 +321,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
280
321
|
frame.type === 'commands' ||
|
|
281
322
|
frame.type === 'options' ||
|
|
282
323
|
frame.type === 'starting' ||
|
|
283
|
-
frame.type === '
|
|
324
|
+
frame.type === 'state' ||
|
|
284
325
|
frame.type === 'link' ||
|
|
285
326
|
frame.type === 'deliveries' ||
|
|
286
327
|
frame.type === 'interactions' ||
|
|
@@ -298,7 +339,9 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
298
339
|
const after = position(frame.after);
|
|
299
340
|
if (at === null || after === null || after >= at)
|
|
300
341
|
return;
|
|
301
|
-
const from =
|
|
342
|
+
const from = after === 0n && !heldAtZero.has(frame.authority)
|
|
343
|
+
? null
|
|
344
|
+
: roomVersion({ position: frame.after, logEpoch: frame.log_epoch });
|
|
302
345
|
const version = roomVersion({ position: frame.position, logEpoch: frame.log_epoch });
|
|
303
346
|
for (const tracked of tracking.get(frame.authority) ?? []) {
|
|
304
347
|
emit({
|
|
@@ -306,7 +349,7 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
306
349
|
locator: tracked.locator,
|
|
307
350
|
from,
|
|
308
351
|
roomVersion: version,
|
|
309
|
-
read: () => changePage(tracked, entries, version, mode),
|
|
352
|
+
read: () => changePage(tracked, entries, version, mode, spaces, from === null),
|
|
310
353
|
});
|
|
311
354
|
}
|
|
312
355
|
}
|
|
@@ -317,6 +360,8 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
317
360
|
announced = null;
|
|
318
361
|
socket = null;
|
|
319
362
|
staged.clear();
|
|
363
|
+
unanswered.length = 0;
|
|
364
|
+
heldAtZero.clear();
|
|
320
365
|
emit({ kind: 'closed', revoked, lost, authorityChanged });
|
|
321
366
|
});
|
|
322
367
|
return {
|
|
@@ -351,11 +396,15 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
351
396
|
},
|
|
352
397
|
observe(notify) {
|
|
353
398
|
observers.add(notify);
|
|
354
|
-
|
|
355
|
-
|
|
399
|
+
if (opening !== null) {
|
|
400
|
+
const replayed = [{ kind: 'opened' }];
|
|
401
|
+
if (announced !== null)
|
|
402
|
+
replayed.push(announced);
|
|
403
|
+
replaying.set(notify, replayed);
|
|
356
404
|
queueMicrotask(() => {
|
|
405
|
+
replaying.delete(notify);
|
|
357
406
|
for (const event of replayed)
|
|
358
|
-
if (
|
|
407
|
+
if (observers.has(notify))
|
|
359
408
|
notify(event);
|
|
360
409
|
});
|
|
361
410
|
}
|
|
@@ -366,7 +415,47 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
366
415
|
send(rooms) {
|
|
367
416
|
opening = null;
|
|
368
417
|
announced = null;
|
|
369
|
-
socket
|
|
418
|
+
if (socket === null)
|
|
419
|
+
return;
|
|
420
|
+
const entries = new Map([...tracking.values()].flat().map((tracked) => [tracked.locator, tracked]));
|
|
421
|
+
const named = rooms.flatMap((room) => {
|
|
422
|
+
const entry = entries.get(room.locator);
|
|
423
|
+
const at = room.roomVersion === null ? null : logPosition(room.roomVersion);
|
|
424
|
+
return entry === undefined || at === null ? [] : [{ entry, at }];
|
|
425
|
+
});
|
|
426
|
+
const unheld = rooms.flatMap((room) => {
|
|
427
|
+
const entry = entries.get(room.locator);
|
|
428
|
+
return entry === undefined || room.roomVersion !== null ? [] : [entry];
|
|
429
|
+
});
|
|
430
|
+
for (const { entry, at } of named) {
|
|
431
|
+
if (at.position === '0')
|
|
432
|
+
heldAtZero.add(entry.authority);
|
|
433
|
+
else
|
|
434
|
+
heldAtZero.delete(entry.authority);
|
|
435
|
+
}
|
|
436
|
+
for (const entry of unheld)
|
|
437
|
+
heldAtZero.delete(entry.authority);
|
|
438
|
+
const site = mode === 'site';
|
|
439
|
+
unanswered.push(site ? unheld.map((entry) => entry.locator) : []);
|
|
440
|
+
socket.hold([
|
|
441
|
+
...named.map(({ entry, at }) => presented(entry.authority, at)),
|
|
442
|
+
...(site ? [] : unheld).map((entry) => presented(entry.authority, { position: '0', logEpoch: entry.logEpoch })),
|
|
443
|
+
], runtime, listedCursor);
|
|
444
|
+
if (site)
|
|
445
|
+
return;
|
|
446
|
+
const made = unheld.filter((entry) => entry.position === '0');
|
|
447
|
+
queueMicrotask(() => {
|
|
448
|
+
for (const entry of made) {
|
|
449
|
+
const version = roomVersion(entry);
|
|
450
|
+
emit({
|
|
451
|
+
kind: 'room-change',
|
|
452
|
+
locator: entry.locator,
|
|
453
|
+
from: null,
|
|
454
|
+
roomVersion: version,
|
|
455
|
+
read: () => changePage(entry, [], version, mode, spaces, true),
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
});
|
|
370
459
|
},
|
|
371
460
|
track(entries) {
|
|
372
461
|
tracking.clear();
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { ConversationEvent,
|
|
1
|
+
import type { ConversationEvent, SavedFacts } from '@agentshouse/mdruntime';
|
|
2
|
+
import type { Operation, SessionState } from './session-content/index.js';
|
|
2
3
|
export declare const HOUSE_RUNTIME_READS: {
|
|
3
|
-
readonly acts: readonly ['account/push', 'agents/
|
|
4
|
-
readonly frames: readonly ['app-message', '
|
|
4
|
+
readonly acts: readonly ['account/push/set', 'agents/list', 'apps/features/set', 'apps/source/download', 'apps/source/top/read', 'conversations/history/list', 'files/attach', 'files/batch', 'files/batch-upload', 'files/finish', 'files/read', 'files/revisions/list', 'room-chunks/list', 'rooms/discover', 'rooms/search', 'sites/screenshot/read'];
|
|
5
|
+
readonly frames: readonly ['app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'link', 'message', 'opening', 'options', 'part', 'process', 'received', 'signal', 'site', 'starting', 'state', 'tab-icon', 'turn'];
|
|
5
6
|
};
|
|
6
7
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
7
8
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
8
9
|
export declare function houseDoorRoute(act: HouseRuntimeAct): string;
|
|
9
|
-
export declare function houseSiteRoute(act:
|
|
10
|
-
export declare const
|
|
10
|
+
export declare function houseSiteRoute(act: 'chunks' | 'discover'): string;
|
|
11
|
+
export declare const SITES_SUBMISSIONS_CREATE = "sites/submissions/create";
|
|
11
12
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
12
13
|
export type HouseMode = 'credential' | 'site';
|
|
13
14
|
export type HouseDoorAnswer = {
|
|
@@ -15,14 +16,12 @@ export type HouseDoorAnswer = {
|
|
|
15
16
|
body: unknown;
|
|
16
17
|
};
|
|
17
18
|
export declare const SITE_FILES = "/_house/files/";
|
|
18
|
-
export type HouseByteAct = 'authored_batch_upload';
|
|
19
19
|
export type HouseBytesAnswer = {
|
|
20
20
|
status: number;
|
|
21
21
|
body: ReadableStream<Uint8Array> | null;
|
|
22
22
|
mediaType: string;
|
|
23
23
|
};
|
|
24
24
|
export type HouseByteTransfer = {
|
|
25
|
-
act: HouseByteAct;
|
|
26
25
|
url: string;
|
|
27
26
|
body: string;
|
|
28
27
|
};
|
|
@@ -33,7 +32,6 @@ export type HouseStreamEntry = {
|
|
|
33
32
|
revision?: string;
|
|
34
33
|
sha256?: string;
|
|
35
34
|
text?: string;
|
|
36
|
-
outline?: unknown;
|
|
37
35
|
bytes?: number;
|
|
38
36
|
media_type?: string;
|
|
39
37
|
author?: {
|
|
@@ -43,7 +41,10 @@ export type HouseStreamEntry = {
|
|
|
43
41
|
site: string;
|
|
44
42
|
name: string;
|
|
45
43
|
};
|
|
44
|
+
changed_at?: string;
|
|
46
45
|
created_at?: string;
|
|
46
|
+
facts?: SavedFacts;
|
|
47
|
+
space?: string;
|
|
47
48
|
};
|
|
48
49
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
49
50
|
kind: K;
|
|
@@ -58,10 +59,8 @@ export type HouseListedConversation = {
|
|
|
58
59
|
finished_at: string | null;
|
|
59
60
|
outcome: string | null;
|
|
60
61
|
waiting: boolean;
|
|
61
|
-
newest:
|
|
62
|
-
|
|
63
|
-
message_id: string;
|
|
64
|
-
} | null;
|
|
62
|
+
newest: number | null;
|
|
63
|
+
process_ended_at: string | null;
|
|
65
64
|
};
|
|
66
65
|
type Listed<Frame extends {
|
|
67
66
|
readonly type: HouseRuntimeFrame;
|
|
@@ -85,7 +84,8 @@ export type HouseStreamFrame = Listed<{
|
|
|
85
84
|
member: unknown;
|
|
86
85
|
bounds: unknown;
|
|
87
86
|
actions: readonly unknown[];
|
|
88
|
-
|
|
87
|
+
shapes: readonly unknown[];
|
|
88
|
+
rooms: readonly unknown[];
|
|
89
89
|
} | {
|
|
90
90
|
type: 'caught_up';
|
|
91
91
|
expired: readonly string[];
|
|
@@ -94,11 +94,17 @@ export type HouseStreamFrame = Listed<{
|
|
|
94
94
|
member: unknown;
|
|
95
95
|
authorities: readonly unknown[];
|
|
96
96
|
left: readonly string[];
|
|
97
|
-
} |
|
|
97
|
+
} | {
|
|
98
|
+
type: 'turn';
|
|
99
|
+
conversation_id: string;
|
|
100
|
+
turn_id: string;
|
|
101
|
+
at: string;
|
|
102
|
+
} | {
|
|
98
103
|
type: 'turn';
|
|
99
104
|
conversation_id: string;
|
|
100
105
|
turn_id: string;
|
|
101
|
-
|
|
106
|
+
operation: Operation;
|
|
107
|
+
} | {
|
|
102
108
|
type: 'message';
|
|
103
109
|
conversation_id: string;
|
|
104
110
|
message: unknown;
|
|
@@ -109,6 +115,7 @@ export type HouseStreamFrame = Listed<{
|
|
|
109
115
|
} | {
|
|
110
116
|
type: 'deliveries';
|
|
111
117
|
conversation_id: string;
|
|
118
|
+
waiting: readonly string[];
|
|
112
119
|
unknown: readonly string[];
|
|
113
120
|
} | {
|
|
114
121
|
type: 'process';
|
|
@@ -127,9 +134,9 @@ export type HouseStreamFrame = Listed<{
|
|
|
127
134
|
conversation_id: string;
|
|
128
135
|
step: string | null;
|
|
129
136
|
} | {
|
|
130
|
-
type: '
|
|
137
|
+
type: 'state';
|
|
131
138
|
conversation_id: string;
|
|
132
|
-
|
|
139
|
+
state: SessionState;
|
|
133
140
|
} | {
|
|
134
141
|
type: 'link';
|
|
135
142
|
conversation_id: string;
|
|
@@ -170,15 +177,11 @@ export type HouseStream = {
|
|
|
170
177
|
opened(notify: (opening: HouseOpening) => void): () => void;
|
|
171
178
|
closed(notify: (closing: HouseClosing) => void): () => void;
|
|
172
179
|
};
|
|
173
|
-
export type HouseStreamed = HouseDoorAnswer & {
|
|
174
|
-
room: ReadableStream<Uint8Array> | null;
|
|
175
|
-
};
|
|
176
180
|
export type HouseDoor = {
|
|
177
181
|
door(route: string, body: unknown): Promise<HouseDoorAnswer>;
|
|
178
182
|
stream: HouseStream;
|
|
179
183
|
};
|
|
180
184
|
export type HouseTransport = HouseDoor & {
|
|
181
|
-
streamed(route: string, body: unknown, signal: AbortSignal): Promise<HouseStreamed>;
|
|
182
185
|
transfer(request: HouseByteTransfer): Promise<HouseDoorAnswer>;
|
|
183
186
|
put(url: string, body: Blob, headers: Readonly<Record<string, string>>): Promise<number>;
|
|
184
187
|
download(url: string): Promise<HouseBytesAnswer>;
|
|
@@ -186,8 +189,6 @@ export type HouseTransport = HouseDoor & {
|
|
|
186
189
|
export type HouseSiteTransport = HouseDoor & {
|
|
187
190
|
online(): boolean;
|
|
188
191
|
read(route: string): Promise<HouseDoorAnswer>;
|
|
189
|
-
streamed(route: string, signal: AbortSignal): Promise<HouseStreamed>;
|
|
190
192
|
download(route: string): Promise<HouseBytesAnswer>;
|
|
191
193
|
};
|
|
192
194
|
export {};
|
|
193
|
-
//# sourceMappingURL=transport.d.ts.map
|
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,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,uBAAuB;aAEzB,MAAM,YACJ,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,MA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AC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD,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;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
|
package/dist/transport.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
export const HOUSE_RUNTIME_READS = {
|
|
2
2
|
acts: [
|
|
3
|
-
'account/push',
|
|
4
|
-
'agents/
|
|
3
|
+
'account/push/set',
|
|
4
|
+
'agents/list',
|
|
5
5
|
'apps/features/set',
|
|
6
6
|
'apps/source/download',
|
|
7
|
-
'apps/source/top',
|
|
8
|
-
'
|
|
9
|
-
'batch-upload',
|
|
10
|
-
'bootstrap',
|
|
11
|
-
'conversations/history',
|
|
12
|
-
'discover',
|
|
7
|
+
'apps/source/top/read',
|
|
8
|
+
'conversations/history/list',
|
|
13
9
|
'files/attach',
|
|
10
|
+
'files/batch',
|
|
11
|
+
'files/batch-upload',
|
|
14
12
|
'files/finish',
|
|
15
|
-
'files/
|
|
16
|
-
'revisions',
|
|
17
|
-
'
|
|
13
|
+
'files/read',
|
|
14
|
+
'files/revisions/list',
|
|
15
|
+
'room-chunks/list',
|
|
16
|
+
'rooms/discover',
|
|
17
|
+
'rooms/search',
|
|
18
18
|
'sites/screenshot/read',
|
|
19
19
|
],
|
|
20
20
|
frames: [
|
|
21
21
|
'app-message',
|
|
22
|
-
'app-release',
|
|
23
22
|
'authority_changed',
|
|
24
23
|
'carried',
|
|
25
24
|
'caught_up',
|
|
@@ -41,7 +40,7 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
41
40
|
'signal',
|
|
42
41
|
'site',
|
|
43
42
|
'starting',
|
|
44
|
-
'
|
|
43
|
+
'state',
|
|
45
44
|
'tab-icon',
|
|
46
45
|
'turn',
|
|
47
46
|
],
|
|
@@ -52,6 +51,6 @@ export function houseDoorRoute(act) {
|
|
|
52
51
|
export function houseSiteRoute(act) {
|
|
53
52
|
return `/_house/door/${act}`;
|
|
54
53
|
}
|
|
55
|
-
export const
|
|
54
|
+
export const SITES_SUBMISSIONS_CREATE = 'sites/submissions/create';
|
|
56
55
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
57
56
|
export const SITE_FILES = '/_house/files/';
|
package/dist/upload.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export type HouseUpload = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
11
11
|
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | null>;
|
|
12
|
-
//# sourceMappingURL=upload.d.ts.map
|
package/dist/version.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export declare function presented(authority: string, at: LogPosition): Presented
|
|
|
14
14
|
export declare const DECIMAL: RegExp;
|
|
15
15
|
export declare function reachedVersion(roomVersion: string, target: string, currentEpoch: string | undefined): boolean;
|
|
16
16
|
export declare function followsVersion(roomVersion: string, next: string): boolean;
|
|
17
|
-
//# sourceMappingURL=version.d.ts.map
|
package/dist/write.d.ts
CHANGED
|
@@ -56,7 +56,5 @@ export declare function revisionBody(input: {
|
|
|
56
56
|
pageToken?: string;
|
|
57
57
|
}): Record<string, unknown>;
|
|
58
58
|
export declare function historyOutcome(status: number, body: unknown, locator: string, request: {
|
|
59
|
-
path: string;
|
|
60
59
|
revision?: string;
|
|
61
60
|
}): HistoryResult;
|
|
62
|
-
//# sourceMappingURL=write.d.ts.map
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
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,CAM1B;AA6BD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7B,aAAa,CA+Cf"}
|
package/dist/write.js
CHANGED
|
@@ -2,7 +2,7 @@ import { departure, partsChanges, ROW_WEIGHT, } from '@agentshouse/mdruntime';
|
|
|
2
2
|
import { answered, answering, binaryFileOf, headChange, revised } from './read.js';
|
|
3
3
|
import { sha256Hex, textBytes } from './digest.js';
|
|
4
4
|
import { nativePath, roomLocalPath } from './map.js';
|
|
5
|
-
import { classifyDoor, doorRefusal, scopedRefusal } from './refusal.js';
|
|
5
|
+
import { classifyDoor, doorRefusal, resetOf, scopedRefusal } from './refusal.js';
|
|
6
6
|
import { readPosition, roomVersion } from './version.js';
|
|
7
7
|
function priorField(batch, path, name) {
|
|
8
8
|
return batch.preconditions.find((precondition) => precondition.kind === 'field' && precondition.path === path && precondition.name === name);
|
|
@@ -230,7 +230,7 @@ function* acceptedOf(at, contents) {
|
|
|
230
230
|
answer.changes.set(entry.path, entry.head);
|
|
231
231
|
}
|
|
232
232
|
const unbinaried = answer.binaryFiles.size === 0;
|
|
233
|
-
const { binaryFiles, ...room } = yield* answered(answer);
|
|
233
|
+
const { binaryFiles, facts: _facts, ...room } = yield* answered(answer);
|
|
234
234
|
return { roomVersion: roomVersion(at), ...room, ...(unbinaried ? {} : { binaryFiles }) };
|
|
235
235
|
}
|
|
236
236
|
function* movedOutcome(held, move) {
|
|
@@ -261,11 +261,6 @@ export function* mutationOutcome(status, body, locator, handle, move) {
|
|
|
261
261
|
if (refusal !== null && refusal.code === 'service_mode_write_halted') {
|
|
262
262
|
return { kind: 'write-halted' };
|
|
263
263
|
}
|
|
264
|
-
if (refusal !== null && refusal.code === 'expired') {
|
|
265
|
-
return refusal.fields.restored === true
|
|
266
|
-
? { kind: 'expired', restored: true }
|
|
267
|
-
: { kind: 'expired' };
|
|
268
|
-
}
|
|
269
264
|
if (refusal !== null && refusal.code === 'edit_conflict') {
|
|
270
265
|
const { current, ...fields } = refusal.fields;
|
|
271
266
|
const held = (yield* material(current, handle)) ?? [];
|
|
@@ -281,10 +276,8 @@ export function* mutationOutcome(status, body, locator, handle, move) {
|
|
|
281
276
|
return scopedRefusal(locator, 'undisclosed', refusal);
|
|
282
277
|
}
|
|
283
278
|
const classified = classifyDoor(status, body, locator);
|
|
284
|
-
const reset = refusal
|
|
285
|
-
if (refusal?.
|
|
286
|
-
typeof reset === 'string' &&
|
|
287
|
-
classified?.kind === 'transport-uncertainty') {
|
|
279
|
+
const reset = resetOf(refusal);
|
|
280
|
+
if (refusal !== null && reset !== undefined && classified?.kind === 'transport-uncertainty') {
|
|
288
281
|
return {
|
|
289
282
|
kind: 'retryable-refusal',
|
|
290
283
|
code: refusal.code,
|
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-cc65657e82614",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
27
|
+
"@agentshouse/mdruntime": "0.1.0-c806ecaf4afed"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|