@agentshouse/mdruntime 0.1.0-c454894e67f74 → 0.1.0-c45e2d0d978ee
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 +24 -19
- package/dist/acceptance.d.ts +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +299 -0
- 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 +26 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +321 -0
- package/dist/adapter.d.ts +252 -117
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +6 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +35 -41
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/binary.d.ts +4 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +9 -2
- package/dist/bootstrap.d.ts +31 -11
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +309 -109
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/chain.d.ts +12 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +13 -16
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +17 -88
- package/dist/change.d.ts +36 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +17 -3
- package/dist/chat-types.d.ts +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +11 -0
- package/dist/client.d.ts +46 -25
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +105 -31
- package/dist/collection.d.ts +33 -21
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +54 -288
- 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 +18 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +723 -0
- package/dist/connection.d.ts +7 -129
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +111 -3346
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +2 -5
- package/dist/conversation-live.d.ts +149 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +40 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +66 -0
- package/dist/conversation.d.ts +83 -49
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +1080 -724
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/discovery.d.ts +12 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- 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 +21 -4
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +12 -0
- package/dist/entry.d.ts +19 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +65 -31
- 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 +8 -0
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +199 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +8 -122
- 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 +28 -10
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +177 -35
- package/dist/house-query.d.ts +15 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +43 -0
- package/dist/identity.d.ts +0 -2
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -6
- package/dist/index.d.ts +45 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -3
- package/dist/install.d.ts +60 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +290 -0
- package/dist/listing.d.ts +60 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +168 -0
- package/dist/live.d.ts +25 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +206 -0
- 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 +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +34 -0
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +49 -0
- package/dist/media.d.ts +25 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +308 -0
- package/dist/memory.d.ts +26 -8
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +323 -116
- package/dist/messages.d.ts +63 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +169 -0
- 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 +12 -13
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +11 -22
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +153 -0
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +42 -10
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +266 -39
- 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 +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +69 -0
- package/dist/outcome.d.ts +62 -9
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +72 -0
- package/dist/overlay.d.ts +9 -6
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +129 -166
- 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 +6 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +36 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +26 -0
- package/dist/preparation.d.ts +46 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +344 -0
- 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 +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +287 -0
- package/dist/query.d.ts +26 -186
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -464
- package/dist/{chat/questions.d.ts → questions.d.ts} +6 -7
- package/dist/questions.d.ts.map +1 -0
- package/dist/{chat/questions.js → questions.js} +14 -8
- 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 +30 -11
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +443 -111
- package/dist/react.d.ts +23 -5
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +40 -18
- package/dist/{chat/read.d.ts → read.d.ts} +2 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/{chat/read.js → read.js} +4 -0
- package/dist/readiness.d.ts +33 -21
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +19 -18
- package/dist/reads.d.ts +39 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +178 -0
- package/dist/recovery.d.ts +6 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +67 -9
- package/dist/refresh.d.ts +17 -14
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +145 -54
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +55 -0
- package/dist/replica.d.ts +50 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +340 -191
- 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 +66 -12
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +416 -122
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +220 -0
- 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 +32 -29
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +60 -118
- 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 +35 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +43 -48
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +751 -303
- package/dist/saves.d.ts +34 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +437 -0
- package/dist/search.d.ts +15 -77
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -184
- package/dist/seed.d.ts +25 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +145 -0
- package/dist/shared.d.ts +6 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +75 -104
- package/dist/shown.d.ts +35 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +326 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +28 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +103 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/session.d.ts +41 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +26 -0
- package/dist/socket.d.ts +68 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +165 -0
- package/dist/source.d.ts +59 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +93 -0
- package/dist/status.d.ts +4 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +40 -0
- package/dist/store/readiness.d.ts +11 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +68 -0
- package/dist/store/records.d.ts +227 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +468 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- 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 +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +115 -149
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +166 -711
- package/dist/stored.d.ts +174 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +785 -0
- package/dist/surface.d.ts +94 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +255 -0
- package/dist/sync.d.ts +21 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +557 -0
- package/dist/tables.d.ts +376 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +499 -0
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +128 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +51 -21
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +98 -0
- package/dist/windows.d.ts +11 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +16 -0
- package/dist/wire.d.ts +112 -9
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +41 -11
- package/package.json +19 -19
- package/AGENTS.md +0 -302
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/chat/acts.d.ts +0 -33
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/input.d.ts +0 -9
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -99
- package/dist/chat/kit.d.ts +0 -61
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -27
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -63
- package/dist/chat/markdown.d.ts +0 -20
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -188
- package/dist/chat/message.d.ts +0 -6
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -192
- package/dist/chat/messages.d.ts +0 -22
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -155
- package/dist/chat/name.d.ts +0 -6
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -11
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -17
- package/dist/chat/overlay.d.ts +0 -31
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -97
- package/dist/chat/parts.d.ts +0 -57
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -119
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -63
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -629
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -80
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/ready.d.ts +0 -34
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -91
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -302
- package/dist/chat.d.ts +0 -14
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/log.d.ts +0 -5
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/read-side.d.ts +0 -25
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -639
package/dist/host.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { queryKey } from '@agentshouse/mdmodel';
|
|
2
|
+
import { composeRuntime } from './connection.js';
|
|
3
|
+
import { untilAnswered } from './recovery.js';
|
|
2
4
|
import { described } from './failure.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
+
import { observed } from './observation.js';
|
|
6
|
+
import { answeredResult } from './outcome.js';
|
|
7
|
+
import { AUTHORIZATION_ENDED, WIRE, wireRequest, } from './wire.js';
|
|
5
8
|
const NARROWED = new Set(['within', 'whole']);
|
|
9
|
+
const UNWAITED_MEMBERS = new Set(['call', 'queryHouse']);
|
|
10
|
+
const UNWAITED_TOPICS = new Set([
|
|
11
|
+
'deployment-facts',
|
|
12
|
+
'room-drafts',
|
|
13
|
+
'sync-status',
|
|
14
|
+
'connection-refusal',
|
|
15
|
+
'storage-loss',
|
|
16
|
+
'service-mode',
|
|
17
|
+
'authority-changes',
|
|
18
|
+
]);
|
|
6
19
|
function answered(md, app, writtenBy, member, input) {
|
|
7
20
|
switch (member) {
|
|
8
21
|
case 'rooms':
|
|
@@ -11,22 +24,44 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
11
24
|
return md.query(input[0]);
|
|
12
25
|
case 'search':
|
|
13
26
|
return md.search(input[0]);
|
|
27
|
+
case 'queryHouse':
|
|
28
|
+
return md.queryHouse(input[0]);
|
|
14
29
|
case 'types':
|
|
15
30
|
return md.types(input[0]);
|
|
16
31
|
case 'save':
|
|
17
32
|
return md.save(input[0], input[1], writtenBy);
|
|
33
|
+
case 'saveParts':
|
|
34
|
+
return md.saveParts(input[0], input[1], writtenBy);
|
|
18
35
|
case 'history':
|
|
19
36
|
return md.history(input[0], input[1], input[2]);
|
|
37
|
+
case 'resolve':
|
|
38
|
+
return md.resolve(input[0], input[1], input[2]);
|
|
20
39
|
case 'binaryFile.read':
|
|
21
40
|
return md.binaryFile.read(input[0], input[1], input[2]);
|
|
22
|
-
case 'binaryFile.
|
|
23
|
-
return md.binaryFile.
|
|
41
|
+
case 'binaryFile.link':
|
|
42
|
+
return md.binaryFile.link(input[0], input[1], input[2]);
|
|
43
|
+
case 'binaryFile.show':
|
|
44
|
+
return md.binaryFile.show(input[0], input[1], input[2]);
|
|
45
|
+
case 'binaryFile.attach':
|
|
46
|
+
return md.binaryFile.attach(input[0], input[1]);
|
|
47
|
+
case 'binaryFile.part':
|
|
48
|
+
return md.binaryFile.part(input[0], input[1]);
|
|
24
49
|
case 'call':
|
|
25
50
|
return md.call(input[0], input[1]);
|
|
51
|
+
case 'answered':
|
|
52
|
+
return md.answered(input[0]);
|
|
26
53
|
case 'reached':
|
|
27
54
|
return md.reached(input[0], input[1], input[2]);
|
|
28
|
-
case '
|
|
29
|
-
return md.
|
|
55
|
+
case 'cleanUp':
|
|
56
|
+
return md.cleanUp();
|
|
57
|
+
case 'unsent':
|
|
58
|
+
return md.unsent();
|
|
59
|
+
case 'sent':
|
|
60
|
+
return md.sent();
|
|
61
|
+
case 'reset':
|
|
62
|
+
return md.reset();
|
|
63
|
+
case 'readAgain':
|
|
64
|
+
return md.readAgain();
|
|
30
65
|
case 'persistence':
|
|
31
66
|
return md.persistence();
|
|
32
67
|
case 'retry':
|
|
@@ -38,13 +73,15 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
38
73
|
case 'roomDraft.read':
|
|
39
74
|
return md.roomDraft.read(input[0], input[1]);
|
|
40
75
|
case 'roomDraft.write':
|
|
41
|
-
return md.roomDraft.write(input[0], input[1], input[2], input[3]);
|
|
76
|
+
return md.roomDraft.write(input[0], input[1], input[2], input[3], input[4]);
|
|
42
77
|
case 'roomDraft.discard':
|
|
43
78
|
return md.roomDraft.discard(input[0], input[1], input[2]);
|
|
44
79
|
case 'presentation.read':
|
|
45
80
|
return md.presentation.read(app);
|
|
46
81
|
case 'presentation.write':
|
|
47
82
|
return md.presentation.write(app, input[0]);
|
|
83
|
+
case 'presentation.edit':
|
|
84
|
+
return md.presentation.edit(app, input[0]);
|
|
48
85
|
case 'conversation.list':
|
|
49
86
|
return md.conversation.list();
|
|
50
87
|
case 'conversation.read':
|
|
@@ -54,21 +91,56 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
54
91
|
case 'conversation.send':
|
|
55
92
|
return md.conversation.send(input[0], input[1], input[2]);
|
|
56
93
|
case 'conversation.answer':
|
|
57
|
-
return md.conversation.answer(input[0], input[1]);
|
|
94
|
+
return md.conversation.answer(input[0], input[1], input[2]);
|
|
58
95
|
case 'conversation.interrupt':
|
|
59
|
-
return md.conversation.interrupt(input[0]);
|
|
96
|
+
return md.conversation.interrupt(input[0], input[1]);
|
|
60
97
|
case 'conversation.kill':
|
|
61
|
-
return md.conversation.kill(input[0]);
|
|
62
|
-
case 'conversation.cancel':
|
|
63
|
-
return md.conversation.cancel(input[0], input[1]);
|
|
98
|
+
return md.conversation.kill(input[0], input[1]);
|
|
64
99
|
case 'conversation.delete':
|
|
65
|
-
return md.conversation.delete(input[0]);
|
|
100
|
+
return md.conversation.delete(input[0], input[1]);
|
|
101
|
+
case 'conversation.takeOut':
|
|
102
|
+
return md.conversation.takeOut(input[0], input[1], input[2]);
|
|
103
|
+
case 'conversation.decide':
|
|
104
|
+
return md.conversation.decide(input[0], input[1], input[2]);
|
|
105
|
+
case 'conversation.rename':
|
|
106
|
+
return md.conversation.rename(input[0], input[1], input[2]);
|
|
107
|
+
case 'conversation.option':
|
|
108
|
+
return md.conversation.option(input[0], input[1], input[2], input[3]);
|
|
109
|
+
case 'conversation.retry':
|
|
110
|
+
return md.conversation.retry(input[0], input[1], input[2]);
|
|
111
|
+
case 'conversation.pin':
|
|
112
|
+
return md.conversation.pin(input[0]);
|
|
113
|
+
case 'conversation.openTurn':
|
|
114
|
+
return md.conversation.openTurn(input[0], input[1]);
|
|
115
|
+
case 'conversation.dismissSuggestion':
|
|
116
|
+
return md.conversation.dismissSuggestion(input[0], input[1]);
|
|
117
|
+
case 'conversation.attach':
|
|
118
|
+
return md.conversation.attach(input[0]);
|
|
119
|
+
case 'conversation.attachment':
|
|
120
|
+
return md.conversation.attachment(input[0]);
|
|
66
121
|
case 'chatDraft.write':
|
|
67
122
|
return md.chatDraft.write(input[0], input[1], input[2]);
|
|
123
|
+
case 'chatDraft.prepend':
|
|
124
|
+
return md.chatDraft.prepend(input[0], input[1]);
|
|
125
|
+
case 'chatDraft.append':
|
|
126
|
+
return md.chatDraft.append(input[0], input[1]);
|
|
68
127
|
case 'chatDraft.discard':
|
|
69
128
|
return md.chatDraft.discard(input[0]);
|
|
70
129
|
}
|
|
71
130
|
}
|
|
131
|
+
function attempted(work) {
|
|
132
|
+
try {
|
|
133
|
+
return Promise.resolve(work());
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
return Promise.reject(error);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function answeredMessage(value) {
|
|
140
|
+
if (typeof value !== 'object' || value === null)
|
|
141
|
+
return false;
|
|
142
|
+
return 'result' in value ? answeredResult(value.result) : !('pending' in value);
|
|
143
|
+
}
|
|
72
144
|
export function serveMdRuntime(options) {
|
|
73
145
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
74
146
|
const closing = new AbortController();
|
|
@@ -82,18 +154,31 @@ export function serveMdRuntime(options) {
|
|
|
82
154
|
const { md } = runtime;
|
|
83
155
|
const attachments = new Map();
|
|
84
156
|
let authorized = true;
|
|
157
|
+
let opening = null;
|
|
158
|
+
const opened = () => (opening ??= untilAnswered(() => md.loaded(), closing.signal, () => true, options.recovery));
|
|
85
159
|
const watchFacts = (deliver) => {
|
|
86
160
|
deliver(structuredClone(deploymentFacts));
|
|
87
161
|
return () => { };
|
|
88
162
|
};
|
|
89
|
-
function attach(port,
|
|
163
|
+
function attach(port, options) {
|
|
90
164
|
if (!authorized)
|
|
91
165
|
throw new Error(AUTHORIZATION_ENDED);
|
|
166
|
+
const { app, release, reach, admission, code = 'stored', first = null } = options;
|
|
92
167
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
93
|
-
const view = runtime.within(reach ?? null, { target: app, code,
|
|
168
|
+
const view = runtime.within(reach ?? null, { target: app, code, first, inboxed: null });
|
|
94
169
|
const observations = new Map();
|
|
95
170
|
const followed = new Set();
|
|
171
|
+
const answeredKeys = new Set();
|
|
172
|
+
let awaited = null;
|
|
96
173
|
let serving = true;
|
|
174
|
+
const answeredQuery = (query) => {
|
|
175
|
+
answeredKeys.add(queryKey(query));
|
|
176
|
+
if (awaited === null || !awaited.keys.every((key) => answeredKeys.has(key)))
|
|
177
|
+
return;
|
|
178
|
+
const { done } = awaited;
|
|
179
|
+
awaited = null;
|
|
180
|
+
done();
|
|
181
|
+
};
|
|
97
182
|
const send = (message) => {
|
|
98
183
|
port.postMessage(message);
|
|
99
184
|
};
|
|
@@ -106,6 +191,7 @@ export function serveMdRuntime(options) {
|
|
|
106
191
|
observations.clear();
|
|
107
192
|
for (const end of [...followed])
|
|
108
193
|
end();
|
|
194
|
+
view.close();
|
|
109
195
|
attachments.delete(detach);
|
|
110
196
|
};
|
|
111
197
|
const observe = (id, topic, input) => {
|
|
@@ -115,11 +201,43 @@ export function serveMdRuntime(options) {
|
|
|
115
201
|
return;
|
|
116
202
|
send(resolved ? { kind: 'event', id, value } : { kind: 'result', id, value });
|
|
117
203
|
resolved = true;
|
|
204
|
+
if (topic === 'query' && answeredMessage(value))
|
|
205
|
+
answeredQuery(input[0]);
|
|
206
|
+
};
|
|
207
|
+
const fail = (error) => {
|
|
208
|
+
if (!serving || resolved)
|
|
209
|
+
return;
|
|
210
|
+
observations.get(id)?.();
|
|
211
|
+
observations.delete(id);
|
|
212
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
118
213
|
};
|
|
119
214
|
observations.set(id, topic === 'deployment-facts'
|
|
120
215
|
? watchFacts(deliver)
|
|
121
|
-
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver));
|
|
216
|
+
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver, fail));
|
|
217
|
+
};
|
|
218
|
+
const reply = async (id, query, pending) => {
|
|
219
|
+
try {
|
|
220
|
+
const value = await pending;
|
|
221
|
+
if (!serving)
|
|
222
|
+
return;
|
|
223
|
+
send({ kind: 'result', id, value });
|
|
224
|
+
if (query !== undefined && answeredResult(value))
|
|
225
|
+
answeredQuery(query);
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
if (serving)
|
|
229
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
230
|
+
}
|
|
122
231
|
};
|
|
232
|
+
const admitted = admission === undefined
|
|
233
|
+
? view.md
|
|
234
|
+
: {
|
|
235
|
+
...view.md,
|
|
236
|
+
async call(name, input) {
|
|
237
|
+
const decided = await admission(name, input);
|
|
238
|
+
return 'refused' in decided ? decided.refused : view.md.call(name, decided.admitted);
|
|
239
|
+
},
|
|
240
|
+
};
|
|
123
241
|
const serve = async (message) => {
|
|
124
242
|
if (message.kind === 'hello')
|
|
125
243
|
return;
|
|
@@ -129,26 +247,31 @@ export function serveMdRuntime(options) {
|
|
|
129
247
|
return;
|
|
130
248
|
}
|
|
131
249
|
try {
|
|
132
|
-
if (message.kind
|
|
250
|
+
if (message.kind === 'observe') {
|
|
251
|
+
if (!UNWAITED_TOPICS.has(message.topic))
|
|
252
|
+
await opened();
|
|
253
|
+
}
|
|
254
|
+
else if (!UNWAITED_MEMBERS.has(message.member))
|
|
133
255
|
await md.loaded();
|
|
134
256
|
if (message.kind === 'observe') {
|
|
135
257
|
if (serving)
|
|
136
258
|
observe(message.id, message.topic, message.input);
|
|
137
259
|
return;
|
|
138
260
|
}
|
|
139
|
-
const value = await answered(NARROWED.has(WIRE.members[message.member].reach) ? view.md : md, app, writtenBy, message.member, message.input);
|
|
140
|
-
if (serving)
|
|
141
|
-
send({ kind: 'result', id: message.id, value });
|
|
142
261
|
}
|
|
143
262
|
catch (error) {
|
|
144
263
|
if (serving)
|
|
145
264
|
send({ kind: 'failure', id: message.id, ...described(error) });
|
|
265
|
+
return;
|
|
146
266
|
}
|
|
267
|
+
const { id, member, input } = message;
|
|
268
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
269
|
+
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
147
270
|
};
|
|
148
271
|
port.addEventListener('message', (event) => {
|
|
149
272
|
if (!serving)
|
|
150
273
|
return;
|
|
151
|
-
const message =
|
|
274
|
+
const message = wireRequest(event.data);
|
|
152
275
|
if (message === null)
|
|
153
276
|
return;
|
|
154
277
|
void serve(message);
|
|
@@ -162,17 +285,32 @@ export function serveMdRuntime(options) {
|
|
|
162
285
|
if (serving)
|
|
163
286
|
view.narrow(next);
|
|
164
287
|
},
|
|
165
|
-
code(next
|
|
288
|
+
code(next) {
|
|
166
289
|
if (serving)
|
|
167
|
-
view.
|
|
290
|
+
view.code(next);
|
|
291
|
+
},
|
|
292
|
+
answered(queries, done) {
|
|
293
|
+
const keys = queries.map(queryKey);
|
|
294
|
+
if (keys.every((key) => answeredKeys.has(key)))
|
|
295
|
+
done();
|
|
296
|
+
else
|
|
297
|
+
awaited = { keys, done };
|
|
168
298
|
},
|
|
169
299
|
readiness(deliver) {
|
|
170
300
|
if (!serving)
|
|
171
301
|
return () => { };
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
302
|
+
let shown = null;
|
|
303
|
+
const stop = view.watch('readiness', [], (message) => {
|
|
304
|
+
if (!serving)
|
|
305
|
+
return;
|
|
306
|
+
if (shown !== null) {
|
|
307
|
+
shown.receive(message);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
shown = observed(message, () => { }, 'readiness');
|
|
311
|
+
shown.observation.subscribe((value) => deliver(value));
|
|
312
|
+
deliver(shown.observation.current());
|
|
313
|
+
}, () => { });
|
|
176
314
|
const end = () => {
|
|
177
315
|
followed.delete(end);
|
|
178
316
|
stop();
|
|
@@ -184,8 +322,11 @@ export function serveMdRuntime(options) {
|
|
|
184
322
|
}
|
|
185
323
|
return {
|
|
186
324
|
attach,
|
|
187
|
-
|
|
188
|
-
|
|
325
|
+
present(app, members) {
|
|
326
|
+
return md.presentation.edit(app, members);
|
|
327
|
+
},
|
|
328
|
+
seed(entry) {
|
|
329
|
+
runtime.seed(entry);
|
|
189
330
|
},
|
|
190
331
|
persisted(answer) {
|
|
191
332
|
runtime.persisted(answer);
|
|
@@ -197,16 +338,17 @@ export function serveMdRuntime(options) {
|
|
|
197
338
|
detach();
|
|
198
339
|
}
|
|
199
340
|
close();
|
|
200
|
-
if (!(await
|
|
341
|
+
if (!(await options.database.ask({ kind: 'authored.end', holder: holder ?? null }))) {
|
|
201
342
|
await options.shell.dropGeneration();
|
|
202
|
-
|
|
203
|
-
lose(locators) {
|
|
204
|
-
return runtime.lose(locators);
|
|
343
|
+
}
|
|
205
344
|
},
|
|
206
345
|
stop() {
|
|
207
346
|
return runtime.stop();
|
|
208
347
|
},
|
|
209
348
|
};
|
|
210
349
|
}
|
|
350
|
+
export { entrySeedOf } from './seed.js';
|
|
211
351
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
212
|
-
export {
|
|
352
|
+
export { replaces } from './observation.js';
|
|
353
|
+
export { undeclared } from './outcome.js';
|
|
354
|
+
export { wireAnswer, wireRequest, } from './wire.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DocumentQuery, type GroupQuery } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { HouseQueryGroups, HouseQueryRows, ProviderRefusal } from './adapter.js';
|
|
3
|
+
import { type Failure, type Offline } from './outcome.js';
|
|
4
|
+
import { type PortReach } from './reach.js';
|
|
5
|
+
import type { Runtime } from './runtime.js';
|
|
6
|
+
export type HouseQuery = (DocumentQuery | GroupQuery) & {
|
|
7
|
+
rooms: readonly [string];
|
|
8
|
+
};
|
|
9
|
+
export type HouseQueryResult = HouseQueryRows | HouseQueryGroups | Offline | (ProviderRefusal & {
|
|
10
|
+
kind: 'rejected';
|
|
11
|
+
}) | (ProviderRefusal & {
|
|
12
|
+
kind: 'undeclared';
|
|
13
|
+
}) | Failure;
|
|
14
|
+
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null): Promise<HouseQueryResult>;
|
|
15
|
+
//# sourceMappingURL=house-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"house-query.d.ts","sourceRoot":"","sources":["../src/house-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAA2C,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACxC,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAC1C,OAAO,CAAC;AAqBZ,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,GAAG,IAAI,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { invalid, plain } from '@agentshouse/mdmodel';
|
|
2
|
+
import { listedOrHeld } from './listing.js';
|
|
3
|
+
import { failure, OFFLINE, UNCERTAIN, undeclared } from './outcome.js';
|
|
4
|
+
import { askedOnline, offline } from './online.js';
|
|
5
|
+
import { holds, queriedOnly } from './reach.js';
|
|
6
|
+
const HELD_ON_DEVICE = {
|
|
7
|
+
kind: 'rejected',
|
|
8
|
+
code: 'held-on-device',
|
|
9
|
+
fields: {},
|
|
10
|
+
retryable: false,
|
|
11
|
+
};
|
|
12
|
+
function houseQueryOf(input) {
|
|
13
|
+
if (!plain(input))
|
|
14
|
+
invalid('query', 'expects a query object');
|
|
15
|
+
const { rooms, ...query } = input;
|
|
16
|
+
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
17
|
+
invalid('rooms', 'names the one Room House answers');
|
|
18
|
+
return { room: rooms[0], query };
|
|
19
|
+
}
|
|
20
|
+
async function heldHere(runtime, reach, room) {
|
|
21
|
+
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
22
|
+
}
|
|
23
|
+
export async function queriedHouse(runtime, input, reach) {
|
|
24
|
+
const { socket } = runtime;
|
|
25
|
+
const asked = houseQueryOf(input);
|
|
26
|
+
await socket.ready;
|
|
27
|
+
const query = socket.queryHouse();
|
|
28
|
+
if (query === undefined)
|
|
29
|
+
return undeclared('queryHouse');
|
|
30
|
+
if (!queriedOnly(reach, socket.session.now().queriesOnly, asked.room)) {
|
|
31
|
+
return (await heldHere(runtime, reach, asked.room))
|
|
32
|
+
? HELD_ON_DEVICE
|
|
33
|
+
: failure({ kind: 'room-not-readable', locator: asked.room });
|
|
34
|
+
}
|
|
35
|
+
if (await offline(runtime))
|
|
36
|
+
return OFFLINE;
|
|
37
|
+
const answer = await askedOnline(runtime, (authorization) => query(authorization, asked));
|
|
38
|
+
if (answer === null)
|
|
39
|
+
return UNCERTAIN;
|
|
40
|
+
return answer.kind === 'rows' || answer.kind === 'groups' || answer.kind === 'rejected'
|
|
41
|
+
? answer
|
|
42
|
+
: failure(answer);
|
|
43
|
+
}
|
package/dist/identity.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export declare function changeBatchIdentity(at?: number): string;
|
|
2
|
-
export declare function identityTime(identity: string): number;
|
|
3
2
|
export declare function roomDraftRevision(): string;
|
|
4
3
|
export declare function chatDraftRevision(): string;
|
|
5
4
|
export declare function transferIdentity(): string;
|
|
6
|
-
export declare function indexGeneration(): string;
|
|
7
5
|
export declare function binaryLocalId(): string;
|
|
8
6
|
//# sourceMappingURL=identity.d.ts.map
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;AAQD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
package/dist/identity.js
CHANGED
|
@@ -10,9 +10,6 @@ export function changeBatchIdentity(at = Date.now()) {
|
|
|
10
10
|
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
11
11
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
12
12
|
}
|
|
13
|
-
export function identityTime(identity) {
|
|
14
|
-
return Number.parseInt(identity.replaceAll('-', '').slice(0, 12), 16);
|
|
15
|
-
}
|
|
16
13
|
function randomIdentity() {
|
|
17
14
|
const bytes = new Uint8Array(16);
|
|
18
15
|
crypto.getRandomValues(bytes);
|
|
@@ -27,9 +24,6 @@ export function chatDraftRevision() {
|
|
|
27
24
|
export function transferIdentity() {
|
|
28
25
|
return randomIdentity();
|
|
29
26
|
}
|
|
30
|
-
export function indexGeneration() {
|
|
31
|
-
return randomIdentity();
|
|
32
|
-
}
|
|
33
27
|
export function binaryLocalId() {
|
|
34
28
|
return randomIdentity();
|
|
35
29
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { Change, ChangeBatch, Precondition, WrittenBy } from './change.js';
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, HouseQueryAnswer, HouseQueryAsk, HouseQueryGroups, HouseQueryRows, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
|
+
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
|
+
export { heldFacts } from './conversation-row.js';
|
|
4
|
+
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
5
|
+
export type { ChatDraft, ChatDraftSurface, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationRead, ConversationState, ConversationSurface, ConversationView, RequestDecision, RunningTurn, } from './conversation.js';
|
|
6
|
+
export type { MdRuntimeOptions } from './connection.js';
|
|
7
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
8
|
+
export { writeRule, type WriteRefusal } from './declaration.js';
|
|
9
|
+
export type { HistoryQuery } from './actions.js';
|
|
10
|
+
export type { AppRoom, AppTypedSelection } from './listing.js';
|
|
11
|
+
export type { ConnectionRefusal, ConnectionRefusalCode } from './socket.js';
|
|
12
|
+
export type { MdRuntime, RoomSchemas } from './surface.js';
|
|
13
|
+
export type { BinaryFileSurface, SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
6
14
|
export type { Observation } from './observation.js';
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
15
|
+
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
16
|
+
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
17
|
+
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
18
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, ConversationAttachAnswer, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
19
|
+
export { blobOf, declaredType } from './outcome.js';
|
|
20
|
+
export type { BinaryFileRecord } from './binary.js';
|
|
9
21
|
export type { RuntimeError } from './failure.js';
|
|
10
|
-
export
|
|
22
|
+
export { refusalError } from './failure.js';
|
|
23
|
+
export type { ChangedPart, FieldValue, Marks, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
11
24
|
export type { SaveRefusal } from './save.js';
|
|
12
|
-
export type {
|
|
25
|
+
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
26
|
+
export type { HouseQuery, HouseQueryResult } from './house-query.js';
|
|
27
|
+
export { keptFile, keptLines } from './chat-types.js';
|
|
28
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
13
29
|
export { departure } from './change.js';
|
|
14
|
-
export {
|
|
30
|
+
export { definitionsIn, selected } from './collection.js';
|
|
31
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
32
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
33
|
+
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
34
|
+
export { contextFigure } from './context.js';
|
|
35
|
+
export { runningWords } from './running.js';
|
|
36
|
+
export { turnLine, WORKING } from './parts.js';
|
|
15
37
|
export { changeBatchIdentity } from './identity.js';
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
19
|
-
export
|
|
38
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
39
|
+
export { authoredAt, covered } from './paths.js';
|
|
40
|
+
export { untilAnswered } from './recovery.js';
|
|
41
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, type RetriedFailure, type Retries, type Step, } from './retried.js';
|
|
42
|
+
export { patching } from './shared.js';
|
|
43
|
+
export { acting, type Acting, type ActingRules, type Ended, type Lane, type LaneShown, type Send, } from './act-lanes.js';
|
|
44
|
+
export { expectation, expecting, type Descriptor, type Expectation, type Expected, type Expecting, } from './expectation.js';
|
|
45
|
+
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
46
|
+
export { leftToSend } from './durability.js';
|
|
47
|
+
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
48
|
+
export type { ObservedRead } from './reads.js';
|
|
20
49
|
export type { AttentionEntry, SyncStatus } from './status.js';
|
|
21
|
-
export type {
|
|
50
|
+
export type { Direction, DocumentQuery, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, Key, LocalQuery, OrderOptions, Predicate, Related, Select, Value, Where, } from '@agentshouse/mdmodel';
|
|
51
|
+
export type { Awaits, Backlink, CoveredRoom, DocumentResult, GroupResult, GroupTotal, PendingResult, PendingRoom, QueryCoverage, QueryDocument, QueryGroup, QueryResult, QueryRows, } from './query.js';
|
|
22
52
|
export type { MdType, ModelIdentity, ModelSnapshot, ModelState, ModelResult, TypesResult, ValidationReceipt, } from './model.js';
|
|
23
53
|
export type { OperationScopes, ReplicaAdmission, ScopedRefusal } from './adapter.js';
|
|
24
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAA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Ae,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
3
|
+
export { writeRule } from './declaration.js';
|
|
4
|
+
export { blobOf, declaredType } from './outcome.js';
|
|
5
|
+
export { refusalError } from './failure.js';
|
|
6
|
+
export { keptFile, keptLines } from './chat-types.js';
|
|
7
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
1
8
|
export { departure } from './change.js';
|
|
2
|
-
export {
|
|
9
|
+
export { definitionsIn, selected } from './collection.js';
|
|
10
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
11
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
12
|
+
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
13
|
+
export { contextFigure } from './context.js';
|
|
14
|
+
export { runningWords } from './running.js';
|
|
15
|
+
export { turnLine, WORKING } from './parts.js';
|
|
3
16
|
export { changeBatchIdentity } from './identity.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
17
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
18
|
+
export { authoredAt, covered } from './paths.js';
|
|
19
|
+
export { untilAnswered } from './recovery.js';
|
|
20
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, } from './retried.js';
|
|
21
|
+
export { patching } from './shared.js';
|
|
22
|
+
export { acting, } from './act-lanes.js';
|
|
23
|
+
export { expectation, expecting, } from './expectation.js';
|
|
24
|
+
export { leftToSend } from './durability.js';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AdapterFailure, Authorization, DiscoveredRoom, NotReady, RetryableRefusal } from './adapter.js';
|
|
2
|
+
import { type Reads } from './bootstrap.js';
|
|
3
|
+
import type { Installation, InstallationAmount, RoomCoverage } from './readiness.js';
|
|
4
|
+
import { advancement, type Refresher } from './refresh.js';
|
|
5
|
+
import type { ReplicaRecord } from './replica.js';
|
|
6
|
+
import type { Runtime } from './runtime.js';
|
|
7
|
+
import type { Live } from './socket.js';
|
|
8
|
+
import { type CoveredRoom, type InstallHold, type RuntimeStore, type Store } from './store.js';
|
|
9
|
+
import { type Unconfirmed } from './transfer.js';
|
|
10
|
+
type Standing = {
|
|
11
|
+
readonly key: number | null;
|
|
12
|
+
readonly confirmed: number;
|
|
13
|
+
};
|
|
14
|
+
export type Unheld = {
|
|
15
|
+
readonly staged: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type Withheld = AdapterFailure | RetryableRefusal | NotReady | Unconfirmed;
|
|
18
|
+
type Landing = {
|
|
19
|
+
readonly kind: 'refreshed';
|
|
20
|
+
readonly from: Standing;
|
|
21
|
+
readonly remodelled: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: 'bootstrapped';
|
|
24
|
+
readonly refreshed: boolean;
|
|
25
|
+
readonly from: Standing;
|
|
26
|
+
};
|
|
27
|
+
type Refreshed = {
|
|
28
|
+
kind: 'advanced';
|
|
29
|
+
record: ReplicaRecord;
|
|
30
|
+
from: Standing;
|
|
31
|
+
remodelled: boolean;
|
|
32
|
+
} | Exclude<Awaited<ReturnType<typeof advancement>>, {
|
|
33
|
+
kind: 'advanced';
|
|
34
|
+
}>;
|
|
35
|
+
export declare const ERASE_BATCH = 512;
|
|
36
|
+
export type InstallShare = {
|
|
37
|
+
readonly installing: boolean;
|
|
38
|
+
readonly downloading: boolean;
|
|
39
|
+
readonly bytes: InstallationAmount;
|
|
40
|
+
};
|
|
41
|
+
export declare function installShare(store: Store, { room, state }: RoomCoverage, held: ReadonlyMap<string, CoveredRoom>): InstallShare;
|
|
42
|
+
export declare function installationOf(installing: number, downloading: number, bytes: InstallationAmount): Installation;
|
|
43
|
+
export declare function roomInFlight(store: Store, locator: string): boolean;
|
|
44
|
+
export declare function sweep({ store, socket }: Runtime): void;
|
|
45
|
+
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
|
46
|
+
export declare function catching(store: Store, locator: string): void;
|
|
47
|
+
export declare function standingAt(store: Store, locator: string, held: Pick<ReplicaRecord, 'key'> | undefined): Standing;
|
|
48
|
+
export declare function showing(system: Runtime, locator: string, roomVersion: string, held: string | undefined): void;
|
|
49
|
+
export declare function olderThan(system: Runtime, locator: string, roomVersion: string, held: string | undefined): boolean;
|
|
50
|
+
export declare function replaced(store: Store, locators: readonly string[]): void;
|
|
51
|
+
export declare function reachedBy({ store, socket }: Runtime, locator: string, roomVersion: string): Promise<boolean>;
|
|
52
|
+
export declare function behind({ store, socket }: Runtime, room: DiscoveredRoom): Promise<boolean>;
|
|
53
|
+
export declare function writtenAfter({ store, socket }: Runtime, locator: string, roomVersion: string, path: string): Promise<boolean>;
|
|
54
|
+
export declare function pullRefresh(runtime: Runtime, authorized: Authorization, record: ReplicaRecord, liveness: Live, hold: InstallHold, refresh: Refresher): Promise<Refreshed>;
|
|
55
|
+
export declare function pullBootstrap(runtime: Runtime, authorized: Authorization, room: DiscoveredRoom, local: RuntimeStore, liveness: Live, prior: ReplicaRecord | undefined, from?: Reads, unheld?: Unheld): Promise<import("./bootstrap.js").Bootstrapped | NotReady | import("./adapter.js").RevokedAuthorization | import("./adapter.js").RoomNotReadable | import("./adapter.js").TransportUncertainty | Unconfirmed | {
|
|
56
|
+
readonly kind: 'transport-uncertainty';
|
|
57
|
+
} | RetryableRefusal | import("./adapter.js").ScopedRefusal>;
|
|
58
|
+
export declare function publish(runtime: Runtime, local: RuntimeStore, room: DiscoveredRoom, reached: ReplicaRecord, landing: Landing, live: Live): Promise<boolean>;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=install.d.ts.map
|