@agentshouse/mdruntime 0.1.0-cedd665dffa4c → 0.1.0-cee2924c82d23
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.d.ts.map +1 -1
- package/dist/acceptance.js +30 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +48 -9
- package/dist/adapter.d.ts +118 -19
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +2 -2
- package/dist/{binary.d.ts → attachment.d.ts} +8 -4
- package/dist/attachment.d.ts.map +1 -0
- package/dist/attachment.js +15 -0
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +347 -0
- package/dist/chain.d.ts +1 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +5 -2
- package/dist/change.d.ts +2 -2
- package/dist/chat-types.js +2 -2
- package/dist/client.d.ts +16 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +24 -51
- package/dist/collection.d.ts +3 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +16 -9
- 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 +2 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +71 -39
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +6 -2
- 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.d.ts +18 -9
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +38 -22
- package/dist/declaration.js +3 -3
- 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 +25 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +111 -34
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -1
- package/dist/figures.d.ts +1 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +2 -2
- 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 +57 -21
- package/dist/house-query.d.ts +24 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +102 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +17 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- 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/live.d.ts +14 -0
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +29 -12
- package/dist/loaded.d.ts +5 -3
- package/dist/loaded.d.ts.map +1 -1
- package/dist/loaded.js +12 -6
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +2 -0
- package/dist/media.d.ts +14 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +126 -30
- package/dist/memory.d.ts +4 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +47 -16
- 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 +10 -7
- 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/opened.d.ts +5 -5
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +2 -2
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +18 -2
- package/dist/outcome.d.ts +27 -14
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +14 -5
- package/dist/overlay.d.ts +19 -8
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +108 -37
- package/dist/parts.d.ts +3 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +30 -7
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- 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 +75 -53
- package/dist/query.d.ts +2 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +1 -0
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -1
- package/dist/reach.d.ts +13 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +114 -25
- package/dist/react.d.ts +5 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +17 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +17 -7
- package/dist/reads.d.ts +1 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +17 -6
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +2 -1
- package/dist/reference-forms.d.ts +4 -0
- package/dist/reference-forms.d.ts.map +1 -0
- package/dist/reference-forms.js +74 -0
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +4 -4
- package/dist/replica.d.ts +3 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +3 -3
- package/dist/room-draft.d.ts +1 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +9 -6
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +8 -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/rows.d.ts +9 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +18 -4
- 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 +5 -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 +6 -6
- package/dist/saves.d.ts +7 -5
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +86 -49
- package/dist/selector.d.ts +3 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +22 -0
- 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 +2 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +2 -0
- package/dist/store/records.d.ts +22 -5
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +14 -4
- package/dist/store.d.ts +3 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +4 -1
- package/dist/stored.d.ts +17 -3
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +139 -35
- package/dist/surface.d.ts +12 -7
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +48 -15
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +45 -23
- package/dist/tables.d.ts +16 -47
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +69 -321
- package/dist/tallies.js +2 -2
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +49 -3
- package/dist/wire.d.ts +28 -6
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +17 -11
- package/package.json +4 -4
- package/dist/binary.d.ts.map +0 -1
- package/dist/binary.js +0 -8
package/dist/client.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { handedCopy, handedLink } from './download.js';
|
|
2
2
|
import { pageMetadataBlock } from './page-metadata.js';
|
|
3
|
-
import { observed } from './observation.js';
|
|
3
|
+
import { appRooms, observed } from './observation.js';
|
|
4
4
|
import { runtimeError } from './failure.js';
|
|
5
|
-
import {
|
|
5
|
+
import { attachmentBlob, } from './outcome.js';
|
|
6
6
|
import { AUTHORIZATION_ENDED, PORT_CLOSED, wireAnswer, } from './wire.js';
|
|
7
7
|
// React renders an arrived value in a later task and opens what that render observes as it commits, so this many frames opening nothing mean the page drew what it observes.
|
|
8
8
|
const SETTLED_FRAMES = 2;
|
|
9
|
-
// A browser reads a download's address only after the click that hands it returns, so a copy's address is released a minute later.
|
|
10
|
-
const HANDED_COPY_MS = 60_000;
|
|
11
|
-
const PAGE = /\.html?$/iu;
|
|
12
|
-
const STARTED = { kind: 'started' };
|
|
13
|
-
const BLOCKED = {
|
|
14
|
-
kind: 'blocked',
|
|
15
|
-
code: 'popup-blocked',
|
|
16
|
-
fields: {},
|
|
17
|
-
retryable: true,
|
|
18
|
-
};
|
|
19
|
-
function handed(url, name) {
|
|
20
|
-
const anchor = document.createElement('a');
|
|
21
|
-
anchor.href = url;
|
|
22
|
-
anchor.download = name;
|
|
23
|
-
anchor.click();
|
|
24
|
-
}
|
|
25
9
|
function refused(refusal) {
|
|
26
10
|
return runtimeError(refusal.code);
|
|
27
11
|
}
|
|
@@ -91,7 +75,7 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
91
75
|
}
|
|
92
76
|
if (message.kind === 'ended') {
|
|
93
77
|
for (const { topic, handle } of observations.values()) {
|
|
94
|
-
if (topic === 'member')
|
|
78
|
+
if (topic === 'member' || topic === 'time-zone')
|
|
95
79
|
handle.receive(null);
|
|
96
80
|
}
|
|
97
81
|
end(runtimeError('authorization-ended', AUTHORIZATION_ENDED));
|
|
@@ -161,12 +145,12 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
161
145
|
let received = 0;
|
|
162
146
|
const stream = new ReadableStream({
|
|
163
147
|
async pull(controller) {
|
|
164
|
-
const bytes = await ask('
|
|
148
|
+
const bytes = await ask('attachment.part', [file, part]);
|
|
165
149
|
if (bytes === null) {
|
|
166
150
|
if (received === byteLength)
|
|
167
151
|
controller.close();
|
|
168
152
|
else
|
|
169
|
-
controller.error(runtimeError('
|
|
153
|
+
controller.error(runtimeError('attachment-absent', 'The file ended early'));
|
|
170
154
|
return;
|
|
171
155
|
}
|
|
172
156
|
part += 1;
|
|
@@ -177,30 +161,13 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
177
161
|
return { kind: 'binary', stream, byteLength, mediaType };
|
|
178
162
|
}
|
|
179
163
|
async function download(room, path, revision) {
|
|
180
|
-
const
|
|
181
|
-
const linked = await ask('binaryFile.link', [room, path, revision]);
|
|
182
|
-
if (linked.kind === 'link' && PAGE.test(linked.name)) {
|
|
183
|
-
const away = tab ?? globalThis.open('', '_blank');
|
|
184
|
-
if (away === null)
|
|
185
|
-
return BLOCKED;
|
|
186
|
-
away.location.replace(linked.url);
|
|
187
|
-
return STARTED;
|
|
188
|
-
}
|
|
189
|
-
tab?.close();
|
|
190
|
-
if (linked.kind === 'link') {
|
|
191
|
-
handed(linked.url, linked.name);
|
|
192
|
-
return STARTED;
|
|
193
|
-
}
|
|
164
|
+
const linked = await handedLink(path, () => ask('attachment.link', [room, path, revision]));
|
|
194
165
|
if (linked.kind !== 'absent')
|
|
195
166
|
return linked;
|
|
196
|
-
const read = streamed(await ask('
|
|
167
|
+
const read = streamed(await ask('attachment.read', [room, path, revision]));
|
|
197
168
|
if (read.kind !== 'binary')
|
|
198
169
|
return read;
|
|
199
|
-
|
|
200
|
-
const url = URL.createObjectURL(copy);
|
|
201
|
-
handed(url, path.slice(path.lastIndexOf('/') + 1));
|
|
202
|
-
setTimeout(() => URL.revokeObjectURL(url), HANDED_COPY_MS);
|
|
203
|
-
return STARTED;
|
|
170
|
+
return handedCopy(await attachmentBlob(read), path.slice(path.lastIndexOf('/') + 1));
|
|
204
171
|
}
|
|
205
172
|
function settled() {
|
|
206
173
|
if (settling !== null)
|
|
@@ -231,12 +198,12 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
231
198
|
});
|
|
232
199
|
return settling;
|
|
233
200
|
}
|
|
234
|
-
|
|
235
|
-
return shownBy(show, {
|
|
201
|
+
return {
|
|
236
202
|
buildFile,
|
|
237
|
-
rooms: () => ask('rooms', []),
|
|
203
|
+
rooms: () => ask('rooms', []).then(appRooms),
|
|
238
204
|
query: ((query) => ask('query', [query])),
|
|
239
205
|
search: (request) => ask('search', [request]),
|
|
206
|
+
queryHouse: (query, options) => ask('queryHouse', options === undefined ? [query] : [query, options]),
|
|
240
207
|
types: (locator) => ask('types', [locator]),
|
|
241
208
|
roomDraft: {
|
|
242
209
|
list: () => ask('roomDraft.list', []),
|
|
@@ -263,11 +230,13 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
263
230
|
takeOut: (conversation, message, operation) => ask('conversation.takeOut', [conversation, message, operation]),
|
|
264
231
|
decide: (request, decision, operation) => ask('conversation.decide', [request, decision, operation]),
|
|
265
232
|
rename: (conversation, name, operation) => ask('conversation.rename', [conversation, name, operation]),
|
|
266
|
-
|
|
233
|
+
set: (conversation, settings, operation) => ask('conversation.set', [conversation, settings, operation]),
|
|
267
234
|
retry: (conversation, message, operation) => ask('conversation.retry', [conversation, message, operation]),
|
|
268
235
|
pin: (figures) => ask('conversation.pin', [figures]),
|
|
269
236
|
openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
|
|
270
237
|
dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
|
|
238
|
+
attach: (file) => ask('conversation.attach', [file]),
|
|
239
|
+
attachment: (link) => ask('conversation.attachment', [link]),
|
|
271
240
|
pageMetadata: async (app, address) => pageMetadataBlock(app, address, [...observations]
|
|
272
241
|
.sort(([left], [right]) => left - right)
|
|
273
242
|
.flatMap(([, { topic, input }]) => (topic === 'query' ? [input[0]] : []))),
|
|
@@ -280,9 +249,10 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
280
249
|
},
|
|
281
250
|
history: (locator, path, query) => ask('history', [locator, path, query]),
|
|
282
251
|
resolve: (room, path, destination) => ask('resolve', [room, path, destination]),
|
|
283
|
-
|
|
284
|
-
read: (room, path, revision) => ask('
|
|
285
|
-
|
|
252
|
+
attachment: {
|
|
253
|
+
read: (room, path, revision) => ask('attachment.read', [room, path, revision]).then((read) => streamed(read)),
|
|
254
|
+
show: (room, path, revision) => ask('attachment.show', [room, path, revision]).then((shown) => streamed(shown)),
|
|
255
|
+
attach: (room, file) => ask('attachment.attach', [room, file]),
|
|
286
256
|
download,
|
|
287
257
|
},
|
|
288
258
|
call: (name, input) => ask('call', [name, input]),
|
|
@@ -292,12 +262,13 @@ export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
|
292
262
|
retry: () => ask('retry', []),
|
|
293
263
|
cleanUp: () => ask('cleanUp', []),
|
|
294
264
|
unsent: () => ask('unsent', []),
|
|
265
|
+
sent: () => ask('sent', []),
|
|
295
266
|
reset: () => ask('reset', []),
|
|
296
267
|
readAgain: () => ask('readAgain', []),
|
|
297
268
|
observe: ((topic, ...input) => watch(topic, input)),
|
|
298
269
|
reauthorize: () => ask('reauthorize', []),
|
|
299
270
|
settled,
|
|
300
|
-
}
|
|
271
|
+
};
|
|
301
272
|
}
|
|
302
273
|
const turns = new WeakMap();
|
|
303
274
|
export function inTurn(client, work) {
|
|
@@ -307,5 +278,7 @@ export function inTurn(client, work) {
|
|
|
307
278
|
}
|
|
308
279
|
export { chainedWindows } from './chain.js';
|
|
309
280
|
export { roomDraftRevision } from './identity.js';
|
|
281
|
+
export { atAddress, importedFile } from './loaded.js';
|
|
310
282
|
export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
|
|
311
|
-
export {
|
|
283
|
+
export { shownModal } from './modal.js';
|
|
284
|
+
export { unanswered, undelivered } from './wire.js';
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DefinitionOf, type Document, type ParseResult, type TypedPath } from '@agentshouse/mdmodel';
|
|
1
|
+
import { type DefinitionOf, type Document, type ParseResult, type TypedPath, type VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { ModelState, TypesResult } from './model.js';
|
|
3
3
|
import type { AppTypedSelection } from './listing.js';
|
|
4
4
|
import type { MdModelIdentity } from './adapter.js';
|
|
@@ -20,6 +20,7 @@ export type Composed = {
|
|
|
20
20
|
readonly composition: Composition;
|
|
21
21
|
readonly fingerprint: string;
|
|
22
22
|
};
|
|
23
|
+
export declare function typesPrint(types: VerifiedModel['types']): string;
|
|
23
24
|
export declare function composedOf(composition: Composition): Composed;
|
|
24
25
|
type Selecting<M> = {
|
|
25
26
|
readonly model: M;
|
|
@@ -44,6 +45,7 @@ export declare function documentsOf(collection: Collection): Generator<number, I
|
|
|
44
45
|
export declare function validRoot(root: unknown): root is string;
|
|
45
46
|
export declare const UNTYPED = "any";
|
|
46
47
|
export declare function textType(read: ParseResult): string | undefined;
|
|
48
|
+
export declare function typeAt(composition: Composition, path: string, read: ParseResult): string | undefined;
|
|
47
49
|
export declare function typedText(read: ParseResult): boolean;
|
|
48
50
|
export declare function available(composition: Composition): boolean;
|
|
49
51
|
export {};
|
package/dist/collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,QAAQ,EAAE,eAAwE,CAAC;AAEhG,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAI3F,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAOhE;AAMD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AAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAEvD;AAED,eAAO,MAAM,OAAO,QAAQ,CAAC;AAE7B,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAE9D;AAED,wBAAgB,MAAM,CACpB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,WAAW,GAChB,MAAM,GAAG,SAAS,CAIpB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEpD;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAE3D"}
|
package/dist/collection.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { definitionAt, parse, VERSION, } from '@agentshouse/mdmodel';
|
|
1
|
+
import { definitionAt, folderType, parse, VERSION, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { beneath, normalize } from './paths.js';
|
|
3
3
|
import { hashed } from './observation.js';
|
|
4
4
|
import { sortedKeys } from './shared.js';
|
|
5
5
|
export const MD_MODEL = { identity: '@agentshouse/mdmodel', version: VERSION };
|
|
6
6
|
const typesPrinted = new WeakMap();
|
|
7
|
-
function typesPrint(
|
|
8
|
-
|
|
9
|
-
return '';
|
|
10
|
-
let print = typesPrinted.get(model.types);
|
|
7
|
+
export function typesPrint(types) {
|
|
8
|
+
let print = typesPrinted.get(types);
|
|
11
9
|
if (print === undefined) {
|
|
12
|
-
print = hashed(JSON.stringify(
|
|
13
|
-
typesPrinted.set(
|
|
10
|
+
print = hashed(JSON.stringify(types)).toString(36);
|
|
11
|
+
typesPrinted.set(types, print);
|
|
14
12
|
}
|
|
15
13
|
return print;
|
|
16
14
|
}
|
|
15
|
+
function modelPrint(model) {
|
|
16
|
+
return model.status === 'unavailable' ? '' : typesPrint(model.types);
|
|
17
|
+
}
|
|
17
18
|
export function composedOf(composition) {
|
|
18
19
|
const { model, selection } = composition;
|
|
19
20
|
return {
|
|
20
21
|
composition,
|
|
21
22
|
fingerprint: JSON.stringify([
|
|
22
|
-
|
|
23
|
-
selection === null ? null : [selection.roots,
|
|
23
|
+
modelPrint(model),
|
|
24
|
+
selection === null ? null : [selection.roots, modelPrint(selection.model)],
|
|
24
25
|
]),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
@@ -77,6 +78,12 @@ export const UNTYPED = 'any';
|
|
|
77
78
|
export function textType(read) {
|
|
78
79
|
return read.ok ? (read.document.type ?? UNTYPED) : undefined;
|
|
79
80
|
}
|
|
81
|
+
export function typeAt(composition, path, read) {
|
|
82
|
+
if (!read.ok || read.document.type !== undefined)
|
|
83
|
+
return textType(read);
|
|
84
|
+
const model = governing(composition, path);
|
|
85
|
+
return (model.status === 'unavailable' ? undefined : folderType(model, path)) ?? UNTYPED;
|
|
86
|
+
}
|
|
80
87
|
export function typedText(read) {
|
|
81
88
|
return (textType(read) ?? UNTYPED) !== UNTYPED;
|
|
82
89
|
}
|
package/dist/column.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Row, Value } from './tables.js';
|
|
2
|
+
export declare function text(value: Value | undefined): string;
|
|
3
|
+
export declare function texts(rows: readonly Row[], column: string): string[];
|
|
4
|
+
export declare function count(value: Value | undefined): number;
|
|
5
|
+
//# sourceMappingURL=column.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../src/column.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAErD;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAEtD"}
|
package/dist/column.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function text(value) {
|
|
2
|
+
return typeof value === 'string' ? value : String(value);
|
|
3
|
+
}
|
|
4
|
+
export function texts(rows, column) {
|
|
5
|
+
return rows.map((row) => text(row[column]));
|
|
6
|
+
}
|
|
7
|
+
export function count(value) {
|
|
8
|
+
return typeof value === 'bigint' ? Number(value) : typeof value === 'number' ? value : 0;
|
|
9
|
+
}
|
package/dist/compile.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare function within(alias: string, path: string): Fragment;
|
|
|
13
13
|
export type QueryAnswer = QueryRows & {
|
|
14
14
|
readonly more?: string;
|
|
15
15
|
};
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function namedHandles(connection: Connection, plan: Plan, rooms: readonly QueryRoom[], handles: readonly string[]): readonly string[];
|
|
17
|
+
export declare function answerQuery(connection: Connection, plan: Plan, rooms: readonly QueryRoom[], budget?: number | null, follows?: readonly QueryRoom[]): QueryAnswer;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=compile.d.ts.map
|
package/dist/compile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,GAAG,EAQJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,GAAG,EAQJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvF,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAG1D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAI7B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAAyD,CAAC;AAsBlG,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAE5D;AAufD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAkajE,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,GACzB,SAAS,MAAM,EAAE,CAenB;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,GAAE,MAAM,GAAG,IAAW,EAC5B,OAAO,GAAE,SAAS,SAAS,EAAO,GACjC,WAAW,CAUb"}
|
package/dist/compile.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { ARRAY_INDEX, bodied, byCodePoint, compared, cursorOf, heldKind, parse, pointerSegments, sql, } from '@agentshouse/mdmodel';
|
|
2
|
-
import {
|
|
2
|
+
import { attachmentRecord } from './attachment.js';
|
|
3
3
|
import { definitionsAt, UNTYPED } from './collection.js';
|
|
4
4
|
import { documentKey, pathOfKey, roomOfKey } from './rows.js';
|
|
5
|
+
import { ROOM_HANDLE } from './stored.js';
|
|
5
6
|
import { FROM_START, MAXIMUM_WINDOW } from './windows.js';
|
|
6
7
|
const { all, any, exists, fragment, grouped, joined, listed } = sql;
|
|
7
8
|
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1`;
|
|
8
9
|
function located(alias) {
|
|
9
10
|
return fragment(`(SELECT k.locator FROM replica_keys k WHERE k.key = ${alias}.key)`);
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
return fragment(`(${
|
|
13
|
-
|
|
14
|
-
`${
|
|
15
|
-
`${
|
|
12
|
+
function inside(path, folder) {
|
|
13
|
+
return fragment(`(${path} = ? OR (${path} >= ? AND ${path} < ?))`, [
|
|
14
|
+
folder,
|
|
15
|
+
`${folder}/`,
|
|
16
|
+
`${folder}0`,
|
|
16
17
|
]);
|
|
17
18
|
}
|
|
19
|
+
export function within(alias, path) {
|
|
20
|
+
return inside(`${alias}.path`, path);
|
|
21
|
+
}
|
|
18
22
|
function ancestors(area) {
|
|
19
23
|
const depth = area.path.split('/').length;
|
|
20
24
|
return area.open.flatMap((open) => {
|
|
@@ -22,18 +26,18 @@ function ancestors(area) {
|
|
|
22
26
|
return segments.slice(depth - 1, -1).map((_, at) => segments.slice(0, depth + at).join('/'));
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
|
-
function fenced(
|
|
29
|
+
function fenced(key, path, held, area, folders) {
|
|
26
30
|
const opened = any([
|
|
27
|
-
...area.open.map((open) =>
|
|
28
|
-
...(folders ? ancestors(area).map((
|
|
31
|
+
...area.open.map((open) => inside(path, open)),
|
|
32
|
+
...(folders ? ancestors(area).map((ancestor) => fragment(`${path} = ?`, [ancestor])) : []),
|
|
29
33
|
]);
|
|
30
34
|
return all([
|
|
31
|
-
fragment(`${
|
|
32
|
-
|
|
35
|
+
fragment(`${key} = ?`, [held]),
|
|
36
|
+
inside(path, area.path),
|
|
33
37
|
fragment(`NOT ${grouped(opened).sql}`, opened.bind),
|
|
34
38
|
]);
|
|
35
39
|
}
|
|
36
|
-
function reached(bound,
|
|
40
|
+
function reached(bound, key, path) {
|
|
37
41
|
const reach = bound.reach;
|
|
38
42
|
if (reach === null)
|
|
39
43
|
return fragment('1');
|
|
@@ -46,49 +50,65 @@ function reached(bound, alias) {
|
|
|
46
50
|
return key === undefined ? [] : [[key, pathOfKey(held)]];
|
|
47
51
|
});
|
|
48
52
|
const outside = any(reach.areas.flatMap((area) => {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
53
|
+
const held = bound.keys.get(area.room);
|
|
54
|
+
return held === undefined ? [] : [fenced(key, path, held, area, false)];
|
|
51
55
|
}));
|
|
52
56
|
return all([
|
|
53
57
|
any([
|
|
54
|
-
...(rooms.length === 0 ? [] : [fragment(`${
|
|
58
|
+
...(rooms.length === 0 ? [] : [fragment(`${key} IN ${listed(rooms).sql}`, rooms)]),
|
|
55
59
|
...(documents.length === 0
|
|
56
60
|
? []
|
|
57
61
|
: [
|
|
58
|
-
fragment(`EXISTS (SELECT 1 FROM json_each(?) j WHERE j.value ->> 0 = ${
|
|
62
|
+
fragment(`EXISTS (SELECT 1 FROM json_each(?) j WHERE j.value ->> 0 = ${key} AND j.value ->> 1 = ${path})`, [JSON.stringify(documents)]),
|
|
59
63
|
]),
|
|
60
64
|
]),
|
|
61
65
|
...(reach.areas.length === 0 ? [] : [fragment(`NOT ${grouped(outside).sql}`, outside.bind)]),
|
|
62
66
|
]);
|
|
63
67
|
}
|
|
68
|
+
function handled(bound, link) {
|
|
69
|
+
return fragment(`FROM replica_rooms h WHERE ${ROOM_HANDLE('h')} = ${link}.handle AND h.key IN (SELECT value FROM json_each(?))`, [bound.follows]);
|
|
70
|
+
}
|
|
71
|
+
function followed(bound) {
|
|
72
|
+
return {
|
|
73
|
+
targets: (link, document) => {
|
|
74
|
+
const room = handled(bound, link);
|
|
75
|
+
return joined([
|
|
76
|
+
fragment(`replica_entries ${document} ON ${document}.key = CASE WHEN ${link}.handle IS NULL THEN d.key ELSE (SELECT h.key ${room.sql}) END AND ${document}.path = ${link}.target AND ${VISIBLE(document)} AND`, room.bind),
|
|
77
|
+
grouped(reached(bound, `${document}.key`, `${document}.path`)),
|
|
78
|
+
], ' ');
|
|
79
|
+
},
|
|
80
|
+
unfollowed: (link) => {
|
|
81
|
+
const own = reached(bound, 'd.key', `${link}.target`);
|
|
82
|
+
const room = handled(bound, link);
|
|
83
|
+
const other = reached(bound, 'h.key', `${link}.target`);
|
|
84
|
+
return fragment(`NOT ((${link}.handle IS NULL AND ${own.sql}) OR EXISTS (SELECT 1 ${room.sql} AND ${other.sql}))`, [...own.bind, ...room.bind, ...other.bind]);
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
64
88
|
function related(bound, plan) {
|
|
65
89
|
const parts = [];
|
|
66
|
-
if (plan.hop !== null)
|
|
67
|
-
parts.push(
|
|
68
|
-
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries m ON m.key = d.key AND m.path = l.target AND ${VISIBLE('m')} WHERE l.doc = d.id AND l.kind = 'field' AND`),
|
|
69
|
-
grouped(sql.placed('l', plan.hop.field, 'link')),
|
|
70
|
-
fragment('AND'),
|
|
71
|
-
grouped(all([sql.scoped('m', plan.hop), reached(bound, 'm')])),
|
|
72
|
-
], ' ')));
|
|
73
|
-
}
|
|
90
|
+
if (plan.hop !== null)
|
|
91
|
+
parts.push(sql.hopped('d', plan.hop, followed(bound)));
|
|
74
92
|
if (plan.backlinks !== null) {
|
|
75
93
|
const field = plan.backlinks.field;
|
|
76
94
|
parts.push(exists(joined([
|
|
77
|
-
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE l.key = d.key AND l.target = d.path AND l.kind = 'field' AND`),
|
|
95
|
+
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE l.key = d.key AND l.handle IS NULL AND l.target = d.path AND l.kind = 'field' AND`),
|
|
78
96
|
...(field === null ? [] : [grouped(sql.placed('l', field, 'link')), fragment('AND')]),
|
|
79
|
-
grouped(all([sql.scoped('s', plan.backlinks), reached(bound, 's')])),
|
|
97
|
+
grouped(all([sql.scoped('s', plan.backlinks), reached(bound, 's.key', 's.path')])),
|
|
80
98
|
], ' ')));
|
|
81
99
|
}
|
|
82
100
|
return parts;
|
|
83
101
|
}
|
|
84
|
-
function
|
|
102
|
+
function tested(bound, plan) {
|
|
85
103
|
const keys = bound.rooms.map(({ key }) => key);
|
|
86
|
-
return
|
|
104
|
+
return [
|
|
87
105
|
fragment(`d.key IN ${listed(keys).sql} AND ${VISIBLE('d')}`, keys),
|
|
88
|
-
reached(bound, 'd'),
|
|
106
|
+
reached(bound, 'd.key', 'd.path'),
|
|
89
107
|
sql.tests('d', plan),
|
|
90
|
-
|
|
91
|
-
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
function filtered(bound, plan) {
|
|
111
|
+
return all([...tested(bound, plan), ...related(bound, plan)]);
|
|
92
112
|
}
|
|
93
113
|
function orderingOf(options) {
|
|
94
114
|
const stringSort = options.stringSort ?? 'locale';
|
|
@@ -334,7 +354,7 @@ function documentOf(shape, queried, row, linked) {
|
|
|
334
354
|
...(binary === null
|
|
335
355
|
? {}
|
|
336
356
|
: {
|
|
337
|
-
|
|
357
|
+
attachment: attachmentRecord(path, binary, revision ?? undefined),
|
|
338
358
|
}),
|
|
339
359
|
...(shape.markdown && content !== null ? { markdown: content } : {}),
|
|
340
360
|
...(shape.change ? { change: changeOf(row) } : {}),
|
|
@@ -388,10 +408,10 @@ function backlinksOf(connection, bound, rows) {
|
|
|
388
408
|
held.push(row.path);
|
|
389
409
|
byKey.set(key, held);
|
|
390
410
|
}
|
|
391
|
-
const reach = reached(bound, 's');
|
|
411
|
+
const reach = reached(bound, 's.key', 's.path');
|
|
392
412
|
for (const [key, targets] of byKey) {
|
|
393
413
|
const room = bound.rooms.find((one) => one.key === key).locator;
|
|
394
|
-
const found = connection.rows(`SELECT target, path, type, field FROM (SELECT l.target, s.path, s.type, l.field, ROW_NUMBER() OVER (PARTITION BY l.target ORDER BY s.path, l.field) AS rank FROM (SELECT DISTINCT doc, target, field FROM replica_links WHERE key = ? AND kind = 'field' AND target IN (SELECT value FROM json_each(?))) l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE ${reach.sql}) WHERE rank <= ? ORDER BY target, path, field`, [key, JSON.stringify(targets), ...reach.bind, MAXIMUM_WINDOW]);
|
|
414
|
+
const found = connection.rows(`SELECT target, path, type, field FROM (SELECT l.target, s.path, s.type, l.field, ROW_NUMBER() OVER (PARTITION BY l.target ORDER BY s.path, l.field) AS rank FROM (SELECT DISTINCT doc, target, field FROM replica_links WHERE key = ? AND kind = 'field' AND handle IS NULL AND target IN (SELECT value FROM json_each(?))) l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE ${reach.sql}) WHERE rank <= ? ORDER BY target, path, field`, [key, JSON.stringify(targets), ...reach.bind, MAXIMUM_WINDOW]);
|
|
395
415
|
for (const row of found) {
|
|
396
416
|
const at = documentKey(room, row.target);
|
|
397
417
|
const held = linked.get(at) ?? [];
|
|
@@ -506,7 +526,7 @@ function storedFolders(bound, plan, subfolder) {
|
|
|
506
526
|
const key = bound.keys.get(area.room);
|
|
507
527
|
if (key === undefined)
|
|
508
528
|
return [];
|
|
509
|
-
const fence = fenced('f', key, area, true);
|
|
529
|
+
const fence = fenced('f.key', 'f.path', key, area, true);
|
|
510
530
|
return [fragment(`NOT ${grouped(fence).sql}`, fence.bind)];
|
|
511
531
|
});
|
|
512
532
|
const under = prefix === ''
|
|
@@ -702,16 +722,28 @@ function groups(connection, bound, plan, shape) {
|
|
|
702
722
|
...(total === undefined ? {} : { total }),
|
|
703
723
|
};
|
|
704
724
|
}
|
|
705
|
-
function boundOf(connection, plan, rooms) {
|
|
725
|
+
function boundOf(connection, plan, rooms, follows) {
|
|
706
726
|
return {
|
|
707
727
|
rooms: [...rooms].sort((left, right) => left.locator < right.locator ? -1 : left.locator > right.locator ? 1 : 0),
|
|
708
|
-
keys: new Map(rooms.map(({ locator, key }) => [locator, key])),
|
|
728
|
+
keys: new Map([...rooms, ...follows].map(({ locator, key }) => [locator, key])),
|
|
729
|
+
follows: JSON.stringify(follows.map(({ key }) => key)),
|
|
709
730
|
reach: plan.reach,
|
|
710
731
|
collate: collating(connection),
|
|
711
732
|
};
|
|
712
733
|
}
|
|
713
|
-
export function
|
|
714
|
-
|
|
734
|
+
export function namedHandles(connection, plan, rooms, handles) {
|
|
735
|
+
if (plan.hop === null)
|
|
736
|
+
return [];
|
|
737
|
+
const statement = joined([
|
|
738
|
+
fragment("SELECT DISTINCT l.handle FROM replica_entries d JOIN replica_links l ON l.doc = d.id AND l.kind = 'field' AND l.handle IN (SELECT value FROM json_each(?)) AND ", [JSON.stringify(handles)]),
|
|
739
|
+
grouped(sql.placed('l', plan.hop.field, 'link')),
|
|
740
|
+
fragment(' WHERE '),
|
|
741
|
+
all(tested(boundOf(connection, plan, rooms, []), plan)),
|
|
742
|
+
], '');
|
|
743
|
+
return connection.rows(statement.sql, statement.bind).map((row) => row.handle);
|
|
744
|
+
}
|
|
745
|
+
export function answerQuery(connection, plan, rooms, budget = null, follows = []) {
|
|
746
|
+
const bound = boundOf(connection, plan, rooms, follows);
|
|
715
747
|
if (rooms.length === 0) {
|
|
716
748
|
return plan.shape.kind === 'groups'
|
|
717
749
|
? { groups: [], ...(plan.total ? { total: 0 } : {}) }
|
package/dist/connection.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export type MdRuntimeOptions = {
|
|
|
10
10
|
authorization?: Authorization;
|
|
11
11
|
signal?: AbortSignal;
|
|
12
12
|
recovery?: Recovery;
|
|
13
|
-
usableWhenHeld?: readonly string[];
|
|
14
13
|
build?: string;
|
|
14
|
+
storeOnNeed?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare function composeRuntime(options: MdRuntimeOptions): ComposedRuntime;
|
|
17
17
|
//# sourceMappingURL=connection.d.ts.map
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAI/E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAUrE,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9D,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAI/E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAUrE,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9D,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGrE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAwGzE"}
|
package/dist/connection.js
CHANGED
|
@@ -20,6 +20,7 @@ import { publishChangeSet, show } from './shown.js';
|
|
|
20
20
|
import { createSocket } from './socket.js';
|
|
21
21
|
import { createStore } from './store.js';
|
|
22
22
|
import { composedRuntime } from './surface.js';
|
|
23
|
+
import { adopt, discover } from './sync.js';
|
|
23
24
|
const ROOM_ATTEMPTS = 16;
|
|
24
25
|
export function composeRuntime(options) {
|
|
25
26
|
const { adapter, shell } = options;
|
|
@@ -73,8 +74,9 @@ export function composeRuntime(options) {
|
|
|
73
74
|
roomTypes,
|
|
74
75
|
builtIn,
|
|
75
76
|
typedPaths,
|
|
77
|
+
renamedActions: adapter.renamedActions ?? new Map(),
|
|
78
|
+
rewrittenInputs: adapter.rewrittenInputs ?? new Map(),
|
|
76
79
|
writeRule: (declaration) => writeRule(declaration, adapter.pathRule ?? (() => true), adapter.localSaves === true),
|
|
77
|
-
usableWhenHeld: options.usableWhenHeld ?? [],
|
|
78
80
|
build: options.build ?? '',
|
|
79
81
|
conversations: createLiveConversations({
|
|
80
82
|
call: (name, input, attempt) => invokeAction(runtime, name, input, { attempt }),
|
|
@@ -117,7 +119,9 @@ export function composeRuntime(options) {
|
|
|
117
119
|
full: store.space.full,
|
|
118
120
|
filled: () => filled(runtime),
|
|
119
121
|
}),
|
|
122
|
+
discover: () => discover(runtime),
|
|
123
|
+
adopt: (unstored) => adopt(runtime, unstored),
|
|
120
124
|
};
|
|
121
|
-
start(runtime, options.signal);
|
|
125
|
+
start(runtime, options.signal, options.storeOnNeed === true);
|
|
122
126
|
return composedRuntime(runtime);
|
|
123
127
|
}
|
|
@@ -34,9 +34,6 @@ export type Live = {
|
|
|
34
34
|
options: readonly SessionOption[];
|
|
35
35
|
starting: string | null;
|
|
36
36
|
state: SessionState | null;
|
|
37
|
-
link: {
|
|
38
|
-
connected: boolean;
|
|
39
|
-
} | null;
|
|
40
37
|
deliveryWaiting: readonly string[];
|
|
41
38
|
deliveryUnknown: readonly string[];
|
|
42
39
|
};
|
|
@@ -79,6 +76,7 @@ export type Audience<T> = {
|
|
|
79
76
|
};
|
|
80
77
|
type HeldFacts = {
|
|
81
78
|
readonly listKnown: boolean;
|
|
79
|
+
readonly listHeld: boolean;
|
|
82
80
|
readonly openingRead: boolean;
|
|
83
81
|
readonly openingListed: boolean;
|
|
84
82
|
readonly listOwed: boolean;
|
|
@@ -140,6 +138,7 @@ export type LiveConversations = {
|
|
|
140
138
|
forget(conversation: string): void;
|
|
141
139
|
current(): boolean;
|
|
142
140
|
known(): boolean;
|
|
141
|
+
listHeld(): boolean;
|
|
143
142
|
listed(): boolean;
|
|
144
143
|
reopened(): void;
|
|
145
144
|
lost(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-live.d.ts","sourceRoot":"","sources":["../src/conversation-live.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,KAAK,E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I,IAAI,CAAC;IACjB,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AA4DF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,wBAAwB,GAAG,iBAAiB,CAuKzF"}
|
|
@@ -7,7 +7,6 @@ export const QUIET = {
|
|
|
7
7
|
options: [],
|
|
8
8
|
starting: null,
|
|
9
9
|
state: null,
|
|
10
|
-
link: null,
|
|
11
10
|
deliveryWaiting: [],
|
|
12
11
|
deliveryUnknown: [],
|
|
13
12
|
};
|
|
@@ -18,7 +17,6 @@ export const FACTS = [
|
|
|
18
17
|
'options',
|
|
19
18
|
'starting',
|
|
20
19
|
'state',
|
|
21
|
-
'link',
|
|
22
20
|
'deliveryWaiting',
|
|
23
21
|
'deliveryUnknown',
|
|
24
22
|
];
|
|
@@ -98,6 +96,7 @@ export function createLiveConversations(deps) {
|
|
|
98
96
|
const listedListeners = createAudience();
|
|
99
97
|
const held = createCell({
|
|
100
98
|
listKnown: false,
|
|
99
|
+
listHeld: false,
|
|
101
100
|
openingRead: false,
|
|
102
101
|
openingListed: false,
|
|
103
102
|
listOwed: false,
|
|
@@ -232,6 +231,7 @@ export function createLiveConversations(deps) {
|
|
|
232
231
|
},
|
|
233
232
|
current: () => behind.size === 0,
|
|
234
233
|
known: () => held.now().listKnown,
|
|
234
|
+
listHeld: () => held.now().listHeld,
|
|
235
235
|
listed: () => deps.stream() === undefined || held.now().openingListed,
|
|
236
236
|
reopened() {
|
|
237
237
|
relisting = null;
|