@agentshouse/mdruntime 0.1.0-c323f0c6b9a60 → 0.1.0-c33f874b1f932

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 (319) 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 +302 -0
  11. package/dist/adapter.d.ts +108 -85
  12. package/dist/adapter.d.ts.map +1 -1
  13. package/dist/attached-model.d.ts +3 -11
  14. package/dist/attached-model.d.ts.map +1 -1
  15. package/dist/attached-model.js +20 -60
  16. package/dist/bootstrap.d.ts +9 -5
  17. package/dist/bootstrap.d.ts.map +1 -1
  18. package/dist/bootstrap.js +204 -85
  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 +2 -1
  23. package/dist/chain.d.ts.map +1 -1
  24. package/dist/change-set.d.ts +4 -0
  25. package/dist/change-set.d.ts.map +1 -1
  26. package/dist/change-set.js +6 -0
  27. package/dist/change.d.ts +1 -0
  28. package/dist/change.d.ts.map +1 -1
  29. package/dist/change.js +4 -2
  30. package/dist/chat-types.d.ts +3 -0
  31. package/dist/chat-types.d.ts.map +1 -0
  32. package/dist/chat-types.js +11 -0
  33. package/dist/client.d.ts +30 -23
  34. package/dist/client.d.ts.map +1 -1
  35. package/dist/client.js +37 -21
  36. package/dist/collection.d.ts +26 -4
  37. package/dist/collection.d.ts.map +1 -1
  38. package/dist/collection.js +19 -2
  39. package/dist/compile.d.ts +8 -6
  40. package/dist/compile.d.ts.map +1 -1
  41. package/dist/compile.js +255 -318
  42. package/dist/connection.d.ts +5 -142
  43. package/dist/connection.d.ts.map +1 -1
  44. package/dist/connection.js +111 -4966
  45. package/dist/context.d.ts +2 -0
  46. package/dist/context.d.ts.map +1 -0
  47. package/dist/context.js +7 -0
  48. package/dist/conversation-live.d.ts +150 -0
  49. package/dist/conversation-live.d.ts.map +1 -0
  50. package/dist/conversation-live.js +259 -0
  51. package/dist/conversation-row.d.ts +35 -0
  52. package/dist/conversation-row.d.ts.map +1 -0
  53. package/dist/conversation-row.js +55 -0
  54. package/dist/conversation.d.ts +65 -44
  55. package/dist/conversation.d.ts.map +1 -1
  56. package/dist/conversation.js +999 -881
  57. package/dist/declaration.d.ts +10 -0
  58. package/dist/declaration.d.ts.map +1 -0
  59. package/dist/declaration.js +24 -0
  60. package/dist/discovery.d.ts +10 -0
  61. package/dist/discovery.d.ts.map +1 -0
  62. package/dist/discovery.js +150 -0
  63. package/dist/durability.d.ts +19 -0
  64. package/dist/durability.d.ts.map +1 -1
  65. package/dist/durability.js +4 -0
  66. package/dist/entry.d.ts +2 -2
  67. package/dist/entry.d.ts.map +1 -1
  68. package/dist/entry.js +18 -8
  69. package/dist/expectation.d.ts +26 -13
  70. package/dist/expectation.d.ts.map +1 -1
  71. package/dist/expectation.js +72 -19
  72. package/dist/failure.d.ts +3 -0
  73. package/dist/failure.d.ts.map +1 -1
  74. package/dist/failure.js +6 -0
  75. package/dist/figures.d.ts +49 -0
  76. package/dist/figures.d.ts.map +1 -0
  77. package/dist/figures.js +199 -0
  78. package/dist/file.d.ts.map +1 -1
  79. package/dist/file.js +2 -1
  80. package/dist/holdings.d.ts +29 -0
  81. package/dist/holdings.d.ts.map +1 -0
  82. package/dist/holdings.js +95 -0
  83. package/dist/host.d.ts +21 -7
  84. package/dist/host.d.ts.map +1 -1
  85. package/dist/host.js +77 -41
  86. package/dist/identity.d.ts +0 -1
  87. package/dist/identity.d.ts.map +1 -1
  88. package/dist/identity.js +0 -3
  89. package/dist/index.d.ts +34 -12
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +16 -5
  92. package/dist/install.d.ts +60 -0
  93. package/dist/install.d.ts.map +1 -0
  94. package/dist/install.js +537 -0
  95. package/dist/lifecycle.d.ts +7 -0
  96. package/dist/lifecycle.d.ts.map +1 -0
  97. package/dist/lifecycle.js +278 -0
  98. package/dist/listing.d.ts +52 -0
  99. package/dist/listing.d.ts.map +1 -0
  100. package/dist/listing.js +152 -0
  101. package/dist/live.d.ts +9 -6
  102. package/dist/live.d.ts.map +1 -1
  103. package/dist/live.js +118 -35
  104. package/dist/loaded.d.ts +5 -0
  105. package/dist/loaded.d.ts.map +1 -0
  106. package/dist/loaded.js +40 -0
  107. package/dist/locks.d.ts +7 -0
  108. package/dist/locks.d.ts.map +1 -0
  109. package/dist/locks.js +32 -0
  110. package/dist/lost.d.ts +5 -0
  111. package/dist/lost.d.ts.map +1 -0
  112. package/dist/lost.js +49 -0
  113. package/dist/media.d.ts +6 -1
  114. package/dist/media.d.ts.map +1 -1
  115. package/dist/media.js +68 -17
  116. package/dist/memory.d.ts +15 -6
  117. package/dist/memory.d.ts.map +1 -1
  118. package/dist/memory.js +178 -89
  119. package/dist/messages.d.ts +35 -5
  120. package/dist/messages.d.ts.map +1 -1
  121. package/dist/messages.js +108 -36
  122. package/dist/model.d.ts +2 -10
  123. package/dist/model.d.ts.map +1 -1
  124. package/dist/model.js +0 -14
  125. package/dist/models.d.ts +10 -0
  126. package/dist/models.d.ts.map +1 -0
  127. package/dist/models.js +153 -0
  128. package/dist/observation.d.ts +28 -13
  129. package/dist/observation.d.ts.map +1 -1
  130. package/dist/observation.js +185 -81
  131. package/dist/opened.d.ts +1 -1
  132. package/dist/opened.d.ts.map +1 -1
  133. package/dist/opened.js +5 -5
  134. package/dist/opening.d.ts +4 -0
  135. package/dist/opening.d.ts.map +1 -0
  136. package/dist/opening.js +53 -0
  137. package/dist/outcome.d.ts +11 -1
  138. package/dist/outcome.d.ts.map +1 -1
  139. package/dist/outcome.js +26 -2
  140. package/dist/overlay.d.ts +6 -1
  141. package/dist/overlay.d.ts.map +1 -1
  142. package/dist/overlay.js +47 -21
  143. package/dist/page-metadata.d.ts +8 -0
  144. package/dist/page-metadata.d.ts.map +1 -0
  145. package/dist/page-metadata.js +19 -0
  146. package/dist/parts.d.ts +4 -0
  147. package/dist/parts.d.ts.map +1 -0
  148. package/dist/parts.js +13 -0
  149. package/dist/paths.d.ts +1 -0
  150. package/dist/paths.d.ts.map +1 -1
  151. package/dist/paths.js +22 -0
  152. package/dist/preparation.d.ts +41 -0
  153. package/dist/preparation.d.ts.map +1 -0
  154. package/dist/preparation.js +314 -0
  155. package/dist/presence.d.ts +58 -0
  156. package/dist/presence.d.ts.map +1 -0
  157. package/dist/presence.js +231 -0
  158. package/dist/queries.d.ts +16 -0
  159. package/dist/queries.d.ts.map +1 -0
  160. package/dist/queries.js +308 -0
  161. package/dist/query.d.ts +13 -209
  162. package/dist/query.d.ts.map +1 -1
  163. package/dist/query.js +3 -505
  164. package/dist/questions.d.ts +29 -0
  165. package/dist/questions.d.ts.map +1 -0
  166. package/dist/questions.js +115 -0
  167. package/dist/queue.d.ts +40 -0
  168. package/dist/queue.d.ts.map +1 -0
  169. package/dist/queue.js +450 -0
  170. package/dist/reach.d.ts +15 -14
  171. package/dist/reach.d.ts.map +1 -1
  172. package/dist/reach.js +240 -134
  173. package/dist/react.d.ts +17 -3
  174. package/dist/react.d.ts.map +1 -1
  175. package/dist/react.js +33 -1
  176. package/dist/read.d.ts +7 -0
  177. package/dist/read.d.ts.map +1 -0
  178. package/dist/read.js +17 -0
  179. package/dist/readiness.d.ts +9 -6
  180. package/dist/readiness.d.ts.map +1 -1
  181. package/dist/readiness.js +3 -5
  182. package/dist/reads.d.ts +39 -0
  183. package/dist/reads.d.ts.map +1 -0
  184. package/dist/reads.js +178 -0
  185. package/dist/recovery.d.ts +3 -1
  186. package/dist/recovery.d.ts.map +1 -1
  187. package/dist/recovery.js +38 -8
  188. package/dist/refresh.d.ts +2 -1
  189. package/dist/refresh.d.ts.map +1 -1
  190. package/dist/refresh.js +31 -3
  191. package/dist/refusal.d.ts +5 -0
  192. package/dist/refusal.d.ts.map +1 -0
  193. package/dist/refusal.js +55 -0
  194. package/dist/replica.d.ts +11 -16
  195. package/dist/replica.d.ts.map +1 -1
  196. package/dist/replica.js +64 -30
  197. package/dist/retried.d.ts +30 -0
  198. package/dist/retried.d.ts.map +1 -0
  199. package/dist/retried.js +72 -0
  200. package/dist/room-draft.d.ts +7 -8
  201. package/dist/room-draft.d.ts.map +1 -1
  202. package/dist/room-draft.js +113 -111
  203. package/dist/room-drafts.d.ts +24 -0
  204. package/dist/room-drafts.d.ts.map +1 -0
  205. package/dist/room-drafts.js +217 -0
  206. package/dist/rows.d.ts +16 -22
  207. package/dist/rows.d.ts.map +1 -1
  208. package/dist/rows.js +49 -186
  209. package/dist/runtime.d.ts +34 -0
  210. package/dist/runtime.d.ts.map +1 -0
  211. package/dist/runtime.js +1 -0
  212. package/dist/save.d.ts +42 -86
  213. package/dist/save.d.ts.map +1 -1
  214. package/dist/save.js +344 -174
  215. package/dist/saves.d.ts +32 -0
  216. package/dist/saves.d.ts.map +1 -0
  217. package/dist/saves.js +409 -0
  218. package/dist/search.d.ts +12 -63
  219. package/dist/search.d.ts.map +1 -1
  220. package/dist/search.js +9 -52
  221. package/dist/seed.d.ts +11 -2
  222. package/dist/seed.d.ts.map +1 -1
  223. package/dist/seed.js +71 -1
  224. package/dist/shared.d.ts +1 -6
  225. package/dist/shared.d.ts.map +1 -1
  226. package/dist/shared.js +13 -95
  227. package/dist/shown.d.ts +33 -0
  228. package/dist/shown.d.ts.map +1 -0
  229. package/dist/shown.js +309 -0
  230. package/dist/socket/admission.d.ts +7 -0
  231. package/dist/socket/admission.d.ts.map +1 -0
  232. package/dist/socket/admission.js +39 -0
  233. package/dist/socket/answers.d.ts +6 -0
  234. package/dist/socket/answers.d.ts.map +1 -0
  235. package/dist/socket/answers.js +20 -0
  236. package/dist/socket/lanes.d.ts +28 -0
  237. package/dist/socket/lanes.d.ts.map +1 -0
  238. package/dist/socket/lanes.js +103 -0
  239. package/dist/socket/reads.d.ts +10 -0
  240. package/dist/socket/reads.d.ts.map +1 -0
  241. package/dist/socket/reads.js +31 -0
  242. package/dist/socket/session.d.ts +38 -0
  243. package/dist/socket/session.d.ts.map +1 -0
  244. package/dist/socket/session.js +23 -0
  245. package/dist/socket.d.ts +67 -0
  246. package/dist/socket.d.ts.map +1 -0
  247. package/dist/socket.js +164 -0
  248. package/dist/source.d.ts +54 -0
  249. package/dist/source.d.ts.map +1 -0
  250. package/dist/source.js +82 -0
  251. package/dist/status.d.ts +0 -2
  252. package/dist/status.d.ts.map +1 -1
  253. package/dist/status.js +0 -6
  254. package/dist/store/installs.d.ts +30 -0
  255. package/dist/store/installs.d.ts.map +1 -0
  256. package/dist/store/installs.js +40 -0
  257. package/dist/store/readiness.d.ts +11 -0
  258. package/dist/store/readiness.d.ts.map +1 -0
  259. package/dist/store/readiness.js +68 -0
  260. package/dist/store/records.d.ts +217 -0
  261. package/dist/store/records.d.ts.map +1 -0
  262. package/dist/store/records.js +464 -0
  263. package/dist/store/room-held.d.ts +8 -0
  264. package/dist/store/room-held.d.ts.map +1 -0
  265. package/dist/store/room-held.js +17 -0
  266. package/dist/store/rooms-shown.d.ts +8 -0
  267. package/dist/store/rooms-shown.d.ts.map +1 -0
  268. package/dist/store/rooms-shown.js +13 -0
  269. package/dist/store/space.d.ts +11 -0
  270. package/dist/store/space.d.ts.map +1 -0
  271. package/dist/store/space.js +41 -0
  272. package/dist/store/watchers.d.ts +17 -0
  273. package/dist/store/watchers.d.ts.map +1 -0
  274. package/dist/store/watchers.js +56 -0
  275. package/dist/store/writes.d.ts +24 -0
  276. package/dist/store/writes.d.ts.map +1 -0
  277. package/dist/store/writes.js +125 -0
  278. package/dist/store.d.ts +113 -144
  279. package/dist/store.d.ts.map +1 -1
  280. package/dist/store.js +171 -364
  281. package/dist/stored.d.ts +72 -35
  282. package/dist/stored.d.ts.map +1 -1
  283. package/dist/stored.js +340 -197
  284. package/dist/surface.d.ts +89 -0
  285. package/dist/surface.d.ts.map +1 -0
  286. package/dist/surface.js +222 -0
  287. package/dist/sync.d.ts +19 -0
  288. package/dist/sync.d.ts.map +1 -0
  289. package/dist/sync.js +535 -0
  290. package/dist/tables.d.ts +124 -30
  291. package/dist/tables.d.ts.map +1 -1
  292. package/dist/tables.js +242 -62
  293. package/dist/tallies.d.ts +18 -0
  294. package/dist/tallies.d.ts.map +1 -0
  295. package/dist/tallies.js +128 -0
  296. package/dist/validation.d.ts.map +1 -1
  297. package/dist/validation.js +9 -12
  298. package/dist/windows.d.ts +1 -12
  299. package/dist/windows.d.ts.map +1 -1
  300. package/dist/windows.js +2 -75
  301. package/dist/wire.d.ts +58 -9
  302. package/dist/wire.d.ts.map +1 -1
  303. package/dist/wire.js +21 -5
  304. package/package.json +3 -2
  305. package/dist/attempt.d.ts +0 -16
  306. package/dist/attempt.d.ts.map +0 -1
  307. package/dist/attempt.js +0 -70
  308. package/dist/fence.d.ts +0 -6
  309. package/dist/fence.d.ts.map +0 -1
  310. package/dist/fence.js +0 -10
  311. package/dist/fulltext.d.ts +0 -27
  312. package/dist/fulltext.d.ts.map +0 -1
  313. package/dist/fulltext.js +0 -370
  314. package/dist/log.d.ts +0 -5
  315. package/dist/log.d.ts.map +0 -1
  316. package/dist/log.js +0 -14
  317. package/dist/words.d.ts +0 -19
  318. package/dist/words.d.ts.map +0 -1
  319. package/dist/words.js +0 -156
package/README.md CHANGED
@@ -12,14 +12,14 @@ npm install @agentshouse/mdruntime
12
12
 
13
13
  ## Entries
14
14
 
15
- | Entry | For |
16
- | ------------------------------- | ----------------------------------------------------------------------------------- |
17
- | `@agentshouse/mdruntime/client` | The host's client: `connectMdRuntime(port)` |
18
- | `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime` |
19
- | `@agentshouse/mdruntime` | Shared types |
20
- | `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter |
21
- | `@agentshouse/mdruntime/tables` | The host's database: the Authored store's and opened files' tables, `answerRuntime` |
22
- | `@agentshouse/mdruntime/react` | React over the client: `useObserve`, `useSave` |
15
+ | Entry | For |
16
+ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
17
+ | `@agentshouse/mdruntime/client` | The host's client: `connectMdRuntime(port)` |
18
+ | `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime` |
19
+ | `@agentshouse/mdruntime` | Shared types |
20
+ | `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter |
21
+ | `@agentshouse/mdruntime/tables` | The host's database: the Authored store's and opened files' tables, `answerRuntime` |
22
+ | `@agentshouse/mdruntime/react` | React over the client: `useObserve`, `useSave`; `useExpected`, a reader of an expectation store; `useLane`, a reader of an act lane |
23
23
 
24
24
  ## Usage
25
25
 
@@ -33,24 +33,26 @@ const rooms = await runtime.rooms();
33
33
  const notes = await runtime.query({ types: ['note'], select: 'all', limit: 20 });
34
34
  ```
35
35
 
36
- `observe('storage-loss')` reports `null` or the stable code
37
- `storage-loss` when unsynchronized Room Drafts and Pending Changes were lost.
38
- The host supplies the user-facing wording.
36
+ `observe('storage-loss')` reports `null`, the stable code `storage-loss` when
37
+ unsynchronized Room Drafts and Pending Changes were lost, or `visit` while the host holds
38
+ the database in memory, which ends with the visit; the readiness `persistence` answer is then
39
+ `memory`. The host supplies the user-facing wording.
39
40
 
40
41
  In House the bridge object the page holds as `window.houseBridge` places the Chat, which
41
- House serves with the page: install and bundle nothing for it. Mount it in an element,
42
- themed by CSS custom properties on that element, docked at a third of the window:
42
+ House serves with the page: install and bundle nothing for it. Mount it in an element it
43
+ fills, where it lays out the User's chats by the element's width, themed by CSS custom
44
+ properties on that element, or as the Chat button, House's dot that opens it in a sheet:
43
45
 
44
46
  ```ts
45
- const chat = await window.houseBridge.chat.mount(element, { width: '1/3', showChats: true });
47
+ const chat = await window.houseBridge.chat.mount(element, { conversation });
46
48
  element.style.setProperty('--chat-accent', '#2a6cf0');
47
- chat.update({ width: 'full', showChats: true });
48
- chat.unmount();
49
+ chat.update({ conversation: null, agent });
50
+ const button = await window.houseBridge.chat.mountButton({});
51
+ button.open({ agent });
49
52
  ```
50
53
 
51
- The rules an App's agent follows, including Local Query, Local Search, Room
52
- Draft, Save and the Chat, are the `apps/` pages of House's Guide, which House's
53
- `open_guide` opens.
54
+ The rules an App's agent follows, including Local Query, search, Room Draft, Save and the
55
+ Chat, are the `apps/` pages of House's Guide, which House's `guide/open` opens.
54
56
 
55
57
  ## License
56
58
 
@@ -0,0 +1,3 @@
1
+ import type { Runtime } from './runtime.js';
2
+ export declare function submitLater(runtime: Runtime, locator: string): void;
3
+ //# sourceMappingURL=acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../src/acceptance.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA0V5C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAK5D"}
@@ -0,0 +1,299 @@
1
+ import { refusalError } from './failure.js';
2
+ import { changeSet } from './change-set.js';
3
+ import { declared } from './declaration.js';
4
+ import { leaving as leavingIn, partnerOf } from './change.js';
5
+ import { olderThan, showing } from './install.js';
6
+ import { scoped } from './models.js';
7
+ import { answered, settle } from './queue.js';
8
+ import { refuse } from './refusal.js';
9
+ import { returnedPaths, returning, slicing } from './replica.js';
10
+ import { batchFile } from './saves.js';
11
+ import { rest, roomUnreadable, statusShown } from './shown.js';
12
+ import { advanced, withhold } from './sync.js';
13
+ import { unconfirmed } from './transfer.js';
14
+ import { stepped } from './turn.js';
15
+ async function mark(runtime, local, locator, batch, submission, lost) {
16
+ const { store, socket, presence } = runtime;
17
+ const partner = partnerOf(batch, locator);
18
+ for (const held of partner === null ? [locator] : [locator, partner]) {
19
+ const { state, room } = await local.pending(held, batch.id);
20
+ if (!socket.continuing() ||
21
+ state === undefined ||
22
+ (JSON.stringify(state.submission) === JSON.stringify(submission) && state.lost === lost)) {
23
+ continue;
24
+ }
25
+ await local.submit(held, batch.id, submission, lost);
26
+ if (presence.lost(held))
27
+ continue;
28
+ if (room)
29
+ store.changed(changeSet(held, { queue: true }));
30
+ }
31
+ statusShown(runtime);
32
+ }
33
+ async function keepUpload({ socket, presence }, local, locator, identifier, upload) {
34
+ if (!socket.continuing())
35
+ throw new Error();
36
+ await local.keepUpload(locator, identifier, upload);
37
+ if (presence.lost(locator))
38
+ throw new Error();
39
+ if (!socket.continuing())
40
+ throw new Error();
41
+ }
42
+ function restands(adoptions) {
43
+ return adoptions.flatMap((one) => (one === null || !('record' in one) ? [] : [one]));
44
+ }
45
+ async function adoption(runtime, room, current, local, submitted, accepted) {
46
+ const { store, socket } = runtime;
47
+ if (!socket.continuing())
48
+ return unconfirmed;
49
+ if (current === undefined || !current.queue.some((batch) => batch.id === submitted.id)) {
50
+ return null;
51
+ }
52
+ const held = current.record.roomVersion;
53
+ let record = current.record;
54
+ let adopted;
55
+ if (!socket.reads.reached(room.locator, held, accepted.roomVersion) &&
56
+ !olderThan(runtime, room.locator, accepted.roomVersion, held)) {
57
+ const paths = [...returnedPaths(submitted, accepted)];
58
+ const confirmedLayer = await stepped(slicing(await local.entries(record.key, 'confirmed', paths), paths));
59
+ adopted = await stepped(returning(confirmedLayer, submitted, accepted, accepted.roomVersion, store.composed(record)));
60
+ record = {
61
+ ...record,
62
+ roomVersion: socket.follows(room.locator, held, accepted.roomVersion)
63
+ ? accepted.roomVersion
64
+ : held,
65
+ };
66
+ }
67
+ const reached = record.roomVersion;
68
+ return {
69
+ locator: room.locator,
70
+ record,
71
+ accepted: submitted.id,
72
+ ...(adopted === undefined ? {} : { adopted }),
73
+ after() {
74
+ showing(runtime, room.locator, accepted.roomVersion, reached);
75
+ runtime.presence.readable(room.locator);
76
+ },
77
+ };
78
+ }
79
+ async function adopted(runtime, room, local, submitted, accepted) {
80
+ let kept = true;
81
+ await settle(runtime, [room.locator], async (held) => {
82
+ const adopting = await adoption(runtime, room, held.get(room.locator)?.replica, local, submitted, accepted);
83
+ kept = adopting !== unconfirmed;
84
+ return restands([adopting]);
85
+ });
86
+ return kept;
87
+ }
88
+ async function adoptedMove(runtime, room, partner, local, submitted, accepted) {
89
+ const other = runtime.presence.room(partner);
90
+ let kept = true;
91
+ await settle(runtime, [room.locator, partner], async (held) => {
92
+ const left = await adoption(runtime, room, held.get(room.locator)?.replica, local, submitted, accepted);
93
+ const there = held.get(partner)?.replica;
94
+ const arriving = there?.queue.find((batch) => batch.id === submitted.id);
95
+ const arrived = other === undefined || arriving === undefined || accepted.destination === undefined
96
+ ? null
97
+ : await adoption(runtime, other, there, local, arriving, {
98
+ kind: 'accepted',
99
+ ...accepted.destination,
100
+ });
101
+ kept = left !== unconfirmed;
102
+ return restands([left, arrived]);
103
+ });
104
+ submitLater(runtime, partner);
105
+ return kept;
106
+ }
107
+ async function behindIn({ store }, locator, batch) {
108
+ const local = await store.open();
109
+ const [order, { room }] = await Promise.all([
110
+ local.order(locator),
111
+ local.pending(locator, batch.id),
112
+ ]);
113
+ return room ? order.indexOf(batch.id) > 0 : order.length > 0;
114
+ }
115
+ async function submitRoom(runtime, room, local, authorized, progress, signal) {
116
+ const { store, socket, presence } = runtime;
117
+ while (socket.continuing() &&
118
+ socket.session.now().authorization !== undefined &&
119
+ !signal.aborted) {
120
+ const headId = (await local.order(room.locator)).find((id) => store.landed.of(room.locator, id) === undefined);
121
+ if (headId === undefined)
122
+ return 'done';
123
+ const [head, pending] = await Promise.all([
124
+ local.batch(room.locator, headId),
125
+ local.pending(room.locator, headId),
126
+ ]);
127
+ if (head === null || !pending.room)
128
+ return 'done';
129
+ const { state } = pending;
130
+ const partner = partnerOf(head, room.locator);
131
+ if (partner !== null && !leavingIn(head, room.locator)) {
132
+ submitLater(runtime, partner);
133
+ return 'done';
134
+ }
135
+ if (partner !== null && (await behindIn(runtime, partner, head))) {
136
+ progress.complete = false;
137
+ return 'done';
138
+ }
139
+ const { submission, lost: earlier } = state ?? {
140
+ submission: { state: 'waiting' },
141
+ lost: false,
142
+ };
143
+ if (submission.state === 'reset' && Date.now() < Date.parse(submission.reset)) {
144
+ progress.complete = false;
145
+ return { at: Date.parse(submission.reset) };
146
+ }
147
+ if (socket.writesHeld()) {
148
+ progress.complete = false;
149
+ return 'done';
150
+ }
151
+ const lost = earlier || submission.state === 'submitted';
152
+ let result;
153
+ await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'submitted' }, lost));
154
+ if (socket.session.now().paused || presence.lost(room.locator))
155
+ return 'done';
156
+ if (signal.aborted || socket.writesHeld()) {
157
+ await store.exclusive(() => mark(runtime, local, room.locator, head, submission, earlier));
158
+ if (signal.aborted)
159
+ return 'done';
160
+ progress.complete = false;
161
+ return 'done';
162
+ }
163
+ const opensBefore = socket.session.now().openSignals;
164
+ const answeredHere = socket.awaitingAnswer(room.locator);
165
+ const answeredThere = partner === null ? () => { } : socket.awaitingAnswer(partner);
166
+ const heard = () => {
167
+ answeredHere();
168
+ answeredThere();
169
+ };
170
+ try {
171
+ result = await socket.mutate(authorized, {
172
+ locator: room.locator,
173
+ changeBatch: head,
174
+ file: batchFile(store, head),
175
+ ...(state?.upload === undefined ? {} : { upload: state.upload }),
176
+ }, (upload) => store.exclusive(() => keepUpload(runtime, local, room.locator, head.id, upload)));
177
+ }
178
+ catch (error) {
179
+ runtime.retries.failed('sending', submitting(room.locator), error);
180
+ heard();
181
+ progress.complete = false;
182
+ if (socket.continuing())
183
+ progress.reachable = false;
184
+ return 'again';
185
+ }
186
+ if (signal.aborted) {
187
+ heard();
188
+ return 'done';
189
+ }
190
+ if (result.kind !== 'accepted' || !socket.continuing())
191
+ heard();
192
+ if (!socket.continuing())
193
+ return 'done';
194
+ if (result.kind === 'accepted')
195
+ runtime.retries.succeeded('sending', submitting(room.locator));
196
+ if (result.kind === 'transport-uncertainty') {
197
+ runtime.retries.uncertain('sending', submitting(room.locator), result);
198
+ progress.complete = false;
199
+ progress.reachable = false;
200
+ return 'again';
201
+ }
202
+ if (result.kind === 'room-not-readable') {
203
+ progress.complete = false;
204
+ roomUnreadable(runtime, (presence.room(result.locator) ?? room).locator);
205
+ return 'done';
206
+ }
207
+ if (result.kind === 'revoked-authorization') {
208
+ await refuse(runtime, 'revoked-authorization');
209
+ return 'done';
210
+ }
211
+ if (result.kind === 'scoped-refusal') {
212
+ await scoped(runtime, result, room.locator, declared(room));
213
+ progress.complete = false;
214
+ return 'done';
215
+ }
216
+ if (result.kind === 'write-halted') {
217
+ await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'waiting' }, lost));
218
+ if (!socket.haltedSince(opensBefore))
219
+ continue;
220
+ progress.complete = false;
221
+ return 'done';
222
+ }
223
+ const other = partner === null ? undefined : presence.room(partner);
224
+ if (result.kind === 'retryable-refusal') {
225
+ runtime.retries.failed('sending', submitting(room.locator), refusalError(result));
226
+ const reset = result.reset;
227
+ progress.complete = false;
228
+ await store.exclusive(() => mark(runtime, local, room.locator, head, reset === undefined ? { state: 'waiting' } : { state: 'reset', reset }, lost));
229
+ return reset === undefined ? 'again' : { at: Date.parse(reset) };
230
+ }
231
+ if (result.kind === 'conflicted' || result.kind === 'rejected') {
232
+ const refreshed = async () => ({
233
+ there: other === undefined ? null : await advanced(runtime, other, local, authorized),
234
+ here: await advanced(runtime, room, local, authorized),
235
+ });
236
+ const judged = result.kind === 'conflicted' && other !== undefined ? await refreshed() : null;
237
+ if (judged !== null && (judged.there !== null || judged.here !== null)) {
238
+ await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'waiting' }, lost));
239
+ if (other !== undefined && judged.there !== null) {
240
+ await withhold(runtime, judged.there, other, local, progress);
241
+ }
242
+ if (judged.here !== null)
243
+ await withhold(runtime, judged.here, room, local, progress);
244
+ return 'done';
245
+ }
246
+ await answered(runtime, room.locator, head, result);
247
+ const { there, here } = judged ?? (await refreshed());
248
+ if (other !== undefined && there !== null) {
249
+ await withhold(runtime, there, other, local, progress);
250
+ }
251
+ if (here !== null) {
252
+ await withhold(runtime, here, room, local, progress);
253
+ return 'done';
254
+ }
255
+ continue;
256
+ }
257
+ const kept = await (partner === null
258
+ ? adopted(runtime, room, local, head, result)
259
+ : adoptedMove(runtime, room, partner, local, head, result)).finally(heard);
260
+ if (!kept) {
261
+ progress.complete = false;
262
+ return 'done';
263
+ }
264
+ }
265
+ return 'done';
266
+ }
267
+ function submitting(locator) {
268
+ return `submit ${locator}`;
269
+ }
270
+ export function submitLater(runtime, locator) {
271
+ if (runtime.localSaves)
272
+ return;
273
+ void runtime.recovery.attempt(submitting(locator), (signal) => submitPass(runtime, locator, signal));
274
+ }
275
+ async function submitPass(runtime, locator, signal) {
276
+ const { store, socket, presence } = runtime;
277
+ const room = presence.room(locator);
278
+ if (!socket.continuing() || socket.stopping() || room === undefined) {
279
+ return 'done';
280
+ }
281
+ const progress = { complete: true, reachable: true };
282
+ let next;
283
+ try {
284
+ await socket.authorize();
285
+ const { authorization } = socket.session.now();
286
+ if (authorization === undefined)
287
+ return 'done';
288
+ next = await submitRoom(runtime, room, await store.open(), authorization, progress, signal);
289
+ }
290
+ catch (error) {
291
+ runtime.retries.failed('sending', submitting(locator), error);
292
+ progress.reachable = false;
293
+ next = 'again';
294
+ }
295
+ if (signal.aborted)
296
+ return 'done';
297
+ await rest(runtime, progress);
298
+ return next === 'again' && !socket.isOpen() ? 'done' : next;
299
+ }
@@ -0,0 +1,30 @@
1
+ import { type Expected, type Expecting } from './expectation.js';
2
+ export type Ended = 'accepted' | 'refused' | 'unanswered' | 'unsent';
3
+ export type Send<O> = {
4
+ (name: string, input: unknown, sending: (operation: string) => Promise<O>): Promise<O>;
5
+ expect(expected: Expected): void;
6
+ };
7
+ export type LaneShown<O> = {
8
+ readonly busy: boolean;
9
+ readonly drawn: boolean;
10
+ readonly ended: O | null;
11
+ };
12
+ export type Lane<O> = {
13
+ run(steps: (send: Send<O>) => Promise<O>, expected?: Expected): Promise<O>;
14
+ shown(): LaneShown<O>;
15
+ subscribe(listener: () => void): () => void;
16
+ forget(): void;
17
+ };
18
+ export type Acting<O> = {
19
+ open(): Lane<O>;
20
+ };
21
+ export type ActingRules<O> = {
22
+ readonly store: Pick<Expecting, 'begin' | 'expect' | 'drop'>;
23
+ readonly uncertain: O;
24
+ ending(outcome: O): Ended;
25
+ acted?(): void;
26
+ mint?(): string;
27
+ settles?(operation: string): Promise<boolean>;
28
+ };
29
+ export declare function acting<O>(rules: ActingRules<O>): Acting<O>;
30
+ //# sourceMappingURL=act-lanes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"act-lanes.d.ts","sourceRoot":"","sources":["../src/act-lanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG/E,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvF,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3E,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;IACtB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,MAAM,IAAI,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACtB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;IAC1B,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,IAAI,CAAC,IAAI,MAAM,CAAC;IAChB,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/C,CAAC;AAUF,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CA6N1D"}
@@ -0,0 +1,225 @@
1
+ import { expectedList } from './expectation.js';
2
+ import { changeBatchIdentity } from './identity.js';
3
+ const IDLE = { busy: false, drawn: false, ended: null };
4
+ export function acting(rules) {
5
+ const { store, uncertain, ending, settles } = rules;
6
+ const mint = rules.mint ?? (() => changeBatchIdentity());
7
+ const identities = new Map();
8
+ const waiting = new Map();
9
+ const settling = new Map();
10
+ const blobs = new WeakMap();
11
+ let counted = 0;
12
+ let touches = 0;
13
+ const requestOf = (name, input) => {
14
+ const carried = [];
15
+ const json = JSON.stringify(input, (_key, value) => {
16
+ if (!(value instanceof Blob))
17
+ return value;
18
+ let one = blobs.get(value);
19
+ if (one === undefined) {
20
+ counted += 1;
21
+ one = counted;
22
+ blobs.set(value, one);
23
+ }
24
+ carried.push(one);
25
+ return null;
26
+ });
27
+ return `${name}\u0000${json}\u0000${carried.join(',')}`;
28
+ };
29
+ const identityOf = (request) => {
30
+ const held = identities.get(request);
31
+ if (held !== undefined)
32
+ return held;
33
+ const fresh = { operation: mint(), touched: 0, flying: 0 };
34
+ identities.set(request, fresh);
35
+ return fresh;
36
+ };
37
+ const settled = (act, ended, calls) => {
38
+ const released = new Map();
39
+ for (const { request, identity, ended: answered } of calls) {
40
+ const heard = answered === 'accepted' || answered === 'refused';
41
+ if (ended === 'accepted' && heard)
42
+ released.set(request, identity.touched);
43
+ else {
44
+ touches += 1;
45
+ identity.touched = touches;
46
+ identities.set(request, identity);
47
+ }
48
+ }
49
+ if (ended === 'refused' || ended === 'unsent')
50
+ store.drop(act);
51
+ for (const { request, ended: answered } of calls) {
52
+ const earlier = waiting.get(request);
53
+ if (answered === 'unsent' && earlier !== undefined)
54
+ continue;
55
+ if (earlier !== undefined && earlier !== act)
56
+ store.drop(earlier);
57
+ if (ended === 'unanswered')
58
+ waiting.set(request, act);
59
+ else
60
+ waiting.delete(request);
61
+ }
62
+ if (ended === 'accepted' || calls.some((one) => one.ended === 'accepted'))
63
+ rules.acted?.();
64
+ return released;
65
+ };
66
+ const release = (released) => {
67
+ for (const [request, touched] of released) {
68
+ const held = identities.get(request);
69
+ if (held !== undefined && held.touched === touched && held.flying === 0) {
70
+ identities.delete(request);
71
+ }
72
+ }
73
+ };
74
+ return {
75
+ open() {
76
+ const listeners = new Set();
77
+ const releasing = new Map();
78
+ let tail = Promise.resolve();
79
+ let pressed = 0;
80
+ let drawing = 0;
81
+ let ended = null;
82
+ let held = null;
83
+ let presses = 0;
84
+ let shown = IDLE;
85
+ const show = () => {
86
+ const busy = pressed > 0;
87
+ const drawn = drawing > 0;
88
+ if (shown.busy === busy && shown.drawn === drawn && shown.ended === ended)
89
+ return;
90
+ shown = { busy, drawn, ended };
91
+ for (const listener of listeners)
92
+ listener();
93
+ };
94
+ const awaiting = (outcome, operations, heard, again) => new Promise((resolve) => {
95
+ const forgotten = () => {
96
+ for (const operation of operations)
97
+ if (settling.get(operation) === record)
98
+ settling.delete(operation);
99
+ };
100
+ const record = {
101
+ supersede() {
102
+ if (held !== record)
103
+ return;
104
+ held = null;
105
+ forgotten();
106
+ resolve(outcome);
107
+ },
108
+ };
109
+ held = record;
110
+ for (const operation of operations)
111
+ settling.set(operation, record);
112
+ const answers = operations.map((operation) => heard(operation).then((answered) => {
113
+ if (!answered)
114
+ record.supersede();
115
+ return answered;
116
+ }));
117
+ void Promise.all(answers).then(() => {
118
+ if (held !== record)
119
+ return;
120
+ held = null;
121
+ forgotten();
122
+ resolve(again());
123
+ }, () => record.supersede());
124
+ });
125
+ const attempt = (steps, expected, press) => {
126
+ const act = store.begin();
127
+ let drew = false;
128
+ const expect = (more) => {
129
+ if (expectedList(more).length === 0)
130
+ return;
131
+ store.expect(act, more);
132
+ if (drew)
133
+ return;
134
+ drew = true;
135
+ drawing += 1;
136
+ show();
137
+ };
138
+ pressed += 1;
139
+ expect(expected);
140
+ show();
141
+ const calls = [];
142
+ const send = Object.assign(async (name, input, sending) => {
143
+ const request = requestOf(name, input);
144
+ const identity = identityOf(request);
145
+ settling.get(identity.operation)?.supersede();
146
+ const called = { request, identity, ended: null };
147
+ calls.push(called);
148
+ touches += 1;
149
+ identity.touched = touches;
150
+ identity.flying += 1;
151
+ let outcome;
152
+ try {
153
+ outcome = await sending(identity.operation);
154
+ }
155
+ catch {
156
+ outcome = uncertain;
157
+ }
158
+ finally {
159
+ identity.flying -= 1;
160
+ }
161
+ called.ended = ending(outcome);
162
+ return outcome;
163
+ }, { expect });
164
+ const end = (outcome, how) => {
165
+ for (const [request, touched] of settled(act, how, calls))
166
+ releasing.set(request, touched);
167
+ pressed -= 1;
168
+ if (drew)
169
+ drawing -= 1;
170
+ ended = outcome;
171
+ if (pressed === 0) {
172
+ release(releasing);
173
+ releasing.clear();
174
+ }
175
+ show();
176
+ };
177
+ const turn = tail.then(async () => {
178
+ ended = null;
179
+ show();
180
+ let outcome;
181
+ try {
182
+ outcome = await steps(send);
183
+ }
184
+ catch (error) {
185
+ end(uncertain, 'unanswered');
186
+ throw error;
187
+ }
188
+ const how = ending(outcome);
189
+ end(outcome, how);
190
+ return { outcome, how };
191
+ });
192
+ tail = turn.catch(() => undefined);
193
+ return turn.then(({ outcome, how }) => {
194
+ const lost = calls.flatMap(({ identity, ended: answered }) => answered === 'unanswered' ? [identity.operation] : []);
195
+ if (how !== 'unanswered' || lost.length === 0 || settles === undefined)
196
+ return outcome;
197
+ if (press !== presses)
198
+ return outcome;
199
+ return awaiting(outcome, lost, settles, () => attempt(steps, expected, press));
200
+ });
201
+ };
202
+ const run = (steps, expected = null) => {
203
+ held?.supersede();
204
+ presses += 1;
205
+ return attempt(steps, expected, presses);
206
+ };
207
+ return {
208
+ run,
209
+ shown: () => shown,
210
+ subscribe(listener) {
211
+ listeners.add(listener);
212
+ return () => {
213
+ listeners.delete(listener);
214
+ };
215
+ },
216
+ forget() {
217
+ if (pressed > 0 || ended === null)
218
+ return;
219
+ ended = null;
220
+ show();
221
+ },
222
+ };
223
+ },
224
+ };
225
+ }
@@ -0,0 +1,26 @@
1
+ import type { ConversationHistoryRequest } from './adapter.js';
2
+ import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
3
+ import type { Attempted } from './recovery.js';
4
+ import type { Attempt } from './retried.js';
5
+ import type { Runtime } from './runtime.js';
6
+ export type HistoryQuery = {
7
+ revision?: string;
8
+ pageToken?: string;
9
+ };
10
+ export declare function readHistory(runtime: Runtime, locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
11
+ export declare function located(runtime: Runtime, room: string, path: string, destination: string): Promise<{
12
+ room: string;
13
+ path: string;
14
+ } | null>;
15
+ export declare function resolveReference(runtime: Runtime, room: string, path: string, destination: string): Promise<Resolution>;
16
+ export type Invoked = {
17
+ readonly dispatching?: () => Promise<void>;
18
+ readonly attempt?: Attempt;
19
+ };
20
+ export declare function invokeAction(runtime: Runtime, name: string, input: unknown, { dispatching, attempt }?: Invoked): Promise<CallResult>;
21
+ export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): Promise<CallResult>;
22
+ export declare function called(runtime: Runtime, name: string, input: unknown, attempt?: Attempt): Promise<CallResult>;
23
+ export declare function answeredCall(runtime: Runtime, operation: string): Promise<boolean>;
24
+ export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
25
+ export declare function resendLater(runtime: Runtime): void;
26
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAM/D,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAOF,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,YAAiB,GACvB,OAAO,CAAC,aAAa,CAAC,CA+BxB;AAED,wBAAsB,OAAO,CAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAShD;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,CAAC,CAuBrB;AAwBD,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,EAAE,WAAW,EAAE,OAAO,EAAE,GAAE,OAAY,GACrC,OAAO,CAAC,UAAU,CAAC,CA6BrB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,UAAU,CAAC,CAerB;AA4GD,wBAAsB,MAAM,CAC1B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,UAAU,CAAC,CAKrB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAaxF;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAe3F;AAiBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAG3C"}