@agentshouse/mdruntime 0.1.0-ca6edc1abd618 → 0.1.0-ca8707258fdde
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/acceptance.d.ts +26 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +384 -0
- package/dist/adapter.d.ts +102 -70
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +29 -47
- package/dist/bootstrap.d.ts +16 -14
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +272 -129
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/change.d.ts +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/chat-types.d.ts +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +2 -0
- package/dist/client.d.ts +20 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -6
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -17
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +278 -282
- package/dist/connection.d.ts +22 -44
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1600 -3577
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +47 -0
- package/dist/conversation.d.ts +27 -18
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +484 -258
- package/dist/durability.d.ts +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- package/dist/figures.d.ts +48 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/file.d.ts +2 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +29 -32
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/install.d.ts +86 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/job.d.ts +33 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +54 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +62 -20
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +12 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +216 -85
- package/dist/messages.d.ts +27 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +97 -19
- package/dist/model.d.ts +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +5 -17
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +8 -3
- package/dist/outcome.d.ts +14 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +19 -2
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +11 -0
- package/dist/parts.d.ts +59 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +118 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/query.d.ts +18 -207
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +32 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +118 -0
- package/dist/reach.d.ts +18 -11
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +206 -126
- package/dist/react.d.ts +5 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +3 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/reads.d.ts +34 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +114 -86
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +35 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +33 -5
- package/dist/replica.d.ts +10 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +52 -20
- package/dist/room-draft.d.ts +21 -5
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +98 -51
- package/dist/room-drafts.d.ts +29 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +216 -0
- package/dist/rows.d.ts +18 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +45 -153
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +22 -13
- package/dist/saves.d.ts +96 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +999 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/seed.d.ts +16 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +66 -0
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket.d.ts +43 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +96 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +81 -0
- package/dist/status.d.ts +4 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- package/dist/store/fences.d.ts +16 -0
- package/dist/store/fences.d.ts.map +1 -0
- package/dist/store/fences.js +26 -0
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/records.d.ts +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +408 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- package/dist/store/watchers.d.ts +15 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +36 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +76 -158
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +117 -403
- package/dist/stored.d.ts +66 -55
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +343 -273
- package/dist/tables.d.ts +118 -65
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +199 -99
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +42 -100
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +23 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +8 -2
- package/package.json +2 -2
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -368
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -150
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ChangeSet } from './change-set.js';
|
|
2
|
+
import { type VisibleLayer } from './replica.js';
|
|
3
|
+
import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
|
|
4
|
+
import type { Store } from './store.js';
|
|
5
|
+
export type RoomDrafting = {
|
|
6
|
+
readonly store: Store;
|
|
7
|
+
closed(): boolean;
|
|
8
|
+
publishChangeSet(set: ChangeSet): Promise<void>;
|
|
9
|
+
statusShown(): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export type RoomDraftSurface = {
|
|
12
|
+
list(): Promise<readonly RoomDraft[]>;
|
|
13
|
+
read(room: string, path: string): Promise<RoomDraft | null>;
|
|
14
|
+
write(room: string, path: string, revision: string | null, parts: unknown, next?: string): Promise<RoomDraftWrite>;
|
|
15
|
+
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
16
|
+
};
|
|
17
|
+
export type PresentationSurface = {
|
|
18
|
+
read(app: string): Promise<unknown>;
|
|
19
|
+
write(app: string, value: unknown): Promise<void>;
|
|
20
|
+
edit(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export declare function visibleOf(store: Store, locator: string, paths: readonly string[]): Promise<VisibleLayer | undefined>;
|
|
23
|
+
export declare function publishRoomDrafts({ store, closed }: RoomDrafting, waitingOnly: boolean, touched?: ChangeSet['documents'] | null): Promise<void>;
|
|
24
|
+
export declare function emitPresentation({ store, closed }: RoomDrafting, app: string): Promise<void>;
|
|
25
|
+
export declare function roomDraftSurface(drafting: RoomDrafting): RoomDraftSurface;
|
|
26
|
+
export declare function presentationSurface(drafting: RoomDrafting): PresentationSurface;
|
|
27
|
+
export declare function watchRoomDrafts({ store, closed }: RoomDrafting, deliver: (value: unknown) => void): () => void;
|
|
28
|
+
export declare function watchPresentation({ store, closed }: RoomDrafting, app: string, deliver: (value: unknown) => void): () => void;
|
|
29
|
+
//# sourceMappingURL=room-drafts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-drafts.d.ts","sourceRoot":"","sources":["../src/room-drafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAQL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,MAAM,IAAI,OAAO,CAAC;IAClB,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,IAAI,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC5D,KAAK,CACH,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,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OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CAiBZ;AAED,wBAAgB,iBAAiB,CAC/B,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,YAAY,EAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CASZ"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { plain } from '@agentshouse/mdmodel';
|
|
2
|
+
import { changeSet } from './change-set.js';
|
|
3
|
+
import { collectionOf } from './collection.js';
|
|
4
|
+
import { runtimeError } from './failure.js';
|
|
5
|
+
import { roomDraftRevision } from './identity.js';
|
|
6
|
+
import { normalize } from './paths.js';
|
|
7
|
+
import { slicing } from './replica.js';
|
|
8
|
+
import { binaryBase, gatheredParts, held, heldFile, readParts, staleWrite, underneath, } from './room-draft.js';
|
|
9
|
+
import { stepped } from './turn.js';
|
|
10
|
+
const ROOM_DRAFTS = 'room-drafts';
|
|
11
|
+
const presentationTopic = (app) => `presentation\u0000${app}`;
|
|
12
|
+
export async function visibleOf(store, locator, paths) {
|
|
13
|
+
const kept = await store.record(locator);
|
|
14
|
+
if (kept === undefined)
|
|
15
|
+
return undefined;
|
|
16
|
+
const local = await store.open();
|
|
17
|
+
const slice = await stepped(slicing(await local.entries(kept.key, 'visible', paths), paths));
|
|
18
|
+
return { ...slice, collection: collectionOf(slice.documents, store.composed(kept)) };
|
|
19
|
+
}
|
|
20
|
+
function roomDraftOf(record, visible) {
|
|
21
|
+
return structuredClone({
|
|
22
|
+
room: record.locator,
|
|
23
|
+
path: record.path,
|
|
24
|
+
revision: record.revision,
|
|
25
|
+
parts: record.parts,
|
|
26
|
+
changedUnderneath: underneath(record.parts, record.path, visible),
|
|
27
|
+
returned: record.returned,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async function roomDraftsOf(store, records) {
|
|
31
|
+
const rooms = new Map();
|
|
32
|
+
for (const record of records) {
|
|
33
|
+
const paths = rooms.get(record.locator) ?? [];
|
|
34
|
+
paths.push(record.path);
|
|
35
|
+
rooms.set(record.locator, paths);
|
|
36
|
+
}
|
|
37
|
+
const layers = new Map();
|
|
38
|
+
for (const [locator, paths] of rooms) {
|
|
39
|
+
layers.set(locator, await visibleOf(store, locator, paths));
|
|
40
|
+
}
|
|
41
|
+
return records.map((record) => roomDraftOf(record, layers.get(record.locator)));
|
|
42
|
+
}
|
|
43
|
+
function inOrder(records) {
|
|
44
|
+
return [...records].sort((left, right) => {
|
|
45
|
+
if (left.locator !== right.locator)
|
|
46
|
+
return left.locator < right.locator ? -1 : 1;
|
|
47
|
+
if (left.path !== right.path)
|
|
48
|
+
return left.path < right.path ? -1 : 1;
|
|
49
|
+
return 0;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async function snapshotRoomDrafts(store) {
|
|
53
|
+
return roomDraftsOf(store, inOrder(await store.drafts()));
|
|
54
|
+
}
|
|
55
|
+
export function publishRoomDrafts({ store, closed }, waitingOnly, touched = null) {
|
|
56
|
+
const unwatched = () => closed() || store.watching(ROOM_DRAFTS).length === 0;
|
|
57
|
+
if (unwatched())
|
|
58
|
+
return Promise.resolve();
|
|
59
|
+
return store.publication(async () => {
|
|
60
|
+
if (unwatched())
|
|
61
|
+
return;
|
|
62
|
+
const records = await store.drafts();
|
|
63
|
+
if (closed())
|
|
64
|
+
return;
|
|
65
|
+
if (touched !== null &&
|
|
66
|
+
!records.some((record) => touched.some(({ locator, path }) => locator === record.locator && (path === null || path === record.path)))) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const value = await roomDraftsOf(store, inOrder(records));
|
|
70
|
+
if (closed())
|
|
71
|
+
return;
|
|
72
|
+
const answered = store.watching(ROOM_DRAFTS, waitingOnly ? 'waiting' : 'all');
|
|
73
|
+
for (const watcher of answered)
|
|
74
|
+
watcher.answer(value);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async function presentationOf(store, app) {
|
|
78
|
+
const value = await (await store.open()).presentation(app);
|
|
79
|
+
return value === undefined ? null : structuredClone(value);
|
|
80
|
+
}
|
|
81
|
+
export function emitPresentation({ store, closed }, app) {
|
|
82
|
+
const topic = presentationTopic(app);
|
|
83
|
+
const listening = () => store.watching(topic, 'ready');
|
|
84
|
+
if (closed() || listening().length === 0)
|
|
85
|
+
return Promise.resolve();
|
|
86
|
+
return store.publication(async () => {
|
|
87
|
+
if (closed() || listening().length === 0)
|
|
88
|
+
return;
|
|
89
|
+
const value = await presentationOf(store, app);
|
|
90
|
+
if (closed())
|
|
91
|
+
return;
|
|
92
|
+
for (const watcher of listening())
|
|
93
|
+
watcher.answer(value);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
async function writtenRoomDraft({ store, publishChangeSet }, room, path, revision, input, next) {
|
|
97
|
+
const parts = readParts(input, path);
|
|
98
|
+
if (path === '' || normalize(path) !== path)
|
|
99
|
+
throw runtimeError('room-draft-malformed', `room-draft-malformed at ${path}: a path inside the Room, such as notes/a.md`);
|
|
100
|
+
const local = await store.open();
|
|
101
|
+
const current = await store.draft(room, path);
|
|
102
|
+
if ((current?.revision ?? null) !== revision) {
|
|
103
|
+
return staleWrite(current === undefined ? null : ((await roomDraftsOf(store, [current]))[0] ?? null));
|
|
104
|
+
}
|
|
105
|
+
const file = parts.file === undefined
|
|
106
|
+
? undefined
|
|
107
|
+
: await heldFile(parts.file.blob, parts.file.base === undefined
|
|
108
|
+
? binaryBase(await visibleOf(store, room, [path]), path)
|
|
109
|
+
: parts.file.base);
|
|
110
|
+
const record = {
|
|
111
|
+
locator: room,
|
|
112
|
+
path,
|
|
113
|
+
revision: next,
|
|
114
|
+
parts: held(current?.parts, parts, file),
|
|
115
|
+
returned: current?.returned ?? null,
|
|
116
|
+
};
|
|
117
|
+
await local.keepRoomDraft(record, parts.file === undefined || file === undefined
|
|
118
|
+
? []
|
|
119
|
+
: [{ key: file.localId, blob: parts.file.blob }]);
|
|
120
|
+
await publishChangeSet(changeSet(room, { drafts: [path] }));
|
|
121
|
+
return { outcome: 'written', roomDraft: (await roomDraftsOf(store, [record]))[0] ?? null };
|
|
122
|
+
}
|
|
123
|
+
async function keptPresentation({ store, publishChangeSet }, app, next) {
|
|
124
|
+
const local = await store.open();
|
|
125
|
+
const stored = next(await local.presentation(app));
|
|
126
|
+
await local.present({ app, value: stored });
|
|
127
|
+
await publishChangeSet(changeSet('', { presentation: app }));
|
|
128
|
+
}
|
|
129
|
+
export function roomDraftSurface(drafting) {
|
|
130
|
+
const { store, publishChangeSet, statusShown } = drafting;
|
|
131
|
+
return {
|
|
132
|
+
list() {
|
|
133
|
+
return store
|
|
134
|
+
.exclusive(async () => {
|
|
135
|
+
await store.open();
|
|
136
|
+
return snapshotRoomDrafts(store);
|
|
137
|
+
})
|
|
138
|
+
.then((listed) => {
|
|
139
|
+
publishRoomDrafts(drafting, true);
|
|
140
|
+
return listed;
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
async read(room, path) {
|
|
144
|
+
const record = await store.draft(room, path);
|
|
145
|
+
return record === undefined ? null : ((await roomDraftsOf(store, [record]))[0] ?? null);
|
|
146
|
+
},
|
|
147
|
+
write(room, path, revision, input, next = roomDraftRevision()) {
|
|
148
|
+
if (typeof next !== 'string' || next === '')
|
|
149
|
+
return Promise.reject(runtimeError('room-draft-malformed'));
|
|
150
|
+
return store.gathered(`room-draft\u0000${room}\u0000${path}`, { revision, input, next }, (earlier, later) => {
|
|
151
|
+
if (later.revision !== earlier.next)
|
|
152
|
+
return null;
|
|
153
|
+
const parts = gatheredParts(earlier.input, later.input);
|
|
154
|
+
return parts === null
|
|
155
|
+
? null
|
|
156
|
+
: { revision: earlier.revision, input: parts, next: later.next };
|
|
157
|
+
}, (written) => writtenRoomDraft(drafting, room, path, written.revision, written.input, written.next));
|
|
158
|
+
},
|
|
159
|
+
discard(room, path, revision) {
|
|
160
|
+
return store.exclusive(async () => {
|
|
161
|
+
const local = await store.open();
|
|
162
|
+
const current = await store.draft(room, path);
|
|
163
|
+
if (current === undefined || current.revision !== revision) {
|
|
164
|
+
return staleWrite(current === undefined ? null : ((await roomDraftsOf(store, [current]))[0] ?? null));
|
|
165
|
+
}
|
|
166
|
+
await local.discardRoomDraft(room, path);
|
|
167
|
+
await Promise.all([publishChangeSet(changeSet(room, { drafts: [path] })), statusShown()]);
|
|
168
|
+
return { outcome: 'written', roomDraft: null };
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export function presentationSurface(drafting) {
|
|
174
|
+
const { store } = drafting;
|
|
175
|
+
return {
|
|
176
|
+
read(app) {
|
|
177
|
+
return store.exclusive(() => presentationOf(store, app));
|
|
178
|
+
},
|
|
179
|
+
write(app, value) {
|
|
180
|
+
return store.exclusive(() => keptPresentation(drafting, app, () => structuredClone(value)));
|
|
181
|
+
},
|
|
182
|
+
edit(app, members) {
|
|
183
|
+
return store.gathered(`presentation\u0000${app}`, structuredClone(members), (earlier, later) => ({ ...earlier, ...later }), (edited) => keptPresentation(drafting, app, (kept) => Object.fromEntries([
|
|
184
|
+
...Object.entries(plain(kept) ? kept : {}).filter(([member]) => !Object.hasOwn(edited, member)),
|
|
185
|
+
...Object.entries(edited).filter(([, value]) => value !== null),
|
|
186
|
+
])));
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export function watchRoomDrafts({ store, closed }, deliver) {
|
|
191
|
+
const watcher = store.watch(ROOM_DRAFTS, deliver);
|
|
192
|
+
const unwatched = () => closed() || !watcher.held();
|
|
193
|
+
void store
|
|
194
|
+
.exclusive(async () => {
|
|
195
|
+
await store.open();
|
|
196
|
+
})
|
|
197
|
+
.then(() => store.publication(async () => {
|
|
198
|
+
if (unwatched())
|
|
199
|
+
return;
|
|
200
|
+
const value = await snapshotRoomDrafts(store);
|
|
201
|
+
if (!unwatched())
|
|
202
|
+
watcher.answer(value);
|
|
203
|
+
}), () => { });
|
|
204
|
+
return watcher.stop;
|
|
205
|
+
}
|
|
206
|
+
export function watchPresentation({ store, closed }, app, deliver) {
|
|
207
|
+
const watcher = store.watch(presentationTopic(app), deliver);
|
|
208
|
+
void store
|
|
209
|
+
.exclusive(async () => {
|
|
210
|
+
const value = await presentationOf(store, app);
|
|
211
|
+
if (!closed() && watcher.held())
|
|
212
|
+
watcher.answer(value);
|
|
213
|
+
})
|
|
214
|
+
.catch(() => { });
|
|
215
|
+
return watcher.stop;
|
|
216
|
+
}
|
package/dist/rows.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { type HeldValue } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { SavedFacts } from './adapter.js';
|
|
1
3
|
import { type Composition } from './collection.js';
|
|
2
|
-
|
|
3
|
-
type HeldValue = {
|
|
4
|
-
readonly form: string;
|
|
5
|
-
readonly held: number;
|
|
6
|
-
readonly item: number;
|
|
7
|
-
readonly kind: ValueKind;
|
|
8
|
-
readonly value: string | number | null;
|
|
9
|
-
readonly size: number | null;
|
|
10
|
-
readonly single: boolean;
|
|
11
|
-
};
|
|
12
|
-
type LinkKind = 'field' | 'section' | 'body';
|
|
4
|
+
type LinkKind = 'field' | 'link';
|
|
13
5
|
type HeldLink = {
|
|
14
6
|
readonly kind: LinkKind;
|
|
15
|
-
readonly
|
|
7
|
+
readonly keys: string;
|
|
8
|
+
readonly places: string;
|
|
16
9
|
readonly target: string;
|
|
17
10
|
readonly field: string;
|
|
18
11
|
};
|
|
19
|
-
export type
|
|
12
|
+
export type Described = {
|
|
20
13
|
readonly type: string | null;
|
|
21
14
|
readonly declared: string | null;
|
|
22
15
|
readonly queried: boolean;
|
|
23
16
|
readonly folder: string;
|
|
24
17
|
readonly fields: string | null;
|
|
18
|
+
readonly links: string | null;
|
|
19
|
+
};
|
|
20
|
+
export type Held = {
|
|
21
|
+
readonly type: string | null;
|
|
22
|
+
readonly fields: Readonly<Record<string, unknown>> | null;
|
|
23
|
+
readonly links: readonly string[];
|
|
24
|
+
};
|
|
25
|
+
export type Derived = {
|
|
25
26
|
readonly values: readonly HeldValue[];
|
|
26
27
|
readonly links: readonly HeldLink[];
|
|
27
28
|
};
|
|
@@ -29,9 +30,10 @@ export declare function documentKey(room: string, path: string): string;
|
|
|
29
30
|
export declare function roomOfKey(key: string): string;
|
|
30
31
|
export declare function pathOfKey(key: string): string;
|
|
31
32
|
export declare function markdownPath(path: string): boolean;
|
|
32
|
-
export declare function settingsTextPath(path: string): boolean;
|
|
33
33
|
export declare function folderOf(path: string): string;
|
|
34
|
-
export declare function
|
|
35
|
-
export declare function
|
|
34
|
+
export declare function writtenFacts(path: string, content: string, composition: Composition): SavedFacts | null;
|
|
35
|
+
export declare function described(path: string, content: string | null, facts: SavedFacts | null): Described;
|
|
36
|
+
export declare function heldOf(path: string, content: string | null, facts: SavedFacts | null): Held;
|
|
37
|
+
export declare function derived(path: string, held: Held, composition: Composition): Derived;
|
|
36
38
|
export {};
|
|
37
39
|
//# sourceMappingURL=rows.d.ts.map
|
package/dist/rows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjC,KAAK,QAAQ,GAAG;IACd,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,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WAAW,EAAE,WAAW,GACvB,UAAU,GAAG,IAAI,CAQnB;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,KAAK,EAAE,UAAU,GAAG,IAAI,GACvB,SAAS,CAeX;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAK3F;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAYnF"}
|
package/dist/rows.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { byCodePoint, documentFacts, indexed, parse } from '@agentshouse/mdmodel';
|
|
2
2
|
import { governing } from './collection.js';
|
|
3
3
|
import { definitionOf } from './model.js';
|
|
4
4
|
function keyOf(...parts) {
|
|
@@ -16,171 +16,63 @@ export function pathOfKey(key) {
|
|
|
16
16
|
export function markdownPath(path) {
|
|
17
17
|
return path.endsWith('.md');
|
|
18
18
|
}
|
|
19
|
-
export function settingsTextPath(path) {
|
|
20
|
-
return /^settings\/.+\.ya?ml$/u.test(path);
|
|
21
|
-
}
|
|
22
19
|
export function folderOf(path) {
|
|
23
20
|
return path.slice(0, Math.max(path.lastIndexOf('/'), 0));
|
|
24
21
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
function compared(reading, exact, value) {
|
|
29
|
-
if (!reading.references.has(exact))
|
|
22
|
+
function byKey(_key, value) {
|
|
23
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
30
24
|
return value;
|
|
31
|
-
return (
|
|
32
|
-
}
|
|
33
|
-
export function kindOf(value) {
|
|
34
|
-
if (value === undefined)
|
|
35
|
-
return 'undefined';
|
|
36
|
-
if (value === null)
|
|
37
|
-
return 'null';
|
|
38
|
-
if (Array.isArray(value))
|
|
39
|
-
return 'array';
|
|
40
|
-
if (typeof value === 'object')
|
|
41
|
-
return 'object';
|
|
42
|
-
return typeof value;
|
|
25
|
+
return Object.fromEntries(Object.entries(value).sort(([one], [other]) => byCodePoint(one, other)));
|
|
43
26
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
return value;
|
|
47
|
-
if (typeof value === 'boolean')
|
|
48
|
-
return value ? 1 : 0;
|
|
49
|
-
if (Array.isArray(value))
|
|
50
|
-
return JSON.stringify(value);
|
|
51
|
-
return null;
|
|
27
|
+
function fieldsText(fields) {
|
|
28
|
+
return JSON.stringify(fields, byKey);
|
|
52
29
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
reading.values.push({
|
|
58
|
-
form,
|
|
59
|
-
held: at,
|
|
60
|
-
item: -1,
|
|
61
|
-
kind,
|
|
62
|
-
value: scalarOf(value),
|
|
63
|
-
size: Array.isArray(value) ? value.length : null,
|
|
64
|
-
single,
|
|
65
|
-
});
|
|
66
|
-
if (!Array.isArray(value))
|
|
67
|
-
return;
|
|
68
|
-
value.forEach((item, index) => {
|
|
69
|
-
const itemKind = kindOf(item);
|
|
70
|
-
reading.values.push({
|
|
71
|
-
form,
|
|
72
|
-
held: at,
|
|
73
|
-
item: index,
|
|
74
|
-
kind: itemKind,
|
|
75
|
-
value: itemKind === 'array' ? null : scalarOf(item),
|
|
76
|
-
size: null,
|
|
77
|
-
single: false,
|
|
78
|
-
});
|
|
30
|
+
export function writtenFacts(path, content, composition) {
|
|
31
|
+
const model = governing(composition, path);
|
|
32
|
+
const facts = documentFacts(path, parse(content, path), {
|
|
33
|
+
types: model.status === 'unavailable' ? {} : model.types,
|
|
79
34
|
});
|
|
35
|
+
return facts === null
|
|
36
|
+
? null
|
|
37
|
+
: { ...facts, fields: JSON.parse(fieldsText(facts.fields)) };
|
|
80
38
|
}
|
|
81
|
-
function
|
|
82
|
-
const value = Array.isArray(node)
|
|
83
|
-
? node.map((item, index) => compared(reading, `${exact}/${index}`, item))
|
|
84
|
-
: compared(reading, exact, node);
|
|
85
|
-
for (const form of forms) {
|
|
86
|
-
if (form.pending)
|
|
87
|
-
continue;
|
|
88
|
-
held(reading, form.text, value, !form.through && value !== undefined && !plainObject(value));
|
|
89
|
-
}
|
|
90
|
-
if (Array.isArray(node) || plainObject(node) || !reading.references.has(exact))
|
|
91
|
-
return;
|
|
92
|
-
const found = compared(reading, exact, node);
|
|
93
|
-
if (typeof found !== 'string')
|
|
94
|
-
return;
|
|
95
|
-
const field = forms
|
|
96
|
-
.map((form) => form.text)
|
|
97
|
-
.reduce((left, right) => (right.length < left.length ? right : left));
|
|
98
|
-
const known = reading.targets.get(`${field}\u0000${found}`);
|
|
99
|
-
const kept = known ?? { field, target: found, forms: new Set() };
|
|
100
|
-
for (const form of forms)
|
|
101
|
-
kept.forms.add(form.text);
|
|
102
|
-
reading.targets.set(`${field}\u0000${found}`, kept);
|
|
103
|
-
}
|
|
104
|
-
function walk(reading, node, forms, exact) {
|
|
105
|
-
record(reading, node, forms, exact);
|
|
106
|
-
if (Array.isArray(node)) {
|
|
107
|
-
node.forEach((item, index) => walk(reading, item, forms.flatMap((form) => [
|
|
108
|
-
...(form.pending
|
|
109
|
-
? []
|
|
110
|
-
: [{ text: `${form.text}/${index}`, through: form.through, pending: false }]),
|
|
111
|
-
{ text: form.text, through: true, pending: true },
|
|
112
|
-
]), `${exact}/${index}`));
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (!plainObject(node))
|
|
116
|
-
return;
|
|
117
|
-
for (const [key, value] of Object.entries(node)) {
|
|
118
|
-
const segment = escapePointer(key);
|
|
119
|
-
walk(reading, value, forms.flatMap((form) => form.pending && ARRAY_INDEX.test(key)
|
|
120
|
-
? []
|
|
121
|
-
: [{ text: `${form.text}/${segment}`, through: form.through, pending: false }]), `${exact}/${segment}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function bodyTargets(path, content) {
|
|
125
|
-
const seen = new Set();
|
|
126
|
-
const found = [];
|
|
127
|
-
for (const { target: reached } of bodyLinks(bodyAfterFrontmatter(content), path)) {
|
|
128
|
-
if (seen.has(reached))
|
|
129
|
-
continue;
|
|
130
|
-
seen.add(reached);
|
|
131
|
-
found.push({ kind: 'body', form: '', target: reached, field: '' });
|
|
132
|
-
}
|
|
133
|
-
return found;
|
|
134
|
-
}
|
|
135
|
-
function typedRows(path, content, document, composition) {
|
|
136
|
-
const definition = definitionOf(governing(composition, path), document.type);
|
|
137
|
-
const reading = {
|
|
138
|
-
path,
|
|
139
|
-
references: new Set(definition === undefined ? [] : references(document, definition).map((one) => one.pointer)),
|
|
140
|
-
values: [],
|
|
141
|
-
reached: new Map(),
|
|
142
|
-
targets: new Map(),
|
|
143
|
-
};
|
|
144
|
-
for (const [name, value] of Object.entries(document.fields)) {
|
|
145
|
-
const segment = escapePointer(name);
|
|
146
|
-
walk(reading, value, [{ text: `/${segment}`, through: false, pending: false }], `/${segment}`);
|
|
147
|
-
}
|
|
148
|
-
const links = [];
|
|
149
|
-
for (const { field, target: reached, forms } of reading.targets.values()) {
|
|
150
|
-
for (const form of [...forms].sort()) {
|
|
151
|
-
links.push({ kind: 'field', form, target: reached, field });
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (definition !== undefined) {
|
|
155
|
-
const sectioned = new Set();
|
|
156
|
-
for (const { target: reached } of sectionReferences(path, content, definition)) {
|
|
157
|
-
if (reached === null || sectioned.has(reached))
|
|
158
|
-
continue;
|
|
159
|
-
sectioned.add(reached);
|
|
160
|
-
links.push({ kind: 'section', form: '', target: reached, field: '' });
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return { values: reading.values, links: [...links, ...bodyTargets(path, content)] };
|
|
164
|
-
}
|
|
165
|
-
export function derived(path, content, composition) {
|
|
39
|
+
export function described(path, content, facts) {
|
|
166
40
|
const folder = folderOf(path);
|
|
167
|
-
const unread = {
|
|
41
|
+
const unread = { type: null, fields: null, links: null, folder };
|
|
168
42
|
if (content === null)
|
|
169
43
|
return { ...unread, declared: null, queried: true };
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (!read.ok)
|
|
176
|
-
return { ...unread, declared, queried: false };
|
|
177
|
-
const document = read.frontmatter;
|
|
44
|
+
if (facts === null)
|
|
45
|
+
return { ...unread, declared: null, queried: !markdownPath(path) };
|
|
46
|
+
const links = JSON.stringify(facts.links);
|
|
47
|
+
if (!markdownPath(path))
|
|
48
|
+
return { ...unread, declared: facts.type, queried: true, links };
|
|
178
49
|
return {
|
|
179
|
-
type:
|
|
180
|
-
declared,
|
|
50
|
+
type: facts.type,
|
|
51
|
+
declared: facts.type,
|
|
181
52
|
queried: true,
|
|
182
53
|
folder,
|
|
183
|
-
fields:
|
|
184
|
-
|
|
54
|
+
fields: fieldsText(facts.fields),
|
|
55
|
+
links,
|
|
185
56
|
};
|
|
186
57
|
}
|
|
58
|
+
export function heldOf(path, content, facts) {
|
|
59
|
+
if (content === null || facts === null)
|
|
60
|
+
return { type: null, fields: null, links: [] };
|
|
61
|
+
return markdownPath(path)
|
|
62
|
+
? { type: facts.type, fields: facts.fields, links: facts.links }
|
|
63
|
+
: { type: null, fields: null, links: facts.links };
|
|
64
|
+
}
|
|
65
|
+
export function derived(path, held, composition) {
|
|
66
|
+
const stored = held.links.map((target) => ({
|
|
67
|
+
kind: 'link',
|
|
68
|
+
keys: '',
|
|
69
|
+
places: '',
|
|
70
|
+
target,
|
|
71
|
+
field: '',
|
|
72
|
+
}));
|
|
73
|
+
if (held.type === null || held.fields === null)
|
|
74
|
+
return { values: [], links: stored };
|
|
75
|
+
const definition = definitionOf(governing(composition, path), held.type);
|
|
76
|
+
const { values, links: fields } = indexed(path, held.fields, definition);
|
|
77
|
+
return { values, links: [...fields, ...stored] };
|
|
78
|
+
}
|
package/dist/save.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type SaveInput = {
|
|
|
21
21
|
providerOwnedPaths: readonly string[];
|
|
22
22
|
providerLimits: readonly ProviderLimit[];
|
|
23
23
|
visible: VisibleLayer;
|
|
24
|
+
folders: ReadonlySet<string>;
|
|
24
25
|
handle: string;
|
|
25
26
|
changes: readonly Change[];
|
|
26
27
|
bases: readonly Precondition[];
|
|
@@ -75,6 +76,7 @@ export type MoveSide = {
|
|
|
75
76
|
operations: OperationScopes;
|
|
76
77
|
providerOwnedPaths: readonly string[];
|
|
77
78
|
visible: VisibleLayer;
|
|
79
|
+
folders: ReadonlySet<string>;
|
|
78
80
|
queued: ReadonlySet<string>;
|
|
79
81
|
unmodeled: boolean;
|
|
80
82
|
validate: Validator;
|
package/dist/save.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../src/save.ts"],"names":[],"mappings":"AACA,OAAO,EAkBL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,MA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