@agentshouse/mdruntime 0.1.0-cee9c8aa4cd86 → 0.1.0-cef76ea952695
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 +19 -17
- package/dist/acceptance.d.ts +6 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +385 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +251 -0
- package/dist/adapter.d.ts +111 -109
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +5 -11
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +36 -47
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +22 -10
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +303 -123
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- 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/change.js +4 -2
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +30 -14
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +61 -10
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +24 -19
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +290 -297
- package/dist/connection.d.ts +6 -142
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +105 -4827
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +1 -4
- package/dist/conversation-live.d.ts +135 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +247 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +53 -0
- package/dist/conversation.d.ts +42 -46
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +901 -815
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/durability.d.ts +15 -4
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- package/dist/expectation.d.ts +4 -2
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +33 -11
- package/dist/failure.d.ts +1 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -0
- package/dist/figures.d.ts +49 -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/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +4 -6
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +59 -38
- 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 +30 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/install.d.ts +56 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +556 -0
- package/dist/job.d.ts +5 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +7 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +270 -0
- package/dist/listing.d.ts +53 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +176 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +63 -21
- package/dist/locks.d.ts +9 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +62 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +61 -0
- 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 +13 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +219 -102
- package/dist/messages.d.ts +24 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +89 -31
- package/dist/model.d.ts +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -18
- package/dist/models.d.ts +14 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +197 -0
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +15 -15
- package/dist/opened.js +3 -3
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +60 -0
- package/dist/outcome.d.ts +17 -7
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +19 -5
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +12 -1
- package/dist/parts.d.ts +11 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +21 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +26 -0
- package/dist/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +233 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +272 -0
- package/dist/query.d.ts +19 -206
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -494
- package/dist/{chat/questions.d.ts → questions.d.ts} +5 -2
- package/dist/questions.d.ts.map +1 -0
- package/dist/{chat/questions.js → questions.js} +13 -2
- package/dist/reach.d.ts +20 -13
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +204 -135
- package/dist/react.d.ts +14 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +10 -1
- package/dist/{chat/read.d.ts → read.d.ts} +2 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/{chat/read.js → read.js} +4 -0
- package/dist/readiness.d.ts +12 -16
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -8
- package/dist/reads.d.ts +36 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +159 -83
- 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 +10 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +92 -30
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +57 -0
- package/dist/replica.d.ts +11 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +56 -23
- package/dist/room-draft.d.ts +22 -7
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +134 -54
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +217 -0
- package/dist/rows.d.ts +18 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +45 -153
- package/dist/runtime.d.ts +43 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +7 -1
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +46 -27
- package/dist/saves.d.ts +70 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +1005 -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 +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -1
- package/dist/shared.d.ts +1 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -105
- package/dist/shown.d.ts +31 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +290 -0
- 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/lanes.d.ts +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -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/rooms.d.ts +44 -0
- package/dist/socket/rooms.d.ts.map +1 -0
- package/dist/socket/rooms.js +90 -0
- package/dist/socket/session.d.ts +38 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +70 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +175 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +82 -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/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +210 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +428 -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/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -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 +105 -149
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +143 -390
- package/dist/stored.d.ts +67 -49
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +358 -253
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +224 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +532 -0
- package/dist/tables.d.ts +140 -60
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +268 -101
- 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 +22 -10
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +9 -3
- package/package.json +12 -18
- package/AGENTS.md +0 -320
- package/dist/chat/acts.d.ts +0 -33
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/earlier.d.ts +0 -10
- package/dist/chat/earlier.d.ts.map +0 -1
- package/dist/chat/earlier.js +0 -54
- package/dist/chat/house.d.ts +0 -25
- package/dist/chat/house.d.ts.map +0 -1
- package/dist/chat/house.js +0 -38
- package/dist/chat/input.d.ts +0 -11
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -92
- package/dist/chat/kit.d.ts +0 -61
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -28
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -103
- package/dist/chat/markdown.d.ts +0 -21
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -246
- package/dist/chat/message.d.ts +0 -7
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -254
- package/dist/chat/messages.d.ts +0 -35
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -210
- package/dist/chat/name.d.ts +0 -7
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -12
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -19
- package/dist/chat/overlay.d.ts +0 -32
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -103
- package/dist/chat/parts.d.ts +0 -58
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -120
- package/dist/chat/pieces.d.ts +0 -62
- package/dist/chat/pieces.d.ts.map +0 -1
- package/dist/chat/pieces.js +0 -1110
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -70
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -635
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -69
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/ready.d.ts +0 -37
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -93
- package/dist/chat/room-file.d.ts +0 -8
- package/dist/chat/room-file.d.ts.map +0 -1
- package/dist/chat/room-file.js +0 -72
- package/dist/chat/steady.d.ts +0 -3
- package/dist/chat/steady.d.ts.map +0 -1
- package/dist/chat/steady.js +0 -26
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -307
- package/dist/chat.d.ts +0 -15
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- 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
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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Authorization, DiscoveredRoom, PathRule, ScopedRefusal, TypedPath } from './adapter.js';
|
|
2
|
+
import type { ChangeSet } from './change-set.js';
|
|
3
|
+
import type { ChangeBatch } from './change.js';
|
|
4
|
+
import type { RuntimeShell } from './durability.js';
|
|
5
|
+
import type { LiveConversations } from './conversation-live.js';
|
|
6
|
+
import type { FiguresRead } from './figures.js';
|
|
7
|
+
import type { Withheld } from './install.js';
|
|
8
|
+
import type { LiveQueries } from './live.js';
|
|
9
|
+
import type { Log } from './log.js';
|
|
10
|
+
import type { ModelState } from './model.js';
|
|
11
|
+
import type { ReadAnswers } from './reads.js';
|
|
12
|
+
import type { Recovery } from './recovery.js';
|
|
13
|
+
import type { ReplicaRecord } from './replica.js';
|
|
14
|
+
import type { RuntimeSocket, RoomDeclaration } from './socket.js';
|
|
15
|
+
import type { CycleProgress } from './status.js';
|
|
16
|
+
import type { Settling } from './saves.js';
|
|
17
|
+
import type { HeldCover, RuntimeStore, Store, Work } from './store.js';
|
|
18
|
+
import type { schemaTypes } from './attached-model.js';
|
|
19
|
+
export type Runtime = {
|
|
20
|
+
readonly store: Store;
|
|
21
|
+
readonly socket: RuntimeSocket;
|
|
22
|
+
readonly journal: Log;
|
|
23
|
+
readonly recovery: Recovery;
|
|
24
|
+
readonly shell: RuntimeShell;
|
|
25
|
+
readonly localSaves: boolean;
|
|
26
|
+
readonly roomTypes: Parameters<typeof schemaTypes>[1];
|
|
27
|
+
readonly builtIn: ModelState;
|
|
28
|
+
readonly typedPaths: readonly TypedPath[];
|
|
29
|
+
readonly pathRule: PathRule;
|
|
30
|
+
readonly usableWhenHeld: readonly string[];
|
|
31
|
+
readonly build: string;
|
|
32
|
+
readonly conversations: LiveConversations;
|
|
33
|
+
readonly liveQueries: LiveQueries<HeldCover>;
|
|
34
|
+
readonly figures: FiguresRead;
|
|
35
|
+
readonly lastAnswers: ReadAnswers;
|
|
36
|
+
settle(local: RuntimeStore, locator: string, work: Work, record: ReplicaRecord, queue: readonly ChangeBatch[], settling?: Settling): Promise<ChangeSet>;
|
|
37
|
+
scoped(result: ScopedRefusal, room: RoomDeclaration, local: RuntimeStore): Promise<void>;
|
|
38
|
+
submitLater(locator: string): void;
|
|
39
|
+
unpair(local: RuntimeStore): Promise<void>;
|
|
40
|
+
advanced(room: DiscoveredRoom, local: RuntimeStore, authorized: Authorization): Promise<Withheld | null>;
|
|
41
|
+
withhold(withheld: Withheld, room: DiscoveredRoom, local: RuntimeStore, progress: CycleProgress): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KA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B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,SAAS,CAAC,CAAC;IACtB,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CACN,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,aAAa,GACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC5B,QAAQ,CACN,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,aAAa,GACtB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB,CAAC"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/save.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Validation } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { OperationScopes, ProviderLimit } from './adapter.js';
|
|
2
|
+
import type { OperationScopes, PathRule, ProviderLimit } from './adapter.js';
|
|
3
3
|
import { type Change, type ChangeBatch, type Precondition, type WrittenBy } from './change.js';
|
|
4
4
|
import { type Composition } from './collection.js';
|
|
5
5
|
import { type Layer } from './overlay.js';
|
|
@@ -19,8 +19,11 @@ export type SaveInput = {
|
|
|
19
19
|
baseRoomVersion: string;
|
|
20
20
|
operations: import('./adapter.js').OperationScopes;
|
|
21
21
|
providerOwnedPaths: readonly string[];
|
|
22
|
+
authoredPaths?: readonly string[];
|
|
22
23
|
providerLimits: readonly ProviderLimit[];
|
|
24
|
+
pathRule: PathRule;
|
|
23
25
|
visible: VisibleLayer;
|
|
26
|
+
folders: ReadonlySet<string>;
|
|
24
27
|
handle: string;
|
|
25
28
|
changes: readonly Change[];
|
|
26
29
|
bases: readonly Precondition[];
|
|
@@ -74,7 +77,9 @@ export type MoveSide = {
|
|
|
74
77
|
composition: Composition;
|
|
75
78
|
operations: OperationScopes;
|
|
76
79
|
providerOwnedPaths: readonly string[];
|
|
80
|
+
authoredPaths?: readonly string[];
|
|
77
81
|
visible: VisibleLayer;
|
|
82
|
+
folders: ReadonlySet<string>;
|
|
78
83
|
queued: ReadonlySet<string>;
|
|
79
84
|
unmodeled: boolean;
|
|
80
85
|
validate: Validator;
|
|
@@ -87,6 +92,7 @@ export type MoveInput = {
|
|
|
87
92
|
readonly to: string;
|
|
88
93
|
}[];
|
|
89
94
|
providerLimits: readonly ProviderLimit[];
|
|
95
|
+
pathRule: PathRule;
|
|
90
96
|
local: boolean;
|
|
91
97
|
writtenBy?: WrittenBy;
|
|
92
98
|
};
|
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;
|
|
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,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,SAAS,EACf,MAAM,aA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,eAAe,CAAC;IAC5B,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,QAAQ,CAAC;IACtB,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,QAAQ,CAAC;AAuInG,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAE/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjE"}
|
package/dist/save.js
CHANGED
|
@@ -4,8 +4,8 @@ import { immutable, leaving, queuedFile, departure, } from './change.js';
|
|
|
4
4
|
import { collectionOf, documentsOf, governing, } from './collection.js';
|
|
5
5
|
import { changeBatchIdentity } from './identity.js';
|
|
6
6
|
import { overlaying } from './overlay.js';
|
|
7
|
-
import { covered, normalize } from './paths.js';
|
|
8
|
-
import { sorting } from './shared.js';
|
|
7
|
+
import { ancestors, authoredAt, covered, normalize } from './paths.js';
|
|
8
|
+
import { entriesIn, sorting } from './shared.js';
|
|
9
9
|
import { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
10
10
|
import { validatedCollection } from './validation.js';
|
|
11
11
|
function refuse(code, file, location) {
|
|
@@ -20,9 +20,6 @@ function refuse(code, file, location) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function repointed(document, definition, from, to, moves, settled) {
|
|
23
|
-
const parsed = parse(document.content, from);
|
|
24
|
-
if (!parsed.ok)
|
|
25
|
-
return [];
|
|
26
23
|
const changes = [];
|
|
27
24
|
const names = new Set();
|
|
28
25
|
for (const { pointer, value } of definition === undefined
|
|
@@ -45,7 +42,7 @@ function repointed(document, definition, from, to, moves, settled) {
|
|
|
45
42
|
}
|
|
46
43
|
if (changes.length === 0)
|
|
47
44
|
return [];
|
|
48
|
-
const applied = apply(
|
|
45
|
+
const applied = apply(document, changes);
|
|
49
46
|
if (applied.outcome !== 'applied')
|
|
50
47
|
return [];
|
|
51
48
|
const next = applied.document;
|
|
@@ -117,6 +114,15 @@ function relinks(path, moved, before, moves) {
|
|
|
117
114
|
function partKey(change) {
|
|
118
115
|
return change.kind === 'section' ? `section ${change.name}` : change.kind;
|
|
119
116
|
}
|
|
117
|
+
const NAMES_A_SKIP_TESTS = 64;
|
|
118
|
+
const ENCODED = /[%&\\]/u;
|
|
119
|
+
function movedNames(moves) {
|
|
120
|
+
const names = new Set([...moves.keys()].map((path) => path.slice(path.lastIndexOf('/') + 1)));
|
|
121
|
+
return names.size > NAMES_A_SKIP_TESTS ? null : [...names];
|
|
122
|
+
}
|
|
123
|
+
function cannotLink(text, names) {
|
|
124
|
+
return names !== null && !ENCODED.test(text) && !names.some((name) => text.includes(name));
|
|
125
|
+
}
|
|
120
126
|
function* rewrites(changes, visible) {
|
|
121
127
|
const moves = new Map();
|
|
122
128
|
const settled = new Set();
|
|
@@ -142,6 +148,7 @@ function* rewrites(changes, visible) {
|
|
|
142
148
|
}
|
|
143
149
|
if (moves.size === 0)
|
|
144
150
|
return { kind: 'changes', changes };
|
|
151
|
+
const names = movedNames(moves);
|
|
145
152
|
const merged = [...changes];
|
|
146
153
|
const added = [];
|
|
147
154
|
for (const [path, document] of yield* documentsOf(visible.collection)) {
|
|
@@ -152,7 +159,9 @@ function* rewrites(changes, visible) {
|
|
|
152
159
|
const repointing = repointed(document, definition, path, moved, moves, settled);
|
|
153
160
|
added.push(...repointing);
|
|
154
161
|
const own = parts.get(path) ?? [];
|
|
155
|
-
const relinked =
|
|
162
|
+
const relinked = moved === path && own.length === 0 && cannotLink(document.content, names)
|
|
163
|
+
? { kind: 'changes', changes: [] }
|
|
164
|
+
: relinks(path, moved, edited(document, own.map((index) => merged[index])), moves);
|
|
156
165
|
if (relinked.kind === 'refused')
|
|
157
166
|
return relinked;
|
|
158
167
|
const keyed = new Map();
|
|
@@ -321,6 +330,8 @@ function* incoming(collection, removed, candidates) {
|
|
|
321
330
|
function affected(change) {
|
|
322
331
|
return change.kind === 'move' ? [change.path, change.to] : [change.path];
|
|
323
332
|
}
|
|
333
|
+
const WRITE = ['write'];
|
|
334
|
+
const MOVE_OUT = ['write', 'erase'];
|
|
324
335
|
function guard(changes, input, removing) {
|
|
325
336
|
const overridden = new Map();
|
|
326
337
|
const existing = {
|
|
@@ -329,21 +340,26 @@ function guard(changes, input, removing) {
|
|
|
329
340
|
add: (path) => void overridden.set(path, true),
|
|
330
341
|
delete: (path) => void overridden.set(path, false),
|
|
331
342
|
};
|
|
343
|
+
const occupied = (path) => input.folders.has(path) ? path : (ancestors(path).find((one) => existing.has(one)) ?? null);
|
|
332
344
|
for (const [index, change] of changes.entries()) {
|
|
333
345
|
for (const path of affected(change)) {
|
|
334
346
|
const normalized = normalize(path);
|
|
335
347
|
if (normalized === null || normalized === '')
|
|
336
348
|
return refuse('room-root', path);
|
|
337
|
-
if (covered(input.providerOwnedPaths, normalized)
|
|
349
|
+
if (covered(input.providerOwnedPaths, normalized) ||
|
|
350
|
+
(input.authoredPaths !== undefined && !authoredAt(input.authoredPaths, normalized))) {
|
|
338
351
|
return refuse('provider-owned-path', normalized);
|
|
339
352
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
353
|
+
if (!input.pathRule(normalized))
|
|
354
|
+
return refuse('invalid-path', normalized);
|
|
355
|
+
for (const operation of change.kind === 'remove' ? removing : WRITE)
|
|
356
|
+
if (!input.local && !covered(input.operations[operation], normalized))
|
|
357
|
+
return refuse(`${operation}-grant`, normalized);
|
|
343
358
|
}
|
|
344
359
|
if (change.kind === 'create' || change.kind === 'arrival') {
|
|
345
|
-
|
|
346
|
-
|
|
360
|
+
const taken = existing.has(change.path) ? change.path : occupied(change.path);
|
|
361
|
+
if (taken !== null)
|
|
362
|
+
return refuse('path-collision', taken);
|
|
347
363
|
existing.add(change.path);
|
|
348
364
|
continue;
|
|
349
365
|
}
|
|
@@ -353,6 +369,9 @@ function guard(changes, input, removing) {
|
|
|
353
369
|
input.bases.some((base) => base.kind === 'absent' && base.path === change.path))) {
|
|
354
370
|
return refuse('path-collision', change.path);
|
|
355
371
|
}
|
|
372
|
+
const taken = occupied(change.path);
|
|
373
|
+
if (taken !== null)
|
|
374
|
+
return refuse('path-collision', taken);
|
|
356
375
|
if (!input.local &&
|
|
357
376
|
existing.has(change.path) &&
|
|
358
377
|
input.visible.revisions[departure(changes, index)] === undefined) {
|
|
@@ -364,8 +383,9 @@ function guard(changes, input, removing) {
|
|
|
364
383
|
if (change.kind === 'move') {
|
|
365
384
|
if (!existing.has(change.path))
|
|
366
385
|
return refuse('path-absent', change.path);
|
|
367
|
-
|
|
368
|
-
|
|
386
|
+
const taken = existing.has(change.to) ? change.to : occupied(change.to);
|
|
387
|
+
if (taken !== null)
|
|
388
|
+
return refuse('path-collision', taken);
|
|
369
389
|
if (unrevised(input, change.path)) {
|
|
370
390
|
return refuse('unknown-revision', change.path);
|
|
371
391
|
}
|
|
@@ -875,7 +895,7 @@ export function* limiting(queue, batch, limits, state) {
|
|
|
875
895
|
const at = queue.indexOf(batch);
|
|
876
896
|
const rewritten = yield* providerRewritten(batch, yield* state(queue.slice(0, at)));
|
|
877
897
|
const limited = yield* exceeding(limits, batch.changes, rewritten.changes, yield* state(queue.slice(0, at + 1)));
|
|
878
|
-
return limited?.
|
|
898
|
+
return limited?.refusal ?? null;
|
|
879
899
|
}
|
|
880
900
|
function typedText(content) {
|
|
881
901
|
if (content === undefined)
|
|
@@ -892,7 +912,7 @@ function touchedLibrary(resulting, touched, composition) {
|
|
|
892
912
|
})
|
|
893
913
|
.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
894
914
|
const contents = new Map(entries.map(({ path, content }) => [path, content]));
|
|
895
|
-
const binaries = new Set(
|
|
915
|
+
const binaries = new Set(Array.from(entriesIn(resulting.binaries), ([path]) => path));
|
|
896
916
|
return validatedCollection(() => Promise.resolve({ entries, next: null }), async (paths) => {
|
|
897
917
|
const known = new Map();
|
|
898
918
|
const pace = paced();
|
|
@@ -968,7 +988,7 @@ function roomReferencesIn(path, content, composition) {
|
|
|
968
988
|
const parsed = parse(content, path);
|
|
969
989
|
if (!parsed.ok)
|
|
970
990
|
return [];
|
|
971
|
-
return roomReferences(
|
|
991
|
+
return roomReferences(parsed.document, definitionOf(governing(composition, path), parsed.document.type));
|
|
972
992
|
}
|
|
973
993
|
function* admittedRooms(changes, visible, resulting, composition) {
|
|
974
994
|
const from = new Map();
|
|
@@ -1014,7 +1034,7 @@ async function batching(input) {
|
|
|
1014
1034
|
const rewritten = await stepped(rewrites(changes, input.visible));
|
|
1015
1035
|
if (rewritten.kind === 'refused')
|
|
1016
1036
|
return rewritten;
|
|
1017
|
-
const refusal = guard(changes, input,
|
|
1037
|
+
const refusal = guard(changes, input, WRITE);
|
|
1018
1038
|
if (refusal !== null)
|
|
1019
1039
|
return refusal;
|
|
1020
1040
|
const preconditions = await stepped(preconditionsOf(changes, input.visible, input.bases));
|
|
@@ -1063,9 +1083,10 @@ function arrivingText(path, to, source, moved) {
|
|
|
1063
1083
|
return applied.outcome === 'applied' ? serialize(applied.document) : content;
|
|
1064
1084
|
}
|
|
1065
1085
|
function arrivalOf({ path, to }, source, moved) {
|
|
1066
|
-
const { documents, revisions, fileIds, changes, binaries } = source.visible;
|
|
1086
|
+
const { documents, revisions, fileIds, created, changes, binaries } = source.visible;
|
|
1067
1087
|
const kept = {
|
|
1068
1088
|
...(fileIds[path] === undefined ? {} : { fileId: fileIds[path] }),
|
|
1089
|
+
...(created[path] === undefined ? {} : { created: created[path] }),
|
|
1069
1090
|
...(changes[path] === undefined ? {} : { change: changes[path] }),
|
|
1070
1091
|
};
|
|
1071
1092
|
const heads = {
|
|
@@ -1074,11 +1095,11 @@ function arrivalOf({ path, to }, source, moved) {
|
|
|
1074
1095
|
};
|
|
1075
1096
|
const binary = binaries[path];
|
|
1076
1097
|
if (binary?.state === 'accepted') {
|
|
1077
|
-
const {
|
|
1098
|
+
const { byteLength, mediaType, sha256 } = binary;
|
|
1078
1099
|
return {
|
|
1079
1100
|
kind: 'arrival',
|
|
1080
1101
|
path: to,
|
|
1081
|
-
binary: {
|
|
1102
|
+
binary: { byteLength, mediaType, sha256 },
|
|
1082
1103
|
...heads,
|
|
1083
1104
|
};
|
|
1084
1105
|
}
|
|
@@ -1091,11 +1112,9 @@ function arrivalOf({ path, to }, source, moved) {
|
|
|
1091
1112
|
};
|
|
1092
1113
|
}
|
|
1093
1114
|
async function moving(input) {
|
|
1094
|
-
const { source, destination, moves } = input;
|
|
1095
|
-
if (moves.length === 0)
|
|
1096
|
-
return refuse('no-change');
|
|
1115
|
+
const { source, destination, moves, pathRule } = input;
|
|
1097
1116
|
const removals = moves.map(({ path }) => ({ kind: 'remove', path }));
|
|
1098
|
-
const leaves = guard(removals, { ...source, local: input.local, bases: [] },
|
|
1117
|
+
const leaves = guard(removals, { ...source, local: input.local, bases: [], pathRule }, MOVE_OUT);
|
|
1099
1118
|
if (leaves !== null)
|
|
1100
1119
|
return leaves;
|
|
1101
1120
|
const uploading = moves.find(({ path }) => source.visible.binaries[path]?.state === 'pending');
|
|
@@ -1103,7 +1122,7 @@ async function moving(input) {
|
|
|
1103
1122
|
return refuse('unknown-revision', uploading.path);
|
|
1104
1123
|
const moved = new Map(moves.map(({ path, to }) => [path, to]));
|
|
1105
1124
|
const arrivals = moves.map((move) => arrivalOf(move, source, moved));
|
|
1106
|
-
const arrives = guard(arrivals, { ...destination, local: input.local, bases: [] },
|
|
1125
|
+
const arrives = guard(arrivals, { ...destination, local: input.local, bases: [], pathRule }, WRITE);
|
|
1107
1126
|
if (arrives !== null)
|
|
1108
1127
|
return arrives;
|
|
1109
1128
|
const bound = input.providerLimits.find((limit) => limit.name === MOVE_DOCUMENTS)?.value;
|
package/dist/saves.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ChangeSet } from './change-set.js';
|
|
2
|
+
import { type ChangeBatch, type WrittenBy } from './change.js';
|
|
3
|
+
import { type AttachAnswer, type BinaryLinkAnswer, type HeldBinaryAnswer, type HeldShownAnswer } from './outcome.js';
|
|
4
|
+
import { type HeldReplica, type ReplicaRecord, type Slice, type VisibleLayer } from './replica.js';
|
|
5
|
+
import { type ReturnReason, type RoomDraftParts } from './room-draft.js';
|
|
6
|
+
import type { Runtime } from './runtime.js';
|
|
7
|
+
import { type SaveRefusal } from './save.js';
|
|
8
|
+
import type { AuthoredWrite, CommittedWrite, PendingState, RoomCommit, RuntimeStore, Store, StoredEntry, View, Work } from './store.js';
|
|
9
|
+
export type SaveResult = {
|
|
10
|
+
outcome: 'saved';
|
|
11
|
+
identifier: string;
|
|
12
|
+
} | ({
|
|
13
|
+
outcome: 'refused';
|
|
14
|
+
} & SaveRefusal);
|
|
15
|
+
export type SavedRoomDraft = {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly revision: string;
|
|
18
|
+
};
|
|
19
|
+
export type SavedParts = {
|
|
20
|
+
readonly path: string;
|
|
21
|
+
readonly parts: RoomDraftParts;
|
|
22
|
+
};
|
|
23
|
+
export type BinaryFileSurface = {
|
|
24
|
+
read(room: string, path: string, revision?: string): Promise<HeldBinaryAnswer>;
|
|
25
|
+
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
26
|
+
show(room: string, path: string, revision?: string): Promise<HeldShownAnswer>;
|
|
27
|
+
attach(room: string, file: File): Promise<AttachAnswer>;
|
|
28
|
+
part(file: string, part: number): Promise<Uint8Array | null>;
|
|
29
|
+
};
|
|
30
|
+
export type Leaving = {
|
|
31
|
+
batch: ChangeBatch;
|
|
32
|
+
returned: ReturnReason | null;
|
|
33
|
+
};
|
|
34
|
+
export declare function withdrawable(states: ReadonlyMap<string, PendingState>): (batch: ChangeBatch) => boolean;
|
|
35
|
+
export declare function sliceAt(store: Store, record: ReplicaRecord, view: View, queue: readonly ChangeBatch[], extra?: Iterable<string>, moved?: Iterable<string>): Promise<Slice>;
|
|
36
|
+
export declare function landedWhole(store: Store, locator: string, batch: ChangeBatch, confirmedLayer: Slice, current?: Readonly<Record<string, string>>): Promise<boolean>;
|
|
37
|
+
export type Settling = {
|
|
38
|
+
leaving?: readonly Leaving[];
|
|
39
|
+
room?: boolean;
|
|
40
|
+
view?: View;
|
|
41
|
+
commit?: Pick<RoomCommit, 'published' | 'refreshed'>;
|
|
42
|
+
changes?: {
|
|
43
|
+
readonly set: readonly StoredEntry[];
|
|
44
|
+
readonly removed: readonly string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare function preparedAfter(runtime: Runtime, locator: string, answer: CommittedWrite): void;
|
|
48
|
+
export declare function replayed(store: Store, record: ReplicaRecord, confirmedLayer: Slice, queue: readonly ChangeBatch[]): import("./turn.js").Later<import("./replica.js").Replayed>;
|
|
49
|
+
export declare function overlayDiff(record: ReplicaRecord, before: HeldReplica | undefined, visible: VisibleLayer, touched: ReadonlySet<string>): Promise<{
|
|
50
|
+
overlay: NonNullable<RoomCommit['overlay']>;
|
|
51
|
+
touched: ReadonlySet<string>;
|
|
52
|
+
}>;
|
|
53
|
+
export type Settlement = {
|
|
54
|
+
readonly locator: string;
|
|
55
|
+
readonly left: readonly ChangeBatch[];
|
|
56
|
+
readonly commit: {
|
|
57
|
+
readonly rooms: readonly RoomCommit[];
|
|
58
|
+
readonly writes: readonly AuthoredWrite[];
|
|
59
|
+
};
|
|
60
|
+
apply(answer: CommittedWrite): ChangeSet;
|
|
61
|
+
};
|
|
62
|
+
export declare function settle(runtime: Runtime, local: RuntimeStore, locator: string, work: Work, record: ReplicaRecord, queue: readonly ChangeBatch[], settling?: Settling): Promise<ChangeSet>;
|
|
63
|
+
export declare function together(runtime: Runtime, local: RuntimeStore, settlements: readonly Settlement[]): Promise<ChangeSet>;
|
|
64
|
+
export declare function settlement(runtime: Runtime, local: RuntimeStore, locator: string, work: Work, record: ReplicaRecord, queue: readonly ChangeBatch[], settling?: Settling): Promise<Settlement>;
|
|
65
|
+
export declare function unpairing(runtime: Runtime, local: RuntimeStore, locator: string, batches: readonly ChangeBatch[]): Promise<Settlement>;
|
|
66
|
+
export declare function saveRoomDrafts(runtime: Runtime, locator: string, named: readonly SavedRoomDraft[], writtenBy: WrittenBy | undefined): Promise<SaveResult>;
|
|
67
|
+
export declare function saveParts(runtime: Runtime, locator: string, named: readonly SavedParts[], writtenBy: WrittenBy | undefined): Promise<SaveResult>;
|
|
68
|
+
export declare function batchFile(store: Store, batch: ChangeBatch): (localId: string) => Promise<Blob>;
|
|
69
|
+
export declare function binaryFileSurface(runtime: Runtime): BinaryFileSurface;
|
|
70
|
+
//# sourceMappingURL=saves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saves.d.ts","sourceRoot":"","sources":["../src/saves.ts"],"names":[],"mappings":"AAGA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,SAAS,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