@agentshouse/mdruntime 0.1.0-c0136de3edfbe → 0.1.0-c01d4615bfe46
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 +16 -15
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +74 -164
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +8 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +122 -68
- package/dist/adapter.d.ts +49 -55
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +0 -5
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -18
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +4 -2
- package/dist/chat-types.d.ts +2 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +11 -2
- package/dist/client.d.ts +13 -19
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -19
- package/dist/collection.d.ts +22 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +12 -2
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -24
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +32 -24
- package/dist/conversation-live.d.ts +147 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +258 -0
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +7 -1
- package/dist/conversation.d.ts +52 -44
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +956 -1029
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +19 -44
- package/dist/durability.d.ts +13 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +4 -0
- package/dist/entry.js +1 -1
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +6 -0
- package/dist/figures.d.ts +1 -0
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +2 -2
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +2 -1
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +18 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +46 -11
- package/dist/index.d.ts +17 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/install.d.ts +2 -4
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +53 -83
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +45 -35
- package/dist/listing.d.ts +6 -11
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +25 -61
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +3 -3
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +10 -39
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +10 -22
- package/dist/media.d.ts +1 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +10 -13
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +58 -27
- package/dist/messages.d.ts +10 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +26 -36
- package/dist/model.d.ts +0 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -5
- package/dist/models.d.ts +4 -8
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +95 -135
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +22 -21
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +7 -10
- package/dist/outcome.d.ts +10 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +23 -2
- package/dist/overlay.d.ts +5 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +36 -21
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +3 -58
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +10 -115
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +25 -24
- package/dist/presence.d.ts +52 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +220 -0
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +24 -14
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +2 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -6
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +450 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +68 -23
- package/dist/react.d.ts +11 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +1 -2
- package/dist/readiness.d.ts.map +1 -1
- package/dist/reads.d.ts +4 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +47 -5
- package/dist/recovery.d.ts +3 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +29 -7
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -6
- package/dist/replica.d.ts +5 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +15 -16
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +4 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +48 -59
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +17 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -4
- package/dist/runtime.d.ts +11 -19
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +42 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +333 -163
- package/dist/saves.d.ts +2 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +109 -703
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -3
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +6 -4
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +43 -35
- package/dist/socket/lanes.d.ts +12 -4
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +34 -8
- package/dist/socket/session.d.ts +0 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket.d.ts +3 -6
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +5 -16
- package/dist/source.d.ts +0 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +5 -4
- package/dist/store/records.d.ts +11 -8
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +43 -12
- package/dist/store/space.d.ts +1 -1
- package/dist/store/space.d.ts.map +1 -1
- package/dist/store/space.js +0 -2
- package/dist/store/watchers.js +1 -2
- package/dist/store.d.ts +12 -7
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +38 -13
- package/dist/stored.d.ts +2 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +27 -15
- package/dist/surface.d.ts +7 -4
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +30 -25
- package/dist/sync.d.ts +0 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +93 -89
- package/dist/tables.d.ts +19 -11
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +58 -21
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +6 -7
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/wire.d.ts +53 -7
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +17 -4
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/socket/rooms.d.ts +0 -43
- package/dist/socket/rooms.d.ts.map +0 -1
- package/dist/socket/rooms.js +0 -90
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM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EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { shownBy } from './media.js';
|
|
2
|
+
import { pageMetadataBlock } from './page-metadata.js';
|
|
2
3
|
import { observed } from './observation.js';
|
|
3
4
|
import { runtimeError } from './failure.js';
|
|
4
|
-
import {
|
|
5
|
+
import { blobOf, } from './outcome.js';
|
|
6
|
+
import { AUTHORIZATION_ENDED, PORT_CLOSED, wireAnswer, } from './wire.js';
|
|
5
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.
|
|
6
8
|
const SETTLED_FRAMES = 2;
|
|
7
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.
|
|
@@ -21,9 +23,10 @@ function handed(url, name) {
|
|
|
21
23
|
anchor.click();
|
|
22
24
|
}
|
|
23
25
|
function refused(refusal) {
|
|
24
|
-
return runtimeError(refusal.code
|
|
26
|
+
return runtimeError(refusal.code);
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
const UNBUILT = () => Promise.resolve(null);
|
|
29
|
+
export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
27
30
|
let sequence = 0;
|
|
28
31
|
let refusal = null;
|
|
29
32
|
let ended = null;
|
|
@@ -35,13 +38,13 @@ export function connectMdRuntime(port) {
|
|
|
35
38
|
const send = (message) => {
|
|
36
39
|
port.postMessage(message);
|
|
37
40
|
};
|
|
38
|
-
function begin(id, topic, first) {
|
|
41
|
+
function begin(id, topic, input, first) {
|
|
39
42
|
const handle = observed(first, () => {
|
|
40
43
|
observations.delete(id);
|
|
41
44
|
if (refusal === null)
|
|
42
45
|
send({ kind: 'stop', id });
|
|
43
|
-
}, topic
|
|
44
|
-
observations.set(id, { topic, handle });
|
|
46
|
+
}, topic);
|
|
47
|
+
observations.set(id, { topic, input, handle });
|
|
45
48
|
return handle.observation;
|
|
46
49
|
}
|
|
47
50
|
function refuse(reported) {
|
|
@@ -53,7 +56,7 @@ export function connectMdRuntime(port) {
|
|
|
53
56
|
const failure = refused(reported);
|
|
54
57
|
for (const [id, waiting] of opening) {
|
|
55
58
|
if (waiting.topic === 'connection-refusal')
|
|
56
|
-
waiting.settle(begin(id, waiting.topic, reported));
|
|
59
|
+
waiting.settle(begin(id, waiting.topic, waiting.input, reported));
|
|
57
60
|
else
|
|
58
61
|
waiting.fail(failure);
|
|
59
62
|
}
|
|
@@ -79,7 +82,7 @@ export function connectMdRuntime(port) {
|
|
|
79
82
|
drawing?.();
|
|
80
83
|
}
|
|
81
84
|
port.addEventListener('message', (event) => {
|
|
82
|
-
const message =
|
|
85
|
+
const message = wireAnswer(event.data);
|
|
83
86
|
if (message === null)
|
|
84
87
|
return;
|
|
85
88
|
if (message.kind === 'refusal') {
|
|
@@ -105,7 +108,7 @@ export function connectMdRuntime(port) {
|
|
|
105
108
|
waiting.fail(runtimeError(message.code, message.message, message.retryable));
|
|
106
109
|
}
|
|
107
110
|
else
|
|
108
|
-
waiting.settle(begin(message.id, waiting.topic, message.value));
|
|
111
|
+
waiting.settle(begin(message.id, waiting.topic, waiting.input, message.value));
|
|
109
112
|
drawing?.();
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
@@ -141,11 +144,11 @@ export function connectMdRuntime(port) {
|
|
|
141
144
|
const id = (sequence += 1);
|
|
142
145
|
if (refusal !== null) {
|
|
143
146
|
return topic === 'connection-refusal'
|
|
144
|
-
? Promise.resolve(begin(id, topic, refusal))
|
|
147
|
+
? Promise.resolve(begin(id, topic, input, refusal))
|
|
145
148
|
: Promise.reject(refused(refusal));
|
|
146
149
|
}
|
|
147
150
|
return new Promise((settle, fail) => {
|
|
148
|
-
opening.set(id, { topic, settle, fail });
|
|
151
|
+
opening.set(id, { topic, input, settle, fail });
|
|
149
152
|
send({ kind: 'observe', id, topic, input });
|
|
150
153
|
drawing?.();
|
|
151
154
|
});
|
|
@@ -193,9 +196,7 @@ export function connectMdRuntime(port) {
|
|
|
193
196
|
const read = streamed(await ask('binaryFile.read', [room, path, revision]));
|
|
194
197
|
if (read.kind !== 'binary')
|
|
195
198
|
return read;
|
|
196
|
-
const copy = await
|
|
197
|
-
headers: { 'content-type': read.mediaType },
|
|
198
|
-
}).blob();
|
|
199
|
+
const copy = await blobOf(read);
|
|
199
200
|
const url = URL.createObjectURL(copy);
|
|
200
201
|
handed(url, path.slice(path.lastIndexOf('/') + 1));
|
|
201
202
|
setTimeout(() => URL.revokeObjectURL(url), HANDED_COPY_MS);
|
|
@@ -232,6 +233,7 @@ export function connectMdRuntime(port) {
|
|
|
232
233
|
}
|
|
233
234
|
const show = (room, path, revision) => ask('binaryFile.show', [room, path, revision]).then((shown) => streamed(shown));
|
|
234
235
|
return shownBy(show, {
|
|
236
|
+
buildFile,
|
|
235
237
|
rooms: () => ask('rooms', []),
|
|
236
238
|
query: ((query) => ask('query', [query])),
|
|
237
239
|
search: (request) => ask('search', [request]),
|
|
@@ -254,14 +256,28 @@ export function connectMdRuntime(port) {
|
|
|
254
256
|
read: (conversation, options) => ask('conversation.read', [conversation, options]),
|
|
255
257
|
create: (input) => ask('conversation.create', [input]),
|
|
256
258
|
send: (conversation, operation, draft) => ask('conversation.send', [conversation, operation, draft]),
|
|
257
|
-
answer: (conversation, answer) => ask('conversation.answer', [conversation, answer]),
|
|
258
|
-
interrupt: (conversation) => ask('conversation.interrupt', [conversation]),
|
|
259
|
-
kill: (conversation) => ask('conversation.kill', [conversation]),
|
|
260
|
-
delete: (conversation) => ask('conversation.delete', [conversation]),
|
|
259
|
+
answer: (conversation, answer, operation) => ask('conversation.answer', [conversation, answer, operation]),
|
|
260
|
+
interrupt: (conversation, operation) => ask('conversation.interrupt', [conversation, operation]),
|
|
261
|
+
kill: (conversation, operation) => ask('conversation.kill', [conversation, operation]),
|
|
262
|
+
delete: (conversation, operation) => ask('conversation.delete', [conversation, operation]),
|
|
263
|
+
takeOut: (conversation, message, operation) => ask('conversation.takeOut', [conversation, message, operation]),
|
|
264
|
+
decide: (request, decision, operation) => ask('conversation.decide', [request, decision, operation]),
|
|
265
|
+
rename: (conversation, name, operation) => ask('conversation.rename', [conversation, name, operation]),
|
|
266
|
+
option: (conversation, option, value, operation) => ask('conversation.option', [conversation, option, value, operation]),
|
|
267
|
+
retry: (conversation, message, operation) => ask('conversation.retry', [conversation, message, operation]),
|
|
268
|
+
pins: () => ask('conversation.pins', []),
|
|
269
|
+
pin: (figures) => ask('conversation.pin', [figures]),
|
|
270
|
+
openedTurns: () => ask('conversation.openedTurns', []),
|
|
271
|
+
openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
|
|
272
|
+
dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
|
|
273
|
+
pageMetadata: async (app, address) => pageMetadataBlock(app, address, [...observations]
|
|
274
|
+
.sort(([left], [right]) => left - right)
|
|
275
|
+
.flatMap(([, { topic, input }]) => (topic === 'query' ? [input[0]] : []))),
|
|
261
276
|
},
|
|
262
277
|
chatDraft: {
|
|
263
278
|
write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
|
|
264
279
|
prepend: (conversation, draft) => ask('chatDraft.prepend', [conversation, draft]),
|
|
280
|
+
append: (conversation, draft) => ask('chatDraft.append', [conversation, draft]),
|
|
265
281
|
discard: (conversation) => ask('chatDraft.discard', [conversation]),
|
|
266
282
|
},
|
|
267
283
|
history: (locator, path, query) => ask('history', [locator, path, query]),
|
|
@@ -272,8 +288,8 @@ export function connectMdRuntime(port) {
|
|
|
272
288
|
download,
|
|
273
289
|
},
|
|
274
290
|
call: (name, input) => ask('call', [name, input]),
|
|
291
|
+
answered: (operation) => ask('answered', [operation]),
|
|
275
292
|
reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
|
|
276
|
-
log: () => ask('log', []),
|
|
277
293
|
persistence: () => ask('persistence', []),
|
|
278
294
|
retry: () => ask('retry', []),
|
|
279
295
|
cleanUp: () => ask('cleanUp', []),
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Document, type TypedPath } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { ModelState } from './model.js';
|
|
1
|
+
import { type DefinitionOf, type Document, type TypedPath } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { ModelState, TypesResult } from './model.js';
|
|
3
|
+
import type { AppTypedSelection } from './listing.js';
|
|
3
4
|
import type { MdModelIdentity } from './adapter.js';
|
|
4
5
|
export declare const MD_MODEL: MdModelIdentity;
|
|
5
6
|
export type Collection = {
|
|
@@ -20,10 +21,27 @@ export type Composed = {
|
|
|
20
21
|
readonly fingerprint: string;
|
|
21
22
|
};
|
|
22
23
|
export declare function composedOf(composition: Composition): Composed;
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
type Selecting<M> = {
|
|
25
|
+
readonly model: M;
|
|
26
|
+
readonly selection: {
|
|
27
|
+
readonly roots: readonly string[];
|
|
28
|
+
readonly model: M;
|
|
29
|
+
} | null;
|
|
30
|
+
};
|
|
31
|
+
export declare function selected(composition: {
|
|
32
|
+
readonly selection: {
|
|
33
|
+
readonly roots: readonly string[];
|
|
34
|
+
} | null;
|
|
35
|
+
}, path: string): boolean;
|
|
36
|
+
export declare function governing<M>(composition: Selecting<M>, path: string): M;
|
|
37
|
+
export declare function definitionsAt(composition: Composition, path: string): DefinitionOf;
|
|
38
|
+
export declare function definitionsIn(room: {
|
|
39
|
+
readonly model: TypesResult;
|
|
40
|
+
readonly typedSelection: AppTypedSelection | null;
|
|
41
|
+
}, path: string, typedPaths: readonly TypedPath[]): DefinitionOf;
|
|
25
42
|
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition): Collection;
|
|
26
43
|
export declare function documentsOf(collection: Collection): Generator<number, Iterable<readonly [string, Document]>, void>;
|
|
27
44
|
export declare function validRoot(root: unknown): root is string;
|
|
28
45
|
export declare function available(composition: Composition): boolean;
|
|
46
|
+
export {};
|
|
29
47
|
//# sourceMappingURL=collection.d.ts.map
|
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,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EAEf,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;AAc3F,wBAAgB,UAAU,CAAC,WAAW,EAAE,W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,GAAG,IAAI,IAAI,MAAM,CAEvD;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAE3D"}
|
package/dist/collection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parse, VERSION } from '@agentshouse/mdmodel';
|
|
1
|
+
import { definitionAt, 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';
|
|
@@ -33,6 +33,16 @@ export function governing(composition, path) {
|
|
|
33
33
|
? composition.selection.model
|
|
34
34
|
: composition.model;
|
|
35
35
|
}
|
|
36
|
+
function definitionsUnder(composition, path, typedPaths, typesOf) {
|
|
37
|
+
const types = typesOf(governing(composition, path));
|
|
38
|
+
return types === null ? () => undefined : definitionAt({ types }, path, typedPaths);
|
|
39
|
+
}
|
|
40
|
+
export function definitionsAt(composition, path) {
|
|
41
|
+
return definitionsUnder(composition, path, composition.typedPaths, (model) => model.status === 'unavailable' ? null : model.types);
|
|
42
|
+
}
|
|
43
|
+
export function definitionsIn(room, path, typedPaths) {
|
|
44
|
+
return definitionsUnder({ model: room.model, selection: room.typedSelection }, path, typedPaths, ({ types }) => types === null ? null : Object.fromEntries(types.map((type) => [type.name, type])));
|
|
45
|
+
}
|
|
36
46
|
export function collectionOf(text, composition) {
|
|
37
47
|
const parsed = new Map();
|
|
38
48
|
return {
|
|
@@ -44,7 +54,7 @@ export function collectionOf(text, composition) {
|
|
|
44
54
|
const content = text[path];
|
|
45
55
|
if (content === undefined)
|
|
46
56
|
return undefined;
|
|
47
|
-
const read = parse(content, path);
|
|
57
|
+
const read = parse(content, path, definitionsAt(composition, path));
|
|
48
58
|
parsed.set(path, read.ok ? read.document : null);
|
|
49
59
|
return read.ok ? read.document : undefined;
|
|
50
60
|
},
|
package/dist/compile.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { sql } from '@agentshouse/mdmodel';
|
|
2
|
+
import { type Composition } from './collection.js';
|
|
2
3
|
import type { Plan, QueryRows } from './query.js';
|
|
3
4
|
import type { Connection } from './tables.js';
|
|
4
5
|
export type QueryRoom = {
|
|
5
6
|
readonly locator: string;
|
|
6
7
|
readonly key: number;
|
|
8
|
+
readonly composition?: Composition;
|
|
7
9
|
};
|
|
8
10
|
type Fragment = sql.Fragment;
|
|
9
11
|
export declare const VISIBLE: (alias: string) => string;
|
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,
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,GAAG,EAQJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvF,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;AAIF,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAI7B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MACkC,CAAC;AAa3E,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAM5D;AA2dD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA4ZjE,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,WAAW,CAUb"}
|
package/dist/compile.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ARRAY_INDEX, bodied, byCodePoint, compared, cursorOf, heldKind, parse, pointerSegments, sql, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { binaryRecord } from './binary.js';
|
|
3
|
+
import { definitionsAt } from './collection.js';
|
|
3
4
|
import { documentKey, pathOfKey, roomOfKey } from './rows.js';
|
|
4
5
|
import { FROM_START, MAXIMUM_WINDOW } from './windows.js';
|
|
6
|
+
const UNTYPED = 'any';
|
|
5
7
|
const { all, any, exists, fragment, grouped, joined, listed } = sql;
|
|
6
8
|
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1 AND ${alias}.queried = 1`;
|
|
7
9
|
function located(alias) {
|
|
@@ -310,11 +312,20 @@ function sectionsOf(sections, names) {
|
|
|
310
312
|
return sections;
|
|
311
313
|
return Object.fromEntries(names.flatMap((name) => (Object.hasOwn(sections, name) ? [[name, sections[name]]] : [])));
|
|
312
314
|
}
|
|
313
|
-
function
|
|
315
|
+
function freeParts(room, path, type, content) {
|
|
316
|
+
const definitions = room.composition === undefined ? undefined : definitionsAt(room.composition, path);
|
|
317
|
+
const definition = definitions?.(type === UNTYPED ? undefined : type);
|
|
318
|
+
if (definition === undefined && type !== UNTYPED)
|
|
319
|
+
return null;
|
|
320
|
+
const read = parse(content, path, definition);
|
|
321
|
+
return read.ok ? read.document : null;
|
|
322
|
+
}
|
|
323
|
+
function documentOf(shape, queried, row, linked) {
|
|
324
|
+
const room = queried.locator;
|
|
314
325
|
const path = row.path;
|
|
315
326
|
const type = row.type;
|
|
316
|
-
const fileId = row.file_id
|
|
317
|
-
const revision = row.revision
|
|
327
|
+
const fileId = row.file_id;
|
|
328
|
+
const revision = row.revision;
|
|
318
329
|
if (type === null) {
|
|
319
330
|
const binary = row.binary === null ? null : JSON.parse(row.binary);
|
|
320
331
|
const content = row.content ?? null;
|
|
@@ -333,8 +344,9 @@ function documentOf(shape, room, row, linked) {
|
|
|
333
344
|
...heldFacts(shape, row),
|
|
334
345
|
};
|
|
335
346
|
}
|
|
336
|
-
const
|
|
337
|
-
|
|
347
|
+
const body = shape.sections !== null || shape.preamble
|
|
348
|
+
? freeParts(queried, path, type, row.content)
|
|
349
|
+
: null;
|
|
338
350
|
const fields = JSON.parse(row.fields ?? '{}');
|
|
339
351
|
return {
|
|
340
352
|
room,
|
|
@@ -365,7 +377,7 @@ function changeOf(row) {
|
|
|
365
377
|
function heldFacts(shape, row) {
|
|
366
378
|
return {
|
|
367
379
|
...(shape.size ? { size: row.bytes === null ? null : Number(row.bytes) } : {}),
|
|
368
|
-
...(shape.created ? { created: row.created
|
|
380
|
+
...(shape.created ? { created: row.created } : {}),
|
|
369
381
|
};
|
|
370
382
|
}
|
|
371
383
|
function backlinksOf(connection, bound, rows) {
|
|
@@ -377,8 +389,8 @@ function backlinksOf(connection, bound, rows) {
|
|
|
377
389
|
held.push(row.path);
|
|
378
390
|
byKey.set(key, held);
|
|
379
391
|
}
|
|
392
|
+
const reach = reached(bound, 's');
|
|
380
393
|
for (const [key, targets] of byKey) {
|
|
381
|
-
const reach = reached(bound, 's');
|
|
382
394
|
const room = bound.rooms.find((one) => one.key === key).locator;
|
|
383
395
|
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]);
|
|
384
396
|
for (const row of found) {
|
|
@@ -395,22 +407,19 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
395
407
|
const filter = filtered(bound, plan);
|
|
396
408
|
const cursor = plan.after?.values ?? null;
|
|
397
409
|
const room = located('d');
|
|
398
|
-
const
|
|
410
|
+
const after = cursor === null
|
|
399
411
|
? null
|
|
400
412
|
: (() => {
|
|
401
413
|
const key = cursor[shape.orderBy.length];
|
|
402
|
-
return any([
|
|
414
|
+
return sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), any([
|
|
403
415
|
fragment(`${room.sql} > ?`, [...room.bind, roomOfKey(key)]),
|
|
404
416
|
fragment(`${room.sql} = ? AND d.path > ?`, [
|
|
405
417
|
...room.bind,
|
|
406
418
|
roomOfKey(key),
|
|
407
419
|
pathOfKey(key),
|
|
408
420
|
]),
|
|
409
|
-
]);
|
|
421
|
+
]));
|
|
410
422
|
})();
|
|
411
|
-
const after = cursor === null || tie === null
|
|
412
|
-
? null
|
|
413
|
-
: sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), tie);
|
|
414
423
|
const selected = joined([
|
|
415
424
|
fragment('SELECT d.id, d.key, d.path, d.type, d.binary, d.revision, d.fields, d.change, d.file_id, d.bytes, d.created'),
|
|
416
425
|
...terms.map(({ term }, index) => joined([
|
|
@@ -431,8 +440,9 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
431
440
|
const kept = bodied(shape) ? withContent(connection, windowed, budget) : windowed;
|
|
432
441
|
const cut = kept.length;
|
|
433
442
|
const roomOf = new Map(bound.rooms.map(({ key, locator }) => [key, locator]));
|
|
443
|
+
const queried = new Map(bound.rooms.map((one) => [one.key, one]));
|
|
434
444
|
const linked = shape.backlinks ? backlinksOf(connection, bound, kept) : new Map();
|
|
435
|
-
const found = kept.map((row) => documentOf(shape,
|
|
445
|
+
const found = kept.map((row) => documentOf(shape, queried.get(Number(row.key)), row, linked));
|
|
436
446
|
const last = kept.at(-1);
|
|
437
447
|
const cursorAt = (row) => cursorOf([
|
|
438
448
|
...shape.orderBy.map(({ key }, index) => decodedKey(key, row, index)),
|
|
@@ -645,17 +655,14 @@ function groups(connection, bound, plan, shape) {
|
|
|
645
655
|
{ ordering: GROUP_TIES, kind: fragment("'string'"), value: fragment(`k${index}`) },
|
|
646
656
|
]);
|
|
647
657
|
const cursor = plan.after?.values ?? null;
|
|
648
|
-
const
|
|
658
|
+
const after = cursor === null
|
|
649
659
|
? null
|
|
650
|
-
:
|
|
651
|
-
value,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
: sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
|
|
657
|
-
.slice(0, -1)
|
|
658
|
-
.map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
|
|
660
|
+
: (() => {
|
|
661
|
+
const tieValues = cursor[shape.orderBy.length].flatMap((value) => [value, heldKind(value ?? null)]);
|
|
662
|
+
return sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
|
|
663
|
+
.slice(0, -1)
|
|
664
|
+
.map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
|
|
665
|
+
})();
|
|
659
666
|
const grouping = joined([fragment(`SELECT ${columns} FROM (`), ranked, fragment(`) GROUP BY ${held}`)], '');
|
|
660
667
|
const windowed = joined([
|
|
661
668
|
fragment('SELECT * FROM ('),
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,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;AAErE,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,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAoGzE"}
|
package/dist/connection.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { submitLater
|
|
1
|
+
import { submitLater } from './acceptance.js';
|
|
2
2
|
import { invokeAction, called, readConversationHistory, resendLater } from './actions.js';
|
|
3
|
-
import { builtInModel,
|
|
4
|
-
import {
|
|
3
|
+
import { builtInModel, NO_ROOM_TYPES } from './attached-model.js';
|
|
4
|
+
import { createLiveConversations } from './conversation-live.js';
|
|
5
|
+
import { writeRule } from './declaration.js';
|
|
5
6
|
import { refusedForSpace } from './durability.js';
|
|
7
|
+
import { uncaught } from './failure.js';
|
|
6
8
|
import { createFigures } from './figures.js';
|
|
7
9
|
import { scheduleCurrency, spaceFreed, start } from './lifecycle.js';
|
|
8
10
|
import { createLiveQueries } from './live.js';
|
|
9
|
-
import { createLog } from './log.js';
|
|
10
|
-
import { scoped } from './models.js';
|
|
11
11
|
import { open } from './opening.js';
|
|
12
|
-
import { deliverOwedReadiness, filled } from './preparation.js';
|
|
12
|
+
import { deliverOwedReadiness, filled, prepare } from './preparation.js';
|
|
13
|
+
import { createPresence } from './presence.js';
|
|
13
14
|
import { answeredPlan, figuresCover, roomTallies } from './queries.js';
|
|
14
15
|
import { readAnswers } from './reads.js';
|
|
15
16
|
import { createRecovery } from './recovery.js';
|
|
16
|
-
import {
|
|
17
|
+
import { createRetries } from './retried.js';
|
|
17
18
|
import { publishChangeSet, show } from './shown.js';
|
|
18
19
|
import { createSocket } from './socket.js';
|
|
19
20
|
import { createStore } from './store.js';
|
|
20
21
|
import { composedRuntime } from './surface.js';
|
|
21
|
-
import { advanced, withhold } from './sync.js';
|
|
22
22
|
const ROOM_ATTEMPTS = 16;
|
|
23
23
|
export function composeRuntime(options) {
|
|
24
24
|
const { adapter, shell } = options;
|
|
25
|
-
const roomTypes =
|
|
25
|
+
const roomTypes = adapter.roomTypes ?? NO_ROOM_TYPES;
|
|
26
26
|
const builtIn = builtInModel(roomTypes);
|
|
27
27
|
const typedPaths = adapter.typedPaths ?? [];
|
|
28
|
-
const
|
|
29
|
-
const socket = createSocket(adapter,
|
|
28
|
+
const retries = createRetries(shell);
|
|
29
|
+
const socket = createSocket(adapter, retries, options.authorization);
|
|
30
|
+
const presence = createPresence();
|
|
30
31
|
const store = createStore({
|
|
32
|
+
retries,
|
|
31
33
|
database: {
|
|
32
34
|
async ask(request) {
|
|
33
35
|
try {
|
|
@@ -44,11 +46,16 @@ export function composeRuntime(options) {
|
|
|
44
46
|
builtIn,
|
|
45
47
|
typedPaths,
|
|
46
48
|
persistence: shell.persistence,
|
|
49
|
+
lost: presence.lost,
|
|
47
50
|
opening: (local) => open(runtime, local),
|
|
48
|
-
unpublished
|
|
49
|
-
|
|
51
|
+
unpublished: uncaught,
|
|
52
|
+
changed(set) {
|
|
53
|
+
if (set.unindexed.length > 0)
|
|
54
|
+
prepare(runtime, set.unindexed);
|
|
55
|
+
for (const locator of set.due)
|
|
56
|
+
submitLater(runtime, locator);
|
|
57
|
+
return publishChangeSet(runtime, set);
|
|
50
58
|
},
|
|
51
|
-
changed: (set) => publishChangeSet(runtime, set),
|
|
52
59
|
deliverReadiness: (owed) => deliverOwedReadiness(runtime, owed),
|
|
53
60
|
spaceFreed: () => spaceFreed(runtime),
|
|
54
61
|
});
|
|
@@ -56,17 +63,19 @@ export function composeRuntime(options) {
|
|
|
56
63
|
const runtime = {
|
|
57
64
|
store,
|
|
58
65
|
socket,
|
|
59
|
-
|
|
66
|
+
presence,
|
|
60
67
|
recovery,
|
|
68
|
+
retries,
|
|
61
69
|
shell,
|
|
62
70
|
localSaves: adapter.localSaves === true,
|
|
63
71
|
roomTypes,
|
|
64
72
|
builtIn,
|
|
65
73
|
typedPaths,
|
|
74
|
+
writeRule: (declaration) => writeRule(declaration, adapter.pathRule ?? (() => true), adapter.localSaves === true),
|
|
66
75
|
usableWhenHeld: options.usableWhenHeld ?? [],
|
|
67
76
|
build: options.build ?? '',
|
|
68
|
-
conversations:
|
|
69
|
-
call: (name, input) => invokeAction(runtime, name, input),
|
|
77
|
+
conversations: createLiveConversations({
|
|
78
|
+
call: (name, input, attempt) => invokeAction(runtime, name, input, { attempt }),
|
|
70
79
|
history: (request) => readConversationHistory(runtime, request),
|
|
71
80
|
durably: store.durably,
|
|
72
81
|
local: store.open,
|
|
@@ -82,6 +91,9 @@ export function composeRuntime(options) {
|
|
|
82
91
|
full: store.space.full,
|
|
83
92
|
closed: socket.closed,
|
|
84
93
|
unanswered: () => resendLater(runtime),
|
|
94
|
+
heard: (operation, lost) => socket.lanes.settle(operation, lost),
|
|
95
|
+
recovery: recovery.scope(),
|
|
96
|
+
retries,
|
|
85
97
|
}),
|
|
86
98
|
liveQueries: createLiveQueries((plan, cover) => answeredPlan(runtime, plan, cover), store.covering),
|
|
87
99
|
figures: createFigures({
|
|
@@ -95,18 +107,14 @@ export function composeRuntime(options) {
|
|
|
95
107
|
unkept: adapter.unkeptReads ?? [],
|
|
96
108
|
leading: adapter.leadingReads ?? [],
|
|
97
109
|
recovery: recovery.scope(),
|
|
98
|
-
|
|
110
|
+
retries,
|
|
111
|
+
call: (name, input, attempt) => called(runtime, name, input, attempt),
|
|
99
112
|
online: socket.reached,
|
|
113
|
+
streaming: socket.isOpen,
|
|
100
114
|
closed: socket.closed,
|
|
101
115
|
full: store.space.full,
|
|
102
116
|
filled: () => filled(runtime),
|
|
103
117
|
}),
|
|
104
|
-
settle: (...held) => settle(runtime, ...held),
|
|
105
|
-
scoped: (...held) => scoped(runtime, ...held),
|
|
106
|
-
submitLater: (locator) => submitLater(runtime, locator),
|
|
107
|
-
unpair: (local) => unpair(runtime, local),
|
|
108
|
-
advanced: (...held) => advanced(runtime, ...held),
|
|
109
|
-
withhold: (...held) => withhold(runtime, ...held),
|
|
110
118
|
};
|
|
111
119
|
start(runtime, options.signal);
|
|
112
120
|
return composedRuntime(runtime);
|