@agentshouse/mdruntime 0.1.0-ce6bc9239a3ee → 0.1.0-ce80727f9590f

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 (304) hide show
  1. package/README.md +21 -19
  2. package/dist/acceptance.d.ts +2 -25
  3. package/dist/acceptance.d.ts.map +1 -1
  4. package/dist/acceptance.js +119 -204
  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 +321 -0
  11. package/dist/adapter.d.ts +114 -57
  12. package/dist/adapter.d.ts.map +1 -1
  13. package/dist/attached-model.d.ts +0 -1
  14. package/dist/attached-model.d.ts.map +1 -1
  15. package/dist/attached-model.js +0 -5
  16. package/dist/authored.d.ts +88 -0
  17. package/dist/authored.d.ts.map +1 -0
  18. package/dist/authored.js +345 -0
  19. package/dist/bootstrap.d.ts +1 -1
  20. package/dist/bootstrap.d.ts.map +1 -1
  21. package/dist/bootstrap.js +6 -18
  22. package/dist/cell.d.ts +6 -0
  23. package/dist/cell.d.ts.map +1 -0
  24. package/dist/cell.js +9 -0
  25. package/dist/change-set.d.ts +4 -0
  26. package/dist/change-set.d.ts.map +1 -1
  27. package/dist/change-set.js +6 -0
  28. package/dist/change.d.ts +4 -0
  29. package/dist/change.d.ts.map +1 -1
  30. package/dist/change.js +7 -2
  31. package/dist/chat-types.d.ts +2 -2
  32. package/dist/chat-types.d.ts.map +1 -1
  33. package/dist/chat-types.js +11 -2
  34. package/dist/client.d.ts +25 -22
  35. package/dist/client.d.ts.map +1 -1
  36. package/dist/client.js +45 -58
  37. package/dist/collection.d.ts +26 -4
  38. package/dist/collection.d.ts.map +1 -1
  39. package/dist/collection.js +28 -10
  40. package/dist/column.d.ts +5 -0
  41. package/dist/column.d.ts.map +1 -0
  42. package/dist/column.js +9 -0
  43. package/dist/compile.d.ts +2 -0
  44. package/dist/compile.d.ts.map +1 -1
  45. package/dist/compile.js +31 -25
  46. package/dist/connection.d.ts +4 -116
  47. package/dist/connection.d.ts.map +1 -1
  48. package/dist/connection.js +103 -2994
  49. package/dist/context.d.ts.map +1 -1
  50. package/dist/context.js +1 -1
  51. package/dist/conversation-live.d.ts +150 -0
  52. package/dist/conversation-live.d.ts.map +1 -0
  53. package/dist/conversation-live.js +259 -0
  54. package/dist/conversation-row.d.ts +8 -1
  55. package/dist/conversation-row.d.ts.map +1 -1
  56. package/dist/conversation-row.js +22 -3
  57. package/dist/conversation.d.ts +57 -45
  58. package/dist/conversation.d.ts.map +1 -1
  59. package/dist/conversation.js +974 -1031
  60. package/dist/declaration.d.ts +10 -0
  61. package/dist/declaration.d.ts.map +1 -0
  62. package/dist/declaration.js +24 -0
  63. package/dist/discovery.d.ts +12 -0
  64. package/dist/discovery.d.ts.map +1 -0
  65. package/dist/discovery.js +175 -0
  66. package/dist/download.d.ts +6 -0
  67. package/dist/download.d.ts.map +1 -0
  68. package/dist/download.js +42 -0
  69. package/dist/durability.d.ts +14 -0
  70. package/dist/durability.d.ts.map +1 -1
  71. package/dist/durability.js +7 -0
  72. package/dist/entry.d.ts +5 -0
  73. package/dist/entry.d.ts.map +1 -1
  74. package/dist/entry.js +23 -12
  75. package/dist/expectation.d.ts +26 -13
  76. package/dist/expectation.d.ts.map +1 -1
  77. package/dist/expectation.js +72 -19
  78. package/dist/failure.d.ts +3 -0
  79. package/dist/failure.d.ts.map +1 -1
  80. package/dist/failure.js +8 -0
  81. package/dist/figures.d.ts +1 -0
  82. package/dist/figures.d.ts.map +1 -1
  83. package/dist/figures.js +6 -4
  84. package/dist/file.d.ts +1 -1
  85. package/dist/file.d.ts.map +1 -1
  86. package/dist/file.js +3 -2
  87. package/dist/holdings.d.ts +29 -0
  88. package/dist/holdings.d.ts.map +1 -0
  89. package/dist/holdings.js +95 -0
  90. package/dist/host.d.ts +20 -2
  91. package/dist/host.d.ts.map +1 -1
  92. package/dist/host.js +83 -19
  93. package/dist/house-query.d.ts +21 -0
  94. package/dist/house-query.d.ts.map +1 -0
  95. package/dist/house-query.js +41 -0
  96. package/dist/index.d.ts +28 -12
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +16 -6
  99. package/dist/install.d.ts +22 -48
  100. package/dist/install.d.ts.map +1 -1
  101. package/dist/install.js +161 -161
  102. package/dist/lifecycle.d.ts +7 -0
  103. package/dist/lifecycle.d.ts.map +1 -0
  104. package/dist/lifecycle.js +290 -0
  105. package/dist/listing.d.ts +60 -0
  106. package/dist/listing.d.ts.map +1 -0
  107. package/dist/listing.js +168 -0
  108. package/dist/live.d.ts +5 -3
  109. package/dist/live.d.ts.map +1 -1
  110. package/dist/live.js +74 -33
  111. package/dist/loaded.d.ts +5 -0
  112. package/dist/loaded.d.ts.map +1 -0
  113. package/dist/loaded.js +40 -0
  114. package/dist/locks.d.ts +7 -0
  115. package/dist/locks.d.ts.map +1 -0
  116. package/dist/locks.js +34 -0
  117. package/dist/lost.d.ts +5 -0
  118. package/dist/lost.d.ts.map +1 -0
  119. package/dist/lost.js +49 -0
  120. package/dist/media.d.ts +19 -2
  121. package/dist/media.d.ts.map +1 -1
  122. package/dist/media.js +105 -27
  123. package/dist/memory.d.ts +9 -3
  124. package/dist/memory.d.ts.map +1 -1
  125. package/dist/memory.js +94 -32
  126. package/dist/messages.d.ts +12 -6
  127. package/dist/messages.d.ts.map +1 -1
  128. package/dist/messages.js +35 -39
  129. package/dist/modal.d.ts +2 -0
  130. package/dist/modal.d.ts.map +1 -0
  131. package/dist/modal.js +11 -0
  132. package/dist/model.d.ts +4 -3
  133. package/dist/model.d.ts.map +1 -1
  134. package/dist/model.js +6 -5
  135. package/dist/models.d.ts +10 -0
  136. package/dist/models.d.ts.map +1 -0
  137. package/dist/models.js +153 -0
  138. package/dist/observation.d.ts +29 -12
  139. package/dist/observation.d.ts.map +1 -1
  140. package/dist/observation.js +217 -85
  141. package/dist/online.d.ts +7 -0
  142. package/dist/online.d.ts.map +1 -0
  143. package/dist/online.js +29 -0
  144. package/dist/opened.d.ts +1 -1
  145. package/dist/opened.d.ts.map +1 -1
  146. package/dist/opened.js +5 -5
  147. package/dist/opening.d.ts +4 -0
  148. package/dist/opening.d.ts.map +1 -0
  149. package/dist/opening.js +70 -0
  150. package/dist/outcome.d.ts +16 -2
  151. package/dist/outcome.d.ts.map +1 -1
  152. package/dist/outcome.js +32 -2
  153. package/dist/overlay.d.ts +6 -2
  154. package/dist/overlay.d.ts.map +1 -1
  155. package/dist/overlay.js +37 -24
  156. package/dist/page-metadata.d.ts +8 -0
  157. package/dist/page-metadata.d.ts.map +1 -0
  158. package/dist/page-metadata.js +19 -0
  159. package/dist/parts.d.ts +5 -58
  160. package/dist/parts.d.ts.map +1 -1
  161. package/dist/parts.js +28 -110
  162. package/dist/paths.d.ts +1 -0
  163. package/dist/paths.d.ts.map +1 -1
  164. package/dist/paths.js +22 -0
  165. package/dist/preparation.d.ts +41 -0
  166. package/dist/preparation.d.ts.map +1 -0
  167. package/dist/preparation.js +326 -0
  168. package/dist/presence.d.ts +58 -0
  169. package/dist/presence.d.ts.map +1 -0
  170. package/dist/presence.js +231 -0
  171. package/dist/queries.d.ts +16 -0
  172. package/dist/queries.d.ts.map +1 -0
  173. package/dist/queries.js +287 -0
  174. package/dist/query.d.ts +0 -1
  175. package/dist/query.d.ts.map +1 -1
  176. package/dist/questions.d.ts +3 -5
  177. package/dist/questions.d.ts.map +1 -1
  178. package/dist/questions.js +4 -6
  179. package/dist/queue.d.ts +40 -0
  180. package/dist/queue.d.ts.map +1 -0
  181. package/dist/queue.js +480 -0
  182. package/dist/reach.d.ts +15 -5
  183. package/dist/reach.d.ts.map +1 -1
  184. package/dist/reach.js +164 -33
  185. package/dist/react.d.ts +17 -2
  186. package/dist/react.d.ts.map +1 -1
  187. package/dist/react.js +33 -1
  188. package/dist/readiness.d.ts +9 -4
  189. package/dist/readiness.d.ts.map +1 -1
  190. package/dist/readiness.js +3 -5
  191. package/dist/reads.d.ts +5 -2
  192. package/dist/reads.d.ts.map +1 -1
  193. package/dist/reads.js +49 -7
  194. package/dist/recovery.d.ts +4 -1
  195. package/dist/recovery.d.ts.map +1 -1
  196. package/dist/recovery.js +31 -8
  197. package/dist/refresh.js +2 -2
  198. package/dist/refusal.d.ts +5 -0
  199. package/dist/refusal.d.ts.map +1 -0
  200. package/dist/refusal.js +55 -0
  201. package/dist/replica.d.ts +5 -10
  202. package/dist/replica.d.ts.map +1 -1
  203. package/dist/replica.js +17 -18
  204. package/dist/retried.d.ts +30 -0
  205. package/dist/retried.d.ts.map +1 -0
  206. package/dist/retried.js +72 -0
  207. package/dist/room-draft.d.ts +31 -8
  208. package/dist/room-draft.d.ts.map +1 -1
  209. package/dist/room-draft.js +273 -66
  210. package/dist/room-drafts.d.ts +7 -12
  211. package/dist/room-drafts.d.ts.map +1 -1
  212. package/dist/room-drafts.js +44 -40
  213. package/dist/room-list.d.ts +10 -0
  214. package/dist/room-list.d.ts.map +1 -0
  215. package/dist/room-list.js +45 -0
  216. package/dist/rows.d.ts +2 -1
  217. package/dist/rows.d.ts.map +1 -1
  218. package/dist/rows.js +9 -10
  219. package/dist/running.d.ts +5 -0
  220. package/dist/running.d.ts.map +1 -0
  221. package/dist/running.js +10 -0
  222. package/dist/runtime.d.ts +36 -0
  223. package/dist/runtime.d.ts.map +1 -0
  224. package/dist/runtime.js +1 -0
  225. package/dist/save.d.ts +42 -86
  226. package/dist/save.d.ts.map +1 -1
  227. package/dist/save.js +326 -225
  228. package/dist/saves.d.ts +8 -70
  229. package/dist/saves.d.ts.map +1 -1
  230. package/dist/saves.js +199 -761
  231. package/dist/seed.d.ts +3 -8
  232. package/dist/seed.d.ts.map +1 -1
  233. package/dist/seed.js +21 -17
  234. package/dist/shared.d.ts +1 -6
  235. package/dist/shared.d.ts.map +1 -1
  236. package/dist/shared.js +13 -95
  237. package/dist/shown.d.ts +35 -0
  238. package/dist/shown.d.ts.map +1 -0
  239. package/dist/shown.js +326 -0
  240. package/dist/socket/lanes.d.ts +28 -0
  241. package/dist/socket/lanes.d.ts.map +1 -0
  242. package/dist/socket/lanes.js +103 -0
  243. package/dist/socket/session.d.ts +41 -0
  244. package/dist/socket/session.d.ts.map +1 -0
  245. package/dist/socket/session.js +26 -0
  246. package/dist/socket.d.ts +30 -5
  247. package/dist/socket.d.ts.map +1 -1
  248. package/dist/socket.js +75 -6
  249. package/dist/source.d.ts +5 -7
  250. package/dist/source.d.ts.map +1 -1
  251. package/dist/source.js +18 -6
  252. package/dist/store/installs.d.ts +2 -2
  253. package/dist/store/installs.d.ts.map +1 -1
  254. package/dist/store/installs.js +10 -4
  255. package/dist/store/readiness.d.ts +11 -0
  256. package/dist/store/readiness.d.ts.map +1 -0
  257. package/dist/store/readiness.js +68 -0
  258. package/dist/store/records.d.ts +22 -8
  259. package/dist/store/records.d.ts.map +1 -1
  260. package/dist/store/records.js +84 -24
  261. package/dist/store/rooms-shown.d.ts +8 -0
  262. package/dist/store/rooms-shown.d.ts.map +1 -0
  263. package/dist/store/rooms-shown.js +13 -0
  264. package/dist/store/space.d.ts +11 -0
  265. package/dist/store/space.d.ts.map +1 -0
  266. package/dist/store/space.js +41 -0
  267. package/dist/store/watchers.d.ts +2 -0
  268. package/dist/store/watchers.d.ts.map +1 -1
  269. package/dist/store/watchers.js +23 -3
  270. package/dist/store.d.ts +50 -9
  271. package/dist/store.d.ts.map +1 -1
  272. package/dist/store.js +78 -17
  273. package/dist/stored.d.ts +25 -14
  274. package/dist/stored.d.ts.map +1 -1
  275. package/dist/stored.js +99 -36
  276. package/dist/surface.d.ts +94 -0
  277. package/dist/surface.d.ts.map +1 -0
  278. package/dist/surface.js +255 -0
  279. package/dist/sync.d.ts +21 -0
  280. package/dist/sync.d.ts.map +1 -0
  281. package/dist/sync.js +557 -0
  282. package/dist/tables.d.ts +28 -59
  283. package/dist/tables.d.ts.map +1 -1
  284. package/dist/tables.js +106 -331
  285. package/dist/tallies.d.ts.map +1 -1
  286. package/dist/tallies.js +6 -7
  287. package/dist/validation.d.ts.map +1 -1
  288. package/dist/validation.js +4 -10
  289. package/dist/wire.d.ts +68 -8
  290. package/dist/wire.d.ts.map +1 -1
  291. package/dist/wire.js +26 -9
  292. package/package.json +3 -2
  293. package/dist/attempt.d.ts +0 -16
  294. package/dist/attempt.d.ts.map +0 -1
  295. package/dist/attempt.js +0 -70
  296. package/dist/job.d.ts +0 -33
  297. package/dist/job.d.ts.map +0 -1
  298. package/dist/job.js +0 -54
  299. package/dist/log.d.ts +0 -6
  300. package/dist/log.d.ts.map +0 -1
  301. package/dist/log.js +0 -14
  302. package/dist/store/fences.d.ts +0 -16
  303. package/dist/store/fences.d.ts.map +0 -1
  304. package/dist/store/fences.js +0 -26
package/dist/parts.js CHANGED
@@ -1,118 +1,36 @@
1
- import { closeLast, markerMoved, openJobs } from './job.js';
2
- import { excerpt, list, record, text } from './read.js';
3
- const MARKERS = ['mode', 'compaction', 'retry', 'model', 'job'];
4
- function partOf(raw) {
5
- const part = record(raw);
6
- switch (text(part, 'type')) {
7
- case 'text':
8
- case 'reasoning': {
9
- const said = text(part, 'text');
10
- return said === null ? null : { type: part.type, text: said };
11
- }
12
- case 'commands':
13
- return typeof part.count === 'number' ? { type: 'commands', count: part.count } : null;
14
- case 'subagent':
15
- return {
16
- type: 'subagent',
17
- description: text(part, 'description') ?? '',
18
- done: part.status === 'done',
19
- result: text(part, 'result'),
20
- };
21
- case 'message': {
22
- const command = text(part, 'command');
23
- return command === null ? null : { type: 'message', command, target: text(part, 'target') };
24
- }
25
- case 'image': {
26
- const path = text(part, 'file');
27
- const name = text(part, 'name');
28
- return path === null || name === null
29
- ? null
30
- : { type: 'image', path, name, mediaType: text(part, 'media_type') ?? '' };
31
- }
32
- case 'marker': {
33
- const marker = text(part, 'marker');
34
- return marker === null || !MARKERS.includes(marker)
35
- ? null
36
- : { type: 'marker', marker: marker, text: text(part, 'text') ?? '' };
37
- }
38
- case 'plan':
39
- return {
40
- type: 'plan',
41
- steps: list(part, 'entries').flatMap((entry) => {
42
- const step = record(entry);
43
- const content = text(step, 'content');
44
- return content === null ? [] : [{ content, status: text(step, 'status') ?? '' }];
45
- }),
46
- };
47
- default:
48
- return null;
49
- }
1
+ import { turnCounts } from '@agentshouse/session-content';
2
+ import { excerpt } from './read.js';
3
+ export const WORKING = 'Working';
4
+ function said(count, one, many) {
5
+ if (count === 0)
6
+ return null;
7
+ return count === 1 ? one : many(count);
50
8
  }
51
- export function partsOf(raw) {
52
- return raw.flatMap((one) => partOf(one) ?? []);
9
+ export function linesWords(added, removed) {
10
+ return `+${added} −${removed}`;
53
11
  }
54
- export function contextIn(raw) {
55
- const held = record(raw);
56
- return typeof held.used === 'number' && typeof held.window === 'number' && held.window > 0
57
- ? { used: held.used, window: held.window }
58
- : null;
12
+ function capitalized(words) {
13
+ return words.charAt(0).toUpperCase() + words.slice(1);
59
14
  }
60
- export function counted(count) {
61
- return count === 1 ? '1 command' : `${count} commands`;
15
+ export function turnLine(parts, lead) {
16
+ const counts = turnCounts(parts);
17
+ const kinds = [
18
+ said(counts.commands, 'ran 1 command', (count) => `ran ${count} commands`),
19
+ said(counts.edited, 'edited 1 file', (count) => `edited ${count} files`),
20
+ said(counts.other, 'made 1 other call', (count) => `made ${count} other calls`),
21
+ ].filter((one) => one !== null);
22
+ if (kinds.length === 0)
23
+ return null;
24
+ const changed = counts.added === 0 && counts.removed === 0 ? null : linesWords(counts.added, counts.removed);
25
+ const failed = counts.failed === 0 ? null : `${counts.failed} failed`;
26
+ const words = kinds.join(' · ');
27
+ return [lead === null ? capitalized(words) : `${lead} · ${words}`, changed, failed]
28
+ .filter((one) => one !== null)
29
+ .join(' · ');
62
30
  }
63
- export function runningLine(raw) {
64
- const parts = partsOf(raw);
31
+ export function runningLine(parts) {
65
32
  const note = [...parts].reverse().find((part) => part.type === 'text' && part.text.trim() !== '');
66
33
  if (note?.type === 'text')
67
34
  return excerpt(note.text);
68
- const commands = parts.reduce((sum, part) => (part.type === 'commands' ? sum + part.count : sum), 0);
69
- return commands === 0 ? null : counted(commands);
70
- }
71
- export function jobsOf(markers, turn) {
72
- const running = (turn === null ? [] : partsOf(turn.parts)).flatMap((part) => part.type === 'marker' && part.marker === 'job'
73
- ? [{ said: part.text, at: turn?.started ?? null }]
74
- : []);
75
- return openJobs([...markers, ...running]);
76
- }
77
- export function stillRunning(turns, subagents) {
78
- const open = [];
79
- for (const { turn, parts, ended } of turns) {
80
- for (const part of parts) {
81
- if (part.type === 'subagent') {
82
- const key = `subagent\u0000${part.description}`;
83
- if (part.done)
84
- closeLast(open, key);
85
- else if (ended) {
86
- open.push({
87
- turn,
88
- key,
89
- work: { kind: 'subagent', title: part.description, next: null, activity: null },
90
- });
91
- }
92
- continue;
93
- }
94
- if (part.type !== 'marker' || part.marker !== 'job')
95
- continue;
96
- markerMoved(open, part.text, (job, key) => ended
97
- ? {
98
- turn,
99
- key,
100
- work: {
101
- kind: job.kind === 'started' ? 'job' : 'schedule',
102
- title: job.label,
103
- next: job.next,
104
- activity: null,
105
- },
106
- }
107
- : null);
108
- }
109
- }
110
- const doing = [...subagents];
111
- const under = new Map();
112
- for (const { turn, work } of open) {
113
- const at = work.kind === 'subagent' ? doing.findIndex((one) => one.description === work.title) : -1;
114
- const shown = at === -1 ? work : { ...work, activity: doing.splice(at, 1)[0].activity };
115
- under.set(turn, [...(under.get(turn) ?? []), shown]);
116
- }
117
- return under;
35
+ return turnLine(parts, null);
118
36
  }
package/dist/paths.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export declare function normalize(path: string): string | null;
2
2
  export declare function beneath(prefix: string, path: string): boolean;
3
3
  export declare function covered(prefixes: readonly string[], path: string): boolean;
4
+ export declare function authoredAt(patterns: readonly string[], path: string): boolean;
4
5
  export declare function ancestors(path: string): readonly string[];
5
6
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGzD"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E;AAwBD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGzD"}
package/dist/paths.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isDocumentPath } from '@agentshouse/mdmodel';
1
2
  export function normalize(path) {
2
3
  const parts = [];
3
4
  for (const part of path.split('/')) {
@@ -22,6 +23,27 @@ export function covered(prefixes, path) {
22
23
  return normalized !== null && (normalized === '' || beneath(normalized, path));
23
24
  });
24
25
  }
26
+ function named(pattern, name) {
27
+ const star = pattern.indexOf('*');
28
+ if (star === -1)
29
+ return pattern === name;
30
+ const before = pattern.slice(0, star);
31
+ const after = pattern.slice(star + 1);
32
+ return (name.length > before.length + after.length && name.startsWith(before) && name.endsWith(after));
33
+ }
34
+ function matched(pattern, path) {
35
+ if (pattern === '/')
36
+ return isDocumentPath(path);
37
+ const wanted = pattern.split('/');
38
+ const names = path.split('/');
39
+ const open = wanted.at(-1) === '**';
40
+ const fixed = open ? wanted.slice(0, -1) : wanted;
41
+ return ((open ? names.length > fixed.length : names.length === fixed.length) &&
42
+ fixed.every((one, at) => named(one, names[at])));
43
+ }
44
+ export function authoredAt(patterns, path) {
45
+ return patterns.some((pattern) => matched(pattern, path));
46
+ }
25
47
  export function ancestors(path) {
26
48
  const parts = path.split('/');
27
49
  return parts.slice(1).map((_, at) => parts.slice(0, at + 1).join('/'));
@@ -0,0 +1,41 @@
1
+ import { type InstallShare } from './install.js';
2
+ import { type ReadinessChange } from './observation.js';
3
+ import { type PortReach } from './reach.js';
4
+ import { type CodeAvailability, type ConnectionAvailability, type Readiness, type RoomCoverage } from './readiness.js';
5
+ import type { Runtime } from './runtime.js';
6
+ export type ReadinessPort = {
7
+ readonly target: string;
8
+ readonly code: CodeAvailability;
9
+ };
10
+ export type ReadinessMessage = Readiness | ReadinessChange;
11
+ export type ReadinessWatch = {
12
+ readonly port: ReadinessPort;
13
+ readonly reach: PortReach | null;
14
+ readonly deliver: (readiness: ReadinessMessage) => void;
15
+ };
16
+ type Share = InstallShare & {
17
+ readonly coverage: RoomCoverage;
18
+ };
19
+ type Totals = {
20
+ installing: number;
21
+ downloading: number;
22
+ acquiring: number;
23
+ unsettled: number;
24
+ done: number;
25
+ total: number;
26
+ };
27
+ export type ReadinessShowing = {
28
+ readonly listing: number;
29
+ readonly roomsListed: boolean;
30
+ readonly named: ReadonlySet<string> | null;
31
+ readonly rooms: Map<string, Share>;
32
+ readonly totals: Totals;
33
+ shown: string;
34
+ };
35
+ export declare function prepare(runtime: Runtime, locators?: readonly string[]): void;
36
+ export declare function connectionNow(runtime: Runtime): Promise<ConnectionAvailability>;
37
+ export declare function deliverOwedReadiness(runtime: Runtime, owed: readonly ReadinessWatch[], touched: ReadonlySet<string> | null): Promise<void>;
38
+ export declare function watchReadiness({ store }: Runtime, port: ReadinessPort, reach: PortReach | null, deliver: (readiness: ReadinessMessage) => void): () => void;
39
+ export declare function filled(runtime: Runtime): void;
40
+ export {};
41
+ //# sourceMappingURL=preparation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preparation.d.ts","sourceRoot":"","sources":["../src/preparation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAE3B,KAAK,SAAS,EAEd,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,eAAe,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,KAAK,KAAK,GAAG,YAAY,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC;AAEhE,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwCF,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,QA4BzE;AAuDD,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAOrF;AAwMD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,iBAKpC;AAED,wBAAgB,cAAc,CAC5B,EAAE,KAAK,EAAE,EAAE,OAAO,EAClB,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,GAC7C,MAAM,IAAI,CAWZ;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,QAKtC"}
@@ -0,0 +1,326 @@
1
+ import { changeSet } from './change-set.js';
2
+ import { uncaught } from './failure.js';
3
+ import { installationOf, installShare } from './install.js';
4
+ import { listedLocators, listedOrHeld } from './listing.js';
5
+ import { keyedAt, keyedChange, unchanged, } from './observation.js';
6
+ import { planReach } from './reach.js';
7
+ import { COMPLETE_ROOMS, readinessOf, } from './readiness.js';
8
+ import { roomsOfReach } from './rows.js';
9
+ import { recoverReads } from './shown.js';
10
+ import { yielded } from './turn.js';
11
+ async function prepareReplica(runtime, locator) {
12
+ const { store, socket } = runtime;
13
+ for (;;) {
14
+ const held = (await store.rooms([locator])).get(locator);
15
+ if (held === undefined || socket.closed() || held.indexed)
16
+ return;
17
+ const key = held.record.key;
18
+ const done = await store.exclusive(async () => {
19
+ const local = await store.open();
20
+ return store.rederive(local, key, store.composed(held.record));
21
+ });
22
+ if (!done.done)
23
+ continue;
24
+ if ((await store.rooms([locator])).get(locator)?.record.key !== key)
25
+ continue;
26
+ store.changed(changeSet(locator, { documents: null }));
27
+ recoverReads(runtime, [locator]);
28
+ store.readiness.queue([locator]);
29
+ return;
30
+ }
31
+ }
32
+ async function unprepared({ store }) {
33
+ const held = (await store.covering()).rooms;
34
+ const { unpreparedDemand, unpreparable } = store.device.now();
35
+ return [...unpreparedDemand, ...held.keys()].find((locator) => !(held.get(locator)?.indexed ?? false) && !unpreparable.has(locator));
36
+ }
37
+ function unpreparedBy({ store }, locator) {
38
+ const { unpreparable } = store.device.now();
39
+ store.device.set({ unpreparable: new Set([...unpreparable, locator]) });
40
+ store.readiness.queue([locator]);
41
+ }
42
+ export function prepare(runtime, locators = []) {
43
+ const { store, socket } = runtime;
44
+ const { device } = store;
45
+ if (locators.length > 0) {
46
+ device.set({ unpreparedDemand: new Set([...device.now().unpreparedDemand, ...locators]) });
47
+ }
48
+ if (device.now().preparing)
49
+ return;
50
+ device.set({ preparing: true });
51
+ void (async () => {
52
+ try {
53
+ for (let waiting = await unprepared(runtime); waiting !== undefined; waiting = await unprepared(runtime)) {
54
+ await yielded();
55
+ if (socket.closed())
56
+ return;
57
+ const demand = new Set(device.now().unpreparedDemand);
58
+ demand.delete(waiting);
59
+ device.set({ unpreparedDemand: demand });
60
+ await prepareReplica(runtime, waiting).catch(() => unpreparedBy(runtime, waiting));
61
+ }
62
+ }
63
+ catch (error) {
64
+ uncaught(error);
65
+ }
66
+ finally {
67
+ device.set({ preparing: false });
68
+ }
69
+ })();
70
+ }
71
+ function requires(runtime, named, held, room) {
72
+ const listed = listedOrHeld(runtime, held, room);
73
+ if (named === null)
74
+ return listed;
75
+ return named.has(room) && (!runtime.socket.session.now().roomsListed || listed);
76
+ }
77
+ function requiredRooms(runtime, named, held) {
78
+ return [...(named ?? listedLocators(runtime, held))]
79
+ .filter((room) => requires(runtime, named, held, room))
80
+ .sort();
81
+ }
82
+ function roomState({ socket, presence }, locator, held) {
83
+ if (socket.session.now().roomsListed &&
84
+ (presence.room(locator) === undefined || !presence.available(locator)))
85
+ return 'unadmitted';
86
+ const stored = held.get(locator);
87
+ if (stored === undefined)
88
+ return 'acquiring';
89
+ if (!stored.indexed)
90
+ return 'preparing';
91
+ return 'complete';
92
+ }
93
+ function conversationCoverage({ socket, conversations }, reach) {
94
+ const declaredConversations = reach === null || reach.conversations;
95
+ if (!declaredConversations || socket.conversations() === undefined)
96
+ return 'undeclared';
97
+ if (!conversations.known() || !conversations.current())
98
+ return 'acquiring';
99
+ return 'complete';
100
+ }
101
+ function connectionOf({ socket }, lastCompleted) {
102
+ if (socket.isOpen())
103
+ return 'connected';
104
+ if (socket.session.now().moving.providerUnreachable)
105
+ return 'unreachable';
106
+ return !socket.streamed && lastCompleted !== null ? 'connected' : 'connecting';
107
+ }
108
+ export async function connectionNow(runtime) {
109
+ const { store, socket } = runtime;
110
+ if (socket.isOpen() || socket.session.now().moving.providerUnreachable || socket.streamed) {
111
+ return connectionOf(runtime, null);
112
+ }
113
+ if (!store.needed())
114
+ return connectionOf(runtime, socket.session.now().lastCompleted);
115
+ return connectionOf(runtime, (await (await store.open()).facts(['lastCompleted'])).lastCompleted);
116
+ }
117
+ async function readinessHeld({ store, socket }) {
118
+ if (!store.needed()) {
119
+ return {
120
+ held: new Map(),
121
+ facts: { lastCompleted: socket.session.now().lastCompleted, targets: {} },
122
+ };
123
+ }
124
+ const local = await store.open();
125
+ const [held, facts] = await Promise.all([
126
+ store.covering(),
127
+ local.facts(['lastCompleted', 'targets']),
128
+ ]);
129
+ return { held: held.rooms, facts };
130
+ }
131
+ function shareOf(runtime, room, held) {
132
+ const coverage = Object.freeze({ room, state: roomState(runtime, room, held) });
133
+ return { ...installShare(runtime.store, coverage, held), coverage };
134
+ }
135
+ function sameState(was, now) {
136
+ return was.coverage.state === now.coverage.state;
137
+ }
138
+ function coverageOf(change) {
139
+ return {
140
+ ...change,
141
+ changed: change.changed.map(([room, share]) => [room, share.coverage]),
142
+ };
143
+ }
144
+ function counted(totals, share, sign) {
145
+ const { state } = share.coverage;
146
+ totals.installing += share.installing ? sign : 0;
147
+ totals.downloading += share.downloading ? sign : 0;
148
+ totals.acquiring += state === 'acquiring' ? sign : 0;
149
+ totals.unsettled += COMPLETE_ROOMS.has(state) ? 0 : sign;
150
+ totals.done += sign * share.bytes.done;
151
+ totals.total += sign * share.bytes.total;
152
+ }
153
+ function showingOf(runtime, reach, held) {
154
+ const planned = planReach(reach);
155
+ const named = planned === null ? null : roomsOfReach(planned);
156
+ const totals = { installing: 0, downloading: 0, acquiring: 0, unsettled: 0, done: 0, total: 0 };
157
+ const rooms = new Map();
158
+ for (const room of requiredRooms(runtime, named, held)) {
159
+ const share = shareOf(runtime, room, held);
160
+ rooms.set(room, share);
161
+ counted(totals, share, 1);
162
+ }
163
+ return {
164
+ listing: runtime.presence.listing(),
165
+ roomsListed: runtime.socket.session.now().roomsListed,
166
+ named,
167
+ rooms,
168
+ totals,
169
+ shown: '',
170
+ };
171
+ }
172
+ function moved(runtime, showing, held, touched) {
173
+ const at = new Map();
174
+ for (const room of touched) {
175
+ at.set(room, requires(runtime, showing.named, held, room) ? shareOf(runtime, room, held) : null);
176
+ }
177
+ const change = keyedAt(showing.rooms, at, sameState);
178
+ if (change === null || change.removed.length > 0)
179
+ return null;
180
+ for (const [room, share] of at) {
181
+ if (share === null)
182
+ continue;
183
+ counted(showing.totals, showing.rooms.get(room), -1);
184
+ counted(showing.totals, share, 1);
185
+ showing.rooms.set(room, share);
186
+ }
187
+ return change;
188
+ }
189
+ function preparingIn(runtime, showing, rooms) {
190
+ const { unpreparable } = runtime.store.device.now();
191
+ const preparing = [...rooms].filter((room) => showing.rooms.get(room)?.coverage.state === 'preparing' && !unpreparable.has(room));
192
+ if (preparing.length > 0)
193
+ prepare(runtime, preparing);
194
+ }
195
+ function shownOf(runtime, { port, reach }, { named, totals }, { facts }) {
196
+ const { store, socket, usableWhenHeld } = runtime;
197
+ const { persistence, storageLoss, heldWhenOpened } = store.device.now();
198
+ const { roomsListed } = socket.session.now();
199
+ return readinessOf({
200
+ code: port.code,
201
+ coverage: {
202
+ listed: named === null ? roomsListed : roomsListed || totals.acquiring === 0,
203
+ unsettled: totals.unsettled,
204
+ conversations: conversationCoverage(runtime, reach),
205
+ },
206
+ persistence,
207
+ connection: connectionOf(runtime, facts.lastCompleted),
208
+ house: socket.session.now().refusal !== null
209
+ ? 'refused'
210
+ : socket.writesHeld()
211
+ ? 'write-halted'
212
+ : 'open',
213
+ space: store.space.full() ? 'full' : null,
214
+ installation: installationOf(totals.installing, totals.downloading, {
215
+ done: totals.done,
216
+ total: totals.total,
217
+ }),
218
+ lost: storageLoss !== null,
219
+ established: facts.targets[port.target]?.established === true ||
220
+ (heldWhenOpened && usableWhenHeld.includes(port.target)),
221
+ });
222
+ }
223
+ function establish(runtime, name) {
224
+ const { store } = runtime;
225
+ const { device } = store;
226
+ if (device.now().establishing.has(name) || !store.needed())
227
+ return;
228
+ device.set({ establishing: new Set([...device.now().establishing, name]) });
229
+ void store
230
+ .durably(async (local) => {
231
+ const { targets } = await local.facts(['targets']);
232
+ await local.fact('targets', { ...targets, [name]: { established: true } });
233
+ })
234
+ .then(() => {
235
+ store.readiness.queue([]);
236
+ void probeEachMinute(runtime);
237
+ }, uncaught)
238
+ .finally(() => {
239
+ const establishing = new Set(device.now().establishing);
240
+ establishing.delete(name);
241
+ device.set({ establishing });
242
+ });
243
+ }
244
+ function deliverReadiness(runtime, watch, held, touched) {
245
+ const { readiness } = runtime.store;
246
+ if (!readiness.held(watch))
247
+ return;
248
+ const kept = readiness.kept(watch);
249
+ const patched = kept === undefined ||
250
+ touched === null ||
251
+ kept.listing !== runtime.presence.listing() ||
252
+ kept.roomsListed !== runtime.socket.session.now().roomsListed
253
+ ? null
254
+ : moved(runtime, kept, held.held, touched);
255
+ const showing = patched === null ? showingOf(runtime, watch.reach, held.held) : kept;
256
+ preparingIn(runtime, showing, patched === null ? showing.rooms.keys() : touched);
257
+ const shown = shownOf(runtime, watch, showing, held);
258
+ if (shown.ready && held.facts.targets[watch.port.target]?.established !== true) {
259
+ establish(runtime, watch.port.target);
260
+ }
261
+ const text = JSON.stringify(shown);
262
+ const before = kept?.shown;
263
+ showing.shown = text;
264
+ readiness.keep(watch, showing);
265
+ if (kept === undefined) {
266
+ watch.deliver({
267
+ ...shown,
268
+ coverage: {
269
+ ...shown.coverage,
270
+ rooms: [...showing.rooms.values()].map(({ coverage }) => coverage),
271
+ },
272
+ });
273
+ return;
274
+ }
275
+ const rooms = coverageOf(patched ??
276
+ keyedChange(kept.rooms, [...showing.rooms.keys()], [...showing.rooms.values()], sameState));
277
+ if (text === before && unchanged(rooms))
278
+ return;
279
+ watch.deliver({ shown, rooms });
280
+ }
281
+ export async function deliverOwedReadiness(runtime, owed, touched) {
282
+ const held = await readinessHeld(runtime);
283
+ if (runtime.socket.closed())
284
+ return;
285
+ for (const watch of owed)
286
+ deliverReadiness(runtime, watch, held, touched);
287
+ }
288
+ export function watchReadiness({ store }, port, reach, deliver) {
289
+ const watch = { port, reach, deliver };
290
+ const stop = store.readiness.add(watch);
291
+ if (!store.needed())
292
+ store.readiness.owe([watch]);
293
+ else {
294
+ void store.open().then(() => store.readiness.owe([watch]), () => store.readiness.owe([watch]));
295
+ }
296
+ return stop;
297
+ }
298
+ export function filled(runtime) {
299
+ const { store, socket } = runtime;
300
+ if (socket.closed() || !store.space.fill())
301
+ return;
302
+ store.readiness.queue([]);
303
+ void probeEachMinute(runtime);
304
+ }
305
+ async function installedTarget({ store }) {
306
+ if (store.device.now().heldWhenOpened)
307
+ return true;
308
+ const { targets } = await (await store.open()).facts(['targets']);
309
+ return Object.values(targets).some((target) => target.established);
310
+ }
311
+ async function probeEachMinute(runtime) {
312
+ const { store, socket } = runtime;
313
+ const { space } = store;
314
+ const idle = () => !space.full() || space.probing() || socket.closed();
315
+ if (idle())
316
+ return;
317
+ const installed = await installedTarget(runtime).catch((error) => {
318
+ uncaught(error);
319
+ return false;
320
+ });
321
+ if (!installed)
322
+ return;
323
+ if (idle())
324
+ return;
325
+ space.probeEachMinute();
326
+ }
@@ -0,0 +1,58 @@
1
+ import type { DiscoveredRoom, ProviderRefusal, ScopedRefusal } from './adapter.js';
2
+ import type { ModelState } from './model.js';
3
+ type Repairable = {
4
+ readonly reset: string | undefined;
5
+ };
6
+ type Standing = {
7
+ readonly stale: boolean;
8
+ readonly repairable: Repairable | null;
9
+ readonly repairing: boolean;
10
+ readonly reloadDue: boolean;
11
+ };
12
+ export declare function lockingMode(mode: string | undefined): boolean;
13
+ type Listing = {
14
+ readonly whole: boolean;
15
+ readonly live: boolean;
16
+ };
17
+ export type Presence = {
18
+ list(found: readonly DiscoveredRoom[], how: Listing): readonly DiscoveredRoom[];
19
+ room(locator: string): DiscoveredRoom | undefined;
20
+ rooms(): readonly DiscoveredRoom[];
21
+ available(locator: string, selection?: string): boolean;
22
+ refusal(locator: string): ProviderRefusal | null;
23
+ unheldModel(locator: string): ModelState | null;
24
+ refused(locator: string, refusal: ScopedRefusal | null): void;
25
+ readable(locator: string): boolean;
26
+ modelled(locator: string, model: ModelState | null): void;
27
+ installed(locator: string, bootstrapped: boolean): void;
28
+ locked(locator: string, stored: () => Promise<string | null>): Promise<boolean>;
29
+ lockedAmong(stored: ReadonlyMap<string, {
30
+ readonly offline: string;
31
+ }>, locking: ReadonlySet<string>): readonly string[];
32
+ lockedAs(locator: string, mode: string | undefined): boolean;
33
+ connectionLost(lapsed: () => void): void;
34
+ connectionLive(): void;
35
+ lapse(): void;
36
+ stood(locator: string, stale: boolean, repairable?: Repairable | null): void;
37
+ repairing(locator: string, running: boolean): void;
38
+ reload(locator: string, due: boolean): void;
39
+ standing(locator: string): Standing;
40
+ settled(): boolean;
41
+ repairsOwed(): readonly string[];
42
+ askAgain(locator: string, ask: () => void): void;
43
+ stopAsking(locator?: string): void;
44
+ lose(locator: string, during: number): boolean;
45
+ writing(locator: string): boolean;
46
+ unwritten(locator: string): void;
47
+ lost(locator: string): boolean;
48
+ losing(): boolean;
49
+ listing(): number;
50
+ losses(): number;
51
+ lostSince(locator: string, losses: number): boolean;
52
+ liftable(locator: string, discovery: number): boolean;
53
+ lift(locator: string, discovery: number, unfenced: boolean): void;
54
+ close(): void;
55
+ };
56
+ export declare function createPresence(notReadyWaitMs: (asked: number) => number): Presence;
57
+ export {};
58
+ //# sourceMappingURL=presence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":"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"}