@agentshouse/mdruntime 0.1.0-c30ed2b8e04d5 → 0.1.0-c389df724fd2f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +55 -19
- package/README.md +7 -6
- package/dist/adapter.d.ts +30 -2
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +15 -2
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +1 -0
- package/dist/client.d.ts +6 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -0
- package/dist/connection.d.ts +8 -5
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +70 -27
- package/dist/conversation.d.ts +17 -6
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +167 -78
- package/dist/host.d.ts +1 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/memory.d.ts +3 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +20 -1
- package/dist/model.d.ts +10 -6
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -3
- package/dist/paths.d.ts +0 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +0 -16
- package/dist/query.d.ts +1 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +71 -33
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +9 -16
- package/dist/react.d.ts +39 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +63 -0
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +102 -46
- package/dist/replica.d.ts +3 -3
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +4 -3
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +75 -38
- package/dist/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +89 -45
- package/dist/store.d.ts +5 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +13 -2
- package/dist/wire.d.ts +2 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +2 -0
- package/package.json +14 -2
package/dist/conversation.js
CHANGED
|
@@ -20,11 +20,18 @@ export function unheldView(conversation) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function startedTurn(turn, operation) {
|
|
23
|
+
if (operation.op === 'begin')
|
|
24
|
+
return { turn, started: operation.at, parts: [], context: null };
|
|
23
25
|
if (operation.op === 'context') {
|
|
24
|
-
return {
|
|
26
|
+
return {
|
|
27
|
+
turn,
|
|
28
|
+
started: null,
|
|
29
|
+
parts: [],
|
|
30
|
+
context: { used: operation.used, window: operation.window },
|
|
31
|
+
};
|
|
25
32
|
}
|
|
26
33
|
return operation.op === 'start' && operation.index === 0
|
|
27
|
-
? { turn, parts: [structuredClone(operation.part)], context: null }
|
|
34
|
+
? { turn, started: null, parts: [structuredClone(operation.part)], context: null }
|
|
28
35
|
: null;
|
|
29
36
|
}
|
|
30
37
|
function changedFields(part, operation) {
|
|
@@ -39,6 +46,8 @@ function changedFields(part, operation) {
|
|
|
39
46
|
return { entries: structuredClone(operation.entries) };
|
|
40
47
|
}
|
|
41
48
|
function appliedTurn(held, operation) {
|
|
49
|
+
if (operation.op === 'begin')
|
|
50
|
+
return { ...held, started: operation.at };
|
|
42
51
|
if (operation.op === 'context') {
|
|
43
52
|
return { ...held, context: { used: operation.used, window: operation.window } };
|
|
44
53
|
}
|
|
@@ -156,6 +165,11 @@ export function createConversationStore(deps) {
|
|
|
156
165
|
const gaps = new Map();
|
|
157
166
|
const lives = new Map();
|
|
158
167
|
const views = new Map();
|
|
168
|
+
const listing = new Map();
|
|
169
|
+
const listWatchers = new Set();
|
|
170
|
+
let listKnown = false;
|
|
171
|
+
let agentNames = new Map();
|
|
172
|
+
let agentsRead = null;
|
|
159
173
|
let replicated = new Set();
|
|
160
174
|
let handedReplicated;
|
|
161
175
|
function liveOf(conversation) {
|
|
@@ -204,8 +218,70 @@ export function createConversationStore(deps) {
|
|
|
204
218
|
watcher.notify(value);
|
|
205
219
|
}
|
|
206
220
|
}
|
|
221
|
+
function stateOf(conversation) {
|
|
222
|
+
const facts = liveOf(conversation);
|
|
223
|
+
if (facts.questions.length > 0)
|
|
224
|
+
return 'asking';
|
|
225
|
+
return facts.turn === null ? 'idle' : 'working';
|
|
226
|
+
}
|
|
227
|
+
function entries() {
|
|
228
|
+
return [...listing.values()].map((entry) => ({
|
|
229
|
+
conversation: entry.conversation,
|
|
230
|
+
agent: { identity: entry.agent, name: agentNames.get(entry.agent) ?? null },
|
|
231
|
+
name: entry.name,
|
|
232
|
+
created: entry.created,
|
|
233
|
+
finished: entry.finished,
|
|
234
|
+
outcome: entry.outcome,
|
|
235
|
+
state: stateOf(entry.conversation),
|
|
236
|
+
started: lives.get(entry.conversation)?.turn?.started ?? null,
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
function emitList() {
|
|
240
|
+
if (deps.closed() || listWatchers.size === 0)
|
|
241
|
+
return;
|
|
242
|
+
const value = entries();
|
|
243
|
+
for (const watcher of listWatchers)
|
|
244
|
+
watcher(value);
|
|
245
|
+
}
|
|
246
|
+
function setLive(conversation, next) {
|
|
247
|
+
const before = stateOf(conversation);
|
|
248
|
+
const began = lives.get(conversation)?.turn?.started;
|
|
249
|
+
if (next === null)
|
|
250
|
+
lives.delete(conversation);
|
|
251
|
+
else
|
|
252
|
+
lives.set(conversation, next);
|
|
253
|
+
if (!listing.has(conversation))
|
|
254
|
+
return;
|
|
255
|
+
if (stateOf(conversation) !== before || next?.turn?.started !== began)
|
|
256
|
+
emitList();
|
|
257
|
+
}
|
|
258
|
+
async function readAgents() {
|
|
259
|
+
const declaration = deps.agents();
|
|
260
|
+
if (declaration === undefined)
|
|
261
|
+
return;
|
|
262
|
+
const { documents } = await deps.documents(declaration.locator);
|
|
263
|
+
const names = new Map();
|
|
264
|
+
for (const document of documents) {
|
|
265
|
+
if (document.type !== declaration.type)
|
|
266
|
+
continue;
|
|
267
|
+
const identity = document.fields?.[declaration.identity];
|
|
268
|
+
const name = document.fields?.[declaration.name];
|
|
269
|
+
if (typeof identity === 'string' && typeof name === 'string')
|
|
270
|
+
names.set(identity, name);
|
|
271
|
+
}
|
|
272
|
+
if (JSON.stringify([...names]) === JSON.stringify([...agentNames]))
|
|
273
|
+
return;
|
|
274
|
+
agentNames = names;
|
|
275
|
+
emitList();
|
|
276
|
+
}
|
|
277
|
+
function agentsReady() {
|
|
278
|
+
agentsRead ??= readAgents().catch(() => {
|
|
279
|
+
agentsRead = null;
|
|
280
|
+
});
|
|
281
|
+
return agentsRead;
|
|
282
|
+
}
|
|
207
283
|
function live(conversation, change) {
|
|
208
|
-
|
|
284
|
+
setLive(conversation, { ...liveOf(conversation), ...change });
|
|
209
285
|
emit(conversation, false);
|
|
210
286
|
}
|
|
211
287
|
function relayed(conversation, turn, operation) {
|
|
@@ -218,7 +294,7 @@ export function createConversationStore(deps) {
|
|
|
218
294
|
const held = lives.get(conversation);
|
|
219
295
|
if (held?.turn == null || !turns.has(held.turn.turn))
|
|
220
296
|
return false;
|
|
221
|
-
|
|
297
|
+
setLive(conversation, { ...held, turn: null });
|
|
222
298
|
return true;
|
|
223
299
|
}
|
|
224
300
|
function handReplicated() {
|
|
@@ -232,27 +308,6 @@ export function createConversationStore(deps) {
|
|
|
232
308
|
handedReplicated = named;
|
|
233
309
|
stream.replicate(held);
|
|
234
310
|
}
|
|
235
|
-
async function documented() {
|
|
236
|
-
const declaration = deps.cards();
|
|
237
|
-
if (declaration === undefined)
|
|
238
|
-
return [];
|
|
239
|
-
const { documents } = await deps.documents(declaration.locator);
|
|
240
|
-
return documents.filter((document) => typeof document.type === 'string');
|
|
241
|
-
}
|
|
242
|
-
function carded(documents) {
|
|
243
|
-
const declaration = deps.cards();
|
|
244
|
-
if (declaration === undefined)
|
|
245
|
-
return [];
|
|
246
|
-
const cards = [];
|
|
247
|
-
for (const card of documents) {
|
|
248
|
-
if (card.type !== declaration.type)
|
|
249
|
-
continue;
|
|
250
|
-
const identity = card.fields[declaration.identity];
|
|
251
|
-
if (typeof identity === 'string')
|
|
252
|
-
cards.push({ conversation: identity, card });
|
|
253
|
-
}
|
|
254
|
-
return cards;
|
|
255
|
-
}
|
|
256
311
|
async function remove(leaving) {
|
|
257
312
|
await deps.durably(async (local) => {
|
|
258
313
|
await local.dropConversations(leaving);
|
|
@@ -269,7 +324,7 @@ export function createConversationStore(deps) {
|
|
|
269
324
|
reads.delete(conversation);
|
|
270
325
|
drafts.delete(conversation);
|
|
271
326
|
behind.delete(conversation);
|
|
272
|
-
|
|
327
|
+
setLive(conversation, null);
|
|
273
328
|
}
|
|
274
329
|
if (changed.length > 0)
|
|
275
330
|
deps.publish(conversationChangeSet(removed, changed));
|
|
@@ -365,6 +420,48 @@ export function createConversationStore(deps) {
|
|
|
365
420
|
}
|
|
366
421
|
});
|
|
367
422
|
}
|
|
423
|
+
function heard(event) {
|
|
424
|
+
const { conversation } = event;
|
|
425
|
+
if (event.kind === 'gap') {
|
|
426
|
+
if (replicated.has(conversation))
|
|
427
|
+
gap(conversation);
|
|
428
|
+
const held = lives.get(conversation);
|
|
429
|
+
if (held === undefined)
|
|
430
|
+
return;
|
|
431
|
+
setLive(conversation, { ...QUIET, turn: held.turn });
|
|
432
|
+
emit(conversation, false);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
if (event.kind === 'turn') {
|
|
436
|
+
relayed(conversation, event.turn, event.operation);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (event.kind === 'questions') {
|
|
440
|
+
live(conversation, { questions: structuredClone(event.questions) });
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (event.kind === 'process') {
|
|
444
|
+
live(conversation, { process: { running: event.running } });
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
if (event.kind === 'commands') {
|
|
448
|
+
live(conversation, { commands: structuredClone(event.commands) });
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (event.kind === 'options') {
|
|
452
|
+
live(conversation, { options: structuredClone(event.options) });
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const arriving = acceptedMessage(event.message);
|
|
456
|
+
if (arriving === null)
|
|
457
|
+
return;
|
|
458
|
+
if (replicated.has(conversation)) {
|
|
459
|
+
void keep(conversation, arriving).catch(() => { });
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (sealTurns(conversation, new Set([arriving.turn])))
|
|
463
|
+
emit(conversation);
|
|
464
|
+
}
|
|
368
465
|
function withDraft(conversation, next) {
|
|
369
466
|
return deps.durably(async (local) => {
|
|
370
467
|
const following = next(drafts.get(conversation));
|
|
@@ -386,17 +483,8 @@ export function createConversationStore(deps) {
|
|
|
386
483
|
}
|
|
387
484
|
const surface = {
|
|
388
485
|
async list() {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return [];
|
|
392
|
-
const documents = await documented();
|
|
393
|
-
const entries = carded(documents).map(({ conversation, card }) => ({
|
|
394
|
-
conversation,
|
|
395
|
-
card,
|
|
396
|
-
agent: documents.find((document) => document.backlinks.some((backlink) => backlink.path === card.path && backlink.field === declaration.agent)) ?? null,
|
|
397
|
-
}));
|
|
398
|
-
entries.sort((left, right) => (left.conversation < right.conversation ? -1 : 1));
|
|
399
|
-
return entries;
|
|
486
|
+
await agentsReady();
|
|
487
|
+
return entries();
|
|
400
488
|
},
|
|
401
489
|
async read(conversation, options = {}) {
|
|
402
490
|
const limit = limitOf(options);
|
|
@@ -492,7 +580,9 @@ export function createConversationStore(deps) {
|
|
|
492
580
|
drafts.set(record.conversation, record);
|
|
493
581
|
},
|
|
494
582
|
async reconcile() {
|
|
495
|
-
|
|
583
|
+
if (!listKnown)
|
|
584
|
+
return;
|
|
585
|
+
const named = new Set(listing.keys());
|
|
496
586
|
const leaving = [
|
|
497
587
|
...new Set([...replicated, ...messages.keys(), ...reads.keys(), ...drafts.keys()]),
|
|
498
588
|
].filter((conversation) => !named.has(conversation));
|
|
@@ -550,53 +640,51 @@ export function createConversationStore(deps) {
|
|
|
550
640
|
views.delete(key);
|
|
551
641
|
};
|
|
552
642
|
},
|
|
643
|
+
watchList(deliver) {
|
|
644
|
+
listWatchers.add(deliver);
|
|
645
|
+
void agentsReady().then(() => {
|
|
646
|
+
if (!deps.closed() && listWatchers.has(deliver))
|
|
647
|
+
deliver(entries());
|
|
648
|
+
});
|
|
649
|
+
return () => {
|
|
650
|
+
listWatchers.delete(deliver);
|
|
651
|
+
};
|
|
652
|
+
},
|
|
553
653
|
changed(set) {
|
|
554
654
|
for (const conversation of set.conversations)
|
|
555
655
|
emit(conversation);
|
|
656
|
+
const declaration = deps.agents();
|
|
657
|
+
if (declaration !== undefined &&
|
|
658
|
+
set.documents.some((change) => change.locator === declaration.locator)) {
|
|
659
|
+
agentsRead = readAgents().catch(() => {
|
|
660
|
+
agentsRead = null;
|
|
661
|
+
});
|
|
662
|
+
}
|
|
556
663
|
},
|
|
557
664
|
receive(event) {
|
|
558
665
|
if (deps.closed())
|
|
559
|
-
return;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
if (event.kind === 'process') {
|
|
580
|
-
live(conversation, { process: { running: event.running } });
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
if (event.kind === 'commands') {
|
|
584
|
-
live(conversation, { commands: structuredClone(event.commands) });
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
if (event.kind === 'options') {
|
|
588
|
-
live(conversation, { options: structuredClone(event.options) });
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
const arriving = acceptedMessage(event.message);
|
|
592
|
-
if (arriving === null)
|
|
593
|
-
return;
|
|
594
|
-
if (replicated.has(conversation)) {
|
|
595
|
-
void keep(conversation, arriving).catch(() => { });
|
|
596
|
-
return;
|
|
666
|
+
return false;
|
|
667
|
+
if (event.kind === 'list' || event.kind === 'listed' || event.kind === 'unlisted') {
|
|
668
|
+
if (event.kind === 'list') {
|
|
669
|
+
listing.clear();
|
|
670
|
+
for (const entry of event.entries)
|
|
671
|
+
listing.set(entry.conversation, { ...entry });
|
|
672
|
+
listKnown = true;
|
|
673
|
+
}
|
|
674
|
+
else if (event.kind === 'listed') {
|
|
675
|
+
listing.set(event.entry.conversation, { ...event.entry });
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
listing.delete(event.conversation);
|
|
679
|
+
}
|
|
680
|
+
emitList();
|
|
681
|
+
return (event.kind !== 'list' &&
|
|
682
|
+
listKnown &&
|
|
683
|
+
(listing.size !== replicated.size ||
|
|
684
|
+
[...listing.keys()].some((conversation) => !replicated.has(conversation))));
|
|
597
685
|
}
|
|
598
|
-
|
|
599
|
-
|
|
686
|
+
heard(event);
|
|
687
|
+
return false;
|
|
600
688
|
},
|
|
601
689
|
messages() {
|
|
602
690
|
return [...messages].flatMap(([conversation, held]) => held.map(({ identity, text }) => ({ conversation, identity, text })));
|
|
@@ -608,6 +696,7 @@ export function createConversationStore(deps) {
|
|
|
608
696
|
close() {
|
|
609
697
|
views.clear();
|
|
610
698
|
lives.clear();
|
|
699
|
+
listWatchers.clear();
|
|
611
700
|
},
|
|
612
701
|
};
|
|
613
702
|
}
|
package/dist/host.d.ts
CHANGED
|
@@ -15,5 +15,6 @@ export type MdRuntimeHost = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
|
|
17
17
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
18
|
+
export { STORE_SCHEMA } from './store.js';
|
|
18
19
|
export type { RuntimePort } from './wire.js';
|
|
19
20
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAGL,KAAK,WAAW,EAOjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IAC1F,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AA0EF,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAwH3E;AAED,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAGL,KAAK,WAAW,EAOjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IAC1F,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AA0EF,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAwH3E;AAED,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type { AcceptedMessage, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, Authorization, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction,
|
|
1
|
+
export type { AcceptedMessage, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, Authorization, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationAgents, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, HeldRoom, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomAttachment, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnContext, TurnOperation, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, WrittenBy } from './change.js';
|
|
3
|
-
export type { ChatDraft, ChatDraftSurface, ConversationEntry, ConversationOptions, ConversationSurface, ConversationView, RunningTurn, } from './conversation.js';
|
|
3
|
+
export type { ChatDraft, ChatDraftSurface, ConversationEntry, ConversationOptions, ConversationState, ConversationSurface, ConversationView, RunningTurn, } from './conversation.js';
|
|
4
4
|
export type { ChatDraftFile, FileDeclaration } from './file.js';
|
|
5
|
-
export type { AppRoom, AppTypedSelection, ConnectionRefusal, ConnectionRefusalReason, HistoryQuery, MdRuntime, MdRuntimeOptions, PresentationSurface, RoomDraftSurface,
|
|
5
|
+
export type { AppRoom, AppTypedSelection, ConnectionRefusal, ConnectionRefusalReason, HistoryQuery, MdRuntime, MdRuntimeOptions, PresentationSurface, RoomDraftSurface, RoomSchemas, SavedRoomDraft, SaveResult, } from './connection.js';
|
|
6
6
|
export type { Observation } from './observation.js';
|
|
7
7
|
export type { CallResult, QueueEntry, Submission } from './outcome.js';
|
|
8
8
|
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, } from './room-draft.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChF,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAChE,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACX,GAAG,EACH,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/memory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelResult } from './model.js';
|
|
2
|
-
import { type AcceptedMessage, type ActionResult, type Adapter, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type HeadChange, type ProviderLimit, type Retention, type RoomAttachment, type ServiceMode } from './adapter.js';
|
|
2
|
+
import { type AcceptedMessage, type ActionResult, type Adapter, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type HeadChange, type ListedConversation, type Member, type ProviderLimit, type Retention, type RoomAttachment, type ServiceMode } from './adapter.js';
|
|
3
3
|
export type MemoryRoom = DiscoveredRoom & {
|
|
4
4
|
model?: ModelResult;
|
|
5
5
|
selectionModel?: ModelResult;
|
|
@@ -11,6 +11,7 @@ export type MemoryRoom = DiscoveredRoom & {
|
|
|
11
11
|
};
|
|
12
12
|
export type MemoryConversation = {
|
|
13
13
|
conversation: string;
|
|
14
|
+
listed?: Omit<ListedConversation, 'conversation'>;
|
|
14
15
|
messages?: readonly AcceptedMessage[];
|
|
15
16
|
outcomes?: Partial<Record<ConversationAction, ActionResult>>;
|
|
16
17
|
};
|
|
@@ -22,6 +23,7 @@ export type MemoryAdapterOptions = {
|
|
|
22
23
|
capabilities?: readonly Capability[];
|
|
23
24
|
providerLimits?: readonly ProviderLimit[];
|
|
24
25
|
retention?: Retention;
|
|
26
|
+
member?: Member;
|
|
25
27
|
unopened?: boolean;
|
|
26
28
|
};
|
|
27
29
|
export type MemoryAdapter = Adapter & {
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EAIZ,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAItB,KAAK,cAAc,EACnB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA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
100
|
name: room.name,
|
|
101
101
|
locator: room.locator,
|
|
102
|
+
handle: room.handle,
|
|
102
103
|
roomVersion: room.roomVersion,
|
|
103
104
|
operations: room.operations,
|
|
104
105
|
replica: room.replica,
|
|
@@ -233,6 +234,11 @@ export function createMemoryAdapter(options = {}) {
|
|
|
233
234
|
scripted.delete(named);
|
|
234
235
|
return { kind: 'action', result: { conversation: named } };
|
|
235
236
|
}
|
|
237
|
+
function announceList() {
|
|
238
|
+
const entries = [...scripted.values()].flatMap(({ conversation, listed }) => listed === undefined ? [] : [{ conversation, ...listed }]);
|
|
239
|
+
for (const listener of listeners)
|
|
240
|
+
listener({ kind: 'list', entries });
|
|
241
|
+
}
|
|
236
242
|
function discovery() {
|
|
237
243
|
return {
|
|
238
244
|
kind: 'discovery',
|
|
@@ -240,6 +246,7 @@ export function createMemoryAdapter(options = {}) {
|
|
|
240
246
|
capabilities,
|
|
241
247
|
providerLimits,
|
|
242
248
|
retention,
|
|
249
|
+
...(options.member === undefined ? {} : { member: options.member }),
|
|
243
250
|
};
|
|
244
251
|
}
|
|
245
252
|
return {
|
|
@@ -251,6 +258,7 @@ export function createMemoryAdapter(options = {}) {
|
|
|
251
258
|
scriptConversations(next);
|
|
252
259
|
},
|
|
253
260
|
open() {
|
|
261
|
+
announceList();
|
|
254
262
|
for (const observer of observers)
|
|
255
263
|
observer({ kind: 'opened' });
|
|
256
264
|
},
|
|
@@ -323,12 +331,23 @@ export function createMemoryAdapter(options = {}) {
|
|
|
323
331
|
}
|
|
324
332
|
});
|
|
325
333
|
},
|
|
334
|
+
reopen() {
|
|
335
|
+
queueMicrotask(() => {
|
|
336
|
+
for (const observer of observers)
|
|
337
|
+
observer({ kind: 'closed', revoked: false });
|
|
338
|
+
});
|
|
339
|
+
},
|
|
326
340
|
observe(notify) {
|
|
327
341
|
observers.add(notify);
|
|
328
342
|
queueMicrotask(() => {
|
|
329
343
|
if (!observers.has(notify))
|
|
330
344
|
return;
|
|
331
|
-
|
|
345
|
+
if (options.unopened === true) {
|
|
346
|
+
notify({ kind: 'closed', revoked: false });
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
announceList();
|
|
350
|
+
notify({ kind: 'opened' });
|
|
332
351
|
});
|
|
333
352
|
return () => {
|
|
334
353
|
observers.delete(notify);
|
package/dist/model.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Definition,
|
|
1
|
+
import type { Definition, ValueFacts, VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
2
|
export type ModelIdentity = {
|
|
3
3
|
identity: string;
|
|
4
4
|
version: string;
|
|
5
5
|
};
|
|
6
6
|
export type ModelSnapshot = ModelIdentity & {
|
|
7
7
|
schema: string | null;
|
|
8
|
+
revision: string | null;
|
|
8
9
|
};
|
|
9
10
|
export type ModelUnavailableReason = 'not-readable' | 'revoked' | 'not-acquired' | 'invalid';
|
|
10
11
|
export type ModelResult = {
|
|
@@ -14,14 +15,12 @@ export type ModelResult = {
|
|
|
14
15
|
kind: 'model-unavailable';
|
|
15
16
|
reason: ModelUnavailableReason;
|
|
16
17
|
};
|
|
17
|
-
export type MdType =
|
|
18
|
-
name: string;
|
|
19
|
-
fields: Readonly<Record<string, FieldSpec>>;
|
|
20
|
-
sections: Readonly<Record<string, SectionSpec>>;
|
|
21
|
-
};
|
|
18
|
+
export type MdType = Definition;
|
|
22
19
|
export type ModelState = {
|
|
23
20
|
status: 'unavailable';
|
|
24
21
|
reason: ModelUnavailableReason;
|
|
22
|
+
schema?: string | null;
|
|
23
|
+
revision?: string | null;
|
|
25
24
|
} | {
|
|
26
25
|
status: 'current' | 'cached';
|
|
27
26
|
snapshot: ModelSnapshot;
|
|
@@ -31,12 +30,16 @@ export type ModelState = {
|
|
|
31
30
|
export type TypesResult = {
|
|
32
31
|
status: 'unavailable';
|
|
33
32
|
reason: ModelUnavailableReason;
|
|
33
|
+
schema?: string | null;
|
|
34
|
+
revision?: string | null;
|
|
34
35
|
} | {
|
|
35
36
|
status: 'current' | 'cached';
|
|
36
37
|
identity: string;
|
|
37
38
|
version: string;
|
|
38
39
|
verifiedWith: ModelIdentity;
|
|
39
40
|
types: readonly MdType[];
|
|
41
|
+
schema: string | null;
|
|
42
|
+
revision: string | null;
|
|
40
43
|
};
|
|
41
44
|
export type ValidationReceipt = {
|
|
42
45
|
identity: string;
|
|
@@ -48,4 +51,5 @@ export declare function definitionOf(state: ModelState, type: string | undefined
|
|
|
48
51
|
export declare function modelTypes(state: ModelState): TypesResult;
|
|
49
52
|
export declare function cached(state: ModelState): ModelState;
|
|
50
53
|
export declare function sameModel(left: ModelIdentity, right: ModelIdentity): boolean;
|
|
54
|
+
export declare function referenceField(facts: ValueFacts | undefined): boolean;
|
|
51
55
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElF,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAC/F,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAAC;AAC7F,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GAC1C;IAAE,IAAI,EA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AU,GAAG,SAAS,CAGhG;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAgBzD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEpD;AACD,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAE5E;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAErE"}
|
package/dist/model.js
CHANGED
|
@@ -12,9 +12,9 @@ export function modelTypes(state) {
|
|
|
12
12
|
identity: state.snapshot.identity,
|
|
13
13
|
version: state.snapshot.version,
|
|
14
14
|
verifiedWith: { ...state.verifiedWith },
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
schema: state.snapshot.schema,
|
|
16
|
+
revision: state.snapshot.revision,
|
|
17
|
+
types: structuredClone(Object.values(state.types).sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export function cached(state) {
|
|
@@ -23,3 +23,6 @@ export function cached(state) {
|
|
|
23
23
|
export function sameModel(left, right) {
|
|
24
24
|
return left.identity === right.identity && left.version === right.version;
|
|
25
25
|
}
|
|
26
|
+
export function referenceField(facts) {
|
|
27
|
+
return facts?.reference !== undefined || facts?.items?.reference !== undefined;
|
|
28
|
+
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare function normalize(path: string): string | null;
|
|
2
|
-
export declare function relative(from: string, target: string): string;
|
|
3
2
|
export declare function beneath(prefix: string, path: string): boolean;
|
|
4
3
|
export declare function covered(prefixes: readonly string[], path: string): boolean;
|
|
5
4
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E"}
|
package/dist/paths.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function dirname(path) {
|
|
2
|
-
const index = path.lastIndexOf('/');
|
|
3
|
-
return index === -1 ? '' : path.slice(0, index);
|
|
4
|
-
}
|
|
5
1
|
export function normalize(path) {
|
|
6
2
|
const parts = [];
|
|
7
3
|
for (const part of path.split('/')) {
|
|
@@ -17,18 +13,6 @@ export function normalize(path) {
|
|
|
17
13
|
}
|
|
18
14
|
return parts.join('/');
|
|
19
15
|
}
|
|
20
|
-
export function relative(from, target) {
|
|
21
|
-
const base = dirname(from)
|
|
22
|
-
.split('/')
|
|
23
|
-
.filter((part) => part !== '');
|
|
24
|
-
const parts = target.split('/');
|
|
25
|
-
let shared = 0;
|
|
26
|
-
while (shared < base.length && shared + 1 < parts.length && base[shared] === parts[shared]) {
|
|
27
|
-
shared += 1;
|
|
28
|
-
}
|
|
29
|
-
const up = Array.from({ length: base.length - shared }, () => '..');
|
|
30
|
-
return [...up, ...parts.slice(shared)].join('/');
|
|
31
|
-
}
|
|
32
16
|
export function beneath(prefix, path) {
|
|
33
17
|
return path === prefix || path.startsWith(`${prefix}/`);
|
|
34
18
|
}
|
package/dist/query.d.ts
CHANGED
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,O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