@agentshouse/mdruntime-adapter 0.1.0-alpha.9 → 0.1.0-c506c7d6e6199

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 (61) hide show
  1. package/AGENTS.md +156 -27
  2. package/README.md +32 -0
  3. package/dist/actions.d.ts +4 -12
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +239 -332
  6. package/dist/adapter.d.ts.map +1 -1
  7. package/dist/adapter.js +271 -197
  8. package/dist/digest.js +1 -5
  9. package/dist/discovery.d.ts +22 -26
  10. package/dist/discovery.d.ts.map +1 -1
  11. package/dist/discovery.js +154 -223
  12. package/dist/gather.d.ts +3 -0
  13. package/dist/gather.d.ts.map +1 -0
  14. package/dist/gather.js +40 -0
  15. package/dist/index.d.ts +1 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +0 -3
  18. package/dist/links.d.ts +12 -0
  19. package/dist/links.d.ts.map +1 -0
  20. package/dist/links.js +66 -0
  21. package/dist/map.d.ts +2 -2
  22. package/dist/map.d.ts.map +1 -1
  23. package/dist/map.js +6 -7
  24. package/dist/model.d.ts +2 -2
  25. package/dist/model.d.ts.map +1 -1
  26. package/dist/model.js +21 -39
  27. package/dist/read.d.ts +31 -26
  28. package/dist/read.d.ts.map +1 -1
  29. package/dist/read.js +208 -199
  30. package/dist/refusal.d.ts +3 -1
  31. package/dist/refusal.d.ts.map +1 -1
  32. package/dist/refusal.js +27 -62
  33. package/dist/site.d.ts.map +1 -1
  34. package/dist/site.js +110 -124
  35. package/dist/stream.d.ts +11 -5
  36. package/dist/stream.d.ts.map +1 -1
  37. package/dist/stream.js +209 -213
  38. package/dist/transport.d.ts +45 -28
  39. package/dist/transport.d.ts.map +1 -1
  40. package/dist/transport.js +2 -3
  41. package/dist/version.d.ts +1 -0
  42. package/dist/version.d.ts.map +1 -1
  43. package/dist/version.js +23 -18
  44. package/dist/write.d.ts +5 -7
  45. package/dist/write.d.ts.map +1 -1
  46. package/dist/write.js +127 -215
  47. package/package.json +4 -12
  48. package/dist/actions.js.map +0 -1
  49. package/dist/adapter.js.map +0 -1
  50. package/dist/digest.js.map +0 -1
  51. package/dist/discovery.js.map +0 -1
  52. package/dist/index.js.map +0 -1
  53. package/dist/map.js.map +0 -1
  54. package/dist/model.js.map +0 -1
  55. package/dist/read.js.map +0 -1
  56. package/dist/refusal.js.map +0 -1
  57. package/dist/site.js.map +0 -1
  58. package/dist/stream.js.map +0 -1
  59. package/dist/transport.js.map +0 -1
  60. package/dist/version.js.map +0 -1
  61. package/dist/write.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
2
- export { nativePath, roomLocalPath } from './map.js';
3
- export type { HouseByteAct, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamAuthority, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
2
+ export type { HouseByteAct, HouseByteAnswer, HouseByteTransfer, HouseDoorAnswer, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,YAAY,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1 @@
1
1
  export { createAgentsHouseAdapter } from './adapter.js';
2
- export { nativePath, roomLocalPath } from './map.js';
3
-
4
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ import type { HouseScope, HouseView } from './read.js';
2
+ import type { StreamedAdvancement } from './stream.js';
3
+ export type RoomLinks = {
4
+ roomVersion: string;
5
+ handed: ReadonlySet<string>;
6
+ paths: ReadonlyMap<string, ReadonlySet<string>>;
7
+ revisions: ReadonlyMap<string, string>;
8
+ };
9
+ export declare function scopeLinks(scope: HouseScope): RoomLinks;
10
+ export declare function enumeratedLinks(view: HouseView, earlier: RoomLinks | undefined): RoomLinks;
11
+ export declare function streamedLinks(held: RoomLinks, advanced: StreamedAdvancement): RoomLinks | null;
12
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAOvD,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAYF,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAWvD;AAOD,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAgB1F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI,CAoB9F"}
package/dist/links.js ADDED
@@ -0,0 +1,66 @@
1
+ import { roomVersion } from './version.js';
2
+ const ATTACHMENT_REFERENCE = /at_[1-9a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]*\.[0-9a-hjkmnp-tv-z]/g;
3
+ const NONE = new Set();
4
+ function linkedBy(text) {
5
+ if (text === null)
6
+ return NONE;
7
+ const references = new Set(Array.from(text.matchAll(ATTACHMENT_REFERENCE), ([found]) => found));
8
+ return references.size === 0 ? NONE : references;
9
+ }
10
+ function handedOf(attachments) {
11
+ return new Set((attachments ?? []).map((attachment) => attachment.reference));
12
+ }
13
+ export function scopeLinks(scope) {
14
+ return {
15
+ roomVersion: roomVersion(scope),
16
+ handed: handedOf(scope.attachments),
17
+ paths: new Map(scope.contents.map(({ path, content }) => [path, linkedBy(content)])),
18
+ revisions: new Map(scope.files.flatMap(({ path, revision }) => revision === undefined ? [] : [[path, revision]])),
19
+ };
20
+ }
21
+ function revised(revisions, path, revision) {
22
+ if (revision === undefined)
23
+ revisions.delete(path);
24
+ else
25
+ revisions.set(path, revision);
26
+ }
27
+ export function enumeratedLinks(view, earlier) {
28
+ const paths = new Map(earlier?.paths);
29
+ const revisions = new Map(earlier?.revisions);
30
+ for (const change of view.changes) {
31
+ paths.set(change.path, linkedBy('content' in change ? change.content : null));
32
+ revised(revisions, change.path, 'removed' in change
33
+ ? undefined
34
+ : 'reference' in change
35
+ ? change.reference.revision
36
+ : change.revision);
37
+ }
38
+ return { roomVersion: roomVersion(view), handed: handedOf(view.attachments), paths, revisions };
39
+ }
40
+ export function streamedLinks(held, advanced) {
41
+ const paths = new Map(held.paths);
42
+ const revisions = new Map(held.revisions);
43
+ const dropped = new Set();
44
+ for (const entry of advanced.entries) {
45
+ revised(revisions, entry.path, entry.kind === 'removed' ? undefined : entry.revision);
46
+ const text = entry.kind === 'removed' ? null : entry.text;
47
+ if (text === undefined)
48
+ return null;
49
+ const linked = linkedBy(text);
50
+ for (const reference of linked)
51
+ if (!held.handed.has(reference))
52
+ return null;
53
+ for (const reference of paths.get(entry.path) ?? held.handed) {
54
+ if (held.handed.has(reference) && !linked.has(reference))
55
+ dropped.add(reference);
56
+ }
57
+ paths.set(entry.path, linked);
58
+ }
59
+ for (const references of paths.values()) {
60
+ for (const reference of references)
61
+ dropped.delete(reference);
62
+ }
63
+ if (dropped.size > 0)
64
+ return null;
65
+ return { roomVersion: advanced.page.roomVersion, handed: held.handed, paths, revisions };
66
+ }
package/dist/map.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare function roomLocalPath(path: string, handle?: string): string;
2
- export declare function nativePath(path: string, handle?: string): string;
1
+ export declare function roomLocalPath(path: string, handle: string): string;
2
+ export declare function nativePath(path: string, handle: string): string;
3
3
  //# sourceMappingURL=map.d.ts.map
package/dist/map.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAUnE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhE"}
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUlE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG/D"}
package/dist/map.js CHANGED
@@ -1,15 +1,14 @@
1
1
  export function roomLocalPath(path, handle) {
2
- const prefix = handle === undefined ? '/private/' : `/rooms/${handle}/`;
2
+ const prefix = `/rooms/${handle}/`;
3
3
  const local = path.startsWith(prefix) ? path.slice(prefix.length) : path;
4
- if (local === '' || local.split('/').some((part)=>part === '' || part === '.' || part === '..')) {
4
+ if (local === '' ||
5
+ local.split('/').some((part) => part === '' || part === '.' || part === '..')) {
5
6
  throw new Error('invalid authority-relative path');
6
7
  }
7
8
  return local;
8
9
  }
9
10
  export function nativePath(path, handle) {
10
- if (path.startsWith('/')) throw new Error('canonical Room path required');
11
- const local = roomLocalPath(path);
12
- return handle === undefined ? `/private/${local}` : `/rooms/${handle}/${local}`;
11
+ if (path.startsWith('/'))
12
+ throw new Error('canonical Room path required');
13
+ return `/rooms/${handle}/${roomLocalPath(path, handle)}`;
13
14
  }
14
-
15
- //# sourceMappingURL=map.js.map
package/dist/model.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AdapterFailure, ModelIdentity, ModelRequest, ModelResult } from '@agentshouse/mdruntime';
2
- import type { HouseDefinitions } from './read.js';
2
+ import type { HouseSchema } from './read.js';
3
3
  export type HeldModel = {
4
4
  snapshot: ModelResult;
5
5
  identity: ModelIdentity | null;
@@ -9,7 +9,7 @@ export declare function failedModel(failure: AdapterFailure | {
9
9
  kind: 'beyond-horizon';
10
10
  }): ModelResult;
11
11
  export declare function modelKey(locator: string, attached: ModelRequest['attached']): string;
12
- export declare function heldModel(read: HouseDefinitions | null, identity: string, failure: ModelResult): Promise<HeldModel>;
12
+ export declare function heldModel(read: HouseSchema | null, identity: string, failure: ModelResult): Promise<HeldModel>;
13
13
  export type ModelShelf = {
14
14
  retain(key: string, acquired: HeldModel | undefined): HeldModel | undefined;
15
15
  answer(request: ModelRequest): ModelResult;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV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IAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,CAAC;AAElF,eAAO,MAAM,YAAY,EAAE,WAAmE,CAAC;AAE/F,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAAG,WAAW,CAI7F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,MAAM,CAEpF;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,CAAC,CAOpB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5E,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,UAAU,IAAI,UAAU,CAqBvC"}
package/dist/model.js CHANGED
@@ -1,64 +1,46 @@
1
1
  import { sha256Hex } from './digest.js';
2
- export const MODEL_ABSENT = {
3
- kind: 'model-unavailable',
4
- reason: 'not-readable'
5
- };
2
+ export const MODEL_ABSENT = { kind: 'model-unavailable', reason: 'not-readable' };
6
3
  export function failedModel(failure) {
7
- if (failure.kind === 'revoked-authorization') return {
8
- kind: 'revoked-authorization'
9
- };
10
- if (failure.kind === 'transport-uncertainty') return {
11
- kind: 'transport-uncertainty'
12
- };
4
+ if (failure.kind === 'revoked-authorization')
5
+ return { kind: 'revoked-authorization' };
6
+ if (failure.kind === 'transport-uncertainty')
7
+ return { kind: 'transport-uncertainty' };
13
8
  return MODEL_ABSENT;
14
9
  }
15
10
  export function modelKey(locator, attached) {
16
11
  return `${locator} ${attached}`;
17
12
  }
18
13
  export async function heldModel(read, identity, failure) {
19
- if (read === null) return {
20
- snapshot: failure,
21
- identity: null
22
- };
23
- const version = await sha256Hex(JSON.stringify(read.versions));
14
+ if (read === null)
15
+ return { snapshot: failure, identity: null };
16
+ const version = await sha256Hex(JSON.stringify(read.version));
24
17
  return {
25
- snapshot: {
26
- kind: 'model',
27
- snapshot: {
28
- identity,
29
- version,
30
- definitions: read.definitions
31
- }
32
- },
33
- identity: {
34
- identity,
35
- version
36
- }
18
+ snapshot: { kind: 'model', snapshot: { identity, version, schema: read.schema } },
19
+ identity: { identity, version },
37
20
  };
38
21
  }
39
22
  export function modelShelf() {
40
23
  const models = new Map();
41
24
  return {
42
- retain (key, acquired) {
43
- if (acquired === undefined) return models.get(key);
25
+ retain(key, acquired) {
26
+ if (acquired === undefined)
27
+ return models.get(key);
44
28
  if (acquired.snapshot.kind === 'transport-uncertainty') {
45
29
  const previous = models.get(key);
46
- if (previous !== undefined && previous.identity !== null) return previous;
30
+ if (previous !== undefined && previous.identity !== null)
31
+ return previous;
47
32
  }
48
33
  models.set(key, acquired);
49
34
  return acquired;
50
35
  },
51
- answer (request) {
36
+ answer(request) {
52
37
  return models.get(modelKey(request.locator, request.attached))?.snapshot ?? MODEL_ABSENT;
53
38
  },
54
- keep (locators) {
55
- for (const key of [
56
- ...models.keys()
57
- ]){
58
- if (!locators.some((locator)=>key.startsWith(`${locator} `))) models.delete(key);
39
+ keep(locators) {
40
+ for (const key of [...models.keys()]) {
41
+ if (!locators.some((locator) => key.startsWith(`${locator} `)))
42
+ models.delete(key);
59
43
  }
60
- }
44
+ },
61
45
  };
62
46
  }
63
-
64
- //# sourceMappingURL=model.js.map
package/dist/read.d.ts CHANGED
@@ -1,28 +1,32 @@
1
- import type { BootstrapPage, BootstrapResult, RefreshResult } from '@agentshouse/mdruntime';
2
- import { type TrackedAuthority } from './discovery.js';
1
+ import type { BootstrapPage, RefreshResult, RoomAttachment } from '@agentshouse/mdruntime';
2
+ import type { TrackedAuthority } from './discovery.js';
3
3
  import type { HouseMode } from './transport.js';
4
4
  import { type LogPosition } from './version.js';
5
+ export type HeadChange = BootstrapPage['changes'][string];
5
6
  export type HouseManifestFile = {
6
7
  path: string;
7
8
  revision: string | undefined;
8
9
  version: string;
10
+ head?: HeadChange;
9
11
  };
10
12
  export type HouseContent = {
11
13
  path: string;
12
14
  content: string;
13
15
  };
14
16
  export type HouseScope = LogPosition & {
15
- scope: 'room' | 'private';
16
17
  anchor: string;
17
- roomHandle: string | undefined;
18
18
  files: readonly HouseManifestFile[];
19
19
  contents: readonly HouseContent[];
20
+ attachments?: readonly RoomAttachment[];
20
21
  };
21
22
  export type HouseEnvelope = {
22
23
  scopes: readonly HouseScope[];
23
24
  };
24
25
  export type HouseGrant = {
25
- method: 'GET' | 'POST';
26
+ method: 'GET';
27
+ url: string;
28
+ } | {
29
+ method: 'POST';
26
30
  operation: string;
27
31
  url: string;
28
32
  };
@@ -34,40 +38,41 @@ export type HouseChange = {
34
38
  content: string;
35
39
  revision: string | undefined;
36
40
  version: string;
41
+ head?: HeadChange;
37
42
  } | {
38
43
  path: string;
39
44
  reference: {
40
45
  revision: string;
41
46
  };
42
47
  };
48
+ export type HouseView = LogPosition & {
49
+ authority: string;
50
+ changes: readonly HouseChange[];
51
+ attachments?: readonly RoomAttachment[];
52
+ };
43
53
  export type HouseEnumeration = {
44
- authorities: readonly (LogPosition & {
45
- authority: string;
46
- changes: readonly HouseChange[];
47
- })[];
54
+ authorities: readonly HouseView[];
48
55
  };
49
- export declare function authorityRoot(handle: string | undefined): string;
50
- export declare const ROOM_README = "ROOM.md";
51
- export declare function selectionRoots(tracked: TrackedAuthority): readonly string[];
56
+ export declare function authorityRoot(handle: string): string;
52
57
  export declare function contentPrefixes(tracked: TrackedAuthority): readonly string[];
53
- export declare function modelPrefix(tracked: TrackedAuthority, modelRoot: string): string;
58
+ export declare function schemaPath(handle: string, schema: string): string;
54
59
  export declare function parseGrant(body: unknown): HouseGrant | null;
60
+ export declare function headChange(held: {
61
+ readonly author?: unknown;
62
+ readonly created_at?: unknown;
63
+ }): HeadChange | undefined | null;
55
64
  export declare function parseEnvelope(body: unknown): HouseEnvelope | null;
56
65
  export declare function parseSiteBootstrap(body: unknown): HouseScope | null;
57
66
  export declare function parseEnumeration(body: unknown, mode: HouseMode): HouseEnumeration | null;
58
- export declare function advancedScope(scope: HouseScope, view: HouseEnumeration['authorities'][number]): HouseScope;
67
+ export declare function advancedScope(scope: HouseScope, view: HouseView): HouseScope;
59
68
  export declare function matchesScope(scope: HouseScope, tracked: TrackedAuthority): boolean;
60
- export declare function withinRoot(path: string, root: string): boolean;
61
- export declare function selects(tracked: TrackedAuthority, path: string): boolean;
62
- export declare function bootstrapFrom(envelope: HouseEnvelope, tracked: TrackedAuthority): BootstrapResult;
63
- export declare function bootstrapOf(scope: HouseScope, tracked: TrackedAuthority): BootstrapPage;
64
- export type HouseDefinitions = {
65
- definitions: Readonly<Record<string, string>>;
66
- versions: readonly string[];
69
+ export declare function bootstrapOf(scope: HouseScope): BootstrapPage;
70
+ export type HouseSchema = {
71
+ schema: string | null;
72
+ version: string | null;
67
73
  };
68
- export declare const MODEL_DEFINITION_ADDRESS = "types";
69
- export declare function definitionAddress(path: string): string;
70
- export declare function definitionsFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, modelRoot: string): HouseDefinitions | null;
71
- export declare function definitionsOf(scope: HouseScope, modelRoot: string): HouseDefinitions | null;
72
- export declare function refreshFrom(enumeration: HouseEnumeration, tracked: TrackedAuthority, fromRoomVersion: string): RefreshResult;
74
+ export declare function schemaFrom(envelope: HouseEnvelope, tracked: TrackedAuthority, schema: string): HouseSchema | null;
75
+ export declare function schemaOf(scope: HouseScope, schema: string): HouseSchema | null;
76
+ export declare function viewOf(enumeration: HouseEnumeration, tracked: TrackedAuthority): HouseView | undefined;
77
+ export declare function refreshFrom(view: HouseView, fromRoomVersion: string): RefreshResult;
73
78
  //#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