@agentshouse/mdruntime 0.1.0-c835af48a82d3 → 0.1.0-c83bc1fac9b35

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 (316) hide show
  1. package/README.md +21 -19
  2. package/dist/acceptance.d.ts +3 -0
  3. package/dist/acceptance.d.ts.map +1 -0
  4. package/dist/acceptance.js +299 -0
  5. package/dist/act-lanes.d.ts +30 -0
  6. package/dist/act-lanes.d.ts.map +1 -0
  7. package/dist/act-lanes.js +225 -0
  8. package/dist/actions.d.ts +26 -0
  9. package/dist/actions.d.ts.map +1 -0
  10. package/dist/actions.js +321 -0
  11. package/dist/adapter.d.ts +115 -57
  12. package/dist/adapter.d.ts.map +1 -1
  13. package/dist/attached-model.d.ts +0 -1
  14. package/dist/attached-model.d.ts.map +1 -1
  15. package/dist/attached-model.js +0 -5
  16. package/dist/authored.d.ts +88 -0
  17. package/dist/authored.d.ts.map +1 -0
  18. package/dist/authored.js +345 -0
  19. package/dist/bootstrap.d.ts +1 -1
  20. package/dist/bootstrap.d.ts.map +1 -1
  21. package/dist/bootstrap.js +6 -18
  22. package/dist/cell.d.ts +6 -0
  23. package/dist/cell.d.ts.map +1 -0
  24. package/dist/cell.js +9 -0
  25. package/dist/change-set.d.ts +4 -0
  26. package/dist/change-set.d.ts.map +1 -1
  27. package/dist/change-set.js +6 -0
  28. package/dist/change.d.ts +4 -0
  29. package/dist/change.d.ts.map +1 -1
  30. package/dist/change.js +7 -2
  31. package/dist/chat-types.d.ts +2 -2
  32. package/dist/chat-types.d.ts.map +1 -1
  33. package/dist/chat-types.js +11 -2
  34. package/dist/client.d.ts +26 -22
  35. package/dist/client.d.ts.map +1 -1
  36. package/dist/client.js +45 -58
  37. package/dist/collection.d.ts +26 -4
  38. package/dist/collection.d.ts.map +1 -1
  39. package/dist/collection.js +28 -10
  40. package/dist/column.d.ts +5 -0
  41. package/dist/column.d.ts.map +1 -0
  42. package/dist/column.js +9 -0
  43. package/dist/compile.d.ts +2 -0
  44. package/dist/compile.d.ts.map +1 -1
  45. package/dist/compile.js +31 -25
  46. package/dist/connection.d.ts +5 -149
  47. package/dist/connection.d.ts.map +1 -1
  48. package/dist/connection.js +112 -5364
  49. package/dist/context.d.ts.map +1 -1
  50. package/dist/context.js +1 -1
  51. package/dist/conversation-live.d.ts +152 -0
  52. package/dist/conversation-live.d.ts.map +1 -0
  53. package/dist/conversation-live.js +261 -0
  54. package/dist/conversation-row.d.ts +8 -1
  55. package/dist/conversation-row.d.ts.map +1 -1
  56. package/dist/conversation-row.js +22 -3
  57. package/dist/conversation.d.ts +57 -45
  58. package/dist/conversation.d.ts.map +1 -1
  59. package/dist/conversation.js +977 -1031
  60. package/dist/declaration.d.ts +10 -0
  61. package/dist/declaration.d.ts.map +1 -0
  62. package/dist/declaration.js +24 -0
  63. package/dist/discovery.d.ts +12 -0
  64. package/dist/discovery.d.ts.map +1 -0
  65. package/dist/discovery.js +175 -0
  66. package/dist/download.d.ts +6 -0
  67. package/dist/download.d.ts.map +1 -0
  68. package/dist/download.js +42 -0
  69. package/dist/durability.d.ts +14 -0
  70. package/dist/durability.d.ts.map +1 -1
  71. package/dist/durability.js +7 -0
  72. package/dist/entry.d.ts +5 -0
  73. package/dist/entry.d.ts.map +1 -1
  74. package/dist/entry.js +23 -12
  75. package/dist/expectation.d.ts +26 -13
  76. package/dist/expectation.d.ts.map +1 -1
  77. package/dist/expectation.js +72 -19
  78. package/dist/failure.d.ts +3 -0
  79. package/dist/failure.d.ts.map +1 -1
  80. package/dist/failure.js +8 -0
  81. package/dist/figures.d.ts +1 -0
  82. package/dist/figures.d.ts.map +1 -1
  83. package/dist/figures.js +6 -4
  84. package/dist/file.d.ts +1 -1
  85. package/dist/file.d.ts.map +1 -1
  86. package/dist/file.js +3 -2
  87. package/dist/holdings.d.ts +29 -0
  88. package/dist/holdings.d.ts.map +1 -0
  89. package/dist/holdings.js +95 -0
  90. package/dist/host.d.ts +24 -4
  91. package/dist/host.d.ts.map +1 -1
  92. package/dist/host.js +87 -20
  93. package/dist/house-query.d.ts +21 -0
  94. package/dist/house-query.d.ts.map +1 -0
  95. package/dist/house-query.js +41 -0
  96. package/dist/index.d.ts +30 -12
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +16 -6
  99. package/dist/install.d.ts +60 -0
  100. package/dist/install.d.ts.map +1 -0
  101. package/dist/install.js +537 -0
  102. package/dist/lifecycle.d.ts +7 -0
  103. package/dist/lifecycle.d.ts.map +1 -0
  104. package/dist/lifecycle.js +290 -0
  105. package/dist/listing.d.ts +60 -0
  106. package/dist/listing.d.ts.map +1 -0
  107. package/dist/listing.js +168 -0
  108. package/dist/live.d.ts +5 -3
  109. package/dist/live.d.ts.map +1 -1
  110. package/dist/live.js +74 -33
  111. package/dist/loaded.d.ts +5 -0
  112. package/dist/loaded.d.ts.map +1 -0
  113. package/dist/loaded.js +40 -0
  114. package/dist/locks.d.ts +7 -0
  115. package/dist/locks.d.ts.map +1 -0
  116. package/dist/locks.js +34 -0
  117. package/dist/lost.d.ts +5 -0
  118. package/dist/lost.d.ts.map +1 -0
  119. package/dist/lost.js +49 -0
  120. package/dist/media.d.ts +19 -2
  121. package/dist/media.d.ts.map +1 -1
  122. package/dist/media.js +105 -27
  123. package/dist/memory.d.ts +9 -3
  124. package/dist/memory.d.ts.map +1 -1
  125. package/dist/memory.js +94 -32
  126. package/dist/messages.d.ts +12 -6
  127. package/dist/messages.d.ts.map +1 -1
  128. package/dist/messages.js +35 -39
  129. package/dist/modal.d.ts +2 -0
  130. package/dist/modal.d.ts.map +1 -0
  131. package/dist/modal.js +11 -0
  132. package/dist/model.d.ts +4 -3
  133. package/dist/model.d.ts.map +1 -1
  134. package/dist/model.js +6 -5
  135. package/dist/models.d.ts +10 -0
  136. package/dist/models.d.ts.map +1 -0
  137. package/dist/models.js +153 -0
  138. package/dist/observation.d.ts +29 -12
  139. package/dist/observation.d.ts.map +1 -1
  140. package/dist/observation.js +217 -85
  141. package/dist/online.d.ts +7 -0
  142. package/dist/online.d.ts.map +1 -0
  143. package/dist/online.js +29 -0
  144. package/dist/opened.d.ts +1 -1
  145. package/dist/opened.d.ts.map +1 -1
  146. package/dist/opened.js +5 -5
  147. package/dist/opening.d.ts +4 -0
  148. package/dist/opening.d.ts.map +1 -0
  149. package/dist/opening.js +69 -0
  150. package/dist/outcome.d.ts +16 -2
  151. package/dist/outcome.d.ts.map +1 -1
  152. package/dist/outcome.js +32 -2
  153. package/dist/overlay.d.ts +6 -2
  154. package/dist/overlay.d.ts.map +1 -1
  155. package/dist/overlay.js +37 -24
  156. package/dist/page-metadata.d.ts +8 -0
  157. package/dist/page-metadata.d.ts.map +1 -0
  158. package/dist/page-metadata.js +19 -0
  159. package/dist/parts.d.ts +5 -58
  160. package/dist/parts.d.ts.map +1 -1
  161. package/dist/parts.js +28 -110
  162. package/dist/paths.d.ts +1 -0
  163. package/dist/paths.d.ts.map +1 -1
  164. package/dist/paths.js +22 -0
  165. package/dist/preparation.d.ts +45 -0
  166. package/dist/preparation.d.ts.map +1 -0
  167. package/dist/preparation.js +335 -0
  168. package/dist/presence.d.ts +58 -0
  169. package/dist/presence.d.ts.map +1 -0
  170. package/dist/presence.js +231 -0
  171. package/dist/queries.d.ts +16 -0
  172. package/dist/queries.d.ts.map +1 -0
  173. package/dist/queries.js +287 -0
  174. package/dist/query.d.ts +0 -1
  175. package/dist/query.d.ts.map +1 -1
  176. package/dist/questions.d.ts +3 -5
  177. package/dist/questions.d.ts.map +1 -1
  178. package/dist/questions.js +4 -6
  179. package/dist/queue.d.ts +40 -0
  180. package/dist/queue.d.ts.map +1 -0
  181. package/dist/queue.js +480 -0
  182. package/dist/reach.d.ts +15 -5
  183. package/dist/reach.d.ts.map +1 -1
  184. package/dist/reach.js +164 -33
  185. package/dist/react.d.ts +18 -2
  186. package/dist/react.d.ts.map +1 -1
  187. package/dist/react.js +33 -1
  188. package/dist/readiness.d.ts +16 -5
  189. package/dist/readiness.d.ts.map +1 -1
  190. package/dist/readiness.js +10 -10
  191. package/dist/reads.d.ts +6 -2
  192. package/dist/reads.d.ts.map +1 -1
  193. package/dist/reads.js +61 -11
  194. package/dist/recovery.d.ts +4 -1
  195. package/dist/recovery.d.ts.map +1 -1
  196. package/dist/recovery.js +31 -8
  197. package/dist/refresh.js +2 -2
  198. package/dist/refusal.d.ts +5 -0
  199. package/dist/refusal.d.ts.map +1 -0
  200. package/dist/refusal.js +55 -0
  201. package/dist/replica.d.ts +5 -13
  202. package/dist/replica.d.ts.map +1 -1
  203. package/dist/replica.js +17 -18
  204. package/dist/retried.d.ts +30 -0
  205. package/dist/retried.d.ts.map +1 -0
  206. package/dist/retried.js +72 -0
  207. package/dist/room-draft.d.ts +31 -8
  208. package/dist/room-draft.d.ts.map +1 -1
  209. package/dist/room-draft.js +273 -66
  210. package/dist/room-drafts.d.ts +24 -0
  211. package/dist/room-drafts.d.ts.map +1 -0
  212. package/dist/room-drafts.js +220 -0
  213. package/dist/room-list.d.ts +10 -0
  214. package/dist/room-list.d.ts.map +1 -0
  215. package/dist/room-list.js +45 -0
  216. package/dist/rows.d.ts +2 -1
  217. package/dist/rows.d.ts.map +1 -1
  218. package/dist/rows.js +9 -10
  219. package/dist/running.d.ts +5 -0
  220. package/dist/running.d.ts.map +1 -0
  221. package/dist/running.js +10 -0
  222. package/dist/runtime.d.ts +35 -0
  223. package/dist/runtime.d.ts.map +1 -0
  224. package/dist/runtime.js +1 -0
  225. package/dist/save.d.ts +42 -86
  226. package/dist/save.d.ts.map +1 -1
  227. package/dist/save.js +326 -225
  228. package/dist/saves.d.ts +34 -0
  229. package/dist/saves.d.ts.map +1 -0
  230. package/dist/saves.js +437 -0
  231. package/dist/seed.d.ts +11 -2
  232. package/dist/seed.d.ts.map +1 -1
  233. package/dist/seed.js +71 -1
  234. package/dist/shared.d.ts +1 -6
  235. package/dist/shared.d.ts.map +1 -1
  236. package/dist/shared.js +13 -95
  237. package/dist/shown.d.ts +35 -0
  238. package/dist/shown.d.ts.map +1 -0
  239. package/dist/shown.js +326 -0
  240. package/dist/socket/admission.d.ts +7 -0
  241. package/dist/socket/admission.d.ts.map +1 -0
  242. package/dist/socket/admission.js +39 -0
  243. package/dist/socket/answers.d.ts +6 -0
  244. package/dist/socket/answers.d.ts.map +1 -0
  245. package/dist/socket/answers.js +20 -0
  246. package/dist/socket/lanes.d.ts +28 -0
  247. package/dist/socket/lanes.d.ts.map +1 -0
  248. package/dist/socket/lanes.js +103 -0
  249. package/dist/socket/reads.d.ts +10 -0
  250. package/dist/socket/reads.d.ts.map +1 -0
  251. package/dist/socket/reads.js +31 -0
  252. package/dist/socket/session.d.ts +41 -0
  253. package/dist/socket/session.d.ts.map +1 -0
  254. package/dist/socket/session.js +26 -0
  255. package/dist/socket.d.ts +68 -0
  256. package/dist/socket.d.ts.map +1 -0
  257. package/dist/socket.js +165 -0
  258. package/dist/source.d.ts +5 -7
  259. package/dist/source.d.ts.map +1 -1
  260. package/dist/source.js +18 -6
  261. package/dist/store/installs.d.ts +30 -0
  262. package/dist/store/installs.d.ts.map +1 -0
  263. package/dist/store/installs.js +40 -0
  264. package/dist/store/readiness.d.ts +11 -0
  265. package/dist/store/readiness.d.ts.map +1 -0
  266. package/dist/store/readiness.js +68 -0
  267. package/dist/store/records.d.ts +227 -0
  268. package/dist/store/records.d.ts.map +1 -0
  269. package/dist/store/records.js +468 -0
  270. package/dist/store/room-held.d.ts +8 -0
  271. package/dist/store/room-held.d.ts.map +1 -0
  272. package/dist/store/room-held.js +17 -0
  273. package/dist/store/rooms-shown.d.ts +8 -0
  274. package/dist/store/rooms-shown.d.ts.map +1 -0
  275. package/dist/store/rooms-shown.js +13 -0
  276. package/dist/store/space.d.ts +11 -0
  277. package/dist/store/space.d.ts.map +1 -0
  278. package/dist/store/space.js +41 -0
  279. package/dist/store/watchers.d.ts +17 -0
  280. package/dist/store/watchers.d.ts.map +1 -0
  281. package/dist/store/watchers.js +56 -0
  282. package/dist/store/writes.d.ts +24 -0
  283. package/dist/store/writes.d.ts.map +1 -0
  284. package/dist/store/writes.js +125 -0
  285. package/dist/store.d.ts +119 -204
  286. package/dist/store.d.ts.map +1 -1
  287. package/dist/store.js +170 -394
  288. package/dist/stored.d.ts +26 -14
  289. package/dist/stored.d.ts.map +1 -1
  290. package/dist/stored.js +101 -36
  291. package/dist/surface.d.ts +94 -0
  292. package/dist/surface.d.ts.map +1 -0
  293. package/dist/surface.js +255 -0
  294. package/dist/sync.d.ts +21 -0
  295. package/dist/sync.d.ts.map +1 -0
  296. package/dist/sync.js +557 -0
  297. package/dist/tables.d.ts +28 -59
  298. package/dist/tables.d.ts.map +1 -1
  299. package/dist/tables.js +106 -331
  300. package/dist/tallies.d.ts.map +1 -1
  301. package/dist/tallies.js +6 -7
  302. package/dist/validation.d.ts.map +1 -1
  303. package/dist/validation.js +4 -10
  304. package/dist/wire.d.ts +68 -8
  305. package/dist/wire.d.ts.map +1 -1
  306. package/dist/wire.js +26 -9
  307. package/package.json +3 -2
  308. package/dist/attempt.d.ts +0 -16
  309. package/dist/attempt.d.ts.map +0 -1
  310. package/dist/attempt.js +0 -70
  311. package/dist/job.d.ts +0 -33
  312. package/dist/job.d.ts.map +0 -1
  313. package/dist/job.js +0 -54
  314. package/dist/log.d.ts +0 -5
  315. package/dist/log.d.ts.map +0 -1
  316. package/dist/log.js +0 -14
@@ -1,26 +1,27 @@
1
- import { parse, VERSION } from '@agentshouse/mdmodel';
1
+ import { definitionAt, parse, VERSION, } from '@agentshouse/mdmodel';
2
2
  import { beneath, normalize } from './paths.js';
3
3
  import { hashed } from './observation.js';
4
4
  import { sortedKeys } from './shared.js';
5
5
  export const MD_MODEL = { identity: '@agentshouse/mdmodel', version: VERSION };
6
6
  const typesPrinted = new WeakMap();
7
- function typesPrint(model) {
8
- if (model.status === 'unavailable')
9
- return '';
10
- let print = typesPrinted.get(model.types);
7
+ export function typesPrint(types) {
8
+ let print = typesPrinted.get(types);
11
9
  if (print === undefined) {
12
- print = hashed(JSON.stringify(model.types)).toString(36);
13
- typesPrinted.set(model.types, print);
10
+ print = hashed(JSON.stringify(types)).toString(36);
11
+ typesPrinted.set(types, print);
14
12
  }
15
13
  return print;
16
14
  }
15
+ function modelPrint(model) {
16
+ return model.status === 'unavailable' ? '' : typesPrint(model.types);
17
+ }
17
18
  export function composedOf(composition) {
18
19
  const { model, selection } = composition;
19
20
  return {
20
21
  composition,
21
22
  fingerprint: JSON.stringify([
22
- typesPrint(model),
23
- selection === null ? null : [selection.roots, typesPrint(selection.model)],
23
+ modelPrint(model),
24
+ selection === null ? null : [selection.roots, modelPrint(selection.model)],
24
25
  ]),
25
26
  };
26
27
  }
@@ -33,6 +34,16 @@ export function governing(composition, path) {
33
34
  ? composition.selection.model
34
35
  : composition.model;
35
36
  }
37
+ function definitionsUnder(composition, path, typedPaths, typesOf) {
38
+ const types = typesOf(governing(composition, path));
39
+ return types === null ? () => undefined : definitionAt({ types }, path, typedPaths);
40
+ }
41
+ export function definitionsAt(composition, path) {
42
+ return definitionsUnder(composition, path, composition.typedPaths, (model) => model.status === 'unavailable' ? null : model.types);
43
+ }
44
+ export function definitionsIn(room, path, typedPaths) {
45
+ return definitionsUnder({ model: room.model, selection: room.typedSelection }, path, typedPaths, ({ types }) => types === null ? null : Object.fromEntries(types.map((type) => [type.name, type])));
46
+ }
36
47
  export function collectionOf(text, composition) {
37
48
  const parsed = new Map();
38
49
  return {
@@ -44,7 +55,7 @@ export function collectionOf(text, composition) {
44
55
  const content = text[path];
45
56
  if (content === undefined)
46
57
  return undefined;
47
- const read = parse(content, path);
58
+ const read = parse(content, path, definitionsAt(composition, path));
48
59
  parsed.set(path, read.ok ? read.document : null);
49
60
  return read.ok ? read.document : undefined;
50
61
  },
@@ -63,6 +74,13 @@ export function* documentsOf(collection) {
63
74
  export function validRoot(root) {
64
75
  return typeof root === 'string' && normalize(root) === root;
65
76
  }
77
+ export const UNTYPED = 'any';
78
+ export function textType(read) {
79
+ return read.ok ? (read.document.type ?? UNTYPED) : undefined;
80
+ }
81
+ export function typedText(read) {
82
+ return (textType(read) ?? UNTYPED) !== UNTYPED;
83
+ }
66
84
  export function available(composition) {
67
85
  return composition.model.status !== 'unavailable';
68
86
  }
@@ -0,0 +1,5 @@
1
+ import type { Row, Value } from './tables.js';
2
+ export declare function text(value: Value | undefined): string;
3
+ export declare function texts(rows: readonly Row[], column: string): string[];
4
+ export declare function count(value: Value | undefined): number;
5
+ //# sourceMappingURL=column.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../src/column.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAErD;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAEtD"}
package/dist/column.js ADDED
@@ -0,0 +1,9 @@
1
+ export function text(value) {
2
+ return typeof value === 'string' ? value : String(value);
3
+ }
4
+ export function texts(rows, column) {
5
+ return rows.map((row) => text(row[column]));
6
+ }
7
+ export function count(value) {
8
+ return typeof value === 'bigint' ? Number(value) : typeof value === 'number' ? value : 0;
9
+ }
package/dist/compile.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { sql } from '@agentshouse/mdmodel';
2
+ import { type Composition } from './collection.js';
2
3
  import type { Plan, QueryRows } from './query.js';
3
4
  import type { Connection } from './tables.js';
4
5
  export type QueryRoom = {
5
6
  readonly locator: string;
6
7
  readonly key: number;
8
+ readonly composition?: Composition;
7
9
  };
8
10
  type Fragment = sql.Fragment;
9
11
  export declare const VISIBLE: (alias: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources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AC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAI7B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAAyD,CAAC;AAalG,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAM5D;AA2dD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA4ZjE,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,WAAW,CAUb"}
package/dist/compile.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { ARRAY_INDEX, bodied, byCodePoint, compared, cursorOf, heldKind, parse, pointerSegments, sql, } from '@agentshouse/mdmodel';
2
2
  import { binaryRecord } from './binary.js';
3
+ import { definitionsAt, UNTYPED } from './collection.js';
3
4
  import { documentKey, pathOfKey, roomOfKey } from './rows.js';
4
5
  import { FROM_START, MAXIMUM_WINDOW } from './windows.js';
5
6
  const { all, any, exists, fragment, grouped, joined, listed } = sql;
6
- export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1 AND ${alias}.queried = 1`;
7
+ export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1`;
7
8
  function located(alias) {
8
9
  return fragment(`(SELECT k.locator FROM replica_keys k WHERE k.key = ${alias}.key)`);
9
10
  }
@@ -310,11 +311,20 @@ function sectionsOf(sections, names) {
310
311
  return sections;
311
312
  return Object.fromEntries(names.flatMap((name) => (Object.hasOwn(sections, name) ? [[name, sections[name]]] : [])));
312
313
  }
313
- function documentOf(shape, room, row, linked) {
314
+ function freeParts(room, path, type, content) {
315
+ const definitions = room.composition === undefined ? undefined : definitionsAt(room.composition, path);
316
+ const definition = definitions?.(type === UNTYPED ? undefined : type);
317
+ if (definition === undefined && type !== UNTYPED)
318
+ return null;
319
+ const read = parse(content, path, definition);
320
+ return read.ok ? read.document : null;
321
+ }
322
+ function documentOf(shape, queried, row, linked) {
323
+ const room = queried.locator;
314
324
  const path = row.path;
315
325
  const type = row.type;
316
- const fileId = row.file_id ?? null;
317
- const revision = row.revision ?? null;
326
+ const fileId = row.file_id;
327
+ const revision = row.revision;
318
328
  if (type === null) {
319
329
  const binary = row.binary === null ? null : JSON.parse(row.binary);
320
330
  const content = row.content ?? null;
@@ -333,8 +343,9 @@ function documentOf(shape, room, row, linked) {
333
343
  ...heldFacts(shape, row),
334
344
  };
335
345
  }
336
- const read = bodied(shape) ? parse(row.content, path) : null;
337
- const body = read?.ok === true ? read.document : null;
346
+ const body = shape.sections !== null || shape.preamble
347
+ ? freeParts(queried, path, type, row.content)
348
+ : null;
338
349
  const fields = JSON.parse(row.fields ?? '{}');
339
350
  return {
340
351
  room,
@@ -365,7 +376,7 @@ function changeOf(row) {
365
376
  function heldFacts(shape, row) {
366
377
  return {
367
378
  ...(shape.size ? { size: row.bytes === null ? null : Number(row.bytes) } : {}),
368
- ...(shape.created ? { created: row.created ?? null } : {}),
379
+ ...(shape.created ? { created: row.created } : {}),
369
380
  };
370
381
  }
371
382
  function backlinksOf(connection, bound, rows) {
@@ -377,8 +388,8 @@ function backlinksOf(connection, bound, rows) {
377
388
  held.push(row.path);
378
389
  byKey.set(key, held);
379
390
  }
391
+ const reach = reached(bound, 's');
380
392
  for (const [key, targets] of byKey) {
381
- const reach = reached(bound, 's');
382
393
  const room = bound.rooms.find((one) => one.key === key).locator;
383
394
  const found = connection.rows(`SELECT target, path, type, field FROM (SELECT l.target, s.path, s.type, l.field, ROW_NUMBER() OVER (PARTITION BY l.target ORDER BY s.path, l.field) AS rank FROM (SELECT DISTINCT doc, target, field FROM replica_links WHERE key = ? AND kind = 'field' AND target IN (SELECT value FROM json_each(?))) l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE ${reach.sql}) WHERE rank <= ? ORDER BY target, path, field`, [key, JSON.stringify(targets), ...reach.bind, MAXIMUM_WINDOW]);
384
395
  for (const row of found) {
@@ -395,22 +406,19 @@ function documents(connection, bound, plan, shape, budget) {
395
406
  const filter = filtered(bound, plan);
396
407
  const cursor = plan.after?.values ?? null;
397
408
  const room = located('d');
398
- const tie = cursor === null
409
+ const after = cursor === null
399
410
  ? null
400
411
  : (() => {
401
412
  const key = cursor[shape.orderBy.length];
402
- return any([
413
+ return sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), any([
403
414
  fragment(`${room.sql} > ?`, [...room.bind, roomOfKey(key)]),
404
415
  fragment(`${room.sql} = ? AND d.path > ?`, [
405
416
  ...room.bind,
406
417
  roomOfKey(key),
407
418
  pathOfKey(key),
408
419
  ]),
409
- ]);
420
+ ]));
410
421
  })();
411
- const after = cursor === null || tie === null
412
- ? null
413
- : sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), tie);
414
422
  const selected = joined([
415
423
  fragment('SELECT d.id, d.key, d.path, d.type, d.binary, d.revision, d.fields, d.change, d.file_id, d.bytes, d.created'),
416
424
  ...terms.map(({ term }, index) => joined([
@@ -431,8 +439,9 @@ function documents(connection, bound, plan, shape, budget) {
431
439
  const kept = bodied(shape) ? withContent(connection, windowed, budget) : windowed;
432
440
  const cut = kept.length;
433
441
  const roomOf = new Map(bound.rooms.map(({ key, locator }) => [key, locator]));
442
+ const queried = new Map(bound.rooms.map((one) => [one.key, one]));
434
443
  const linked = shape.backlinks ? backlinksOf(connection, bound, kept) : new Map();
435
- const found = kept.map((row) => documentOf(shape, roomOf.get(Number(row.key)), row, linked));
444
+ const found = kept.map((row) => documentOf(shape, queried.get(Number(row.key)), row, linked));
436
445
  const last = kept.at(-1);
437
446
  const cursorAt = (row) => cursorOf([
438
447
  ...shape.orderBy.map(({ key }, index) => decodedKey(key, row, index)),
@@ -645,17 +654,14 @@ function groups(connection, bound, plan, shape) {
645
654
  { ordering: GROUP_TIES, kind: fragment("'string'"), value: fragment(`k${index}`) },
646
655
  ]);
647
656
  const cursor = plan.after?.values ?? null;
648
- const tieValues = cursor === null
657
+ const after = cursor === null
649
658
  ? null
650
- : cursor[shape.orderBy.length].flatMap((value) => [
651
- value,
652
- heldKind(value ?? null),
653
- ]);
654
- const after = cursor === null || tieValues === null
655
- ? null
656
- : sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
657
- .slice(0, -1)
658
- .map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
659
+ : (() => {
660
+ const tieValues = cursor[shape.orderBy.length].flatMap((value) => [value, heldKind(value ?? null)]);
661
+ return sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
662
+ .slice(0, -1)
663
+ .map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
664
+ })();
659
665
  const grouping = joined([fragment(`SELECT ${columns} FROM (`), ranked, fragment(`) GROUP BY ${held}`)], '');
660
666
  const windowed = joined([
661
667
  fragment('SELECT * FROM ('),
@@ -1,55 +1,8 @@
1
- import { type DocumentQuery, type GroupQuery } from '@agentshouse/mdmodel';
2
- import { type TypesResult } from './model.js';
3
- import { type Observation } from './observation.js';
4
- import { type DocumentResult, type GroupResult, type PendingResult } from './query.js';
5
- import { type FiguresResult } from './figures.js';
6
- import { type EntrySeed } from './seed.js';
7
- import { type SearchRequest, type SearchResult } from './search.js';
8
- import { type Adapter, type Authorization, type Member, type ProviderRefusal, type ServiceMode } from './adapter.js';
9
- import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
10
- import { type WrittenBy } from './change.js';
11
- import type { Open } from './open.js';
12
- import { type AttachAnswer, type BinaryLinkAnswer, type CallResult, type HeldBinaryAnswer, type HeldShownAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
13
- import { type ObservedRead } from './reads.js';
1
+ import type { Adapter, Authorization } from './adapter.js';
2
+ import { type RuntimeShell } from './durability.js';
14
3
  import { type Recovery } from './recovery.js';
15
- import { type SaveRefusal } from './save.js';
16
- import { type RoomDraft, type RoomDraftParts, type RoomDraftWrite } from './room-draft.js';
17
- import { type SyncStatus } from './status.js';
18
- import { type RuntimeShell, type UnsentWork } from './durability.js';
19
- import { type CodeAvailability, type Persistence, type Readiness } from './readiness.js';
20
- import type { RuntimeDatabase } from './tables.js';
21
- import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
22
- export type AppTypedSelection = {
23
- roots: readonly string[];
24
- model: TypesResult;
25
- };
26
- export type AppRoom = {
27
- name: string;
28
- locator: string;
29
- handle: string;
30
- operations: import('./adapter.js').OperationScopes;
31
- replica: import('./adapter.js').ReplicaAdmission;
32
- model: TypesResult;
33
- typedSelection: AppTypedSelection | null;
34
- providerOwnedPaths: readonly string[];
35
- roomVersion: string | null;
36
- documents: number;
37
- synchronizationAvailable: boolean;
38
- refusal: ProviderRefusal | null;
39
- locked: boolean;
40
- };
41
- export type RoomSchemas = {
42
- collection: TypesResult;
43
- typedSelection: TypesResult | null;
44
- };
45
- type RefusalReason = 'missing-required-guarantee' | 'revoked-authorization';
46
- export type ConnectionRefusalCode = Open<RefusalReason>;
47
- export type ConnectionRefusal = {
48
- code: ConnectionRefusalCode;
49
- retryable: boolean;
50
- reauthorizationOffered: boolean;
51
- refusal: ProviderRefusal | null;
52
- };
4
+ import { type RuntimeDatabase } from './store.js';
5
+ import { type ComposedRuntime } from './surface.js';
53
6
  export type MdRuntimeOptions = {
54
7
  adapter: Adapter;
55
8
  shell: RuntimeShell;
@@ -57,105 +10,8 @@ export type MdRuntimeOptions = {
57
10
  authorization?: Authorization;
58
11
  signal?: AbortSignal;
59
12
  recovery?: Recovery;
60
- usableWhenHeld?: readonly string[];
61
13
  build?: string;
62
- };
63
- export type SaveResult = {
64
- outcome: 'saved';
65
- identifier: string;
66
- } | ({
67
- outcome: 'refused';
68
- } & SaveRefusal);
69
- export type SavedRoomDraft = {
70
- readonly path: string;
71
- readonly revision: string;
72
- };
73
- export type SavedParts = {
74
- readonly path: string;
75
- readonly parts: RoomDraftParts;
76
- };
77
- export type RoomDraftSurface = {
78
- list(): Promise<readonly RoomDraft[]>;
79
- read(room: string, path: string): Promise<RoomDraft | null>;
80
- write(room: string, path: string, revision: string | null, parts: unknown, next?: string): Promise<RoomDraftWrite>;
81
- discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
82
- };
83
- export type PresentationSurface = {
84
- read(app: string): Promise<unknown>;
85
- write(app: string, value: unknown): Promise<void>;
86
- edit(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
87
- };
88
- export type BinaryFileSurface = {
89
- read(room: string, path: string, revision?: string): Promise<HeldBinaryAnswer>;
90
- link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
91
- show(room: string, path: string, revision?: string): Promise<HeldShownAnswer>;
92
- attach(room: string, file: File): Promise<AttachAnswer>;
93
- part(file: string, part: number): Promise<Uint8Array | null>;
94
- };
95
- export type HistoryQuery = {
96
- revision?: string;
97
- pageToken?: string;
98
- };
99
- export type MdRuntime = {
100
- loaded(): Promise<void>;
101
- rooms(): Promise<readonly AppRoom[]>;
102
- query: {
103
- (query: DocumentQuery): Promise<DocumentResult | PendingResult>;
104
- (query: GroupQuery): Promise<GroupResult | PendingResult>;
105
- };
106
- search(request: SearchRequest): Promise<SearchResult>;
107
- types(locator: string): Promise<RoomSchemas>;
108
- roomDraft: RoomDraftSurface;
109
- conversation: ConversationSurface;
110
- chatDraft: ChatDraftSurface;
111
- presentation: PresentationSurface;
112
- save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
113
- saveParts(room: string, parts: readonly SavedParts[], writtenBy?: WrittenBy): Promise<SaveResult>;
114
- history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
115
- resolve(room: string, path: string, destination: string): Promise<Resolution>;
116
- binaryFile: BinaryFileSurface;
117
- call(name: string, input: unknown): Promise<CallResult>;
118
- reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
119
- log(): string;
120
- persistence(): boolean;
121
- retry(): Promise<void>;
122
- cleanUp(): Promise<number>;
123
- unsent(): Promise<readonly UnsentWork[]>;
124
- reset(): Promise<void>;
125
- readAgain(): Promise<void>;
126
- observe: {
127
- (topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
128
- (topic: 'readiness'): Promise<Observation<Readiness>>;
129
- (topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;
130
- (topic: 'storage-loss'): Promise<Observation<string | null>>;
131
- (topic: 'sync-status'): Promise<Observation<SyncStatus>>;
132
- (topic: 'service-mode'): Promise<Observation<ServiceMode>>;
133
- (topic: 'member'): Promise<Observation<Member | null>>;
134
- (topic: 'authority-changes'): Promise<Observation<number>>;
135
- (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
136
- (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
137
- (topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
138
- (topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
139
- (topic: 'presentation', app: string): Promise<Observation<unknown>>;
140
- (topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
141
- (topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
142
- (topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
143
- (topic: 'figures'): Promise<Observation<FiguresResult>>;
144
- (topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
145
- };
146
- reauthorize(): Promise<void>;
147
- };
148
- export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'figures' | 'read';
149
- export type ReadinessPort = {
150
- readonly target: string;
151
- readonly code: CodeAvailability;
152
- };
153
- export type ComposedRuntime = RuntimeView & {
154
- seed(entry: EntrySeed): void;
155
- stop(): Promise<void>;
156
- persisted(answer: Persistence): void;
157
- within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
14
+ storeOnNeed?: boolean;
158
15
  };
159
16
  export declare function composeRuntime(options: MdRuntimeOptions): ComposedRuntime;
160
- export {};
161
17
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoB,KAAK,WAAW,EAAqB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EAMnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAiD,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,EAAgB,KAAK,SAAS,EAAe,MAAM,WAAW,CAAC;AAEtE,OAAO,EAAgB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAEL,KAAK,OAAO,EAIZ,KAAK,aAAa,EAMlB,KAAK,MAAM,EAYX,KAAK,eAAe,EAGpB,KAAK,WAAW,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,M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