@agentshouse/mdruntime 0.1.0-c0bed82db8d73 → 0.1.0-c0c0511ef12ee

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 (292) hide show
  1. package/README.md +3 -2
  2. package/dist/acceptance.d.ts +6 -0
  3. package/dist/acceptance.d.ts.map +1 -0
  4. package/dist/acceptance.js +385 -0
  5. package/dist/actions.d.ts +20 -0
  6. package/dist/actions.d.ts.map +1 -0
  7. package/dist/actions.js +251 -0
  8. package/dist/adapter.d.ts +107 -71
  9. package/dist/adapter.d.ts.map +1 -1
  10. package/dist/attached-model.d.ts +4 -10
  11. package/dist/attached-model.d.ts.map +1 -1
  12. package/dist/attached-model.js +35 -46
  13. package/dist/bootstrap.d.ts +16 -15
  14. package/dist/bootstrap.d.ts.map +1 -1
  15. package/dist/bootstrap.js +274 -131
  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/chain.d.ts +2 -1
  20. package/dist/chain.d.ts.map +1 -1
  21. package/dist/change.d.ts +1 -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 +25 -10
  28. package/dist/client.d.ts.map +1 -1
  29. package/dist/client.js +56 -7
  30. package/dist/collection.d.ts +7 -4
  31. package/dist/collection.d.ts.map +1 -1
  32. package/dist/collection.js +24 -19
  33. package/dist/compile.d.ts +6 -6
  34. package/dist/compile.d.ts.map +1 -1
  35. package/dist/compile.js +287 -297
  36. package/dist/connection.d.ts +6 -141
  37. package/dist/connection.d.ts.map +1 -1
  38. package/dist/connection.js +103 -5016
  39. package/dist/context.d.ts +2 -0
  40. package/dist/context.d.ts.map +1 -0
  41. package/dist/context.js +7 -0
  42. package/dist/conversation-live.d.ts +136 -0
  43. package/dist/conversation-live.d.ts.map +1 -0
  44. package/dist/conversation-live.js +248 -0
  45. package/dist/conversation-row.d.ts +33 -0
  46. package/dist/conversation-row.d.ts.map +1 -0
  47. package/dist/conversation-row.js +53 -0
  48. package/dist/conversation.d.ts +41 -45
  49. package/dist/conversation.d.ts.map +1 -1
  50. package/dist/conversation.js +870 -786
  51. package/dist/discovery.d.ts +10 -0
  52. package/dist/discovery.d.ts.map +1 -0
  53. package/dist/discovery.js +175 -0
  54. package/dist/durability.d.ts +15 -1
  55. package/dist/durability.d.ts.map +1 -1
  56. package/dist/entry.d.ts +3 -2
  57. package/dist/entry.d.ts.map +1 -1
  58. package/dist/entry.js +18 -8
  59. package/dist/figures.d.ts +49 -0
  60. package/dist/figures.d.ts.map +1 -0
  61. package/dist/figures.js +197 -0
  62. package/dist/file.d.ts +2 -11
  63. package/dist/file.d.ts.map +1 -1
  64. package/dist/file.js +6 -4
  65. package/dist/holdings.d.ts +29 -0
  66. package/dist/holdings.d.ts.map +1 -0
  67. package/dist/holdings.js +95 -0
  68. package/dist/host.d.ts +4 -7
  69. package/dist/host.d.ts.map +1 -1
  70. package/dist/host.js +33 -33
  71. package/dist/identity.d.ts +0 -1
  72. package/dist/identity.d.ts.map +1 -1
  73. package/dist/identity.js +0 -3
  74. package/dist/index.d.ts +27 -10
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +8 -1
  77. package/dist/install.d.ts +56 -0
  78. package/dist/install.d.ts.map +1 -0
  79. package/dist/install.js +554 -0
  80. package/dist/job.d.ts +33 -0
  81. package/dist/job.d.ts.map +1 -0
  82. package/dist/job.js +54 -0
  83. package/dist/lifecycle.d.ts +7 -0
  84. package/dist/lifecycle.d.ts.map +1 -0
  85. package/dist/lifecycle.js +268 -0
  86. package/dist/listing.d.ts +53 -0
  87. package/dist/listing.d.ts.map +1 -0
  88. package/dist/listing.js +176 -0
  89. package/dist/live.d.ts +5 -4
  90. package/dist/live.d.ts.map +1 -1
  91. package/dist/live.js +61 -21
  92. package/dist/locks.d.ts +9 -0
  93. package/dist/locks.d.ts.map +1 -0
  94. package/dist/locks.js +61 -0
  95. package/dist/log.d.ts +1 -0
  96. package/dist/log.d.ts.map +1 -1
  97. package/dist/lost.d.ts +5 -0
  98. package/dist/lost.d.ts.map +1 -0
  99. package/dist/lost.js +61 -0
  100. package/dist/media.d.ts +8 -0
  101. package/dist/media.d.ts.map +1 -0
  102. package/dist/media.js +218 -0
  103. package/dist/memory.d.ts +13 -6
  104. package/dist/memory.d.ts.map +1 -1
  105. package/dist/memory.js +219 -91
  106. package/dist/messages.d.ts +27 -3
  107. package/dist/messages.d.ts.map +1 -1
  108. package/dist/messages.js +103 -31
  109. package/dist/model.d.ts +8 -10
  110. package/dist/model.d.ts.map +1 -1
  111. package/dist/model.js +6 -18
  112. package/dist/models.d.ts +14 -0
  113. package/dist/models.d.ts.map +1 -0
  114. package/dist/models.js +195 -0
  115. package/dist/observation.d.ts +3 -2
  116. package/dist/observation.d.ts.map +1 -1
  117. package/dist/observation.js +15 -15
  118. package/dist/opened.js +3 -3
  119. package/dist/opening.d.ts +4 -0
  120. package/dist/opening.d.ts.map +1 -0
  121. package/dist/opening.js +57 -0
  122. package/dist/outcome.d.ts +17 -6
  123. package/dist/outcome.d.ts.map +1 -1
  124. package/dist/outcome.js +19 -2
  125. package/dist/overlay.d.ts +1 -0
  126. package/dist/overlay.d.ts.map +1 -1
  127. package/dist/overlay.js +11 -0
  128. package/dist/parts.d.ts +60 -0
  129. package/dist/parts.d.ts.map +1 -0
  130. package/dist/parts.js +126 -0
  131. package/dist/paths.d.ts +2 -0
  132. package/dist/paths.d.ts.map +1 -1
  133. package/dist/paths.js +26 -0
  134. package/dist/preparation.d.ts +20 -0
  135. package/dist/preparation.d.ts.map +1 -0
  136. package/dist/preparation.js +226 -0
  137. package/dist/queries.d.ts +16 -0
  138. package/dist/queries.d.ts.map +1 -0
  139. package/dist/queries.js +272 -0
  140. package/dist/query.d.ts +18 -208
  141. package/dist/query.d.ts.map +1 -1
  142. package/dist/query.js +3 -505
  143. package/dist/questions.d.ts +34 -0
  144. package/dist/questions.d.ts.map +1 -0
  145. package/dist/questions.js +122 -0
  146. package/dist/reach.d.ts +20 -11
  147. package/dist/reach.d.ts.map +1 -1
  148. package/dist/reach.js +206 -126
  149. package/dist/react.d.ts +10 -2
  150. package/dist/react.d.ts.map +1 -1
  151. package/dist/read.d.ts +7 -0
  152. package/dist/read.d.ts.map +1 -0
  153. package/dist/read.js +17 -0
  154. package/dist/readiness.d.ts +3 -18
  155. package/dist/readiness.d.ts.map +1 -1
  156. package/dist/readiness.js +4 -10
  157. package/dist/reads.d.ts +36 -10
  158. package/dist/reads.d.ts.map +1 -1
  159. package/dist/reads.js +157 -86
  160. package/dist/recovery.d.ts +1 -0
  161. package/dist/recovery.d.ts.map +1 -1
  162. package/dist/recovery.js +35 -1
  163. package/dist/refresh.d.ts +7 -5
  164. package/dist/refresh.d.ts.map +1 -1
  165. package/dist/refresh.js +34 -10
  166. package/dist/refusal.d.ts +5 -0
  167. package/dist/refusal.d.ts.map +1 -0
  168. package/dist/refusal.js +55 -0
  169. package/dist/replica.d.ts +11 -12
  170. package/dist/replica.d.ts.map +1 -1
  171. package/dist/replica.js +56 -23
  172. package/dist/room-draft.d.ts +21 -7
  173. package/dist/room-draft.d.ts.map +1 -1
  174. package/dist/room-draft.js +101 -54
  175. package/dist/room-drafts.d.ts +24 -0
  176. package/dist/room-drafts.d.ts.map +1 -0
  177. package/dist/room-drafts.js +217 -0
  178. package/dist/rows.d.ts +18 -16
  179. package/dist/rows.d.ts.map +1 -1
  180. package/dist/rows.js +45 -153
  181. package/dist/runtime.d.ts +43 -0
  182. package/dist/runtime.d.ts.map +1 -0
  183. package/dist/runtime.js +1 -0
  184. package/dist/save.d.ts +7 -1
  185. package/dist/save.d.ts.map +1 -1
  186. package/dist/save.js +31 -24
  187. package/dist/saves.d.ts +70 -0
  188. package/dist/saves.d.ts.map +1 -0
  189. package/dist/saves.js +1005 -0
  190. package/dist/search.d.ts +12 -63
  191. package/dist/search.d.ts.map +1 -1
  192. package/dist/search.js +9 -52
  193. package/dist/seed.d.ts +11 -2
  194. package/dist/seed.d.ts.map +1 -1
  195. package/dist/seed.js +71 -1
  196. package/dist/shared.d.ts +1 -7
  197. package/dist/shared.d.ts.map +1 -1
  198. package/dist/shared.js +13 -105
  199. package/dist/shown.d.ts +31 -0
  200. package/dist/shown.d.ts.map +1 -0
  201. package/dist/shown.js +292 -0
  202. package/dist/socket/admission.d.ts +7 -0
  203. package/dist/socket/admission.d.ts.map +1 -0
  204. package/dist/socket/admission.js +39 -0
  205. package/dist/socket/answers.d.ts +6 -0
  206. package/dist/socket/answers.d.ts.map +1 -0
  207. package/dist/socket/answers.js +20 -0
  208. package/dist/socket/lanes.d.ts +20 -0
  209. package/dist/socket/lanes.d.ts.map +1 -0
  210. package/dist/socket/lanes.js +77 -0
  211. package/dist/socket/reads.d.ts +10 -0
  212. package/dist/socket/reads.d.ts.map +1 -0
  213. package/dist/socket/reads.js +31 -0
  214. package/dist/socket/rooms.d.ts +44 -0
  215. package/dist/socket/rooms.d.ts.map +1 -0
  216. package/dist/socket/rooms.js +90 -0
  217. package/dist/socket/session.d.ts +38 -0
  218. package/dist/socket/session.d.ts.map +1 -0
  219. package/dist/socket/session.js +23 -0
  220. package/dist/socket.d.ts +70 -0
  221. package/dist/socket.d.ts.map +1 -0
  222. package/dist/socket.js +175 -0
  223. package/dist/source.d.ts +61 -0
  224. package/dist/source.d.ts.map +1 -0
  225. package/dist/source.js +82 -0
  226. package/dist/status.d.ts +4 -5
  227. package/dist/status.d.ts.map +1 -1
  228. package/dist/status.js +3 -7
  229. package/dist/store/fences.d.ts +16 -0
  230. package/dist/store/fences.d.ts.map +1 -0
  231. package/dist/store/fences.js +26 -0
  232. package/dist/store/installs.d.ts +30 -0
  233. package/dist/store/installs.d.ts.map +1 -0
  234. package/dist/store/installs.js +34 -0
  235. package/dist/store/readiness.d.ts +10 -0
  236. package/dist/store/readiness.d.ts.map +1 -0
  237. package/dist/store/readiness.js +52 -0
  238. package/dist/store/records.d.ts +212 -0
  239. package/dist/store/records.d.ts.map +1 -0
  240. package/dist/store/records.js +431 -0
  241. package/dist/store/room-held.d.ts +8 -0
  242. package/dist/store/room-held.d.ts.map +1 -0
  243. package/dist/store/room-held.js +17 -0
  244. package/dist/store/space.d.ts +11 -0
  245. package/dist/store/space.d.ts.map +1 -0
  246. package/dist/store/space.js +41 -0
  247. package/dist/store/watchers.d.ts +17 -0
  248. package/dist/store/watchers.d.ts.map +1 -0
  249. package/dist/store/watchers.js +56 -0
  250. package/dist/store/writes.d.ts +24 -0
  251. package/dist/store/writes.d.ts.map +1 -0
  252. package/dist/store/writes.js +125 -0
  253. package/dist/store.d.ts +105 -158
  254. package/dist/store.d.ts.map +1 -1
  255. package/dist/store.js +143 -401
  256. package/dist/stored.d.ts +66 -55
  257. package/dist/stored.d.ts.map +1 -1
  258. package/dist/stored.js +355 -273
  259. package/dist/surface.d.ts +88 -0
  260. package/dist/surface.d.ts.map +1 -0
  261. package/dist/surface.js +223 -0
  262. package/dist/sync.d.ts +19 -0
  263. package/dist/sync.d.ts.map +1 -0
  264. package/dist/sync.js +532 -0
  265. package/dist/tables.d.ts +131 -69
  266. package/dist/tables.d.ts.map +1 -1
  267. package/dist/tables.js +221 -105
  268. package/dist/tallies.d.ts +18 -0
  269. package/dist/tallies.d.ts.map +1 -0
  270. package/dist/tallies.js +129 -0
  271. package/dist/transfer.d.ts +0 -5
  272. package/dist/transfer.d.ts.map +1 -1
  273. package/dist/validation.d.ts +3 -4
  274. package/dist/validation.d.ts.map +1 -1
  275. package/dist/validation.js +42 -100
  276. package/dist/windows.d.ts +1 -12
  277. package/dist/windows.d.ts.map +1 -1
  278. package/dist/windows.js +2 -75
  279. package/dist/wire.d.ts +25 -9
  280. package/dist/wire.d.ts.map +1 -1
  281. package/dist/wire.js +9 -2
  282. package/package.json +2 -3
  283. package/AGENTS.md +0 -312
  284. package/dist/fence.d.ts +0 -6
  285. package/dist/fence.d.ts.map +0 -1
  286. package/dist/fence.js +0 -10
  287. package/dist/fulltext.d.ts +0 -27
  288. package/dist/fulltext.d.ts.map +0 -1
  289. package/dist/fulltext.js +0 -368
  290. package/dist/words.d.ts +0 -19
  291. package/dist/words.d.ts.map +0 -1
  292. package/dist/words.js +0 -150
@@ -3,58 +3,66 @@ import { runtimeError } from './failure.js';
3
3
  import { sha256 } from './digest.js';
4
4
  import { binaryLocalId } from './identity.js';
5
5
  import { normalize } from './paths.js';
6
- export function returnedBy(kind) {
7
- return { kind, code: kind, fields: {}, retryable: false };
6
+ export function returnedBy() {
7
+ return { kind: 'withdrawn', code: 'withdrawn', fields: {}, retryable: false };
8
8
  }
9
9
  export function staleWrite(current) {
10
- return { outcome: 'stale', code: 'stale', retryable: false, current };
10
+ return { outcome: 'stale', current };
11
11
  }
12
- function malformed() {
13
- throw runtimeError('room-draft-malformed');
12
+ function malformed(at, needs) {
13
+ throw runtimeError('room-draft-malformed', at === undefined ? 'room-draft-malformed' : `room-draft-malformed at ${at}: ${needs}`);
14
14
  }
15
15
  function plain(value) {
16
16
  return typeof value === 'object' && value !== null && !Array.isArray(value);
17
17
  }
18
- function text(value) {
19
- return typeof value === 'string' ? value : malformed();
18
+ function text(value, at) {
19
+ return typeof value === 'string' ? value : malformed(at, 'text');
20
20
  }
21
- function optionalText(value) {
22
- return value === undefined ? undefined : text(value);
21
+ function optionalText(value, at) {
22
+ return value === undefined ? undefined : text(value, at);
23
23
  }
24
- function markdownBase(value) {
25
- return value === null ? null : optionalText(value);
24
+ function markdownBase(value, at) {
25
+ return value === null ? null : optionalText(value, at);
26
26
  }
27
- function entries(value, each) {
27
+ function entries(value, at, each) {
28
28
  if (!plain(value))
29
- malformed();
29
+ malformed(at, 'an object of named values');
30
30
  const read = {};
31
31
  for (const [name, item] of Object.entries(value))
32
- read[name] = each(item);
32
+ read[name] = each(item, `${at}.${name}`);
33
33
  return read;
34
34
  }
35
- function fieldValue(value) {
35
+ function frontmatter(item, at) {
36
+ return frontmatterValue(item) ? item : malformed(at, 'a frontmatter value');
37
+ }
38
+ function fieldValue(value, at) {
36
39
  if (value === null)
37
40
  return null;
38
41
  if (!plain(value) || !Object.hasOwn(value, 'value') || !frontmatterValue(value.value)) {
39
- malformed();
42
+ malformed(at, '{ value } with a frontmatter value, or null where the document lacks it');
40
43
  }
41
44
  return { value: value.value };
42
45
  }
43
- function textPart(value) {
46
+ function textPart(value, at) {
44
47
  if (!plain(value))
45
- malformed();
46
- const base = optionalText(value.base);
47
- return { value: text(value.value), ...(base === undefined ? {} : { base }) };
48
+ malformed(at, '{ value, base }');
49
+ const base = optionalText(value.base, `${at}.base`);
50
+ return { value: text(value.value, `${at}.value`), ...(base === undefined ? {} : { base }) };
48
51
  }
49
- function creationOf(value) {
52
+ function creationOf(value, at) {
50
53
  if (!plain(value))
51
- malformed();
54
+ malformed(at, '{ type, fields, sections }, or { markdown }');
52
55
  if (Object.hasOwn(value, 'markdown'))
53
- return { markdown: text(value.markdown) };
54
- const fields = entries(value.fields, (item) => (frontmatterValue(item) ? item : malformed()));
55
- return { type: text(value.type), fields, sections: entries(value.sections, text) };
56
+ return { markdown: text(value.markdown, `${at}.markdown`) };
57
+ if (typeof value.type !== 'string')
58
+ malformed(`${at}.type`, 'a type name, or markdown in place of type, fields and sections');
59
+ return {
60
+ type: value.type,
61
+ fields: entries(value.fields, `${at}.fields`, frontmatter),
62
+ sections: entries(value.sections, `${at}.sections`, text),
63
+ };
56
64
  }
57
- const PART_NAMES = new Set([
65
+ const PART_NAMES = [
58
66
  'fields',
59
67
  'sections',
60
68
  'preamble',
@@ -63,52 +71,57 @@ const PART_NAMES = new Set([
63
71
  'move',
64
72
  'removal',
65
73
  'file',
66
- ]);
67
- export function readParts(value) {
68
- if (!plain(value) || Object.keys(value).some((name) => !PART_NAMES.has(name)))
69
- malformed();
74
+ ];
75
+ const NAMED_PARTS = `a part named ${PART_NAMES.slice(0, -1).join(', ')} or ${PART_NAMES.at(-1)}`;
76
+ export function readParts(value, path) {
77
+ if (!plain(value))
78
+ malformed(path, 'an object of parts');
79
+ const unknown = Object.keys(value).find((name) => !PART_NAMES.includes(name));
80
+ if (unknown !== undefined)
81
+ malformed(`${path} ${unknown}`, NAMED_PARTS);
70
82
  const parts = {};
71
83
  if (value.fields !== undefined) {
72
- parts.fields = entries(value.fields, (item) => {
84
+ parts.fields = entries(value.fields, `${path} fields`, (item, at) => {
73
85
  if (!plain(item) || !Object.hasOwn(item, 'value') || !frontmatterValue(item.value)) {
74
- malformed();
86
+ malformed(at, '{ value, base } with a frontmatter value');
75
87
  }
76
88
  return item.base === undefined
77
89
  ? { value: item.value }
78
- : { value: item.value, base: fieldValue(item.base) };
90
+ : { value: item.value, base: fieldValue(item.base, `${at}.base`) };
79
91
  });
80
92
  }
81
93
  if (value.sections !== undefined)
82
- parts.sections = entries(value.sections, textPart);
94
+ parts.sections = entries(value.sections, `${path} sections`, textPart);
83
95
  if (value.preamble !== undefined)
84
- parts.preamble = textPart(value.preamble);
96
+ parts.preamble = textPart(value.preamble, `${path} preamble`);
85
97
  if (value.markdown !== undefined)
86
- parts.markdown = textPart(value.markdown);
98
+ parts.markdown = textPart(value.markdown, `${path} markdown`);
87
99
  if (value.creation !== undefined)
88
- parts.creation = creationOf(value.creation);
100
+ parts.creation = creationOf(value.creation, `${path} creation`);
89
101
  if (value.move !== undefined) {
90
102
  if (!plain(value.move))
91
- malformed();
92
- const base = markdownBase(value.move.base);
93
- const room = optionalText(value.move.room);
103
+ malformed(`${path} move`, '{ to, room, base }');
104
+ const base = markdownBase(value.move.base, `${path} move.base`);
105
+ const room = optionalText(value.move.room, `${path} move.room`);
94
106
  parts.move = {
95
- to: text(value.move.to),
107
+ to: text(value.move.to, `${path} move.to`),
96
108
  ...(room === undefined ? {} : { room }),
97
109
  ...(base === undefined ? {} : { base }),
98
110
  };
99
111
  }
100
112
  if (value.removal !== undefined) {
101
113
  if (!plain(value.removal))
102
- malformed();
103
- const base = markdownBase(value.removal.base);
114
+ malformed(`${path} removal`, '{ base }');
115
+ const base = markdownBase(value.removal.base, `${path} removal.base`);
104
116
  parts.removal = base === undefined ? {} : { base };
105
117
  }
106
118
  if (value.file !== undefined) {
107
119
  if (!plain(value.file) || !(value.file.blob instanceof Blob))
108
- malformed();
120
+ malformed(`${path} file`, '{ blob, base } with a Blob');
109
121
  if (Object.keys(value).length > 1)
110
122
  throw runtimeError('room-draft-file-exclusive');
111
- parts.file = { blob: value.file.blob };
123
+ const base = markdownBase(value.file.base, `${path} file.base`);
124
+ parts.file = base === undefined ? { blob: value.file.blob } : { blob: value.file.blob, base };
112
125
  }
113
126
  return parts;
114
127
  }
@@ -292,18 +305,22 @@ export async function heldFile(blob, base) {
292
305
  };
293
306
  }
294
307
  export function binaryBase(visible, path) {
295
- return visible?.binaries[path] === undefined ? null : (visible.revisions[path] ?? null);
308
+ const binary = visible?.binaries[path];
309
+ if (binary === undefined)
310
+ return null;
311
+ return visible?.revisions[path] ?? (binary.state === 'pending' ? binary.localId : null);
296
312
  }
297
- export function changedParts(path, report) {
313
+ export function changedParts(path, parts, visible) {
314
+ const report = underneath(parts, path, visible);
315
+ const made = parts.file?.base === null;
298
316
  return [
299
- ...(report.creation === undefined ? [] : [{ path, part: 'creation' }]),
300
317
  ...named(report.fields).map(([name]) => ({ path, part: 'field', name })),
301
318
  ...named(report.sections).map(([name]) => ({ path, part: 'section', name })),
302
319
  ...(report.preamble === undefined ? [] : [{ path, part: 'preamble' }]),
303
320
  ...(report.markdown === undefined ? [] : [{ path, part: 'markdown' }]),
304
321
  ...(report.move === undefined ? [] : [{ path, part: 'move' }]),
305
322
  ...(report.removal === undefined ? [] : [{ path, part: 'removal' }]),
306
- ...(report.file === undefined ? [] : [{ path, part: 'file' }]),
323
+ ...(report.file === undefined || made ? [] : [{ path, part: 'file' }]),
307
324
  ];
308
325
  }
309
326
  function joined(existing, returned) {
@@ -313,7 +330,7 @@ function joined(existing, returned) {
313
330
  merged[name] = part;
314
331
  return Object.keys(merged).length === 0 ? undefined : merged;
315
332
  }
316
- function ended(text) {
333
+ export function lineEnded(text) {
317
334
  return text === '' || text.endsWith('\n') ? text : `${text}\n`;
318
335
  }
319
336
  function frontmatterOf(fields) {
@@ -337,7 +354,7 @@ export function partsAfter(markdown, parts) {
337
354
  ];
338
355
  if (pieces.length === 0)
339
356
  return markdown;
340
- return `${ended(markdown)}\n${pieces.map(ended).join('')}`;
357
+ return `${lineEnded(markdown)}\n${pieces.map(lineEnded).join('')}`;
341
358
  }
342
359
  export function returnedInto(existing, returned) {
343
360
  if (existing === undefined)
@@ -380,6 +397,36 @@ export function moveTarget(move) {
380
397
  const to = normalize(move.to);
381
398
  return to === null || to === '' ? move.to : to;
382
399
  }
400
+ export function readSavedParts(named) {
401
+ const read = named.map(({ path, parts }) => ({ path, parts: readParts(parts, path) }));
402
+ read.forEach(({ path }, at) => {
403
+ if (path === '' || normalize(path) !== path)
404
+ malformed(path, 'a path inside the Room, such as notes/a.md');
405
+ if (read.findIndex((one) => one.path === path) !== at)
406
+ malformed(path, 'each path once in one save');
407
+ });
408
+ return read;
409
+ }
410
+ export function partsChanges(named) {
411
+ const changes = [];
412
+ const preconditions = [];
413
+ for (const { path, parts } of readSavedParts(named)) {
414
+ const parted = held(undefined, parts);
415
+ const made = changesOf(path, parted);
416
+ changes.push(...made.changes);
417
+ preconditions.push(...made.bases);
418
+ for (const change of made.changes) {
419
+ if (change.kind === 'create')
420
+ preconditions.push({ kind: 'absent', path });
421
+ if (change.kind === 'move')
422
+ preconditions.push({ kind: 'absent', path: change.to });
423
+ }
424
+ const revision = parted.markdown?.base ?? parted.move?.base ?? parted.removal?.base;
425
+ if (typeof revision === 'string')
426
+ preconditions.push({ kind: 'revision', path, revision });
427
+ }
428
+ return { changes, preconditions };
429
+ }
383
430
  export function changesOf(path, parts) {
384
431
  const changes = [];
385
432
  const bases = [];
@@ -399,11 +446,11 @@ export function changesOf(path, parts) {
399
446
  bases.push({ kind: 'field', path, name, value: part.base?.value });
400
447
  }
401
448
  for (const [name, part] of named(parts.sections)) {
402
- changes.push({ kind: 'section', path, name, value: part.value });
449
+ changes.push({ kind: 'section', path, name, value: lineEnded(part.value) });
403
450
  bases.push({ kind: 'section', path, name, value: part.base });
404
451
  }
405
452
  if (parts.preamble !== undefined) {
406
- changes.push({ kind: 'preamble', path, value: parts.preamble.value });
453
+ changes.push({ kind: 'preamble', path, value: lineEnded(parts.preamble.value) });
407
454
  bases.push({ kind: 'preamble', path, value: parts.preamble.base });
408
455
  }
409
456
  if (parts.markdown !== undefined) {
@@ -415,7 +462,7 @@ export function changesOf(path, parts) {
415
462
  if (base !== null && at !== path)
416
463
  changes.push({ kind: 'move', path, to: at });
417
464
  changes.push({ kind: 'binary', path: at, ...file });
418
- if (base === null && at !== path)
465
+ if (base === null)
419
466
  bases.push({ kind: 'absent', path: at });
420
467
  return { changes, bases };
421
468
  }
@@ -0,0 +1,24 @@
1
+ import { type ChangeSet } from './change-set.js';
2
+ import { type VisibleLayer } from './replica.js';
3
+ import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
4
+ import type { Runtime } from './runtime.js';
5
+ import type { Store } from './store.js';
6
+ export type RoomDraftSurface = {
7
+ list(): Promise<readonly RoomDraft[]>;
8
+ read(room: string, path: string): Promise<RoomDraft | null>;
9
+ write(room: string, path: string, revision: string | null, parts: unknown, next?: string): Promise<RoomDraftWrite>;
10
+ discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
11
+ };
12
+ export type PresentationSurface = {
13
+ read(app: string): Promise<unknown>;
14
+ write(app: string, value: unknown): Promise<void>;
15
+ edit(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
16
+ };
17
+ export declare function visibleOf(store: Store, locator: string, paths: readonly string[]): Promise<VisibleLayer | undefined>;
18
+ export declare function publishRoomDrafts({ store, socket }: Runtime, waitingOnly: boolean, touched?: ChangeSet['documents'] | null): Promise<void>;
19
+ export declare function emitPresentation({ store, socket }: Runtime, app: string): Promise<void>;
20
+ export declare function roomDraftSurface(runtime: Runtime): RoomDraftSurface;
21
+ export declare function presentationSurface(runtime: Runtime): PresentationSurface;
22
+ export declare function watchRoomDrafts({ store, socket }: Runtime, deliver: (value: unknown) => void): () => void;
23
+ export declare function watchPresentation({ store, socket }: Runtime, app: string, deliver: (value: unknown) => void): () => void;
24
+ //# sourceMappingURL=room-drafts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room-drafts.d.ts","sourceRoot":"","sources":["../src/room-drafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAQL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,IAAI,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC5D,KAAK,CACH,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,O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0,0 +1,217 @@
1
+ import { plain } from '@agentshouse/mdmodel';
2
+ import { changeSet } from './change-set.js';
3
+ import { collectionOf } from './collection.js';
4
+ import { runtimeError } from './failure.js';
5
+ import { roomDraftRevision } from './identity.js';
6
+ import { normalize } from './paths.js';
7
+ import { slicing } from './replica.js';
8
+ import { binaryBase, gatheredParts, held, heldFile, readParts, staleWrite, underneath, } from './room-draft.js';
9
+ import { stepped } from './turn.js';
10
+ const ROOM_DRAFTS = 'room-drafts';
11
+ const presentationTopic = (app) => `presentation\u0000${app}`;
12
+ export async function visibleOf(store, locator, paths) {
13
+ const kept = await store.record(locator);
14
+ if (kept === undefined)
15
+ return undefined;
16
+ const local = await store.open();
17
+ const slice = await stepped(slicing(await local.entries(kept.key, 'visible', paths), paths));
18
+ return { ...slice, collection: collectionOf(slice.documents, store.composed(kept)) };
19
+ }
20
+ function roomDraftOf(record, visible) {
21
+ return structuredClone({
22
+ room: record.locator,
23
+ path: record.path,
24
+ revision: record.revision,
25
+ parts: record.parts,
26
+ changedUnderneath: underneath(record.parts, record.path, visible),
27
+ returned: record.returned,
28
+ });
29
+ }
30
+ async function roomDraftsOf(store, records) {
31
+ const rooms = new Map();
32
+ for (const record of records) {
33
+ const paths = rooms.get(record.locator) ?? [];
34
+ paths.push(record.path);
35
+ rooms.set(record.locator, paths);
36
+ }
37
+ const layers = new Map();
38
+ for (const [locator, paths] of rooms) {
39
+ layers.set(locator, await visibleOf(store, locator, paths));
40
+ }
41
+ return records.map((record) => roomDraftOf(record, layers.get(record.locator)));
42
+ }
43
+ function inOrder(records) {
44
+ return [...records].sort((left, right) => {
45
+ if (left.locator !== right.locator)
46
+ return left.locator < right.locator ? -1 : 1;
47
+ if (left.path !== right.path)
48
+ return left.path < right.path ? -1 : 1;
49
+ return 0;
50
+ });
51
+ }
52
+ async function snapshotRoomDrafts(store) {
53
+ return roomDraftsOf(store, inOrder(await store.drafts()));
54
+ }
55
+ export function publishRoomDrafts({ store, socket }, waitingOnly, touched = null) {
56
+ const unwatched = () => socket.closed() || store.watching(ROOM_DRAFTS).length === 0;
57
+ if (unwatched())
58
+ return Promise.resolve();
59
+ return store.publication(async () => {
60
+ if (unwatched())
61
+ return;
62
+ const records = await store.drafts();
63
+ if (socket.closed())
64
+ return;
65
+ if (touched !== null &&
66
+ !records.some((record) => touched.some(({ locator, path }) => locator === record.locator && (path === null || path === record.path)))) {
67
+ return;
68
+ }
69
+ const value = await roomDraftsOf(store, inOrder(records));
70
+ if (socket.closed())
71
+ return;
72
+ const answered = store.watching(ROOM_DRAFTS, waitingOnly ? 'waiting' : 'all');
73
+ for (const watcher of answered)
74
+ watcher.answer(value);
75
+ });
76
+ }
77
+ async function presentationOf(store, app) {
78
+ const value = await (await store.open()).presentation(app);
79
+ return value === undefined ? null : structuredClone(value);
80
+ }
81
+ export function emitPresentation({ store, socket }, app) {
82
+ const topic = presentationTopic(app);
83
+ const listening = () => store.watching(topic, 'ready');
84
+ if (socket.closed() || listening().length === 0)
85
+ return Promise.resolve();
86
+ return store.publication(async () => {
87
+ if (socket.closed() || listening().length === 0)
88
+ return;
89
+ const value = await presentationOf(store, app);
90
+ if (socket.closed())
91
+ return;
92
+ for (const watcher of listening())
93
+ watcher.answer(value);
94
+ });
95
+ }
96
+ async function writtenRoomDraft({ store }, room, path, revision, input, next) {
97
+ const parts = readParts(input, path);
98
+ if (path === '' || normalize(path) !== path)
99
+ throw runtimeError('room-draft-malformed', `room-draft-malformed at ${path}: a path inside the Room, such as notes/a.md`);
100
+ const local = await store.open();
101
+ const current = await store.draft(room, path);
102
+ if ((current?.revision ?? null) !== revision) {
103
+ return staleWrite(current === undefined ? null : (await roomDraftsOf(store, [current]))[0]);
104
+ }
105
+ const file = parts.file === undefined
106
+ ? undefined
107
+ : await heldFile(parts.file.blob, parts.file.base === undefined
108
+ ? binaryBase(await visibleOf(store, room, [path]), path)
109
+ : parts.file.base);
110
+ const record = {
111
+ locator: room,
112
+ path,
113
+ revision: next,
114
+ parts: held(current?.parts, parts, file),
115
+ returned: current?.returned ?? null,
116
+ };
117
+ await local.keepRoomDraft(record, parts.file === undefined || file === undefined
118
+ ? []
119
+ : [{ key: file.localId, blob: parts.file.blob }]);
120
+ await store.changed(changeSet(room, { drafts: [path] }));
121
+ return { outcome: 'written', roomDraft: (await roomDraftsOf(store, [record]))[0] };
122
+ }
123
+ async function keptPresentation({ store }, app, value) {
124
+ await (await store.open()).present({ app, value });
125
+ await store.changed(changeSet('', { presentation: app }));
126
+ }
127
+ export function roomDraftSurface(runtime) {
128
+ const { store } = runtime;
129
+ return {
130
+ list() {
131
+ return store
132
+ .exclusive(async () => {
133
+ await store.open();
134
+ return snapshotRoomDrafts(store);
135
+ })
136
+ .then((listed) => {
137
+ publishRoomDrafts(runtime, true);
138
+ return listed;
139
+ });
140
+ },
141
+ async read(room, path) {
142
+ const record = await store.draft(room, path);
143
+ return record === undefined ? null : (await roomDraftsOf(store, [record]))[0];
144
+ },
145
+ write(room, path, revision, input, next = roomDraftRevision()) {
146
+ if (typeof next !== 'string' || next === '')
147
+ return Promise.reject(runtimeError('room-draft-malformed'));
148
+ return store.gathered(`room-draft\u0000${room}\u0000${path}`, { revision, input, next }, (earlier, later) => {
149
+ if (later.revision !== earlier.next)
150
+ return null;
151
+ const parts = gatheredParts(earlier.input, later.input);
152
+ return parts === null
153
+ ? null
154
+ : { revision: earlier.revision, input: parts, next: later.next };
155
+ }, (written) => writtenRoomDraft(runtime, room, path, written.revision, written.input, written.next));
156
+ },
157
+ discard(room, path, revision) {
158
+ return store.exclusive(async () => {
159
+ const local = await store.open();
160
+ const current = await store.draft(room, path);
161
+ if (current === undefined || current.revision !== revision) {
162
+ return staleWrite(current === undefined ? null : (await roomDraftsOf(store, [current]))[0]);
163
+ }
164
+ await local.discardRoomDraft(room, path);
165
+ await store.changed(changeSet(room, { drafts: [path] }));
166
+ return { outcome: 'written', roomDraft: null };
167
+ });
168
+ },
169
+ };
170
+ }
171
+ export function presentationSurface(runtime) {
172
+ const { store } = runtime;
173
+ return {
174
+ read(app) {
175
+ return store.exclusive(() => presentationOf(store, app));
176
+ },
177
+ write(app, value) {
178
+ return store.exclusive(() => keptPresentation(runtime, app, structuredClone(value)));
179
+ },
180
+ edit(app, members) {
181
+ return store.gathered(`presentation\u0000${app}`, structuredClone(members), (earlier, later) => ({ ...earlier, ...later }), async (edited) => {
182
+ const kept = await (await store.open()).presentation(app);
183
+ await keptPresentation(runtime, app, Object.fromEntries([
184
+ ...Object.entries(plain(kept) ? kept : {}).filter(([member]) => !Object.hasOwn(edited, member)),
185
+ ...Object.entries(edited).filter(([, value]) => value !== null),
186
+ ]));
187
+ });
188
+ },
189
+ };
190
+ }
191
+ export function watchRoomDrafts({ store, socket }, deliver) {
192
+ const watcher = store.watch(ROOM_DRAFTS, deliver);
193
+ const unwatched = () => socket.closed() || !watcher.held();
194
+ void store
195
+ .exclusive(async () => {
196
+ await store.open();
197
+ })
198
+ .then(() => store.publication(async () => {
199
+ if (unwatched())
200
+ return;
201
+ const value = await snapshotRoomDrafts(store);
202
+ if (!unwatched())
203
+ watcher.answer(value);
204
+ }), () => { });
205
+ return watcher.stop;
206
+ }
207
+ export function watchPresentation({ store, socket }, app, deliver) {
208
+ const watcher = store.watch(presentationTopic(app), deliver);
209
+ void store
210
+ .exclusive(async () => {
211
+ const value = await presentationOf(store, app);
212
+ if (!socket.closed() && watcher.held())
213
+ watcher.answer(value);
214
+ })
215
+ .catch(() => { });
216
+ return watcher.stop;
217
+ }
package/dist/rows.d.ts CHANGED
@@ -1,27 +1,28 @@
1
+ import { type HeldValue } from '@agentshouse/mdmodel';
2
+ import type { SavedFacts } from './adapter.js';
1
3
  import { type Composition } from './collection.js';
2
- export type ValueKind = 'string' | 'number' | 'boolean' | 'null' | 'array' | 'object' | 'undefined';
3
- type HeldValue = {
4
- readonly form: string;
5
- readonly held: number;
6
- readonly item: number;
7
- readonly kind: ValueKind;
8
- readonly value: string | number | null;
9
- readonly size: number | null;
10
- readonly single: boolean;
11
- };
12
- type LinkKind = 'field' | 'section' | 'body';
4
+ type LinkKind = 'field' | 'link';
13
5
  type HeldLink = {
14
6
  readonly kind: LinkKind;
15
- readonly form: string;
7
+ readonly keys: string;
8
+ readonly places: string;
16
9
  readonly target: string;
17
10
  readonly field: string;
18
11
  };
19
- export type Derived = {
12
+ export type Described = {
20
13
  readonly type: string | null;
21
14
  readonly declared: string | null;
22
15
  readonly queried: boolean;
23
16
  readonly folder: string;
24
17
  readonly fields: string | null;
18
+ readonly links: string | null;
19
+ };
20
+ export type Held = {
21
+ readonly type: string | null;
22
+ readonly fields: Readonly<Record<string, unknown>> | null;
23
+ readonly links: readonly string[];
24
+ };
25
+ export type Derived = {
25
26
  readonly values: readonly HeldValue[];
26
27
  readonly links: readonly HeldLink[];
27
28
  };
@@ -29,9 +30,10 @@ export declare function documentKey(room: string, path: string): string;
29
30
  export declare function roomOfKey(key: string): string;
30
31
  export declare function pathOfKey(key: string): string;
31
32
  export declare function markdownPath(path: string): boolean;
32
- export declare function settingsTextPath(path: string): boolean;
33
33
  export declare function folderOf(path: string): string;
34
- export declare function kindOf(value: unknown): ValueKind;
35
- export declare function derived(path: string, content: string | null, composition: Composition): Derived;
34
+ export declare function writtenFacts(path: string, content: string, composition: Composition): SavedFacts | null;
35
+ export declare function described(path: string, content: string | null, facts: SavedFacts | null): Described;
36
+ export declare function heldOf(path: string, content: string | null, facts: SavedFacts | null): Held;
37
+ export declare function derived(path: string, held: Held, composition: Composition): Derived;
36
38
  export {};
37
39
  //# sourceMappingURL=rows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"AAWA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpG,KAAK,SAAS,GAAG;IAC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