@agentshouse/mdruntime 0.1.0-c091c0855b688 → 0.1.0-c0aa19c04da09

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 (284) hide show
  1. package/README.md +21 -19
  2. package/dist/acceptance.d.ts.map +1 -1
  3. package/dist/acceptance.js +26 -36
  4. package/dist/act-lanes.d.ts +30 -0
  5. package/dist/act-lanes.d.ts.map +1 -0
  6. package/dist/act-lanes.js +225 -0
  7. package/dist/actions.d.ts +8 -2
  8. package/dist/actions.d.ts.map +1 -1
  9. package/dist/actions.js +172 -73
  10. package/dist/adapter.d.ts +129 -24
  11. package/dist/adapter.d.ts.map +1 -1
  12. package/dist/attached-model.d.ts +0 -1
  13. package/dist/attached-model.d.ts.map +1 -1
  14. package/dist/attached-model.js +2 -7
  15. package/dist/authored.d.ts +88 -0
  16. package/dist/authored.d.ts.map +1 -0
  17. package/dist/authored.js +347 -0
  18. package/dist/binary.d.ts +6 -2
  19. package/dist/binary.d.ts.map +1 -1
  20. package/dist/binary.js +10 -3
  21. package/dist/chain.d.ts +1 -1
  22. package/dist/chain.d.ts.map +1 -1
  23. package/dist/chain.js +5 -2
  24. package/dist/change.d.ts +6 -2
  25. package/dist/change.d.ts.map +1 -1
  26. package/dist/change.js +3 -0
  27. package/dist/chat-types.d.ts +0 -2
  28. package/dist/chat-types.d.ts.map +1 -1
  29. package/dist/chat-types.js +2 -4
  30. package/dist/client.d.ts +22 -23
  31. package/dist/client.d.ts.map +1 -1
  32. package/dist/client.js +49 -64
  33. package/dist/collection.d.ts +6 -1
  34. package/dist/collection.d.ts.map +1 -1
  35. package/dist/collection.js +23 -9
  36. package/dist/column.d.ts +5 -0
  37. package/dist/column.d.ts.map +1 -0
  38. package/dist/column.js +9 -0
  39. package/dist/compile.d.ts +4 -1
  40. package/dist/compile.d.ts.map +1 -1
  41. package/dist/compile.js +87 -43
  42. package/dist/connection.d.ts +1 -1
  43. package/dist/connection.d.ts.map +1 -1
  44. package/dist/connection.js +26 -15
  45. package/dist/context.d.ts.map +1 -1
  46. package/dist/context.js +1 -1
  47. package/dist/conversation-live.d.ts +25 -11
  48. package/dist/conversation-live.d.ts.map +1 -1
  49. package/dist/conversation-live.js +23 -11
  50. package/dist/conversation-row.d.ts +8 -1
  51. package/dist/conversation-row.d.ts.map +1 -1
  52. package/dist/conversation-row.js +20 -7
  53. package/dist/conversation.d.ts +43 -11
  54. package/dist/conversation.d.ts.map +1 -1
  55. package/dist/conversation.js +312 -184
  56. package/dist/declaration.js +1 -1
  57. package/dist/discovery.d.ts +3 -1
  58. package/dist/discovery.d.ts.map +1 -1
  59. package/dist/discovery.js +46 -48
  60. package/dist/download.d.ts +6 -0
  61. package/dist/download.d.ts.map +1 -0
  62. package/dist/download.js +42 -0
  63. package/dist/durability.d.ts +5 -0
  64. package/dist/durability.d.ts.map +1 -1
  65. package/dist/durability.js +7 -0
  66. package/dist/entry.d.ts +16 -1
  67. package/dist/entry.d.ts.map +1 -1
  68. package/dist/entry.js +75 -30
  69. package/dist/expectation.d.ts +25 -14
  70. package/dist/expectation.d.ts.map +1 -1
  71. package/dist/expectation.js +51 -20
  72. package/dist/failure.d.ts +2 -0
  73. package/dist/failure.d.ts.map +1 -1
  74. package/dist/failure.js +6 -1
  75. package/dist/figures.d.ts.map +1 -1
  76. package/dist/figures.js +4 -2
  77. package/dist/file.d.ts +1 -1
  78. package/dist/file.d.ts.map +1 -1
  79. package/dist/file.js +3 -2
  80. package/dist/host.d.ts +7 -2
  81. package/dist/host.d.ts.map +1 -1
  82. package/dist/host.js +94 -30
  83. package/dist/house-query.d.ts +24 -0
  84. package/dist/house-query.d.ts.map +1 -0
  85. package/dist/house-query.js +82 -0
  86. package/dist/index.d.ts +22 -14
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +15 -8
  89. package/dist/install.d.ts +10 -5
  90. package/dist/install.d.ts.map +1 -1
  91. package/dist/install.js +49 -55
  92. package/dist/lifecycle.d.ts +2 -2
  93. package/dist/lifecycle.d.ts.map +1 -1
  94. package/dist/lifecycle.js +69 -50
  95. package/dist/listing.d.ts +28 -20
  96. package/dist/listing.d.ts.map +1 -1
  97. package/dist/listing.js +69 -69
  98. package/dist/live.d.ts +19 -3
  99. package/dist/live.d.ts.map +1 -1
  100. package/dist/live.js +94 -36
  101. package/dist/loaded.d.ts +7 -0
  102. package/dist/loaded.d.ts.map +1 -0
  103. package/dist/loaded.js +46 -0
  104. package/dist/locks.d.ts +2 -4
  105. package/dist/locks.d.ts.map +1 -1
  106. package/dist/locks.js +10 -38
  107. package/dist/lost.d.ts.map +1 -1
  108. package/dist/lost.js +8 -20
  109. package/dist/media.d.ts +19 -3
  110. package/dist/media.d.ts.map +1 -1
  111. package/dist/media.js +167 -33
  112. package/dist/memory.d.ts +7 -3
  113. package/dist/memory.d.ts.map +1 -1
  114. package/dist/memory.js +93 -34
  115. package/dist/messages.d.ts +17 -3
  116. package/dist/messages.d.ts.map +1 -1
  117. package/dist/messages.js +34 -13
  118. package/dist/modal.d.ts +2 -0
  119. package/dist/modal.d.ts.map +1 -0
  120. package/dist/modal.js +11 -0
  121. package/dist/model.d.ts +4 -2
  122. package/dist/model.d.ts.map +1 -1
  123. package/dist/model.js +7 -1
  124. package/dist/models.d.ts.map +1 -1
  125. package/dist/models.js +18 -35
  126. package/dist/name.d.ts +0 -1
  127. package/dist/name.d.ts.map +1 -1
  128. package/dist/name.js +3 -7
  129. package/dist/observation.d.ts +29 -12
  130. package/dist/observation.d.ts.map +1 -1
  131. package/dist/observation.js +206 -69
  132. package/dist/online.d.ts +7 -0
  133. package/dist/online.d.ts.map +1 -0
  134. package/dist/online.js +29 -0
  135. package/dist/opened.d.ts +1 -1
  136. package/dist/opened.d.ts.map +1 -1
  137. package/dist/opened.js +2 -2
  138. package/dist/opening.d.ts.map +1 -1
  139. package/dist/opening.js +20 -10
  140. package/dist/outcome.d.ts +24 -4
  141. package/dist/outcome.d.ts.map +1 -1
  142. package/dist/outcome.js +33 -3
  143. package/dist/overlay.d.ts +7 -4
  144. package/dist/overlay.d.ts.map +1 -1
  145. package/dist/overlay.js +11 -9
  146. package/dist/page-metadata.d.ts +8 -0
  147. package/dist/page-metadata.d.ts.map +1 -0
  148. package/dist/page-metadata.js +19 -0
  149. package/dist/parts.d.ts +4 -9
  150. package/dist/parts.d.ts.map +1 -1
  151. package/dist/parts.js +30 -15
  152. package/dist/preparation.d.ts +33 -7
  153. package/dist/preparation.d.ts.map +1 -1
  154. package/dist/preparation.js +207 -96
  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 +2 -2
  159. package/dist/queries.d.ts.map +1 -1
  160. package/dist/queries.js +136 -78
  161. package/dist/query.d.ts +2 -2
  162. package/dist/questions.d.ts +1 -5
  163. package/dist/questions.d.ts.map +1 -1
  164. package/dist/questions.js +3 -8
  165. package/dist/queue.d.ts +2 -1
  166. package/dist/queue.d.ts.map +1 -1
  167. package/dist/queue.js +74 -49
  168. package/dist/reach.d.ts +15 -6
  169. package/dist/reach.d.ts.map +1 -1
  170. package/dist/reach.js +180 -37
  171. package/dist/react.d.ts +11 -5
  172. package/dist/react.d.ts.map +1 -1
  173. package/dist/react.js +28 -5
  174. package/dist/readiness.d.ts +20 -4
  175. package/dist/readiness.d.ts.map +1 -1
  176. package/dist/readiness.js +17 -10
  177. package/dist/reads.d.ts +4 -2
  178. package/dist/reads.d.ts.map +1 -1
  179. package/dist/reads.js +7 -3
  180. package/dist/recovery.d.ts +4 -1
  181. package/dist/recovery.d.ts.map +1 -1
  182. package/dist/recovery.js +31 -8
  183. package/dist/reference-forms.d.ts +4 -0
  184. package/dist/reference-forms.d.ts.map +1 -0
  185. package/dist/reference-forms.js +74 -0
  186. package/dist/refresh.d.ts +1 -1
  187. package/dist/refresh.js +4 -4
  188. package/dist/refusal.d.ts.map +1 -1
  189. package/dist/refusal.js +2 -4
  190. package/dist/replica.d.ts.map +1 -1
  191. package/dist/replica.js +4 -4
  192. package/dist/retried.d.ts +30 -0
  193. package/dist/retried.d.ts.map +1 -0
  194. package/dist/retried.js +72 -0
  195. package/dist/room-draft.d.ts +30 -5
  196. package/dist/room-draft.d.ts.map +1 -1
  197. package/dist/room-draft.js +258 -32
  198. package/dist/room-drafts.d.ts.map +1 -1
  199. package/dist/room-drafts.js +11 -6
  200. package/dist/room-list.d.ts +10 -0
  201. package/dist/room-list.d.ts.map +1 -0
  202. package/dist/room-list.js +45 -0
  203. package/dist/rows.d.ts +11 -2
  204. package/dist/rows.d.ts.map +1 -1
  205. package/dist/rows.js +24 -10
  206. package/dist/running.d.ts +5 -0
  207. package/dist/running.d.ts.map +1 -0
  208. package/dist/running.js +10 -0
  209. package/dist/runtime.d.ts +9 -4
  210. package/dist/runtime.d.ts.map +1 -1
  211. package/dist/save.d.ts +2 -0
  212. package/dist/save.d.ts.map +1 -1
  213. package/dist/save.js +105 -124
  214. package/dist/saves.d.ts +4 -2
  215. package/dist/saves.d.ts.map +1 -1
  216. package/dist/saves.js +82 -32
  217. package/dist/seed.d.ts.map +1 -1
  218. package/dist/seed.js +4 -4
  219. package/dist/shown.d.ts +7 -4
  220. package/dist/shown.d.ts.map +1 -1
  221. package/dist/shown.js +86 -59
  222. package/dist/socket/lanes.d.ts +12 -4
  223. package/dist/socket/lanes.d.ts.map +1 -1
  224. package/dist/socket/lanes.js +34 -8
  225. package/dist/socket/session.d.ts +4 -1
  226. package/dist/socket/session.d.ts.map +1 -1
  227. package/dist/socket/session.js +3 -0
  228. package/dist/socket.d.ts +4 -5
  229. package/dist/socket.d.ts.map +1 -1
  230. package/dist/socket.js +4 -14
  231. package/dist/source.d.ts +7 -7
  232. package/dist/source.d.ts.map +1 -1
  233. package/dist/source.js +15 -2
  234. package/dist/store/installs.d.ts +2 -2
  235. package/dist/store/installs.d.ts.map +1 -1
  236. package/dist/store/installs.js +10 -4
  237. package/dist/store/readiness.d.ts +5 -4
  238. package/dist/store/readiness.d.ts.map +1 -1
  239. package/dist/store/readiness.js +28 -12
  240. package/dist/store/records.d.ts +24 -5
  241. package/dist/store/records.d.ts.map +1 -1
  242. package/dist/store/records.js +68 -22
  243. package/dist/store/rooms-shown.d.ts +8 -0
  244. package/dist/store/rooms-shown.d.ts.map +1 -0
  245. package/dist/store/rooms-shown.js +13 -0
  246. package/dist/store.d.ts +24 -14
  247. package/dist/store.d.ts.map +1 -1
  248. package/dist/store.js +49 -17
  249. package/dist/stored.d.ts +39 -14
  250. package/dist/stored.d.ts.map +1 -1
  251. package/dist/stored.js +215 -57
  252. package/dist/surface.d.ts +14 -8
  253. package/dist/surface.d.ts.map +1 -1
  254. package/dist/surface.js +63 -32
  255. package/dist/sync.d.ts +4 -2
  256. package/dist/sync.d.ts.map +1 -1
  257. package/dist/sync.js +109 -82
  258. package/dist/tables.d.ts +28 -52
  259. package/dist/tables.d.ts.map +1 -1
  260. package/dist/tables.js +95 -326
  261. package/dist/tallies.d.ts.map +1 -1
  262. package/dist/tallies.js +1 -2
  263. package/dist/validation.d.ts +2 -0
  264. package/dist/validation.d.ts.map +1 -1
  265. package/dist/validation.js +50 -10
  266. package/dist/wire.d.ts +67 -8
  267. package/dist/wire.d.ts.map +1 -1
  268. package/dist/wire.js +27 -11
  269. package/package.json +4 -4
  270. package/dist/attempt.d.ts +0 -16
  271. package/dist/attempt.d.ts.map +0 -1
  272. package/dist/attempt.js +0 -70
  273. package/dist/job.d.ts +0 -5
  274. package/dist/job.d.ts.map +0 -1
  275. package/dist/job.js +0 -7
  276. package/dist/log.d.ts +0 -6
  277. package/dist/log.d.ts.map +0 -1
  278. package/dist/log.js +0 -14
  279. package/dist/socket/rooms.d.ts +0 -41
  280. package/dist/socket/rooms.d.ts.map +0 -1
  281. package/dist/socket/rooms.js +0 -90
  282. package/dist/store/fences.d.ts +0 -16
  283. package/dist/store/fences.d.ts.map +0 -1
  284. package/dist/store/fences.js +0 -26
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`; `useReading`, a reader of an expectation store |
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: `formatted` lays it out for a device format, keeping the Authored store's tables and creating any it lacks, and `answerRuntime` answers it |
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, search, Room
52
- Draft, Save and the Chat, are the `apps/` pages of House's Guide, which House's
53
- `guide/open` 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` tool opens.
54
56
 
55
57
  ## License
56
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../src/acceptance.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAiX5C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAK5D"}
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"}
@@ -1,8 +1,8 @@
1
+ import { refusalError } from './failure.js';
1
2
  import { changeSet } from './change-set.js';
2
3
  import { declared } from './declaration.js';
3
4
  import { leaving as leavingIn, partnerOf } from './change.js';
4
5
  import { olderThan, showing } from './install.js';
5
- import { readable } from './listing.js';
6
6
  import { scoped } from './models.js';
7
7
  import { answered, settle } from './queue.js';
8
8
  import { refuse } from './refusal.js';
@@ -13,7 +13,7 @@ import { advanced, withhold } from './sync.js';
13
13
  import { unconfirmed } from './transfer.js';
14
14
  import { stepped } from './turn.js';
15
15
  async function mark(runtime, local, locator, batch, submission, lost) {
16
- const { store, socket } = runtime;
16
+ const { store, socket, presence } = runtime;
17
17
  const partner = partnerOf(batch, locator);
18
18
  for (const held of partner === null ? [locator] : [locator, partner]) {
19
19
  const { state, room } = await local.pending(held, batch.id);
@@ -23,27 +23,22 @@ async function mark(runtime, local, locator, batch, submission, lost) {
23
23
  continue;
24
24
  }
25
25
  await local.submit(held, batch.id, submission, lost);
26
- if (store.fences.has(held))
26
+ if (presence.lost(held))
27
27
  continue;
28
28
  if (room)
29
29
  store.changed(changeSet(held, { queue: true }));
30
30
  }
31
31
  statusShown(runtime);
32
32
  }
33
- async function keepUpload({ store, socket }, local, locator, identifier, upload) {
33
+ async function keepUpload({ socket, presence }, local, locator, identifier, upload) {
34
34
  if (!socket.continuing())
35
35
  throw new Error();
36
36
  await local.keepUpload(locator, identifier, upload);
37
- if (store.fences.has(locator))
37
+ if (presence.lost(locator))
38
38
  throw new Error();
39
39
  if (!socket.continuing())
40
40
  throw new Error();
41
41
  }
42
- function logAccepted({ journal }, locator, submitted, accepted) {
43
- journal.record(`outcome ${locator} ${submitted.id} accepted ${accepted.roomVersion}` +
44
- (accepted.author === undefined ? '' : ` author ${accepted.author}`) +
45
- (accepted.time === undefined ? '' : ` time ${accepted.time}`));
46
- }
47
42
  function restands(adoptions) {
48
43
  return adoptions.flatMap((one) => (one === null || !('record' in one) ? [] : [one]));
49
44
  }
@@ -55,7 +50,6 @@ async function adoption(runtime, room, current, local, submitted, accepted) {
55
50
  return null;
56
51
  }
57
52
  const held = current.record.roomVersion;
58
- logAccepted(runtime, room.locator, submitted, accepted);
59
53
  let record = current.record;
60
54
  let adopted;
61
55
  if (!socket.reads.reached(room.locator, held, accepted.roomVersion) &&
@@ -78,7 +72,7 @@ async function adoption(runtime, room, current, local, submitted, accepted) {
78
72
  ...(adopted === undefined ? {} : { adopted }),
79
73
  after() {
80
74
  showing(runtime, room.locator, accepted.roomVersion, reached);
81
- readable(runtime, room);
75
+ runtime.presence.readable(room.locator);
82
76
  },
83
77
  };
84
78
  }
@@ -92,7 +86,7 @@ async function adopted(runtime, room, local, submitted, accepted) {
92
86
  return kept;
93
87
  }
94
88
  async function adoptedMove(runtime, room, partner, local, submitted, accepted) {
95
- const other = runtime.socket.rooms.discovered(partner);
89
+ const other = runtime.presence.room(partner);
96
90
  let kept = true;
97
91
  await settle(runtime, [room.locator, partner], async (held) => {
98
92
  const left = await adoption(runtime, room, held.get(room.locator)?.replica, local, submitted, accepted);
@@ -119,11 +113,11 @@ async function behindIn({ store }, locator, batch) {
119
113
  return room ? order.indexOf(batch.id) > 0 : order.length > 0;
120
114
  }
121
115
  async function submitRoom(runtime, room, local, authorized, progress, signal) {
122
- const { store, socket, journal } = runtime;
116
+ const { store, socket, presence } = runtime;
123
117
  while (socket.continuing() &&
124
118
  socket.session.now().authorization !== undefined &&
125
119
  !signal.aborted) {
126
- const headId = (await local.order(room.locator)).find((id) => store.landed.of(room.locator, id) === undefined);
120
+ const headId = (await local.order(room.locator)).find((id) => store.conflicted.of(room.locator, id) === undefined);
127
121
  if (headId === undefined)
128
122
  return 'done';
129
123
  const [head, pending] = await Promise.all([
@@ -152,21 +146,18 @@ async function submitRoom(runtime, room, local, authorized, progress, signal) {
152
146
  }
153
147
  if (socket.writesHeld()) {
154
148
  progress.complete = false;
155
- journal.record(`submission ${room.locator} ${head.id} held`);
156
149
  return 'done';
157
150
  }
158
151
  const lost = earlier || submission.state === 'submitted';
159
152
  let result;
160
- journal.record(`submission ${room.locator} ${head.id}`);
161
153
  await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'submitted' }, lost));
162
- if (socket.session.now().paused || store.fences.has(room.locator))
154
+ if (socket.session.now().paused || presence.lost(room.locator))
163
155
  return 'done';
164
156
  if (signal.aborted || socket.writesHeld()) {
165
157
  await store.exclusive(() => mark(runtime, local, room.locator, head, submission, earlier));
166
158
  if (signal.aborted)
167
159
  return 'done';
168
160
  progress.complete = false;
169
- journal.record(`submission ${room.locator} ${head.id} held`);
170
161
  return 'done';
171
162
  }
172
163
  const opensBefore = socket.session.now().openSignals;
@@ -184,7 +175,8 @@ async function submitRoom(runtime, room, local, authorized, progress, signal) {
184
175
  ...(state?.upload === undefined ? {} : { upload: state.upload }),
185
176
  }, (upload) => store.exclusive(() => keepUpload(runtime, local, room.locator, head.id, upload)));
186
177
  }
187
- catch {
178
+ catch (error) {
179
+ runtime.retries.failed('sending', submitting(room.locator), error);
188
180
  heard();
189
181
  progress.complete = false;
190
182
  if (socket.continuing())
@@ -199,14 +191,17 @@ async function submitRoom(runtime, room, local, authorized, progress, signal) {
199
191
  heard();
200
192
  if (!socket.continuing())
201
193
  return 'done';
194
+ if (result.kind === 'accepted')
195
+ runtime.retries.succeeded('sending', submitting(room.locator));
202
196
  if (result.kind === 'transport-uncertainty') {
197
+ runtime.retries.uncertain('sending', submitting(room.locator), result);
203
198
  progress.complete = false;
204
199
  progress.reachable = false;
205
200
  return 'again';
206
201
  }
207
202
  if (result.kind === 'room-not-readable') {
208
203
  progress.complete = false;
209
- roomUnreadable(runtime, socket.rooms.discovered(result.locator) ?? room);
204
+ roomUnreadable(runtime, (presence.room(result.locator) ?? room).locator);
210
205
  return 'done';
211
206
  }
212
207
  if (result.kind === 'revoked-authorization') {
@@ -219,24 +214,15 @@ async function submitRoom(runtime, room, local, authorized, progress, signal) {
219
214
  return 'done';
220
215
  }
221
216
  if (result.kind === 'write-halted') {
222
- journal.record(`outcome ${room.locator} ${head.id} write-halted`);
223
217
  await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'waiting' }, lost));
224
218
  if (!socket.haltedSince(opensBefore))
225
219
  continue;
226
220
  progress.complete = false;
227
221
  return 'done';
228
222
  }
229
- const other = partner === null ? undefined : socket.rooms.discovered(partner);
230
- if (result.kind === 'conflicted' ||
231
- result.kind === 'rejected' ||
232
- result.kind === 'retryable-refusal') {
233
- journal.record(`outcome ${room.locator} ${head.id} ${result.kind}` +
234
- (result.kind === 'conflicted' && result.roomVersion !== undefined
235
- ? ` ${result.roomVersion}`
236
- : ''));
237
- journal.record(`refusal ${result.kind} ${result.code}`);
238
- }
223
+ const other = partner === null ? undefined : presence.room(partner);
239
224
  if (result.kind === 'retryable-refusal') {
225
+ runtime.retries.failed('sending', submitting(room.locator), refusalError(result));
240
226
  const reset = result.reset;
241
227
  progress.complete = false;
242
228
  await store.exclusive(() => mark(runtime, local, room.locator, head, reset === undefined ? { state: 'waiting' } : { state: 'reset', reset }, lost));
@@ -278,14 +264,17 @@ async function submitRoom(runtime, room, local, authorized, progress, signal) {
278
264
  }
279
265
  return 'done';
280
266
  }
267
+ function submitting(locator) {
268
+ return `submit ${locator}`;
269
+ }
281
270
  export function submitLater(runtime, locator) {
282
271
  if (runtime.localSaves)
283
272
  return;
284
- void runtime.recovery.attempt(`submit ${locator}`, (signal) => submitPass(runtime, locator, signal));
273
+ void runtime.recovery.attempt(submitting(locator), (signal) => submitPass(runtime, locator, signal));
285
274
  }
286
275
  async function submitPass(runtime, locator, signal) {
287
- const { store, socket } = runtime;
288
- const room = socket.rooms.discovered(locator);
276
+ const { store, socket, presence } = runtime;
277
+ const room = presence.room(locator);
289
278
  if (!socket.continuing() || socket.stopping() || room === undefined) {
290
279
  return 'done';
291
280
  }
@@ -298,7 +287,8 @@ async function submitPass(runtime, locator, signal) {
298
287
  return 'done';
299
288
  next = await submitRoom(runtime, room, await store.open(), authorization, progress, signal);
300
289
  }
301
- catch {
290
+ catch (error) {
291
+ runtime.retries.failed('sending', submitting(locator), error);
302
292
  progress.reachable = false;
303
293
  next = 'again';
304
294
  }
@@ -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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LE = { 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
+ }
package/dist/actions.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ConversationHistoryRequest } from './adapter.js';
2
2
  import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
3
3
  import type { Attempted } from './recovery.js';
4
+ import type { Attempt } from './retried.js';
4
5
  import type { Runtime } from './runtime.js';
5
6
  export type HistoryQuery = {
6
7
  revision?: string;
@@ -12,9 +13,14 @@ export declare function located(runtime: Runtime, room: string, path: string, de
12
13
  path: string;
13
14
  } | null>;
14
15
  export declare function resolveReference(runtime: Runtime, room: string, path: string, destination: string): Promise<Resolution>;
15
- export declare function invokeAction(runtime: Runtime, name: string, input: unknown, dispatching?: () => Promise<void>): Promise<CallResult>;
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>;
16
21
  export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): Promise<CallResult>;
17
- export declare function called(runtime: Runtime, name: string, input: unknown): 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>;
18
24
  export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
19
25
  export declare function resendLater(runtime: Runtime): void;
20
26
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK/D,OAAO,EAUL,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;AAG5C,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,C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