@agentshouse/mdruntime 0.1.0-cff1b70c6ad46 → 0.1.0-cffcba9cd9c2f
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/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +48 -124
- package/dist/actions.js +2 -2
- package/dist/adapter.d.ts +16 -44
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -19
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/client.d.ts +3 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -3
- package/dist/collection.d.ts +22 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +12 -2
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +13 -13
- package/dist/conversation-live.d.ts +3 -4
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +2 -3
- package/dist/conversation.d.ts +4 -6
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +43 -71
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +5 -3
- package/dist/failure.d.ts +1 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -0
- package/dist/host.d.ts +17 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +16 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/install.d.ts +0 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +46 -57
- package/dist/job.d.ts +1 -29
- package/dist/job.d.ts.map +1 -1
- package/dist/job.js +2 -49
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +9 -6
- package/dist/listing.d.ts +3 -4
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +14 -22
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +3 -1
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +2 -1
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +3 -3
- package/dist/memory.d.ts +4 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +8 -6
- package/dist/messages.d.ts +0 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +0 -14
- package/dist/model.d.ts +0 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -5
- package/dist/models.d.ts +4 -8
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +101 -126
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +6 -4
- package/dist/overlay.d.ts +2 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +32 -21
- package/dist/parts.d.ts +3 -52
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +15 -120
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +10 -3
- package/dist/queue.d.ts +32 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +402 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +5 -4
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +4 -1
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +3 -1
- package/dist/replica.d.ts +5 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +12 -14
- package/dist/room-draft.d.ts +3 -2
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +33 -20
- package/dist/room-drafts.js +3 -3
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -4
- package/dist/runtime.d.ts +5 -16
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +5 -10
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +59 -56
- package/dist/saves.d.ts +2 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +23 -349
- package/dist/shown.d.ts +2 -1
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +13 -6
- package/dist/socket/rooms.d.ts +1 -4
- package/dist/socket/rooms.d.ts.map +1 -1
- package/dist/socket.d.ts +0 -1
- package/dist/socket.d.ts.map +1 -1
- package/dist/store/records.d.ts +0 -2
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +0 -3
- package/dist/store.d.ts +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +1 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +3 -3
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +2 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +18 -20
- package/dist/tables.d.ts +0 -4
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +1 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/wire.d.ts +4 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +3 -3
- package/package.json +3 -2
package/dist/conversation.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { cursorOf, decodedCursor } from '@agentshouse/mdmodel';
|
|
2
|
+
import { applied, isTurn, standingState, } from '@agentshouse/session-content';
|
|
2
3
|
import { conversationChangeSet } from './change-set.js';
|
|
3
4
|
import { FACTS, QUIET, } from './conversation-live.js';
|
|
4
5
|
import { heldFacts } from './conversation-row.js';
|
|
5
|
-
import { runtimeError } from './failure.js';
|
|
6
|
+
import { runtimeError, uncaught } from './failure.js';
|
|
6
7
|
import { refusedForSpace } from './durability.js';
|
|
7
8
|
import { changeBatchIdentity, chatDraftRevision } from './identity.js';
|
|
8
9
|
import { OFFLINE } from './outcome.js';
|
|
9
|
-
import {
|
|
10
|
+
import { runningLine } from './parts.js';
|
|
11
|
+
import { record, text } from './read.js';
|
|
10
12
|
import { openQuestion, questionAsked } from './questions.js';
|
|
11
13
|
import { untilAnswered } from './recovery.js';
|
|
12
14
|
import { capped, FROM_START, messageOrder, precedes } from './windows.js';
|
|
@@ -21,11 +23,10 @@ export function unheldView(conversation) {
|
|
|
21
23
|
commands: [],
|
|
22
24
|
options: [],
|
|
23
25
|
starting: null,
|
|
24
|
-
|
|
26
|
+
state: null,
|
|
25
27
|
link: null,
|
|
26
28
|
deliveryUnknown: [],
|
|
27
29
|
chatDraft: null,
|
|
28
|
-
jobs: [],
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
export const SESSION_STARTED = 'Session started';
|
|
@@ -42,52 +43,15 @@ function creationOf(input) {
|
|
|
42
43
|
}
|
|
43
44
|
function startedTurn(turn, operation) {
|
|
44
45
|
if (operation.op === 'begin')
|
|
45
|
-
return { turn, started: operation.at, parts: []
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
turn,
|
|
49
|
-
started: null,
|
|
50
|
-
parts: [],
|
|
51
|
-
context: { used: operation.used, window: operation.window },
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return operation.op === 'start' && operation.index === 0
|
|
55
|
-
? { turn, started: null, parts: [structuredClone(operation.part)], context: null }
|
|
56
|
-
: null;
|
|
57
|
-
}
|
|
58
|
-
function changedFields(part, operation) {
|
|
59
|
-
if (operation.op === 'append') {
|
|
60
|
-
return { text: `${String(part.text ?? '')}${operation.text}` };
|
|
61
|
-
}
|
|
62
|
-
if (operation.op === 'status') {
|
|
63
|
-
return { status: operation.status, result: structuredClone(operation.result) };
|
|
64
|
-
}
|
|
65
|
-
if (operation.op === 'count')
|
|
66
|
-
return { count: operation.count };
|
|
67
|
-
return { entries: structuredClone(operation.entries) };
|
|
46
|
+
return { turn, started: operation.at, parts: [] };
|
|
47
|
+
const parts = applied([], operation);
|
|
48
|
+
return parts === null ? null : { turn, started: null, parts };
|
|
68
49
|
}
|
|
69
50
|
function appliedTurn(held, operation) {
|
|
70
51
|
if (operation.op === 'begin')
|
|
71
52
|
return { ...held, started: operation.at };
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
if (operation.op === 'start') {
|
|
76
|
-
if (operation.index !== 0 && operation.index !== held.parts.length)
|
|
77
|
-
return null;
|
|
78
|
-
return {
|
|
79
|
-
...held,
|
|
80
|
-
parts: [...held.parts.slice(0, operation.index), structuredClone(operation.part)],
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const part = held.parts[operation.index];
|
|
84
|
-
if (typeof part !== 'object' || part === null)
|
|
85
|
-
return null;
|
|
86
|
-
const changed = { ...part, ...changedFields(part, operation) };
|
|
87
|
-
return {
|
|
88
|
-
...held,
|
|
89
|
-
parts: held.parts.map((kept, at) => (at === operation.index ? changed : kept)),
|
|
90
|
-
};
|
|
53
|
+
const parts = applied(held.parts, operation);
|
|
54
|
+
return parts === null ? null : { ...held, parts };
|
|
91
55
|
}
|
|
92
56
|
function windowOf(held, arriving, limit) {
|
|
93
57
|
const byIdentity = new Map(held.map((message) => [message.identity, message]));
|
|
@@ -237,7 +201,7 @@ function returned(draft, submission, others) {
|
|
|
237
201
|
revision: chatDraftRevision(),
|
|
238
202
|
}, others);
|
|
239
203
|
}
|
|
240
|
-
function viewOf(alive, conversation, held, frame, draft, ended
|
|
204
|
+
function viewOf(alive, conversation, held, frame, draft, ended) {
|
|
241
205
|
const facts = alive.liveOf(conversation);
|
|
242
206
|
return {
|
|
243
207
|
conversation,
|
|
@@ -255,26 +219,36 @@ function viewOf(alive, conversation, held, frame, draft, ended, marked) {
|
|
|
255
219
|
commands: structuredClone(facts.commands),
|
|
256
220
|
options: structuredClone(facts.options),
|
|
257
221
|
starting: facts.starting,
|
|
258
|
-
|
|
222
|
+
state: sessionOf(facts, held, ended),
|
|
259
223
|
link: facts.link === null ? null : { ...facts.link },
|
|
260
224
|
deliveryUnknown: [...facts.deliveryUnknown],
|
|
261
225
|
chatDraft: draft === null || unwritten(draft) ? null : { text: draft.text, revision: draft.revision },
|
|
262
|
-
jobs: facts.process?.running === false
|
|
263
|
-
? []
|
|
264
|
-
: jobsOf(marked.filter(({ at }) => ended === null || at > ended), facts.turn),
|
|
265
226
|
};
|
|
266
227
|
}
|
|
228
|
+
function sessionOf(facts, held, ended) {
|
|
229
|
+
if (facts.state !== null)
|
|
230
|
+
return structuredClone(facts.state);
|
|
231
|
+
const saved = [...held]
|
|
232
|
+
.reverse()
|
|
233
|
+
.map(({ message }) => record(message))
|
|
234
|
+
.find(({ content }) => isTurn(content));
|
|
235
|
+
const at = saved === undefined ? null : text(saved, 'accepted_at');
|
|
236
|
+
if (saved === undefined || !isTurn(saved.content) || at === null)
|
|
237
|
+
return null;
|
|
238
|
+
const down = facts.process?.running === false;
|
|
239
|
+
return structuredClone(standingState(saved.content.state, at, down ? at : ended));
|
|
240
|
+
}
|
|
267
241
|
function emit(alive, conversation) {
|
|
268
242
|
if (alive.deps.closed())
|
|
269
243
|
return;
|
|
270
244
|
for (const view of alive.views()) {
|
|
271
|
-
const { window, draft, ended
|
|
245
|
+
const { window, draft, ended } = view.held.now();
|
|
272
246
|
if (view.conversation !== conversation || window === null)
|
|
273
247
|
continue;
|
|
274
248
|
const ready = view.ready();
|
|
275
249
|
if (ready.length === 0)
|
|
276
250
|
continue;
|
|
277
|
-
const value = viewOf(alive, conversation, window, sharedFrame(view, window), draft, ended
|
|
251
|
+
const value = viewOf(alive, conversation, window, sharedFrame(view, window), draft, ended);
|
|
278
252
|
for (const watcher of ready)
|
|
279
253
|
watcher.notify(value);
|
|
280
254
|
}
|
|
@@ -285,23 +259,18 @@ function sharedFrame(view, window) {
|
|
|
285
259
|
}
|
|
286
260
|
async function slide(alive, local, conversation, arriving) {
|
|
287
261
|
let count;
|
|
288
|
-
let marked;
|
|
289
262
|
for (const view of alive.views()) {
|
|
290
263
|
const { held } = view;
|
|
291
264
|
const { window, total } = held.now();
|
|
292
265
|
if (view.conversation !== conversation || window === null)
|
|
293
266
|
continue;
|
|
294
267
|
if (arriving === null) {
|
|
295
|
-
held.set({ window: [],
|
|
268
|
+
held.set({ window: [], more: false, total: total === null ? null : 0 });
|
|
296
269
|
continue;
|
|
297
270
|
}
|
|
298
271
|
const joining = arriving.filter((message) => precedes(message, view.asked.before));
|
|
299
272
|
const next = windowOf(window, joining, view.asked.limit);
|
|
300
273
|
held.set({ window: next.messages, more: held.now().more || next.dropped });
|
|
301
|
-
if (arriving.length > 0) {
|
|
302
|
-
marked ??= await local.jobMarkers(conversation);
|
|
303
|
-
held.set({ marked });
|
|
304
|
-
}
|
|
305
274
|
if (held.now().total !== null && arriving.length > 0) {
|
|
306
275
|
count ??= await local.messageCount(conversation);
|
|
307
276
|
held.set({ total: count });
|
|
@@ -399,7 +368,7 @@ function listChanged(alive, change) {
|
|
|
399
368
|
list.some(({ conversation }) => !replicated.has(conversation)))) {
|
|
400
369
|
alive.deps.again();
|
|
401
370
|
}
|
|
402
|
-
},
|
|
371
|
+
}, uncaught);
|
|
403
372
|
}
|
|
404
373
|
function endedAnew(alive, list) {
|
|
405
374
|
const entries = new Map(list.map((entry) => [entry.conversation, entry]));
|
|
@@ -415,7 +384,10 @@ function endedAnew(alive, list) {
|
|
|
415
384
|
function shownList(alive, work) {
|
|
416
385
|
const reading = heldList(alive);
|
|
417
386
|
alive.inOrder(async () => {
|
|
418
|
-
const list = await reading.catch(() =>
|
|
387
|
+
const list = await reading.catch((error) => {
|
|
388
|
+
uncaught(error);
|
|
389
|
+
return null;
|
|
390
|
+
});
|
|
419
391
|
if (list === null || alive.deps.closed())
|
|
420
392
|
return;
|
|
421
393
|
work(list);
|
|
@@ -550,7 +522,7 @@ function openingEnded(alive) {
|
|
|
550
522
|
commands: facts.has('commands') ? QUIET.commands : held.commands,
|
|
551
523
|
options: facts.has('options') ? QUIET.options : held.options,
|
|
552
524
|
starting: facts.has('starting') ? QUIET.starting : held.starting,
|
|
553
|
-
|
|
525
|
+
state: facts.has('state') ? QUIET.state : held.state,
|
|
554
526
|
link: facts.has('link') ? QUIET.link : held.link,
|
|
555
527
|
deliveryUnknown: facts.has('deliveryUnknown') ? QUIET.deliveryUnknown : held.deliveryUnknown,
|
|
556
528
|
});
|
|
@@ -634,7 +606,7 @@ function retiredDrafts(alive, list) {
|
|
|
634
606
|
held.some(({ conversation }) => retiredChat(conversation, list))) {
|
|
635
607
|
alive.deps.again();
|
|
636
608
|
}
|
|
637
|
-
},
|
|
609
|
+
}, uncaught);
|
|
638
610
|
}
|
|
639
611
|
function settleBehind(alive, list) {
|
|
640
612
|
void alive.deps
|
|
@@ -660,7 +632,7 @@ function settleBehind(alive, list) {
|
|
|
660
632
|
alive.deps.settled();
|
|
661
633
|
if (owed)
|
|
662
634
|
alive.deps.again();
|
|
663
|
-
},
|
|
635
|
+
}, uncaught);
|
|
664
636
|
}
|
|
665
637
|
function keep(alive, conversation, message) {
|
|
666
638
|
return alive.deps.durably(async (local) => {
|
|
@@ -786,8 +758,8 @@ function heard(alive, event) {
|
|
|
786
758
|
live(alive, conversation, { starting: event.step });
|
|
787
759
|
return;
|
|
788
760
|
}
|
|
789
|
-
if (event.kind === '
|
|
790
|
-
live(alive, conversation, {
|
|
761
|
+
if (event.kind === 'state') {
|
|
762
|
+
live(alive, conversation, { state: structuredClone(event.state) });
|
|
791
763
|
return;
|
|
792
764
|
}
|
|
793
765
|
if (event.kind === 'link') {
|
|
@@ -810,6 +782,8 @@ function heard(alive, event) {
|
|
|
810
782
|
void keep(alive, conversation, arriving).catch((error) => {
|
|
811
783
|
if (refusedForSpace(error))
|
|
812
784
|
alive.gapOpened(conversation);
|
|
785
|
+
else
|
|
786
|
+
uncaught(error);
|
|
813
787
|
});
|
|
814
788
|
return;
|
|
815
789
|
}
|
|
@@ -948,8 +922,7 @@ export function conversationSurface(alive) {
|
|
|
948
922
|
return alive.deps.durably(async (local) => {
|
|
949
923
|
const { messages, more } = await local.messageWindow(conversation, asked.limit, asked.before, phrase);
|
|
950
924
|
const total = asked.total ? await local.messageCount(conversation, phrase) : null;
|
|
951
|
-
|
|
952
|
-
return structuredClone(viewOf(alive, conversation, messages, frameOf(asked, messages, more, total), (await local.chatDraft(conversation)) ?? null, await endedIn(alive, conversation), marked));
|
|
925
|
+
return structuredClone(viewOf(alive, conversation, messages, frameOf(asked, messages, more, total), (await local.chatDraft(conversation)) ?? null, await endedIn(alive, conversation)));
|
|
953
926
|
});
|
|
954
927
|
},
|
|
955
928
|
async create(input) {
|
|
@@ -1126,16 +1099,15 @@ export function watchConversation(alive, conversation, options, deliver) {
|
|
|
1126
1099
|
held.set({ draft: (await local.chatDraft(conversation)) ?? null });
|
|
1127
1100
|
held.set({ ended: await endedIn(alive, conversation) });
|
|
1128
1101
|
held.set({ window: messages });
|
|
1129
|
-
held.set({ marked: await local.jobMarkers(conversation) });
|
|
1130
1102
|
held.set({ more });
|
|
1131
1103
|
held.set({ total: asked.total ? await local.messageCount(conversation) : null });
|
|
1132
1104
|
}), reading.signal)
|
|
1133
1105
|
.then(() => {
|
|
1134
1106
|
if (alive.deps.closed() || !view.admit(watcher))
|
|
1135
1107
|
return;
|
|
1136
|
-
const { window, draft, ended
|
|
1108
|
+
const { window, draft, ended } = held.now();
|
|
1137
1109
|
const shown = window ?? [];
|
|
1138
|
-
watcher.notify(viewOf(alive, conversation, shown, sharedFrame(view, shown), draft, ended
|
|
1110
|
+
watcher.notify(viewOf(alive, conversation, shown, sharedFrame(view, shown), draft, ended));
|
|
1139
1111
|
})
|
|
1140
1112
|
.catch(() => { });
|
|
1141
1113
|
return () => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DiscoveredRoom, OperationScopes, PathRule, RoomDeclaration } from './adapter.js';
|
|
2
|
+
export type WriteRefusal = {
|
|
3
|
+
readonly code: 'room-root' | 'provider-owned-path' | 'invalid-path' | `${keyof OperationScopes}-grant`;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
};
|
|
6
|
+
export type WriteRule = (path: string, needs: readonly (keyof OperationScopes)[]) => WriteRefusal | null;
|
|
7
|
+
export declare function declared({ locator: _locator, roomVersion: _roomVersion, ...declaration }: DiscoveredRoom): RoomDeclaration;
|
|
8
|
+
export declare function sameDeclaration(left: RoomDeclaration, right: RoomDeclaration): boolean;
|
|
9
|
+
export declare function writeRule({ operations, providerOwnedPaths, authoredPaths, }: Pick<RoomDeclaration, 'operations' | 'providerOwnedPaths' | 'authoredPaths'>, pathRule: PathRule, local: boolean): WriteRule;
|
|
10
|
+
//# sourceMappingURL=declaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../src/declaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/F,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,IAAI,EACT,WAAW,GACX,qBAAqB,GACrB,cAAc,GACd,GAAG,MAAM,eAAe,QAAQ,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,KACtC,YAAY,GAAG,IAAI,CAAC;AAEzB,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,YAAY,EACzB,GAAG,WAAW,EACf,EAAE,cAAc,GAAG,eAAe,CAElC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAEtF;AAED,wBAAgB,SAAS,CACvB,EACE,UAAU,EACV,kBAAkB,EAClB,aAAa,GACd,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,oBAAoB,GAAG,eAAe,CAAC,EAC/E,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,OAAO,GACb,SAAS,CAYX"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { equalValue } from '@agentshouse/mdmodel';
|
|
2
|
+
import { authoredAt, covered, normalize } from './paths.js';
|
|
3
|
+
export function declared({ locator: _locator, roomVersion: _roomVersion, ...declaration }) {
|
|
4
|
+
return declaration;
|
|
5
|
+
}
|
|
6
|
+
export function sameDeclaration(left, right) {
|
|
7
|
+
return equalValue(left, right);
|
|
8
|
+
}
|
|
9
|
+
export function writeRule({ operations, providerOwnedPaths, authoredPaths, }, pathRule, local) {
|
|
10
|
+
return (path, needs) => {
|
|
11
|
+
const normalized = normalize(path);
|
|
12
|
+
if (normalized === null || normalized === '')
|
|
13
|
+
return { code: 'room-root', path };
|
|
14
|
+
if (covered(providerOwnedPaths, normalized) || !authoredAt(authoredPaths, normalized)) {
|
|
15
|
+
return { code: 'provider-owned-path', path: normalized };
|
|
16
|
+
}
|
|
17
|
+
if (!pathRule(normalized))
|
|
18
|
+
return { code: 'invalid-path', path: normalized };
|
|
19
|
+
if (local)
|
|
20
|
+
return null;
|
|
21
|
+
const missing = needs.find((operation) => !covered(operations[operation], normalized));
|
|
22
|
+
return missing === undefined ? null : { code: `${missing}-grant`, path: normalized };
|
|
23
|
+
};
|
|
24
|
+
}
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,MAAM,EAEP,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,MAAM,EAEP,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,IAAI,CAsB1E;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAqEpC;AAUD,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,iBAI1F;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,GAAG,IAAI,GACtB,OAAO,CAAC,SAAS,cAAc,EAAE,GAAG,IAAI,CAAC,CA+D3C"}
|
package/dist/discovery.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validRoot } from './collection.js';
|
|
2
|
+
import { declared } from './declaration.js';
|
|
2
3
|
import { admitted, list, listHeld } from './listing.js';
|
|
3
4
|
import { confirmLocks, lockedRooms, relocked } from './locks.js';
|
|
4
5
|
import { loseRooms } from './lost.js';
|
|
@@ -11,7 +12,7 @@ function within(root, path) {
|
|
|
11
12
|
}
|
|
12
13
|
function declaredSelection(room) {
|
|
13
14
|
const selection = room.typedSelection;
|
|
14
|
-
if (selection ===
|
|
15
|
+
if (selection === null)
|
|
15
16
|
return true;
|
|
16
17
|
if (!Array.isArray(selection.roots) || selection.roots.length === 0)
|
|
17
18
|
return false;
|
|
@@ -84,11 +85,12 @@ export async function applyDiscovery(runtime, found, started, left) {
|
|
|
84
85
|
const held = await store.rooms(listed.map((room) => room.locator));
|
|
85
86
|
for (const room of listed) {
|
|
86
87
|
const record = held.get(room.locator)?.record;
|
|
87
|
-
if (record !== undefined && record.replica.selection !== room.replica.selection) {
|
|
88
|
+
if (record !== undefined && record.declaration.replica.selection !== room.replica.selection) {
|
|
88
89
|
listHeld(runtime, room.locator);
|
|
89
90
|
continue;
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
const declaration = declared(room);
|
|
93
|
+
list(runtime, room.locator, declaration, admitted(runtime, room.locator, declaration));
|
|
92
94
|
}
|
|
93
95
|
confirmLocks(runtime, listed);
|
|
94
96
|
socket.session.set({ roomsListed: true });
|
package/dist/failure.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export type Described = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare function runtimeError(code: string, message?: string, retryable?: boolean): RuntimeError;
|
|
11
11
|
export declare function failed(error: unknown): RuntimeError;
|
|
12
|
+
export declare function uncaught(error: unknown): void;
|
|
12
13
|
export declare function described(error: unknown): Described;
|
|
13
14
|
//# sourceMappingURL=failure.d.ts.map
|
package/dist/failure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAa,EACtB,SAAS,UAAQ,GAChB,YAAY,CAEd;AAYD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAGnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAGnD"}
|
|
1
|
+
{"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAa,EACtB,SAAS,UAAQ,GAChB,YAAY,CAEd;AAYD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAGnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAGnD"}
|
package/dist/failure.js
CHANGED
|
@@ -13,6 +13,9 @@ export function failed(error) {
|
|
|
13
13
|
return error;
|
|
14
14
|
return runtimeError('runtime-failure', error instanceof Error ? error.message : String(error));
|
|
15
15
|
}
|
|
16
|
+
export function uncaught(error) {
|
|
17
|
+
reportError(error);
|
|
18
|
+
}
|
|
16
19
|
export function described(error) {
|
|
17
20
|
const { message, code, retryable } = failed(error);
|
|
18
21
|
return { message, code, retryable };
|
package/dist/host.d.ts
CHANGED
|
@@ -2,10 +2,24 @@ import { type MdRuntimeOptions } from './connection.js';
|
|
|
2
2
|
import type { PortReach } from './reach.js';
|
|
3
3
|
import type { CodeAvailability, Persistence, Readiness } from './readiness.js';
|
|
4
4
|
import type { EntrySeed } from './seed.js';
|
|
5
|
+
import { type CallResult } from './outcome.js';
|
|
5
6
|
import { type RuntimePort } from './wire.js';
|
|
6
7
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
7
8
|
deploymentFacts?: unknown;
|
|
8
9
|
};
|
|
10
|
+
export type Admitted = {
|
|
11
|
+
readonly admitted: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
readonly refused: CallResult;
|
|
14
|
+
};
|
|
15
|
+
export type ActionAdmission = (name: string, input: unknown) => Promise<Admitted>;
|
|
16
|
+
export type AttachOptions = {
|
|
17
|
+
readonly app: string;
|
|
18
|
+
readonly release?: string;
|
|
19
|
+
readonly reach?: PortReach;
|
|
20
|
+
readonly admission?: ActionAdmission;
|
|
21
|
+
readonly code?: CodeAvailability;
|
|
22
|
+
};
|
|
9
23
|
export type AttachedPort = {
|
|
10
24
|
detach(): void;
|
|
11
25
|
narrow(reach: PortReach): void;
|
|
@@ -13,7 +27,7 @@ export type AttachedPort = {
|
|
|
13
27
|
answered(queries: readonly unknown[], done: () => void): void;
|
|
14
28
|
};
|
|
15
29
|
export type MdRuntimeHost = {
|
|
16
|
-
attach(port: RuntimePort,
|
|
30
|
+
attach(port: RuntimePort, options: AttachOptions): AttachedPort;
|
|
17
31
|
present(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
18
32
|
seed(entry: EntrySeed): void;
|
|
19
33
|
persisted(answer: Persistence): void;
|
|
@@ -25,5 +39,6 @@ export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
|
25
39
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
26
40
|
export type { CodeAvailability, Persistence, Space } from './readiness.js';
|
|
27
41
|
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
28
|
-
export
|
|
42
|
+
export { undeclared } from './outcome.js';
|
|
43
|
+
export { wireAnswer, wireRequest, type RuntimePort, type WireAnswer, type WireRequest, } from './wire.js';
|
|
29
44
|
//# 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":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEL,KAAK,WAAW,EAQjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,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AY,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -3,7 +3,7 @@ import { composeRuntime } from './connection.js';
|
|
|
3
3
|
import { untilAnswered } from './recovery.js';
|
|
4
4
|
import { described } from './failure.js';
|
|
5
5
|
import { answeredResult } from './outcome.js';
|
|
6
|
-
import { AUTHORIZATION_ENDED,
|
|
6
|
+
import { AUTHORIZATION_ENDED, WIRE, wireRequest, } from './wire.js';
|
|
7
7
|
const NARROWED = new Set(['within', 'whole']);
|
|
8
8
|
function answered(md, app, writtenBy, member, input) {
|
|
9
9
|
switch (member) {
|
|
@@ -123,9 +123,10 @@ export function serveMdRuntime(options) {
|
|
|
123
123
|
deliver(structuredClone(deploymentFacts));
|
|
124
124
|
return () => { };
|
|
125
125
|
};
|
|
126
|
-
function attach(port,
|
|
126
|
+
function attach(port, options) {
|
|
127
127
|
if (!authorized)
|
|
128
128
|
throw new Error(AUTHORIZATION_ENDED);
|
|
129
|
+
const { app, release, reach, admission, code = 'stored' } = options;
|
|
129
130
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
130
131
|
const view = runtime.within(reach ?? null, { target: app, code });
|
|
131
132
|
const observations = new Map();
|
|
@@ -190,6 +191,15 @@ export function serveMdRuntime(options) {
|
|
|
190
191
|
send({ kind: 'failure', id, ...described(error) });
|
|
191
192
|
}
|
|
192
193
|
};
|
|
194
|
+
const admitted = admission === undefined
|
|
195
|
+
? view.md
|
|
196
|
+
: {
|
|
197
|
+
...view.md,
|
|
198
|
+
async call(name, input) {
|
|
199
|
+
const decided = await admission(name, input);
|
|
200
|
+
return 'refused' in decided ? decided.refused : view.md.call(name, decided.admitted);
|
|
201
|
+
},
|
|
202
|
+
};
|
|
193
203
|
const serve = async (message) => {
|
|
194
204
|
if (message.kind === 'hello')
|
|
195
205
|
return;
|
|
@@ -215,13 +225,13 @@ export function serveMdRuntime(options) {
|
|
|
215
225
|
return;
|
|
216
226
|
}
|
|
217
227
|
const { id, member, input } = message;
|
|
218
|
-
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ?
|
|
228
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
219
229
|
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
220
230
|
};
|
|
221
231
|
port.addEventListener('message', (event) => {
|
|
222
232
|
if (!serving)
|
|
223
233
|
return;
|
|
224
|
-
const message =
|
|
234
|
+
const message = wireRequest(event.data);
|
|
225
235
|
if (message === null)
|
|
226
236
|
return;
|
|
227
237
|
void serve(message);
|
|
@@ -287,3 +297,5 @@ export function serveMdRuntime(options) {
|
|
|
287
297
|
}
|
|
288
298
|
export { entrySeedOf } from './seed.js';
|
|
289
299
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
300
|
+
export { undeclared } from './outcome.js';
|
|
301
|
+
export { wireAnswer, wireRequest, } from './wire.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty,
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
3
|
export { heldFacts } from './conversation-row.js';
|
|
4
4
|
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
@@ -22,11 +22,12 @@ export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './sear
|
|
|
22
22
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
23
23
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
24
24
|
export { departure } from './change.js';
|
|
25
|
+
export { definitionsIn, selected } from './collection.js';
|
|
25
26
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
26
27
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
27
28
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
28
29
|
export { contextFigure } from './context.js';
|
|
29
|
-
export {
|
|
30
|
+
export { sessionEnded, type RunningJob } from './job.js';
|
|
30
31
|
export { changeBatchIdentity } from './identity.js';
|
|
31
32
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
32
33
|
export { authoredAt } from './paths.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,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,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,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,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,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM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{ heldFacts } from './conversation-row.js';
|
|
|
2
2
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
3
3
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
4
4
|
export { departure } from './change.js';
|
|
5
|
+
export { definitionsIn, selected } from './collection.js';
|
|
5
6
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
6
7
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
7
8
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
8
9
|
export { contextFigure } from './context.js';
|
|
9
|
-
export {
|
|
10
|
+
export { sessionEnded } from './job.js';
|
|
10
11
|
export { changeBatchIdentity } from './identity.js';
|
|
11
12
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
12
13
|
export { authoredAt } from './paths.js';
|
package/dist/install.d.ts
CHANGED
|
@@ -39,7 +39,6 @@ export declare function sweep({ store, socket, journal }: Runtime): void;
|
|
|
39
39
|
export declare function forgetInstall(store: Store, locator: string): void;
|
|
40
40
|
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
|
41
41
|
export declare function catching(store: Store, locator: string): void;
|
|
42
|
-
export declare function confirmedAgain(store: Store, locator: string): void;
|
|
43
42
|
export declare function standingAt(store: Store, locator: string, held: Pick<ReplicaRecord, 'key'> | undefined): Standing;
|
|
44
43
|
export declare function showing(system: Runtime, locator: string, roomVersion: string, held: string | undefined): void;
|
|
45
44
|
export declare function olderThan(system: Runtime, locator: string, roomVersion: string, held: string | undefined): boolean;
|
package/dist/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,QAAQ,EACR,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkC,KAAK,KAAK,EAAgB,MAA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