@agentshouse/mdruntime-adapter 0.1.0-cefdbbefd37e5 → 0.1.0-cf151c882c69c
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 +4 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +55 -9
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +129 -117
- package/dist/authored-path.d.ts +54 -3
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +142 -11
- package/dist/chunks.d.ts +2 -3
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +72 -38
- package/dist/discovery.d.ts +25 -5
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +169 -21
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +3 -2
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -8
- 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 +71 -44
- package/dist/refusal.d.ts +5 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +23 -6
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +29 -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/search.d.ts.map +1 -1
- package/dist/search.js +4 -4
- package/dist/session-content/check.d.ts +0 -1
- package/dist/session-content/index.d.ts +2 -3
- package/dist/session-content/parts.d.ts +12 -84
- package/dist/session-content/state.d.ts +4 -6
- package/dist/session-content/turn.d.ts +28 -219
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +56 -22
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +1 -8
- package/dist/stream.d.ts +2 -3
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +74 -76
- package/dist/transport.d.ts +44 -13
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +47 -7
- package/dist/uncertain.d.ts +5 -0
- package/dist/uncertain.d.ts.map +1 -0
- package/dist/uncertain.js +11 -0
- package/dist/upload.d.ts +7 -1
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +49 -6
- package/dist/write.d.ts +1 -2
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +30 -30
- package/package.json +4 -3
- package/dist/app-reference.d.ts +0 -1
- package/dist/app-reference.d.ts.map +0 -1
- package/dist/app-reference.js +0 -2
- package/dist/crockford.d.ts +0 -3
- package/dist/crockford.d.ts.map +0 -1
- package/dist/crockford.js +0 -3
- package/dist/house-model.d.ts +0 -830
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -465
- package/dist/room-types.d.ts +0 -4
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -135
- package/dist/session-content/bounds.d.ts +0 -7
package/dist/stream.js
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
2
|
import { acceptedMessage, changeCursor, houseHistory } from './history.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { houseDoorRoute, } from './transport.js';
|
|
3
|
+
import { spaceSchemaTexts, streamedModels } from './model.js';
|
|
4
|
+
import { spaceSchemas } from './space-schema.js';
|
|
5
|
+
import { answered, answering, documentEntry, folded, forgotten, kept, } from './read.js';
|
|
7
6
|
import { DECIMAL, logPosition, presented, roomVersion } from './version.js';
|
|
8
7
|
function turnOperation(frame) {
|
|
9
8
|
return 'at' in frame ? { op: 'begin', at: frame.at } : structuredClone(frame.operation);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
function listedAgent(agent) {
|
|
11
|
+
return {
|
|
12
|
+
id: agent.id,
|
|
13
|
+
name: agent.name,
|
|
14
|
+
revision: agent.revision,
|
|
15
|
+
environment: agent.environment,
|
|
16
|
+
environment_name: agent.environment_name,
|
|
17
|
+
environment_connected: agent.environment_connected,
|
|
18
|
+
launch_directory: agent.launch_directory,
|
|
19
|
+
cli: agent.cli,
|
|
20
|
+
model: agent.model,
|
|
21
|
+
effort: agent.effort,
|
|
22
|
+
mode: agent.mode,
|
|
23
|
+
base_instructions: agent.base_instructions,
|
|
24
|
+
in_telegram: agent.in_telegram,
|
|
25
|
+
created: agent.created,
|
|
26
|
+
retired_at: agent.retired_at,
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
function listedConversation(listed) {
|
|
27
30
|
return {
|
|
28
31
|
conversation: listed.conversation_id,
|
|
29
32
|
agent: listed.agent_id,
|
|
30
|
-
agentName: listed.agent_name,
|
|
31
|
-
agentRetired: listed.agent_retired,
|
|
32
33
|
name: listed.name,
|
|
33
34
|
created: listed.created_at,
|
|
34
|
-
finished: listed.finished_at,
|
|
35
35
|
outcome: listed.outcome,
|
|
36
36
|
waiting: listed.waiting,
|
|
37
37
|
newest: listed.newest === null ? null : changeCursor(listed.newest),
|
|
38
38
|
processEnded: listed.process_ended_at,
|
|
39
|
+
subject: listed.subject,
|
|
40
|
+
room: listed.room_ref,
|
|
41
|
+
model: listed.model,
|
|
42
|
+
effort: listed.effort,
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
function position(value) {
|
|
@@ -43,55 +47,47 @@ function position(value) {
|
|
|
43
47
|
return null;
|
|
44
48
|
return BigInt(value);
|
|
45
49
|
}
|
|
46
|
-
function* changed(tracked, entries, version, schemas) {
|
|
50
|
+
function* changed(tracked, entries, version, mode, schemas) {
|
|
47
51
|
const answer = answering();
|
|
48
52
|
for (const entry of entries) {
|
|
49
|
-
yield ROW_WEIGHT + (entry.
|
|
53
|
+
yield ROW_WEIGHT + (entry.content?.length ?? 0);
|
|
50
54
|
if (entry.kind === 'folder') {
|
|
51
55
|
folded(answer, entry.path, entry.removed === true);
|
|
52
56
|
continue;
|
|
53
57
|
}
|
|
54
|
-
if (entry.path === tracked.schema)
|
|
55
|
-
schemas.set(entry.path, entry);
|
|
56
|
-
forgotten(answer, entry.path);
|
|
57
|
-
if (entry.space !== undefined) {
|
|
58
|
-
answer.removals.add(entry.path);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
58
|
if (entry.kind === 'removed') {
|
|
59
|
+
if (entry.path === tracked.schema)
|
|
60
|
+
schemas.set(entry.path, null);
|
|
61
|
+
forgotten(answer, entry.path);
|
|
62
62
|
answer.removals.add(entry.path);
|
|
63
63
|
continue;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const head = headChange(entry);
|
|
76
|
-
if (head)
|
|
77
|
-
answer.changes.set(entry.path, head);
|
|
78
|
-
const created = createdOf(entry);
|
|
79
|
-
if (created)
|
|
80
|
-
answer.created.set(entry.path, created);
|
|
65
|
+
const file = documentEntry(entry, mode);
|
|
66
|
+
if (file === null)
|
|
67
|
+
throw new Error(`the stream carried ${entry.path} as no file`);
|
|
68
|
+
if (entry.path === tracked.schema)
|
|
69
|
+
schemas.set(entry.path, file);
|
|
70
|
+
forgotten(answer, file.path);
|
|
71
|
+
if (file.space === undefined)
|
|
72
|
+
kept(answer, file);
|
|
73
|
+
else
|
|
74
|
+
answer.removals.add(file.path);
|
|
81
75
|
}
|
|
82
76
|
return { kind: 'net-advancement', roomVersion: version, ...(yield* answered(answer)) };
|
|
83
77
|
}
|
|
84
|
-
async function changePage(tracked, entries, version, mode,
|
|
78
|
+
async function changePage(tracked, entries, version, mode, whole) {
|
|
85
79
|
const schemas = new Map();
|
|
86
|
-
const page = await stepped(changed(tracked, entries, version, schemas));
|
|
87
|
-
const models = await streamedModels(schemas, tracked,
|
|
80
|
+
const page = await stepped(changed(tracked, entries, version, mode, schemas));
|
|
81
|
+
const models = await streamedModels(schemas, tracked, whole);
|
|
88
82
|
return models === undefined ? page : { ...page, models };
|
|
89
83
|
}
|
|
90
|
-
export function houseNotifications(transport, mode, discovering
|
|
84
|
+
export function houseNotifications(transport, mode, discovering) {
|
|
91
85
|
const stream = transport.stream;
|
|
92
86
|
const staged = new Map();
|
|
87
|
+
let spaces = spaceSchemas();
|
|
93
88
|
let socket = null;
|
|
94
89
|
const tracking = new Map();
|
|
90
|
+
const located = new Map();
|
|
95
91
|
const observers = new Set();
|
|
96
92
|
const replaying = new Map();
|
|
97
93
|
const conversationObservers = new Set();
|
|
@@ -121,7 +117,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
121
117
|
event.kind === 'options' ||
|
|
122
118
|
event.kind === 'starting' ||
|
|
123
119
|
event.kind === 'state' ||
|
|
124
|
-
event.kind === 'link' ||
|
|
125
120
|
event.kind === 'deliveries') {
|
|
126
121
|
live.add(event.conversation);
|
|
127
122
|
}
|
|
@@ -133,6 +128,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
133
128
|
announced = null;
|
|
134
129
|
socket = next;
|
|
135
130
|
staged.clear();
|
|
131
|
+
spaces = spaceSchemas();
|
|
136
132
|
unanswered.length = 0;
|
|
137
133
|
heldAtZero.clear();
|
|
138
134
|
const gapped = new Set([...replicated, ...live]);
|
|
@@ -153,9 +149,9 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
153
149
|
}
|
|
154
150
|
announced = { kind: 'discovered', discovery };
|
|
155
151
|
emit(announced);
|
|
156
|
-
}, () => {
|
|
152
|
+
}, (failure) => {
|
|
157
153
|
if (socket === via)
|
|
158
|
-
via.close();
|
|
154
|
+
via.close(failure);
|
|
159
155
|
});
|
|
160
156
|
}
|
|
161
157
|
function converse(frame) {
|
|
@@ -198,10 +194,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
198
194
|
emitConversation({ kind: 'state', conversation, state: structuredClone(frame.state) });
|
|
199
195
|
return;
|
|
200
196
|
}
|
|
201
|
-
if (frame.type === 'link') {
|
|
202
|
-
emitConversation({ kind: 'link', conversation, connected: frame.connected });
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
197
|
if (frame.type === 'deliveries') {
|
|
206
198
|
emitConversation({
|
|
207
199
|
kind: 'deliveries',
|
|
@@ -225,6 +217,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
225
217
|
emitConversation({ kind: 'accepted-message', conversation, message });
|
|
226
218
|
}
|
|
227
219
|
function stage(frame, via) {
|
|
220
|
+
const entries = spaceSchemaTexts(frame.entries, spaces);
|
|
228
221
|
const held = staged.get(frame.carry);
|
|
229
222
|
if (frame.index !== (held?.parts ?? 0)) {
|
|
230
223
|
staged.delete(frame.carry);
|
|
@@ -237,8 +230,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
237
230
|
}
|
|
238
231
|
}
|
|
239
232
|
const next = held ?? { authority: frame.authority, parts: 0, entries: [] };
|
|
240
|
-
|
|
241
|
-
next.entries.push(...frame.entries);
|
|
233
|
+
next.entries.push(...entries);
|
|
242
234
|
next.parts += 1;
|
|
243
235
|
staged.set(frame.carry, next);
|
|
244
236
|
via?.received(frame.authority, frame.carry, frame.index);
|
|
@@ -265,16 +257,18 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
265
257
|
return;
|
|
266
258
|
}
|
|
267
259
|
if (frame.type === 'caught_up') {
|
|
268
|
-
|
|
260
|
+
const expired = frame.expired.flatMap((authority) => tracking.get(authority) ?? []);
|
|
261
|
+
discovering.expired?.(expired);
|
|
269
262
|
emit({
|
|
270
263
|
kind: 'caught-up',
|
|
271
|
-
expired: [
|
|
272
|
-
...frame.expired.flatMap((authority) => (tracking.get(authority) ?? []).map((tracked) => tracked.locator)),
|
|
273
|
-
...(unanswered.shift() ?? []),
|
|
274
|
-
],
|
|
264
|
+
expired: [...expired.map(({ locator }) => locator), ...(unanswered.shift() ?? [])],
|
|
275
265
|
});
|
|
276
266
|
return;
|
|
277
267
|
}
|
|
268
|
+
if (frame.type === 'report') {
|
|
269
|
+
emit({ kind: 'reported' });
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
278
272
|
if (frame.type === 'authority_changed') {
|
|
279
273
|
const change = discovering.changed(frame);
|
|
280
274
|
if (change !== null)
|
|
@@ -284,6 +278,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
284
278
|
if (frame.type === 'conversations') {
|
|
285
279
|
emitConversation({
|
|
286
280
|
kind: 'list',
|
|
281
|
+
agents: frame.agents.map(listedAgent),
|
|
287
282
|
entries: frame.conversations.map(listedConversation),
|
|
288
283
|
whole: frame.whole,
|
|
289
284
|
more: frame.more,
|
|
@@ -295,6 +290,10 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
295
290
|
emitConversation({ kind: 'listed', entry: listedConversation(frame.conversation) });
|
|
296
291
|
return;
|
|
297
292
|
}
|
|
293
|
+
if (frame.type === 'agent') {
|
|
294
|
+
emitConversation({ kind: 'agent', agent: listedAgent(frame.agent) });
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
298
297
|
if (frame.type === 'conversation_deleted') {
|
|
299
298
|
emitConversation({ kind: 'unlisted', conversation: frame.conversation_id });
|
|
300
299
|
return;
|
|
@@ -305,7 +304,6 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
305
304
|
frame.type === 'options' ||
|
|
306
305
|
frame.type === 'starting' ||
|
|
307
306
|
frame.type === 'state' ||
|
|
308
|
-
frame.type === 'link' ||
|
|
309
307
|
frame.type === 'deliveries' ||
|
|
310
308
|
frame.type === 'interactions' ||
|
|
311
309
|
frame.type === 'message') {
|
|
@@ -332,7 +330,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
332
330
|
locator: tracked.locator,
|
|
333
331
|
from,
|
|
334
332
|
roomVersion: version,
|
|
335
|
-
read: () => changePage(tracked, entries, version, mode,
|
|
333
|
+
read: () => changePage(tracked, entries, version, mode, from === null),
|
|
336
334
|
});
|
|
337
335
|
}
|
|
338
336
|
}
|
|
@@ -343,6 +341,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
343
341
|
announced = null;
|
|
344
342
|
socket = null;
|
|
345
343
|
staged.clear();
|
|
344
|
+
spaces = spaceSchemas();
|
|
346
345
|
unanswered.length = 0;
|
|
347
346
|
heldAtZero.clear();
|
|
348
347
|
emit({ kind: 'closed', revoked, lost, authorityChanged });
|
|
@@ -370,12 +369,7 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
370
369
|
conversationObservers.delete(notify);
|
|
371
370
|
};
|
|
372
371
|
},
|
|
373
|
-
...(mode === 'credential'
|
|
374
|
-
? {
|
|
375
|
-
agents: () => houseAgents(transport),
|
|
376
|
-
history: (request) => houseHistory(transport, request),
|
|
377
|
-
}
|
|
378
|
-
: {}),
|
|
372
|
+
...(mode === 'credential' ? { history: (request) => houseHistory(transport, request) } : {}),
|
|
379
373
|
},
|
|
380
374
|
observe(notify) {
|
|
381
375
|
observers.add(notify);
|
|
@@ -400,14 +394,13 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
400
394
|
announced = null;
|
|
401
395
|
if (socket === null)
|
|
402
396
|
return;
|
|
403
|
-
const entries = new Map([...tracking.values()].flat().map((tracked) => [tracked.locator, tracked]));
|
|
404
397
|
const named = rooms.flatMap((room) => {
|
|
405
|
-
const entry =
|
|
398
|
+
const entry = located.get(room.locator);
|
|
406
399
|
const at = room.roomVersion === null ? null : logPosition(room.roomVersion);
|
|
407
400
|
return entry === undefined || at === null ? [] : [{ entry, at }];
|
|
408
401
|
});
|
|
409
402
|
const unheld = rooms.flatMap((room) => {
|
|
410
|
-
const entry =
|
|
403
|
+
const entry = located.get(room.locator);
|
|
411
404
|
return entry === undefined || room.roomVersion !== null ? [] : [entry];
|
|
412
405
|
});
|
|
413
406
|
for (const { entry, at } of named) {
|
|
@@ -435,16 +428,21 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
435
428
|
locator: entry.locator,
|
|
436
429
|
from: null,
|
|
437
430
|
roomVersion: version,
|
|
438
|
-
read: () => changePage(entry, [], version, mode,
|
|
431
|
+
read: () => changePage(entry, [], version, mode, true),
|
|
439
432
|
});
|
|
440
433
|
}
|
|
441
434
|
});
|
|
442
435
|
},
|
|
443
436
|
track(entries) {
|
|
444
437
|
tracking.clear();
|
|
438
|
+
located.clear();
|
|
445
439
|
for (const entry of entries) {
|
|
446
440
|
tracking.set(entry.authority, [...(tracking.get(entry.authority) ?? []), entry]);
|
|
447
441
|
}
|
|
442
|
+
for (const held of tracking.values()) {
|
|
443
|
+
for (const entry of held)
|
|
444
|
+
located.set(entry.locator, entry);
|
|
445
|
+
}
|
|
448
446
|
for (const [carry, held] of staged) {
|
|
449
447
|
if (!tracking.has(held.authority))
|
|
450
448
|
staged.delete(carry);
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import type { ConversationEvent, SavedFacts } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { 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 ['account/push/set', '
|
|
5
|
-
readonly frames: readonly ['app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', '
|
|
4
|
+
readonly acts: readonly ['account/push/set', 'account/time-zone/set', 'app.screenshot', 'app.source', 'apps/features/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', '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
|
+
export declare const SITE_DOOR_ACTS: Readonly<Record<string, string>>;
|
|
21
|
+
export declare const SITE_DOOR_TOOL = "app_update";
|
|
22
|
+
export declare const SITE_DOOR_OPS: Readonly<Record<string, string>>;
|
|
13
23
|
export type HouseMode = 'credential' | 'site';
|
|
14
24
|
export type HouseDoorAnswer = {
|
|
15
25
|
status: number;
|
|
16
26
|
body: unknown;
|
|
17
27
|
};
|
|
18
28
|
export declare const SITE_FILES = "/_house/files/";
|
|
29
|
+
export declare const SITE_IMAGE_COPIES_HEADER = "X-House-Image-Copies";
|
|
19
30
|
export type HouseBytesAnswer = {
|
|
20
31
|
status: number;
|
|
21
32
|
body: ReadableStream<Uint8Array> | null;
|
|
22
33
|
mediaType: string;
|
|
34
|
+
copies?: string | null;
|
|
23
35
|
};
|
|
24
36
|
export type HouseByteTransfer = {
|
|
25
37
|
url: string;
|
|
@@ -31,7 +43,6 @@ export type HouseStreamEntry = {
|
|
|
31
43
|
removed?: true;
|
|
32
44
|
revision?: string;
|
|
33
45
|
sha256?: string;
|
|
34
|
-
text?: string;
|
|
35
46
|
bytes?: number;
|
|
36
47
|
media_type?: string;
|
|
37
48
|
author?: {
|
|
@@ -40,10 +51,21 @@ export type HouseStreamEntry = {
|
|
|
40
51
|
} | {
|
|
41
52
|
site: string;
|
|
42
53
|
name: string;
|
|
54
|
+
} | {
|
|
55
|
+
inbox: string;
|
|
56
|
+
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
app: string;
|
|
59
|
+
function: string;
|
|
60
|
+
release: string;
|
|
61
|
+
name: string;
|
|
43
62
|
};
|
|
44
63
|
changed_at?: string;
|
|
45
64
|
created_at?: string;
|
|
65
|
+
content?: string;
|
|
66
|
+
provenance?: string;
|
|
46
67
|
facts?: SavedFacts;
|
|
68
|
+
move?: 'arrival' | 'leaving';
|
|
47
69
|
space?: string;
|
|
48
70
|
};
|
|
49
71
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
@@ -52,15 +74,16 @@ type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent,
|
|
|
52
74
|
export type HouseListedConversation = {
|
|
53
75
|
conversation_id: string;
|
|
54
76
|
agent_id: string;
|
|
55
|
-
agent_name: string;
|
|
56
|
-
agent_retired: boolean;
|
|
57
77
|
name: string;
|
|
58
78
|
created_at: string;
|
|
59
|
-
finished_at: string | null;
|
|
60
79
|
outcome: string | null;
|
|
61
80
|
waiting: boolean;
|
|
62
81
|
newest: number | null;
|
|
63
82
|
process_ended_at: string | null;
|
|
83
|
+
subject: string | null;
|
|
84
|
+
room_ref: string | null;
|
|
85
|
+
model: string | null;
|
|
86
|
+
effort: string | null;
|
|
64
87
|
};
|
|
65
88
|
type Listed<Frame extends {
|
|
66
89
|
readonly type: HouseRuntimeFrame;
|
|
@@ -82,17 +105,23 @@ export type HouseStreamFrame = Listed<{
|
|
|
82
105
|
} | {
|
|
83
106
|
type: 'opening';
|
|
84
107
|
member: unknown;
|
|
108
|
+
time_zone: unknown;
|
|
85
109
|
bounds: unknown;
|
|
86
110
|
actions: readonly unknown[];
|
|
87
111
|
shapes: readonly unknown[];
|
|
88
112
|
rooms: readonly unknown[];
|
|
113
|
+
listed: readonly unknown[];
|
|
114
|
+
spaces: readonly unknown[];
|
|
89
115
|
} | {
|
|
90
116
|
type: 'caught_up';
|
|
91
117
|
expired: readonly string[];
|
|
92
118
|
} | {
|
|
93
119
|
type: 'authority_changed';
|
|
94
120
|
member: unknown;
|
|
121
|
+
time_zone: unknown;
|
|
95
122
|
authorities: readonly unknown[];
|
|
123
|
+
listed: readonly unknown[];
|
|
124
|
+
spaces: readonly unknown[];
|
|
96
125
|
left: readonly string[];
|
|
97
126
|
} | {
|
|
98
127
|
type: 'turn';
|
|
@@ -137,12 +166,9 @@ export type HouseStreamFrame = Listed<{
|
|
|
137
166
|
type: 'state';
|
|
138
167
|
conversation_id: string;
|
|
139
168
|
state: SessionState;
|
|
140
|
-
} | {
|
|
141
|
-
type: 'link';
|
|
142
|
-
conversation_id: string;
|
|
143
|
-
connected: boolean;
|
|
144
169
|
} | {
|
|
145
170
|
type: 'conversations';
|
|
171
|
+
agents: readonly ListedAgent[];
|
|
146
172
|
conversations: readonly HouseListedConversation[];
|
|
147
173
|
whole: boolean;
|
|
148
174
|
more: boolean;
|
|
@@ -150,12 +176,17 @@ export type HouseStreamFrame = Listed<{
|
|
|
150
176
|
} | {
|
|
151
177
|
type: 'conversation';
|
|
152
178
|
conversation: HouseListedConversation;
|
|
179
|
+
} | {
|
|
180
|
+
type: 'agent';
|
|
181
|
+
agent: ListedAgent;
|
|
153
182
|
} | {
|
|
154
183
|
type: 'conversation_deleted';
|
|
155
184
|
conversation_id: string;
|
|
156
185
|
} | {
|
|
157
186
|
type: 'signal';
|
|
158
187
|
service_mode: string;
|
|
188
|
+
} | {
|
|
189
|
+
type: 'report';
|
|
159
190
|
}>;
|
|
160
191
|
export type HouseHeldRoom = {
|
|
161
192
|
authority: string;
|
|
@@ -165,7 +196,7 @@ export type HouseHeldRoom = {
|
|
|
165
196
|
export type HouseOpening = {
|
|
166
197
|
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null): void;
|
|
167
198
|
received(authority: string, carry: string, index: number): void;
|
|
168
|
-
close(): void;
|
|
199
|
+
close(failure?: unknown): void;
|
|
169
200
|
};
|
|
170
201
|
export type HouseClosing = {
|
|
171
202
|
revoked: boolean;
|
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,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,4BAA4B,EAC5B,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,QAAQ;aAEV,MAAM,YACJ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EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,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,26 @@
|
|
|
1
|
+
import { plain, queryKey } from '@agentshouse/mdmodel';
|
|
1
2
|
export const HOUSE_RUNTIME_READS = {
|
|
2
3
|
acts: [
|
|
3
4
|
'account/push/set',
|
|
4
|
-
'
|
|
5
|
+
'account/time-zone/set',
|
|
6
|
+
'app.screenshot',
|
|
7
|
+
'app.source',
|
|
5
8
|
'apps/features/set',
|
|
6
|
-
'apps/source/download',
|
|
7
|
-
'apps/source/top/read',
|
|
8
9
|
'conversations/history/list',
|
|
9
10
|
'files/attach',
|
|
10
|
-
'files/batch',
|
|
11
|
-
'files/batch-upload',
|
|
12
11
|
'files/finish',
|
|
13
12
|
'files/read',
|
|
14
13
|
'files/revisions/list',
|
|
14
|
+
'info',
|
|
15
15
|
'room-chunks/list',
|
|
16
16
|
'rooms/discover',
|
|
17
17
|
'rooms/search',
|
|
18
|
-
'
|
|
18
|
+
'update',
|
|
19
19
|
],
|
|
20
20
|
frames: [
|
|
21
|
+
'agent',
|
|
21
22
|
'app-message',
|
|
23
|
+
'app-rooms',
|
|
22
24
|
'authority_changed',
|
|
23
25
|
'carried',
|
|
24
26
|
'caught_up',
|
|
@@ -30,13 +32,13 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
30
32
|
'deployment',
|
|
31
33
|
'held',
|
|
32
34
|
'interactions',
|
|
33
|
-
'link',
|
|
34
35
|
'message',
|
|
35
36
|
'opening',
|
|
36
37
|
'options',
|
|
37
38
|
'part',
|
|
38
39
|
'process',
|
|
39
40
|
'received',
|
|
41
|
+
'report',
|
|
40
42
|
'signal',
|
|
41
43
|
'site',
|
|
42
44
|
'starting',
|
|
@@ -51,6 +53,44 @@ export function houseDoorRoute(act) {
|
|
|
51
53
|
export function houseSiteRoute(act) {
|
|
52
54
|
return `/_house/door/${act}`;
|
|
53
55
|
}
|
|
56
|
+
export const SITE_QUERY = 'query';
|
|
57
|
+
export const SITE_FRESH_QUERY = 'fresh';
|
|
58
|
+
export const SITE_QUERY_ROUTE_CHARACTERS = 12_000;
|
|
59
|
+
function addressed(text) {
|
|
60
|
+
let binary = '';
|
|
61
|
+
for (const byte of new TextEncoder().encode(text))
|
|
62
|
+
binary += String.fromCharCode(byte);
|
|
63
|
+
return btoa(binary).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/u, '');
|
|
64
|
+
}
|
|
65
|
+
export function siteQueryRoute(room, query, fresh = false) {
|
|
66
|
+
const canonical = queryKey(JSON.parse(JSON.stringify(query)));
|
|
67
|
+
const named = fresh ? SITE_FRESH_QUERY : SITE_QUERY;
|
|
68
|
+
return `${houseSiteRoute('query')}/${room}?${named}=${addressed(canonical)}`;
|
|
69
|
+
}
|
|
70
|
+
export function siteQueryAsked(address) {
|
|
71
|
+
let asked;
|
|
72
|
+
try {
|
|
73
|
+
const binary = atob(address.replaceAll('-', '+').replaceAll('_', '/'));
|
|
74
|
+
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
75
|
+
asked = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return plain(asked) && addressed(queryKey(asked)) === address ? asked : null;
|
|
81
|
+
}
|
|
54
82
|
export const SITES_SUBMISSIONS_CREATE = 'sites/submissions/create';
|
|
55
83
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
84
|
+
export const SITES_FUNCTIONS_CALL = 'sites/functions/call';
|
|
85
|
+
export const SITE_DOOR_FUNCTION = '/_house/door/function';
|
|
86
|
+
export const SITE_DOOR_ACTS = {
|
|
87
|
+
[SITES_SUBMISSIONS_CREATE]: SITE_DOOR_SUBMIT,
|
|
88
|
+
[SITES_FUNCTIONS_CALL]: SITE_DOOR_FUNCTION,
|
|
89
|
+
};
|
|
90
|
+
export const SITE_DOOR_TOOL = 'app_update';
|
|
91
|
+
export const SITE_DOOR_OPS = {
|
|
92
|
+
submission_create: SITE_DOOR_SUBMIT,
|
|
93
|
+
function_call: SITE_DOOR_FUNCTION,
|
|
94
|
+
};
|
|
56
95
|
export const SITE_FILES = '/_house/files/';
|
|
96
|
+
export const SITE_IMAGE_COPIES_HEADER = 'X-House-Image-Copies';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProviderRefusal, type TransportUncertainty } from '@agentshouse/mdruntime';
|
|
2
|
+
export declare const UNANSWERED: TransportUncertainty;
|
|
3
|
+
export declare function failedOn(failure: unknown): TransportUncertainty;
|
|
4
|
+
export declare function unusable(): TransportUncertainty;
|
|
5
|
+
export declare function refusedFor(refusal: ProviderRefusal): TransportUncertainty;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncertain.d.ts","sourceRoot":"","sources":["../src/uncertain.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,UAAU,EAAE,oBAAwD,CAAC;AAElF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAE/D;AAED,wBAAgB,QAAQ,IAAI,oBAAoB,CAE/C;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,oBAAoB,CAEzE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { refusalError, } from '@agentshouse/mdruntime';
|
|
2
|
+
export const UNANSWERED = { kind: 'transport-uncertainty' };
|
|
3
|
+
export function failedOn(failure) {
|
|
4
|
+
return { kind: 'transport-uncertainty', failure };
|
|
5
|
+
}
|
|
6
|
+
export function unusable() {
|
|
7
|
+
return failedOn(new Error());
|
|
8
|
+
}
|
|
9
|
+
export function refusedFor(refusal) {
|
|
10
|
+
return failedOn(refusalError(refusal));
|
|
11
|
+
}
|
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;
|
|
@@ -8,4 +9,9 @@ export type HouseUpload = {
|
|
|
8
9
|
}[];
|
|
9
10
|
};
|
|
10
11
|
export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
11
|
-
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer |
|
|
12
|
+
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | {
|
|
13
|
+
readonly unfinished: number;
|
|
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"}
|