@agentshouse/mdruntime 0.1.0-ccad597a8a1f0 → 0.1.0-ccb3e30d19ce2
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/README.md +9 -9
- package/dist/acceptance.js +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +24 -5
- package/dist/adapter.d.ts +83 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/binary.d.ts +4 -0
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +9 -2
- package/dist/change.d.ts +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +3 -0
- package/dist/chat-types.js +2 -2
- package/dist/client.d.ts +15 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +17 -44
- package/dist/collection.d.ts +2 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +9 -8
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +3 -5
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +4 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +2 -3
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +2 -2
- package/dist/conversation-row.d.ts +6 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +18 -7
- package/dist/conversation.d.ts +9 -6
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +34 -20
- package/dist/declaration.js +1 -1
- package/dist/discovery.d.ts +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +30 -5
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +1 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +3 -0
- package/dist/entry.d.ts +14 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +45 -16
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -1
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +1 -1
- package/dist/host.d.ts +6 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +45 -9
- package/dist/house-query.d.ts +18 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +54 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +28 -16
- package/dist/listing.d.ts +20 -12
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +33 -17
- package/dist/loaded.d.ts +7 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +46 -0
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +2 -0
- package/dist/media.d.ts +19 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +161 -24
- package/dist/memory.d.ts +2 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +39 -8
- package/dist/messages.d.ts +6 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +11 -4
- 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/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- 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/outcome.d.ts +17 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +9 -0
- package/dist/overlay.d.ts +1 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +1 -3
- 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 +10 -5
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +78 -48
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +20 -41
- package/dist/questions.d.ts +1 -0
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +51 -21
- package/dist/reach.d.ts +13 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +105 -16
- package/dist/react.d.ts +5 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +14 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +16 -7
- package/dist/reads.d.ts +1 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +2 -2
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +2 -1
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +2 -2
- package/dist/room-draft.d.ts +28 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +225 -4
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +11 -6
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- 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/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +9 -75
- package/dist/saves.d.ts +2 -0
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +59 -11
- package/dist/shown.d.ts +2 -0
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +21 -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/source.d.ts +7 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +15 -2
- package/dist/store/records.d.ts +11 -1
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +4 -0
- package/dist/store.d.ts +8 -4
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +7 -4
- package/dist/stored.d.ts +8 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +109 -27
- package/dist/surface.d.ts +10 -5
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +47 -14
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +44 -22
- package/dist/tables.d.ts +2 -45
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +59 -318
- package/dist/wire.d.ts +22 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +11 -5
- package/package.json +3 -3
package/dist/host.js
CHANGED
|
@@ -6,7 +6,17 @@ 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
|
-
|
|
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
|
+
]);
|
|
19
|
+
function answered(md, app, writtenBy, member, input, said) {
|
|
10
20
|
switch (member) {
|
|
11
21
|
case 'rooms':
|
|
12
22
|
return md.rooms();
|
|
@@ -14,12 +24,18 @@ 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], input[1]);
|
|
17
29
|
case 'types':
|
|
18
30
|
return md.types(input[0]);
|
|
19
31
|
case 'save':
|
|
20
|
-
return md
|
|
32
|
+
return md
|
|
33
|
+
.save(input[0], input[1], writtenBy)
|
|
34
|
+
.then(said);
|
|
21
35
|
case 'saveParts':
|
|
22
|
-
return md
|
|
36
|
+
return md
|
|
37
|
+
.saveParts(input[0], input[1], writtenBy)
|
|
38
|
+
.then(said);
|
|
23
39
|
case 'history':
|
|
24
40
|
return md.history(input[0], input[1], input[2]);
|
|
25
41
|
case 'resolve':
|
|
@@ -44,6 +60,8 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
44
60
|
return md.cleanUp();
|
|
45
61
|
case 'unsent':
|
|
46
62
|
return md.unsent();
|
|
63
|
+
case 'sent':
|
|
64
|
+
return md.sent();
|
|
47
65
|
case 'reset':
|
|
48
66
|
return md.reset();
|
|
49
67
|
case 'readAgain':
|
|
@@ -100,6 +118,10 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
100
118
|
return md.conversation.openTurn(input[0], input[1]);
|
|
101
119
|
case 'conversation.dismissSuggestion':
|
|
102
120
|
return md.conversation.dismissSuggestion(input[0], input[1]);
|
|
121
|
+
case 'conversation.attach':
|
|
122
|
+
return md.conversation.attach(input[0]);
|
|
123
|
+
case 'conversation.attachment':
|
|
124
|
+
return md.conversation.attachment(input[0]);
|
|
103
125
|
case 'chatDraft.write':
|
|
104
126
|
return md.chatDraft.write(input[0], input[1], input[2]);
|
|
105
127
|
case 'chatDraft.prepend':
|
|
@@ -125,6 +147,13 @@ function answeredMessage(value) {
|
|
|
125
147
|
}
|
|
126
148
|
export function serveMdRuntime(options) {
|
|
127
149
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
150
|
+
const saveMessages = new Map(Object.entries(options.saveMessages ?? {}));
|
|
151
|
+
const said = (result) => {
|
|
152
|
+
if (result.outcome !== 'refused')
|
|
153
|
+
return result;
|
|
154
|
+
const message = saveMessages.get(result.code);
|
|
155
|
+
return message === undefined ? result : { ...result, message };
|
|
156
|
+
};
|
|
128
157
|
const closing = new AbortController();
|
|
129
158
|
const close = () => {
|
|
130
159
|
closing.abort();
|
|
@@ -145,9 +174,9 @@ export function serveMdRuntime(options) {
|
|
|
145
174
|
function attach(port, options) {
|
|
146
175
|
if (!authorized)
|
|
147
176
|
throw new Error(AUTHORIZATION_ENDED);
|
|
148
|
-
const { app, release, reach, admission, code = 'stored' } = options;
|
|
177
|
+
const { app, release, reach, admission, code = 'stored', first = null } = options;
|
|
149
178
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
150
|
-
const view = runtime.within(reach ?? null, { target: app, code });
|
|
179
|
+
const view = runtime.within(reach ?? null, { target: app, code, first, inboxed: null });
|
|
151
180
|
const observations = new Map();
|
|
152
181
|
const followed = new Set();
|
|
153
182
|
const answeredKeys = new Set();
|
|
@@ -173,6 +202,7 @@ export function serveMdRuntime(options) {
|
|
|
173
202
|
observations.clear();
|
|
174
203
|
for (const end of [...followed])
|
|
175
204
|
end();
|
|
205
|
+
view.close();
|
|
176
206
|
attachments.delete(detach);
|
|
177
207
|
};
|
|
178
208
|
const observe = (id, topic, input) => {
|
|
@@ -228,10 +258,12 @@ export function serveMdRuntime(options) {
|
|
|
228
258
|
return;
|
|
229
259
|
}
|
|
230
260
|
try {
|
|
231
|
-
if (message.kind
|
|
261
|
+
if (message.kind === 'observe') {
|
|
262
|
+
if (!UNWAITED_TOPICS.has(message.topic))
|
|
263
|
+
await opened();
|
|
264
|
+
}
|
|
265
|
+
else if (!UNWAITED_MEMBERS.has(message.member))
|
|
232
266
|
await md.loaded();
|
|
233
|
-
else if (message.topic !== 'room-drafts')
|
|
234
|
-
await opened();
|
|
235
267
|
if (message.kind === 'observe') {
|
|
236
268
|
if (serving)
|
|
237
269
|
observe(message.id, message.topic, message.input);
|
|
@@ -244,7 +276,7 @@ export function serveMdRuntime(options) {
|
|
|
244
276
|
return;
|
|
245
277
|
}
|
|
246
278
|
const { id, member, input } = message;
|
|
247
|
-
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
279
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input, said));
|
|
248
280
|
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
249
281
|
};
|
|
250
282
|
port.addEventListener('message', (event) => {
|
|
@@ -264,6 +296,10 @@ export function serveMdRuntime(options) {
|
|
|
264
296
|
if (serving)
|
|
265
297
|
view.narrow(next);
|
|
266
298
|
},
|
|
299
|
+
code(next) {
|
|
300
|
+
if (serving)
|
|
301
|
+
view.code(next);
|
|
302
|
+
},
|
|
267
303
|
answered(queries, done) {
|
|
268
304
|
const keys = queries.map(queryKey);
|
|
269
305
|
if (keys.every((key) => answeredKeys.has(key)))
|
|
@@ -0,0 +1,18 @@
|
|
|
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 HouseQueryOptions = {
|
|
10
|
+
readonly fresh?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type HouseQueryResult = HouseQueryRows | HouseQueryGroups | Offline | (ProviderRefusal & {
|
|
13
|
+
kind: 'rejected';
|
|
14
|
+
}) | (ProviderRefusal & {
|
|
15
|
+
kind: 'undeclared';
|
|
16
|
+
}) | Failure;
|
|
17
|
+
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null, options: unknown): Promise<HouseQueryResult>;
|
|
18
|
+
//# 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,EAAyB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,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,iBAAiB,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7D,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;AA8BZ,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { invalid, known, 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 freshOf(options) {
|
|
13
|
+
if (options === undefined)
|
|
14
|
+
return false;
|
|
15
|
+
if (!plain(options))
|
|
16
|
+
invalid('options', 'expects { fresh }');
|
|
17
|
+
known(options, ['fresh'], 'options');
|
|
18
|
+
const { fresh = false } = options;
|
|
19
|
+
if (typeof fresh !== 'boolean')
|
|
20
|
+
invalid('fresh', 'expects true or false');
|
|
21
|
+
return fresh;
|
|
22
|
+
}
|
|
23
|
+
function houseQueryOf(input, options) {
|
|
24
|
+
if (!plain(input))
|
|
25
|
+
invalid('query', 'expects a query object');
|
|
26
|
+
const { rooms, ...query } = input;
|
|
27
|
+
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
28
|
+
invalid('rooms', 'names the one Room House answers');
|
|
29
|
+
return { room: rooms[0], query, fresh: freshOf(options) };
|
|
30
|
+
}
|
|
31
|
+
async function heldHere(runtime, reach, room) {
|
|
32
|
+
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
33
|
+
}
|
|
34
|
+
export async function queriedHouse(runtime, input, reach, options) {
|
|
35
|
+
const { socket } = runtime;
|
|
36
|
+
const asked = houseQueryOf(input, options);
|
|
37
|
+
await socket.ready;
|
|
38
|
+
const query = socket.queryHouse();
|
|
39
|
+
if (query === undefined)
|
|
40
|
+
return undeclared('queryHouse');
|
|
41
|
+
if (!queriedOnly(reach, socket.session.now().queriesOnly, asked.room)) {
|
|
42
|
+
return (await heldHere(runtime, reach, asked.room))
|
|
43
|
+
? HELD_ON_DEVICE
|
|
44
|
+
: failure({ kind: 'room-not-readable', locator: asked.room });
|
|
45
|
+
}
|
|
46
|
+
if (await offline(runtime))
|
|
47
|
+
return OFFLINE;
|
|
48
|
+
const answer = await askedOnline(runtime, (authorization) => query(authorization, asked));
|
|
49
|
+
if (answer === null)
|
|
50
|
+
return UNCERTAIN;
|
|
51
|
+
return answer.kind === 'rows' || answer.kind === 'groups' || answer.kind === 'rejected'
|
|
52
|
+
? answer
|
|
53
|
+
: failure(answer);
|
|
54
|
+
}
|
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, AgentEnvironment, ListedAgent, ListedConversation, 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, BinaryCopy, 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';
|
|
@@ -15,22 +15,25 @@ export type { Observation } from './observation.js';
|
|
|
15
15
|
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
16
16
|
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
17
17
|
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
18
|
-
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
18
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, ShownAnswer, ConversationAttachAnswer, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
19
19
|
export { blobOf, declaredType } from './outcome.js';
|
|
20
20
|
export type { BinaryFileRecord } from './binary.js';
|
|
21
21
|
export type { RuntimeError } from './failure.js';
|
|
22
22
|
export { refusalError } from './failure.js';
|
|
23
|
-
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
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, HouseQueryOptions, 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';
|
|
29
30
|
export { definitionsIn, selected } from './collection.js';
|
|
30
31
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
31
|
-
export { cutName, nameFrom
|
|
32
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
32
|
+
export { cutName, nameFrom } from './name.js';
|
|
33
|
+
export { HISTORY_CONVERSATIONS, newChat } 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';
|
|
@@ -40,6 +43,7 @@ export { patching } from './shared.js';
|
|
|
40
43
|
export { acting, type Acting, type ActingRules, type Ended, type Lane, type LaneShown, type Send, } from './act-lanes.js';
|
|
41
44
|
export { expectation, expecting, type Descriptor, type Expectation, type Expected, type Expecting, } from './expectation.js';
|
|
42
45
|
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
46
|
+
export { leftToSend } from './durability.js';
|
|
43
47
|
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
44
48
|
export type { ObservedRead } from './reads.js';
|
|
45
49
|
export type { AttentionEntry, SyncStatus } from './status.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,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,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,E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ources":["../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,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;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,i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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
|
@@ -8,9 +8,11 @@ export { FIGURES_DAY_MS } from './figures.js';
|
|
|
8
8
|
export { departure } from './change.js';
|
|
9
9
|
export { definitionsIn, selected } from './collection.js';
|
|
10
10
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
11
|
-
export { cutName, nameFrom
|
|
12
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
11
|
+
export { cutName, nameFrom } from './name.js';
|
|
12
|
+
export { HISTORY_CONVERSATIONS, newChat } 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';
|
|
@@ -19,3 +21,4 @@ export { createRetries, STEPS, retrying, Unanswered, uncertainError, } from './r
|
|
|
19
21
|
export { patching } from './shared.js';
|
|
20
22
|
export { acting, } from './act-lanes.js';
|
|
21
23
|
export { expectation, expecting, } from './expectation.js';
|
|
24
|
+
export { leftToSend } from './durability.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":"
|
|
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
|
@@ -6,6 +6,7 @@ import { connectionLost } from './locks.js';
|
|
|
6
6
|
import { fenceLive } from './lost.js';
|
|
7
7
|
import { cachedModels, revoked, settleModels } from './models.js';
|
|
8
8
|
import { refuse } from './refusal.js';
|
|
9
|
+
import { roomsListed } from './room-list.js';
|
|
9
10
|
import { moveTo, recoverReads, rest, SERVICE_MODE_TOPIC, show, submissionDue, transferring, } from './shown.js';
|
|
10
11
|
import { applyRoom, changeAuthority, countAuthorityChange, finishOpening, loadRoom, OPENING_LANE, reload, resynchronize, sync, } from './sync.js';
|
|
11
12
|
const CONVERSATION_LANE = 'conversations';
|
|
@@ -15,9 +16,11 @@ function closing(runtime, opened) {
|
|
|
15
16
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
16
17
|
if (!live())
|
|
17
18
|
return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (store.needed()) {
|
|
20
|
+
const local = await store.open();
|
|
21
|
+
if (!opened && !socket.isOpen())
|
|
22
|
+
await cachedModels(runtime, local);
|
|
23
|
+
}
|
|
21
24
|
await rest(runtime, null, live);
|
|
22
25
|
});
|
|
23
26
|
}
|
|
@@ -95,6 +98,16 @@ function caughtUpRooms(runtime, expired) {
|
|
|
95
98
|
session.set({ underway: null });
|
|
96
99
|
socket.named();
|
|
97
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
|
+
}
|
|
98
111
|
replaced(store, expired);
|
|
99
112
|
const among = progress === null ? expired : null;
|
|
100
113
|
const installing = store.installs.underway(among);
|
|
@@ -197,7 +210,7 @@ export function spaceFreed(runtime) {
|
|
|
197
210
|
if (closed || authorization === undefined)
|
|
198
211
|
return;
|
|
199
212
|
if (!socket.streamed)
|
|
200
|
-
void
|
|
213
|
+
void runtime.discover();
|
|
201
214
|
else
|
|
202
215
|
void resynchronize(runtime);
|
|
203
216
|
}
|
|
@@ -222,7 +235,7 @@ export async function stop(runtime) {
|
|
|
222
235
|
await store.written();
|
|
223
236
|
close(runtime);
|
|
224
237
|
}
|
|
225
|
-
export function start(runtime, signal) {
|
|
238
|
+
export function start(runtime, signal, onNeed) {
|
|
226
239
|
const { store, socket, presence, conversations, lastAnswers, recovery } = runtime;
|
|
227
240
|
const closeRuntime = () => close(runtime);
|
|
228
241
|
socket.observeServiceMode((mode) => signalled(runtime, mode));
|
|
@@ -246,8 +259,9 @@ export function start(runtime, signal) {
|
|
|
246
259
|
recovery.resume();
|
|
247
260
|
}
|
|
248
261
|
else if (event.kind === 'discovered') {
|
|
262
|
+
const listed = roomsListed(runtime, event.discovery.roomList);
|
|
249
263
|
if (event.missed)
|
|
250
|
-
countAuthorityChange(runtime);
|
|
264
|
+
countAuthorityChange(runtime, listed);
|
|
251
265
|
void sync(runtime, 'opened', event.discovery);
|
|
252
266
|
}
|
|
253
267
|
else if (event.kind === 'closed') {
|
|
@@ -255,6 +269,8 @@ export function start(runtime, signal) {
|
|
|
255
269
|
}
|
|
256
270
|
else if (event.kind === 'caught-up')
|
|
257
271
|
void caughtUpRooms(runtime, event.expired);
|
|
272
|
+
else if (event.kind === 'reported')
|
|
273
|
+
lastAnswers.again();
|
|
258
274
|
else if (event.kind === 'authority-changed') {
|
|
259
275
|
if (socket.isAnnounced() && socket.isOpen())
|
|
260
276
|
fenceLive(runtime, event.left);
|
|
@@ -263,16 +279,12 @@ export function start(runtime, signal) {
|
|
|
263
279
|
else
|
|
264
280
|
void applyRoom(runtime, event);
|
|
265
281
|
});
|
|
266
|
-
|
|
267
|
-
.open()
|
|
268
|
-
.then(async (local) => {
|
|
269
|
-
if ((await local.facts()).capabilities.length > 0)
|
|
282
|
+
if (!onNeed) {
|
|
283
|
+
void store.open().catch((error) => {
|
|
270
284
|
socket.readyFromStore();
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
uncaught(error);
|
|
275
|
-
});
|
|
285
|
+
uncaught(error);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
276
288
|
if (!socket.streamed)
|
|
277
|
-
void
|
|
289
|
+
void runtime.discover();
|
|
278
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":["../src/listing.ts"],"names":[],"mappings":"AA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AChC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAYrB;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAO3D"}
|
package/dist/listing.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { typesPrint } from './collection.js';
|
|
1
2
|
import { declared } from './declaration.js';
|
|
2
|
-
import {
|
|
3
|
+
import { modelResult, NO_MODEL, sortedTypes, } from './model.js';
|
|
3
4
|
import { governs, holds } from './reach.js';
|
|
4
5
|
export function modelIn({ socket, presence }, locator, stored) {
|
|
5
6
|
if (socket.session.now().refusal?.code === 'revoked-authorization')
|
|
@@ -46,10 +47,8 @@ function listedRoom(runtime, locator, stored) {
|
|
|
46
47
|
handle: room.handle,
|
|
47
48
|
operations: room.operations,
|
|
48
49
|
replica: room.replica,
|
|
49
|
-
model:
|
|
50
|
-
typedSelection: selection === null
|
|
51
|
-
? null
|
|
52
|
-
: { roots: selection.roots, model: modelTypes(selectionModel(runtime)) },
|
|
50
|
+
model: modelIn(runtime, locator, stored),
|
|
51
|
+
typedSelection: selection === null ? null : { roots: selection.roots, model: selectionModel(runtime) },
|
|
53
52
|
providerOwnedPaths: room.providerOwnedPaths,
|
|
54
53
|
authoredPaths: room.authoredPaths,
|
|
55
54
|
roomVersion: stored?.record.roomVersion ?? null,
|
|
@@ -86,26 +85,43 @@ export async function listedEntries(runtime, touched) {
|
|
|
86
85
|
export async function listingNow(runtime) {
|
|
87
86
|
return listingOf(runtime, await runtime.store.rooms());
|
|
88
87
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
91
|
-
|
|
88
|
+
function listedModel(state, models) {
|
|
89
|
+
return modelResult(state, (types) => {
|
|
90
|
+
const key = typesPrint(types);
|
|
91
|
+
if (!models.has(key))
|
|
92
|
+
models.set(key, sortedTypes(types));
|
|
93
|
+
return key;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function shownRoom({ presence }, { model, typedSelection, documents, ...room }, models) {
|
|
97
|
+
if (presence.lockedAs(room.locator, room.replica.offline)) {
|
|
98
|
+
return {
|
|
92
99
|
...room,
|
|
93
|
-
model:
|
|
100
|
+
model: listedModel(NO_MODEL, models),
|
|
94
101
|
typedSelection: null,
|
|
95
102
|
documents: 0,
|
|
96
103
|
locked: true,
|
|
97
|
-
}
|
|
98
|
-
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
...room,
|
|
108
|
+
model: listedModel(model, models),
|
|
109
|
+
typedSelection: typedSelection === null
|
|
110
|
+
? null
|
|
111
|
+
: { roots: typedSelection.roots, model: listedModel(typedSelection.model, models) },
|
|
112
|
+
documents,
|
|
113
|
+
locked: false,
|
|
114
|
+
};
|
|
99
115
|
}
|
|
100
116
|
export function shownRooms(runtime, listing) {
|
|
101
|
-
|
|
117
|
+
const models = new Map();
|
|
118
|
+
const rooms = [...listing.values()].map((entry) => shownRoom(runtime, entry, models));
|
|
119
|
+
return structuredClone({ rooms, models: Object.fromEntries(models) });
|
|
102
120
|
}
|
|
103
121
|
export function shownChange(runtime, entries) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
order: null,
|
|
108
|
-
};
|
|
122
|
+
const models = new Map();
|
|
123
|
+
const changed = entries.map((entry) => [entry.locator, shownRoom(runtime, entry, models)]);
|
|
124
|
+
return structuredClone({ changed, removed: [], order: null, models: Object.fromEntries(models) });
|
|
109
125
|
}
|
|
110
126
|
export async function roomFacts(runtime, reach = null) {
|
|
111
127
|
const { store, socket, builtIn } = runtime;
|
package/dist/loaded.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuildFile, BuiltFile } from './client.js';
|
|
2
|
+
export declare function atAddress<T>(file: BuiltFile, use: (address: string) => Promise<T>): Promise<T>;
|
|
3
|
+
export declare function importedFile(file: BuiltFile | null): Promise<unknown>;
|
|
4
|
+
export declare function parsed(file: BuiltFile | null): Promise<unknown>;
|
|
5
|
+
export declare function perBuild<T>(buildFile: BuildFile, key: string, make: () => Promise<T>): Promise<T>;
|
|
6
|
+
export declare function loaded<T>(buildFile: BuildFile, name: string, read?: (file: BuiltFile | null) => Promise<unknown>): Promise<T | null>;
|
|
7
|
+
//# sourceMappingURL=loaded.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loaded.d.ts","sourceRoot":"","sources":["../src/loaded.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxD,wBAAsB,SAAS,CAAC,CAAC,EAC/B,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACnC,OAAO,CAAC,CAAC,CAAC,CAQZ;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAIrE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYjG;AAED,wBAAgB,MAAM,CAAC,CAAC,EACtB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,OAAO,CAAC,OAAO,CAAgB,GAChE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAEnB"}
|
package/dist/loaded.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
const holdings = new WeakMap();
|
|
10
|
+
export async function atAddress(file, use) {
|
|
11
|
+
if (typeof file === 'string')
|
|
12
|
+
return use(file);
|
|
13
|
+
const address = URL.createObjectURL(file);
|
|
14
|
+
try {
|
|
15
|
+
return await use(address);
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
URL.revokeObjectURL(address);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function importedFile(file) {
|
|
22
|
+
return file === null ? Promise.resolve(null) : atAddress(file, (address) => import(__rewriteRelativeImportExtension(address)));
|
|
23
|
+
}
|
|
24
|
+
export async function parsed(file) {
|
|
25
|
+
if (file === null)
|
|
26
|
+
return null;
|
|
27
|
+
const text = typeof file === 'string' ? await (await fetch(file)).text() : await file.text();
|
|
28
|
+
return JSON.parse(text);
|
|
29
|
+
}
|
|
30
|
+
export function perBuild(buildFile, key, make) {
|
|
31
|
+
let named = holdings.get(buildFile);
|
|
32
|
+
if (named === undefined) {
|
|
33
|
+
named = new Map();
|
|
34
|
+
holdings.set(buildFile, named);
|
|
35
|
+
}
|
|
36
|
+
const holding = named.get(key);
|
|
37
|
+
if (holding !== undefined)
|
|
38
|
+
return holding;
|
|
39
|
+
const making = make();
|
|
40
|
+
named.set(key, making);
|
|
41
|
+
making.catch(() => named.delete(key));
|
|
42
|
+
return making;
|
|
43
|
+
}
|
|
44
|
+
export function loaded(buildFile, name, read = importedFile) {
|
|
45
|
+
return perBuild(buildFile, name, () => buildFile(name).then(read));
|
|
46
|
+
}
|
package/dist/locks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locks.d.ts","sourceRoot":"","sources":["../src/locks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,wBAAsB,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE5F;AAED,wBAAsB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"locks.d.ts","sourceRoot":"","sources":["../src/locks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,wBAAsB,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE5F;AAED,wBAAsB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAI1F;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,iBAKzE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAU9C;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAE7E"}
|