@agentshouse/mdruntime 0.1.0-c49444f2a8fc6 → 0.1.0-c4c5934c45f21

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.
Files changed (261) hide show
  1. package/README.md +8 -8
  2. package/dist/acceptance.d.ts +3 -0
  3. package/dist/acceptance.d.ts.map +1 -0
  4. package/dist/acceptance.js +308 -0
  5. package/dist/act-lanes.d.ts +33 -0
  6. package/dist/act-lanes.d.ts.map +1 -0
  7. package/dist/act-lanes.js +177 -0
  8. package/dist/actions.d.ts +20 -0
  9. package/dist/actions.d.ts.map +1 -0
  10. package/dist/actions.js +251 -0
  11. package/dist/adapter.d.ts +31 -44
  12. package/dist/adapter.d.ts.map +1 -1
  13. package/dist/bootstrap.d.ts +1 -1
  14. package/dist/bootstrap.d.ts.map +1 -1
  15. package/dist/bootstrap.js +6 -18
  16. package/dist/cell.d.ts +6 -0
  17. package/dist/cell.d.ts.map +1 -0
  18. package/dist/cell.js +9 -0
  19. package/dist/change-set.d.ts +4 -0
  20. package/dist/change-set.d.ts.map +1 -1
  21. package/dist/change-set.js +6 -0
  22. package/dist/change.d.ts.map +1 -1
  23. package/dist/change.js +4 -2
  24. package/dist/chat-types.d.ts +5 -0
  25. package/dist/chat-types.d.ts.map +1 -0
  26. package/dist/chat-types.js +13 -0
  27. package/dist/client.d.ts +19 -13
  28. package/dist/client.d.ts.map +1 -1
  29. package/dist/client.js +30 -14
  30. package/dist/collection.d.ts +22 -4
  31. package/dist/collection.d.ts.map +1 -1
  32. package/dist/collection.js +12 -2
  33. package/dist/compile.d.ts +5 -0
  34. package/dist/compile.d.ts.map +1 -1
  35. package/dist/compile.js +200 -75
  36. package/dist/connection.d.ts +5 -143
  37. package/dist/connection.d.ts.map +1 -1
  38. package/dist/connection.js +104 -5308
  39. package/dist/conversation-live.d.ts +136 -0
  40. package/dist/conversation-live.d.ts.map +1 -0
  41. package/dist/conversation-live.js +249 -0
  42. package/dist/conversation-row.d.ts.map +1 -1
  43. package/dist/conversation-row.js +7 -1
  44. package/dist/conversation.d.ts +43 -44
  45. package/dist/conversation.d.ts.map +1 -1
  46. package/dist/conversation.js +906 -1024
  47. package/dist/declaration.d.ts +10 -0
  48. package/dist/declaration.d.ts.map +1 -0
  49. package/dist/declaration.js +24 -0
  50. package/dist/discovery.d.ts +10 -0
  51. package/dist/discovery.d.ts.map +1 -0
  52. package/dist/discovery.js +148 -0
  53. package/dist/durability.d.ts +9 -0
  54. package/dist/durability.d.ts.map +1 -1
  55. package/dist/expectation.d.ts +4 -2
  56. package/dist/expectation.d.ts.map +1 -1
  57. package/dist/expectation.js +33 -11
  58. package/dist/failure.d.ts +1 -0
  59. package/dist/failure.d.ts.map +1 -1
  60. package/dist/failure.js +3 -0
  61. package/dist/figures.d.ts +49 -0
  62. package/dist/figures.d.ts.map +1 -0
  63. package/dist/figures.js +197 -0
  64. package/dist/holdings.d.ts +29 -0
  65. package/dist/holdings.d.ts.map +1 -0
  66. package/dist/holdings.js +95 -0
  67. package/dist/host.d.ts +18 -2
  68. package/dist/host.d.ts.map +1 -1
  69. package/dist/host.js +45 -12
  70. package/dist/index.d.ts +22 -8
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +7 -2
  73. package/dist/install.d.ts +54 -0
  74. package/dist/install.d.ts.map +1 -0
  75. package/dist/install.js +538 -0
  76. package/dist/lifecycle.d.ts +7 -0
  77. package/dist/lifecycle.d.ts.map +1 -0
  78. package/dist/lifecycle.js +272 -0
  79. package/dist/listing.d.ts +48 -0
  80. package/dist/listing.d.ts.map +1 -0
  81. package/dist/listing.js +139 -0
  82. package/dist/live.d.ts.map +1 -1
  83. package/dist/live.js +3 -3
  84. package/dist/locks.d.ts +7 -0
  85. package/dist/locks.d.ts.map +1 -0
  86. package/dist/locks.js +33 -0
  87. package/dist/log.d.ts +1 -0
  88. package/dist/log.d.ts.map +1 -1
  89. package/dist/lost.d.ts +5 -0
  90. package/dist/lost.d.ts.map +1 -0
  91. package/dist/lost.js +50 -0
  92. package/dist/media.d.ts +1 -1
  93. package/dist/media.d.ts.map +1 -1
  94. package/dist/media.js +4 -4
  95. package/dist/memory.d.ts +4 -2
  96. package/dist/memory.d.ts.map +1 -1
  97. package/dist/memory.js +38 -20
  98. package/dist/messages.d.ts +1 -4
  99. package/dist/messages.d.ts.map +1 -1
  100. package/dist/messages.js +14 -32
  101. package/dist/model.d.ts +0 -1
  102. package/dist/model.d.ts.map +1 -1
  103. package/dist/model.js +0 -5
  104. package/dist/models.d.ts +10 -0
  105. package/dist/models.d.ts.map +1 -0
  106. package/dist/models.js +156 -0
  107. package/dist/observation.d.ts.map +1 -1
  108. package/dist/observation.js +12 -17
  109. package/dist/opened.d.ts +1 -1
  110. package/dist/opened.d.ts.map +1 -1
  111. package/dist/opened.js +5 -5
  112. package/dist/opening.d.ts +4 -0
  113. package/dist/opening.d.ts.map +1 -0
  114. package/dist/opening.js +59 -0
  115. package/dist/outcome.d.ts +4 -1
  116. package/dist/outcome.d.ts.map +1 -1
  117. package/dist/outcome.js +3 -0
  118. package/dist/overlay.d.ts +2 -1
  119. package/dist/overlay.d.ts.map +1 -1
  120. package/dist/overlay.js +32 -21
  121. package/dist/page-metadata.d.ts +8 -0
  122. package/dist/page-metadata.d.ts.map +1 -0
  123. package/dist/page-metadata.js +19 -0
  124. package/dist/parts.d.ts +3 -51
  125. package/dist/parts.d.ts.map +1 -1
  126. package/dist/parts.js +14 -111
  127. package/dist/paths.d.ts +1 -0
  128. package/dist/paths.d.ts.map +1 -1
  129. package/dist/paths.js +22 -0
  130. package/dist/preparation.d.ts +20 -0
  131. package/dist/preparation.d.ts.map +1 -0
  132. package/dist/preparation.js +233 -0
  133. package/dist/presence.d.ts +52 -0
  134. package/dist/presence.d.ts.map +1 -0
  135. package/dist/presence.js +220 -0
  136. package/dist/queries.d.ts +16 -0
  137. package/dist/queries.d.ts.map +1 -0
  138. package/dist/queries.js +270 -0
  139. package/dist/query.d.ts +10 -1
  140. package/dist/query.d.ts.map +1 -1
  141. package/dist/questions.d.ts +2 -0
  142. package/dist/questions.d.ts.map +1 -1
  143. package/dist/questions.js +5 -1
  144. package/dist/queue.d.ts +40 -0
  145. package/dist/queue.d.ts.map +1 -0
  146. package/dist/queue.js +455 -0
  147. package/dist/reach.d.ts +3 -1
  148. package/dist/reach.d.ts.map +1 -1
  149. package/dist/reach.js +38 -8
  150. package/dist/react.d.ts +18 -1
  151. package/dist/react.d.ts.map +1 -1
  152. package/dist/react.js +15 -1
  153. package/dist/readiness.d.ts +0 -1
  154. package/dist/readiness.d.ts.map +1 -1
  155. package/dist/reads.d.ts +37 -0
  156. package/dist/reads.d.ts.map +1 -0
  157. package/dist/reads.js +174 -0
  158. package/dist/refresh.js +2 -2
  159. package/dist/refusal.d.ts +5 -0
  160. package/dist/refusal.d.ts.map +1 -0
  161. package/dist/refusal.js +57 -0
  162. package/dist/replica.d.ts +5 -13
  163. package/dist/replica.d.ts.map +1 -1
  164. package/dist/replica.js +15 -16
  165. package/dist/room-draft.d.ts +4 -6
  166. package/dist/room-draft.d.ts.map +1 -1
  167. package/dist/room-draft.js +36 -52
  168. package/dist/room-drafts.d.ts +24 -0
  169. package/dist/room-drafts.d.ts.map +1 -0
  170. package/dist/room-drafts.js +217 -0
  171. package/dist/rows.d.ts.map +1 -1
  172. package/dist/rows.js +3 -4
  173. package/dist/runtime.d.ts +34 -0
  174. package/dist/runtime.d.ts.map +1 -0
  175. package/dist/runtime.js +1 -0
  176. package/dist/save.d.ts +41 -86
  177. package/dist/save.d.ts.map +1 -1
  178. package/dist/save.js +232 -112
  179. package/dist/saves.d.ts +32 -0
  180. package/dist/saves.d.ts.map +1 -0
  181. package/dist/saves.js +413 -0
  182. package/dist/seed.d.ts +11 -2
  183. package/dist/seed.d.ts.map +1 -1
  184. package/dist/seed.js +71 -1
  185. package/dist/shared.d.ts +1 -6
  186. package/dist/shared.d.ts.map +1 -1
  187. package/dist/shared.js +13 -95
  188. package/dist/shown.d.ts +32 -0
  189. package/dist/shown.d.ts.map +1 -0
  190. package/dist/shown.js +290 -0
  191. package/dist/socket/admission.d.ts +7 -0
  192. package/dist/socket/admission.d.ts.map +1 -0
  193. package/dist/socket/admission.js +39 -0
  194. package/dist/socket/answers.d.ts +6 -0
  195. package/dist/socket/answers.d.ts.map +1 -0
  196. package/dist/socket/answers.js +20 -0
  197. package/dist/socket/lanes.d.ts +20 -0
  198. package/dist/socket/lanes.d.ts.map +1 -0
  199. package/dist/socket/lanes.js +77 -0
  200. package/dist/socket/reads.d.ts +10 -0
  201. package/dist/socket/reads.d.ts.map +1 -0
  202. package/dist/socket/reads.js +31 -0
  203. package/dist/socket/session.d.ts +38 -0
  204. package/dist/socket/session.d.ts.map +1 -0
  205. package/dist/socket/session.js +23 -0
  206. package/dist/socket.d.ts +67 -0
  207. package/dist/socket.d.ts.map +1 -0
  208. package/dist/socket.js +170 -0
  209. package/dist/source.d.ts.map +1 -1
  210. package/dist/source.js +5 -4
  211. package/dist/store/installs.d.ts +30 -0
  212. package/dist/store/installs.d.ts.map +1 -0
  213. package/dist/store/installs.js +34 -0
  214. package/dist/store/readiness.d.ts +10 -0
  215. package/dist/store/readiness.d.ts.map +1 -0
  216. package/dist/store/readiness.js +52 -0
  217. package/dist/store/records.d.ts +212 -0
  218. package/dist/store/records.d.ts.map +1 -0
  219. package/dist/store/records.js +430 -0
  220. package/dist/store/room-held.d.ts +8 -0
  221. package/dist/store/room-held.d.ts.map +1 -0
  222. package/dist/store/room-held.js +17 -0
  223. package/dist/store/space.d.ts +11 -0
  224. package/dist/store/space.d.ts.map +1 -0
  225. package/dist/store/space.js +41 -0
  226. package/dist/store/watchers.d.ts +17 -0
  227. package/dist/store/watchers.d.ts.map +1 -0
  228. package/dist/store/watchers.js +56 -0
  229. package/dist/store/writes.d.ts +24 -0
  230. package/dist/store/writes.d.ts.map +1 -0
  231. package/dist/store/writes.js +125 -0
  232. package/dist/store.d.ts +112 -204
  233. package/dist/store.d.ts.map +1 -1
  234. package/dist/store.js +158 -394
  235. package/dist/stored.d.ts +1 -1
  236. package/dist/stored.d.ts.map +1 -1
  237. package/dist/stored.js +28 -14
  238. package/dist/surface.d.ts +88 -0
  239. package/dist/surface.d.ts.map +1 -0
  240. package/dist/surface.js +223 -0
  241. package/dist/sync.d.ts +19 -0
  242. package/dist/sync.d.ts.map +1 -0
  243. package/dist/sync.js +521 -0
  244. package/dist/tables.d.ts +32 -8
  245. package/dist/tables.d.ts.map +1 -1
  246. package/dist/tables.js +43 -12
  247. package/dist/tallies.d.ts +18 -0
  248. package/dist/tallies.d.ts.map +1 -0
  249. package/dist/tallies.js +129 -0
  250. package/dist/validation.d.ts.map +1 -1
  251. package/dist/validation.js +2 -2
  252. package/dist/wire.d.ts +48 -5
  253. package/dist/wire.d.ts.map +1 -1
  254. package/dist/wire.js +16 -3
  255. package/package.json +3 -2
  256. package/dist/attempt.d.ts +0 -16
  257. package/dist/attempt.d.ts.map +0 -1
  258. package/dist/attempt.js +0 -70
  259. package/dist/job.d.ts +0 -33
  260. package/dist/job.d.ts.map +0 -1
  261. package/dist/job.js +0 -54
package/dist/saves.js ADDED
@@ -0,0 +1,413 @@
1
+ import { parseFrontmatter } from '@agentshouse/mdmodel';
2
+ import { binaryRecord } from './binary.js';
3
+ import { queuedFile } from './change.js';
4
+ import { available } from './collection.js';
5
+ import { runtimeError } from './failure.js';
6
+ import { attachedFile } from './file.js';
7
+ import { compositionFor } from './listing.js';
8
+ import { scoped } from './models.js';
9
+ import { absentBinary, attachAnswer, binaryAnswer, binaryLinkAnswer, failure, OFFLINE, UNCERTAIN, } from './outcome.js';
10
+ import { sameBinary } from './overlay.js';
11
+ import { ancestors } from './paths.js';
12
+ import { connectionNow } from './preparation.js';
13
+ import { append, sliceAt, withdrawable } from './queue.js';
14
+ import { entryAt, replaying, slicing, } from './replica.js';
15
+ import { binaryBase, changesOf, held, heldFile, moveTarget, readSavedParts, } from './room-draft.js';
16
+ import { refuse } from './refusal.js';
17
+ import { visibleOf } from './room-drafts.js';
18
+ import { destination, planSave, } from './save.js';
19
+ import { pendingShown } from './shown.js';
20
+ import { paced, ROW_WEIGHT, stepped } from './turn.js';
21
+ import { validatedNeighbourhood } from './validation.js';
22
+ const FULL = { outcome: 'refused', code: 'durable-write', retryable: true };
23
+ async function savedRoom({ store, presence }, locator) {
24
+ const replica = await store.replica(locator);
25
+ if (replica === undefined || presence.lost(locator)) {
26
+ throw runtimeError('unknown-room', `Unknown Room ${locator}`);
27
+ }
28
+ return replica;
29
+ }
30
+ export function saveRoomDrafts(runtime, locator, named, writtenBy) {
31
+ const { store } = runtime;
32
+ return store.exclusive(async () => {
33
+ if (store.space.full())
34
+ return FULL;
35
+ const replica = await savedRoom(runtime, locator);
36
+ const drafts = new Map((await store.drafts(locator, named.map(({ path }) => path))).map((record) => [record.path, record]));
37
+ const saved = [];
38
+ for (const { path, revision } of named) {
39
+ const record = drafts.get(path);
40
+ if (record === undefined || record.revision !== revision) {
41
+ return { outcome: 'refused', code: 'stale', retryable: false, file: path };
42
+ }
43
+ if (!saved.some((draft) => draft.path === path))
44
+ saved.push({ path, parts: record.parts });
45
+ }
46
+ return loaded(runtime, locator, replica, saved, new Set(saved.map(({ path }) => path)), [], writtenBy);
47
+ });
48
+ }
49
+ export function saveParts(runtime, locator, named, writtenBy) {
50
+ const { store } = runtime;
51
+ return store.exclusive(async () => {
52
+ const read = readSavedParts(named);
53
+ if (store.space.full())
54
+ return FULL;
55
+ const replica = await savedRoom(runtime, locator);
56
+ const saved = [];
57
+ const files = [];
58
+ const filed = read.filter(({ parts }) => parts.file !== undefined).map(({ path }) => path);
59
+ const visible = filed.length === 0 ? undefined : await visibleOf(store, locator, filed);
60
+ for (const { path, parts } of read) {
61
+ const file = parts.file === undefined
62
+ ? undefined
63
+ : await heldFile(parts.file.blob, parts.file.base === undefined ? binaryBase(visible, path) : parts.file.base);
64
+ if (parts.file !== undefined && file !== undefined) {
65
+ files.push({ key: file.localId, blob: parts.file.blob });
66
+ }
67
+ saved.push({ path, parts: held(undefined, parts, file) });
68
+ }
69
+ return loaded(runtime, locator, replica, saved, new Set(), files, writtenBy);
70
+ });
71
+ }
72
+ async function unmodeledIn(runtime, record) {
73
+ const composition = compositionFor(runtime, record);
74
+ if (available(composition))
75
+ return false;
76
+ const local = await runtime.store.open();
77
+ const roots = record.declaration.typedSelection?.roots ?? [];
78
+ return local.typedWithin(record.key, 'visible', roots, false);
79
+ }
80
+ async function savingRoom(runtime, replica, changes, extra, drafted) {
81
+ const { store } = runtime;
82
+ const { record, queue, states } = replica;
83
+ const local = await store.open();
84
+ const paths = [
85
+ ...extra,
86
+ ...changes.flatMap((change) => change.kind === 'move' ? [change.path, change.to] : [change.path]),
87
+ ];
88
+ const moved = changes.flatMap((change) => (change.kind === 'move' ? [change.path] : []));
89
+ const removed = changes.flatMap((change) => (change.kind === 'remove' ? [change.path] : []));
90
+ const referring = removed.length === 0
91
+ ? []
92
+ : (await local.referrers(record.key, 'confirmed', removed)).map(({ path }) => path);
93
+ const confirmed = await sliceAt(store, record, 'confirmed', queue, [...paths, ...paths.flatMap(ancestors), ...referring], moved);
94
+ const composition = store.composed(record);
95
+ const changeable = withdrawable(states);
96
+ return {
97
+ held: { replica, confirmed },
98
+ room: {
99
+ record,
100
+ rule: runtime.writeRule(record.declaration),
101
+ composition: compositionFor(runtime, record),
102
+ queue,
103
+ changeable: new Set(queue.filter(changeable).map(({ id }) => id)),
104
+ saved: new Map([...states].map(([id, state]) => [id, state.drafts])),
105
+ *replay(over) {
106
+ return (yield* replaying(confirmed, over, record.locator, composition)).visible;
107
+ },
108
+ folders: new Set(await local.folders(record.key, paths)),
109
+ modelled: !(await unmodeledIn(runtime, record)),
110
+ drafts: new Map(drafted.length === 0
111
+ ? []
112
+ : (await store.drafts(record.locator, drafted)).map((held) => [held.path, held])),
113
+ validate: validatorOf(runtime, record, confirmed),
114
+ },
115
+ };
116
+ }
117
+ function targetsOf(saved) {
118
+ return saved.flatMap(({ parts }) => (parts.move === undefined ? [] : [moveTarget(parts.move)]));
119
+ }
120
+ async function loaded(runtime, locator, replica, saved, consumed, files, writtenBy) {
121
+ const { store, localSaves } = runtime;
122
+ const into = destination(locator, saved);
123
+ const target = into === null ? undefined : await savedRoom(runtime, into);
124
+ const paths = saved.map(({ path }) => path);
125
+ const targets = targetsOf(saved);
126
+ const parts = saved.map(({ path, parts: held }) => changesOf(path, held));
127
+ const source = target === undefined
128
+ ? await savingRoom(runtime, replica, parts.flatMap(({ changes }) => changes), [...paths, ...parts.flatMap(({ bases }) => bases.map(({ path }) => path))], targets.length === 0 ? [] : [...paths, ...targets])
129
+ : await savingRoom(runtime, replica, paths.map((path) => ({ kind: 'remove', path })), paths, paths);
130
+ const arriving = target === undefined ? undefined : await savingRoom(runtime, target, [], targets, targets);
131
+ const { providerLimits } = await (await store.open()).facts();
132
+ const plan = await planSave({ saved, consumed, writtenBy, local: localSaves, providerLimits }, source.room, arriving?.room);
133
+ return append(runtime, {
134
+ plan,
135
+ files,
136
+ held: new Map([source, ...(arriving === undefined ? [] : [arriving])].map(({ room, held }) => [
137
+ room.record.locator,
138
+ held,
139
+ ])),
140
+ after: () => pendingShown(runtime),
141
+ });
142
+ }
143
+ function textDiffers(left, right) {
144
+ return ((left?.content ?? undefined) !== (right?.content ?? undefined) ||
145
+ !sameBinary(left?.binary ?? undefined, right?.binary ?? undefined));
146
+ }
147
+ function textOf(entry) {
148
+ if (entry === null)
149
+ return undefined;
150
+ return entry.binary !== null ? null : entry.content;
151
+ }
152
+ function lookupOf(local, key, view) {
153
+ return async (paths) => {
154
+ if (paths.length === 0)
155
+ return new Map();
156
+ return new Map((await local.typed(key, view, paths)).map(({ path, type, binary }) => [
157
+ path,
158
+ { type: type ?? undefined, binary },
159
+ ]));
160
+ };
161
+ }
162
+ function declaredOf(entry) {
163
+ if (entry.binary !== null)
164
+ return { type: undefined, binary: true };
165
+ const read = parseFrontmatter(entry.content ?? '');
166
+ return { type: read.ok ? (read.frontmatter.type ?? 'any') : undefined, binary: false };
167
+ }
168
+ function overriddenLookup(lookup, overrides) {
169
+ return async (paths) => {
170
+ const known = new Map(await lookup(paths.filter((path) => !overrides.has(path))));
171
+ for (const path of paths) {
172
+ const entry = overrides.get(path);
173
+ if (entry === undefined)
174
+ continue;
175
+ if (entry === null)
176
+ known.delete(path);
177
+ else
178
+ known.set(path, declaredOf(entry));
179
+ }
180
+ return known;
181
+ };
182
+ }
183
+ function validatorOf(runtime, record, confirmedLayer) {
184
+ return async (resulting, touched) => {
185
+ const local = await runtime.store.open();
186
+ const changes = [];
187
+ const overrides = new Map();
188
+ const pace = paced();
189
+ for (const path of new Set([...confirmedLayer.held, ...touched])) {
190
+ await pace(ROW_WEIGHT);
191
+ const was = entryAt(confirmedLayer, path);
192
+ const now = entryAt(resulting, path);
193
+ if (!textDiffers(was, now))
194
+ continue;
195
+ overrides.set(path, now);
196
+ if (textOf(was) !== textOf(now))
197
+ changes.push({ path, was: textOf(was), now: textOf(now) });
198
+ }
199
+ return validatedNeighbourhood(changes, compositionFor(runtime, record), {
200
+ lookup: overriddenLookup(lookupOf(local, record.key, 'confirmed'), overrides),
201
+ texts: textsOf(local, record.key, 'confirmed'),
202
+ referrers: referrersOf(local, record.key, 'confirmed'),
203
+ });
204
+ };
205
+ }
206
+ function textsOf(local, key, view) {
207
+ return async (paths) => new Map((await local.entries(key, view, paths)).map(({ path, content, binary }) => [
208
+ path,
209
+ binary !== null ? null : content,
210
+ ]));
211
+ }
212
+ function referrersOf(local, key, view) {
213
+ return async (targets) => [
214
+ ...new Set((await local.referrers(key, view, targets)).map(({ path }) => path)),
215
+ ];
216
+ }
217
+ async function queuedFacts(store, locator, path, localId) {
218
+ for (const batch of (await store.replica(locator))?.queue ?? []) {
219
+ const change = batch.changes[queuedFile(batch, path, localId)];
220
+ if (change?.kind === 'binary')
221
+ return change;
222
+ }
223
+ const drafted = (await store.draft(locator, path))?.parts.file;
224
+ return drafted?.localId === localId ? drafted : null;
225
+ }
226
+ export function batchFile(store, batch) {
227
+ return async (localId) => {
228
+ const change = batch.changes.find((held) => held.kind === 'binary' && held.localId === localId);
229
+ return (await store.open()).file(localId, change?.kind === 'binary' ? change.mediaType : '');
230
+ };
231
+ }
232
+ async function transferBinary(runtime, request, transfer, answer) {
233
+ const { store, socket, presence, journal } = runtime;
234
+ const { session } = socket;
235
+ if (socket.closed() || session.now().refusal !== null)
236
+ return UNCERTAIN;
237
+ await socket.firstDiscovery;
238
+ if (!session.now().roomsNamed)
239
+ return UNCERTAIN;
240
+ try {
241
+ await socket.authorize();
242
+ }
243
+ catch {
244
+ return UNCERTAIN;
245
+ }
246
+ const { closed, authorization, refusal } = session.now();
247
+ if (closed || authorization === undefined || refusal !== null)
248
+ return UNCERTAIN;
249
+ const since = presence.losses();
250
+ journal.record(`transfer binary ${request.locator} ${request.path}`);
251
+ try {
252
+ const result = await transfer(authorization);
253
+ const settled = result;
254
+ journal.record(`outcome binary ${settled.kind}`);
255
+ if (presence.lostSince(request.locator, since))
256
+ return failure({ kind: 'room-not-readable', locator: request.locator });
257
+ if (settled.kind === 'scoped-refusal') {
258
+ const room = await store.record(settled.locator);
259
+ if (room !== undefined)
260
+ await scoped(runtime, settled, room.locator, room.declaration);
261
+ }
262
+ if (settled.kind === 'revoked-authorization')
263
+ await refuse(runtime, 'revoked-authorization');
264
+ return answer(result);
265
+ }
266
+ catch {
267
+ journal.record('outcome binary transport-uncertainty');
268
+ return UNCERTAIN;
269
+ }
270
+ }
271
+ function fetchBinary(runtime, request, name) {
272
+ const { store, socket } = runtime;
273
+ return transferBinary(runtime, request, (authorization) => store.opened.fetch(name, () => socket.binary(authorization, request)), binaryAnswer);
274
+ }
275
+ async function readBinary(runtime, request, name) {
276
+ if (runtime.socket.closed())
277
+ return UNCERTAIN;
278
+ const held = await runtime.store.opened.find(name);
279
+ if (held !== null)
280
+ return held;
281
+ return fetchBinary(runtime, request, name);
282
+ }
283
+ async function binaryPath(store, locator, path, revision) {
284
+ if (revision !== undefined)
285
+ return { kind: 'path', locator, path, revision };
286
+ const replica = await store.replica(locator);
287
+ const local = await store.open();
288
+ const [held] = replica === undefined ? [] : await local.entries(replica.record.key, 'visible', [path]);
289
+ const attached = held === undefined ? store.attached.of(locator, path) : undefined;
290
+ if (attached !== undefined)
291
+ return { kind: 'path', locator, path, revision: attached.revision };
292
+ if (replica === undefined || held?.binary === undefined || held.binary === null)
293
+ return null;
294
+ if (held.binary.state === 'pending')
295
+ return { kind: 'pending', localId: held.binary.localId };
296
+ const record = binaryRecord(path, held.binary, held.revision ?? undefined);
297
+ if (record.state !== 'accepted')
298
+ return null;
299
+ const queued = replica.queue.flatMap((batch) => batch.changes);
300
+ const sources = queued.flatMap((change) => (change.kind === 'move' ? [change.path] : []));
301
+ const confirmedLayer = await stepped(slicing(await local.entries(replica.record.key, 'confirmed', [path, ...sources]), [
302
+ path,
303
+ ...sources,
304
+ ]));
305
+ const holds = (at) => {
306
+ const kept = confirmedLayer.binaries[at];
307
+ return (kept?.state === 'accepted' &&
308
+ kept.sha256 === record.sha256 &&
309
+ confirmedLayer.revisions[at] === record.revision);
310
+ };
311
+ let confirmedAt = path;
312
+ for (let index = queued.length - 1; index >= 0 && !holds(confirmedAt); index -= 1) {
313
+ const change = queued[index];
314
+ if (change.kind === 'move' && change.to === confirmedAt)
315
+ confirmedAt = change.path;
316
+ }
317
+ return {
318
+ kind: 'path',
319
+ locator,
320
+ path: confirmedAt,
321
+ revision: record.revision,
322
+ };
323
+ }
324
+ async function askedBinary({ store, socket }, locator, path, revision) {
325
+ await socket.ready;
326
+ const drafted = (await store.draft(locator, path))?.parts.file;
327
+ return drafted !== undefined && drafted.localId === revision
328
+ ? { kind: 'pending', localId: revision }
329
+ : binaryPath(store, locator, path, revision);
330
+ }
331
+ async function pendingBinary(store, locator, path, localId) {
332
+ const facts = await queuedFacts(store, locator, path, localId);
333
+ return facts === null
334
+ ? absentBinary(path)
335
+ : {
336
+ kind: 'binary',
337
+ file: localId,
338
+ byteLength: facts.byteLength,
339
+ mediaType: facts.mediaType,
340
+ };
341
+ }
342
+ async function readBinaryPath(runtime, locator, path, revision) {
343
+ const asked = await askedBinary(runtime, locator, path, revision);
344
+ if (asked === null)
345
+ return absentBinary(path);
346
+ if (asked.kind === 'pending')
347
+ return pendingBinary(runtime.store, locator, path, asked.localId);
348
+ return readBinary(runtime, asked, { locator, path: asked.path, revision: asked.revision });
349
+ }
350
+ async function heldMediaType(store, locator, path) {
351
+ const replica = await store.record(locator);
352
+ const [held] = replica === undefined ? [] : await (await store.open()).entries(replica.key, 'visible', [path]);
353
+ return held === undefined ? store.attached.of(locator, path)?.mediaType : held.binary?.mediaType;
354
+ }
355
+ function linkOf(runtime, asked, held) {
356
+ return transferBinary(runtime, asked, (authorization) => runtime.socket.link(authorization, asked), (result) => binaryLinkAnswer(result, held));
357
+ }
358
+ async function linkBinaryPath(runtime, locator, path, revision) {
359
+ const { store, socket } = runtime;
360
+ await socket.ready;
361
+ const asked = await binaryPath(store, locator, path, revision);
362
+ if (asked === null || asked.kind === 'pending')
363
+ return absentBinary(path);
364
+ return linkOf(runtime, asked, revision === undefined ? await heldMediaType(store, locator, path) : undefined);
365
+ }
366
+ async function showBinaryPath(runtime, locator, path, revision) {
367
+ const { store } = runtime;
368
+ const asked = await askedBinary(runtime, locator, path, revision);
369
+ if (asked === null)
370
+ return absentBinary(path);
371
+ if (asked.kind === 'pending')
372
+ return pendingBinary(store, locator, path, asked.localId);
373
+ if (runtime.socket.closed())
374
+ return UNCERTAIN;
375
+ const name = { locator, path: asked.path, revision: asked.revision };
376
+ const kept = await store.opened.find(name);
377
+ if (kept !== null)
378
+ return kept;
379
+ const mediaType = await heldMediaType(store, locator, path);
380
+ if (mediaType?.startsWith('image/') === true)
381
+ return fetchBinary(runtime, asked, name);
382
+ return linkOf(runtime, asked, revision === undefined ? mediaType : undefined);
383
+ }
384
+ async function attachBinary(runtime, locator, file) {
385
+ const { store, socket } = runtime;
386
+ await socket.ready;
387
+ await socket.firstDiscovery;
388
+ if (socket.closed() ||
389
+ !socket.session.now().roomsNamed ||
390
+ (await connectionNow(runtime)) === 'unreachable' ||
391
+ socket.session.now().refusal !== null)
392
+ return OFFLINE;
393
+ const request = await attachedFile(locator, file);
394
+ return transferBinary(runtime, { locator, path: file.name }, async (held) => {
395
+ const result = await socket.attach(held, request);
396
+ if (result.kind === 'attached') {
397
+ store.attached.hold(locator, result.path, {
398
+ revision: result.revision,
399
+ mediaType: request.mediaType,
400
+ });
401
+ }
402
+ return result;
403
+ }, attachAnswer);
404
+ }
405
+ export function binaryFileSurface(runtime) {
406
+ return {
407
+ part: runtime.store.part,
408
+ read: (room, path, revision) => readBinaryPath(runtime, room, path, revision),
409
+ link: (room, path, revision) => linkBinaryPath(runtime, room, path, revision),
410
+ show: (room, path, revision) => showBinaryPath(runtime, room, path, revision),
411
+ attach: (room, file) => attachBinary(runtime, room, file),
412
+ };
413
+ }
package/dist/seed.d.ts CHANGED
@@ -1,5 +1,9 @@
1
- import type { KeyedResult } from './observation.js';
2
- import type { QueryRows } from './query.js';
1
+ import type { Cover } from './live.js';
2
+ import { type KeyedResult } from './observation.js';
3
+ import type { Plan, QueryRows } from './query.js';
4
+ import type { Deliver } from './reach.js';
5
+ import type { Runtime } from './runtime.js';
6
+ import type { HeldCover, Store } from './store.js';
3
7
  export type EntrySeed = {
4
8
  readonly at: Readonly<Record<string, string>>;
5
9
  readonly queries: readonly {
@@ -11,6 +15,11 @@ export type Seeded = {
11
15
  readonly rows: QueryRows;
12
16
  readonly at: Readonly<Record<string, string>>;
13
17
  };
18
+ type SeededWatch = (coverOf: (cover: Cover, held: HeldCover) => Cover, deliver: (message: unknown) => void) => () => void;
14
19
  export declare function entrySeedOf(value: unknown): EntrySeed | null;
15
20
  export declare function seededResult(seed: Seeded): KeyedResult;
21
+ export declare function seedApplies(runtime: Runtime, plan: Plan, held: HeldCover): Seeded | null;
22
+ export declare function keepEntrySeed(store: Store, entry: EntrySeed): void;
23
+ export declare function watchSeeded(runtime: Runtime, plan: Plan, deliver: Deliver, watch: SeededWatch): () => void;
24
+ export {};
16
25
  //# sourceMappingURL=seed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAA4C,SAAS,EAAE,MAAM,YAAY,CAAC;AAGtF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;CACpF,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CAAC;AAwCjG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAe5D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAoBtD"}
1
+ {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAS,KAAK,WAAW,EAAqB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,IAAI,EAA4C,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAA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
+ import { queryKey } from '@agentshouse/mdmodel';
2
+ import { whole } from './observation.js';
1
3
  import { documentKey } from './rows.js';
4
+ const seedTopic = (key) => `seed\u0000${key}`;
2
5
  function plain(value) {
3
6
  return typeof value === 'object' && value !== null && !Array.isArray(value);
4
7
  }
@@ -59,7 +62,6 @@ export function seededResult(seed) {
59
62
  generation,
60
63
  current: false,
61
64
  })),
62
- indexes: [],
63
65
  overlay: [],
64
66
  };
65
67
  if ('groups' in seed.rows) {
@@ -73,3 +75,71 @@ export function seededResult(seed) {
73
75
  keys: seed.rows.documents.map((document) => documentKey(document.room, document.path)),
74
76
  };
75
77
  }
78
+ function seedRoomHeld({ socket }, room, version, held) {
79
+ const stored = held.rooms.get(room);
80
+ return (stored !== undefined &&
81
+ stored.indexed &&
82
+ socket.reads.reached(room, stored.roomVersion, version));
83
+ }
84
+ function seedHeld(runtime, at, held) {
85
+ const { socket, presence } = runtime;
86
+ return Object.entries(at).every(([room, version]) => (socket.session.now().roomsListed &&
87
+ presence.room(room) === undefined &&
88
+ !held.rooms.has(room)) ||
89
+ seedRoomHeld(runtime, room, version, held));
90
+ }
91
+ export function seedApplies(runtime, plan, held) {
92
+ const { seeds } = runtime.store;
93
+ const seed = seeds.of(plan.key);
94
+ if (seed === undefined)
95
+ return null;
96
+ if (!seedHeld(runtime, seed.at, held))
97
+ return seed;
98
+ seeds.drop(plan.key);
99
+ return null;
100
+ }
101
+ function seedBehind(runtime, plan, cover, held) {
102
+ const seed = seedApplies(runtime, plan, held);
103
+ if (seed === null || 'pending' in cover)
104
+ return cover;
105
+ return {
106
+ pending: Object.entries(seed.at)
107
+ .filter(([room, version]) => !seedRoomHeld(runtime, room, version, held))
108
+ .map(([room]) => ({ room, awaits: 'acquisition' })),
109
+ };
110
+ }
111
+ export function keepEntrySeed(store, entry) {
112
+ for (const { query, rows } of entry.queries) {
113
+ const key = queryKey(query);
114
+ store.seeds.keep(key, { rows, at: entry.at });
115
+ for (const watcher of store.watching(seedTopic(key)))
116
+ watcher.answer(null);
117
+ }
118
+ }
119
+ export function watchSeeded(runtime, plan, deliver, watch) {
120
+ const { store } = runtime;
121
+ let seeded = false;
122
+ let pending = true;
123
+ const shown = () => {
124
+ const seed = store.seeds.of(plan.key);
125
+ if (seed === undefined || seeded || !pending)
126
+ return;
127
+ seeded = true;
128
+ deliver(seededResult(seed));
129
+ };
130
+ const watcher = store.watch(seedTopic(plan.key), shown);
131
+ const stop = watch((cover, held) => seedBehind(runtime, plan, cover, held), (message) => {
132
+ const answered = message;
133
+ pending = whole(answered) && 'pending' in answered.result;
134
+ if (pending && store.seeds.of(plan.key) !== undefined) {
135
+ shown();
136
+ return;
137
+ }
138
+ seeded = false;
139
+ deliver(message);
140
+ });
141
+ return () => {
142
+ watcher.stop();
143
+ stop();
144
+ };
145
+ }
package/dist/shared.d.ts CHANGED
@@ -1,14 +1,9 @@
1
1
  export type Paths<V> = Readonly<Record<string, V>>;
2
+ export declare function guarding<V>(values: Paths<V>, handler: ProxyHandler<Paths<V>>): Paths<V>;
2
3
  export declare function entriesIn<V>(map: Paths<V>): Generator<readonly [string, V]>;
3
4
  export declare function sortedKeys(map: Paths<unknown>): Generator<number, readonly string[], void>;
4
5
  export declare function sorting(keys: Iterable<string>): Generator<number, readonly string[], void>;
5
- export declare function sharing<V>(map: Paths<V>): Generator<number, Paths<V>, void>;
6
- export declare function shared<V>(map: Paths<V>): Paths<V>;
7
- export declare function patched<V>(base: Paths<V>, set: Iterable<readonly [string, V]>, removed?: Iterable<string>): Paths<V>;
8
6
  export declare function patching<V>(base: Paths<V>, set: Iterable<readonly [string, V]>, removed?: Iterable<string>): Generator<number, Paths<V>, void>;
9
- export declare function sizeOf<V>(map: Paths<V>): number;
10
- export declare function differences<V>(left: Paths<V>, right: Paths<V>, same?: (left: V, right: V) => boolean): Generator<number, ReadonlySet<string>, void>;
11
- export declare function differing<V>(left: Paths<V>, right: Paths<V>, same?: (left: V, right: V) => boolean): ReadonlySet<string>;
12
7
  export declare function drafted<V>(base: Paths<V>): Record<string, V>;
13
8
  export declare function settled<V>(draft: Record<string, V>): Paths<V>;
14
9
  export declare function settling<V>(draft: Record<string, V>): Generator<number, Paths<V>, void>;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AA+LnD,wBAAiB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAO5E;AAuCD,wBAAiB,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,CAE3F;AAED,wBAAiB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,CAoB3F;AAED,wBAAiB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAE5E;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAEjD;AAED,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EACnC,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAM,GAC7B,KAAK,CAAC,CAAC,CAAC,CAEV;AAED,wBAAiB,QAAQ,CAA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