@agentshouse/mdruntime-adapter 0.1.0-cd4aec0d43ce1 → 0.1.0-cd59e72d7f397
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 +1 -1
- package/dist/actions.d.ts +9 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +179 -5
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +108 -106
- package/dist/authored-path.d.ts +54 -2
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +142 -10
- package/dist/chunks.d.ts +1 -2
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +17 -28
- package/dist/discovery.d.ts +25 -5
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +169 -21
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/model.d.ts +5 -5
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -27
- package/dist/read.d.ts +11 -24
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +72 -45
- package/dist/refusal.d.ts +4 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +11 -0
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +20 -0
- package/dist/room-query.d.ts +4 -0
- package/dist/room-query.d.ts.map +1 -0
- package/dist/room-query.js +63 -0
- package/dist/session-content/check.d.ts +4 -2
- package/dist/session-content/index.d.ts +3 -4
- package/dist/session-content/parts.d.ts +14 -87
- package/dist/session-content/state.d.ts +21 -23
- package/dist/session-content/turn.d.ts +82 -258
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +44 -10
- package/dist/space-schema.d.ts +1 -1
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +2 -9
- package/dist/stream.d.ts +4 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +114 -53
- package/dist/transport.d.ts +62 -11
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +46 -8
- package/dist/upload.d.ts +4 -0
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +41 -0
- package/dist/write.d.ts +3 -8
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +72 -92
- package/package.json +4 -4
- package/dist/session-content/bounds.d.ts +0 -7
package/dist/stream.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
import { parse } from '@agentshouse/mdmodel';
|
|
1
2
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
3
|
import { acceptedMessage, changeCursor, houseHistory } from './history.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { spaceSchemaTexts, streamedModels } from './model.js';
|
|
5
|
+
import { spaceSchemas } from './space-schema.js';
|
|
6
|
+
import { answered, answering, documentEntry, folded, forgotten, kept, } from './read.js';
|
|
5
7
|
import { DECIMAL, logPosition, presented, roomVersion } from './version.js';
|
|
8
|
+
const CURRENT_RUN_STATES = new Set(['awaiting_approval', 'started']);
|
|
9
|
+
const NO_RUN_MARKS = { rooms: {}, sent: null };
|
|
10
|
+
function heardRun(request) {
|
|
11
|
+
const read = parse(`---\n${request.document}---\n`);
|
|
12
|
+
if (!read.ok)
|
|
13
|
+
throw new Error(`the stream carried request ${request.name} as no document`);
|
|
14
|
+
const fields = read.document.fields;
|
|
15
|
+
return {
|
|
16
|
+
room: request.room_ref,
|
|
17
|
+
name: request.name,
|
|
18
|
+
document: request.document,
|
|
19
|
+
current: CURRENT_RUN_STATES.has(fields.state),
|
|
20
|
+
starter: typeof fields.requester === 'string' ? fields.requester : null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
6
23
|
function turnOperation(frame) {
|
|
7
24
|
return 'at' in frame ? { op: 'begin', at: frame.at } : structuredClone(frame.operation);
|
|
8
25
|
}
|
|
@@ -18,9 +35,11 @@ function listedAgent(agent) {
|
|
|
18
35
|
cli: agent.cli,
|
|
19
36
|
model: agent.model,
|
|
20
37
|
effort: agent.effort,
|
|
38
|
+
model_fixed: agent.model_fixed,
|
|
21
39
|
mode: agent.mode,
|
|
22
40
|
base_instructions: agent.base_instructions,
|
|
23
41
|
in_telegram: agent.in_telegram,
|
|
42
|
+
telegram_messages: agent.telegram_messages,
|
|
24
43
|
created: agent.created,
|
|
25
44
|
retired_at: agent.retired_at,
|
|
26
45
|
};
|
|
@@ -31,12 +50,15 @@ function listedConversation(listed) {
|
|
|
31
50
|
agent: listed.agent_id,
|
|
32
51
|
name: listed.name,
|
|
33
52
|
created: listed.created_at,
|
|
34
|
-
finished: listed.finished_at,
|
|
35
53
|
outcome: listed.outcome,
|
|
36
54
|
waiting: listed.waiting,
|
|
37
55
|
newest: listed.newest === null ? null : changeCursor(listed.newest),
|
|
38
56
|
processEnded: listed.process_ended_at,
|
|
57
|
+
activity: listed.activity,
|
|
39
58
|
subject: listed.subject,
|
|
59
|
+
room: listed.room_ref,
|
|
60
|
+
model: listed.model,
|
|
61
|
+
effort: listed.effort,
|
|
40
62
|
};
|
|
41
63
|
}
|
|
42
64
|
function position(value) {
|
|
@@ -44,61 +66,55 @@ function position(value) {
|
|
|
44
66
|
return null;
|
|
45
67
|
return BigInt(value);
|
|
46
68
|
}
|
|
47
|
-
function* changed(tracked, entries, version, schemas) {
|
|
69
|
+
function* changed(tracked, entries, version, mode, schemas) {
|
|
48
70
|
const answer = answering();
|
|
49
71
|
for (const entry of entries) {
|
|
50
|
-
yield ROW_WEIGHT + (entry.
|
|
72
|
+
yield ROW_WEIGHT + (entry.content?.length ?? 0);
|
|
51
73
|
if (entry.kind === 'folder') {
|
|
52
74
|
folded(answer, entry.path, entry.removed === true);
|
|
53
75
|
continue;
|
|
54
76
|
}
|
|
55
|
-
if (entry.path === tracked.schema)
|
|
56
|
-
schemas.set(entry.path, entry);
|
|
57
|
-
forgotten(answer, entry.path);
|
|
58
|
-
if (entry.space !== undefined) {
|
|
59
|
-
answer.removals.add(entry.path);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
77
|
if (entry.kind === 'removed') {
|
|
78
|
+
if (entry.path === tracked.schema)
|
|
79
|
+
schemas.set(entry.path, null);
|
|
80
|
+
forgotten(answer, entry.path);
|
|
63
81
|
answer.removals.add(entry.path);
|
|
64
82
|
continue;
|
|
65
83
|
}
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const head = headChange(entry);
|
|
77
|
-
if (head)
|
|
78
|
-
answer.changes.set(entry.path, head);
|
|
79
|
-
const created = createdOf(entry);
|
|
80
|
-
if (created)
|
|
81
|
-
answer.created.set(entry.path, created);
|
|
84
|
+
const file = documentEntry(entry, mode);
|
|
85
|
+
if (file === null)
|
|
86
|
+
throw new Error(`the stream carried ${entry.path} as no file`);
|
|
87
|
+
if (entry.path === tracked.schema)
|
|
88
|
+
schemas.set(entry.path, file);
|
|
89
|
+
forgotten(answer, file.path);
|
|
90
|
+
if (file.space === undefined)
|
|
91
|
+
kept(answer, file);
|
|
92
|
+
else
|
|
93
|
+
answer.removals.add(file.path);
|
|
82
94
|
}
|
|
83
95
|
return { kind: 'net-advancement', roomVersion: version, ...(yield* answered(answer)) };
|
|
84
96
|
}
|
|
85
|
-
async function changePage(tracked, entries, version, mode,
|
|
97
|
+
async function changePage(tracked, entries, version, mode, whole) {
|
|
86
98
|
const schemas = new Map();
|
|
87
|
-
const page = await stepped(changed(tracked, entries, version, schemas));
|
|
88
|
-
const models = await streamedModels(schemas, tracked,
|
|
99
|
+
const page = await stepped(changed(tracked, entries, version, mode, schemas));
|
|
100
|
+
const models = await streamedModels(schemas, tracked, whole);
|
|
89
101
|
return models === undefined ? page : { ...page, models };
|
|
90
102
|
}
|
|
91
|
-
export function houseNotifications(transport, mode, discovering
|
|
103
|
+
export function houseNotifications(transport, mode, discovering) {
|
|
92
104
|
const stream = transport.stream;
|
|
93
105
|
const staged = new Map();
|
|
106
|
+
let spaces = spaceSchemas();
|
|
94
107
|
let socket = null;
|
|
95
108
|
const tracking = new Map();
|
|
109
|
+
const located = new Map();
|
|
96
110
|
const observers = new Set();
|
|
97
111
|
const replaying = new Map();
|
|
98
112
|
const conversationObservers = new Set();
|
|
113
|
+
const runObservers = new Set();
|
|
99
114
|
const modeObservers = new Set();
|
|
100
115
|
let replicated = [];
|
|
101
116
|
let listedCursor = null;
|
|
117
|
+
let runMarks = NO_RUN_MARKS;
|
|
102
118
|
const unanswered = [];
|
|
103
119
|
const heldAtZero = new Set();
|
|
104
120
|
const live = new Set();
|
|
@@ -114,6 +130,10 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
114
130
|
held.push(event);
|
|
115
131
|
}
|
|
116
132
|
}
|
|
133
|
+
function emitRun(event) {
|
|
134
|
+
for (const observer of runObservers)
|
|
135
|
+
observer(event);
|
|
136
|
+
}
|
|
117
137
|
function emitConversation(event) {
|
|
118
138
|
if (event.kind === 'turn' ||
|
|
119
139
|
event.kind === 'questions' ||
|
|
@@ -122,7 +142,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
122
142
|
event.kind === 'options' ||
|
|
123
143
|
event.kind === 'starting' ||
|
|
124
144
|
event.kind === 'state' ||
|
|
125
|
-
event.kind === 'link' ||
|
|
126
145
|
event.kind === 'deliveries') {
|
|
127
146
|
live.add(event.conversation);
|
|
128
147
|
}
|
|
@@ -134,6 +153,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
134
153
|
announced = null;
|
|
135
154
|
socket = next;
|
|
136
155
|
staged.clear();
|
|
156
|
+
spaces = spaceSchemas();
|
|
137
157
|
unanswered.length = 0;
|
|
138
158
|
heldAtZero.clear();
|
|
139
159
|
const gapped = new Set([...replicated, ...live]);
|
|
@@ -199,10 +219,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
199
219
|
emitConversation({ kind: 'state', conversation, state: structuredClone(frame.state) });
|
|
200
220
|
return;
|
|
201
221
|
}
|
|
202
|
-
if (frame.type === 'link') {
|
|
203
|
-
emitConversation({ kind: 'link', conversation, connected: frame.connected });
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
222
|
if (frame.type === 'deliveries') {
|
|
207
223
|
emitConversation({
|
|
208
224
|
kind: 'deliveries',
|
|
@@ -226,6 +242,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
226
242
|
emitConversation({ kind: 'accepted-message', conversation, message });
|
|
227
243
|
}
|
|
228
244
|
function stage(frame, via) {
|
|
245
|
+
const entries = spaceSchemaTexts(frame.entries, spaces);
|
|
229
246
|
const held = staged.get(frame.carry);
|
|
230
247
|
if (frame.index !== (held?.parts ?? 0)) {
|
|
231
248
|
staged.delete(frame.carry);
|
|
@@ -238,8 +255,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
238
255
|
}
|
|
239
256
|
}
|
|
240
257
|
const next = held ?? { authority: frame.authority, parts: 0, entries: [] };
|
|
241
|
-
|
|
242
|
-
next.entries.push(...frame.entries);
|
|
258
|
+
next.entries.push(...entries);
|
|
243
259
|
next.parts += 1;
|
|
244
260
|
staged.set(frame.carry, next);
|
|
245
261
|
via?.received(frame.authority, frame.carry, frame.index);
|
|
@@ -266,13 +282,39 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
266
282
|
return;
|
|
267
283
|
}
|
|
268
284
|
if (frame.type === 'caught_up') {
|
|
269
|
-
|
|
285
|
+
const expired = frame.expired.flatMap((authority) => tracking.get(authority) ?? []);
|
|
286
|
+
discovering.expired?.(expired);
|
|
270
287
|
emit({
|
|
271
288
|
kind: 'caught-up',
|
|
272
|
-
expired: [
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
289
|
+
expired: [...expired.map(({ locator }) => locator), ...(unanswered.shift() ?? [])],
|
|
290
|
+
});
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (frame.type === 'report') {
|
|
294
|
+
emit({ kind: 'reported' });
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (frame.type === 'request') {
|
|
298
|
+
const room = frame.request.room_ref;
|
|
299
|
+
emitRun({
|
|
300
|
+
kind: 'run',
|
|
301
|
+
run: heardRun(frame.request),
|
|
302
|
+
listing: tracking.has(room) ? room : null,
|
|
303
|
+
});
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (frame.type === 'request_removed') {
|
|
307
|
+
emitRun({ kind: 'removed', room: frame.room_ref, name: frame.request });
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (frame.type === 'requests') {
|
|
311
|
+
emitRun({
|
|
312
|
+
kind: 'runs',
|
|
313
|
+
listing: frame.room_ref,
|
|
314
|
+
runs: frame.requests.map(heardRun),
|
|
315
|
+
whole: frame.whole,
|
|
316
|
+
more: frame.more,
|
|
317
|
+
mark: frame.cursor,
|
|
276
318
|
});
|
|
277
319
|
return;
|
|
278
320
|
}
|
|
@@ -311,7 +353,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
311
353
|
frame.type === 'options' ||
|
|
312
354
|
frame.type === 'starting' ||
|
|
313
355
|
frame.type === 'state' ||
|
|
314
|
-
frame.type === 'link' ||
|
|
315
356
|
frame.type === 'deliveries' ||
|
|
316
357
|
frame.type === 'interactions' ||
|
|
317
358
|
frame.type === 'message') {
|
|
@@ -338,7 +379,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
338
379
|
locator: tracked.locator,
|
|
339
380
|
from,
|
|
340
381
|
roomVersion: version,
|
|
341
|
-
read: () => changePage(tracked, entries, version, mode,
|
|
382
|
+
read: () => changePage(tracked, entries, version, mode, from === null),
|
|
342
383
|
});
|
|
343
384
|
}
|
|
344
385
|
}
|
|
@@ -349,6 +390,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
349
390
|
announced = null;
|
|
350
391
|
socket = null;
|
|
351
392
|
staged.clear();
|
|
393
|
+
spaces = spaceSchemas();
|
|
352
394
|
unanswered.length = 0;
|
|
353
395
|
heldAtZero.clear();
|
|
354
396
|
emit({ kind: 'closed', revoked, lost, authorityChanged });
|
|
@@ -378,6 +420,17 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
378
420
|
},
|
|
379
421
|
...(mode === 'credential' ? { history: (request) => houseHistory(transport, request) } : {}),
|
|
380
422
|
},
|
|
423
|
+
runs: {
|
|
424
|
+
hold(marks) {
|
|
425
|
+
runMarks = marks;
|
|
426
|
+
},
|
|
427
|
+
observe(notify) {
|
|
428
|
+
runObservers.add(notify);
|
|
429
|
+
return () => {
|
|
430
|
+
runObservers.delete(notify);
|
|
431
|
+
};
|
|
432
|
+
},
|
|
433
|
+
},
|
|
381
434
|
observe(notify) {
|
|
382
435
|
observers.add(notify);
|
|
383
436
|
if (opening !== null) {
|
|
@@ -401,14 +454,13 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
401
454
|
announced = null;
|
|
402
455
|
if (socket === null)
|
|
403
456
|
return;
|
|
404
|
-
const entries = new Map([...tracking.values()].flat().map((tracked) => [tracked.locator, tracked]));
|
|
405
457
|
const named = rooms.flatMap((room) => {
|
|
406
|
-
const entry =
|
|
458
|
+
const entry = located.get(room.locator);
|
|
407
459
|
const at = room.roomVersion === null ? null : logPosition(room.roomVersion);
|
|
408
460
|
return entry === undefined || at === null ? [] : [{ entry, at }];
|
|
409
461
|
});
|
|
410
462
|
const unheld = rooms.flatMap((room) => {
|
|
411
|
-
const entry =
|
|
463
|
+
const entry = located.get(room.locator);
|
|
412
464
|
return entry === undefined || room.roomVersion !== null ? [] : [entry];
|
|
413
465
|
});
|
|
414
466
|
for (const { entry, at } of named) {
|
|
@@ -421,10 +473,14 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
421
473
|
heldAtZero.delete(entry.authority);
|
|
422
474
|
const site = mode === 'site';
|
|
423
475
|
unanswered.push(site ? unheld.map((entry) => entry.locator) : []);
|
|
476
|
+
const marked = (held) => {
|
|
477
|
+
const mark = runMarks.rooms[held.authority];
|
|
478
|
+
return mark === undefined ? held : { ...held, requests: mark };
|
|
479
|
+
};
|
|
424
480
|
socket.hold([
|
|
425
|
-
...named.map(({ entry, at }) => presented(entry.authority, at)),
|
|
426
|
-
...(site ? [] : unheld).map((entry) => presented(entry.authority, { position: '0', logEpoch: entry.logEpoch })),
|
|
427
|
-
], runtime, listedCursor);
|
|
481
|
+
...named.map(({ entry, at }) => marked(presented(entry.authority, at))),
|
|
482
|
+
...(site ? [] : unheld).map((entry) => marked(presented(entry.authority, { position: '0', logEpoch: entry.logEpoch }))),
|
|
483
|
+
], runtime, listedCursor, runMarks.sent ?? undefined);
|
|
428
484
|
if (site)
|
|
429
485
|
return;
|
|
430
486
|
const made = unheld.filter((entry) => entry.position === '0');
|
|
@@ -436,16 +492,21 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
436
492
|
locator: entry.locator,
|
|
437
493
|
from: null,
|
|
438
494
|
roomVersion: version,
|
|
439
|
-
read: () => changePage(entry, [], version, mode,
|
|
495
|
+
read: () => changePage(entry, [], version, mode, true),
|
|
440
496
|
});
|
|
441
497
|
}
|
|
442
498
|
});
|
|
443
499
|
},
|
|
444
500
|
track(entries) {
|
|
445
501
|
tracking.clear();
|
|
502
|
+
located.clear();
|
|
446
503
|
for (const entry of entries) {
|
|
447
504
|
tracking.set(entry.authority, [...(tracking.get(entry.authority) ?? []), entry]);
|
|
448
505
|
}
|
|
506
|
+
for (const held of tracking.values()) {
|
|
507
|
+
for (const entry of held)
|
|
508
|
+
located.set(entry.locator, entry);
|
|
509
|
+
}
|
|
449
510
|
for (const [carry, held] of staged) {
|
|
450
511
|
if (!tracking.has(held.authority))
|
|
451
512
|
staged.delete(carry);
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
import type { ConversationEvent, ListedAgent, SavedFacts } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { ConversationActivity, ConversationEvent, ListedAgent, SavedFacts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { Operation, SessionState } from './session-content/index.js';
|
|
3
3
|
export declare const HOUSE_RUNTIME_READS: {
|
|
4
|
-
readonly acts: readonly ['
|
|
5
|
-
readonly frames: readonly ['agent', 'app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', '
|
|
4
|
+
readonly acts: readonly ['account_update.set', 'app.screenshot', 'app.source', 'app_update.feature_set', 'conversations/history/list', 'files/attach', 'files/finish', 'files/read', 'files/revisions/list', 'info', 'room-chunks/list', 'rooms/discover', 'rooms/search', 'update'];
|
|
5
|
+
readonly frames: readonly ['agent', 'app-message', 'app-rooms', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'message', 'opening', 'options', 'part', 'process', 'received', 'report', 'request', 'request_removed', 'requests', 'signal', 'site', 'starting', 'state', 'tab-icon', 'turn'];
|
|
6
6
|
};
|
|
7
7
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
8
8
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
9
9
|
export declare function houseDoorRoute(act: HouseRuntimeAct): string;
|
|
10
|
-
export declare function houseSiteRoute(act: 'chunks' | 'discover'): string;
|
|
10
|
+
export declare function houseSiteRoute(act: 'chunks' | 'discover' | 'query'): string;
|
|
11
|
+
export declare const SITE_QUERY = "query";
|
|
12
|
+
export declare const SITE_FRESH_QUERY = "fresh";
|
|
13
|
+
export declare const SITE_QUERY_ROUTE_CHARACTERS = 12000;
|
|
14
|
+
export declare function siteQueryRoute(room: string, query: Readonly<Record<string, unknown>>, fresh?: boolean): string;
|
|
15
|
+
export declare function siteQueryAsked(address: string): Readonly<Record<string, unknown>> | null;
|
|
11
16
|
export declare const SITES_SUBMISSIONS_CREATE = "sites/submissions/create";
|
|
12
17
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
18
|
+
export declare const SITES_FUNCTIONS_CALL = "sites/functions/call";
|
|
19
|
+
export declare const SITE_DOOR_FUNCTION = "/_house/door/function";
|
|
20
|
+
interface SiteDoorAct {
|
|
21
|
+
readonly op: string;
|
|
22
|
+
readonly route: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const SITE_DOOR_ACTS: Readonly<Record<string, SiteDoorAct>>;
|
|
25
|
+
export declare const SITE_DOOR_TOOL = "app_update";
|
|
13
26
|
export type HouseMode = 'credential' | 'site';
|
|
14
27
|
export type HouseDoorAnswer = {
|
|
15
28
|
status: number;
|
|
16
29
|
body: unknown;
|
|
17
30
|
};
|
|
18
31
|
export declare const SITE_FILES = "/_house/files/";
|
|
32
|
+
export declare const SITE_IMAGE_COPIES_HEADER = "X-House-Image-Copies";
|
|
19
33
|
export type HouseBytesAnswer = {
|
|
20
34
|
status: number;
|
|
21
35
|
body: ReadableStream<Uint8Array> | null;
|
|
22
36
|
mediaType: string;
|
|
37
|
+
copies?: string | null;
|
|
23
38
|
};
|
|
24
39
|
export type HouseByteTransfer = {
|
|
25
40
|
url: string;
|
|
@@ -31,7 +46,6 @@ export type HouseStreamEntry = {
|
|
|
31
46
|
removed?: true;
|
|
32
47
|
revision?: string;
|
|
33
48
|
sha256?: string;
|
|
34
|
-
text?: string;
|
|
35
49
|
bytes?: number;
|
|
36
50
|
media_type?: string;
|
|
37
51
|
author?: {
|
|
@@ -40,12 +54,27 @@ export type HouseStreamEntry = {
|
|
|
40
54
|
} | {
|
|
41
55
|
site: string;
|
|
42
56
|
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
inbox: string;
|
|
59
|
+
name: string;
|
|
60
|
+
} | {
|
|
61
|
+
app: string;
|
|
62
|
+
function: string;
|
|
63
|
+
release: string;
|
|
64
|
+
name: string;
|
|
43
65
|
};
|
|
44
66
|
changed_at?: string;
|
|
45
67
|
created_at?: string;
|
|
68
|
+
content?: string;
|
|
46
69
|
facts?: SavedFacts;
|
|
70
|
+
move?: 'arrival' | 'leaving';
|
|
47
71
|
space?: string;
|
|
48
72
|
};
|
|
73
|
+
export type HouseStreamedRequest = {
|
|
74
|
+
room_ref: string;
|
|
75
|
+
name: string;
|
|
76
|
+
document: string;
|
|
77
|
+
};
|
|
49
78
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
50
79
|
kind: K;
|
|
51
80
|
}>;
|
|
@@ -54,12 +83,15 @@ export type HouseListedConversation = {
|
|
|
54
83
|
agent_id: string;
|
|
55
84
|
name: string;
|
|
56
85
|
created_at: string;
|
|
57
|
-
finished_at: string | null;
|
|
58
86
|
outcome: string | null;
|
|
59
87
|
waiting: boolean;
|
|
60
88
|
newest: number | null;
|
|
61
89
|
process_ended_at: string | null;
|
|
90
|
+
activity: ConversationActivity | null;
|
|
62
91
|
subject: string | null;
|
|
92
|
+
room_ref: string | null;
|
|
93
|
+
model: string | null;
|
|
94
|
+
effort: string | null;
|
|
63
95
|
};
|
|
64
96
|
type Listed<Frame extends {
|
|
65
97
|
readonly type: HouseRuntimeFrame;
|
|
@@ -81,17 +113,23 @@ export type HouseStreamFrame = Listed<{
|
|
|
81
113
|
} | {
|
|
82
114
|
type: 'opening';
|
|
83
115
|
member: unknown;
|
|
116
|
+
time_zone: unknown;
|
|
84
117
|
bounds: unknown;
|
|
85
118
|
actions: readonly unknown[];
|
|
86
119
|
shapes: readonly unknown[];
|
|
87
120
|
rooms: readonly unknown[];
|
|
121
|
+
listed: readonly unknown[];
|
|
122
|
+
spaces: readonly unknown[];
|
|
88
123
|
} | {
|
|
89
124
|
type: 'caught_up';
|
|
90
125
|
expired: readonly string[];
|
|
91
126
|
} | {
|
|
92
127
|
type: 'authority_changed';
|
|
93
128
|
member: unknown;
|
|
129
|
+
time_zone: unknown;
|
|
94
130
|
authorities: readonly unknown[];
|
|
131
|
+
listed: readonly unknown[];
|
|
132
|
+
spaces: readonly unknown[];
|
|
95
133
|
left: readonly string[];
|
|
96
134
|
} | {
|
|
97
135
|
type: 'turn';
|
|
@@ -136,10 +174,6 @@ export type HouseStreamFrame = Listed<{
|
|
|
136
174
|
type: 'state';
|
|
137
175
|
conversation_id: string;
|
|
138
176
|
state: SessionState;
|
|
139
|
-
} | {
|
|
140
|
-
type: 'link';
|
|
141
|
-
conversation_id: string;
|
|
142
|
-
connected: boolean;
|
|
143
177
|
} | {
|
|
144
178
|
type: 'conversations';
|
|
145
179
|
agents: readonly ListedAgent[];
|
|
@@ -159,14 +193,31 @@ export type HouseStreamFrame = Listed<{
|
|
|
159
193
|
} | {
|
|
160
194
|
type: 'signal';
|
|
161
195
|
service_mode: string;
|
|
196
|
+
} | {
|
|
197
|
+
type: 'report';
|
|
198
|
+
} | {
|
|
199
|
+
type: 'request';
|
|
200
|
+
request: HouseStreamedRequest;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'request_removed';
|
|
203
|
+
room_ref: string;
|
|
204
|
+
request: string;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'requests';
|
|
207
|
+
room_ref: string | null;
|
|
208
|
+
requests: readonly HouseStreamedRequest[];
|
|
209
|
+
whole: boolean;
|
|
210
|
+
more: boolean;
|
|
211
|
+
cursor: string;
|
|
162
212
|
}>;
|
|
163
213
|
export type HouseHeldRoom = {
|
|
164
214
|
authority: string;
|
|
165
215
|
position: string;
|
|
166
216
|
log_epoch: string;
|
|
217
|
+
requests?: string;
|
|
167
218
|
};
|
|
168
219
|
export type HouseOpening = {
|
|
169
|
-
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null): void;
|
|
220
|
+
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null, sent?: string): void;
|
|
170
221
|
received(authority: string, carry: string, index: number): void;
|
|
171
222
|
close(failure?: unknown): void;
|
|
172
223
|
};
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,4BAA4B,EAC5B,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,QAAQ;aAEV,MAAM,YACJ,OAAO,EACP,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,MAAM;CAEA,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAE3D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAE3E;AAED,eAAO,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IAAI,GAAG,MAAM,IAAI,CAAC;IAC5D,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7D,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/D,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,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,24 +1,25 @@
|
|
|
1
|
+
import { plain, queryKey } from '@agentshouse/mdmodel';
|
|
1
2
|
export const HOUSE_RUNTIME_READS = {
|
|
2
3
|
acts: [
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
4
|
+
'account_update.set',
|
|
5
|
+
'app.screenshot',
|
|
6
|
+
'app.source',
|
|
7
|
+
'app_update.feature_set',
|
|
7
8
|
'conversations/history/list',
|
|
8
9
|
'files/attach',
|
|
9
|
-
'files/batch',
|
|
10
|
-
'files/batch-upload',
|
|
11
10
|
'files/finish',
|
|
12
11
|
'files/read',
|
|
13
12
|
'files/revisions/list',
|
|
13
|
+
'info',
|
|
14
14
|
'room-chunks/list',
|
|
15
15
|
'rooms/discover',
|
|
16
16
|
'rooms/search',
|
|
17
|
-
'
|
|
17
|
+
'update',
|
|
18
18
|
],
|
|
19
19
|
frames: [
|
|
20
20
|
'agent',
|
|
21
21
|
'app-message',
|
|
22
|
+
'app-rooms',
|
|
22
23
|
'authority_changed',
|
|
23
24
|
'carried',
|
|
24
25
|
'caught_up',
|
|
@@ -30,13 +31,16 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
30
31
|
'deployment',
|
|
31
32
|
'held',
|
|
32
33
|
'interactions',
|
|
33
|
-
'link',
|
|
34
34
|
'message',
|
|
35
35
|
'opening',
|
|
36
36
|
'options',
|
|
37
37
|
'part',
|
|
38
38
|
'process',
|
|
39
39
|
'received',
|
|
40
|
+
'report',
|
|
41
|
+
'request',
|
|
42
|
+
'request_removed',
|
|
43
|
+
'requests',
|
|
40
44
|
'signal',
|
|
41
45
|
'site',
|
|
42
46
|
'starting',
|
|
@@ -51,6 +55,40 @@ export function houseDoorRoute(act) {
|
|
|
51
55
|
export function houseSiteRoute(act) {
|
|
52
56
|
return `/_house/door/${act}`;
|
|
53
57
|
}
|
|
58
|
+
export const SITE_QUERY = 'query';
|
|
59
|
+
export const SITE_FRESH_QUERY = 'fresh';
|
|
60
|
+
export const SITE_QUERY_ROUTE_CHARACTERS = 12_000;
|
|
61
|
+
function addressed(text) {
|
|
62
|
+
let binary = '';
|
|
63
|
+
for (const byte of new TextEncoder().encode(text))
|
|
64
|
+
binary += String.fromCharCode(byte);
|
|
65
|
+
return btoa(binary).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/u, '');
|
|
66
|
+
}
|
|
67
|
+
export function siteQueryRoute(room, query, fresh = false) {
|
|
68
|
+
const canonical = queryKey(JSON.parse(JSON.stringify(query)));
|
|
69
|
+
const named = fresh ? SITE_FRESH_QUERY : SITE_QUERY;
|
|
70
|
+
return `${houseSiteRoute('query')}/${room}?${named}=${addressed(canonical)}`;
|
|
71
|
+
}
|
|
72
|
+
export function siteQueryAsked(address) {
|
|
73
|
+
let asked;
|
|
74
|
+
try {
|
|
75
|
+
const binary = atob(address.replaceAll('-', '+').replaceAll('_', '/'));
|
|
76
|
+
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
77
|
+
asked = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return plain(asked) && addressed(queryKey(asked)) === address ? asked : null;
|
|
83
|
+
}
|
|
54
84
|
export const SITES_SUBMISSIONS_CREATE = 'sites/submissions/create';
|
|
55
85
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
86
|
+
export const SITES_FUNCTIONS_CALL = 'sites/functions/call';
|
|
87
|
+
export const SITE_DOOR_FUNCTION = '/_house/door/function';
|
|
88
|
+
export const SITE_DOOR_ACTS = {
|
|
89
|
+
[SITES_SUBMISSIONS_CREATE]: { op: 'submission_create', route: SITE_DOOR_SUBMIT },
|
|
90
|
+
[SITES_FUNCTIONS_CALL]: { op: 'function_call', route: SITE_DOOR_FUNCTION },
|
|
91
|
+
};
|
|
92
|
+
export const SITE_DOOR_TOOL = 'app_update';
|
|
56
93
|
export const SITE_FILES = '/_house/files/';
|
|
94
|
+
export const SITE_IMAGE_COPIES_HEADER = 'X-House-Image-Copies';
|
package/dist/upload.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TransportUncertainty } from '@agentshouse/mdruntime';
|
|
1
2
|
import { type HouseDoorAnswer, type HouseTransport } from './transport.js';
|
|
2
3
|
export type HouseUpload = {
|
|
3
4
|
readonly id: string;
|
|
@@ -11,3 +12,6 @@ export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
|
11
12
|
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | {
|
|
12
13
|
readonly unfinished: number;
|
|
13
14
|
}>;
|
|
15
|
+
type StagedFile = (sha256: unknown) => Promise<Blob> | null;
|
|
16
|
+
export declare function stagedBatch(transport: HouseTransport, body: Readonly<Record<string, unknown>>, file: StagedFile): Promise<HouseDoorAnswer | TransportUncertainty>;
|
|
17
|
+
export {};
|
package/dist/upload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGpF,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG3F,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5E,CAAC;AAeF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAQ9D;AA+BD,wBAAsB,cAAc,CAClC,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,eAAe,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB5D;AAED,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAsB5D,wBAAsB,WAAW,CAC/B,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,eAAe,GAAG,oBAAoB,CAAC,CAoBjD"}
|