@agentshouse/mdruntime 0.1.0-cbb8d8acc9d19 → 0.1.0-cbb9cd3aced1a

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 (349) hide show
  1. package/README.md +29 -14
  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 +302 -0
  11. package/dist/adapter.d.ts +258 -92
  12. package/dist/adapter.d.ts.map +1 -1
  13. package/dist/attached-model.d.ts +6 -10
  14. package/dist/attached-model.d.ts.map +1 -1
  15. package/dist/attached-model.js +35 -41
  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/binary.d.ts +18 -0
  20. package/dist/binary.d.ts.map +1 -0
  21. package/dist/binary.js +8 -0
  22. package/dist/bootstrap.d.ts +37 -5
  23. package/dist/bootstrap.d.ts.map +1 -1
  24. package/dist/bootstrap.js +324 -52
  25. package/dist/cell.d.ts +6 -0
  26. package/dist/cell.d.ts.map +1 -0
  27. package/dist/cell.js +9 -0
  28. package/dist/chain.d.ts +12 -0
  29. package/dist/chain.d.ts.map +1 -0
  30. package/dist/chain.js +64 -0
  31. package/dist/change-set.d.ts +13 -14
  32. package/dist/change-set.d.ts.map +1 -1
  33. package/dist/change-set.js +17 -56
  34. package/dist/change.d.ts +50 -0
  35. package/dist/change.d.ts.map +1 -1
  36. package/dist/change.js +39 -0
  37. package/dist/chat-types.d.ts +3 -0
  38. package/dist/chat-types.d.ts.map +1 -0
  39. package/dist/chat-types.js +11 -0
  40. package/dist/client.d.ts +59 -27
  41. package/dist/client.d.ts.map +1 -1
  42. package/dist/client.js +160 -35
  43. package/dist/collection.d.ts +34 -14
  44. package/dist/collection.d.ts.map +1 -1
  45. package/dist/collection.js +67 -54
  46. package/dist/column.d.ts +5 -0
  47. package/dist/column.d.ts.map +1 -0
  48. package/dist/column.js +9 -0
  49. package/dist/compile.d.ts +18 -0
  50. package/dist/compile.d.ts.map +1 -0
  51. package/dist/compile.js +723 -0
  52. package/dist/connection.d.ts +8 -104
  53. package/dist/connection.d.ts.map +1 -1
  54. package/dist/connection.js +113 -2097
  55. package/dist/context.d.ts +2 -0
  56. package/dist/context.d.ts.map +1 -0
  57. package/dist/context.js +7 -0
  58. package/dist/conversation-live.d.ts +150 -0
  59. package/dist/conversation-live.d.ts.map +1 -0
  60. package/dist/conversation-live.js +259 -0
  61. package/dist/conversation-row.d.ts +40 -0
  62. package/dist/conversation-row.d.ts.map +1 -0
  63. package/dist/conversation-row.js +66 -0
  64. package/dist/conversation.d.ts +97 -47
  65. package/dist/conversation.d.ts.map +1 -1
  66. package/dist/conversation.js +1121 -546
  67. package/dist/declaration.d.ts +10 -0
  68. package/dist/declaration.d.ts.map +1 -0
  69. package/dist/declaration.js +24 -0
  70. package/dist/digest.d.ts +7 -0
  71. package/dist/digest.d.ts.map +1 -0
  72. package/dist/digest.js +113 -0
  73. package/dist/discovery.d.ts +11 -0
  74. package/dist/discovery.d.ts.map +1 -0
  75. package/dist/discovery.js +157 -0
  76. package/dist/download.d.ts +6 -0
  77. package/dist/download.d.ts.map +1 -0
  78. package/dist/download.js +42 -0
  79. package/dist/durability.d.ts +24 -1
  80. package/dist/durability.d.ts.map +1 -1
  81. package/dist/durability.js +12 -0
  82. package/dist/entry.d.ts +25 -0
  83. package/dist/entry.d.ts.map +1 -0
  84. package/dist/entry.js +172 -0
  85. package/dist/expectation.d.ts +34 -0
  86. package/dist/expectation.d.ts.map +1 -0
  87. package/dist/expectation.js +123 -0
  88. package/dist/failure.d.ts +16 -0
  89. package/dist/failure.d.ts.map +1 -0
  90. package/dist/failure.js +27 -0
  91. package/dist/figures.d.ts +49 -0
  92. package/dist/figures.d.ts.map +1 -0
  93. package/dist/figures.js +199 -0
  94. package/dist/file.d.ts +2 -19
  95. package/dist/file.d.ts.map +1 -1
  96. package/dist/file.js +8 -122
  97. package/dist/holdings.d.ts +29 -0
  98. package/dist/holdings.d.ts.map +1 -0
  99. package/dist/holdings.js +95 -0
  100. package/dist/host.d.ts +29 -4
  101. package/dist/host.d.ts.map +1 -1
  102. package/dist/host.js +189 -33
  103. package/dist/identity.d.ts +3 -0
  104. package/dist/identity.d.ts.map +1 -1
  105. package/dist/identity.js +13 -1
  106. package/dist/index.d.ts +44 -10
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +21 -0
  109. package/dist/install.d.ts +60 -0
  110. package/dist/install.d.ts.map +1 -0
  111. package/dist/install.js +537 -0
  112. package/dist/lifecycle.d.ts +7 -0
  113. package/dist/lifecycle.d.ts.map +1 -0
  114. package/dist/lifecycle.js +282 -0
  115. package/dist/listing.d.ts +52 -0
  116. package/dist/listing.d.ts.map +1 -0
  117. package/dist/listing.js +152 -0
  118. package/dist/live.d.ts +25 -0
  119. package/dist/live.d.ts.map +1 -0
  120. package/dist/live.js +206 -0
  121. package/dist/loaded.d.ts +5 -0
  122. package/dist/loaded.d.ts.map +1 -0
  123. package/dist/loaded.js +40 -0
  124. package/dist/locks.d.ts +7 -0
  125. package/dist/locks.d.ts.map +1 -0
  126. package/dist/locks.js +32 -0
  127. package/dist/lost.d.ts +5 -0
  128. package/dist/lost.d.ts.map +1 -0
  129. package/dist/lost.js +49 -0
  130. package/dist/media.d.ts +25 -0
  131. package/dist/media.d.ts.map +1 -0
  132. package/dist/media.js +296 -0
  133. package/dist/memory.d.ts +29 -8
  134. package/dist/memory.d.ts.map +1 -1
  135. package/dist/memory.js +359 -104
  136. package/dist/messages.d.ts +58 -0
  137. package/dist/messages.d.ts.map +1 -0
  138. package/dist/messages.js +160 -0
  139. package/dist/modal.d.ts +2 -0
  140. package/dist/modal.d.ts.map +1 -0
  141. package/dist/modal.js +11 -0
  142. package/dist/model.d.ts +13 -13
  143. package/dist/model.d.ts.map +1 -1
  144. package/dist/model.js +7 -15
  145. package/dist/models.d.ts +10 -0
  146. package/dist/models.d.ts.map +1 -0
  147. package/dist/models.js +153 -0
  148. package/dist/name.d.ts +4 -0
  149. package/dist/name.d.ts.map +1 -0
  150. package/dist/name.js +122 -0
  151. package/dist/observation.d.ts +42 -9
  152. package/dist/observation.d.ts.map +1 -1
  153. package/dist/observation.js +238 -33
  154. package/dist/open.d.ts +2 -0
  155. package/dist/open.d.ts.map +1 -0
  156. package/dist/open.js +1 -0
  157. package/dist/opened.d.ts +22 -0
  158. package/dist/opened.d.ts.map +1 -0
  159. package/dist/opened.js +107 -0
  160. package/dist/opening.d.ts +4 -0
  161. package/dist/opening.d.ts.map +1 -0
  162. package/dist/opening.js +53 -0
  163. package/dist/outcome.d.ts +87 -5
  164. package/dist/outcome.d.ts.map +1 -1
  165. package/dist/outcome.js +114 -1
  166. package/dist/overlay.d.ts +21 -6
  167. package/dist/overlay.d.ts.map +1 -1
  168. package/dist/overlay.js +170 -190
  169. package/dist/page-metadata.d.ts +8 -0
  170. package/dist/page-metadata.d.ts.map +1 -0
  171. package/dist/page-metadata.js +19 -0
  172. package/dist/parts.d.ts +4 -0
  173. package/dist/parts.d.ts.map +1 -0
  174. package/dist/parts.js +13 -0
  175. package/dist/paths.d.ts +2 -0
  176. package/dist/paths.d.ts.map +1 -1
  177. package/dist/paths.js +26 -0
  178. package/dist/preparation.d.ts +41 -0
  179. package/dist/preparation.d.ts.map +1 -0
  180. package/dist/preparation.js +314 -0
  181. package/dist/presence.d.ts +58 -0
  182. package/dist/presence.d.ts.map +1 -0
  183. package/dist/presence.js +231 -0
  184. package/dist/queries.d.ts +16 -0
  185. package/dist/queries.d.ts.map +1 -0
  186. package/dist/queries.js +308 -0
  187. package/dist/query.d.ts +51 -181
  188. package/dist/query.d.ts.map +1 -1
  189. package/dist/query.js +3 -461
  190. package/dist/questions.d.ts +30 -0
  191. package/dist/questions.d.ts.map +1 -0
  192. package/dist/questions.js +116 -0
  193. package/dist/queue.d.ts +40 -0
  194. package/dist/queue.d.ts.map +1 -0
  195. package/dist/queue.js +480 -0
  196. package/dist/reach.d.ts +20 -5
  197. package/dist/reach.d.ts.map +1 -1
  198. package/dist/reach.js +375 -88
  199. package/dist/react.d.ts +49 -20
  200. package/dist/react.d.ts.map +1 -1
  201. package/dist/react.js +45 -21
  202. package/dist/read.d.ts +7 -0
  203. package/dist/read.d.ts.map +1 -0
  204. package/dist/read.js +17 -0
  205. package/dist/readiness.d.ts +55 -0
  206. package/dist/readiness.d.ts.map +1 -0
  207. package/dist/readiness.js +25 -0
  208. package/dist/reads.d.ts +39 -0
  209. package/dist/reads.d.ts.map +1 -0
  210. package/dist/reads.js +178 -0
  211. package/dist/recovery.d.ts +28 -0
  212. package/dist/recovery.d.ts.map +1 -0
  213. package/dist/recovery.js +254 -0
  214. package/dist/refresh.d.ts +20 -7
  215. package/dist/refresh.d.ts.map +1 -1
  216. package/dist/refresh.js +155 -59
  217. package/dist/refusal.d.ts +5 -0
  218. package/dist/refusal.d.ts.map +1 -0
  219. package/dist/refusal.js +55 -0
  220. package/dist/replica.d.ts +53 -33
  221. package/dist/replica.d.ts.map +1 -1
  222. package/dist/replica.js +362 -165
  223. package/dist/retried.d.ts +30 -0
  224. package/dist/retried.d.ts.map +1 -0
  225. package/dist/retried.js +72 -0
  226. package/dist/room-draft.d.ts +85 -14
  227. package/dist/room-draft.d.ts.map +1 -1
  228. package/dist/room-draft.js +498 -95
  229. package/dist/room-drafts.d.ts +24 -0
  230. package/dist/room-drafts.d.ts.map +1 -0
  231. package/dist/room-drafts.js +220 -0
  232. package/dist/room-list.d.ts +10 -0
  233. package/dist/room-list.d.ts.map +1 -0
  234. package/dist/room-list.js +45 -0
  235. package/dist/rows.d.ts +33 -35
  236. package/dist/rows.d.ts.map +1 -1
  237. package/dist/rows.js +64 -124
  238. package/dist/runtime.d.ts +34 -0
  239. package/dist/runtime.d.ts.map +1 -0
  240. package/dist/runtime.js +1 -0
  241. package/dist/save.d.ts +47 -22
  242. package/dist/save.d.ts.map +1 -1
  243. package/dist/save.js +994 -215
  244. package/dist/saves.d.ts +34 -0
  245. package/dist/saves.d.ts.map +1 -0
  246. package/dist/saves.js +437 -0
  247. package/dist/search.d.ts +15 -54
  248. package/dist/search.d.ts.map +1 -1
  249. package/dist/search.js +10 -121
  250. package/dist/seed.d.ts +25 -0
  251. package/dist/seed.d.ts.map +1 -0
  252. package/dist/seed.js +145 -0
  253. package/dist/shared.d.ts +10 -0
  254. package/dist/shared.d.ts.map +1 -0
  255. package/dist/shared.js +339 -0
  256. package/dist/shown.d.ts +35 -0
  257. package/dist/shown.d.ts.map +1 -0
  258. package/dist/shown.js +313 -0
  259. package/dist/socket/admission.d.ts +7 -0
  260. package/dist/socket/admission.d.ts.map +1 -0
  261. package/dist/socket/admission.js +39 -0
  262. package/dist/socket/answers.d.ts +6 -0
  263. package/dist/socket/answers.d.ts.map +1 -0
  264. package/dist/socket/answers.js +20 -0
  265. package/dist/socket/lanes.d.ts +28 -0
  266. package/dist/socket/lanes.d.ts.map +1 -0
  267. package/dist/socket/lanes.js +103 -0
  268. package/dist/socket/reads.d.ts +10 -0
  269. package/dist/socket/reads.d.ts.map +1 -0
  270. package/dist/socket/reads.js +31 -0
  271. package/dist/socket/session.d.ts +38 -0
  272. package/dist/socket/session.d.ts.map +1 -0
  273. package/dist/socket/session.js +23 -0
  274. package/dist/socket.d.ts +67 -0
  275. package/dist/socket.d.ts.map +1 -0
  276. package/dist/socket.js +164 -0
  277. package/dist/source.d.ts +59 -0
  278. package/dist/source.d.ts.map +1 -0
  279. package/dist/source.js +93 -0
  280. package/dist/status.d.ts +7 -4
  281. package/dist/status.d.ts.map +1 -1
  282. package/dist/status.js +3 -15
  283. package/dist/store/installs.d.ts +30 -0
  284. package/dist/store/installs.d.ts.map +1 -0
  285. package/dist/store/installs.js +40 -0
  286. package/dist/store/readiness.d.ts +11 -0
  287. package/dist/store/readiness.d.ts.map +1 -0
  288. package/dist/store/readiness.js +68 -0
  289. package/dist/store/records.d.ts +224 -0
  290. package/dist/store/records.d.ts.map +1 -0
  291. package/dist/store/records.js +466 -0
  292. package/dist/store/room-held.d.ts +8 -0
  293. package/dist/store/room-held.d.ts.map +1 -0
  294. package/dist/store/room-held.js +17 -0
  295. package/dist/store/rooms-shown.d.ts +8 -0
  296. package/dist/store/rooms-shown.d.ts.map +1 -0
  297. package/dist/store/rooms-shown.js +13 -0
  298. package/dist/store/space.d.ts +11 -0
  299. package/dist/store/space.d.ts.map +1 -0
  300. package/dist/store/space.js +41 -0
  301. package/dist/store/watchers.d.ts +17 -0
  302. package/dist/store/watchers.d.ts.map +1 -0
  303. package/dist/store/watchers.js +56 -0
  304. package/dist/store/writes.d.ts +24 -0
  305. package/dist/store/writes.d.ts.map +1 -0
  306. package/dist/store/writes.js +125 -0
  307. package/dist/store.d.ts +114 -93
  308. package/dist/store.d.ts.map +1 -1
  309. package/dist/store.js +170 -384
  310. package/dist/stored.d.ts +167 -0
  311. package/dist/stored.d.ts.map +1 -0
  312. package/dist/stored.js +700 -0
  313. package/dist/surface.d.ts +92 -0
  314. package/dist/surface.d.ts.map +1 -0
  315. package/dist/surface.js +251 -0
  316. package/dist/sync.d.ts +19 -0
  317. package/dist/sync.d.ts.map +1 -0
  318. package/dist/sync.js +538 -0
  319. package/dist/tables.d.ts +376 -0
  320. package/dist/tables.d.ts.map +1 -0
  321. package/dist/tables.js +499 -0
  322. package/dist/tallies.d.ts +18 -0
  323. package/dist/tallies.d.ts.map +1 -0
  324. package/dist/tallies.js +128 -0
  325. package/dist/transfer.d.ts +0 -5
  326. package/dist/transfer.d.ts.map +1 -1
  327. package/dist/turn.d.ts +9 -0
  328. package/dist/turn.d.ts.map +1 -0
  329. package/dist/turn.js +75 -0
  330. package/dist/validation.d.ts +29 -0
  331. package/dist/validation.d.ts.map +1 -0
  332. package/dist/validation.js +98 -0
  333. package/dist/windows.d.ts +11 -0
  334. package/dist/windows.d.ts.map +1 -0
  335. package/dist/windows.js +16 -0
  336. package/dist/wire.d.ts +240 -37
  337. package/dist/wire.d.ts.map +1 -1
  338. package/dist/wire.js +92 -33
  339. package/package.json +27 -15
  340. package/AGENTS.md +0 -244
  341. package/dist/attachment.d.ts +0 -3
  342. package/dist/attachment.d.ts.map +0 -1
  343. package/dist/attachment.js +0 -8
  344. package/dist/log.d.ts +0 -5
  345. package/dist/log.d.ts.map +0 -1
  346. package/dist/log.js +0 -14
  347. package/dist/read-side.d.ts +0 -18
  348. package/dist/read-side.d.ts.map +0 -1
  349. package/dist/read-side.js +0 -433
package/dist/change.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { BinaryFile, HeadChange } from './adapter.js';
1
2
  export type Change = {
2
3
  readonly kind: 'field';
3
4
  readonly path: string;
@@ -25,6 +26,13 @@ export type Change = {
25
26
  readonly kind: 'replace';
26
27
  readonly path: string;
27
28
  readonly content: string;
29
+ } | {
30
+ readonly kind: 'binary';
31
+ readonly path: string;
32
+ readonly localId: string;
33
+ readonly byteLength: number;
34
+ readonly mediaType: string;
35
+ readonly sha256: string;
28
36
  } | {
29
37
  readonly kind: 'move';
30
38
  readonly path: string;
@@ -32,6 +40,37 @@ export type Change = {
32
40
  } | {
33
41
  readonly kind: 'remove';
34
42
  readonly path: string;
43
+ } | (Arriving & {
44
+ readonly content: string;
45
+ }) | (Arriving & {
46
+ readonly binary: BinaryFile;
47
+ });
48
+ type Arriving = {
49
+ readonly kind: 'arrival';
50
+ readonly path: string;
51
+ readonly revision?: string;
52
+ readonly fileId?: string;
53
+ readonly created?: string;
54
+ readonly change?: HeadChange;
55
+ };
56
+ export type PartChange = Extract<Change, {
57
+ readonly kind: 'field' | 'section' | 'preamble';
58
+ }>;
59
+ export declare function isPart(change: Change): change is PartChange;
60
+ export type RoomMove = {
61
+ readonly source: {
62
+ readonly room: string;
63
+ readonly baseRoomVersion: string;
64
+ };
65
+ readonly destination: {
66
+ readonly room: string;
67
+ readonly baseRoomVersion: string;
68
+ readonly handle: string;
69
+ };
70
+ readonly moves: readonly {
71
+ readonly path: string;
72
+ readonly to: string;
73
+ }[];
35
74
  };
36
75
  export type Precondition = {
37
76
  readonly kind: 'field';
@@ -51,6 +90,10 @@ export type Precondition = {
51
90
  readonly kind: 'revision';
52
91
  readonly path: string;
53
92
  readonly revision: string;
93
+ } | {
94
+ readonly kind: 'content';
95
+ readonly path: string;
96
+ readonly content: string;
54
97
  } | {
55
98
  readonly kind: 'present';
56
99
  readonly path: string;
@@ -69,6 +112,13 @@ export type ChangeBatch = {
69
112
  readonly changes: readonly Change[];
70
113
  readonly preconditions: readonly Precondition[];
71
114
  readonly writtenBy?: WrittenBy;
115
+ readonly between?: RoomMove;
72
116
  };
73
117
  export declare function immutable(batch: ChangeBatch): ChangeBatch;
118
+ export declare function partnerOf(batch: ChangeBatch, locator: string): string | null;
119
+ export declare function leaving(batch: ChangeBatch, locator: string): boolean;
120
+ export declare function landing(changes: readonly Change[], index: number, path: string): string | null;
121
+ export declare function departure(changes: readonly Change[], index: number): string;
122
+ export declare function queuedFile(batch: ChangeBatch, path: string, localId: string): number;
123
+ export {};
74
124
  //# sourceMappingURL=change.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GACd;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAA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;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpF"}
package/dist/change.js CHANGED
@@ -1,3 +1,6 @@
1
+ export function isPart(change) {
2
+ return change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble';
3
+ }
1
4
  function frozen(value) {
2
5
  if (Array.isArray(value))
3
6
  return Object.freeze(value.map((item) => frozen(item)));
@@ -11,3 +14,39 @@ function frozen(value) {
11
14
  export function immutable(batch) {
12
15
  return frozen(batch);
13
16
  }
17
+ export function partnerOf(batch, locator) {
18
+ const between = batch.between;
19
+ if (between === undefined)
20
+ return null;
21
+ return between.source.room === locator ? between.destination.room : between.source.room;
22
+ }
23
+ export function leaving(batch, locator) {
24
+ return batch.between?.source.room === locator;
25
+ }
26
+ export function landing(changes, index, path) {
27
+ let at = path;
28
+ for (let next = index + 1; next < changes.length; next += 1) {
29
+ const change = changes[next];
30
+ if (change.path !== at)
31
+ continue;
32
+ if (change.kind === 'remove')
33
+ return null;
34
+ if (change.kind === 'move')
35
+ at = change.to;
36
+ }
37
+ return at;
38
+ }
39
+ export function departure(changes, index) {
40
+ let at = changes[index].path;
41
+ for (let earlier = index - 1; earlier >= 0; earlier -= 1) {
42
+ const change = changes[earlier];
43
+ if (change.kind === 'move' && change.to === at)
44
+ at = change.path;
45
+ }
46
+ return at;
47
+ }
48
+ export function queuedFile(batch, path, localId) {
49
+ return batch.changes.findIndex((change, index) => change.kind === 'binary' &&
50
+ change.localId === localId &&
51
+ landing(batch.changes, index, change.path) === path);
52
+ }
@@ -0,0 +1,3 @@
1
+ export declare function keptFile(line: string): string | null;
2
+ export declare function keptLines(body: string): string[];
3
+ //# sourceMappingURL=chat-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../src/chat-types.ts"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEpD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKhD"}
@@ -0,0 +1,11 @@
1
+ const KEPT_LINE = /^\[([^\]\n]+)\]\(\1\)$/u;
2
+ const TOO_BIG_LINE = /^\[too big to keep: [^\n]*\]$/u;
3
+ export function keptFile(line) {
4
+ return KEPT_LINE.exec(line)?.[1] ?? null;
5
+ }
6
+ export function keptLines(body) {
7
+ const trimmed = body.replace(/\n+$/u, '');
8
+ const at = trimmed.lastIndexOf('\n\n');
9
+ const lines = (at === -1 ? trimmed : trimmed.slice(at + 2)).split('\n');
10
+ return lines.every((line) => keptFile(line) !== null || TOO_BIG_LINE.test(line)) ? lines : [];
11
+ }
package/dist/client.d.ts CHANGED
@@ -1,70 +1,102 @@
1
- import type { AppRoom, ConnectionRefusal, HistoryQuery, RoomSchemas, SavedRoomDraft, SaveResult } from './connection.js';
2
- import type { HistoryResult, ServiceMode } from './adapter.js';
3
- import type { ChatDraft, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
1
+ import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
2
+ import type { HistoryQuery } from './actions.js';
3
+ import type { AppRoom } from './listing.js';
4
+ import type { ConnectionRefusal } from './socket.js';
5
+ import type { RoomSchemas } from './surface.js';
6
+ import type { SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
7
+ import type { ListedAgent, Member, RoomList, ServiceMode } from './adapter.js';
8
+ import type { UnsentWork } from './durability.js';
9
+ import type { ChatDraftSurface, ConversationAgent, ConversationEntry, ConversationOptions, ConversationSurface, ConversationView } from './conversation.js';
4
10
  import { type Observation } from './observation.js';
5
- import type { CallResult, QueueEntry } from './outcome.js';
6
- import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult } from './query.js';
11
+ import { type AttachAnswer, type BinaryAnswer, type CallResult, type DownloadAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
12
+ import type { FiguresResult } from './figures.js';
13
+ import type { Holdings } from './holdings.js';
14
+ import type { DocumentResult, GroupResult, PendingResult } from './query.js';
7
15
  import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
8
16
  import type { SearchRequest, SearchResult } from './search.js';
17
+ import type { Readiness } from './readiness.js';
18
+ import type { ObservedRead } from './reads.js';
9
19
  import type { SyncStatus } from './status.js';
10
20
  import { type RuntimePort } from './wire.js';
21
+ export type BuildFile = (name: string) => Promise<Blob | null>;
11
22
  export type MdRuntimeClient = {
23
+ buildFile(name: string): Promise<Blob | null>;
12
24
  rooms(): Promise<readonly AppRoom[]>;
13
25
  query: {
14
- (query: DocumentQuery): Promise<DocumentResult>;
15
- (query: GroupQuery): Promise<GroupResult>;
26
+ (query: DocumentQuery): Promise<DocumentResult | PendingResult>;
27
+ (query: GroupQuery): Promise<GroupResult | PendingResult>;
16
28
  };
17
29
  search(request: SearchRequest): Promise<SearchResult>;
18
30
  types(locator: string): Promise<RoomSchemas>;
19
31
  roomDraft: {
20
32
  list(): Promise<readonly RoomDraft[]>;
21
33
  read(room: string, path: string): Promise<RoomDraft | null>;
22
- write(room: string, path: string, revision: string | null, parts: RoomDraftParts): Promise<RoomDraftWrite>;
34
+ write(room: string, path: string, revision: string | null, parts: RoomDraftParts, next?: string): Promise<RoomDraftWrite>;
23
35
  discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
24
36
  };
25
37
  save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;
38
+ saveParts(room: string, parts: readonly SavedParts[]): Promise<SaveResult>;
26
39
  presentation: {
27
40
  read(): Promise<unknown>;
28
41
  write(value: unknown): Promise<void>;
42
+ edit(members: Readonly<Record<string, unknown>>): Promise<void>;
29
43
  };
30
- conversation: {
31
- list(): Promise<readonly ConversationEntry[]>;
32
- read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
33
- create(input: unknown): Promise<CallResult>;
34
- send(conversation: string): Promise<CallResult>;
35
- answer(conversation: string, answer: unknown): Promise<CallResult>;
36
- interrupt(conversation: string): Promise<CallResult>;
37
- kill(conversation: string): Promise<CallResult>;
38
- cancel(conversation: string, turn: string): Promise<CallResult>;
39
- delete(conversation: string): Promise<CallResult>;
44
+ conversation: ConversationSurface & {
45
+ pageMetadata(app: string, address: string): Promise<string>;
40
46
  };
41
- chatDraft: {
42
- write(conversation: string, draft: ChatDraft): Promise<void>;
43
- discard(conversation: string): Promise<void>;
47
+ chatDraft: ChatDraftSurface;
48
+ history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
49
+ resolve(room: string, path: string, destination: string): Promise<Resolution>;
50
+ binaryFile: {
51
+ read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
52
+ attach(room: string, file: File): Promise<AttachAnswer>;
53
+ download(room: string, path: string, revision?: string): Promise<DownloadAnswer>;
44
54
  };
45
- history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;
46
55
  call(name: string, input: unknown): Promise<CallResult>;
56
+ answered(operation: string): Promise<boolean>;
47
57
  reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
48
- log(): Promise<string>;
49
58
  persistence(): Promise<boolean>;
59
+ retry(): Promise<void>;
60
+ cleanUp(): Promise<number>;
61
+ unsent(): Promise<readonly UnsentWork[]>;
62
+ sent(): Promise<void>;
63
+ reset(): Promise<void>;
64
+ readAgain(): Promise<void>;
50
65
  observe: {
51
66
  (topic: 'deployment-facts'): Promise<Observation<unknown>>;
52
67
  (topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
68
+ (topic: 'readiness'): Promise<Observation<Readiness>>;
53
69
  (topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;
54
70
  (topic: 'storage-loss'): Promise<Observation<string | null>>;
55
71
  (topic: 'sync-status'): Promise<Observation<SyncStatus>>;
56
72
  (topic: 'service-mode'): Promise<Observation<ServiceMode>>;
57
- (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult>>;
58
- (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult>>;
73
+ (topic: 'member'): Promise<Observation<Member | null>>;
74
+ (topic: 'time-zone'): Promise<Observation<string | null>>;
75
+ (topic: 'authority-changes'): Promise<Observation<number>>;
76
+ (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
77
+ (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
59
78
  (topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
60
79
  (topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
61
80
  (topic: 'presentation'): Promise<Observation<unknown>>;
62
81
  (topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
63
82
  (topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
83
+ (topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
84
+ (topic: 'listed-agents'): Promise<Observation<readonly ListedAgent[]>>;
85
+ (topic: 'room-list'): Promise<Observation<RoomList | null>>;
86
+ (topic: 'figures'): Promise<Observation<FiguresResult>>;
87
+ (topic: 'holdings'): Promise<Observation<Holdings>>;
88
+ (topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
64
89
  };
65
90
  reauthorize(): Promise<void>;
91
+ settled(): Promise<void>;
66
92
  };
67
- export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
93
+ export declare function connectMdRuntime(port: RuntimePort, buildFile?: BuildFile): MdRuntimeClient;
94
+ export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
95
+ export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
96
+ export { roomDraftRevision } from './identity.js';
97
+ export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
98
+ export { shownModal } from './modal.js';
68
99
  export type { Observation } from './observation.js';
69
- export type { RuntimePort } from './wire.js';
100
+ export type { Open } from './open.js';
101
+ export { unanswered, type RuntimePort, type WireMember } from './wire.js';
70
102
  //# s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AE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
package/dist/client.js CHANGED
@@ -1,22 +1,35 @@
1
+ import { handedCopy, handedLink } from './download.js';
2
+ import { shownBy } from './media.js';
3
+ import { pageMetadataBlock } from './page-metadata.js';
1
4
  import { observed } from './observation.js';
2
- import { answer, AUTHORIZATION_ENDED, PORT_CLOSED, } from './wire.js';
3
- export function connectMdRuntime(port) {
5
+ import { runtimeError } from './failure.js';
6
+ import { blobOf, } from './outcome.js';
7
+ import { AUTHORIZATION_ENDED, PORT_CLOSED, wireAnswer, } from './wire.js';
8
+ // React renders an arrived value in a later task and opens what that render observes as it commits, so this many frames opening nothing mean the page drew what it observes.
9
+ const SETTLED_FRAMES = 2;
10
+ function refused(refusal) {
11
+ return runtimeError(refusal.code);
12
+ }
13
+ const UNBUILT = () => Promise.resolve(null);
14
+ export function connectMdRuntime(port, buildFile = UNBUILT) {
4
15
  let sequence = 0;
5
16
  let refusal = null;
6
17
  let ended = null;
7
18
  const calls = new Map();
8
19
  const opening = new Map();
9
20
  const observations = new Map();
21
+ let drawing = null;
22
+ let settling = null;
10
23
  const send = (message) => {
11
24
  port.postMessage(message);
12
25
  };
13
- function begin(id, topic, first) {
26
+ function begin(id, topic, input, first) {
14
27
  const handle = observed(first, () => {
15
28
  observations.delete(id);
16
29
  if (refusal === null)
17
30
  send({ kind: 'stop', id });
18
- }, topic === 'query');
19
- observations.set(id, { topic, handle });
31
+ }, topic);
32
+ observations.set(id, { topic, input, handle });
20
33
  return handle.observation;
21
34
  }
22
35
  function refuse(reported) {
@@ -25,10 +38,10 @@ export function connectMdRuntime(port) {
25
38
  if (topic === 'connection-refusal')
26
39
  handle.receive(reported);
27
40
  }
28
- const failure = new Error(reported.reason);
41
+ const failure = refused(reported);
29
42
  for (const [id, waiting] of opening) {
30
43
  if (waiting.topic === 'connection-refusal')
31
- waiting.settle(begin(id, waiting.topic, reported));
44
+ waiting.settle(begin(id, waiting.topic, waiting.input, reported));
32
45
  else
33
46
  waiting.fail(failure);
34
47
  }
@@ -36,12 +49,12 @@ export function connectMdRuntime(port) {
36
49
  for (const waiting of calls.values())
37
50
  waiting.fail(failure);
38
51
  calls.clear();
52
+ drawing?.();
39
53
  }
40
- function end(reason) {
54
+ function end(failure) {
41
55
  if (ended !== null)
42
56
  return;
43
- ended = reason;
44
- const failure = new Error(reason);
57
+ ended = failure;
45
58
  for (const waiting of opening.values())
46
59
  waiting.fail(failure);
47
60
  opening.clear();
@@ -51,9 +64,10 @@ export function connectMdRuntime(port) {
51
64
  for (const { handle } of observations.values())
52
65
  handle.end();
53
66
  observations.clear();
67
+ drawing?.();
54
68
  }
55
69
  port.addEventListener('message', (event) => {
56
- const message = answer(event.data);
70
+ const message = wireAnswer(event.data);
57
71
  if (message === null)
58
72
  return;
59
73
  if (message.kind === 'refusal') {
@@ -61,7 +75,11 @@ export function connectMdRuntime(port) {
61
75
  return;
62
76
  }
63
77
  if (message.kind === 'ended') {
64
- end(AUTHORIZATION_ENDED);
78
+ for (const { topic, handle } of observations.values()) {
79
+ if (topic === 'member' || topic === 'time-zone')
80
+ handle.receive(null);
81
+ }
82
+ end(runtimeError('authorization-ended', AUTHORIZATION_ENDED));
65
83
  return;
66
84
  }
67
85
  if (message.kind === 'event') {
@@ -71,31 +89,34 @@ export function connectMdRuntime(port) {
71
89
  const waiting = opening.get(message.id);
72
90
  if (waiting !== undefined) {
73
91
  opening.delete(message.id);
74
- if (message.kind === 'failure')
75
- waiting.fail(new Error(message.message));
92
+ if (message.kind === 'failure') {
93
+ waiting.fail(runtimeError(message.code, message.message, message.retryable));
94
+ }
76
95
  else
77
- waiting.settle(begin(message.id, waiting.topic, message.value));
96
+ waiting.settle(begin(message.id, waiting.topic, waiting.input, message.value));
97
+ drawing?.();
78
98
  return;
79
99
  }
80
100
  const called = calls.get(message.id);
81
101
  if (called === undefined)
82
102
  return;
83
103
  calls.delete(message.id);
84
- if (message.kind === 'failure')
85
- called.fail(new Error(message.message));
104
+ if (message.kind === 'failure') {
105
+ called.fail(runtimeError(message.code, message.message, message.retryable));
106
+ }
86
107
  else
87
108
  called.settle(message.value);
88
109
  });
89
110
  port.addEventListener('close', () => {
90
- end(PORT_CLOSED);
111
+ end(runtimeError('port-closed', PORT_CLOSED));
91
112
  });
92
113
  port.start();
93
114
  send({ kind: 'hello' });
94
115
  function ask(member, input) {
95
116
  if (ended !== null)
96
- return Promise.reject(new Error(ended));
117
+ return Promise.reject(ended);
97
118
  if (refusal !== null)
98
- return Promise.reject(new Error(refusal.reason));
119
+ return Promise.reject(refused(refusal));
99
120
  const id = (sequence += 1);
100
121
  return new Promise((settle, fail) => {
101
122
  calls.set(id, { settle: settle, fail });
@@ -104,19 +125,83 @@ export function connectMdRuntime(port) {
104
125
  }
105
126
  function watch(topic, input) {
106
127
  if (ended !== null)
107
- return Promise.reject(new Error(ended));
128
+ return Promise.reject(ended);
108
129
  const id = (sequence += 1);
109
130
  if (refusal !== null) {
110
131
  return topic === 'connection-refusal'
111
- ? Promise.resolve(begin(id, topic, refusal))
112
- : Promise.reject(new Error(refusal.reason));
132
+ ? Promise.resolve(begin(id, topic, input, refusal))
133
+ : Promise.reject(refused(refusal));
113
134
  }
114
135
  return new Promise((settle, fail) => {
115
- opening.set(id, { topic, settle, fail });
136
+ opening.set(id, { topic, input, settle, fail });
116
137
  send({ kind: 'observe', id, topic, input });
138
+ drawing?.();
139
+ });
140
+ }
141
+ function streamed(answer) {
142
+ if (answer.kind !== 'binary')
143
+ return answer;
144
+ const { file, byteLength, mediaType } = answer;
145
+ let part = 0;
146
+ let received = 0;
147
+ const stream = new ReadableStream({
148
+ async pull(controller) {
149
+ const bytes = await ask('binaryFile.part', [file, part]);
150
+ if (bytes === null) {
151
+ if (received === byteLength)
152
+ controller.close();
153
+ else
154
+ controller.error(runtimeError('binary-file-absent', 'The file ended early'));
155
+ return;
156
+ }
157
+ part += 1;
158
+ received += bytes.byteLength;
159
+ controller.enqueue(bytes);
160
+ },
161
+ }, { highWaterMark: 0 });
162
+ return { kind: 'binary', stream, byteLength, mediaType };
163
+ }
164
+ async function download(room, path, revision) {
165
+ const linked = await handedLink(path, () => ask('binaryFile.link', [room, path, revision]));
166
+ if (linked.kind !== 'absent')
167
+ return linked;
168
+ const read = streamed(await ask('binaryFile.read', [room, path, revision]));
169
+ if (read.kind !== 'binary')
170
+ return read;
171
+ return handedCopy(await blobOf(read), path.slice(path.lastIndexOf('/') + 1));
172
+ }
173
+ function settled() {
174
+ if (settling !== null)
175
+ return settling;
176
+ settling = new Promise((resolve) => {
177
+ let moved = 0;
178
+ const check = () => {
179
+ moved += 1;
180
+ if (opening.size > 0)
181
+ return;
182
+ const at = moved;
183
+ const waited = (frames) => {
184
+ requestAnimationFrame(() => {
185
+ if (frames < SETTLED_FRAMES) {
186
+ waited(frames + 1);
187
+ return;
188
+ }
189
+ if (moved !== at || opening.size > 0)
190
+ return;
191
+ drawing = null;
192
+ resolve();
193
+ });
194
+ };
195
+ waited(1);
196
+ };
197
+ drawing = check;
198
+ check();
117
199
  });
200
+ return settling;
118
201
  }
119
- return {
202
+ const show = (room, path, revision) => ask('binaryFile.show', [room, path, revision]).then((shown) => streamed(shown));
203
+ return shownBy(show, {
204
+ buildFile,
120
205
  rooms: () => ask('rooms', []),
121
206
  query: ((query) => ask('query', [query])),
122
207
  search: (request) => ask('search', [request]),
@@ -124,35 +209,75 @@ export function connectMdRuntime(port) {
124
209
  roomDraft: {
125
210
  list: () => ask('roomDraft.list', []),
126
211
  read: (room, path) => ask('roomDraft.read', [room, path]),
127
- write: (room, path, revision, parts) => ask('roomDraft.write', [room, path, revision, parts]),
212
+ write: (room, path, revision, parts, next) => ask('roomDraft.write', next === undefined ? [room, path, revision, parts] : [room, path, revision, parts, next]),
128
213
  discard: (room, path, revision) => ask('roomDraft.discard', [room, path, revision]),
129
214
  },
130
215
  save: (room, roomDrafts) => ask('save', [room, roomDrafts]),
216
+ saveParts: (room, parts) => ask('saveParts', [room, parts]),
131
217
  presentation: {
132
218
  read: () => ask('presentation.read', []),
133
219
  write: (value) => ask('presentation.write', [value]),
220
+ edit: (members) => ask('presentation.edit', [members]),
134
221
  },
135
222
  conversation: {
136
223
  list: () => ask('conversation.list', []),
137
224
  read: (conversation, options) => ask('conversation.read', [conversation, options]),
138
225
  create: (input) => ask('conversation.create', [input]),
139
- send: (conversation) => ask('conversation.send', [conversation]),
140
- answer: (conversation, answer) => ask('conversation.answer', [conversation, answer]),
141
- interrupt: (conversation) => ask('conversation.interrupt', [conversation]),
142
- kill: (conversation) => ask('conversation.kill', [conversation]),
143
- cancel: (conversation, turn) => ask('conversation.cancel', [conversation, turn]),
144
- delete: (conversation) => ask('conversation.delete', [conversation]),
226
+ send: (conversation, operation, draft) => ask('conversation.send', [conversation, operation, draft]),
227
+ answer: (conversation, answer, operation) => ask('conversation.answer', [conversation, answer, operation]),
228
+ interrupt: (conversation, operation) => ask('conversation.interrupt', [conversation, operation]),
229
+ kill: (conversation, operation) => ask('conversation.kill', [conversation, operation]),
230
+ delete: (conversation, operation) => ask('conversation.delete', [conversation, operation]),
231
+ takeOut: (conversation, message, operation) => ask('conversation.takeOut', [conversation, message, operation]),
232
+ decide: (request, decision, operation) => ask('conversation.decide', [request, decision, operation]),
233
+ rename: (conversation, name, operation) => ask('conversation.rename', [conversation, name, operation]),
234
+ option: (conversation, option, value, operation) => ask('conversation.option', [conversation, option, value, operation]),
235
+ retry: (conversation, message, operation) => ask('conversation.retry', [conversation, message, operation]),
236
+ pin: (figures) => ask('conversation.pin', [figures]),
237
+ openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
238
+ dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
239
+ attach: (file) => ask('conversation.attach', [file]),
240
+ attachment: (link) => ask('conversation.attachment', [link]),
241
+ pageMetadata: async (app, address) => pageMetadataBlock(app, address, [...observations]
242
+ .sort(([left], [right]) => left - right)
243
+ .flatMap(([, { topic, input }]) => (topic === 'query' ? [input[0]] : []))),
145
244
  },
146
245
  chatDraft: {
147
- write: (conversation, draft) => ask('chatDraft.write', [conversation, draft]),
246
+ write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
247
+ prepend: (conversation, draft) => ask('chatDraft.prepend', [conversation, draft]),
248
+ append: (conversation, draft) => ask('chatDraft.append', [conversation, draft]),
148
249
  discard: (conversation) => ask('chatDraft.discard', [conversation]),
149
250
  },
150
251
  history: (locator, path, query) => ask('history', [locator, path, query]),
252
+ resolve: (room, path, destination) => ask('resolve', [room, path, destination]),
253
+ binaryFile: {
254
+ read: (room, path, revision) => ask('binaryFile.read', [room, path, revision]).then((read) => streamed(read)),
255
+ attach: (room, file) => ask('binaryFile.attach', [room, file]),
256
+ download,
257
+ },
151
258
  call: (name, input) => ask('call', [name, input]),
259
+ answered: (operation) => ask('answered', [operation]),
152
260
  reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
153
- log: () => ask('log', []),
154
261
  persistence: () => ask('persistence', []),
262
+ retry: () => ask('retry', []),
263
+ cleanUp: () => ask('cleanUp', []),
264
+ unsent: () => ask('unsent', []),
265
+ sent: () => ask('sent', []),
266
+ reset: () => ask('reset', []),
267
+ readAgain: () => ask('readAgain', []),
155
268
  observe: ((topic, ...input) => watch(topic, input)),
156
269
  reauthorize: () => ask('reauthorize', []),
157
- };
270
+ settled,
271
+ });
272
+ }
273
+ const turns = new WeakMap();
274
+ export function inTurn(client, work) {
275
+ const turn = (turns.get(client) ?? Promise.resolve()).then(work);
276
+ turns.set(client, turn.then(() => undefined, () => undefined));
277
+ return turn;
158
278
  }
279
+ export { chainedWindows } from './chain.js';
280
+ export { roomDraftRevision } from './identity.js';
281
+ export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
282
+ export { shownModal } from './modal.js';
283
+ export { unanswered } from './wire.js';