@agentshouse/mdruntime 0.1.0-c10002a0f5d24 → 0.1.0-c10ba07fdc247
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.
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +24 -5
- package/dist/adapter.d.ts +28 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -3
- package/dist/collection.d.ts +2 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +9 -8
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +4 -2
- package/dist/conversation-live.d.ts +2 -0
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +2 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +8 -3
- package/dist/discovery.d.ts +2 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +22 -4
- package/dist/entry.d.ts +14 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +45 -16
- package/dist/host.d.ts +5 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +23 -5
- package/dist/house-query.d.ts +15 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +43 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +23 -15
- package/dist/listing.d.ts +20 -12
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +33 -17
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +2 -0
- package/dist/messages.d.ts +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +5 -1
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +4 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -1
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +42 -9
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +18 -2
- package/dist/parts.d.ts +3 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +30 -7
- package/dist/preparation.d.ts +9 -5
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +69 -48
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +20 -41
- package/dist/reach.d.ts +12 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +82 -14
- package/dist/react.d.ts +2 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +10 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +9 -7
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +2 -1
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +17 -4
- package/dist/socket/session.d.ts +4 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +1 -0
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +1 -0
- package/dist/store/records.d.ts +4 -1
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +2 -0
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +4 -1
- package/dist/stored.d.ts +8 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +108 -23
- package/dist/surface.d.ts +4 -2
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +10 -6
- package/dist/sync.d.ts +3 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +38 -19
- package/dist/wire.d.ts +8 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +6 -5
- package/package.json +3 -3
package/dist/discovery.js
CHANGED
|
@@ -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,7 +83,7 @@ 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;
|
|
@@ -90,8 +96,8 @@ export async function zoned(runtime, local, zone) {
|
|
|
90
96
|
await local.fact('timeZone', zone);
|
|
91
97
|
emitTimeZone(runtime, zone);
|
|
92
98
|
}
|
|
93
|
-
export async function discoverRooms(runtime,
|
|
94
|
-
const { socket } = runtime;
|
|
99
|
+
export async function discoverRooms(runtime, progress, live, found) {
|
|
100
|
+
const { store, socket } = runtime;
|
|
95
101
|
const { session } = socket;
|
|
96
102
|
const { closed, authorization } = session.now();
|
|
97
103
|
if (closed || authorization === undefined) {
|
|
@@ -114,7 +120,8 @@ export async function discoverRooms(runtime, local, progress, live, found) {
|
|
|
114
120
|
if (result.kind === 'discovery')
|
|
115
121
|
runtime.retries.succeeded('connection', DISCOVERY);
|
|
116
122
|
if (result.kind === 'transport-uncertainty') {
|
|
117
|
-
|
|
123
|
+
if (store.needed())
|
|
124
|
+
await cachedModels(runtime, await store.open());
|
|
118
125
|
progress.reachable = false;
|
|
119
126
|
progress.complete = false;
|
|
120
127
|
socket.notifyReady();
|
|
@@ -144,12 +151,23 @@ export async function discoverRooms(runtime, local, progress, live, found) {
|
|
|
144
151
|
session.set({ refusal: null });
|
|
145
152
|
emitRefusal(runtime);
|
|
146
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();
|
|
147
161
|
const held = await local.facts();
|
|
148
162
|
if (JSON.stringify(result.providerLimits) !== JSON.stringify(held.providerLimits) ||
|
|
149
163
|
JSON.stringify(result.capabilities) !== JSON.stringify(held.capabilities)) {
|
|
150
164
|
await local.fact('providerLimits', result.providerLimits);
|
|
151
165
|
await local.fact('capabilities', result.capabilities);
|
|
152
166
|
}
|
|
167
|
+
if (JSON.stringify(queriesOnly) !== JSON.stringify(held.queriesOnly)) {
|
|
168
|
+
await local.fact('queriesOnly', queriesOnly);
|
|
169
|
+
}
|
|
170
|
+
session.set({ queriesOnly, unstored: null });
|
|
153
171
|
socket.notifyReady();
|
|
154
172
|
await signIn(runtime, local, result.member ?? null);
|
|
155
173
|
await zoned(runtime, local, result.timeZone ?? null);
|
package/dist/entry.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { type VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { BinaryFile, HeadChange } from './adapter.js';
|
|
2
3
|
import { type QueryRows } from './query.js';
|
|
4
|
+
import { type ValuedEntry } from './stored.js';
|
|
3
5
|
import type { Connection } from './tables.js';
|
|
4
6
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
7
|
+
export { documentKey, pathOfKey } from './rows.js';
|
|
8
|
+
export type { ValuedEntry } from './stored.js';
|
|
5
9
|
export type EntryRoom = {
|
|
6
10
|
locator: string;
|
|
7
11
|
schema: string | null;
|
|
8
12
|
documents: Readonly<Record<string, string>>;
|
|
9
13
|
revisions?: Readonly<Record<string, string>>;
|
|
14
|
+
fileIds?: Readonly<Record<string, string>>;
|
|
15
|
+
created?: Readonly<Record<string, string>>;
|
|
16
|
+
changes?: Readonly<Record<string, HeadChange>>;
|
|
17
|
+
binaryFiles?: Readonly<Record<string, BinaryFile>>;
|
|
10
18
|
};
|
|
11
19
|
export type EntryArguments = Readonly<Record<string, string>>;
|
|
12
20
|
export type EntryParameterKind = 'string' | 'integer' | 'number' | 'boolean';
|
|
@@ -16,5 +24,11 @@ export declare function entryRefusal(template: unknown): string | null;
|
|
|
16
24
|
export type EntryScope = {
|
|
17
25
|
results(queries: Readonly<Record<string, unknown>>): Promise<Record<string, QueryRows>>;
|
|
18
26
|
};
|
|
27
|
+
export type CountedRoom = {
|
|
28
|
+
locator: string;
|
|
29
|
+
schema: string | null;
|
|
30
|
+
documents: readonly ValuedEntry[];
|
|
31
|
+
};
|
|
19
32
|
export declare function entryScope(rooms: readonly EntryRoom[], roomTypes: VerifiedModel, connection: Connection): EntryScope;
|
|
33
|
+
export declare function countScope(room: CountedRoom, roomTypes: VerifiedModel, connection: Connection): EntryScope;
|
|
20
34
|
//# sourceMappingURL=entry.d.ts.map
|
package/dist/entry.d.ts.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry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G,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,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACzF,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,SAAS,WAAW,EAAE,CAAC;CACnC,CAAC;AAgDF,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAwCZ;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAaZ"}
|
package/dist/entry.js
CHANGED
|
@@ -3,8 +3,9 @@ import { attachedModel } from './attached-model.js';
|
|
|
3
3
|
import { answerQuery } from './compile.js';
|
|
4
4
|
import { planWithin } from './query.js';
|
|
5
5
|
import { writtenFacts } from './rows.js';
|
|
6
|
-
import { entered, REPLICA_TABLES } from './stored.js';
|
|
6
|
+
import { entered, enteredValues, REPLICA_TABLES, } from './stored.js';
|
|
7
7
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
8
|
+
export { documentKey, pathOfKey } from './rows.js';
|
|
8
9
|
const PARAMETER = '$param';
|
|
9
10
|
const KIND = 'as';
|
|
10
11
|
const INTEGER = /^-?(?:0|[1-9][0-9]*)$/u;
|
|
@@ -117,7 +118,7 @@ export function entryRefusal(template) {
|
|
|
117
118
|
throw error;
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
+
function scope(rooms, roomTypes, connection) {
|
|
121
122
|
for (const table of REPLICA_TABLES)
|
|
122
123
|
connection.run(table);
|
|
123
124
|
const held = [];
|
|
@@ -132,20 +133,7 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
132
133
|
types: model.status === 'unavailable' ? [] : Object.values(model.types),
|
|
133
134
|
});
|
|
134
135
|
const composition = { model, selection: null, typedPaths: [] };
|
|
135
|
-
|
|
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 };
|
|
136
|
+
return { locator: room.locator, key: room.enter(composition), composition };
|
|
149
137
|
});
|
|
150
138
|
const planned = { listed: true, rooms: held };
|
|
151
139
|
return {
|
|
@@ -159,3 +147,44 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
159
147
|
},
|
|
160
148
|
};
|
|
161
149
|
}
|
|
150
|
+
export function entryScope(rooms, roomTypes, connection) {
|
|
151
|
+
return scope(rooms.map((room) => ({
|
|
152
|
+
locator: room.locator,
|
|
153
|
+
schema: room.schema,
|
|
154
|
+
enter(composition) {
|
|
155
|
+
const heads = (path) => ({
|
|
156
|
+
revision: room.revisions?.[path] ?? null,
|
|
157
|
+
fileId: room.fileIds?.[path] ?? null,
|
|
158
|
+
created: room.created?.[path] ?? null,
|
|
159
|
+
change: room.changes?.[path] ?? null,
|
|
160
|
+
written: null,
|
|
161
|
+
});
|
|
162
|
+
const entries = [
|
|
163
|
+
...Object.entries(room.documents).map(([path, content]) => ({
|
|
164
|
+
path,
|
|
165
|
+
content,
|
|
166
|
+
facts: writtenFacts(path, content, composition),
|
|
167
|
+
binary: null,
|
|
168
|
+
...heads(path),
|
|
169
|
+
})),
|
|
170
|
+
...Object.entries(room.binaryFiles ?? {}).map(([path, binary]) => ({
|
|
171
|
+
path,
|
|
172
|
+
content: null,
|
|
173
|
+
facts: null,
|
|
174
|
+
binary: { state: 'accepted', ...binary },
|
|
175
|
+
...heads(path),
|
|
176
|
+
})),
|
|
177
|
+
];
|
|
178
|
+
return entered(connection, room.locator, composition, entries.sort((left, right) => (left.path < right.path ? -1 : 1)));
|
|
179
|
+
},
|
|
180
|
+
})), roomTypes, connection);
|
|
181
|
+
}
|
|
182
|
+
export function countScope(room, roomTypes, connection) {
|
|
183
|
+
return scope([
|
|
184
|
+
{
|
|
185
|
+
locator: room.locator,
|
|
186
|
+
schema: room.schema,
|
|
187
|
+
enter: (composition) => enteredValues(connection, room.locator, composition, room.documents),
|
|
188
|
+
},
|
|
189
|
+
], roomTypes, connection);
|
|
190
|
+
}
|
package/dist/host.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
@@ -19,10 +19,12 @@ export type AttachOptions = {
|
|
|
19
19
|
readonly reach?: PortReach;
|
|
20
20
|
readonly admission?: ActionAdmission;
|
|
21
21
|
readonly code?: CodeAvailability;
|
|
22
|
+
readonly first?: FirstTier;
|
|
22
23
|
};
|
|
23
24
|
export type AttachedPort = {
|
|
24
25
|
detach(): void;
|
|
25
26
|
narrow(reach: PortReach): void;
|
|
27
|
+
code(code: CodeAvailability): void;
|
|
26
28
|
readiness(deliver: (readiness: Readiness) => void): () => void;
|
|
27
29
|
answered(queries: readonly unknown[], done: () => void): void;
|
|
28
30
|
};
|
|
@@ -36,8 +38,9 @@ export type MdRuntimeHost = {
|
|
|
36
38
|
};
|
|
37
39
|
export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
|
|
38
40
|
export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
41
|
+
export type { QueriedRoom } from './adapter.js';
|
|
39
42
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
40
|
-
export type { CodeAvailability, Persistence, Space } from './readiness.js';
|
|
43
|
+
export type { CodeAvailability, FirstTier, Persistence, Space } from './readiness.js';
|
|
41
44
|
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
42
45
|
export { replaces } from './observation.js';
|
|
43
46
|
export { undeclared } from './outcome.js';
|
package/dist/host.d.ts.map
CHANGED
|
@@ -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;
|
|
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,gBAA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KAAK,WAAW,GACjB,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -6,6 +6,16 @@ import { observed } from './observation.js';
|
|
|
6
6
|
import { answeredResult } from './outcome.js';
|
|
7
7
|
import { AUTHORIZATION_ENDED, WIRE, wireRequest, } from './wire.js';
|
|
8
8
|
const NARROWED = new Set(['within', 'whole']);
|
|
9
|
+
const UNWAITED_MEMBERS = new Set(['call', 'queryHouse']);
|
|
10
|
+
const UNWAITED_TOPICS = new Set([
|
|
11
|
+
'deployment-facts',
|
|
12
|
+
'room-drafts',
|
|
13
|
+
'sync-status',
|
|
14
|
+
'connection-refusal',
|
|
15
|
+
'storage-loss',
|
|
16
|
+
'service-mode',
|
|
17
|
+
'authority-changes',
|
|
18
|
+
]);
|
|
9
19
|
function answered(md, app, writtenBy, member, input) {
|
|
10
20
|
switch (member) {
|
|
11
21
|
case 'rooms':
|
|
@@ -14,6 +24,8 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
14
24
|
return md.query(input[0]);
|
|
15
25
|
case 'search':
|
|
16
26
|
return md.search(input[0]);
|
|
27
|
+
case 'queryHouse':
|
|
28
|
+
return md.queryHouse(input[0]);
|
|
17
29
|
case 'types':
|
|
18
30
|
return md.types(input[0]);
|
|
19
31
|
case 'save':
|
|
@@ -151,9 +163,9 @@ export function serveMdRuntime(options) {
|
|
|
151
163
|
function attach(port, options) {
|
|
152
164
|
if (!authorized)
|
|
153
165
|
throw new Error(AUTHORIZATION_ENDED);
|
|
154
|
-
const { app, release, reach, admission, code = 'stored' } = options;
|
|
166
|
+
const { app, release, reach, admission, code = 'stored', first = null } = options;
|
|
155
167
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
156
|
-
const view = runtime.within(reach ?? null, { target: app, code });
|
|
168
|
+
const view = runtime.within(reach ?? null, { target: app, code, first });
|
|
157
169
|
const observations = new Map();
|
|
158
170
|
const followed = new Set();
|
|
159
171
|
const answeredKeys = new Set();
|
|
@@ -234,10 +246,12 @@ export function serveMdRuntime(options) {
|
|
|
234
246
|
return;
|
|
235
247
|
}
|
|
236
248
|
try {
|
|
237
|
-
if (message.kind
|
|
249
|
+
if (message.kind === 'observe') {
|
|
250
|
+
if (!UNWAITED_TOPICS.has(message.topic))
|
|
251
|
+
await opened();
|
|
252
|
+
}
|
|
253
|
+
else if (!UNWAITED_MEMBERS.has(message.member))
|
|
238
254
|
await md.loaded();
|
|
239
|
-
else if (message.topic !== 'room-drafts')
|
|
240
|
-
await opened();
|
|
241
255
|
if (message.kind === 'observe') {
|
|
242
256
|
if (serving)
|
|
243
257
|
observe(message.id, message.topic, message.input);
|
|
@@ -270,6 +284,10 @@ export function serveMdRuntime(options) {
|
|
|
270
284
|
if (serving)
|
|
271
285
|
view.narrow(next);
|
|
272
286
|
},
|
|
287
|
+
code(next) {
|
|
288
|
+
if (serving)
|
|
289
|
+
view.code(next);
|
|
290
|
+
},
|
|
273
291
|
answered(queries, done) {
|
|
274
292
|
const keys = queries.map(queryKey);
|
|
275
293
|
if (keys.every((key) => answeredKeys.has(key)))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DocumentQuery, type GroupQuery } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { HouseQueryGroups, HouseQueryRows, ProviderRefusal } from './adapter.js';
|
|
3
|
+
import { type Failure, type Offline } from './outcome.js';
|
|
4
|
+
import { type PortReach } from './reach.js';
|
|
5
|
+
import type { Runtime } from './runtime.js';
|
|
6
|
+
export type HouseQuery = (DocumentQuery | GroupQuery) & {
|
|
7
|
+
rooms: readonly [string];
|
|
8
|
+
};
|
|
9
|
+
export type HouseQueryResult = HouseQueryRows | HouseQueryGroups | Offline | (ProviderRefusal & {
|
|
10
|
+
kind: 'rejected';
|
|
11
|
+
}) | (ProviderRefusal & {
|
|
12
|
+
kind: 'undeclared';
|
|
13
|
+
}) | Failure;
|
|
14
|
+
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null): Promise<HouseQueryResult>;
|
|
15
|
+
//# sourceMappingURL=house-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"house-query.d.ts","sourceRoot":"","sources":["../src/house-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAA2C,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACxC,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAC1C,OAAO,CAAC;AAqBZ,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,GAAG,IAAI,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { invalid, plain } from '@agentshouse/mdmodel';
|
|
2
|
+
import { listedOrHeld } from './listing.js';
|
|
3
|
+
import { failure, OFFLINE, UNCERTAIN, undeclared } from './outcome.js';
|
|
4
|
+
import { askedOnline, offline } from './online.js';
|
|
5
|
+
import { holds, queriedOnly } from './reach.js';
|
|
6
|
+
const HELD_ON_DEVICE = {
|
|
7
|
+
kind: 'rejected',
|
|
8
|
+
code: 'held-on-device',
|
|
9
|
+
fields: {},
|
|
10
|
+
retryable: false,
|
|
11
|
+
};
|
|
12
|
+
function houseQueryOf(input) {
|
|
13
|
+
if (!plain(input))
|
|
14
|
+
invalid('query', 'expects a query object');
|
|
15
|
+
const { rooms, ...query } = input;
|
|
16
|
+
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
17
|
+
invalid('rooms', 'names the one Room House answers');
|
|
18
|
+
return { room: rooms[0], query };
|
|
19
|
+
}
|
|
20
|
+
async function heldHere(runtime, reach, room) {
|
|
21
|
+
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
22
|
+
}
|
|
23
|
+
export async function queriedHouse(runtime, input, reach) {
|
|
24
|
+
const { socket } = runtime;
|
|
25
|
+
const asked = houseQueryOf(input);
|
|
26
|
+
await socket.ready;
|
|
27
|
+
const query = socket.queryHouse();
|
|
28
|
+
if (query === undefined)
|
|
29
|
+
return undeclared('queryHouse');
|
|
30
|
+
if (!queriedOnly(reach, socket.session.now().queriesOnly, asked.room)) {
|
|
31
|
+
return (await heldHere(runtime, reach, asked.room))
|
|
32
|
+
? HELD_ON_DEVICE
|
|
33
|
+
: failure({ kind: 'room-not-readable', locator: asked.room });
|
|
34
|
+
}
|
|
35
|
+
if (await offline(runtime))
|
|
36
|
+
return OFFLINE;
|
|
37
|
+
const answer = await askedOnline(runtime, (authorization) => query(authorization, asked));
|
|
38
|
+
if (answer === null)
|
|
39
|
+
return UNCERTAIN;
|
|
40
|
+
return answer.kind === 'rows' || answer.kind === 'groups' || answer.kind === 'rejected'
|
|
41
|
+
? answer
|
|
42
|
+
: failure(answer);
|
|
43
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, HouseQueryAnswer, HouseQueryAsk, HouseQueryGroups, HouseQueryRows, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
3
|
export { heldFacts } from './conversation-row.js';
|
|
4
4
|
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
@@ -23,6 +23,7 @@ export { refusalError } from './failure.js';
|
|
|
23
23
|
export type { ChangedPart, FieldValue, Marks, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
24
24
|
export type { SaveRefusal } from './save.js';
|
|
25
25
|
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
26
|
+
export type { HouseQuery, HouseQueryResult } from './house-query.js';
|
|
26
27
|
export { keptFile, keptLines } from './chat-types.js';
|
|
27
28
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
28
29
|
export { departure } from './change.js';
|
|
@@ -31,6 +32,8 @@ export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
|
31
32
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
32
33
|
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
33
34
|
export { contextFigure } from './context.js';
|
|
35
|
+
export { runningWords } from './running.js';
|
|
36
|
+
export { turnLine, WORKING } from './parts.js';
|
|
34
37
|
export { changeBatchIdentity } from './identity.js';
|
|
35
38
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
36
39
|
export { authoredAt, covered } from './paths.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB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pB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,cAAc,EACd,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;A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,UAAU,EACV,WAAW,EACX,GAAG,EACH,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,MAAM,EACN,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,8 @@ export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
|
11
11
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
12
12
|
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
13
13
|
export { contextFigure } from './context.js';
|
|
14
|
+
export { runningWords } from './running.js';
|
|
15
|
+
export { turnLine, WORKING } from './parts.js';
|
|
14
16
|
export { changeBatchIdentity } from './identity.js';
|
|
15
17
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
16
18
|
export { authoredAt, covered } from './paths.js';
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export declare function scheduleCurrency(runtime: Runtime): void;
|
|
|
3
3
|
export declare function spaceFreed(runtime: Runtime): void;
|
|
4
4
|
export declare function close({ store, socket, presence, conversations, recovery, liveQueries, figures, }: Runtime): void;
|
|
5
5
|
export declare function stop(runtime: Runtime): Promise<void>;
|
|
6
|
-
export declare function start(runtime: Runtime, signal: AbortSignal | undefined): void;
|
|
6
|
+
export declare function start(runtime: Runtime, signal: AbortSignal | undefined, onNeed: boolean): void;
|
|
7
7
|
//# sourceMappingURL=lifecycle.d.ts.map
|
package/dist/lifecycle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6O5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAOhD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,QAQ1C;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,WAAW,EACX,OAAO,GACR,EAAE,OAAO,QAST;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,iBAS1C;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,QAwCvF"}
|
package/dist/lifecycle.js
CHANGED
|
@@ -16,9 +16,11 @@ function closing(runtime, opened) {
|
|
|
16
16
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
17
17
|
if (!live())
|
|
18
18
|
return;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (store.needed()) {
|
|
20
|
+
const local = await store.open();
|
|
21
|
+
if (!opened && !socket.isOpen())
|
|
22
|
+
await cachedModels(runtime, local);
|
|
23
|
+
}
|
|
22
24
|
await rest(runtime, null, live);
|
|
23
25
|
});
|
|
24
26
|
}
|
|
@@ -96,6 +98,16 @@ function caughtUpRooms(runtime, expired) {
|
|
|
96
98
|
session.set({ underway: null });
|
|
97
99
|
socket.named();
|
|
98
100
|
const cycle = progress ?? { complete: true, reachable: true };
|
|
101
|
+
if (!store.needed()) {
|
|
102
|
+
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
103
|
+
if (!live())
|
|
104
|
+
return;
|
|
105
|
+
if (progress === null)
|
|
106
|
+
await rest(runtime, cycle, live);
|
|
107
|
+
else
|
|
108
|
+
await finishOpening(runtime, progress, live);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
99
111
|
replaced(store, expired);
|
|
100
112
|
const among = progress === null ? expired : null;
|
|
101
113
|
const installing = store.installs.underway(among);
|
|
@@ -198,7 +210,7 @@ export function spaceFreed(runtime) {
|
|
|
198
210
|
if (closed || authorization === undefined)
|
|
199
211
|
return;
|
|
200
212
|
if (!socket.streamed)
|
|
201
|
-
void
|
|
213
|
+
void runtime.discover();
|
|
202
214
|
else
|
|
203
215
|
void resynchronize(runtime);
|
|
204
216
|
}
|
|
@@ -223,7 +235,7 @@ export async function stop(runtime) {
|
|
|
223
235
|
await store.written();
|
|
224
236
|
close(runtime);
|
|
225
237
|
}
|
|
226
|
-
export function start(runtime, signal) {
|
|
238
|
+
export function start(runtime, signal, onNeed) {
|
|
227
239
|
const { store, socket, presence, conversations, lastAnswers, recovery } = runtime;
|
|
228
240
|
const closeRuntime = () => close(runtime);
|
|
229
241
|
socket.observeServiceMode((mode) => signalled(runtime, mode));
|
|
@@ -267,16 +279,12 @@ export function start(runtime, signal) {
|
|
|
267
279
|
else
|
|
268
280
|
void applyRoom(runtime, event);
|
|
269
281
|
});
|
|
270
|
-
|
|
271
|
-
.open()
|
|
272
|
-
.then(async (local) => {
|
|
273
|
-
if ((await local.facts()).capabilities.length > 0)
|
|
282
|
+
if (!onNeed) {
|
|
283
|
+
void store.open().catch((error) => {
|
|
274
284
|
socket.readyFromStore();
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
uncaught(error);
|
|
279
|
-
});
|
|
285
|
+
uncaught(error);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
280
288
|
if (!socket.streamed)
|
|
281
|
-
void
|
|
289
|
+
void runtime.discover();
|
|
282
290
|
}
|
package/dist/listing.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { HeldRooms } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { DiscoveredRoom, HeldRoom, OperationScopes, ProviderRefusal, ReplicaAdmission, RoomDeclaration } from './adapter.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type Composition } from './collection.js';
|
|
4
4
|
import type { KeyedChange } from './observation.js';
|
|
5
|
-
import { type ModelState, type TypesResult } from './model.js';
|
|
5
|
+
import { type MdType, type ModelState, type TypesResult } from './model.js';
|
|
6
6
|
import { type PortReach } from './reach.js';
|
|
7
7
|
import type { ReplicaRecord } from './replica.js';
|
|
8
8
|
import type { Runtime } from './runtime.js';
|
|
9
9
|
import type { Stored } from './store.js';
|
|
10
|
-
|
|
10
|
+
type Selection<Model> = {
|
|
11
11
|
roots: readonly string[];
|
|
12
|
-
model:
|
|
12
|
+
model: Model;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type Shown<Model> = {
|
|
15
15
|
name: string;
|
|
16
16
|
locator: string;
|
|
17
17
|
handle: string;
|
|
18
18
|
operations: OperationScopes;
|
|
19
19
|
replica: ReplicaAdmission;
|
|
20
|
-
model:
|
|
21
|
-
typedSelection:
|
|
20
|
+
model: Model;
|
|
21
|
+
typedSelection: Selection<Model> | null;
|
|
22
22
|
providerOwnedPaths: readonly string[];
|
|
23
23
|
authoredPaths: readonly string[];
|
|
24
24
|
roomVersion: string | null;
|
|
@@ -26,13 +26,21 @@ export type AppRoom = {
|
|
|
26
26
|
synchronizationAvailable: boolean;
|
|
27
27
|
refusal: ProviderRefusal | null;
|
|
28
28
|
locked: boolean;
|
|
29
|
+
queriesOnly?: true;
|
|
29
30
|
};
|
|
30
|
-
type
|
|
31
|
-
export type
|
|
32
|
-
|
|
31
|
+
export type AppTypedSelection = Selection<TypesResult>;
|
|
32
|
+
export type AppRoom = Shown<TypesResult>;
|
|
33
|
+
export type ListedRoom = Shown<TypesResult<string>>;
|
|
34
|
+
export type ListedModels = Readonly<Record<string, readonly MdType[]>>;
|
|
35
|
+
export type ListedRooms = {
|
|
36
|
+
readonly rooms: readonly ListedRoom[];
|
|
37
|
+
readonly models: ListedModels;
|
|
33
38
|
};
|
|
39
|
+
export type ListedEntry = Omit<Shown<ModelState>, 'locked'>;
|
|
34
40
|
export type Listing = ReadonlyMap<string, ListedEntry>;
|
|
35
|
-
export type RoomsChange = KeyedChange<string,
|
|
41
|
+
export type RoomsChange = KeyedChange<string, ListedRoom> & {
|
|
42
|
+
readonly models: ListedModels;
|
|
43
|
+
};
|
|
36
44
|
export declare function modelIn({ socket, presence }: Runtime, locator: string, stored: Stored | undefined): ModelState;
|
|
37
45
|
export declare function compositionFor(runtime: Runtime, record: ReplicaRecord): Composition;
|
|
38
46
|
export declare function declarationOf({ presence }: Runtime, locator: string, stored: Stored | undefined): {
|
|
@@ -43,7 +51,7 @@ export declare function listedLocators({ presence }: Runtime, held: ReadonlyMap<
|
|
|
43
51
|
export declare function listedOrHeld({ presence }: Runtime, held: ReadonlyMap<string, unknown>, locator: string): boolean;
|
|
44
52
|
export declare function listedEntries(runtime: Runtime, touched: readonly string[]): Promise<readonly ListedEntry[] | null>;
|
|
45
53
|
export declare function listingNow(runtime: Runtime): Promise<Listing>;
|
|
46
|
-
export declare function shownRooms(runtime: Runtime, listing: Listing):
|
|
54
|
+
export declare function shownRooms(runtime: Runtime, listing: Listing): ListedRooms;
|
|
47
55
|
export declare function shownChange(runtime: Runtime, entries: readonly ListedEntry[]): RoomsChange;
|
|
48
56
|
export declare function roomFacts(runtime: Runtime, reach?: PortReach | null): Promise<HeldRooms>;
|
|
49
57
|
export declare function heldRooms({ store }: Runtime, listed: readonly DiscoveredRoom[]): Promise<HeldRoom[]>;
|
package/dist/listing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../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