@agentshouse/mdruntime 0.1.0-c2af3ddcc243b → 0.1.0-c2d73b235d7d7

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 (266) hide show
  1. package/README.md +14 -13
  2. package/dist/acceptance.d.ts.map +1 -1
  3. package/dist/acceptance.js +32 -3
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +62 -19
  6. package/dist/adapter.d.ts +201 -28
  7. package/dist/adapter.d.ts.map +1 -1
  8. package/dist/attached-model.d.ts +0 -1
  9. package/dist/attached-model.d.ts.map +1 -1
  10. package/dist/attached-model.js +2 -7
  11. package/dist/{binary.d.ts → attachment.d.ts} +8 -4
  12. package/dist/attachment.d.ts.map +1 -0
  13. package/dist/attachment.js +15 -0
  14. package/dist/authored.d.ts +88 -0
  15. package/dist/authored.d.ts.map +1 -0
  16. package/dist/authored.js +345 -0
  17. package/dist/chain.d.ts +1 -1
  18. package/dist/chain.d.ts.map +1 -1
  19. package/dist/chain.js +5 -2
  20. package/dist/change.d.ts +6 -2
  21. package/dist/change.d.ts.map +1 -1
  22. package/dist/change.js +3 -0
  23. package/dist/chat-types.d.ts +0 -2
  24. package/dist/chat-types.d.ts.map +1 -1
  25. package/dist/chat-types.js +2 -4
  26. package/dist/client.d.ts +24 -8
  27. package/dist/client.d.ts.map +1 -1
  28. package/dist/client.js +26 -56
  29. package/dist/collection.d.ts +6 -1
  30. package/dist/collection.d.ts.map +1 -1
  31. package/dist/collection.js +23 -9
  32. package/dist/column.d.ts +5 -0
  33. package/dist/column.d.ts.map +1 -0
  34. package/dist/column.js +9 -0
  35. package/dist/compile.d.ts +2 -1
  36. package/dist/compile.d.ts.map +1 -1
  37. package/dist/compile.js +73 -42
  38. package/dist/connection.d.ts +1 -1
  39. package/dist/connection.d.ts.map +1 -1
  40. package/dist/connection.js +18 -8
  41. package/dist/context.d.ts.map +1 -1
  42. package/dist/context.js +1 -1
  43. package/dist/conversation-live.d.ts +19 -9
  44. package/dist/conversation-live.d.ts.map +1 -1
  45. package/dist/conversation-live.js +18 -8
  46. package/dist/conversation-row.d.ts +23 -1
  47. package/dist/conversation-row.d.ts.map +1 -1
  48. package/dist/conversation-row.js +37 -8
  49. package/dist/conversation.d.ts +26 -12
  50. package/dist/conversation.d.ts.map +1 -1
  51. package/dist/conversation.js +213 -160
  52. package/dist/declaration.js +3 -3
  53. package/dist/discovery.d.ts +3 -1
  54. package/dist/discovery.d.ts.map +1 -1
  55. package/dist/discovery.js +30 -5
  56. package/dist/download.d.ts +6 -0
  57. package/dist/download.d.ts.map +1 -0
  58. package/dist/download.js +42 -0
  59. package/dist/durability.d.ts +1 -0
  60. package/dist/durability.d.ts.map +1 -1
  61. package/dist/durability.js +3 -0
  62. package/dist/entry.d.ts +26 -1
  63. package/dist/entry.d.ts.map +1 -1
  64. package/dist/entry.js +126 -36
  65. package/dist/failure.d.ts.map +1 -1
  66. package/dist/failure.js +3 -1
  67. package/dist/figures.d.ts +1 -1
  68. package/dist/figures.d.ts.map +1 -1
  69. package/dist/figures.js +6 -4
  70. package/dist/file.d.ts +1 -1
  71. package/dist/file.d.ts.map +1 -1
  72. package/dist/file.js +3 -2
  73. package/dist/host.d.ts +7 -2
  74. package/dist/host.d.ts.map +1 -1
  75. package/dist/host.js +71 -29
  76. package/dist/house-query.d.ts +24 -0
  77. package/dist/house-query.d.ts.map +1 -0
  78. package/dist/house-query.js +102 -0
  79. package/dist/identity.d.ts +1 -1
  80. package/dist/identity.d.ts.map +1 -1
  81. package/dist/identity.js +1 -1
  82. package/dist/index.d.ts +21 -12
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +11 -5
  85. package/dist/install.d.ts +8 -2
  86. package/dist/install.d.ts.map +1 -1
  87. package/dist/install.js +40 -33
  88. package/dist/lifecycle.d.ts +1 -1
  89. package/dist/lifecycle.d.ts.map +1 -1
  90. package/dist/lifecycle.js +40 -25
  91. package/dist/linked-file.d.ts +7 -0
  92. package/dist/linked-file.d.ts.map +1 -0
  93. package/dist/linked-file.js +16 -0
  94. package/dist/listing.d.ts +24 -12
  95. package/dist/listing.d.ts.map +1 -1
  96. package/dist/listing.js +50 -21
  97. package/dist/live.d.ts +19 -3
  98. package/dist/live.d.ts.map +1 -1
  99. package/dist/live.js +94 -36
  100. package/dist/loaded.d.ts +7 -0
  101. package/dist/loaded.d.ts.map +1 -0
  102. package/dist/loaded.js +46 -0
  103. package/dist/locks.d.ts.map +1 -1
  104. package/dist/locks.js +4 -2
  105. package/dist/lost.js +1 -1
  106. package/dist/media.d.ts +19 -3
  107. package/dist/media.d.ts.map +1 -1
  108. package/dist/media.js +181 -34
  109. package/dist/memory.d.ts +7 -3
  110. package/dist/memory.d.ts.map +1 -1
  111. package/dist/memory.js +64 -23
  112. package/dist/messages.d.ts +12 -1
  113. package/dist/messages.d.ts.map +1 -1
  114. package/dist/messages.js +28 -6
  115. package/dist/modal.d.ts +2 -0
  116. package/dist/modal.d.ts.map +1 -0
  117. package/dist/modal.js +11 -0
  118. package/dist/model.d.ts +10 -7
  119. package/dist/model.d.ts.map +1 -1
  120. package/dist/model.js +7 -1
  121. package/dist/models.d.ts.map +1 -1
  122. package/dist/models.js +3 -3
  123. package/dist/name.d.ts +0 -1
  124. package/dist/name.d.ts.map +1 -1
  125. package/dist/name.js +3 -7
  126. package/dist/observation.d.ts +29 -12
  127. package/dist/observation.d.ts.map +1 -1
  128. package/dist/observation.js +206 -69
  129. package/dist/online.d.ts +7 -0
  130. package/dist/online.d.ts.map +1 -0
  131. package/dist/online.js +29 -0
  132. package/dist/opened.d.ts +5 -5
  133. package/dist/opened.d.ts.map +1 -1
  134. package/dist/opened.js +2 -2
  135. package/dist/opening.d.ts.map +1 -1
  136. package/dist/opening.js +20 -2
  137. package/dist/outcome.d.ts +30 -13
  138. package/dist/outcome.d.ts.map +1 -1
  139. package/dist/outcome.js +21 -6
  140. package/dist/overlay.d.ts +20 -9
  141. package/dist/overlay.d.ts.map +1 -1
  142. package/dist/overlay.js +110 -41
  143. package/dist/parts.d.ts +4 -1
  144. package/dist/parts.d.ts.map +1 -1
  145. package/dist/parts.js +30 -7
  146. package/dist/paths.d.ts +1 -1
  147. package/dist/paths.js +1 -1
  148. package/dist/preparation.d.ts +33 -7
  149. package/dist/preparation.d.ts.map +1 -1
  150. package/dist/preparation.js +195 -78
  151. package/dist/presence.d.ts +8 -2
  152. package/dist/presence.d.ts.map +1 -1
  153. package/dist/presence.js +24 -13
  154. package/dist/queries.d.ts +1 -1
  155. package/dist/queries.d.ts.map +1 -1
  156. package/dist/queries.js +115 -67
  157. package/dist/query.d.ts +2 -2
  158. package/dist/query.d.ts.map +1 -1
  159. package/dist/questions.d.ts +1 -0
  160. package/dist/questions.d.ts.map +1 -1
  161. package/dist/questions.js +3 -1
  162. package/dist/queue.d.ts +1 -1
  163. package/dist/queue.d.ts.map +1 -1
  164. package/dist/queue.js +55 -23
  165. package/dist/reach.d.ts +15 -6
  166. package/dist/reach.d.ts.map +1 -1
  167. package/dist/reach.js +140 -25
  168. package/dist/react.d.ts +12 -1
  169. package/dist/react.d.ts.map +1 -1
  170. package/dist/readiness.d.ts +22 -3
  171. package/dist/readiness.d.ts.map +1 -1
  172. package/dist/readiness.js +18 -10
  173. package/dist/reads.d.ts +1 -1
  174. package/dist/reads.d.ts.map +1 -1
  175. package/dist/reads.js +17 -6
  176. package/dist/recovery.d.ts +1 -0
  177. package/dist/recovery.d.ts.map +1 -1
  178. package/dist/recovery.js +2 -1
  179. package/dist/refresh.d.ts +1 -1
  180. package/dist/refresh.js +4 -4
  181. package/dist/replica.d.ts +3 -8
  182. package/dist/replica.d.ts.map +1 -1
  183. package/dist/replica.js +5 -5
  184. package/dist/room-draft.d.ts +29 -4
  185. package/dist/room-draft.d.ts.map +1 -1
  186. package/dist/room-draft.js +239 -18
  187. package/dist/room-drafts.d.ts.map +1 -1
  188. package/dist/room-drafts.js +12 -7
  189. package/dist/room-list.d.ts +10 -0
  190. package/dist/room-list.d.ts.map +1 -0
  191. package/dist/room-list.js +47 -0
  192. package/dist/rows.d.ts +11 -3
  193. package/dist/rows.d.ts.map +1 -1
  194. package/dist/rows.js +25 -11
  195. package/dist/run-tables.d.ts +25 -0
  196. package/dist/run-tables.d.ts.map +1 -0
  197. package/dist/run-tables.js +98 -0
  198. package/dist/running.d.ts +5 -0
  199. package/dist/running.d.ts.map +1 -0
  200. package/dist/running.js +10 -0
  201. package/dist/runs.d.ts +27 -0
  202. package/dist/runs.d.ts.map +1 -0
  203. package/dist/runs.js +92 -0
  204. package/dist/runtime.d.ts +7 -3
  205. package/dist/runtime.d.ts.map +1 -1
  206. package/dist/save.d.ts +1 -0
  207. package/dist/save.d.ts.map +1 -1
  208. package/dist/save.js +31 -96
  209. package/dist/saves.d.ts +7 -5
  210. package/dist/saves.d.ts.map +1 -1
  211. package/dist/saves.js +109 -55
  212. package/dist/seed.d.ts.map +1 -1
  213. package/dist/seed.js +2 -2
  214. package/dist/selector.d.ts +3 -0
  215. package/dist/selector.d.ts.map +1 -0
  216. package/dist/selector.js +22 -0
  217. package/dist/shown.d.ts +4 -2
  218. package/dist/shown.d.ts.map +1 -1
  219. package/dist/shown.js +83 -51
  220. package/dist/socket/session.d.ts +4 -1
  221. package/dist/socket/session.d.ts.map +1 -1
  222. package/dist/socket/session.js +3 -0
  223. package/dist/socket.d.ts +4 -1
  224. package/dist/socket.d.ts.map +1 -1
  225. package/dist/socket.js +8 -0
  226. package/dist/source.d.ts +42 -0
  227. package/dist/source.d.ts.map +1 -1
  228. package/dist/source.js +76 -9
  229. package/dist/store/installs.d.ts +2 -2
  230. package/dist/store/installs.d.ts.map +1 -1
  231. package/dist/store/installs.js +10 -4
  232. package/dist/store/readiness.d.ts +5 -4
  233. package/dist/store/readiness.d.ts.map +1 -1
  234. package/dist/store/readiness.js +28 -12
  235. package/dist/store/records.d.ts +25 -5
  236. package/dist/store/records.d.ts.map +1 -1
  237. package/dist/store/records.js +59 -23
  238. package/dist/store/rooms-shown.d.ts +8 -0
  239. package/dist/store/rooms-shown.d.ts.map +1 -0
  240. package/dist/store/rooms-shown.js +13 -0
  241. package/dist/store.d.ts +15 -10
  242. package/dist/store.d.ts.map +1 -1
  243. package/dist/store.js +12 -5
  244. package/dist/stored.d.ts +40 -16
  245. package/dist/stored.d.ts.map +1 -1
  246. package/dist/stored.js +210 -52
  247. package/dist/surface.d.ts +19 -7
  248. package/dist/surface.d.ts.map +1 -1
  249. package/dist/surface.js +55 -17
  250. package/dist/sync.d.ts +4 -2
  251. package/dist/sync.d.ts.map +1 -1
  252. package/dist/sync.js +49 -27
  253. package/dist/tables.d.ts +34 -49
  254. package/dist/tables.d.ts.map +1 -1
  255. package/dist/tables.js +84 -325
  256. package/dist/tallies.d.ts.map +1 -1
  257. package/dist/tallies.js +3 -4
  258. package/dist/validation.d.ts +2 -0
  259. package/dist/validation.d.ts.map +1 -1
  260. package/dist/validation.js +50 -10
  261. package/dist/wire.d.ts +30 -14
  262. package/dist/wire.d.ts.map +1 -1
  263. package/dist/wire.js +19 -13
  264. package/package.json +4 -4
  265. package/dist/binary.d.ts.map +0 -1
  266. package/dist/binary.js +0 -8
@@ -5,6 +5,8 @@ import type { CycleProgress } from './status.js';
5
5
  import type { RuntimeStore } from './store.js';
6
6
  export declare function malformed(listed: readonly DiscoveredRoom[]): string | null;
7
7
  export declare function applyDiscovery(runtime: Runtime, found: readonly DiscoveredRoom[], started: number, left?: readonly string[]): Promise<readonly DiscoveredRoom[]>;
8
+ export declare const DISCOVERY = "discovery";
8
9
  export declare function signIn(runtime: Runtime, local: RuntimeStore, signedIn: Member | null): Promise<void>;
9
- export declare function discoverRooms(runtime: Runtime, local: RuntimeStore, progress: CycleProgress, live: Live, found: Discovery | null): Promise<readonly DiscoveredRoom[] | null>;
10
+ export declare function zoned(runtime: Runtime, local: RuntimeStore, zone: string | null): Promise<void>;
11
+ export declare function discoverRooms(runtime: Runtime, progress: CycleProgress, live: Live, found: Discovery | null): Promise<readonly DiscoveredRoom[] | null>;
10
12
  //# sourceMappingURL=discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,MAAM,EAEP,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,IAAI,CAsB1E;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CA0CpC;AAYD,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,iBAI1F;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,GAAG,IAAI,GACtB,OAAO,CAAC,SAAS,cAAc,EAAE,GAAG,IAAI,CAAC,CA+D3C"}
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,MAAM,EAEP,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,IAAI,CAsB1E;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAgDpC;AAUD,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,iBAI1F;AAED,wBAAsB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,iBAIrF;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,GAAG,IAAI,GACtB,OAAO,CAAC,SAAS,cAAc,EAAE,GAAG,IAAI,CAAC,CA2E3C"}
package/dist/discovery.js CHANGED
@@ -4,7 +4,7 @@ import { loseRooms } from './lost.js';
4
4
  import { cachedModels } from './models.js';
5
5
  import { beneath } from './paths.js';
6
6
  import { refuse } from './refusal.js';
7
- import { emitMember, emitRefusal, emitRooms, moveTo, transferring } from './shown.js';
7
+ import { emitMember, emitRefusal, emitRooms, emitTimeZone, moveTo, transferring } from './shown.js';
8
8
  function within(root, path) {
9
9
  return root === '' || beneath(root, path);
10
10
  }
@@ -37,6 +37,12 @@ export function malformed(listed) {
37
37
  }
38
38
  export async function applyDiscovery(runtime, found, started, left) {
39
39
  const { store, socket, presence } = runtime;
40
+ if (found.length === 0 && !store.needed()) {
41
+ const listed = presence.list([], { whole: left === undefined, live: socket.isOpen() });
42
+ socket.session.set({ roomsListed: true });
43
+ emitRooms(runtime);
44
+ return listed;
45
+ }
40
46
  const lockedBefore = await lockedRooms(runtime);
41
47
  const local = await store.open();
42
48
  const fenced = new Set(await local.fences());
@@ -77,15 +83,21 @@ async function asked({ socket }, authorized) {
77
83
  return { kind: 'transport-uncertainty', failure };
78
84
  }
79
85
  }
80
- const DISCOVERY = 'discovery';
86
+ export const DISCOVERY = 'discovery';
81
87
  export async function signIn(runtime, local, signedIn) {
82
88
  if (JSON.stringify(signedIn) === JSON.stringify((await local.facts()).member))
83
89
  return;
84
90
  await local.fact('member', signedIn);
85
91
  emitMember(runtime, signedIn);
86
92
  }
87
- export async function discoverRooms(runtime, local, progress, live, found) {
88
- const { socket } = runtime;
93
+ export async function zoned(runtime, local, zone) {
94
+ if (zone === (await local.facts()).timeZone)
95
+ return;
96
+ await local.fact('timeZone', zone);
97
+ emitTimeZone(runtime, zone);
98
+ }
99
+ export async function discoverRooms(runtime, progress, live, found) {
100
+ const { store, socket } = runtime;
89
101
  const { session } = socket;
90
102
  const { closed, authorization } = session.now();
91
103
  if (closed || authorization === undefined) {
@@ -108,7 +120,8 @@ export async function discoverRooms(runtime, local, progress, live, found) {
108
120
  if (result.kind === 'discovery')
109
121
  runtime.retries.succeeded('connection', DISCOVERY);
110
122
  if (result.kind === 'transport-uncertainty') {
111
- await cachedModels(runtime, local);
123
+ if (store.needed())
124
+ await cachedModels(runtime, await store.open());
112
125
  progress.reachable = false;
113
126
  progress.complete = false;
114
127
  socket.notifyReady();
@@ -138,13 +151,25 @@ export async function discoverRooms(runtime, local, progress, live, found) {
138
151
  session.set({ refusal: null });
139
152
  emitRefusal(runtime);
140
153
  }
154
+ const queriesOnly = result.queriesOnly ?? [];
155
+ if (!store.needed() && result.rooms.length === 0) {
156
+ session.set({ queriesOnly, unstored: result });
157
+ socket.notifyReady();
158
+ return applyDiscovery(runtime, result.rooms, started);
159
+ }
160
+ const local = await store.open();
141
161
  const held = await local.facts();
142
162
  if (JSON.stringify(result.providerLimits) !== JSON.stringify(held.providerLimits) ||
143
163
  JSON.stringify(result.capabilities) !== JSON.stringify(held.capabilities)) {
144
164
  await local.fact('providerLimits', result.providerLimits);
145
165
  await local.fact('capabilities', result.capabilities);
146
166
  }
167
+ if (JSON.stringify(queriesOnly) !== JSON.stringify(held.queriesOnly)) {
168
+ await local.fact('queriesOnly', queriesOnly);
169
+ }
170
+ session.set({ queriesOnly, unstored: null });
147
171
  socket.notifyReady();
148
172
  await signIn(runtime, local, result.member ?? null);
173
+ await zoned(runtime, local, result.timeZone ?? null);
149
174
  return applyDiscovery(runtime, result.rooms, started);
150
175
  }
@@ -0,0 +1,6 @@
1
+ import type { MdRuntimeClient } from './client.js';
2
+ import type { AttachmentLinkAnswer, DownloadAnswer } from './outcome.js';
3
+ export declare function handedCopy(copy: Blob, name: string): DownloadAnswer;
4
+ export declare function handedLink(path: string, link: () => Promise<AttachmentLinkAnswer>): Promise<DownloadAnswer>;
5
+ export declare function downloadAttachment(client: MdRuntimeClient, link: string): Promise<DownloadAnswer>;
6
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAuBzE,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAKnE;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAAC,cAAc,CAAC,CAazB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAEjG"}
@@ -0,0 +1,42 @@
1
+ import { linkedFile } from './linked-file.js';
2
+ // A browser reads a download's address only after the click that hands it returns, so a copy's address is released a minute later.
3
+ const HANDED_COPY_MS = 60_000;
4
+ const PAGE = /\.html?$/iu;
5
+ const STARTED = { kind: 'started' };
6
+ const BLOCKED = {
7
+ kind: 'blocked',
8
+ code: 'popup-blocked',
9
+ fields: {},
10
+ retryable: true,
11
+ };
12
+ function handed(url, name) {
13
+ const anchor = document.createElement('a');
14
+ anchor.href = url;
15
+ anchor.download = name;
16
+ anchor.click();
17
+ }
18
+ export function handedCopy(copy, name) {
19
+ const url = URL.createObjectURL(copy);
20
+ handed(url, name);
21
+ setTimeout(() => URL.revokeObjectURL(url), HANDED_COPY_MS);
22
+ return STARTED;
23
+ }
24
+ export async function handedLink(path, link) {
25
+ const tab = PAGE.test(path) ? globalThis.open('', '_blank') : null;
26
+ const linked = await link();
27
+ if (linked.kind === 'link' && PAGE.test(linked.name)) {
28
+ const away = tab ?? globalThis.open('', '_blank');
29
+ if (away === null)
30
+ return BLOCKED;
31
+ away.location.replace(linked.url);
32
+ return STARTED;
33
+ }
34
+ tab?.close();
35
+ if (linked.kind !== 'link')
36
+ return linked;
37
+ handed(linked.url, linked.name);
38
+ return STARTED;
39
+ }
40
+ export function downloadAttachment(client, link) {
41
+ return handedLink(linkedFile(link)?.path ?? link, () => client.conversation.attachment(link));
42
+ }
@@ -5,6 +5,7 @@ export type UnsentWork = {
5
5
  readonly kind: UnsentKind;
6
6
  readonly count: number;
7
7
  };
8
+ export declare function leftToSend(unsent: readonly UnsentWork[]): boolean;
8
9
  export type AppCode = {
9
10
  readonly running: number;
10
11
  readonly older: number;
@@ -1 +1 @@
1
- {"version":3,"file":"durability.d.ts","sourceRoot":"","sources":["../src/durability.ts"],"names":[],"mappings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ACzB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMvD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAG/F;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAEvF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAGrF"}
@@ -1,5 +1,8 @@
1
1
  const STORAGE_LOSS_CODE = 'storage-loss';
2
2
  const VISIT_LOSS_CODE = 'visit';
3
+ export function leftToSend(unsent) {
4
+ return unsent.some(({ kind }) => kind === 'pending-change' || kind === 'call');
5
+ }
3
6
  export function refusedForSpace(error) {
4
7
  return (typeof error === 'object' &&
5
8
  error !== null &&
package/dist/entry.d.ts CHANGED
@@ -1,20 +1,45 @@
1
1
  import { type VerifiedModel } from '@agentshouse/mdmodel';
2
+ import type { Attachment, HeadChange } from './adapter.js';
3
+ import type { ChangeBatch } from './change.js';
4
+ import { type Written } from './overlay.js';
2
5
  import { type QueryRows } from './query.js';
6
+ import { type ValuedEntry } from './stored.js';
3
7
  import type { Connection } from './tables.js';
4
8
  export { QueryError } from '@agentshouse/mdmodel';
9
+ export { documentKey, pathOfKey } from './rows.js';
10
+ export type { ValuedEntry } from './stored.js';
11
+ export type EntryArea = {
12
+ readonly path: string;
13
+ readonly open: readonly string[];
14
+ };
5
15
  export type EntryRoom = {
6
16
  locator: string;
17
+ handle?: string;
18
+ readable?: readonly string[];
19
+ areas?: readonly EntryArea[];
7
20
  schema: string | null;
8
21
  documents: Readonly<Record<string, string>>;
9
22
  revisions?: Readonly<Record<string, string>>;
23
+ fileIds?: Readonly<Record<string, string>>;
24
+ created?: Readonly<Record<string, string>>;
25
+ changes?: Readonly<Record<string, HeadChange>>;
26
+ attachments?: Readonly<Record<string, Attachment>>;
10
27
  };
11
28
  export type EntryArguments = Readonly<Record<string, string>>;
12
29
  export type EntryParameterKind = 'string' | 'integer' | 'number' | 'boolean';
13
30
  export declare function boundQuery(template: unknown, args: EntryArguments): unknown;
14
31
  export declare function entryParameters(template: unknown): readonly string[];
32
+ export declare function localQueryRefusal(template: unknown): string | null;
15
33
  export declare function entryRefusal(template: unknown): string | null;
16
34
  export type EntryScope = {
17
35
  results(queries: Readonly<Record<string, unknown>>): Promise<Record<string, QueryRows>>;
18
36
  };
19
- export declare function entryScope(rooms: readonly EntryRoom[], roomTypes: VerifiedModel, connection: Connection): EntryScope;
37
+ export type CountedRoom = {
38
+ locator: string;
39
+ schema: string | null;
40
+ documents: readonly ValuedEntry[];
41
+ };
42
+ export declare function writtenIn(room: EntryRoom, roomTypes: VerifiedModel, batch: ChangeBatch): Written;
43
+ export declare function entryScope(rooms: readonly EntryRoom[], roomTypes: VerifiedModel, connection: Connection, followed?: readonly EntryRoom[]): EntryScope;
44
+ export declare function countScope(room: CountedRoom, roomTypes: VerifiedModel, connection: Connection): EntryScope;
20
45
  //# sourceMappingURL=entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AA0D7E,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAE3E;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAMpE;AAyCD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAA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MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,SAAS,WAAW,EAAE,CAAC;CACnC,CAAC;AAgCF,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAiBhG;AAqHD,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,GAAE,SAAS,SAAS,EAAO,GAClC,UAAU,CAOZ;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAaZ"}
package/dist/entry.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { invalid, plain, QueryError, } from '@agentshouse/mdmodel';
2
2
  import { attachedModel } from './attached-model.js';
3
+ import { writtenDocuments } from './overlay.js';
3
4
  import { answerQuery } from './compile.js';
4
5
  import { planWithin } from './query.js';
5
- import { writtenFacts } from './rows.js';
6
- import { entered, REPLICA_TABLES } from './stored.js';
6
+ import { documentKey, writtenFacts } from './rows.js';
7
+ import { entered, enteredValues, REPLICA_TABLES, } from './stored.js';
7
8
  export { QueryError } from '@agentshouse/mdmodel';
9
+ export { documentKey, pathOfKey } from './rows.js';
8
10
  const PARAMETER = '$param';
9
11
  const KIND = 'as';
10
12
  const INTEGER = /^-?(?:0|[1-9][0-9]*)$/u;
@@ -70,6 +72,12 @@ export function entryParameters(template) {
70
72
  return [];
71
73
  }
72
74
  const SAMPLED = {
75
+ rooms: 'entry',
76
+ folder: 'entry',
77
+ outside: 'entry',
78
+ paths: 'entry',
79
+ fileIds: 'entry',
80
+ text: 'entry',
73
81
  direction: 'asc',
74
82
  nulls: 'last',
75
83
  stringSort: 'lexical',
@@ -100,15 +108,16 @@ function sampled(template, key) {
100
108
  }
101
109
  return template;
102
110
  }
103
- function entryPlan(query, facts) {
104
- const plan = planWithin(query, facts);
111
+ function entryPlan(query, facts, reach = null) {
112
+ const plan = planWithin(query, facts, reach);
105
113
  if (plan.fileIds !== null)
106
114
  invalid('fileIds', 'an entry Room holds no file IDs');
107
115
  return plan;
108
116
  }
109
- export function entryRefusal(template) {
117
+ const UNHELD = { listed: false, rooms: [] };
118
+ function refusalOf(plan) {
110
119
  try {
111
- entryPlan(sampled(template, ''), { listed: false, rooms: [] });
120
+ plan();
112
121
  return null;
113
122
  }
114
123
  catch (error) {
@@ -117,45 +126,126 @@ export function entryRefusal(template) {
117
126
  throw error;
118
127
  }
119
128
  }
120
- export function entryScope(rooms, roomTypes, connection) {
121
- for (const table of REPLICA_TABLES)
122
- connection.run(table);
123
- const held = [];
124
- const keys = rooms.map((room) => {
125
- const model = attachedModel({
126
- kind: 'model',
127
- snapshot: { identity: room.locator, version: '', schema: room.schema, revision: null },
128
- }, roomTypes);
129
- held.push({
129
+ export function localQueryRefusal(template) {
130
+ return refusalOf(() => planWithin(sampled(template, ''), UNHELD));
131
+ }
132
+ export function entryRefusal(template) {
133
+ return refusalOf(() => entryPlan(sampled(template, ''), UNHELD));
134
+ }
135
+ function composedRoom(room, roomTypes) {
136
+ const model = attachedModel({
137
+ kind: 'model',
138
+ snapshot: { identity: room.locator, version: '', schema: room.schema, revision: null },
139
+ }, roomTypes);
140
+ return { model, selection: null, typedPaths: [] };
141
+ }
142
+ export function writtenIn(room, roomTypes, batch) {
143
+ const written = writtenDocuments({
144
+ documents: room.documents,
145
+ binaries: {},
146
+ revisions: room.revisions ?? {},
147
+ fileIds: {},
148
+ created: {},
149
+ changes: {},
150
+ }, batch, composedRoom(room, roomTypes));
151
+ for (;;) {
152
+ const step = written.next();
153
+ if (step.done === true)
154
+ return step.value;
155
+ }
156
+ }
157
+ function enteredRoom(room, roomTypes, connection) {
158
+ const composition = composedRoom(room, roomTypes);
159
+ const { model } = composition;
160
+ const key = room.enter(composition);
161
+ if (room.handle !== undefined)
162
+ connection.run("INSERT INTO replica_rooms (locator, key, record) VALUES (?, ?, json_object('declaration', json_object('handle', ?)))", [room.locator, key, room.handle]);
163
+ return {
164
+ locator: room.locator,
165
+ key,
166
+ composition,
167
+ ...(room.handle === undefined ? {} : { handle: room.handle }),
168
+ facts: {
130
169
  locator: room.locator,
131
170
  available: model.status !== 'unavailable',
132
171
  types: model.status === 'unavailable' ? [] : Object.values(model.types),
133
- });
134
- const composition = { model, selection: null, typedPaths: [] };
135
- const key = entered(connection, room.locator, composition, Object.keys(room.documents)
136
- .sort()
137
- .map((path) => ({
138
- path,
139
- content: room.documents[path],
140
- facts: writtenFacts(path, room.documents[path], composition),
141
- binary: null,
142
- revision: room.revisions?.[path] ?? null,
143
- fileId: null,
144
- created: null,
145
- change: null,
146
- written: null,
147
- })));
148
- return { locator: room.locator, key, composition };
149
- });
150
- const planned = { listed: true, rooms: held };
172
+ },
173
+ };
174
+ }
175
+ function reachOf(rooms, followed) {
176
+ if (followed.every(({ readable, areas }) => readable === undefined && areas === undefined))
177
+ return null;
178
+ return {
179
+ rooms: [...rooms, ...followed.filter(({ readable }) => readable === undefined)].map(({ locator }) => locator),
180
+ documents: followed.flatMap(({ locator, readable }) => (readable ?? []).map((path) => documentKey(locator, path))),
181
+ areas: followed.flatMap(({ locator, areas }) => (areas ?? []).map(({ path, open }) => ({ room: locator, path, open }))),
182
+ };
183
+ }
184
+ function scope(rooms, roomTypes, connection, followed = []) {
185
+ for (const table of REPLICA_TABLES)
186
+ connection.run(table);
187
+ const keys = rooms.map((room) => enteredRoom(room, roomTypes, connection));
188
+ const follows = [
189
+ ...keys,
190
+ ...followed.map((room) => enteredRoom(room, roomTypes, connection)),
191
+ ].filter(({ handle }) => handle !== undefined);
192
+ const planned = { listed: true, rooms: keys.map(({ facts }) => facts) };
193
+ const reach = reachOf(rooms, followed);
151
194
  return {
152
195
  async results(queries) {
153
196
  const results = {};
154
197
  for (const [name, query] of Object.entries(queries)) {
155
- const plan = entryPlan(query, planned);
156
- results[name] = answerQuery(connection, plan, keys.filter(({ locator }) => plan.rooms === null || plan.rooms.includes(locator)));
198
+ const plan = entryPlan(query, planned, reach);
199
+ results[name] = answerQuery(connection, plan, keys.filter(({ locator }) => plan.rooms === null || plan.rooms.includes(locator)), null, follows);
157
200
  }
158
201
  return results;
159
202
  },
160
203
  };
161
204
  }
205
+ function scopedRoom(room, connection) {
206
+ return {
207
+ locator: room.locator,
208
+ ...(room.handle === undefined ? {} : { handle: room.handle }),
209
+ ...(room.readable === undefined ? {} : { readable: room.readable }),
210
+ ...(room.areas === undefined ? {} : { areas: room.areas }),
211
+ schema: room.schema,
212
+ enter(composition) {
213
+ const heads = (path) => ({
214
+ revision: room.revisions?.[path] ?? null,
215
+ fileId: room.fileIds?.[path] ?? null,
216
+ created: room.created?.[path] ?? null,
217
+ change: room.changes?.[path] ?? null,
218
+ written: null,
219
+ });
220
+ const entries = [
221
+ ...Object.entries(room.documents).map(([path, content]) => ({
222
+ path,
223
+ content,
224
+ facts: writtenFacts(path, content, composition),
225
+ binary: null,
226
+ ...heads(path),
227
+ })),
228
+ ...Object.entries(room.attachments ?? {}).map(([path, binary]) => ({
229
+ path,
230
+ content: null,
231
+ facts: null,
232
+ binary: { state: 'accepted', ...binary },
233
+ ...heads(path),
234
+ })),
235
+ ];
236
+ return entered(connection, room.locator, composition, entries.sort((left, right) => (left.path < right.path ? -1 : 1)));
237
+ },
238
+ };
239
+ }
240
+ export function entryScope(rooms, roomTypes, connection, followed = []) {
241
+ return scope(rooms.map((room) => scopedRoom(room, connection)), roomTypes, connection, followed.map((room) => scopedRoom(room, connection)));
242
+ }
243
+ export function countScope(room, roomTypes, connection) {
244
+ return scope([
245
+ {
246
+ locator: room.locator,
247
+ schema: room.schema,
248
+ enter: (composition) => enteredValues(connection, room.locator, composition, room.documents),
249
+ },
250
+ ], roomTypes, connection);
251
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAa,EACtB,SAAS,UAAQ,GAChB,YAAY,CAEd;AAYD,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,YAAY,CAEnE;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAGnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAGnD"}
1
+ {"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAa,EACtB,SAAS,UAAQ,GAChB,YAAY,CAEd;AAYD,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,YAAY,CAEnE;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAGnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAGnD"}
package/dist/failure.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { refusedForSpace } from './durability.js';
1
2
  export function runtimeError(code, message = code, retryable = false) {
2
3
  return Object.assign(new Error(message), { code, retryable });
3
4
  }
@@ -17,7 +18,8 @@ export function failed(error) {
17
18
  return runtimeError('runtime-failure', error instanceof Error ? error.message : String(error));
18
19
  }
19
20
  export function uncaught(error) {
20
- reportError(error);
21
+ if (!refusedForSpace(error))
22
+ reportError(error);
21
23
  }
22
24
  export function described(error) {
23
25
  const { message, code, retryable } = failed(error);
package/dist/figures.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { GroupTotal, PendingResult } from './query.js';
3
3
  import type { Deliver, Fail } from './reach.js';
4
4
  import type { ConversationTally, RoomTally } from './tallies.js';
5
5
  import type { QueryRoom } from './tables.js';
6
- export declare const HOUSE_DIRECTORY = "house";
6
+ export declare const HOUSE_FOLDER = "house";
7
7
  export declare const ROOM_TOTALS: {
8
8
  readonly outside: readonly ["house"];
9
9
  readonly groupBy: readonly ["room"];
@@ -1 +1 @@
1
- {"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../src/figures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EA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house';
2
+ export const HOUSE_FOLDER = 'house';
3
3
  export const ROOM_TOTALS = {
4
- outside: [HOUSE_DIRECTORY],
4
+ outside: [HOUSE_FOLDER],
5
5
  groupBy: ['room'],
6
6
  select: { size: true },
7
7
  };
@@ -72,8 +72,9 @@ export function createFigures(sources) {
72
72
  }
73
73
  }
74
74
  async function tallied(rooms, since) {
75
+ const covered = new Set(rooms.map(({ locator }) => locator));
75
76
  for (const locator of held.rooms.keys()) {
76
- if (!rooms.some((room) => room.locator === locator))
77
+ if (!covered.has(locator))
77
78
  held.rooms.delete(locator);
78
79
  }
79
80
  const asked = rooms.filter(({ locator, key }) => held.staleRooms.has(locator) || held.rooms.get(locator)?.key !== key);
@@ -90,8 +91,9 @@ export function createFigures(sources) {
90
91
  ]);
91
92
  if (kept !== held)
92
93
  return false;
94
+ const byKey = new Map(asked.map((room) => [room.key, room]));
93
95
  for (const tally of roomTallies) {
94
- const room = asked.find(({ key }) => key === tally.key);
96
+ const room = byKey.get(tally.key);
95
97
  if (room !== undefined)
96
98
  held.rooms.set(room.locator, tally);
97
99
  }
package/dist/file.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { AttachRequest } from './adapter.js';
2
- export declare function attachedFile(locator: string, file: File): Promise<AttachRequest>;
2
+ export declare function attachedFile(locator: string | null, file: File): Promise<AttachRequest>;
3
3
  //# sourceMappingURL=file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAStF"}
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAS7F"}
package/dist/file.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { sha256 } from './digest.js';
2
+ import { declaredType } from './outcome.js';
2
3
  export async function attachedFile(locator, file) {
3
4
  return {
4
- locator,
5
+ ...(locator === null ? {} : { locator }),
5
6
  name: file.name,
6
- mediaType: file.type,
7
+ mediaType: declaredType(file),
7
8
  byteLength: file.size,
8
9
  sha256: await sha256(file),
9
10
  blob: file,
package/dist/host.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { type MdRuntimeOptions } from './connection.js';
2
2
  import type { PortReach } from './reach.js';
3
- import type { CodeAvailability, Persistence, Readiness } from './readiness.js';
3
+ import type { CodeAvailability, FirstTier, Persistence, Readiness } from './readiness.js';
4
4
  import type { EntrySeed } from './seed.js';
5
5
  import { type CallResult } from './outcome.js';
6
6
  import { type RuntimePort } from './wire.js';
7
7
  export type MdRuntimeHostOptions = MdRuntimeOptions & {
8
8
  deploymentFacts?: unknown;
9
+ saveMessages?: Readonly<Record<string, string>>;
9
10
  };
10
11
  export type Admitted = {
11
12
  readonly admitted: unknown;
@@ -19,10 +20,12 @@ export type AttachOptions = {
19
20
  readonly reach?: PortReach;
20
21
  readonly admission?: ActionAdmission;
21
22
  readonly code?: CodeAvailability;
23
+ readonly first?: FirstTier;
22
24
  };
23
25
  export type AttachedPort = {
24
26
  detach(): void;
25
27
  narrow(reach: PortReach): void;
28
+ code(code: CodeAvailability): void;
26
29
  readiness(deliver: (readiness: Readiness) => void): () => void;
27
30
  answered(queries: readonly unknown[], done: () => void): void;
28
31
  };
@@ -36,9 +39,11 @@ export type MdRuntimeHost = {
36
39
  };
37
40
  export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
38
41
  export { entrySeedOf, type EntrySeed } from './seed.js';
42
+ export type { QueriedRoom } from './adapter.js';
39
43
  export type { PortReach, ReachedDocument } from './reach.js';
40
- export type { CodeAvailability, Persistence, Space } from './readiness.js';
44
+ export type { CodeAvailability, FirstTier, Persistence, Space } from './readiness.js';
41
45
  export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
46
+ export { replaces } from './observation.js';
42
47
  export { undeclared } from './outcome.js';
43
48
  export { wireAnswer, wireRequest, type RuntimePort, type WireAnswer, type WireRequest, } from './wire.js';
44
49
  //# sourceMappingURL=host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAUxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEL,KAAK,WAAW,EAQjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO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