@agentshouse/mdruntime 0.1.0-cfbf80d8d4644 → 0.1.0-cfcf93be6310b

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 (187) hide show
  1. package/README.md +24 -11
  2. package/dist/adapter.d.ts +182 -47
  3. package/dist/adapter.d.ts.map +1 -1
  4. package/dist/attached-model.d.ts +5 -1
  5. package/dist/attached-model.d.ts.map +1 -1
  6. package/dist/attached-model.js +53 -6
  7. package/dist/attempt.d.ts +16 -0
  8. package/dist/attempt.d.ts.map +1 -0
  9. package/dist/attempt.js +70 -0
  10. package/dist/binary.d.ts +18 -0
  11. package/dist/binary.d.ts.map +1 -0
  12. package/dist/binary.js +8 -0
  13. package/dist/bootstrap.d.ts +33 -5
  14. package/dist/bootstrap.d.ts.map +1 -1
  15. package/dist/bootstrap.js +202 -48
  16. package/dist/chain.d.ts +11 -0
  17. package/dist/chain.d.ts.map +1 -0
  18. package/dist/chain.js +64 -0
  19. package/dist/change-set.d.ts +9 -14
  20. package/dist/change-set.d.ts.map +1 -1
  21. package/dist/change-set.js +11 -56
  22. package/dist/change.d.ts +45 -0
  23. package/dist/change.d.ts.map +1 -1
  24. package/dist/change.js +34 -0
  25. package/dist/client.d.ts +38 -17
  26. package/dist/client.d.ts.map +1 -1
  27. package/dist/client.js +156 -20
  28. package/dist/collection.d.ts +13 -14
  29. package/dist/collection.d.ts.map +1 -1
  30. package/dist/collection.js +52 -56
  31. package/dist/compile.d.ts +16 -0
  32. package/dist/compile.d.ts.map +1 -0
  33. package/dist/compile.js +789 -0
  34. package/dist/connection.d.ts +59 -20
  35. package/dist/connection.d.ts.map +1 -1
  36. package/dist/connection.js +4080 -879
  37. package/dist/context.d.ts +2 -0
  38. package/dist/context.d.ts.map +1 -0
  39. package/dist/context.js +7 -0
  40. package/dist/conversation.d.ts +51 -20
  41. package/dist/conversation.d.ts.map +1 -1
  42. package/dist/conversation.js +732 -242
  43. package/dist/digest.d.ts +7 -0
  44. package/dist/digest.d.ts.map +1 -0
  45. package/dist/digest.js +113 -0
  46. package/dist/durability.d.ts +4 -1
  47. package/dist/durability.d.ts.map +1 -1
  48. package/dist/durability.js +5 -0
  49. package/dist/entry.d.ts +20 -0
  50. package/dist/entry.d.ts.map +1 -0
  51. package/dist/entry.js +152 -0
  52. package/dist/expectation.d.ts +21 -0
  53. package/dist/expectation.d.ts.map +1 -0
  54. package/dist/expectation.js +70 -0
  55. package/dist/failure.d.ts +13 -0
  56. package/dist/failure.d.ts.map +1 -0
  57. package/dist/failure.js +19 -0
  58. package/dist/fence.d.ts +6 -0
  59. package/dist/fence.d.ts.map +1 -0
  60. package/dist/fence.js +10 -0
  61. package/dist/file.d.ts +2 -19
  62. package/dist/file.d.ts.map +1 -1
  63. package/dist/file.js +7 -122
  64. package/dist/host.d.ts +11 -2
  65. package/dist/host.d.ts.map +1 -1
  66. package/dist/host.js +128 -24
  67. package/dist/identity.d.ts +4 -0
  68. package/dist/identity.d.ts.map +1 -1
  69. package/dist/identity.js +16 -1
  70. package/dist/index.d.ts +22 -9
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +11 -0
  73. package/dist/job.d.ts +14 -0
  74. package/dist/job.d.ts.map +1 -0
  75. package/dist/job.js +28 -0
  76. package/dist/live.d.ts +23 -0
  77. package/dist/live.d.ts.map +1 -0
  78. package/dist/live.js +127 -0
  79. package/dist/media.d.ts +8 -0
  80. package/dist/media.d.ts.map +1 -0
  81. package/dist/media.js +218 -0
  82. package/dist/memory.d.ts +20 -7
  83. package/dist/memory.d.ts.map +1 -1
  84. package/dist/memory.js +253 -92
  85. package/dist/messages.d.ts +28 -0
  86. package/dist/messages.d.ts.map +1 -0
  87. package/dist/messages.js +89 -0
  88. package/dist/model.d.ts +19 -4
  89. package/dist/model.d.ts.map +1 -1
  90. package/dist/model.js +10 -2
  91. package/dist/name.d.ts +4 -0
  92. package/dist/name.d.ts.map +1 -0
  93. package/dist/name.js +122 -0
  94. package/dist/observation.d.ts +22 -4
  95. package/dist/observation.d.ts.map +1 -1
  96. package/dist/observation.js +120 -14
  97. package/dist/open.d.ts +2 -0
  98. package/dist/open.d.ts.map +1 -0
  99. package/dist/open.js +1 -0
  100. package/dist/opened.d.ts +22 -0
  101. package/dist/opened.d.ts.map +1 -0
  102. package/dist/opened.js +107 -0
  103. package/dist/outcome.d.ts +72 -5
  104. package/dist/outcome.d.ts.map +1 -1
  105. package/dist/outcome.js +81 -1
  106. package/dist/overlay.d.ts +15 -5
  107. package/dist/overlay.d.ts.map +1 -1
  108. package/dist/overlay.js +136 -180
  109. package/dist/paths.d.ts +1 -0
  110. package/dist/paths.d.ts.map +1 -1
  111. package/dist/paths.js +4 -0
  112. package/dist/phrase.d.ts +3 -0
  113. package/dist/phrase.d.ts.map +1 -0
  114. package/dist/phrase.js +8 -0
  115. package/dist/query.d.ts +75 -5
  116. package/dist/query.d.ts.map +1 -1
  117. package/dist/query.js +119 -26
  118. package/dist/reach.d.ts +18 -4
  119. package/dist/reach.d.ts.map +1 -1
  120. package/dist/reach.js +234 -69
  121. package/dist/react.d.ts +32 -19
  122. package/dist/react.d.ts.map +1 -1
  123. package/dist/react.js +13 -21
  124. package/dist/readiness.d.ts +50 -0
  125. package/dist/readiness.d.ts.map +1 -0
  126. package/dist/readiness.js +27 -0
  127. package/dist/recovery.d.ts +26 -0
  128. package/dist/recovery.d.ts.map +1 -0
  129. package/dist/recovery.js +224 -0
  130. package/dist/refresh.d.ts +20 -7
  131. package/dist/refresh.d.ts.map +1 -1
  132. package/dist/refresh.js +167 -59
  133. package/dist/replica.d.ts +59 -33
  134. package/dist/replica.d.ts.map +1 -1
  135. package/dist/replica.js +324 -157
  136. package/dist/room-draft.d.ts +59 -11
  137. package/dist/room-draft.d.ts.map +1 -1
  138. package/dist/room-draft.js +276 -80
  139. package/dist/rows.d.ts +40 -34
  140. package/dist/rows.d.ts.map +1 -1
  141. package/dist/rows.js +202 -80
  142. package/dist/save.d.ts +73 -4
  143. package/dist/save.d.ts.map +1 -1
  144. package/dist/save.js +825 -152
  145. package/dist/search.d.ts +15 -54
  146. package/dist/search.d.ts.map +1 -1
  147. package/dist/search.js +10 -121
  148. package/dist/seed.d.ts +16 -0
  149. package/dist/seed.d.ts.map +1 -0
  150. package/dist/seed.js +75 -0
  151. package/dist/shared.d.ts +15 -0
  152. package/dist/shared.d.ts.map +1 -0
  153. package/dist/shared.js +421 -0
  154. package/dist/status.d.ts +7 -2
  155. package/dist/status.d.ts.map +1 -1
  156. package/dist/status.js +3 -9
  157. package/dist/store.d.ts +118 -59
  158. package/dist/store.d.ts.map +1 -1
  159. package/dist/store.js +354 -344
  160. package/dist/stored.d.ts +162 -0
  161. package/dist/stored.d.ts.map +1 -0
  162. package/dist/stored.js +549 -0
  163. package/dist/tables.d.ts +353 -0
  164. package/dist/tables.d.ts.map +1 -0
  165. package/dist/tables.js +585 -0
  166. package/dist/transfer.d.ts +0 -5
  167. package/dist/transfer.d.ts.map +1 -1
  168. package/dist/turn.d.ts +9 -0
  169. package/dist/turn.d.ts.map +1 -0
  170. package/dist/turn.js +75 -0
  171. package/dist/validation.d.ts +29 -0
  172. package/dist/validation.d.ts.map +1 -0
  173. package/dist/validation.js +104 -0
  174. package/dist/windows.d.ts +22 -0
  175. package/dist/windows.d.ts.map +1 -0
  176. package/dist/windows.js +89 -0
  177. package/dist/wire.d.ts +170 -33
  178. package/dist/wire.d.ts.map +1 -1
  179. package/dist/wire.js +69 -31
  180. package/package.json +26 -15
  181. package/AGENTS.md +0 -232
  182. package/dist/attachment.d.ts +0 -3
  183. package/dist/attachment.d.ts.map +0 -1
  184. package/dist/attachment.js +0 -8
  185. package/dist/read-side.d.ts +0 -18
  186. package/dist/read-side.d.ts.map +0 -1
  187. package/dist/read-side.js +0 -377
package/dist/query.js CHANGED
@@ -1,17 +1,45 @@
1
+ import { pointerFacts, } from '@agentshouse/mdmodel';
1
2
  import { referenceField } from './model.js';
2
3
  import { normalize } from './paths.js';
4
+ import { decodedCursor } from './windows.js';
5
+ export function bodied(shape) {
6
+ return shape.sections !== null || shape.preamble || shape.markdown;
7
+ }
3
8
  export class QueryError extends Error {
9
+ code;
10
+ retryable = false;
4
11
  constructor(code, at, problem) {
5
12
  super(`${code} at ${at}: ${problem}`);
13
+ this.code = code;
6
14
  }
7
15
  }
8
16
  const RANGE = ['$gt', '$gte', '$lt', '$lte'];
9
17
  const SINGLE = ['$eq', '$ne', '$in', '$nin', '$all', '$size', '$exists'];
10
- const FILTER = ['rooms', 'types', 'where', 'pathPrefix', 'hop', 'backlinks'];
18
+ const FILTER = [
19
+ 'rooms',
20
+ 'types',
21
+ 'where',
22
+ 'pathPrefix',
23
+ 'folder',
24
+ 'paths',
25
+ 'hop',
26
+ 'backlinks',
27
+ 'text',
28
+ ];
11
29
  const RELATED = ['types', 'where', 'pathPrefix', 'field'];
12
- const PARTS = ['fields', 'sections', 'preamble', 'markdown', 'backlinks', 'change'];
30
+ const PARTS = [
31
+ 'fields',
32
+ 'sections',
33
+ 'preamble',
34
+ 'markdown',
35
+ 'backlinks',
36
+ 'change',
37
+ 'fileId',
38
+ 'revision',
39
+ ];
13
40
  const ORDER = ['by', 'direction', 'nulls', 'stringSort', 'locale', 'localeOptions'];
14
41
  const CALENDAR_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
42
+ const STRAY_ESCAPE = /~(?![01])/u;
15
43
  export function invalid(at, problem) {
16
44
  throw new QueryError('invalid-query', at, problem);
17
45
  }
@@ -55,6 +83,18 @@ function names(input, at) {
55
83
  invalid(at, 'expects a list of names');
56
84
  return [...new Set(listed)].sort();
57
85
  }
86
+ function pathsOf(input) {
87
+ const listed = list(input, 'paths');
88
+ if (listed.some((item) => typeof item !== 'string' || item === '' || normalize(item) !== item)) {
89
+ invalid('paths', 'expects a list of Paths');
90
+ }
91
+ return [...new Set(listed)].sort();
92
+ }
93
+ function phrase(input) {
94
+ if (typeof input !== 'string' || input === '')
95
+ invalid('text', 'expects a phrase');
96
+ return input;
97
+ }
58
98
  function directory(input, at) {
59
99
  if (typeof input !== 'string' || normalize(input) !== input) {
60
100
  invalid(at, 'expects a normalized directory');
@@ -109,23 +149,46 @@ function typing(facts, rooms, types, at) {
109
149
  types: types === null ? declared : declared.filter((type) => types.includes(type.name)),
110
150
  };
111
151
  }
112
- function specs(typed, field, at) {
113
- const declared = typed.types.flatMap((type) => Object.hasOwn(type.fields, field) ? [type.fields[field]] : []);
152
+ function pointer(input, at) {
153
+ if (typeof input !== 'string' || !input.startsWith('/') || STRAY_ESCAPE.test(input)) {
154
+ invalid(at, 'expects a JSON Pointer');
155
+ }
156
+ return input;
157
+ }
158
+ function specs(typed, input, at) {
159
+ const field = pointer(input, at);
160
+ const declared = typed.types.flatMap((type) => {
161
+ const spec = pointerFacts(type, field);
162
+ return spec === undefined ? [] : [spec];
163
+ });
114
164
  if (declared.length === 0 && !typed.untyped) {
115
165
  throw new QueryError('unknown-field', at, `no MD Type it reads declares ${field}`);
116
166
  }
117
- return declared;
167
+ if (!declared.some((spec) => spec.conditional))
168
+ return declared;
169
+ return declared.map((spec) => ({
170
+ facts: { prose: false },
171
+ through: several(spec),
172
+ conditional: true,
173
+ }));
174
+ }
175
+ function several(spec) {
176
+ return spec.through || spec.facts.type === 'array';
177
+ }
178
+ function single(spec) {
179
+ return spec.facts.type !== undefined && spec.facts.type !== 'array';
180
+ }
181
+ function every(declared, holds) {
182
+ return declared.length > 0 && declared.every(holds);
118
183
  }
119
184
  function kind(declared, checked, at) {
120
- if (checked === null || declared.length === 0 || declared.some((spec) => fits(spec, checked))) {
185
+ if (checked === null ||
186
+ declared.length === 0 ||
187
+ declared.some((spec) => fits(spec.facts, checked))) {
121
188
  return;
122
189
  }
123
190
  throw new QueryError('wrong-kind', at, `${JSON.stringify(checked)} is not of its field's kind`);
124
191
  }
125
- function listed(declared, list) {
126
- return (declared.length > 0 &&
127
- declared.every((facts) => facts.type !== undefined && (facts.type === 'array') === list));
128
- }
129
192
  function test(declared, input, at) {
130
193
  if (!plain(input)) {
131
194
  const equal = value(input, at);
@@ -139,8 +202,11 @@ function test(declared, input, at) {
139
202
  const stray = operators.find((operator) => !RANGE.includes(operator));
140
203
  if (stray !== undefined)
141
204
  invalid(place(at, stray), 'cannot join a range');
142
- if (listed(declared, true))
205
+ if (every(declared, (spec) => spec.facts.type === 'array'))
143
206
  invalid(at, 'a range on a list');
207
+ if (every(declared, (spec) => spec.facts.type === 'boolean' || spec.facts.type === 'object')) {
208
+ throw new QueryError('wrong-kind', at, 'its field does not compare in order');
209
+ }
144
210
  return {
145
211
  op: 'range',
146
212
  bounds: RANGE.filter((operator) => operators.includes(operator)).map((operator) => {
@@ -173,7 +239,7 @@ function test(declared, input, at) {
173
239
  return { op: 'nin', values: compared };
174
240
  if (compared.includes(null))
175
241
  invalid(where, 'a list holds no null');
176
- if (listed(declared, false))
242
+ if (every(declared, single))
177
243
  invalid(where, 'the field is not a list');
178
244
  return { op: 'all', values: compared };
179
245
  }
@@ -181,7 +247,7 @@ function test(declared, input, at) {
181
247
  if (!Number.isSafeInteger(operand) || operand < 0) {
182
248
  invalid(where, 'expects a nonnegative integer');
183
249
  }
184
- if (listed(declared, false))
250
+ if (every(declared, single))
185
251
  invalid(where, 'the field is not a list');
186
252
  return { op: 'size', size: operand };
187
253
  }
@@ -194,7 +260,7 @@ function condition(typed, input, at) {
194
260
  invalid(at, 'expects an object of field predicates');
195
261
  const conditions = [];
196
262
  for (const name of Object.keys(input).sort()) {
197
- const where = place(at, name);
263
+ const where = name.startsWith('/') ? `${at}${name}` : place(at, name);
198
264
  const entry = input[name];
199
265
  if (name === '$and' || name === '$or') {
200
266
  const nested = list(entry, where).map((item, index) => condition(typed, item, `${where}[${index}]`));
@@ -224,11 +290,11 @@ function scope(facts, rooms, input, at) {
224
290
  };
225
291
  }
226
292
  function referenceName(typed, field, at) {
227
- if (typeof field !== 'string')
228
- invalid(at, 'expects a field name');
229
293
  const declared = specs(typed, field, at);
230
- if (declared.length > 0 && !declared.some(referenceField))
294
+ if (declared.length > 0 &&
295
+ !declared.some((spec) => spec.conditional || referenceField(spec.facts))) {
231
296
  invalid(at, 'not a reference field');
297
+ }
232
298
  return field;
233
299
  }
234
300
  function hopOf(facts, rooms, root, input) {
@@ -248,13 +314,16 @@ function backlinksOf(facts, rooms, input) {
248
314
  return { types, where, pathPrefix, field };
249
315
  }
250
316
  function keyPlan(typed, input, at, path) {
251
- if (input === 'room' || input === 'type' || (path && input === 'path'))
317
+ if (input === 'room' || input === 'type' || input === 'folder' || (path && input === 'path')) {
252
318
  return { of: input };
253
- if (plain(input) && typeof input.field === 'string' && Object.keys(input).length === 1) {
254
- specs(typed, input.field, place(at, 'field'));
319
+ }
320
+ if (plain(input) && Object.hasOwn(input, 'field') && Object.keys(input).length === 1) {
321
+ if (specs(typed, input.field, place(at, 'field')).some(several)) {
322
+ invalid(place(at, 'field'), 'a path that can hold several values');
323
+ }
255
324
  return { of: 'field', field: input.field };
256
325
  }
257
- return invalid(at, path ? 'expects room, path, type or a field' : 'expects room, type or a field');
326
+ return invalid(at, path ? 'expects room, path, type, folder or a field' : 'expects room, type, folder or a field');
258
327
  }
259
328
  function direction(input, at) {
260
329
  if (input === undefined)
@@ -309,14 +378,14 @@ function parts(typed, input, at, fields) {
309
378
  return 'all';
310
379
  const named = list(input, at);
311
380
  named.forEach((name, index) => {
312
- if (typeof name !== 'string')
313
- invalid(`${at}[${index}]`, 'expects a name');
314
381
  if (fields)
315
382
  specs(typed, name, `${at}[${index}]`);
383
+ else if (typeof name !== 'string')
384
+ invalid(`${at}[${index}]`, 'expects a name');
316
385
  });
317
386
  return named;
318
387
  }
319
- function flag(input, at) {
388
+ export function flag(input, at) {
320
389
  if (input === undefined)
321
390
  return false;
322
391
  if (input !== true)
@@ -344,6 +413,8 @@ function documentShape(typed, input) {
344
413
  markdown: true,
345
414
  backlinks: true,
346
415
  change: true,
416
+ fileId: true,
417
+ revision: true,
347
418
  orderBy,
348
419
  };
349
420
  }
@@ -358,6 +429,8 @@ function documentShape(typed, input) {
358
429
  markdown: flag(select.markdown, 'select.markdown'),
359
430
  backlinks: flag(select.backlinks, 'select.backlinks'),
360
431
  change: flag(select.change, 'select.change'),
432
+ fileId: flag(select.fileId, 'select.fileId'),
433
+ revision: flag(select.revision, 'select.revision'),
361
434
  orderBy,
362
435
  };
363
436
  }
@@ -388,20 +461,37 @@ export function planOf(input, facts, reach = null) {
388
461
  invalid('select', 'a grouped query selects nothing');
389
462
  if (!grouped && input.select === undefined)
390
463
  invalid('select', 'a Document query must select');
391
- known(input, [...FILTER, 'orderBy', 'limit', grouped ? 'groupBy' : 'select'], '');
464
+ known(input, [...FILTER, 'orderBy', 'limit', 'after', 'total', grouped ? 'groupBy' : 'select'], '');
392
465
  const limit = limitOf(input.limit);
393
466
  const rooms = input.rooms === undefined ? null : names(input.rooms, 'rooms');
394
467
  const { typed, ...root } = scope(facts, rooms, input, '');
468
+ const shape = grouped ? groupShape(typed, input) : documentShape(typed, input);
395
469
  return {
470
+ key: queryKey(input),
396
471
  rooms,
397
472
  reach,
473
+ locked: [],
398
474
  root,
475
+ folder: input.folder === undefined ? null : directory(input.folder, 'folder'),
476
+ paths: input.paths === undefined ? null : pathsOf(input.paths),
399
477
  hop: input.hop === undefined ? null : hopOf(facts, rooms, typed, input.hop),
400
478
  backlinks: input.backlinks === undefined ? null : backlinksOf(facts, rooms, input.backlinks),
401
- shape: grouped ? groupShape(typed, input) : documentShape(typed, input),
479
+ text: input.text === undefined ? null : phrase(input.text),
480
+ shape,
402
481
  limit,
482
+ after: continuationOf(input.after, shape.orderBy.length + 1),
483
+ total: flag(input.total, 'total'),
403
484
  };
404
485
  }
486
+ function continuationOf(input, arity) {
487
+ if (input === undefined)
488
+ return null;
489
+ const values = typeof input === 'string' ? decodedCursor(input) : null;
490
+ if (values === null || (values.length !== 0 && values.length !== arity)) {
491
+ invalid('after', 'expects the next an earlier result of this query returned');
492
+ }
493
+ return { text: input, values: values.length === 0 ? null : values };
494
+ }
405
495
  export function limitOf(input) {
406
496
  if (input === undefined)
407
497
  return null;
@@ -416,6 +506,9 @@ export function filterOf(input, facts, reach = null) {
416
506
  known(input, FILTER, '');
417
507
  return planOf({ ...input, select: {} }, facts, reach);
418
508
  }
509
+ export function queryKey(query) {
510
+ return canonical(query);
511
+ }
419
512
  function canonical(value) {
420
513
  if (Array.isArray(value))
421
514
  return `[${value.map(canonical).join(',')}]`;
package/dist/reach.d.ts CHANGED
@@ -1,17 +1,25 @@
1
- import type { MdRuntime, RuntimeTopic } from './connection.js';
1
+ import type { AppRoom, MdRuntime, ReadinessPort, RuntimeTopic } from './connection.js';
2
2
  import type { Plan, PlanReach, QueryResult } from './query.js';
3
+ import type { Readiness } from './readiness.js';
3
4
  import type { SearchResult } from './search.js';
4
5
  export type ReachedDocument = {
5
6
  readonly room: string;
6
7
  readonly path: string;
7
8
  };
9
+ export type ReachedArea = {
10
+ readonly room: string;
11
+ readonly path: string;
12
+ readonly open: readonly string[];
13
+ };
8
14
  export type PortReach = {
9
15
  readonly rooms: readonly string[];
10
16
  readonly documents: readonly ReachedDocument[];
17
+ readonly areas?: readonly ReachedArea[];
11
18
  readonly conversations: boolean;
12
19
  };
13
20
  export type Deliver = (message: unknown) => void;
14
- export type Watch = (topic: RuntimeTopic, input: readonly unknown[], deliver: Deliver) => () => void;
21
+ export type Fail = (error: unknown) => void;
22
+ export type Watch = (topic: RuntimeTopic, input: readonly unknown[], deliver: Deliver, fail: Fail) => () => void;
15
23
  export type RuntimeView = {
16
24
  md: MdRuntime;
17
25
  watch: Watch;
@@ -22,8 +30,14 @@ export type NarrowedView = RuntimeView & {
22
30
  export type Reachable = RuntimeView & {
23
31
  plan(input: unknown, reach: PortReach | null): Plan;
24
32
  query(plan: Plan): Promise<QueryResult>;
25
- watchPlan(plan: Plan, deliver: (message: unknown) => void): () => void;
33
+ watchPlan(plan: Plan, deliver: Deliver, fail: Fail): () => void;
26
34
  search(input: unknown, reach: PortReach | null): Promise<SearchResult>;
35
+ watchReadiness(port: ReadinessPort, reach: PortReach | null, deliver: (readiness: Readiness) => void): () => void;
36
+ locked(room: string): boolean;
37
+ lockedRooms(): readonly string[];
38
+ watchLocks(notify: () => void): () => void;
39
+ located(room: string, path: string, destination: string): ReachedDocument | null;
40
+ room(locator: string): AppRoom | undefined;
27
41
  };
28
42
  export declare function holds(reach: PortReach | null, room: string): boolean;
29
43
  export declare function governs(reach: PortReach | null, room: {
@@ -36,5 +50,5 @@ export declare function governs(reach: PortReach | null, room: {
36
50
  readonly selection: boolean;
37
51
  };
38
52
  export declare function planReach(reach: PortReach | null): PlanReach | null;
39
- export declare function narrowed(runtime: Reachable, given: PortReach | null): NarrowedView;
53
+ export declare function narrowed(runtime: Reachable, given: PortReach | null, port: ReadinessPort): NarrowedView;
40
54
  //# sourceMappingURL=reach.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,SAAS,EAAe,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAMjG,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG,CAClB,KAAK,EA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