@agentshouse/mdruntime 0.1.0-c3fa75348e547 → 0.1.0-c3faae279d4d2

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 (368) hide show
  1. package/README.md +19 -16
  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 +150 -81
  9. package/dist/adapter.d.ts.map +1 -1
  10. package/dist/attached-model.d.ts +7 -10
  11. package/dist/attached-model.d.ts.map +1 -1
  12. package/dist/attached-model.js +40 -41
  13. package/dist/binary.d.ts +0 -5
  14. package/dist/binary.d.ts.map +1 -1
  15. package/dist/binary.js +1 -1
  16. package/dist/bootstrap.d.ts +30 -11
  17. package/dist/bootstrap.d.ts.map +1 -1
  18. package/dist/bootstrap.js +320 -111
  19. package/dist/cell.d.ts +6 -0
  20. package/dist/cell.d.ts.map +1 -0
  21. package/dist/cell.js +9 -0
  22. package/dist/chain.d.ts +12 -0
  23. package/dist/chain.d.ts.map +1 -0
  24. package/dist/chain.js +64 -0
  25. package/dist/change-set.d.ts +9 -16
  26. package/dist/change-set.d.ts.map +1 -1
  27. package/dist/change-set.js +11 -89
  28. package/dist/change.d.ts +32 -1
  29. package/dist/change.d.ts.map +1 -1
  30. package/dist/change.js +14 -3
  31. package/dist/chat-types.d.ts +5 -0
  32. package/dist/chat-types.d.ts.map +1 -0
  33. package/dist/chat-types.js +13 -0
  34. package/dist/client.d.ts +33 -10
  35. package/dist/client.d.ts.map +1 -1
  36. package/dist/client.js +90 -10
  37. package/dist/collection.d.ts +11 -21
  38. package/dist/collection.d.ts.map +1 -1
  39. package/dist/collection.js +39 -291
  40. package/dist/compile.d.ts +16 -0
  41. package/dist/compile.d.ts.map +1 -0
  42. package/dist/compile.js +711 -0
  43. package/dist/connection.d.ts +7 -132
  44. package/dist/connection.d.ts.map +1 -1
  45. package/dist/connection.js +100 -3568
  46. package/dist/context.d.ts +2 -0
  47. package/dist/context.d.ts.map +1 -0
  48. package/dist/{chat/context.js → context.js} +1 -4
  49. package/dist/conversation-live.d.ts +136 -0
  50. package/dist/conversation-live.d.ts.map +1 -0
  51. package/dist/conversation-live.js +248 -0
  52. package/dist/conversation-row.d.ts +33 -0
  53. package/dist/conversation-row.d.ts.map +1 -0
  54. package/dist/conversation-row.js +53 -0
  55. package/dist/conversation.d.ts +53 -44
  56. package/dist/conversation.d.ts.map +1 -1
  57. package/dist/conversation.js +938 -715
  58. package/dist/digest.d.ts +7 -0
  59. package/dist/digest.d.ts.map +1 -0
  60. package/dist/digest.js +113 -0
  61. package/dist/discovery.d.ts +10 -0
  62. package/dist/discovery.d.ts.map +1 -0
  63. package/dist/discovery.js +175 -0
  64. package/dist/durability.d.ts +16 -4
  65. package/dist/durability.d.ts.map +1 -1
  66. package/dist/durability.js +5 -0
  67. package/dist/entry.d.ts +5 -2
  68. package/dist/entry.d.ts.map +1 -1
  69. package/dist/entry.js +33 -28
  70. package/dist/figures.d.ts +49 -0
  71. package/dist/figures.d.ts.map +1 -0
  72. package/dist/figures.js +197 -0
  73. package/dist/file.d.ts +2 -19
  74. package/dist/file.d.ts.map +1 -1
  75. package/dist/file.js +7 -122
  76. package/dist/holdings.d.ts +29 -0
  77. package/dist/holdings.d.ts.map +1 -0
  78. package/dist/holdings.js +95 -0
  79. package/dist/host.d.ts +4 -10
  80. package/dist/host.d.ts.map +1 -1
  81. package/dist/host.js +74 -41
  82. package/dist/identity.d.ts +0 -2
  83. package/dist/identity.d.ts.map +1 -1
  84. package/dist/identity.js +0 -6
  85. package/dist/index.d.ts +33 -13
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +12 -2
  88. package/dist/install.d.ts +56 -0
  89. package/dist/install.d.ts.map +1 -0
  90. package/dist/install.js +554 -0
  91. package/dist/job.d.ts +33 -0
  92. package/dist/job.d.ts.map +1 -0
  93. package/dist/job.js +54 -0
  94. package/dist/lifecycle.d.ts +7 -0
  95. package/dist/lifecycle.d.ts.map +1 -0
  96. package/dist/lifecycle.js +268 -0
  97. package/dist/listing.d.ts +53 -0
  98. package/dist/listing.d.ts.map +1 -0
  99. package/dist/listing.js +176 -0
  100. package/dist/live.d.ts +23 -0
  101. package/dist/live.d.ts.map +1 -0
  102. package/dist/live.js +163 -0
  103. package/dist/locks.d.ts +9 -0
  104. package/dist/locks.d.ts.map +1 -0
  105. package/dist/locks.js +61 -0
  106. package/dist/log.d.ts +1 -0
  107. package/dist/log.d.ts.map +1 -1
  108. package/dist/lost.d.ts +5 -0
  109. package/dist/lost.d.ts.map +1 -0
  110. package/dist/lost.js +61 -0
  111. package/dist/media.d.ts +8 -0
  112. package/dist/media.d.ts.map +1 -0
  113. package/dist/media.js +218 -0
  114. package/dist/memory.d.ts +14 -7
  115. package/dist/memory.d.ts.map +1 -1
  116. package/dist/memory.js +241 -107
  117. package/dist/messages.d.ts +52 -0
  118. package/dist/messages.d.ts.map +1 -0
  119. package/dist/messages.js +162 -0
  120. package/dist/model.d.ts +8 -10
  121. package/dist/model.d.ts.map +1 -1
  122. package/dist/model.js +6 -18
  123. package/dist/models.d.ts +14 -0
  124. package/dist/models.d.ts.map +1 -0
  125. package/dist/models.js +195 -0
  126. package/dist/name.d.ts +4 -0
  127. package/dist/name.d.ts.map +1 -0
  128. package/dist/name.js +122 -0
  129. package/dist/observation.d.ts +17 -2
  130. package/dist/observation.d.ts.map +1 -1
  131. package/dist/observation.js +107 -17
  132. package/dist/opened.d.ts +22 -0
  133. package/dist/opened.d.ts.map +1 -0
  134. package/dist/opened.js +107 -0
  135. package/dist/opening.d.ts +4 -0
  136. package/dist/opening.d.ts.map +1 -0
  137. package/dist/opening.js +57 -0
  138. package/dist/outcome.d.ts +49 -8
  139. package/dist/outcome.d.ts.map +1 -1
  140. package/dist/outcome.js +42 -0
  141. package/dist/overlay.d.ts +3 -5
  142. package/dist/overlay.d.ts.map +1 -1
  143. package/dist/overlay.js +98 -172
  144. package/dist/{chat/parts.d.ts → parts.d.ts} +12 -9
  145. package/dist/parts.d.ts.map +1 -0
  146. package/dist/{chat/parts.js → parts.js} +53 -46
  147. package/dist/paths.d.ts +2 -0
  148. package/dist/paths.d.ts.map +1 -1
  149. package/dist/paths.js +26 -0
  150. package/dist/preparation.d.ts +20 -0
  151. package/dist/preparation.d.ts.map +1 -0
  152. package/dist/preparation.js +226 -0
  153. package/dist/queries.d.ts +16 -0
  154. package/dist/queries.d.ts.map +1 -0
  155. package/dist/queries.js +272 -0
  156. package/dist/query.d.ts +25 -191
  157. package/dist/query.d.ts.map +1 -1
  158. package/dist/query.js +3 -470
  159. package/dist/{chat/questions.d.ts → questions.d.ts} +5 -2
  160. package/dist/questions.d.ts.map +1 -0
  161. package/dist/{chat/questions.js → questions.js} +13 -2
  162. package/dist/reach.d.ts +20 -9
  163. package/dist/reach.d.ts.map +1 -1
  164. package/dist/reach.js +287 -99
  165. package/dist/react.d.ts +11 -4
  166. package/dist/react.d.ts.map +1 -1
  167. package/dist/react.js +2 -14
  168. package/dist/{chat/read.d.ts → read.d.ts} +2 -0
  169. package/dist/read.d.ts.map +1 -0
  170. package/dist/{chat/read.js → read.js} +4 -0
  171. package/dist/readiness.d.ts +13 -17
  172. package/dist/readiness.d.ts.map +1 -1
  173. package/dist/readiness.js +2 -8
  174. package/dist/reads.d.ts +36 -10
  175. package/dist/reads.d.ts.map +1 -1
  176. package/dist/reads.js +157 -84
  177. package/dist/recovery.d.ts +3 -2
  178. package/dist/recovery.d.ts.map +1 -1
  179. package/dist/recovery.js +43 -8
  180. package/dist/refresh.d.ts +18 -15
  181. package/dist/refresh.d.ts.map +1 -1
  182. package/dist/refresh.js +143 -58
  183. package/dist/refusal.d.ts +5 -0
  184. package/dist/refusal.d.ts.map +1 -0
  185. package/dist/refusal.js +55 -0
  186. package/dist/replica.d.ts +56 -33
  187. package/dist/replica.d.ts.map +1 -1
  188. package/dist/replica.js +332 -190
  189. package/dist/room-draft.d.ts +25 -8
  190. package/dist/room-draft.d.ts.map +1 -1
  191. package/dist/room-draft.js +161 -74
  192. package/dist/room-drafts.d.ts +24 -0
  193. package/dist/room-drafts.d.ts.map +1 -0
  194. package/dist/room-drafts.js +217 -0
  195. package/dist/rows.d.ts +31 -30
  196. package/dist/rows.d.ts.map +1 -1
  197. package/dist/rows.js +59 -118
  198. package/dist/runtime.d.ts +43 -0
  199. package/dist/runtime.d.ts.map +1 -0
  200. package/dist/runtime.js +1 -0
  201. package/dist/save.d.ts +57 -14
  202. package/dist/save.d.ts.map +1 -1
  203. package/dist/save.js +537 -192
  204. package/dist/saves.d.ts +70 -0
  205. package/dist/saves.d.ts.map +1 -0
  206. package/dist/saves.js +1005 -0
  207. package/dist/search.d.ts +12 -82
  208. package/dist/search.d.ts.map +1 -1
  209. package/dist/search.js +10 -207
  210. package/dist/seed.d.ts +11 -2
  211. package/dist/seed.d.ts.map +1 -1
  212. package/dist/seed.js +89 -5
  213. package/dist/shared.d.ts +6 -7
  214. package/dist/shared.d.ts.map +1 -1
  215. package/dist/shared.js +75 -104
  216. package/dist/shown.d.ts +31 -0
  217. package/dist/shown.d.ts.map +1 -0
  218. package/dist/shown.js +292 -0
  219. package/dist/socket/admission.d.ts +7 -0
  220. package/dist/socket/admission.d.ts.map +1 -0
  221. package/dist/socket/admission.js +39 -0
  222. package/dist/socket/answers.d.ts +6 -0
  223. package/dist/socket/answers.d.ts.map +1 -0
  224. package/dist/socket/answers.js +20 -0
  225. package/dist/socket/lanes.d.ts +20 -0
  226. package/dist/socket/lanes.d.ts.map +1 -0
  227. package/dist/socket/lanes.js +77 -0
  228. package/dist/socket/reads.d.ts +10 -0
  229. package/dist/socket/reads.d.ts.map +1 -0
  230. package/dist/socket/reads.js +31 -0
  231. package/dist/socket/rooms.d.ts +44 -0
  232. package/dist/socket/rooms.d.ts.map +1 -0
  233. package/dist/socket/rooms.js +90 -0
  234. package/dist/socket/session.d.ts +38 -0
  235. package/dist/socket/session.d.ts.map +1 -0
  236. package/dist/socket/session.js +23 -0
  237. package/dist/socket.d.ts +70 -0
  238. package/dist/socket.d.ts.map +1 -0
  239. package/dist/socket.js +175 -0
  240. package/dist/source.d.ts +61 -0
  241. package/dist/source.d.ts.map +1 -0
  242. package/dist/source.js +82 -0
  243. package/dist/status.d.ts +4 -5
  244. package/dist/status.d.ts.map +1 -1
  245. package/dist/status.js +3 -7
  246. package/dist/store/fences.d.ts +16 -0
  247. package/dist/store/fences.d.ts.map +1 -0
  248. package/dist/store/fences.js +26 -0
  249. package/dist/store/installs.d.ts +30 -0
  250. package/dist/store/installs.d.ts.map +1 -0
  251. package/dist/store/installs.js +34 -0
  252. package/dist/store/readiness.d.ts +10 -0
  253. package/dist/store/readiness.d.ts.map +1 -0
  254. package/dist/store/readiness.js +52 -0
  255. package/dist/store/records.d.ts +212 -0
  256. package/dist/store/records.d.ts.map +1 -0
  257. package/dist/store/records.js +431 -0
  258. package/dist/store/room-held.d.ts +8 -0
  259. package/dist/store/room-held.d.ts.map +1 -0
  260. package/dist/store/room-held.js +17 -0
  261. package/dist/store/space.d.ts +11 -0
  262. package/dist/store/space.d.ts.map +1 -0
  263. package/dist/store/space.js +41 -0
  264. package/dist/store/watchers.d.ts +17 -0
  265. package/dist/store/watchers.d.ts.map +1 -0
  266. package/dist/store/watchers.js +56 -0
  267. package/dist/store/writes.d.ts +24 -0
  268. package/dist/store/writes.d.ts.map +1 -0
  269. package/dist/store/writes.js +125 -0
  270. package/dist/store.d.ts +106 -158
  271. package/dist/store.d.ts.map +1 -1
  272. package/dist/store.js +136 -734
  273. package/dist/stored.d.ts +156 -0
  274. package/dist/stored.d.ts.map +1 -0
  275. package/dist/stored.js +649 -0
  276. package/dist/surface.d.ts +88 -0
  277. package/dist/surface.d.ts.map +1 -0
  278. package/dist/surface.js +223 -0
  279. package/dist/sync.d.ts +19 -0
  280. package/dist/sync.d.ts.map +1 -0
  281. package/dist/sync.js +532 -0
  282. package/dist/tables.d.ts +416 -0
  283. package/dist/tables.d.ts.map +1 -0
  284. package/dist/tables.js +740 -0
  285. package/dist/tallies.d.ts +18 -0
  286. package/dist/tallies.d.ts.map +1 -0
  287. package/dist/tallies.js +129 -0
  288. package/dist/transfer.d.ts +0 -5
  289. package/dist/transfer.d.ts.map +1 -1
  290. package/dist/turn.d.ts +5 -3
  291. package/dist/turn.d.ts.map +1 -1
  292. package/dist/turn.js +51 -21
  293. package/dist/validation.d.ts +29 -0
  294. package/dist/validation.d.ts.map +1 -0
  295. package/dist/validation.js +104 -0
  296. package/dist/windows.d.ts +11 -0
  297. package/dist/windows.d.ts.map +1 -0
  298. package/dist/windows.js +16 -0
  299. package/dist/wire.d.ts +50 -6
  300. package/dist/wire.d.ts.map +1 -1
  301. package/dist/wire.js +16 -2
  302. package/package.json +18 -19
  303. package/AGENTS.md +0 -299
  304. package/dist/acquisition.d.ts +0 -14
  305. package/dist/acquisition.d.ts.map +0 -1
  306. package/dist/acquisition.js +0 -24
  307. package/dist/chat/acts.d.ts +0 -33
  308. package/dist/chat/acts.d.ts.map +0 -1
  309. package/dist/chat/acts.js +0 -36
  310. package/dist/chat/context.d.ts +0 -3
  311. package/dist/chat/context.d.ts.map +0 -1
  312. package/dist/chat/input.d.ts +0 -9
  313. package/dist/chat/input.d.ts.map +0 -1
  314. package/dist/chat/input.js +0 -99
  315. package/dist/chat/kit.d.ts +0 -61
  316. package/dist/chat/kit.d.ts.map +0 -1
  317. package/dist/chat/kit.js +0 -123
  318. package/dist/chat/lasting.d.ts +0 -6
  319. package/dist/chat/lasting.d.ts.map +0 -1
  320. package/dist/chat/lasting.js +0 -19
  321. package/dist/chat/list.d.ts +0 -27
  322. package/dist/chat/list.d.ts.map +0 -1
  323. package/dist/chat/list.js +0 -63
  324. package/dist/chat/markdown.d.ts +0 -20
  325. package/dist/chat/markdown.d.ts.map +0 -1
  326. package/dist/chat/markdown.js +0 -188
  327. package/dist/chat/message.d.ts +0 -6
  328. package/dist/chat/message.d.ts.map +0 -1
  329. package/dist/chat/message.js +0 -192
  330. package/dist/chat/messages.d.ts +0 -22
  331. package/dist/chat/messages.d.ts.map +0 -1
  332. package/dist/chat/messages.js +0 -155
  333. package/dist/chat/name.d.ts +0 -6
  334. package/dist/chat/name.d.ts.map +0 -1
  335. package/dist/chat/name.js +0 -37
  336. package/dist/chat/opened.d.ts +0 -11
  337. package/dist/chat/opened.d.ts.map +0 -1
  338. package/dist/chat/opened.js +0 -17
  339. package/dist/chat/overlay.d.ts +0 -31
  340. package/dist/chat/overlay.d.ts.map +0 -1
  341. package/dist/chat/overlay.js +0 -97
  342. package/dist/chat/parts.d.ts.map +0 -1
  343. package/dist/chat/process.d.ts +0 -20
  344. package/dist/chat/process.d.ts.map +0 -1
  345. package/dist/chat/process.js +0 -32
  346. package/dist/chat/provider.d.ts +0 -63
  347. package/dist/chat/provider.d.ts.map +0 -1
  348. package/dist/chat/provider.js +0 -629
  349. package/dist/chat/question.d.ts +0 -9
  350. package/dist/chat/question.d.ts.map +0 -1
  351. package/dist/chat/question.js +0 -80
  352. package/dist/chat/questions.d.ts.map +0 -1
  353. package/dist/chat/read.d.ts.map +0 -1
  354. package/dist/chat/ready.d.ts +0 -34
  355. package/dist/chat/ready.d.ts.map +0 -1
  356. package/dist/chat/ready.js +0 -91
  357. package/dist/chat/style.d.ts +0 -4
  358. package/dist/chat/style.d.ts.map +0 -1
  359. package/dist/chat/style.js +0 -302
  360. package/dist/chat.d.ts +0 -14
  361. package/dist/chat.d.ts.map +0 -1
  362. package/dist/chat.js +0 -8
  363. package/dist/fence.d.ts +0 -6
  364. package/dist/fence.d.ts.map +0 -1
  365. package/dist/fence.js +0 -10
  366. package/dist/read-side.d.ts +0 -25
  367. package/dist/read-side.d.ts.map +0 -1
  368. package/dist/read-side.js +0 -642
@@ -0,0 +1,554 @@
1
+ import { attachedModel } from './attached-model.js';
2
+ import { bootstrapRoom } from './bootstrap.js';
3
+ import { refusedForSpace } from './durability.js';
4
+ import { name, usable } from './listing.js';
5
+ import { NO_MODEL } from './model.js';
6
+ import { advancement } from './refresh.js';
7
+ import { recoverReads, statusShown } from './shown.js';
8
+ import { NO_INSTALL, } from './store.js';
9
+ import { unconfirmed } from './transfer.js';
10
+ import { ROW_WEIGHT, yielded } from './turn.js';
11
+ // Bytes still arriving are reported at most this often, so readiness is not rebuilt for every chunk the network hands over while a slow link still moves the figure.
12
+ const ARRIVAL_REPORT_MS = 250;
13
+ const NOTHING_HELD = { bytes: 0 };
14
+ export const ERASE_BATCH = 512;
15
+ function transferGone(held) {
16
+ return {
17
+ ...held,
18
+ transfer: null,
19
+ arrived: null,
20
+ streaming: false,
21
+ underived: 0,
22
+ unindexed: [],
23
+ };
24
+ }
25
+ function amountOf(held, kept) {
26
+ if (held.transfer !== null) {
27
+ const owed = held.unindexed.reduce((sum, part) => sum + part.bytes, 0);
28
+ return {
29
+ done: held.transfer.done.bytes - Math.ceil(owed),
30
+ total: Math.max(held.arrived ?? 0, held.transfer.done.bytes),
31
+ };
32
+ }
33
+ return { done: kept, total: held.arrived ?? kept };
34
+ }
35
+ function setBack(held) {
36
+ const now = amountOf(held, NOTHING_HELD.bytes);
37
+ const earlier = held.startedOver;
38
+ return {
39
+ ...held,
40
+ startedOver: {
41
+ done: Math.max(now.done, earlier?.done ?? 0),
42
+ total: Math.max(now.total, earlier?.total ?? 0),
43
+ },
44
+ };
45
+ }
46
+ function owedIndexes(held, bytes, text) {
47
+ if (bytes <= 0 || text <= 0)
48
+ return held;
49
+ return { ...held, unindexed: [...held.unindexed, { bytes, text }] };
50
+ }
51
+ function built(held, done, text) {
52
+ const owed = [...held.unindexed];
53
+ let left = text;
54
+ while (!done && left > 0 && owed.length > 0) {
55
+ const [first] = owed;
56
+ if (left >= first.text) {
57
+ left -= first.text;
58
+ owed.shift();
59
+ continue;
60
+ }
61
+ owed[0] = {
62
+ bytes: (first.bytes * (first.text - left)) / first.text,
63
+ text: first.text - left,
64
+ };
65
+ left = 0;
66
+ }
67
+ return { ...held, unindexed: done ? [] : owed };
68
+ }
69
+ function batchEnd(entries, from, bytes) {
70
+ let end = from;
71
+ let spent = 0;
72
+ while (end < entries.length) {
73
+ const size = (entries[end].content?.length ?? 0) + ROW_WEIGHT;
74
+ if (spent + size > bytes && end > from)
75
+ break;
76
+ spent += size;
77
+ end += 1;
78
+ }
79
+ return end;
80
+ }
81
+ export function installationOf(store, coverage, held) {
82
+ const bytes = { done: 0, total: 0 };
83
+ let installing = 0;
84
+ let downloading = false;
85
+ for (const { room, state } of coverage) {
86
+ if (state === 'unadmitted')
87
+ continue;
88
+ const install = store.installs.of(room);
89
+ const underway = state === 'acquiring' || (install.installing && state !== 'complete');
90
+ if (underway)
91
+ installing += 1;
92
+ if (underway && (install.streaming || install.arrived === null))
93
+ downloading = true;
94
+ const kept = underway ? NOTHING_HELD.bytes : (held.get(room)?.bytes ?? NOTHING_HELD.bytes);
95
+ const now = amountOf(install, kept);
96
+ const earlier = underway ? install.startedOver : null;
97
+ bytes.done += Math.max(now.done, earlier?.done ?? 0);
98
+ bytes.total += Math.max(now.total, earlier?.total ?? 0);
99
+ }
100
+ const step = installing === 0
101
+ ? null
102
+ : downloading
103
+ ? 'downloading'
104
+ : bytes.done < bytes.total
105
+ ? 'writing'
106
+ : 'replaying';
107
+ return { step, bytes };
108
+ }
109
+ export function roomInFlight(store, locator) {
110
+ const { catching, transfer } = store.installs.of(locator);
111
+ return catching || transfer !== null;
112
+ }
113
+ function installing(runtime, locator) {
114
+ runtime.store.installs.change(locator, (held) => ({ ...held, installing: true }));
115
+ runtime.store.readiness.queue();
116
+ }
117
+ function installed(runtime, locator) {
118
+ if (!runtime.store.installs.of(locator).installing)
119
+ return;
120
+ runtime.store.installs.change(locator, (held) => ({ ...held, installing: false }));
121
+ runtime.store.readiness.queue();
122
+ }
123
+ export function sweep({ store, socket, journal }) {
124
+ if (store.device.now().sweeping || socket.closed())
125
+ return;
126
+ store.device.set({ sweeping: true });
127
+ void (async () => {
128
+ try {
129
+ while (!socket.closed() && (await store.durably((local) => local.erase(null, ERASE_BATCH)))) {
130
+ await yielded();
131
+ }
132
+ }
133
+ catch {
134
+ journal.record('erasure failed');
135
+ }
136
+ finally {
137
+ store.device.set({ sweeping: false });
138
+ }
139
+ })();
140
+ }
141
+ export function forgetInstall(store, locator) {
142
+ store.installs.change(locator, ({ installing }) => ({ ...NO_INSTALL, installing }));
143
+ }
144
+ export function caughtUpTo(runtime, locator) {
145
+ if (!runtime.store.installs.of(locator).catching)
146
+ return;
147
+ runtime.store.installs.change(locator, (held) => ({ ...held, catching: false }));
148
+ recoverReads(runtime);
149
+ }
150
+ export function catching(store, locator) {
151
+ store.installs.change(locator, (held) => ({ ...held, catching: true }));
152
+ }
153
+ export function confirmedAgain(store, locator) {
154
+ store.installs.change(locator, (held) => ({
155
+ ...held,
156
+ confirmations: held.confirmations + 1,
157
+ }));
158
+ }
159
+ export function standingAt(store, locator, held) {
160
+ return { key: held?.key ?? null, confirmed: store.installs.of(locator).confirmations };
161
+ }
162
+ function standsAt(store, locator, held, from) {
163
+ const now = standingAt(store, locator, held);
164
+ return now.key === from.key && now.confirmed === from.confirmed;
165
+ }
166
+ function shownAt({ store, socket }, locator, held) {
167
+ const raised = store.installs.of(locator).highest ?? undefined;
168
+ if (held === undefined || raised === undefined)
169
+ return held ?? raised;
170
+ return socket.reads.reached(locator, held, raised) ? held : raised;
171
+ }
172
+ export function showing(system, locator, roomVersion, held) {
173
+ const at = shownAt(system, locator, held);
174
+ if (at === undefined || !system.socket.reads.reached(locator, at, roomVersion)) {
175
+ system.store.installs.change(locator, (room) => ({ ...room, highest: roomVersion }));
176
+ }
177
+ }
178
+ export function olderThan(system, locator, roomVersion, held) {
179
+ const { store, socket } = system;
180
+ if (store.installs.of(locator).beyondHorizon)
181
+ return false;
182
+ const at = shownAt(system, locator, held);
183
+ return (at !== undefined &&
184
+ socket.reads.reached(locator, at, roomVersion) &&
185
+ !socket.reads.reached(locator, roomVersion, at));
186
+ }
187
+ async function older(runtime, locator, roomVersion) {
188
+ const { store } = runtime;
189
+ if (store.installs.of(locator).beyondHorizon)
190
+ return false;
191
+ return olderThan(runtime, locator, roomVersion, (await store.record(locator))?.roomVersion);
192
+ }
193
+ export function replaced(store, locators) {
194
+ for (const locator of locators) {
195
+ store.installs.change(locator, (held) => ({ ...held, highest: null, beyondHorizon: true }));
196
+ }
197
+ }
198
+ export async function reachedBy({ store, socket }, locator, roomVersion) {
199
+ const held = await store.record(locator);
200
+ return held !== undefined && socket.reads.reached(locator, held.roomVersion, roomVersion);
201
+ }
202
+ export async function behind({ store, socket }, room) {
203
+ const held = (await store.record(room.locator))?.roomVersion;
204
+ return held !== undefined && !socket.reads.reached(room.locator, held, room.roomVersion);
205
+ }
206
+ export async function writtenAfter({ store, socket }, locator, roomVersion, path) {
207
+ const held = await store.record(locator);
208
+ if (held === undefined)
209
+ return false;
210
+ const [entry] = await (await store.open()).entries(held.key, 'confirmed', [path]);
211
+ const written = entry?.written ?? undefined;
212
+ return (written !== undefined &&
213
+ socket.reads.reached(locator, written, roomVersion) &&
214
+ !socket.reads.reached(locator, roomVersion, written));
215
+ }
216
+ async function writtenLater(runtime, local, locator, key, paths, roomVersion, heldAt) {
217
+ if (paths.length === 0)
218
+ return new Set();
219
+ const { reached } = runtime.socket.reads;
220
+ const behindShown = heldAt === undefined
221
+ ? await older(runtime, locator, roomVersion)
222
+ : olderThan(runtime, locator, roomVersion, heldAt);
223
+ if (!behindShown)
224
+ return new Set();
225
+ const entries = await local.entries(key, 'confirmed', paths);
226
+ return new Set(entries.flatMap(({ path, written }) => written !== null &&
227
+ reached(locator, written, roomVersion) &&
228
+ !reached(locator, roomVersion, written)
229
+ ? [path]
230
+ : []));
231
+ }
232
+ function remodel(runtime, answers, held) {
233
+ const answer = answers?.collection;
234
+ if (answer === undefined)
235
+ return held;
236
+ return { collection: attachedModel(answer, runtime.roomTypes) };
237
+ }
238
+ function refreshingOf(runtime, local, locator, key, composition, liveness, replaying = false, heldAt) {
239
+ const { store } = runtime;
240
+ const write = replaying ? store.finishingWrite : store.exclusive;
241
+ return {
242
+ turn() {
243
+ if (replaying)
244
+ installing(runtime, locator);
245
+ },
246
+ prior: async (paths) => new Map((await local.entries(key, 'refreshed', paths)).map((entry) => [entry.path, entry])),
247
+ later: (paths, roomVersion) => writtenLater(runtime, local, locator, key, paths, roomVersion, heldAt),
248
+ async stage(page) {
249
+ for (let written = 0;;) {
250
+ const end = batchEnd(page.entries, written, store.stageBytes());
251
+ const last = end === page.entries.length;
252
+ const entries = page.entries.slice(written, end);
253
+ const staged = await write(async () => {
254
+ if (!liveness())
255
+ return false;
256
+ await store.refreshPage(local, key, composition, last
257
+ ? { ...page, entries }
258
+ : { entries, removals: [], folders: [], folderRemovals: [] });
259
+ return true;
260
+ });
261
+ if (!staged)
262
+ return false;
263
+ if (last)
264
+ return true;
265
+ written = end;
266
+ }
267
+ },
268
+ };
269
+ }
270
+ export async function pullRefresh(runtime, authorized, record, liveness, hold, refresh) {
271
+ if (!liveness())
272
+ return unconfirmed;
273
+ const { store, journal } = runtime;
274
+ const from = standingAt(store, record.locator, record);
275
+ const local = await store.open();
276
+ try {
277
+ await store.exclusive(() => local.unrefresh(record.key));
278
+ const result = await advancement(async (authorization, request) => {
279
+ hold.release();
280
+ try {
281
+ return await refresh(authorization, request);
282
+ }
283
+ finally {
284
+ hold.take();
285
+ }
286
+ }, authorized, record, (models, kept) => (liveness() ? remodel(runtime, models, kept) : kept), liveness, refreshingOf(runtime, local, record.locator, record.key, store.composed(record), liveness, false, record.roomVersion));
287
+ if (result.kind !== 'advanced') {
288
+ journal.record(`transfer refresh ${record.locator} ${result.kind}`);
289
+ return result;
290
+ }
291
+ journal.record(`transfer refresh ${record.locator} ${result.record.roomVersion}`);
292
+ return {
293
+ kind: 'advanced',
294
+ record: result.record,
295
+ from,
296
+ remodelled: result.record.model !== record.model,
297
+ };
298
+ }
299
+ catch (error) {
300
+ if (refusedForSpace(error))
301
+ return unconfirmed;
302
+ journal.record(`transfer refresh ${record.locator} transport-uncertainty`);
303
+ throw error;
304
+ }
305
+ }
306
+ async function abandoned(runtime, local, locator) {
307
+ await local.abandon(locator);
308
+ runtime.store.installs.change(locator, (held) => transferGone(setBack(held)));
309
+ recoverReads(runtime);
310
+ sweep(runtime);
311
+ }
312
+ function staging(runtime, local, liveness, unheld) {
313
+ const { store, socket } = runtime;
314
+ const derived = async (locator, key, composition) => {
315
+ store.installs.change(locator, (held) => ({ ...held, underived: 0 }));
316
+ for (;;) {
317
+ if (!liveness())
318
+ return false;
319
+ const done = await store.finishingWrite(async () => liveness() ? store.rederive(local, key, composition) : null);
320
+ if (done === null)
321
+ return false;
322
+ store.installs.change(locator, (held) => built(held, done.done, done.text));
323
+ runtime.store.readiness.queue();
324
+ if (done.done)
325
+ return true;
326
+ }
327
+ };
328
+ return {
329
+ held: (locator) => store.installs.of(locator).transfer,
330
+ async turn(locator, step) {
331
+ installing(runtime, locator);
332
+ return step === 'downloading' ? socket.heldStream() : () => { };
333
+ },
334
+ unqueued: socket.unqueued,
335
+ queued: socket.queued,
336
+ arriving(locator) {
337
+ let ended = false;
338
+ return {
339
+ at(bytes) {
340
+ if (ended)
341
+ return;
342
+ store.installs.change(locator, (held) => ({
343
+ ...held,
344
+ arrived: bytes,
345
+ streaming: true,
346
+ }));
347
+ if (!store.installs.arrivalDue(performance.now(), ARRIVAL_REPORT_MS))
348
+ return;
349
+ runtime.store.readiness.queue();
350
+ },
351
+ end() {
352
+ if (ended)
353
+ return;
354
+ ended = true;
355
+ if (!store.installs.of(locator).streaming)
356
+ return;
357
+ store.installs.change(locator, (held) => ({ ...held, streaming: false }));
358
+ runtime.store.readiness.queue();
359
+ },
360
+ };
361
+ },
362
+ streamed: socket.streamed,
363
+ async stage(record, page, composition) {
364
+ const { locator } = record;
365
+ installing(runtime, locator);
366
+ if (!liveness())
367
+ return null;
368
+ const key = await store.startingWrite(async () => {
369
+ if (!liveness())
370
+ return null;
371
+ return local.stage(record, composition, page);
372
+ });
373
+ if (key === null || !liveness())
374
+ return null;
375
+ const before = store.installs.of(locator);
376
+ const prior = before.transfer?.done.bytes ?? 0;
377
+ const held = { ...record, key };
378
+ const text = page.entries.reduce((sum, entry) => sum + (entry.content?.length ?? 0), 0);
379
+ const owed = text + before.underived;
380
+ store.installs.change(locator, (room) => ({
381
+ ...owedIndexes(room, record.done.bytes - prior, text),
382
+ transfer: held,
383
+ underived: owed,
384
+ }));
385
+ installing(runtime, locator);
386
+ recoverReads(runtime);
387
+ if (owed < store.deriveBytes())
388
+ return held;
389
+ return (await derived(locator, key, composition)) ? held : null;
390
+ },
391
+ async resume(record, parts, composition) {
392
+ const { locator } = record;
393
+ installing(runtime, locator);
394
+ if (!liveness())
395
+ return null;
396
+ const prior = unheld === undefined ? await store.record(locator) : undefined;
397
+ const published = prior !== undefined && prior.replica.selection === record.selection ? prior.key : null;
398
+ const kept = unheld?.staged ?? (await local.held()).staged.has(locator);
399
+ if (published === null && !kept)
400
+ return { record: null, staged: new Set() };
401
+ const resumed = await store.startingWrite(async () => {
402
+ if (!liveness())
403
+ return null;
404
+ return local.resume(record, composition, parts.map((part) => part.id), published);
405
+ });
406
+ if (resumed === null || !liveness())
407
+ return null;
408
+ const parted = new Set(resumed.staged);
409
+ if (resumed.key === null)
410
+ return { record: null, staged: parted };
411
+ const bytes = parts.reduce((sum, part) => sum + (parted.has(part.id) ? part.bytes : 0), 0);
412
+ const held = {
413
+ ...record,
414
+ transfer: resumed.transfer,
415
+ key: resumed.key,
416
+ done: { bytes },
417
+ };
418
+ store.installs.change(locator, (room) => ({ ...room, transfer: held }));
419
+ recoverReads(runtime);
420
+ return { record: held, staged: parted };
421
+ },
422
+ derive: derived,
423
+ async refreshing(locator, key, composition) {
424
+ await store.exclusive(() => local.unrefresh(key));
425
+ return refreshingOf(runtime, local, locator, key, composition, liveness, true);
426
+ },
427
+ abandon: (locator) => store.exclusive(async () => {
428
+ if (liveness())
429
+ await abandoned(runtime, local, locator);
430
+ }),
431
+ setAside: async (locator) => {
432
+ if (!liveness())
433
+ return;
434
+ store.installs.change(locator, (held) => transferGone(setBack(held)));
435
+ recoverReads(runtime);
436
+ },
437
+ release: (key) => store.exclusive(async () => {
438
+ await local.release(key);
439
+ sweep(runtime);
440
+ }),
441
+ };
442
+ }
443
+ export async function pullBootstrap(runtime, authorized, room, local, liveness, prior, from = runtime.socket.reads, unheld) {
444
+ if (!liveness())
445
+ return unconfirmed;
446
+ const { store, journal } = runtime;
447
+ if (prior !== undefined) {
448
+ catching(store, room.locator);
449
+ recoverReads(runtime);
450
+ }
451
+ try {
452
+ const result = await bootstrapRoom(from, authorized, room, {
453
+ collection: prior?.model ?? runtime.socket.rooms.standing(room.locator).unheldModel ?? NO_MODEL,
454
+ }, runtime.builtIn, runtime.typedPaths, (models, held) => (liveness() ? remodel(runtime, models, held) : held), liveness, staging(runtime, local, liveness, unheld));
455
+ const detail = result.kind === 'staged' ? result.record.roomVersion : result.kind;
456
+ journal.record(`transfer bootstrap ${room.locator} ${detail}`);
457
+ if (result.kind === 'staged' &&
458
+ (await older(runtime, room.locator, result.record.roomVersion))) {
459
+ caughtUpTo(runtime, room.locator);
460
+ installed(runtime, room.locator);
461
+ await abandoned(runtime, local, room.locator);
462
+ journal.record(`transfer bootstrap ${room.locator} older than shown`);
463
+ return { kind: 'transport-uncertainty' };
464
+ }
465
+ if (result.kind !== 'staged') {
466
+ caughtUpTo(runtime, room.locator);
467
+ installed(runtime, room.locator);
468
+ }
469
+ return result;
470
+ }
471
+ catch (error) {
472
+ caughtUpTo(runtime, room.locator);
473
+ installed(runtime, room.locator);
474
+ if (refusedForSpace(error))
475
+ return unconfirmed;
476
+ journal.record(`transfer bootstrap ${room.locator} transport-uncertainty`);
477
+ throw error;
478
+ }
479
+ }
480
+ export function publish(runtime, local, room, reached, landing, live) {
481
+ const { store } = runtime;
482
+ const landed = store.exclusive(async () => {
483
+ if (!live()) {
484
+ caughtUpTo(runtime, room.locator);
485
+ return true;
486
+ }
487
+ const work = await store.work(room.locator);
488
+ const prior = work.replica;
489
+ if (!standsAt(store, room.locator, prior?.record, landing.from)) {
490
+ if (landing.kind === 'refreshed') {
491
+ await local.unrefresh(reached.key);
492
+ return false;
493
+ }
494
+ caughtUpTo(runtime, room.locator);
495
+ await abandoned(runtime, local, room.locator);
496
+ return false;
497
+ }
498
+ const record = landing.kind === 'refreshed' && prior !== undefined
499
+ ? {
500
+ ...prior.record,
501
+ roomVersion: reached.roomVersion,
502
+ ...(landing.remodelled ? { model: reached.model } : {}),
503
+ }
504
+ : reached;
505
+ let set;
506
+ try {
507
+ set = await runtime.settle(local, room.locator, work, record, work.queue, landing.kind === 'refreshed'
508
+ ? {
509
+ room: true,
510
+ view: 'refreshed',
511
+ commit: { refreshed: true },
512
+ }
513
+ : {
514
+ room: true,
515
+ view: landing.refreshed ? 'refreshed' : 'confirmed',
516
+ commit: {
517
+ published: { from: prior?.record.key ?? null },
518
+ ...(landing.refreshed ? { refreshed: true } : {}),
519
+ },
520
+ });
521
+ }
522
+ catch (error) {
523
+ if (!refusedForSpace(error))
524
+ throw error;
525
+ caughtUpTo(runtime, room.locator);
526
+ return true;
527
+ }
528
+ if (landing.kind === 'bootstrapped') {
529
+ runtime.socket.rooms.readied(room.locator);
530
+ store.installs.change(room.locator, (held) => ({
531
+ ...transferGone(held),
532
+ highest: null,
533
+ beyondHorizon: false,
534
+ startedOver: null,
535
+ catching: false,
536
+ }));
537
+ runtime.socket.rooms.stand(room.locator, { unheldModel: null });
538
+ if (prior !== undefined && prior.record.key !== record.key)
539
+ sweep(runtime);
540
+ void name(runtime, room.locator);
541
+ }
542
+ usable(runtime, room);
543
+ void runtime.store.changed(set);
544
+ await runtime.unpair(local);
545
+ void statusShown(runtime);
546
+ if (landing.kind === 'bootstrapped' && work.queue.length > 0) {
547
+ runtime.submitLater(room.locator);
548
+ }
549
+ return true;
550
+ });
551
+ return landing.kind === 'refreshed'
552
+ ? landed
553
+ : landed.finally(() => installed(runtime, room.locator));
554
+ }
package/dist/job.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ type Job = {
2
+ readonly label: string;
3
+ readonly kind: 'started' | 'scheduled' | 'ended';
4
+ readonly state: string;
5
+ readonly next: string | null;
6
+ };
7
+ export type RunningJob = {
8
+ readonly name: string;
9
+ readonly running_since: string;
10
+ };
11
+ export type JobMarker = {
12
+ readonly said: string;
13
+ readonly at: string;
14
+ };
15
+ export type OpenJob<At = string | null> = {
16
+ readonly name: string;
17
+ readonly started: At;
18
+ };
19
+ export declare function jobOf(said: string): Job;
20
+ export declare function closeLast(open: {
21
+ readonly key: string;
22
+ }[], key: string): void;
23
+ export declare function markerMoved<Kept extends {
24
+ readonly key: string;
25
+ }>(open: Kept[], said: string, opened: (job: Job, key: string) => Kept | null): void;
26
+ export declare function openJobs<At>(markers: readonly {
27
+ readonly said: string;
28
+ readonly at: At;
29
+ }[]): readonly OpenJob<At>[];
30
+ export declare function jobsRunning(jobs: readonly RunningJob[], now: number): string[];
31
+ export declare function sessionEnded(jobs: readonly RunningJob[], now: number): string;
32
+ export {};
33
+ //# sourceMappingURL=job.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG;IACT,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,OAAO,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAA;CAAE,CAAC;AAQ1F,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CASvC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAG7E;AAED,wBAAgB,WAAW,CAAC,IAAI,SAAS;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAC/D,IAAI,EAAE,IAAI,EAAE,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,GAC7C,IAAI,CASN;AAED,wBAAgB,QAAQ,CAAC,EAAE,EACzB,OAAO,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAA;CAAE,EAAE,GAC7D,SAAS,OAAO,CAAC,EAAE,CAAC,EAAE,CAQxB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAM9E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7E"}
package/dist/job.js ADDED
@@ -0,0 +1,54 @@
1
+ const NEXT_RUN = 'next run ';
2
+ const MINUTE = 60_000;
3
+ const ENDED = 'Session ended.';
4
+ export function jobOf(said) {
5
+ const at = said.lastIndexOf(': ');
6
+ const label = at === -1 ? said : said.slice(0, at);
7
+ const state = at === -1 ? '' : said.slice(at + 2);
8
+ if (state === 'running')
9
+ return { label, kind: 'started', state, next: null };
10
+ if (state === 'scheduled')
11
+ return { label, kind: 'scheduled', state, next: null };
12
+ return state.startsWith(NEXT_RUN)
13
+ ? { label, kind: 'scheduled', state, next: state.slice(NEXT_RUN.length) }
14
+ : { label, kind: 'ended', state, next: null };
15
+ }
16
+ export function closeLast(open, key) {
17
+ const at = open.map((one) => one.key).lastIndexOf(key);
18
+ if (at !== -1)
19
+ open.splice(at, 1);
20
+ }
21
+ export function markerMoved(open, said, opened) {
22
+ const job = jobOf(said);
23
+ const started = `job\u0000${job.label}`;
24
+ const schedule = `schedule\u0000${job.label}`;
25
+ if (job.kind === 'ended')
26
+ closeLast(open, started);
27
+ if (job.kind !== 'started')
28
+ closeLast(open, schedule);
29
+ if (job.kind === 'ended')
30
+ return;
31
+ const kept = opened(job, job.kind === 'started' ? started : schedule);
32
+ if (kept !== null)
33
+ open.push(kept);
34
+ }
35
+ export function openJobs(markers) {
36
+ const open = [];
37
+ for (const { said, at } of markers) {
38
+ markerMoved(open, said, (job, key) => job.kind === 'started' ? { key, name: job.label, started: at } : null);
39
+ }
40
+ return open.map(({ name, started }) => ({ name, started }));
41
+ }
42
+ export function jobsRunning(jobs, now) {
43
+ return jobs.map((job) => {
44
+ const since = Date.parse(job.running_since);
45
+ const ran = Number.isNaN(since) ? 0 : Math.floor((now - since) / MINUTE);
46
+ return ran >= 1 ? `${job.name} (${ran} min)` : job.name;
47
+ });
48
+ }
49
+ export function sessionEnded(jobs, now) {
50
+ if (jobs.length === 0)
51
+ return ENDED;
52
+ const counted = jobs.length === 1 ? '1 background job' : `${jobs.length} background jobs`;
53
+ return `${ENDED} ${counted} stopped: ${jobsRunning(jobs, now).join(', ')}`;
54
+ }
@@ -0,0 +1,7 @@
1
+ import type { Runtime } from './runtime.js';
2
+ export declare function scheduleCurrency(runtime: Runtime): void;
3
+ export declare function spaceFreed(runtime: Runtime): void;
4
+ export declare function close({ store, socket, conversations, recovery, liveQueries, figures }: Runtime): void;
5
+ export declare function stop(runtime: Runtime): Promise<void>;
6
+ export declare function start(runtime: Runtime, signal: AbortSignal | undefined): void;
7
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA8M5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAOhD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,QAS1C;AAED,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,OAAO,QAQ9F;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,iBAS1C;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,QAwCtE"}