@agentshouse/mdruntime 0.1.0-ce41fec66d91b → 0.1.0-ce5b3c1e6ea87

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 (274) hide show
  1. package/README.md +2 -2
  2. package/dist/acceptance.d.ts +6 -0
  3. package/dist/acceptance.d.ts.map +1 -0
  4. package/dist/acceptance.js +389 -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 +44 -25
  9. package/dist/adapter.d.ts.map +1 -1
  10. package/dist/attached-model.d.ts +3 -10
  11. package/dist/attached-model.d.ts.map +1 -1
  12. package/dist/attached-model.js +21 -56
  13. package/dist/bootstrap.d.ts +8 -4
  14. package/dist/bootstrap.d.ts.map +1 -1
  15. package/dist/bootstrap.js +209 -78
  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/chat-types.d.ts +5 -0
  24. package/dist/chat-types.d.ts.map +1 -0
  25. package/dist/chat-types.js +13 -0
  26. package/dist/client.d.ts +20 -4
  27. package/dist/client.d.ts.map +1 -1
  28. package/dist/client.js +3 -0
  29. package/dist/collection.d.ts +2 -1
  30. package/dist/collection.d.ts.map +1 -1
  31. package/dist/compile.d.ts +6 -6
  32. package/dist/compile.d.ts.map +1 -1
  33. package/dist/compile.js +231 -300
  34. package/dist/connection.d.ts +5 -141
  35. package/dist/connection.d.ts.map +1 -1
  36. package/dist/connection.js +101 -5058
  37. package/dist/context.d.ts +2 -0
  38. package/dist/context.d.ts.map +1 -0
  39. package/dist/context.js +7 -0
  40. package/dist/conversation-live.d.ts +136 -0
  41. package/dist/conversation-live.d.ts.map +1 -0
  42. package/dist/conversation-live.js +248 -0
  43. package/dist/conversation-row.d.ts +33 -0
  44. package/dist/conversation-row.d.ts.map +1 -0
  45. package/dist/conversation-row.js +53 -0
  46. package/dist/conversation.d.ts +34 -38
  47. package/dist/conversation.d.ts.map +1 -1
  48. package/dist/conversation.js +856 -850
  49. package/dist/discovery.d.ts +10 -0
  50. package/dist/discovery.d.ts.map +1 -0
  51. package/dist/discovery.js +175 -0
  52. package/dist/durability.d.ts +15 -0
  53. package/dist/durability.d.ts.map +1 -1
  54. package/dist/entry.d.ts +2 -2
  55. package/dist/entry.d.ts.map +1 -1
  56. package/dist/entry.js +17 -7
  57. package/dist/figures.d.ts +48 -0
  58. package/dist/figures.d.ts.map +1 -0
  59. package/dist/figures.js +197 -0
  60. package/dist/holdings.d.ts +29 -0
  61. package/dist/holdings.d.ts.map +1 -0
  62. package/dist/holdings.js +95 -0
  63. package/dist/host.d.ts +4 -5
  64. package/dist/host.d.ts.map +1 -1
  65. package/dist/host.js +23 -22
  66. package/dist/identity.d.ts +0 -1
  67. package/dist/identity.d.ts.map +1 -1
  68. package/dist/identity.js +0 -3
  69. package/dist/index.d.ts +23 -8
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +5 -1
  72. package/dist/install.d.ts +56 -0
  73. package/dist/install.d.ts.map +1 -0
  74. package/dist/install.js +560 -0
  75. package/dist/job.d.ts +33 -0
  76. package/dist/job.d.ts.map +1 -0
  77. package/dist/job.js +54 -0
  78. package/dist/lifecycle.d.ts +7 -0
  79. package/dist/lifecycle.d.ts.map +1 -0
  80. package/dist/lifecycle.js +268 -0
  81. package/dist/listing.d.ts +53 -0
  82. package/dist/listing.d.ts.map +1 -0
  83. package/dist/listing.js +175 -0
  84. package/dist/live.d.ts +5 -4
  85. package/dist/live.d.ts.map +1 -1
  86. package/dist/live.js +62 -20
  87. package/dist/locks.d.ts +9 -0
  88. package/dist/locks.d.ts.map +1 -0
  89. package/dist/locks.js +61 -0
  90. package/dist/log.d.ts +1 -0
  91. package/dist/log.d.ts.map +1 -1
  92. package/dist/lost.d.ts +5 -0
  93. package/dist/lost.d.ts.map +1 -0
  94. package/dist/lost.js +61 -0
  95. package/dist/memory.d.ts +5 -1
  96. package/dist/memory.d.ts.map +1 -1
  97. package/dist/memory.js +47 -8
  98. package/dist/messages.d.ts +27 -3
  99. package/dist/messages.d.ts.map +1 -1
  100. package/dist/messages.js +97 -19
  101. package/dist/model.d.ts +2 -9
  102. package/dist/model.d.ts.map +1 -1
  103. package/dist/model.js +0 -9
  104. package/dist/models.d.ts +14 -0
  105. package/dist/models.d.ts.map +1 -0
  106. package/dist/models.js +193 -0
  107. package/dist/observation.d.ts +2 -2
  108. package/dist/observation.d.ts.map +1 -1
  109. package/dist/observation.js +7 -2
  110. package/dist/opening.d.ts +4 -0
  111. package/dist/opening.d.ts.map +1 -0
  112. package/dist/opening.js +57 -0
  113. package/dist/outcome.d.ts +4 -1
  114. package/dist/outcome.d.ts.map +1 -1
  115. package/dist/outcome.js +3 -0
  116. package/dist/overlay.d.ts +1 -0
  117. package/dist/overlay.d.ts.map +1 -1
  118. package/dist/overlay.js +11 -0
  119. package/dist/parts.d.ts +59 -0
  120. package/dist/parts.d.ts.map +1 -0
  121. package/dist/parts.js +118 -0
  122. package/dist/preparation.d.ts +20 -0
  123. package/dist/preparation.d.ts.map +1 -0
  124. package/dist/preparation.js +226 -0
  125. package/dist/queries.d.ts +16 -0
  126. package/dist/queries.d.ts.map +1 -0
  127. package/dist/queries.js +272 -0
  128. package/dist/query.d.ts +13 -208
  129. package/dist/query.d.ts.map +1 -1
  130. package/dist/query.js +3 -505
  131. package/dist/questions.d.ts +34 -0
  132. package/dist/questions.d.ts.map +1 -0
  133. package/dist/questions.js +122 -0
  134. package/dist/reach.d.ts +14 -12
  135. package/dist/reach.d.ts.map +1 -1
  136. package/dist/reach.js +167 -114
  137. package/dist/react.d.ts +10 -2
  138. package/dist/react.d.ts.map +1 -1
  139. package/dist/read.d.ts +7 -0
  140. package/dist/read.d.ts.map +1 -0
  141. package/dist/read.js +17 -0
  142. package/dist/readiness.d.ts +0 -2
  143. package/dist/readiness.d.ts.map +1 -1
  144. package/dist/reads.d.ts +37 -0
  145. package/dist/reads.d.ts.map +1 -0
  146. package/dist/reads.js +171 -0
  147. package/dist/recovery.d.ts.map +1 -1
  148. package/dist/recovery.js +9 -1
  149. package/dist/refresh.d.ts +1 -1
  150. package/dist/refresh.d.ts.map +1 -1
  151. package/dist/refresh.js +7 -0
  152. package/dist/refusal.d.ts +5 -0
  153. package/dist/refusal.d.ts.map +1 -0
  154. package/dist/refusal.js +56 -0
  155. package/dist/replica.d.ts +8 -8
  156. package/dist/replica.d.ts.map +1 -1
  157. package/dist/replica.js +52 -16
  158. package/dist/room-draft.d.ts +4 -3
  159. package/dist/room-draft.d.ts.map +1 -1
  160. package/dist/room-draft.js +65 -52
  161. package/dist/room-drafts.d.ts +24 -0
  162. package/dist/room-drafts.d.ts.map +1 -0
  163. package/dist/room-drafts.js +216 -0
  164. package/dist/rows.d.ts +14 -21
  165. package/dist/rows.d.ts.map +1 -1
  166. package/dist/rows.js +48 -184
  167. package/dist/runtime.d.ts +43 -0
  168. package/dist/runtime.d.ts.map +1 -0
  169. package/dist/runtime.js +1 -0
  170. package/dist/save.d.ts +3 -1
  171. package/dist/save.d.ts.map +1 -1
  172. package/dist/save.js +16 -11
  173. package/dist/saves.d.ts +70 -0
  174. package/dist/saves.d.ts.map +1 -0
  175. package/dist/saves.js +1006 -0
  176. package/dist/search.d.ts +12 -63
  177. package/dist/search.d.ts.map +1 -1
  178. package/dist/search.js +9 -52
  179. package/dist/seed.d.ts +11 -2
  180. package/dist/seed.d.ts.map +1 -1
  181. package/dist/seed.js +71 -0
  182. package/dist/shared.d.ts +1 -1
  183. package/dist/shared.d.ts.map +1 -1
  184. package/dist/shared.js +9 -5
  185. package/dist/shown.d.ts +31 -0
  186. package/dist/shown.d.ts.map +1 -0
  187. package/dist/shown.js +295 -0
  188. package/dist/socket/admission.d.ts +7 -0
  189. package/dist/socket/admission.d.ts.map +1 -0
  190. package/dist/socket/admission.js +39 -0
  191. package/dist/socket/answers.d.ts +6 -0
  192. package/dist/socket/answers.d.ts.map +1 -0
  193. package/dist/socket/answers.js +20 -0
  194. package/dist/socket/lanes.d.ts +20 -0
  195. package/dist/socket/lanes.d.ts.map +1 -0
  196. package/dist/socket/lanes.js +77 -0
  197. package/dist/socket/reads.d.ts +10 -0
  198. package/dist/socket/reads.d.ts.map +1 -0
  199. package/dist/socket/reads.js +31 -0
  200. package/dist/socket/rooms.d.ts +43 -0
  201. package/dist/socket/rooms.d.ts.map +1 -0
  202. package/dist/socket/rooms.js +90 -0
  203. package/dist/socket/session.d.ts +39 -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 +70 -0
  207. package/dist/socket.d.ts.map +1 -0
  208. package/dist/socket.js +175 -0
  209. package/dist/source.d.ts +61 -0
  210. package/dist/source.d.ts.map +1 -0
  211. package/dist/source.js +81 -0
  212. package/dist/status.d.ts +0 -2
  213. package/dist/status.d.ts.map +1 -1
  214. package/dist/status.js +0 -6
  215. package/dist/store/fences.d.ts +16 -0
  216. package/dist/store/fences.d.ts.map +1 -0
  217. package/dist/store/fences.js +26 -0
  218. package/dist/store/installs.d.ts +30 -0
  219. package/dist/store/installs.d.ts.map +1 -0
  220. package/dist/store/installs.js +34 -0
  221. package/dist/store/readiness.d.ts +10 -0
  222. package/dist/store/readiness.d.ts.map +1 -0
  223. package/dist/store/readiness.js +52 -0
  224. package/dist/store/records.d.ts +212 -0
  225. package/dist/store/records.d.ts.map +1 -0
  226. package/dist/store/records.js +408 -0
  227. package/dist/store/room-held.d.ts +8 -0
  228. package/dist/store/room-held.d.ts.map +1 -0
  229. package/dist/store/room-held.js +17 -0
  230. package/dist/store/space.d.ts +11 -0
  231. package/dist/store/space.d.ts.map +1 -0
  232. package/dist/store/space.js +43 -0
  233. package/dist/store/watchers.d.ts +17 -0
  234. package/dist/store/watchers.d.ts.map +1 -0
  235. package/dist/store/watchers.js +57 -0
  236. package/dist/store/writes.d.ts +24 -0
  237. package/dist/store/writes.d.ts.map +1 -0
  238. package/dist/store/writes.js +125 -0
  239. package/dist/store.d.ts +107 -145
  240. package/dist/store.d.ts.map +1 -1
  241. package/dist/store.js +143 -366
  242. package/dist/stored.d.ts +58 -32
  243. package/dist/stored.d.ts.map +1 -1
  244. package/dist/stored.js +264 -187
  245. package/dist/surface.d.ts +88 -0
  246. package/dist/surface.d.ts.map +1 -0
  247. package/dist/surface.js +223 -0
  248. package/dist/sync.d.ts +20 -0
  249. package/dist/sync.d.ts.map +1 -0
  250. package/dist/sync.js +532 -0
  251. package/dist/tables.d.ts +117 -27
  252. package/dist/tables.d.ts.map +1 -1
  253. package/dist/tables.js +211 -49
  254. package/dist/tallies.d.ts +18 -0
  255. package/dist/tallies.d.ts.map +1 -0
  256. package/dist/tallies.js +129 -0
  257. package/dist/validation.d.ts.map +1 -1
  258. package/dist/validation.js +7 -4
  259. package/dist/windows.d.ts +1 -12
  260. package/dist/windows.d.ts.map +1 -1
  261. package/dist/windows.js +2 -75
  262. package/dist/wire.d.ts +17 -1
  263. package/dist/wire.d.ts.map +1 -1
  264. package/dist/wire.js +7 -0
  265. package/package.json +2 -2
  266. package/dist/fence.d.ts +0 -6
  267. package/dist/fence.d.ts.map +0 -1
  268. package/dist/fence.js +0 -10
  269. package/dist/fulltext.d.ts +0 -27
  270. package/dist/fulltext.d.ts.map +0 -1
  271. package/dist/fulltext.js +0 -370
  272. package/dist/words.d.ts +0 -19
  273. package/dist/words.d.ts.map +0 -1
  274. package/dist/words.js +0 -156
package/dist/rows.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ARRAY_INDEX, bodyAfterFrontmatter, bodyLinks, escapePointer, parseFrontmatter, references, sectionReferences, target, } from '@agentshouse/mdmodel';
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) {
@@ -19,196 +19,60 @@ export function markdownPath(path) {
19
19
  export function folderOf(path) {
20
20
  return path.slice(0, Math.max(path.lastIndexOf('/'), 0));
21
21
  }
22
- export function placedOf(pointer, reach) {
23
- const [first = '', ...rest] = pointer.split('/').slice(1);
24
- const keys = [first];
25
- const gaps = [[]];
26
- for (const segment of rest) {
27
- if (ARRAY_INDEX.test(segment)) {
28
- gaps.at(-1).push(segment);
29
- continue;
30
- }
31
- keys.push(segment);
32
- gaps.push([]);
33
- }
34
- const places = gaps
35
- .map((gap, at) => {
36
- const open = at < gaps.length - 1 ? reach !== 'exact' : reach === 'link';
37
- return `/${gap.map((number) => `[.:]${number}`).join('')}.${open ? '*' : ''}`;
38
- })
39
- .join('');
40
- return {
41
- keys: keys.map((key) => `/${key}`).join(''),
42
- places,
43
- glob: /[[*]/u.test(places),
44
- };
45
- }
46
- function placesOf({ done, head, tail }) {
47
- return `${done}/${head}${tail}.`;
48
- }
49
- function throughOf(keys, places) {
50
- const gaps = places.split('/').slice(1);
51
- return keys
52
- .split('/')
53
- .slice(1)
54
- .map((key, at) => `/${key}${gaps[at].replace(/\.\d*/gu, '').replaceAll(':', '/')}`)
55
- .join('');
56
- }
57
- function plainObject(value) {
58
- return typeof value === 'object' && value !== null && !Array.isArray(value);
59
- }
60
- function compared(reading, exact, value) {
61
- if (!reading.references.has(exact))
62
- return value;
63
- return (typeof value === 'string' ? target(reading.path, value) : null) ?? undefined;
64
- }
65
- export function kindOf(value) {
66
- if (value === undefined)
67
- return 'undefined';
68
- if (value === null)
69
- return 'null';
70
- if (Array.isArray(value))
71
- return 'array';
72
- if (typeof value === 'object')
73
- return 'object';
74
- return typeof value;
75
- }
76
- function scalarOf(value) {
77
- if (typeof value === 'string' || typeof value === 'number')
22
+ function byKey(_key, value) {
23
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
78
24
  return value;
79
- if (typeof value === 'boolean')
80
- return value ? 1 : 0;
81
- if (Array.isArray(value))
82
- return JSON.stringify(value);
83
- return null;
25
+ return Object.fromEntries(Object.entries(value).sort(([one], [other]) => byCodePoint(one, other)));
84
26
  }
85
- function held(reading, keys, places, value) {
86
- reading.values.push({
87
- keys,
88
- places,
89
- item: -1,
90
- kind: kindOf(value),
91
- value: scalarOf(value),
92
- size: Array.isArray(value) ? value.length : null,
93
- });
94
- if (!Array.isArray(value))
95
- return;
96
- value.forEach((item, index) => {
97
- const itemKind = kindOf(item);
98
- reading.values.push({
99
- keys,
100
- places,
101
- item: index,
102
- kind: itemKind,
103
- value: itemKind === 'array' ? null : scalarOf(item),
104
- size: null,
105
- });
106
- });
27
+ function fieldsText(fields) {
28
+ return JSON.stringify(fields, byKey);
107
29
  }
108
- function record(reading, node, at) {
109
- const value = Array.isArray(node)
110
- ? node.map((item, index) => compared(reading, `${at.exact}/${index}`, item))
111
- : compared(reading, at.exact, node);
112
- const places = placesOf(at);
113
- held(reading, at.keys, places, value);
114
- if (typeof value !== 'string' || !reading.references.has(at.exact))
115
- return;
116
- reading.links.push({
117
- kind: 'field',
118
- keys: at.keys,
119
- places,
120
- target: value,
121
- field: throughOf(at.keys, places),
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,
122
34
  });
35
+ return facts === null
36
+ ? null
37
+ : { ...facts, fields: JSON.parse(fieldsText(facts.fields)) };
123
38
  }
124
- function walk(reading, node, at) {
125
- record(reading, node, at);
126
- if (Array.isArray(node)) {
127
- node.forEach((item, index) => walk(reading, item, { ...at, tail: `${at.tail}.${index}`, exact: `${at.exact}/${index}` }));
128
- return;
129
- }
130
- if (!plainObject(node))
131
- return;
132
- for (const [key, value] of Object.entries(node)) {
133
- const segment = escapePointer(key);
134
- const exact = `${at.exact}/${segment}`;
135
- walk(reading, value, ARRAY_INDEX.test(segment)
136
- ? { ...at, head: `${at.head}${at.tail.replaceAll('.', ':')}:${segment}`, tail: '', exact }
137
- : { keys: `${at.keys}/${segment}`, done: placesOf(at), head: '', tail: '', exact });
138
- }
139
- }
140
- function bodyTargets(path, content) {
141
- const seen = new Set();
142
- const found = [];
143
- for (const { target: reached } of bodyLinks(bodyAfterFrontmatter(content), path)) {
144
- if (seen.has(reached))
145
- continue;
146
- seen.add(reached);
147
- found.push({ kind: 'body', keys: '', places: '', target: reached, field: '' });
148
- }
149
- return found;
150
- }
151
- function typedRows(path, content, document, composition) {
152
- const definition = definitionOf(governing(composition, path), document.type);
153
- const reading = {
154
- path,
155
- references: new Set(definition === undefined ? [] : references(document, definition).map((one) => one.pointer)),
156
- values: [],
157
- links: [],
158
- };
159
- for (const [name, value] of Object.entries(document.fields)) {
160
- const segment = escapePointer(name);
161
- walk(reading, value, {
162
- keys: `/${segment}`,
163
- done: '',
164
- head: '',
165
- tail: '',
166
- exact: `/${segment}`,
167
- });
168
- }
169
- const links = reading.links;
170
- if (definition !== undefined) {
171
- const sectioned = new Set();
172
- for (const { target: reached } of sectionReferences(path, content, definition)) {
173
- if (reached === null || sectioned.has(reached))
174
- continue;
175
- sectioned.add(reached);
176
- links.push({ kind: 'section', keys: '', places: '', target: reached, field: '' });
177
- }
178
- }
179
- return { values: reading.values, links: [...links, ...bodyTargets(path, content)] };
180
- }
181
- function read(path, content) {
39
+ export function described(path, content, facts) {
182
40
  const folder = folderOf(path);
183
- const unread = { fields: null, folder, type: null };
184
- if (content === null) {
185
- return { described: { ...unread, declared: null, queried: true }, document: null };
186
- }
187
- const parsed = parseFrontmatter(content, path);
188
- const declared = parsed.ok ? (parsed.frontmatter.type ?? 'any') : null;
189
- if (!markdownPath(path) || !parsed.ok) {
190
- return { described: { ...unread, declared, queried: !markdownPath(path) }, document: null };
191
- }
192
- const document = parsed.frontmatter;
41
+ const unread = { type: null, fields: null, links: null, folder };
42
+ if (content === null)
43
+ return { ...unread, declared: null, queried: true };
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 };
193
49
  return {
194
- described: {
195
- type: document.type ?? 'any',
196
- declared,
197
- queried: true,
198
- folder,
199
- fields: JSON.stringify(document.fields),
200
- },
201
- document,
50
+ type: facts.type,
51
+ declared: facts.type,
52
+ queried: true,
53
+ folder,
54
+ fields: fieldsText(facts.fields),
55
+ links,
202
56
  };
203
57
  }
204
- export function described(path, content) {
205
- return read(path, content).described;
206
- }
207
- export function derived(path, content, composition) {
208
- const { described: columns, document } = read(path, content);
209
- if (document !== null) {
210
- return { ...columns, ...typedRows(path, content, document, composition) };
211
- }
212
- const links = content === null || markdownPath(path) ? [] : bodyTargets(path, content);
213
- return { ...columns, values: [], links };
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] };
214
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,W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IAAI,CAAC,CAAC;CAClB,CAAC"}
@@ -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';
@@ -20,6 +20,7 @@ export type SaveInput = {
20
20
  operations: import('./adapter.js').OperationScopes;
21
21
  providerOwnedPaths: readonly string[];
22
22
  providerLimits: readonly ProviderLimit[];
23
+ pathRule: PathRule;
23
24
  visible: VisibleLayer;
24
25
  folders: ReadonlySet<string>;
25
26
  handle: string;
@@ -89,6 +90,7 @@ export type MoveInput = {
89
90
  readonly to: string;
90
91
  }[];
91
92
  providerLimits: readonly ProviderLimit[];
93
+ pathRule: PathRule;
92
94
  local: boolean;
93
95
  writtenBy?: WrittenBy;
94
96
  };
@@ -1 +1 @@
1
- {"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../src/save.ts"],"names":[],"mappings":"AACA,OAAO,EAkBL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,E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AC,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;AAwInG,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
@@ -5,7 +5,7 @@ import { collectionOf, documentsOf, governing, } from './collection.js';
5
5
  import { changeBatchIdentity } from './identity.js';
6
6
  import { overlaying } from './overlay.js';
7
7
  import { ancestors, covered, normalize } from './paths.js';
8
- import { sorting } from './shared.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) {
@@ -321,6 +321,8 @@ function* incoming(collection, removed, candidates) {
321
321
  function affected(change) {
322
322
  return change.kind === 'move' ? [change.path, change.to] : [change.path];
323
323
  }
324
+ const WRITE = ['write'];
325
+ const MOVE_OUT = ['write', 'erase'];
324
326
  function guard(changes, input, removing) {
325
327
  const overridden = new Map();
326
328
  const existing = {
@@ -338,9 +340,11 @@ function guard(changes, input, removing) {
338
340
  if (covered(input.providerOwnedPaths, normalized)) {
339
341
  return refuse('provider-owned-path', normalized);
340
342
  }
341
- const operation = change.kind === 'remove' ? removing : 'write';
342
- if (!input.local && !covered(input.operations[operation], normalized))
343
- return refuse(`${operation}-grant`, normalized);
343
+ if (!input.pathRule(normalized))
344
+ return refuse('invalid-path', normalized);
345
+ for (const operation of change.kind === 'remove' ? removing : WRITE)
346
+ if (!input.local && !covered(input.operations[operation], normalized))
347
+ return refuse(`${operation}-grant`, normalized);
344
348
  }
345
349
  if (change.kind === 'create' || change.kind === 'arrival') {
346
350
  const taken = existing.has(change.path) ? change.path : occupied(change.path);
@@ -898,7 +902,7 @@ function touchedLibrary(resulting, touched, composition) {
898
902
  })
899
903
  .sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
900
904
  const contents = new Map(entries.map(({ path, content }) => [path, content]));
901
- const binaries = new Set(Object.keys(resulting.binaries).filter((path) => resulting.binaries[path] !== undefined));
905
+ const binaries = new Set(Array.from(entriesIn(resulting.binaries), ([path]) => path));
902
906
  return validatedCollection(() => Promise.resolve({ entries, next: null }), async (paths) => {
903
907
  const known = new Map();
904
908
  const pace = paced();
@@ -974,7 +978,7 @@ function roomReferencesIn(path, content, composition) {
974
978
  const parsed = parse(content, path);
975
979
  if (!parsed.ok)
976
980
  return [];
977
- return roomReferences(path, content, definitionOf(governing(composition, path), parsed.document.type));
981
+ return roomReferences(parsed.document, definitionOf(governing(composition, path), parsed.document.type));
978
982
  }
979
983
  function* admittedRooms(changes, visible, resulting, composition) {
980
984
  const from = new Map();
@@ -1020,7 +1024,7 @@ async function batching(input) {
1020
1024
  const rewritten = await stepped(rewrites(changes, input.visible));
1021
1025
  if (rewritten.kind === 'refused')
1022
1026
  return rewritten;
1023
- const refusal = guard(changes, input, 'delete');
1027
+ const refusal = guard(changes, input, WRITE);
1024
1028
  if (refusal !== null)
1025
1029
  return refusal;
1026
1030
  const preconditions = await stepped(preconditionsOf(changes, input.visible, input.bases));
@@ -1069,9 +1073,10 @@ function arrivingText(path, to, source, moved) {
1069
1073
  return applied.outcome === 'applied' ? serialize(applied.document) : content;
1070
1074
  }
1071
1075
  function arrivalOf({ path, to }, source, moved) {
1072
- const { documents, revisions, fileIds, changes, binaries } = source.visible;
1076
+ const { documents, revisions, fileIds, created, changes, binaries } = source.visible;
1073
1077
  const kept = {
1074
1078
  ...(fileIds[path] === undefined ? {} : { fileId: fileIds[path] }),
1079
+ ...(created[path] === undefined ? {} : { created: created[path] }),
1075
1080
  ...(changes[path] === undefined ? {} : { change: changes[path] }),
1076
1081
  };
1077
1082
  const heads = {
@@ -1097,11 +1102,11 @@ function arrivalOf({ path, to }, source, moved) {
1097
1102
  };
1098
1103
  }
1099
1104
  async function moving(input) {
1100
- const { source, destination, moves } = input;
1105
+ const { source, destination, moves, pathRule } = input;
1101
1106
  if (moves.length === 0)
1102
1107
  return refuse('no-change');
1103
1108
  const removals = moves.map(({ path }) => ({ kind: 'remove', path }));
1104
- const leaves = guard(removals, { ...source, local: input.local, bases: [] }, 'write');
1109
+ const leaves = guard(removals, { ...source, local: input.local, bases: [], pathRule }, MOVE_OUT);
1105
1110
  if (leaves !== null)
1106
1111
  return leaves;
1107
1112
  const uploading = moves.find(({ path }) => source.visible.binaries[path]?.state === 'pending');
@@ -1109,7 +1114,7 @@ async function moving(input) {
1109
1114
  return refuse('unknown-revision', uploading.path);
1110
1115
  const moved = new Map(moves.map(({ path, to }) => [path, to]));
1111
1116
  const arrivals = moves.map((move) => arrivalOf(move, source, moved));
1112
- const arrives = guard(arrivals, { ...destination, local: input.local, bases: [] }, 'write');
1117
+ const arrives = guard(arrivals, { ...destination, local: input.local, bases: [], pathRule }, WRITE);
1113
1118
  if (arrives !== null)
1114
1119
  return arrives;
1115
1120
  const bound = input.providerLimits.find((limit) => limit.name === MOVE_DOCUMENTS)?.value;
@@ -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,EACf,MAAM,aAAa,CAAC;AAQrB,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,gBAAgB,E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