@agentshouse/mdruntime 0.1.0-cbb8d8acc9d19 → 0.1.0-cc56db96f86ae
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 +285 -225
- package/README.md +21 -10
- package/dist/adapter.d.ts +114 -26
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attempt.d.ts +16 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +70 -0
- package/dist/binary.d.ts +23 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts +18 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +147 -40
- package/dist/change-set.d.ts +7 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +50 -16
- package/dist/change.d.ts +45 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +34 -0
- package/dist/chat/acts.d.ts +33 -0
- package/dist/chat/acts.d.ts.map +1 -0
- package/dist/chat/acts.js +36 -0
- package/dist/chat/context.d.ts +3 -0
- package/dist/chat/context.d.ts.map +1 -0
- package/dist/chat/context.js +10 -0
- package/dist/chat/earlier.d.ts +10 -0
- package/dist/chat/earlier.d.ts.map +1 -0
- package/dist/chat/earlier.js +54 -0
- package/dist/chat/house.d.ts +25 -0
- package/dist/chat/house.d.ts.map +1 -0
- package/dist/chat/house.js +38 -0
- package/dist/chat/input.d.ts +11 -0
- package/dist/chat/input.d.ts.map +1 -0
- package/dist/chat/input.js +92 -0
- package/dist/chat/kit.d.ts +61 -0
- package/dist/chat/kit.d.ts.map +1 -0
- package/dist/chat/kit.js +123 -0
- package/dist/chat/lasting.d.ts +6 -0
- package/dist/chat/lasting.d.ts.map +1 -0
- package/dist/chat/lasting.js +19 -0
- package/dist/chat/list.d.ts +28 -0
- package/dist/chat/list.d.ts.map +1 -0
- package/dist/chat/list.js +103 -0
- package/dist/chat/markdown.d.ts +21 -0
- package/dist/chat/markdown.d.ts.map +1 -0
- package/dist/chat/markdown.js +246 -0
- package/dist/chat/message.d.ts +7 -0
- package/dist/chat/message.d.ts.map +1 -0
- package/dist/chat/message.js +237 -0
- package/dist/chat/messages.d.ts +29 -0
- package/dist/chat/messages.d.ts.map +1 -0
- package/dist/chat/messages.js +190 -0
- package/dist/chat/name.d.ts +7 -0
- package/dist/chat/name.d.ts.map +1 -0
- package/dist/chat/name.js +37 -0
- package/dist/chat/opened.d.ts +12 -0
- package/dist/chat/opened.d.ts.map +1 -0
- package/dist/chat/opened.js +19 -0
- package/dist/chat/overlay.d.ts +32 -0
- package/dist/chat/overlay.d.ts.map +1 -0
- package/dist/chat/overlay.js +103 -0
- package/dist/chat/parts.d.ts +58 -0
- package/dist/chat/parts.d.ts.map +1 -0
- package/dist/chat/parts.js +120 -0
- package/dist/chat/pieces.d.ts +62 -0
- package/dist/chat/pieces.d.ts.map +1 -0
- package/dist/chat/pieces.js +1110 -0
- package/dist/chat/process.d.ts +20 -0
- package/dist/chat/process.d.ts.map +1 -0
- package/dist/chat/process.js +32 -0
- package/dist/chat/provider.d.ts +68 -0
- package/dist/chat/provider.d.ts.map +1 -0
- package/dist/chat/provider.js +619 -0
- package/dist/chat/question.d.ts +9 -0
- package/dist/chat/question.d.ts.map +1 -0
- package/dist/chat/question.js +69 -0
- package/dist/chat/questions.d.ts +31 -0
- package/dist/chat/questions.d.ts.map +1 -0
- package/dist/chat/questions.js +111 -0
- package/dist/chat/read.d.ts +5 -0
- package/dist/chat/read.d.ts.map +1 -0
- package/dist/chat/read.js +13 -0
- package/dist/chat/ready.d.ts +37 -0
- package/dist/chat/ready.d.ts.map +1 -0
- package/dist/chat/ready.js +93 -0
- package/dist/chat/room-file.d.ts +8 -0
- package/dist/chat/room-file.d.ts.map +1 -0
- package/dist/chat/room-file.js +67 -0
- package/dist/chat/steady.d.ts +3 -0
- package/dist/chat/steady.d.ts.map +1 -0
- package/dist/chat/steady.js +26 -0
- package/dist/chat/style.d.ts +4 -0
- package/dist/chat/style.d.ts.map +1 -0
- package/dist/chat/style.js +306 -0
- package/dist/chat.d.ts +15 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +8 -0
- package/dist/client.d.ts +33 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +81 -16
- package/dist/collection.d.ts +23 -13
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +367 -38
- package/dist/connection.d.ts +54 -16
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +2582 -486
- package/dist/conversation.d.ts +39 -12
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +546 -171
- package/dist/digest.d.ts +2 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +100 -0
- package/dist/durability.d.ts +7 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +17 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +157 -0
- package/dist/expectation.d.ts +21 -0
- package/dist/expectation.d.ts.map +1 -0
- package/dist/expectation.js +70 -0
- package/dist/failure.d.ts +13 -0
- package/dist/failure.d.ts.map +1 -0
- package/dist/failure.js +19 -0
- package/dist/fence.d.ts +6 -0
- package/dist/fence.d.ts.map +1 -0
- package/dist/fence.js +10 -0
- package/dist/file.d.ts +2 -10
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -120
- package/dist/host.d.ts +15 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +107 -21
- package/dist/identity.d.ts +5 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +19 -1
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/memory.d.ts +11 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +92 -27
- package/dist/model.d.ts +7 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +10 -1
- package/dist/observation.d.ts +7 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +29 -12
- package/dist/open.d.ts +2 -0
- package/dist/open.d.ts.map +1 -0
- package/dist/open.js +1 -0
- package/dist/outcome.d.ts +57 -3
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +67 -1
- package/dist/overlay.d.ts +18 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +271 -165
- package/dist/query.d.ts +61 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +40 -7
- package/dist/reach.d.ts +13 -4
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +201 -47
- package/dist/react.d.ts +31 -20
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +13 -21
- package/dist/read-side.d.ts +18 -9
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +903 -157
- package/dist/readiness.d.ts +53 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +33 -0
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +98 -0
- package/dist/recovery.d.ts +25 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +198 -0
- package/dist/refresh.d.ts +13 -3
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +73 -43
- package/dist/replica.d.ts +16 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +198 -91
- package/dist/room-draft.d.ts +40 -9
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +153 -37
- package/dist/rows.d.ts +10 -13
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +19 -14
- package/dist/save.d.ts +72 -4
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +812 -145
- package/dist/search.d.ts +52 -8
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +242 -46
- package/dist/seed.d.ts +16 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +75 -0
- package/dist/shared.d.ts +19 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +461 -0
- package/dist/status.d.ts +6 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -8
- package/dist/store.d.ts +90 -23
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +675 -295
- package/dist/tables.d.ts +181 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +309 -0
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +67 -0
- package/dist/windows.d.ts +21 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +84 -0
- package/dist/wire.d.ts +165 -33
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +67 -31
- package/package.json +30 -14
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.js +0 -8
package/dist/replica.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ChangeBatch } from './change.js';
|
|
2
2
|
import { type Collection, type Composition } from './collection.js';
|
|
3
3
|
import { type Layer } from './overlay.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MutationResult } from './adapter.js';
|
|
5
5
|
import type { ReplicaRecord } from './store.js';
|
|
6
6
|
import type { Refused } from './transfer.js';
|
|
7
|
+
import { type Later } from './turn.js';
|
|
7
8
|
export type ConfirmedLayer = {
|
|
8
9
|
record: ReplicaRecord;
|
|
9
10
|
collection: Collection;
|
|
@@ -29,15 +30,22 @@ type ReplayStep = {
|
|
|
29
30
|
collection?: Collection;
|
|
30
31
|
};
|
|
31
32
|
export declare function compositionOf(record: ReplicaRecord): Composition;
|
|
32
|
-
export declare function
|
|
33
|
+
export declare function confirmedOf(record: ReplicaRecord, previous?: ConfirmedLayer): Later<ConfirmedLayer>;
|
|
33
34
|
export declare function sameMembership(record: ReplicaRecord, other: ReplicaRecord): boolean;
|
|
34
|
-
export declare function readStaged(
|
|
35
|
-
export declare function readReclassified(record: ReplicaRecord, previous: ConfirmedLayer): Staged | {
|
|
35
|
+
export declare function readStaged(staged: ReplicaRecord, previous?: ConfirmedLayer): Later<Staged>;
|
|
36
|
+
export declare function readReclassified(record: ReplicaRecord, previous: ConfirmedLayer): Later<Staged | {
|
|
36
37
|
kind: 'deferred';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
}>;
|
|
39
|
+
type Accepted = Extract<MutationResult, {
|
|
40
|
+
kind: 'accepted';
|
|
41
|
+
}>;
|
|
42
|
+
export declare function applyReturned(confirmed: ConfirmedLayer, submitted: ChangeBatch, accepted: Accepted, roomVersion: string, writtenAt: string): Later<Staged>;
|
|
43
|
+
export declare function replicating(confirmed: ConfirmedLayer, queue: readonly ChangeBatch[], previous?: Replica): Generator<number, Replica, void>;
|
|
40
44
|
export declare function landed(batch: ChangeBatch, confirmed: ConfirmedLayer, current?: Readonly<Record<string, string>>): boolean;
|
|
41
|
-
export
|
|
45
|
+
export type Standing = {
|
|
46
|
+
readonly withdrawn: readonly ChangeBatch[];
|
|
47
|
+
readonly kept: readonly ChangeBatch[];
|
|
48
|
+
};
|
|
49
|
+
export declare function standing(confirmed: ConfirmedLayer, queue: readonly ChangeBatch[], withdrawable: (batch: ChangeBatch) => boolean, local: boolean): Generator<number, Standing, void>;
|
|
42
50
|
export {};
|
|
43
51
|
//# sourceMappingURL=replica.d.ts.map
|
package/dist/replica.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../src/replica.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../src/replica.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,WAAW,EAAqB,MAAM,aAAa,CAAC;AACnG,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAML,KAAK,KAAK,EACX,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,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parse } from '@agentshouse/mdmodel';
|
|
2
|
-
import { immutable } from './change.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { equalValue, parse } from '@agentshouse/mdmodel';
|
|
2
|
+
import { immutable, landing } from './change.js';
|
|
3
|
+
import { changedCleanly, collecting, unreadable, validateCollection, } from './collection.js';
|
|
4
|
+
import { acceptedBinaries, overlayChanged, overlaying, sameText, } from './overlay.js';
|
|
5
|
+
import { effectiveIn, rewriting } from './save.js';
|
|
6
|
+
import { drafted, entriesIn, patched, settling, sharing } from './shared.js';
|
|
7
|
+
import { ROW_WEIGHT, stepped } from './turn.js';
|
|
8
8
|
export function compositionOf(record) {
|
|
9
9
|
return {
|
|
10
10
|
model: record.model,
|
|
@@ -13,83 +13,170 @@ export function compositionOf(record) {
|
|
|
13
13
|
: { roots: record.typedSelection.roots, model: record.selectionModel },
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function* holding(record) {
|
|
17
|
+
const documents = yield* sharing(record.documents);
|
|
18
|
+
const binaries = yield* sharing(record.binaries);
|
|
19
|
+
const revisions = yield* sharing(record.revisions);
|
|
20
|
+
const fileIds = yield* sharing(record.fileIds);
|
|
21
|
+
const changes = yield* sharing(record.changes);
|
|
22
|
+
const written = yield* sharing(record.written);
|
|
23
|
+
return documents === record.documents &&
|
|
24
|
+
binaries === record.binaries &&
|
|
25
|
+
revisions === record.revisions &&
|
|
26
|
+
fileIds === record.fileIds &&
|
|
27
|
+
changes === record.changes &&
|
|
28
|
+
written === record.written
|
|
29
|
+
? record
|
|
30
|
+
: { ...record, documents, binaries, revisions, fileIds, changes, written };
|
|
31
|
+
}
|
|
32
|
+
export function confirmedOf(record, previous) {
|
|
33
|
+
return stepped(confirming(record, previous));
|
|
34
|
+
}
|
|
35
|
+
function* confirming(record, previous) {
|
|
36
|
+
const kept = yield* holding(record);
|
|
37
|
+
return {
|
|
38
|
+
record: kept,
|
|
39
|
+
collection: yield* collecting(kept.documents, compositionOf(kept), previous?.collection),
|
|
40
|
+
};
|
|
23
41
|
}
|
|
24
42
|
export function sameMembership(record, other) {
|
|
25
43
|
return (JSON.stringify(record.typedSelection?.roots ?? null) ===
|
|
26
44
|
JSON.stringify(other.typedSelection?.roots ?? null));
|
|
27
45
|
}
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
function* cleanly(record, previous) {
|
|
47
|
+
if (previous === undefined)
|
|
48
|
+
return false;
|
|
49
|
+
const before = previous.record;
|
|
50
|
+
return yield* changedCleanly({ text: record.documents, binaries: record.binaries }, { text: before.documents, binaries: before.binaries, composition: compositionOf(before) }, compositionOf(record));
|
|
51
|
+
}
|
|
52
|
+
function* staging(staged, previous) {
|
|
53
|
+
const record = yield* holding(staged);
|
|
54
|
+
const textChanged = previous === undefined || !(yield* sameText(record, previous.record));
|
|
55
|
+
const modeled = record.model.status !== 'unavailable' || record.selectionModel.status !== 'unavailable';
|
|
56
|
+
if (modeled &&
|
|
57
|
+
(textChanged ||
|
|
58
|
+
record.model !== previous?.record.model ||
|
|
59
|
+
record.selectionModel !== previous?.record.selectionModel) &&
|
|
60
|
+
!(yield* cleanly(record, previous))) {
|
|
61
|
+
const verdict = yield* validateCollection(record.documents, Object.keys(record.binaries), compositionOf(record));
|
|
35
62
|
if (verdict.verdict === 'refuse' && verdict.rule !== 'model-unavailable') {
|
|
36
63
|
return { kind: 'refused', refusal: verdict };
|
|
37
64
|
}
|
|
65
|
+
if (verdict.verdict === 'refuse') {
|
|
66
|
+
const refused = yield* unreadable(record.documents, previous?.record.documents);
|
|
67
|
+
if (refused !== null)
|
|
68
|
+
return refused;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (textChanged) {
|
|
72
|
+
const refused = yield* unreadable(record.documents, previous?.record.documents);
|
|
73
|
+
if (refused !== null)
|
|
74
|
+
return refused;
|
|
38
75
|
}
|
|
39
|
-
return
|
|
76
|
+
return { kind: 'staged', confirmed: yield* confirming(record, previous) };
|
|
40
77
|
}
|
|
41
|
-
export function
|
|
42
|
-
|
|
78
|
+
export function readStaged(staged, previous) {
|
|
79
|
+
return stepped(staging(staged, previous));
|
|
80
|
+
}
|
|
81
|
+
function* reclassifying(record, previous) {
|
|
82
|
+
const verdict = yield* validateCollection(record.documents, Object.keys(record.binaries), compositionOf(record));
|
|
43
83
|
if (verdict.verdict !== 'refuse')
|
|
44
|
-
return
|
|
84
|
+
return { kind: 'staged', confirmed: yield* confirming(record, previous) };
|
|
45
85
|
return verdict.rule === 'model-unavailable'
|
|
46
86
|
? { kind: 'deferred' }
|
|
47
87
|
: { kind: 'refused', refusal: verdict };
|
|
48
88
|
}
|
|
49
|
-
export function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
89
|
+
export function readReclassified(record, previous) {
|
|
90
|
+
return stepped(reclassifying(record, previous));
|
|
91
|
+
}
|
|
92
|
+
function* returnedBinaries(held, submitted, accepted) {
|
|
93
|
+
const binaries = drafted(held);
|
|
94
|
+
for (const change of submitted.changes) {
|
|
95
|
+
if (change.kind === 'arrival' && 'binary' in change) {
|
|
96
|
+
if (accepted.revisions[change.path] !== undefined)
|
|
97
|
+
binaries[change.path] = { state: 'accepted', ...change.binary };
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (change.kind !== 'move')
|
|
101
|
+
continue;
|
|
102
|
+
const moved = binaries[change.path];
|
|
103
|
+
if (moved === undefined || accepted.revisions[change.to] === undefined)
|
|
104
|
+
continue;
|
|
105
|
+
binaries[change.to] = moved;
|
|
106
|
+
delete binaries[change.path];
|
|
61
107
|
}
|
|
62
|
-
for (const path of
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
delete nextChanges[path];
|
|
66
|
-
delete nextWritten[path];
|
|
67
|
-
binaryTargets.delete(path);
|
|
108
|
+
for (const [path, binary] of acceptedBinaries(accepted.binaryFiles ?? {})) {
|
|
109
|
+
binaries[path] = binary;
|
|
110
|
+
yield ROW_WEIGHT;
|
|
68
111
|
}
|
|
69
|
-
|
|
70
|
-
|
|
112
|
+
for (const path of accepted.removals) {
|
|
113
|
+
delete binaries[path];
|
|
114
|
+
yield ROW_WEIGHT;
|
|
115
|
+
}
|
|
116
|
+
return yield* settling(binaries);
|
|
117
|
+
}
|
|
118
|
+
function* returning(confirmed, submitted, accepted, roomVersion, writtenAt) {
|
|
119
|
+
const held = confirmed.record;
|
|
120
|
+
const documents = drafted(held.documents);
|
|
121
|
+
const revisions = drafted(held.revisions);
|
|
122
|
+
const fileIds = drafted(held.fileIds);
|
|
123
|
+
const changes = drafted(held.changes);
|
|
124
|
+
const written = drafted(held.written);
|
|
125
|
+
for (const [path, content] of entriesIn(accepted.documents)) {
|
|
126
|
+
documents[path] = content;
|
|
127
|
+
delete fileIds[path];
|
|
128
|
+
written[path] = writtenAt;
|
|
129
|
+
yield ROW_WEIGHT + content.length;
|
|
130
|
+
}
|
|
131
|
+
for (const [path, revision] of entriesIn(accepted.revisions)) {
|
|
132
|
+
revisions[path] = revision;
|
|
133
|
+
delete fileIds[path];
|
|
134
|
+
if (held.revisions[path] !== revision)
|
|
135
|
+
delete changes[path];
|
|
136
|
+
yield ROW_WEIGHT;
|
|
137
|
+
}
|
|
138
|
+
for (const [path, fileId] of entriesIn(accepted.fileIds ?? {})) {
|
|
139
|
+
fileIds[path] = fileId;
|
|
140
|
+
yield ROW_WEIGHT;
|
|
141
|
+
}
|
|
142
|
+
for (const [path, change] of entriesIn(accepted.changes)) {
|
|
143
|
+
changes[path] = change;
|
|
144
|
+
yield ROW_WEIGHT;
|
|
145
|
+
}
|
|
146
|
+
for (const path of accepted.removals) {
|
|
147
|
+
delete documents[path];
|
|
148
|
+
delete revisions[path];
|
|
149
|
+
delete fileIds[path];
|
|
150
|
+
delete changes[path];
|
|
151
|
+
delete written[path];
|
|
152
|
+
yield ROW_WEIGHT;
|
|
153
|
+
}
|
|
154
|
+
return yield* staging({
|
|
155
|
+
...held,
|
|
71
156
|
roomVersion,
|
|
72
|
-
documents:
|
|
73
|
-
revisions:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
? confirmed.record.attachments
|
|
79
|
-
: declaredAttachments([attachments]),
|
|
157
|
+
documents: yield* settling(documents),
|
|
158
|
+
revisions: yield* settling(revisions),
|
|
159
|
+
fileIds: yield* settling(fileIds),
|
|
160
|
+
changes: yield* settling(changes),
|
|
161
|
+
written: yield* settling(written),
|
|
162
|
+
binaries: yield* returnedBinaries(held.binaries, submitted, accepted),
|
|
80
163
|
}, confirmed);
|
|
81
164
|
}
|
|
82
|
-
function
|
|
165
|
+
export function applyReturned(confirmed, submitted, accepted, roomVersion, writtenAt) {
|
|
166
|
+
return stepped(returning(confirmed, submitted, accepted, roomVersion, writtenAt));
|
|
167
|
+
}
|
|
168
|
+
function* predicting(confirmed, batches, previous) {
|
|
83
169
|
const composition = compositionOf(confirmed.record);
|
|
170
|
+
const locator = confirmed.record.locator;
|
|
84
171
|
let layer = confirmed.record;
|
|
85
172
|
const replay = [];
|
|
86
173
|
const prior = new Map(previous?.replay.map((step) => [step.id, step]) ?? []);
|
|
87
174
|
for (const batch of batches) {
|
|
88
175
|
const before = layer;
|
|
89
176
|
const old = prior.get(batch.id);
|
|
90
|
-
const hasMove = batch
|
|
177
|
+
const hasMove = rewriting(batch, locator);
|
|
91
178
|
const reuseRewrite = old?.collection !== undefined &&
|
|
92
|
-
|
|
179
|
+
(yield* sameText(before, old.before)) &&
|
|
93
180
|
old.collection.composition.model === composition.model &&
|
|
94
181
|
old.collection.composition.selection?.model === composition.selection?.model &&
|
|
95
182
|
JSON.stringify(old.collection.composition.selection?.roots) ===
|
|
@@ -97,19 +184,17 @@ function predicted(confirmed, batches, previous) {
|
|
|
97
184
|
const collection = hasMove
|
|
98
185
|
? reuseRewrite
|
|
99
186
|
? old.collection
|
|
100
|
-
:
|
|
101
|
-
? { text: confirmed.record.documents, collection: confirmed.collection }
|
|
102
|
-
: { text: old.before.documents, collection: old.collection })
|
|
187
|
+
: yield* collecting(before.documents, composition, old?.collection ?? confirmed.collection)
|
|
103
188
|
: undefined;
|
|
104
189
|
const effective = collection === undefined
|
|
105
190
|
? batch
|
|
106
191
|
: reuseRewrite
|
|
107
192
|
? old.effective
|
|
108
|
-
:
|
|
193
|
+
: yield* effectiveIn(batch, locator, { ...before, collection });
|
|
109
194
|
layer =
|
|
110
195
|
old === undefined
|
|
111
|
-
?
|
|
112
|
-
: overlayChanged(before,
|
|
196
|
+
? yield* overlaying(before, [effective])
|
|
197
|
+
: yield* overlayChanged(before, effective, old.before, old.effective, old.after);
|
|
113
198
|
replay.push({
|
|
114
199
|
id: batch.id,
|
|
115
200
|
before,
|
|
@@ -120,7 +205,7 @@ function predicted(confirmed, batches, previous) {
|
|
|
120
205
|
}
|
|
121
206
|
return { layer, replay };
|
|
122
207
|
}
|
|
123
|
-
export function
|
|
208
|
+
export function* replicating(confirmed, queue, previous) {
|
|
124
209
|
const batches = Object.freeze(queue.map(immutable));
|
|
125
210
|
if (batches.length === 0) {
|
|
126
211
|
return {
|
|
@@ -128,29 +213,28 @@ export function replicaOf(confirmed, queue, previous) {
|
|
|
128
213
|
queue: batches,
|
|
129
214
|
visible: {
|
|
130
215
|
documents: confirmed.record.documents,
|
|
131
|
-
|
|
216
|
+
binaries: confirmed.record.binaries,
|
|
132
217
|
revisions: confirmed.record.revisions,
|
|
218
|
+
fileIds: confirmed.record.fileIds,
|
|
133
219
|
changes: confirmed.record.changes,
|
|
134
220
|
collection: confirmed.collection,
|
|
135
221
|
},
|
|
136
222
|
replay: [],
|
|
137
223
|
};
|
|
138
224
|
}
|
|
139
|
-
const { layer, replay } =
|
|
225
|
+
const { layer, replay } = yield* predicting(confirmed, batches, previous);
|
|
140
226
|
return {
|
|
141
227
|
confirmed,
|
|
142
228
|
queue: batches,
|
|
143
229
|
replay,
|
|
144
230
|
visible: {
|
|
145
231
|
...layer,
|
|
146
|
-
collection:
|
|
147
|
-
? undefined
|
|
148
|
-
: { text: previous.visible.documents, collection: previous.visible.collection }),
|
|
232
|
+
collection: yield* collecting(layer.documents, compositionOf(confirmed.record), previous?.visible.collection ?? confirmed.collection),
|
|
149
233
|
},
|
|
150
234
|
};
|
|
151
235
|
}
|
|
152
236
|
function present(layer, path) {
|
|
153
|
-
return layer.documents[path] !== undefined || layer.
|
|
237
|
+
return layer.documents[path] !== undefined || layer.binaries[path] !== undefined;
|
|
154
238
|
}
|
|
155
239
|
function holds(layer, preconditions) {
|
|
156
240
|
const parsed = new Map();
|
|
@@ -171,6 +255,8 @@ function holds(layer, preconditions) {
|
|
|
171
255
|
if (precondition.kind === 'revision') {
|
|
172
256
|
return present(layer, path) && layer.revisions[path] === precondition.revision;
|
|
173
257
|
}
|
|
258
|
+
if (precondition.kind === 'content')
|
|
259
|
+
return layer.documents[path] === precondition.content;
|
|
174
260
|
const document = documentAt(path);
|
|
175
261
|
if (document === null)
|
|
176
262
|
return false;
|
|
@@ -215,53 +301,74 @@ function effects(change) {
|
|
|
215
301
|
{ kind: 'present', path: change.to },
|
|
216
302
|
];
|
|
217
303
|
}
|
|
304
|
+
if (change.kind === 'binary' || change.kind === 'arrival')
|
|
305
|
+
return [{ kind: 'present', path }];
|
|
218
306
|
return [{ kind: 'absent', path }];
|
|
219
307
|
}
|
|
220
|
-
function after(changes, index, path) {
|
|
221
|
-
let at = path;
|
|
222
|
-
for (const change of changes.slice(index + 1)) {
|
|
223
|
-
if (change.path !== at)
|
|
224
|
-
continue;
|
|
225
|
-
if (change.kind === 'remove')
|
|
226
|
-
return null;
|
|
227
|
-
if (change.kind === 'move')
|
|
228
|
-
at = change.to;
|
|
229
|
-
}
|
|
230
|
-
return at;
|
|
231
|
-
}
|
|
232
308
|
export function landed(batch, confirmed, current = {}) {
|
|
233
|
-
const layer = {
|
|
309
|
+
const layer = {
|
|
310
|
+
...confirmed.record,
|
|
311
|
+
documents: patched(confirmed.record.documents, Object.entries(current)),
|
|
312
|
+
};
|
|
234
313
|
return batch.changes.every((change, index) => {
|
|
235
314
|
if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
|
|
236
|
-
const at =
|
|
315
|
+
const at = landing(batch.changes, index, change.path);
|
|
237
316
|
return at === null || layer.documents[at] === change.content;
|
|
238
317
|
}
|
|
318
|
+
if (change.kind === 'binary') {
|
|
319
|
+
const at = landing(batch.changes, index, change.path);
|
|
320
|
+
return at === null || layer.binaries[at]?.sha256 === change.sha256;
|
|
321
|
+
}
|
|
239
322
|
return effects(change).every((effect) => {
|
|
240
323
|
if (effect.kind === 'absent')
|
|
241
324
|
return holds(layer, [effect]);
|
|
242
|
-
const at =
|
|
325
|
+
const at = landing(batch.changes, index, effect.path);
|
|
243
326
|
return at === null || holds(layer, [{ ...effect, path: at }]);
|
|
244
327
|
});
|
|
245
328
|
});
|
|
246
329
|
}
|
|
247
|
-
|
|
330
|
+
function founded(batch, layer) {
|
|
331
|
+
let changed = false;
|
|
332
|
+
const preconditions = batch.preconditions.map((precondition) => {
|
|
333
|
+
if (precondition.kind !== 'content')
|
|
334
|
+
return precondition;
|
|
335
|
+
const revision = layer.revisions[precondition.path];
|
|
336
|
+
if (revision === undefined || layer.documents[precondition.path] !== precondition.content) {
|
|
337
|
+
return precondition;
|
|
338
|
+
}
|
|
339
|
+
changed = true;
|
|
340
|
+
return { kind: 'revision', path: precondition.path, revision };
|
|
341
|
+
});
|
|
342
|
+
return changed ? immutable({ ...batch, preconditions }) : batch;
|
|
343
|
+
}
|
|
344
|
+
export function* standing(confirmed, queue, withdrawable, local) {
|
|
248
345
|
if (!queue.some(withdrawable))
|
|
249
|
-
return [];
|
|
346
|
+
return { withdrawn: [], kept: queue };
|
|
250
347
|
const composition = compositionOf(confirmed.record);
|
|
251
348
|
let layer = confirmed.record;
|
|
252
349
|
const withdrawn = [];
|
|
350
|
+
const kept = [];
|
|
253
351
|
for (const batch of queue) {
|
|
254
352
|
if (withdrawable(batch) && !holds(layer, batch.preconditions)) {
|
|
255
353
|
withdrawn.push(batch);
|
|
256
354
|
continue;
|
|
257
355
|
}
|
|
258
|
-
const effective = batch.
|
|
259
|
-
?
|
|
356
|
+
const effective = rewriting(batch, confirmed.record.locator)
|
|
357
|
+
? yield* effectiveIn(batch, confirmed.record.locator, {
|
|
260
358
|
...layer,
|
|
261
|
-
collection:
|
|
359
|
+
collection: yield* collecting(layer.documents, composition),
|
|
262
360
|
})
|
|
263
361
|
: batch;
|
|
264
|
-
|
|
362
|
+
let unapplied = false;
|
|
363
|
+
const next = yield* overlaying(layer, [effective], () => {
|
|
364
|
+
unapplied = true;
|
|
365
|
+
});
|
|
366
|
+
if (local && unapplied) {
|
|
367
|
+
withdrawn.push(batch);
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
kept.push(local || !withdrawable(batch) ? batch : founded(batch, layer));
|
|
371
|
+
layer = next;
|
|
265
372
|
}
|
|
266
|
-
return withdrawn;
|
|
373
|
+
return { withdrawn, kept };
|
|
267
374
|
}
|
package/dist/room-draft.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderRefusal } from './adapter.js';
|
|
2
|
+
import type { Open } from './open.js';
|
|
2
3
|
import type { Change, Precondition } from './change.js';
|
|
3
4
|
import type { VisibleLayer } from './replica.js';
|
|
4
5
|
export type FieldValue = {
|
|
@@ -31,11 +32,23 @@ export type RoomDraftParts = {
|
|
|
31
32
|
readonly creation?: RoomDraftCreation;
|
|
32
33
|
readonly move?: {
|
|
33
34
|
readonly to: string;
|
|
35
|
+
readonly room?: string;
|
|
34
36
|
readonly base?: string | null;
|
|
35
37
|
};
|
|
36
38
|
readonly removal?: {
|
|
37
39
|
readonly base?: string | null;
|
|
38
40
|
};
|
|
41
|
+
readonly file?: {
|
|
42
|
+
readonly blob: Blob;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type HeldFile = {
|
|
46
|
+
readonly localId: string;
|
|
47
|
+
readonly name?: string;
|
|
48
|
+
readonly byteLength: number;
|
|
49
|
+
readonly mediaType: string;
|
|
50
|
+
readonly sha256: string;
|
|
51
|
+
readonly base: string | null;
|
|
39
52
|
};
|
|
40
53
|
type HeldParts = {
|
|
41
54
|
readonly fields?: Readonly<Record<string, {
|
|
@@ -57,11 +70,13 @@ type HeldParts = {
|
|
|
57
70
|
readonly creation?: RoomDraftCreation;
|
|
58
71
|
readonly move?: {
|
|
59
72
|
readonly to: string;
|
|
73
|
+
readonly room?: string;
|
|
60
74
|
readonly base: string | null;
|
|
61
75
|
};
|
|
62
76
|
readonly removal?: {
|
|
63
77
|
readonly base: string | null;
|
|
64
78
|
};
|
|
79
|
+
readonly file?: HeldFile;
|
|
65
80
|
};
|
|
66
81
|
type ChangedUnderneath = {
|
|
67
82
|
readonly fields?: Readonly<Record<string, FieldValue>>;
|
|
@@ -71,14 +86,12 @@ type ChangedUnderneath = {
|
|
|
71
86
|
readonly creation?: string;
|
|
72
87
|
readonly move?: string | null;
|
|
73
88
|
readonly removal?: string | null;
|
|
89
|
+
readonly file?: string | null;
|
|
74
90
|
};
|
|
75
|
-
export type ReturnReason =
|
|
76
|
-
readonly kind: 'conflicted' | 'rejected'
|
|
77
|
-
}) | {
|
|
78
|
-
readonly kind: 'expired';
|
|
79
|
-
} | {
|
|
80
|
-
readonly kind: 'withdrawn';
|
|
91
|
+
export type ReturnReason = ProviderRefusal & {
|
|
92
|
+
readonly kind: Open<'conflicted' | 'rejected' | 'expired' | 'withdrawn'>;
|
|
81
93
|
};
|
|
94
|
+
export declare function returnedBy(kind: 'expired' | 'withdrawn'): ReturnReason;
|
|
82
95
|
export type RoomDraft = {
|
|
83
96
|
readonly room: string;
|
|
84
97
|
readonly path: string;
|
|
@@ -92,11 +105,14 @@ export type RoomDraftWrite = {
|
|
|
92
105
|
readonly roomDraft: RoomDraft | null;
|
|
93
106
|
} | {
|
|
94
107
|
readonly outcome: 'stale';
|
|
108
|
+
readonly code: string;
|
|
109
|
+
readonly retryable: boolean;
|
|
95
110
|
readonly current: RoomDraft | null;
|
|
96
111
|
};
|
|
112
|
+
export declare function staleWrite(current: RoomDraft | null): RoomDraftWrite;
|
|
97
113
|
export type ChangedPart = {
|
|
98
114
|
readonly path: string;
|
|
99
|
-
readonly part: 'field' | 'section' | 'preamble' | 'markdown' | 'creation' | 'move' | 'removal'
|
|
115
|
+
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | 'creation' | 'move' | 'removal' | 'file'>;
|
|
100
116
|
readonly name?: string;
|
|
101
117
|
};
|
|
102
118
|
export type RoomDraftRecord = {
|
|
@@ -111,10 +127,23 @@ export type SavedDraft = {
|
|
|
111
127
|
readonly parts: HeldParts;
|
|
112
128
|
};
|
|
113
129
|
export declare function readParts(value: unknown): RoomDraftParts;
|
|
114
|
-
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts): HeldParts;
|
|
115
|
-
export declare function equalValue(left: unknown, right: unknown): boolean;
|
|
130
|
+
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts, file?: HeldFile): HeldParts;
|
|
116
131
|
export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
|
|
132
|
+
export declare function heldFile(blob: Blob, base: string | null): Promise<HeldFile>;
|
|
133
|
+
export declare function binaryBase(visible: VisibleLayer | undefined, path: string): string | null;
|
|
117
134
|
export declare function changedParts(path: string, report: ChangedUnderneath): readonly ChangedPart[];
|
|
135
|
+
export type TextParts = {
|
|
136
|
+
readonly fields?: Readonly<Record<string, {
|
|
137
|
+
readonly value: unknown;
|
|
138
|
+
}>>;
|
|
139
|
+
readonly sections?: Readonly<Record<string, {
|
|
140
|
+
readonly value: string;
|
|
141
|
+
}>>;
|
|
142
|
+
readonly preamble?: {
|
|
143
|
+
readonly value: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export declare function partsAfter(markdown: string, parts: TextParts): string;
|
|
118
147
|
export declare function returnedInto(existing: HeldParts | undefined, returned: HeldParts): HeldParts;
|
|
119
148
|
export declare function moveTarget(move: {
|
|
120
149
|
readonly to: string;
|
|
@@ -123,5 +152,7 @@ export declare function changesOf(path: string, parts: HeldParts): {
|
|
|
123
152
|
changes: readonly Change[];
|
|
124
153
|
bases: readonly Precondition[];
|
|
125
154
|
};
|
|
155
|
+
export declare function joinedDraft(carried: SavedDraft, saved: readonly SavedDraft[]): SavedDraft;
|
|
156
|
+
export declare function withdrawnDrafts(drafts: readonly SavedDraft[], changes: readonly Change[]): readonly SavedDraft[];
|
|
126
157
|
export {};
|
|
127
158
|
//# sourceMappingURL=room-draft.d.ts.map
|
package/dist/room-draft.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAA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