@agentshouse/mdruntime 0.1.0-cd507e16e5fc0 → 0.1.0-cd574a610e9c8
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 +21 -19
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +75 -165
- 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 +118 -67
- package/dist/adapter.d.ts +90 -58
- 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/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -19
- 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 +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +0 -2
- package/dist/client.d.ts +13 -20
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +36 -20
- package/dist/collection.d.ts +25 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +19 -2
- 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 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -25
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +31 -24
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +26 -12
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +23 -12
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +20 -7
- package/dist/conversation.d.ts +37 -12
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +320 -234
- 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 +4 -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.map +1 -1
- package/dist/figures.js +4 -2
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/host.d.ts +18 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +59 -15
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -7
- package/dist/install.d.ts +10 -6
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +92 -111
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +54 -40
- package/dist/listing.d.ts +11 -12
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +48 -72
- package/dist/live.d.ts +5 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +74 -33
- package/dist/loaded.d.ts +5 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +40 -0
- 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 +11 -23
- package/dist/media.d.ts +6 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +68 -17
- package/dist/memory.d.ts +8 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +92 -33
- package/dist/messages.d.ts +12 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +30 -38
- 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 +97 -139
- package/dist/observation.d.ts +27 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +184 -85
- 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 +5 -9
- package/dist/outcome.d.ts +13 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +32 -2
- package/dist/overlay.d.ts +6 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +37 -24
- 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/preparation.d.ts +27 -6
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +156 -68
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +231 -0
- package/dist/queries.d.ts +2 -2
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +67 -31
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +1 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +1 -7
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +480 -0
- package/dist/reach.d.ts +2 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +88 -26
- package/dist/react.d.ts +8 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +9 -3
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +4 -2
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +11 -4
- 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 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +15 -17
- 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 +31 -8
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +273 -66
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +22 -18
- 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 +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +9 -10
- package/dist/runtime.d.ts +9 -18
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +42 -90
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +327 -229
- package/dist/saves.d.ts +4 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +143 -714
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +4 -5
- package/dist/shared.d.ts +0 -5
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -90
- package/dist/shown.d.ts +7 -5
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +77 -63
- 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 +5 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +18 -6
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +18 -7
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +58 -24
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- 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 +23 -14
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +46 -17
- package/dist/stored.d.ts +25 -14
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +83 -32
- package/dist/surface.d.ts +5 -3
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +25 -23
- package/dist/sync.d.ts +1 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +96 -92
- package/dist/tables.d.ts +16 -57
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +91 -332
- 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 +4 -10
- 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 -44
- 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,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
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,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,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AAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;KACnF,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAQF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,YAAU,GAAG,eAAe,CA6UxF;AAID,wBAAgB,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxF;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,IAAI,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
|
+
pin: (figures) => ask('conversation.pin', [figures]),
|
|
269
|
+
openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
|
|
270
|
+
dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
|
|
271
|
+
attach: (file) => ask('conversation.attach', [file]),
|
|
272
|
+
attachment: (link) => ask('conversation.attachment', [link]),
|
|
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', []),
|
|
@@ -293,5 +309,5 @@ export function inTurn(client, work) {
|
|
|
293
309
|
}
|
|
294
310
|
export { chainedWindows } from './chain.js';
|
|
295
311
|
export { roomDraftRevision } from './identity.js';
|
|
296
|
-
export { defineRoomMedia, ROOM_MEDIA } from './media.js';
|
|
312
|
+
export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
|
|
297
313
|
export { unanswered } from './wire.js';
|
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 ParseResult, 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,30 @@ 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;
|
|
45
|
+
export declare const UNTYPED = "any";
|
|
46
|
+
export declare function textType(read: ParseResult): string | undefined;
|
|
47
|
+
export declare function typedText(read: ParseResult): boolean;
|
|
28
48
|
export declare function available(composition: Composition): boolean;
|
|
49
|
+
export {};
|
|
29
50
|
//# 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,WAAW,EAChB,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,WAAW,GAAG,QAAQ,CAS7D;AAED,KAAK,SAAS,CAAC,CAAC,IAAI;IAClB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,SAAS,EAAE;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AAS,CAE9D;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,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
|
},
|
|
@@ -63,6 +73,13 @@ export function* documentsOf(collection) {
|
|
|
63
73
|
export function validRoot(root) {
|
|
64
74
|
return typeof root === 'string' && normalize(root) === root;
|
|
65
75
|
}
|
|
76
|
+
export const UNTYPED = 'any';
|
|
77
|
+
export function textType(read) {
|
|
78
|
+
return read.ok ? (read.document.type ?? UNTYPED) : undefined;
|
|
79
|
+
}
|
|
80
|
+
export function typedText(read) {
|
|
81
|
+
return (textType(read) ?? UNTYPED) !== UNTYPED;
|
|
82
|
+
}
|
|
66
83
|
export function available(composition) {
|
|
67
84
|
return composition.model.status !== 'unavailable';
|
|
68
85
|
}
|
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
|
@@ -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,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3E,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;AAEF,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAI7B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAAyD,CAAC;AAalG,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,9 +1,10 @@
|
|
|
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, UNTYPED } from './collection.js';
|
|
3
4
|
import { documentKey, pathOfKey, roomOfKey } from './rows.js';
|
|
4
5
|
import { FROM_START, MAXIMUM_WINDOW } from './windows.js';
|
|
5
6
|
const { all, any, exists, fragment, grouped, joined, listed } = sql;
|
|
6
|
-
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1
|
|
7
|
+
export const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1`;
|
|
7
8
|
function located(alias) {
|
|
8
9
|
return fragment(`(SELECT k.locator FROM replica_keys k WHERE k.key = ${alias}.key)`);
|
|
9
10
|
}
|
|
@@ -310,11 +311,20 @@ function sectionsOf(sections, names) {
|
|
|
310
311
|
return sections;
|
|
311
312
|
return Object.fromEntries(names.flatMap((name) => (Object.hasOwn(sections, name) ? [[name, sections[name]]] : [])));
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function freeParts(room, path, type, content) {
|
|
315
|
+
const definitions = room.composition === undefined ? undefined : definitionsAt(room.composition, path);
|
|
316
|
+
const definition = definitions?.(type === UNTYPED ? undefined : type);
|
|
317
|
+
if (definition === undefined && type !== UNTYPED)
|
|
318
|
+
return null;
|
|
319
|
+
const read = parse(content, path, definition);
|
|
320
|
+
return read.ok ? read.document : null;
|
|
321
|
+
}
|
|
322
|
+
function documentOf(shape, queried, row, linked) {
|
|
323
|
+
const room = queried.locator;
|
|
314
324
|
const path = row.path;
|
|
315
325
|
const type = row.type;
|
|
316
|
-
const fileId = row.file_id
|
|
317
|
-
const revision = row.revision
|
|
326
|
+
const fileId = row.file_id;
|
|
327
|
+
const revision = row.revision;
|
|
318
328
|
if (type === null) {
|
|
319
329
|
const binary = row.binary === null ? null : JSON.parse(row.binary);
|
|
320
330
|
const content = row.content ?? null;
|
|
@@ -333,8 +343,9 @@ function documentOf(shape, room, row, linked) {
|
|
|
333
343
|
...heldFacts(shape, row),
|
|
334
344
|
};
|
|
335
345
|
}
|
|
336
|
-
const
|
|
337
|
-
|
|
346
|
+
const body = shape.sections !== null || shape.preamble
|
|
347
|
+
? freeParts(queried, path, type, row.content)
|
|
348
|
+
: null;
|
|
338
349
|
const fields = JSON.parse(row.fields ?? '{}');
|
|
339
350
|
return {
|
|
340
351
|
room,
|
|
@@ -365,7 +376,7 @@ function changeOf(row) {
|
|
|
365
376
|
function heldFacts(shape, row) {
|
|
366
377
|
return {
|
|
367
378
|
...(shape.size ? { size: row.bytes === null ? null : Number(row.bytes) } : {}),
|
|
368
|
-
...(shape.created ? { created: row.created
|
|
379
|
+
...(shape.created ? { created: row.created } : {}),
|
|
369
380
|
};
|
|
370
381
|
}
|
|
371
382
|
function backlinksOf(connection, bound, rows) {
|
|
@@ -377,8 +388,8 @@ function backlinksOf(connection, bound, rows) {
|
|
|
377
388
|
held.push(row.path);
|
|
378
389
|
byKey.set(key, held);
|
|
379
390
|
}
|
|
391
|
+
const reach = reached(bound, 's');
|
|
380
392
|
for (const [key, targets] of byKey) {
|
|
381
|
-
const reach = reached(bound, 's');
|
|
382
393
|
const room = bound.rooms.find((one) => one.key === key).locator;
|
|
383
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]);
|
|
384
395
|
for (const row of found) {
|
|
@@ -395,22 +406,19 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
395
406
|
const filter = filtered(bound, plan);
|
|
396
407
|
const cursor = plan.after?.values ?? null;
|
|
397
408
|
const room = located('d');
|
|
398
|
-
const
|
|
409
|
+
const after = cursor === null
|
|
399
410
|
? null
|
|
400
411
|
: (() => {
|
|
401
412
|
const key = cursor[shape.orderBy.length];
|
|
402
|
-
return any([
|
|
413
|
+
return sql.following(terms.map(({ term }, index) => sql.beyond(bound.collate, term, cursor[index])), any([
|
|
403
414
|
fragment(`${room.sql} > ?`, [...room.bind, roomOfKey(key)]),
|
|
404
415
|
fragment(`${room.sql} = ? AND d.path > ?`, [
|
|
405
416
|
...room.bind,
|
|
406
417
|
roomOfKey(key),
|
|
407
418
|
pathOfKey(key),
|
|
408
419
|
]),
|
|
409
|
-
]);
|
|
420
|
+
]));
|
|
410
421
|
})();
|
|
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
422
|
const selected = joined([
|
|
415
423
|
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
424
|
...terms.map(({ term }, index) => joined([
|
|
@@ -431,8 +439,9 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
431
439
|
const kept = bodied(shape) ? withContent(connection, windowed, budget) : windowed;
|
|
432
440
|
const cut = kept.length;
|
|
433
441
|
const roomOf = new Map(bound.rooms.map(({ key, locator }) => [key, locator]));
|
|
442
|
+
const queried = new Map(bound.rooms.map((one) => [one.key, one]));
|
|
434
443
|
const linked = shape.backlinks ? backlinksOf(connection, bound, kept) : new Map();
|
|
435
|
-
const found = kept.map((row) => documentOf(shape,
|
|
444
|
+
const found = kept.map((row) => documentOf(shape, queried.get(Number(row.key)), row, linked));
|
|
436
445
|
const last = kept.at(-1);
|
|
437
446
|
const cursorAt = (row) => cursorOf([
|
|
438
447
|
...shape.orderBy.map(({ key }, index) => decodedKey(key, row, index)),
|
|
@@ -645,17 +654,14 @@ function groups(connection, bound, plan, shape) {
|
|
|
645
654
|
{ ordering: GROUP_TIES, kind: fragment("'string'"), value: fragment(`k${index}`) },
|
|
646
655
|
]);
|
|
647
656
|
const cursor = plan.after?.values ?? null;
|
|
648
|
-
const
|
|
657
|
+
const after = cursor === null
|
|
649
658
|
? 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));
|
|
659
|
+
: (() => {
|
|
660
|
+
const tieValues = cursor[shape.orderBy.length].flatMap((value) => [value, heldKind(value ?? null)]);
|
|
661
|
+
return sql.following(ordered.map((term, index) => sql.beyond(bound.collate, term, cursor[index])), sql.following(ties
|
|
662
|
+
.slice(0, -1)
|
|
663
|
+
.map((term, index) => sql.beyond(bound.collate, term, tieValues[index])), sql.beyond(bound.collate, ties.at(-1), tieValues.at(-1)).beyond));
|
|
664
|
+
})();
|
|
659
665
|
const grouping = joined([fragment(`SELECT ${columns} FROM (`), ranked, fragment(`) GROUP BY ${held}`)], '');
|
|
660
666
|
const windowed = joined([
|
|
661
667
|
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":"
|
|
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;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,CAqGzE"}
|
package/dist/connection.js
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { notReadyWaitMs } from '@agentshouse/mdmodel';
|
|
2
|
+
import { submitLater } from './acceptance.js';
|
|
2
3
|
import { invokeAction, called, readConversationHistory, resendLater } from './actions.js';
|
|
3
|
-
import { builtInModel,
|
|
4
|
+
import { builtInModel, NO_ROOM_TYPES } from './attached-model.js';
|
|
4
5
|
import { createLiveConversations } from './conversation-live.js';
|
|
6
|
+
import { writeRule } from './declaration.js';
|
|
5
7
|
import { refusedForSpace } from './durability.js';
|
|
8
|
+
import { uncaught } from './failure.js';
|
|
6
9
|
import { createFigures } from './figures.js';
|
|
7
10
|
import { scheduleCurrency, spaceFreed, start } from './lifecycle.js';
|
|
8
11
|
import { createLiveQueries } from './live.js';
|
|
9
|
-
import { createLog } from './log.js';
|
|
10
|
-
import { scoped } from './models.js';
|
|
11
12
|
import { open } from './opening.js';
|
|
12
|
-
import { deliverOwedReadiness, filled } from './preparation.js';
|
|
13
|
+
import { deliverOwedReadiness, filled, prepare } from './preparation.js';
|
|
14
|
+
import { createPresence } from './presence.js';
|
|
13
15
|
import { answeredPlan, figuresCover, roomTallies } from './queries.js';
|
|
14
16
|
import { readAnswers } from './reads.js';
|
|
15
17
|
import { createRecovery } from './recovery.js';
|
|
16
|
-
import {
|
|
18
|
+
import { createRetries } from './retried.js';
|
|
17
19
|
import { publishChangeSet, show } from './shown.js';
|
|
18
20
|
import { createSocket } from './socket.js';
|
|
19
21
|
import { createStore } from './store.js';
|
|
20
22
|
import { composedRuntime } from './surface.js';
|
|
21
|
-
import { advanced, withhold } from './sync.js';
|
|
22
23
|
const ROOM_ATTEMPTS = 16;
|
|
23
24
|
export function composeRuntime(options) {
|
|
24
25
|
const { adapter, shell } = options;
|
|
25
|
-
const roomTypes =
|
|
26
|
+
const roomTypes = adapter.roomTypes ?? NO_ROOM_TYPES;
|
|
26
27
|
const builtIn = builtInModel(roomTypes);
|
|
27
28
|
const typedPaths = adapter.typedPaths ?? [];
|
|
28
|
-
const
|
|
29
|
-
const socket = createSocket(adapter,
|
|
29
|
+
const retries = createRetries(shell);
|
|
30
|
+
const socket = createSocket(adapter, retries, options.authorization);
|
|
31
|
+
const presence = createPresence(notReadyWaitMs);
|
|
30
32
|
const store = createStore({
|
|
33
|
+
retries,
|
|
31
34
|
database: {
|
|
32
35
|
async ask(request) {
|
|
33
36
|
try {
|
|
@@ -44,30 +47,37 @@ export function composeRuntime(options) {
|
|
|
44
47
|
builtIn,
|
|
45
48
|
typedPaths,
|
|
46
49
|
persistence: shell.persistence,
|
|
50
|
+
lost: presence.lost,
|
|
51
|
+
losing: presence.losing,
|
|
47
52
|
opening: (local) => open(runtime, local),
|
|
48
|
-
unpublished
|
|
49
|
-
|
|
53
|
+
unpublished: uncaught,
|
|
54
|
+
changed(set) {
|
|
55
|
+
if (set.unindexed.length > 0)
|
|
56
|
+
prepare(runtime, set.unindexed);
|
|
57
|
+
for (const locator of set.due)
|
|
58
|
+
submitLater(runtime, locator);
|
|
59
|
+
return publishChangeSet(runtime, set);
|
|
50
60
|
},
|
|
51
|
-
|
|
52
|
-
deliverReadiness: (owed) => deliverOwedReadiness(runtime, owed),
|
|
61
|
+
deliverReadiness: (owed, rooms) => deliverOwedReadiness(runtime, owed, rooms),
|
|
53
62
|
spaceFreed: () => spaceFreed(runtime),
|
|
54
63
|
});
|
|
55
64
|
const recovery = (options.recovery ?? createRecovery()).scope(ROOM_ATTEMPTS);
|
|
56
65
|
const runtime = {
|
|
57
66
|
store,
|
|
58
67
|
socket,
|
|
59
|
-
|
|
68
|
+
presence,
|
|
60
69
|
recovery,
|
|
70
|
+
retries,
|
|
61
71
|
shell,
|
|
62
72
|
localSaves: adapter.localSaves === true,
|
|
63
73
|
roomTypes,
|
|
64
74
|
builtIn,
|
|
65
75
|
typedPaths,
|
|
66
|
-
|
|
76
|
+
writeRule: (declaration) => writeRule(declaration, adapter.pathRule ?? (() => true), adapter.localSaves === true),
|
|
67
77
|
usableWhenHeld: options.usableWhenHeld ?? [],
|
|
68
78
|
build: options.build ?? '',
|
|
69
79
|
conversations: createLiveConversations({
|
|
70
|
-
call: (name, input) => invokeAction(runtime, name, input),
|
|
80
|
+
call: (name, input, attempt) => invokeAction(runtime, name, input, { attempt }),
|
|
71
81
|
history: (request) => readConversationHistory(runtime, request),
|
|
72
82
|
durably: store.durably,
|
|
73
83
|
local: store.open,
|
|
@@ -83,7 +93,9 @@ export function composeRuntime(options) {
|
|
|
83
93
|
full: store.space.full,
|
|
84
94
|
closed: socket.closed,
|
|
85
95
|
unanswered: () => resendLater(runtime),
|
|
96
|
+
heard: (operation, lost) => socket.lanes.settle(operation, lost),
|
|
86
97
|
recovery: recovery.scope(),
|
|
98
|
+
retries,
|
|
87
99
|
}),
|
|
88
100
|
liveQueries: createLiveQueries((plan, cover) => answeredPlan(runtime, plan, cover), store.covering),
|
|
89
101
|
figures: createFigures({
|
|
@@ -97,19 +109,14 @@ export function composeRuntime(options) {
|
|
|
97
109
|
unkept: adapter.unkeptReads ?? [],
|
|
98
110
|
leading: adapter.leadingReads ?? [],
|
|
99
111
|
recovery: recovery.scope(),
|
|
100
|
-
|
|
112
|
+
retries,
|
|
113
|
+
call: (name, input, attempt) => called(runtime, name, input, attempt),
|
|
101
114
|
online: socket.reached,
|
|
102
115
|
streaming: socket.isOpen,
|
|
103
116
|
closed: socket.closed,
|
|
104
117
|
full: store.space.full,
|
|
105
118
|
filled: () => filled(runtime),
|
|
106
119
|
}),
|
|
107
|
-
settle: (...held) => settle(runtime, ...held),
|
|
108
|
-
scoped: (...held) => scoped(runtime, ...held),
|
|
109
|
-
submitLater: (locator) => submitLater(runtime, locator),
|
|
110
|
-
unpair: (local) => unpair(runtime, local),
|
|
111
|
-
advanced: (...held) => advanced(runtime, ...held),
|
|
112
|
-
withhold: (...held) => withhold(runtime, ...held),
|
|
113
120
|
};
|
|
114
121
|
start(runtime, options.signal);
|
|
115
122
|
return composedRuntime(runtime);
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKpD"}
|
package/dist/context.js
CHANGED