@agentshouse/mdruntime 0.1.0-c94cfdbdb6f68 → 0.1.0-c95dc33df5c05
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 +19 -16
- package/dist/acceptance.d.ts +6 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +389 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +250 -0
- package/dist/adapter.d.ts +140 -85
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +7 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +40 -41
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +30 -11
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +319 -111
- 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 +9 -16
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -89
- package/dist/change.d.ts +32 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +10 -1
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +30 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +83 -7
- package/dist/collection.d.ts +11 -21
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +39 -321
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +717 -0
- package/dist/connection.d.ts +7 -137
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +98 -3600
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +1 -4
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +53 -0
- package/dist/conversation.d.ts +37 -18
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +573 -287
- 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 +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/durability.d.ts +16 -4
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +5 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +33 -29
- package/dist/figures.d.ts +48 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -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 +4 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +67 -39
- 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 +31 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/install.d.ts +56 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +560 -0
- package/dist/job.d.ts +33 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +54 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +267 -0
- package/dist/listing.d.ts +53 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +175 -0
- package/dist/live.d.ts +23 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +165 -0
- package/dist/locks.d.ts +9 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +61 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +61 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +14 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +237 -105
- package/dist/messages.d.ts +52 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +168 -0
- package/dist/model.d.ts +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -18
- package/dist/models.d.ts +14 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +193 -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 +15 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +91 -2
- 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 +56 -0
- package/dist/outcome.d.ts +44 -9
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +41 -2
- package/dist/overlay.d.ts +3 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +98 -172
- package/dist/{chat/parts.d.ts → parts.d.ts} +11 -9
- package/dist/parts.d.ts.map +1 -0
- package/dist/{chat/parts.js → parts.js} +45 -46
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +226 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +272 -0
- package/dist/query.d.ts +21 -206
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -493
- package/dist/{chat/questions.d.ts → questions.d.ts} +5 -2
- package/dist/questions.d.ts.map +1 -0
- package/dist/{chat/questions.js → questions.js} +12 -1
- package/dist/reach.d.ts +20 -9
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +278 -103
- package/dist/react.d.ts +10 -2
- package/dist/react.d.ts.map +1 -1
- 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 +14 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -8
- package/dist/reads.d.ts +35 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +136 -84
- package/dist/recovery.d.ts +3 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +43 -8
- package/dist/refresh.d.ts +18 -15
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +143 -58
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +56 -0
- package/dist/replica.d.ts +54 -36
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +313 -188
- package/dist/room-draft.d.ts +25 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +158 -71
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +216 -0
- package/dist/rows.d.ts +31 -31
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +59 -123
- package/dist/runtime.d.ts +42 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +52 -14
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +518 -185
- package/dist/saves.d.ts +70 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +1004 -0
- package/dist/search.d.ts +12 -95
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -266
- package/dist/seed.d.ts +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -0
- package/dist/shared.d.ts +7 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +119 -66
- package/dist/shown.d.ts +31 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +294 -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 +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -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/rooms.d.ts +43 -0
- package/dist/socket/rooms.d.ts.map +1 -0
- package/dist/socket/rooms.js +90 -0
- package/dist/socket/session.d.ts +39 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +70 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +175 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +81 -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/fences.d.ts +16 -0
- package/dist/store/fences.d.ts.map +1 -0
- package/dist/store/fences.js +26 -0
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +408 -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/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +43 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +57 -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 +106 -164
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +136 -752
- package/dist/stored.d.ts +156 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +637 -0
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +222 -0
- package/dist/sync.d.ts +20 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +531 -0
- package/dist/tables.d.ts +415 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +740 -0
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +4 -2
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +46 -22
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +104 -0
- package/dist/windows.d.ts +1 -16
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -79
- package/dist/wire.d.ts +34 -6
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +12 -2
- package/package.json +18 -19
- package/AGENTS.md +0 -299
- 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/earlier.d.ts +0 -10
- package/dist/chat/earlier.d.ts.map +0 -1
- package/dist/chat/earlier.js +0 -54
- 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 -99
- 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.map +0 -1
- 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 -628
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -69
- 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/read-side.d.ts +0 -27
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -824
package/dist/host.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { queryKey } from '@agentshouse/mdmodel';
|
|
2
|
+
import { composeRuntime } from './connection.js';
|
|
3
|
+
import { untilAnswered } from './recovery.js';
|
|
3
4
|
import { described } from './failure.js';
|
|
4
|
-
import {
|
|
5
|
+
import { answeredResult } from './outcome.js';
|
|
5
6
|
import { AUTHORIZATION_ENDED, request, WIRE, } from './wire.js';
|
|
6
7
|
const NARROWED = new Set(['within', 'whole']);
|
|
7
8
|
function answered(md, app, writtenBy, member, input) {
|
|
@@ -20,18 +21,32 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
20
21
|
return md.saveParts(input[0], input[1], writtenBy);
|
|
21
22
|
case 'history':
|
|
22
23
|
return md.history(input[0], input[1], input[2]);
|
|
24
|
+
case 'resolve':
|
|
25
|
+
return md.resolve(input[0], input[1], input[2]);
|
|
23
26
|
case 'binaryFile.read':
|
|
24
27
|
return md.binaryFile.read(input[0], input[1], input[2]);
|
|
25
28
|
case 'binaryFile.link':
|
|
26
29
|
return md.binaryFile.link(input[0], input[1], input[2]);
|
|
27
|
-
case 'binaryFile.
|
|
28
|
-
return md.binaryFile.
|
|
30
|
+
case 'binaryFile.show':
|
|
31
|
+
return md.binaryFile.show(input[0], input[1], input[2]);
|
|
32
|
+
case 'binaryFile.attach':
|
|
33
|
+
return md.binaryFile.attach(input[0], input[1]);
|
|
34
|
+
case 'binaryFile.part':
|
|
35
|
+
return md.binaryFile.part(input[0], input[1]);
|
|
29
36
|
case 'call':
|
|
30
37
|
return md.call(input[0], input[1]);
|
|
31
38
|
case 'reached':
|
|
32
39
|
return md.reached(input[0], input[1], input[2]);
|
|
33
40
|
case 'log':
|
|
34
41
|
return md.log();
|
|
42
|
+
case 'cleanUp':
|
|
43
|
+
return md.cleanUp();
|
|
44
|
+
case 'unsent':
|
|
45
|
+
return md.unsent();
|
|
46
|
+
case 'reset':
|
|
47
|
+
return md.reset();
|
|
48
|
+
case 'readAgain':
|
|
49
|
+
return md.readAgain();
|
|
35
50
|
case 'persistence':
|
|
36
51
|
return md.persistence();
|
|
37
52
|
case 'retry':
|
|
@@ -43,7 +58,7 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
43
58
|
case 'roomDraft.read':
|
|
44
59
|
return md.roomDraft.read(input[0], input[1]);
|
|
45
60
|
case 'roomDraft.write':
|
|
46
|
-
return md.roomDraft.write(input[0], input[1], input[2], input[3]);
|
|
61
|
+
return md.roomDraft.write(input[0], input[1], input[2], input[3], input[4]);
|
|
47
62
|
case 'roomDraft.discard':
|
|
48
63
|
return md.roomDraft.discard(input[0], input[1], input[2]);
|
|
49
64
|
case 'presentation.read':
|
|
@@ -66,8 +81,6 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
66
81
|
return md.conversation.interrupt(input[0]);
|
|
67
82
|
case 'conversation.kill':
|
|
68
83
|
return md.conversation.kill(input[0]);
|
|
69
|
-
case 'conversation.cancel':
|
|
70
|
-
return md.conversation.cancel(input[0], input[1]);
|
|
71
84
|
case 'conversation.delete':
|
|
72
85
|
return md.conversation.delete(input[0]);
|
|
73
86
|
case 'chatDraft.write':
|
|
@@ -78,8 +91,13 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
78
91
|
return md.chatDraft.discard(input[0]);
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
94
|
+
function attempted(work) {
|
|
95
|
+
try {
|
|
96
|
+
return Promise.resolve(work());
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
return Promise.reject(error);
|
|
100
|
+
}
|
|
83
101
|
}
|
|
84
102
|
function answeredMessage(value) {
|
|
85
103
|
if (typeof value !== 'object' || value === null)
|
|
@@ -99,16 +117,17 @@ export function serveMdRuntime(options) {
|
|
|
99
117
|
const { md } = runtime;
|
|
100
118
|
const attachments = new Map();
|
|
101
119
|
let authorized = true;
|
|
120
|
+
let opening = null;
|
|
121
|
+
const opened = () => (opening ??= untilAnswered(() => md.loaded(), closing.signal));
|
|
102
122
|
const watchFacts = (deliver) => {
|
|
103
123
|
deliver(structuredClone(deploymentFacts));
|
|
104
124
|
return () => { };
|
|
105
125
|
};
|
|
106
|
-
function attach(port, app, release, reach, code = 'stored'
|
|
126
|
+
function attach(port, app, release, reach, code = 'stored') {
|
|
107
127
|
if (!authorized)
|
|
108
128
|
throw new Error(AUTHORIZATION_ENDED);
|
|
109
129
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
110
|
-
|
|
111
|
-
const view = runtime.within(reach ?? null, facts);
|
|
130
|
+
const view = runtime.within(reach ?? null, { target: app, code });
|
|
112
131
|
const observations = new Map();
|
|
113
132
|
const followed = new Set();
|
|
114
133
|
const answeredKeys = new Set();
|
|
@@ -146,9 +165,30 @@ export function serveMdRuntime(options) {
|
|
|
146
165
|
if (topic === 'query' && answeredMessage(value))
|
|
147
166
|
answeredQuery(input[0]);
|
|
148
167
|
};
|
|
168
|
+
const fail = (error) => {
|
|
169
|
+
if (!serving || resolved)
|
|
170
|
+
return;
|
|
171
|
+
observations.get(id)?.();
|
|
172
|
+
observations.delete(id);
|
|
173
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
174
|
+
};
|
|
149
175
|
observations.set(id, topic === 'deployment-facts'
|
|
150
176
|
? watchFacts(deliver)
|
|
151
|
-
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver));
|
|
177
|
+
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver, fail));
|
|
178
|
+
};
|
|
179
|
+
const reply = async (id, query, pending) => {
|
|
180
|
+
try {
|
|
181
|
+
const value = await pending;
|
|
182
|
+
if (!serving)
|
|
183
|
+
return;
|
|
184
|
+
send({ kind: 'result', id, value });
|
|
185
|
+
if (query !== undefined && answeredResult(value))
|
|
186
|
+
answeredQuery(query);
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
if (serving)
|
|
190
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
191
|
+
}
|
|
152
192
|
};
|
|
153
193
|
const serve = async (message) => {
|
|
154
194
|
if (message.kind === 'hello')
|
|
@@ -159,24 +199,24 @@ export function serveMdRuntime(options) {
|
|
|
159
199
|
return;
|
|
160
200
|
}
|
|
161
201
|
try {
|
|
162
|
-
if (message.kind !== 'observe'
|
|
202
|
+
if (message.kind !== 'observe')
|
|
163
203
|
await md.loaded();
|
|
204
|
+
else if (message.topic !== 'room-drafts')
|
|
205
|
+
await opened();
|
|
164
206
|
if (message.kind === 'observe') {
|
|
165
207
|
if (serving)
|
|
166
208
|
observe(message.id, message.topic, message.input);
|
|
167
209
|
return;
|
|
168
210
|
}
|
|
169
|
-
const value = await answered(NARROWED.has(WIRE.members[message.member].reach) ? view.md : md, app, writtenBy, message.member, message.input);
|
|
170
|
-
if (!serving)
|
|
171
|
-
return;
|
|
172
|
-
send({ kind: 'result', id: message.id, value });
|
|
173
|
-
if (message.member === 'query' && answeredResult(value))
|
|
174
|
-
answeredQuery(message.input[0]);
|
|
175
211
|
}
|
|
176
212
|
catch (error) {
|
|
177
213
|
if (serving)
|
|
178
214
|
send({ kind: 'failure', id: message.id, ...described(error) });
|
|
215
|
+
return;
|
|
179
216
|
}
|
|
217
|
+
const { id, member, input } = message;
|
|
218
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? view.md : md, app, writtenBy, member, input));
|
|
219
|
+
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
180
220
|
};
|
|
181
221
|
port.addEventListener('message', (event) => {
|
|
182
222
|
if (!serving)
|
|
@@ -195,18 +235,6 @@ export function serveMdRuntime(options) {
|
|
|
195
235
|
if (serving)
|
|
196
236
|
view.narrow(next);
|
|
197
237
|
},
|
|
198
|
-
code(next, capacity) {
|
|
199
|
-
if (!serving)
|
|
200
|
-
return;
|
|
201
|
-
facts = { ...facts, code: next, capacity };
|
|
202
|
-
view.facts(facts);
|
|
203
|
-
},
|
|
204
|
-
search(next) {
|
|
205
|
-
if (!serving)
|
|
206
|
-
return;
|
|
207
|
-
facts = { ...facts, search: next };
|
|
208
|
-
view.facts(facts);
|
|
209
|
-
},
|
|
210
238
|
answered(queries, done) {
|
|
211
239
|
const keys = queries.map(queryKey);
|
|
212
240
|
if (keys.every((key) => answeredKeys.has(key)))
|
|
@@ -220,7 +248,7 @@ export function serveMdRuntime(options) {
|
|
|
220
248
|
const stop = view.watch('readiness', [], (value) => {
|
|
221
249
|
if (serving)
|
|
222
250
|
deliver(value);
|
|
223
|
-
});
|
|
251
|
+
}, () => { });
|
|
224
252
|
const end = () => {
|
|
225
253
|
followed.delete(end);
|
|
226
254
|
stop();
|
|
@@ -232,6 +260,9 @@ export function serveMdRuntime(options) {
|
|
|
232
260
|
}
|
|
233
261
|
return {
|
|
234
262
|
attach,
|
|
263
|
+
present(app, members) {
|
|
264
|
+
return md.presentation.edit(app, members);
|
|
265
|
+
},
|
|
235
266
|
seed(entry) {
|
|
236
267
|
runtime.seed(entry);
|
|
237
268
|
},
|
|
@@ -245,11 +276,9 @@ export function serveMdRuntime(options) {
|
|
|
245
276
|
detach();
|
|
246
277
|
}
|
|
247
278
|
close();
|
|
248
|
-
if (!(await
|
|
279
|
+
if (!(await options.database.ask({ kind: 'authored.end', holder: holder ?? null }))) {
|
|
249
280
|
await options.shell.dropGeneration();
|
|
250
|
-
|
|
251
|
-
lose(locators) {
|
|
252
|
-
return runtime.lose(locators);
|
|
281
|
+
}
|
|
253
282
|
},
|
|
254
283
|
stop() {
|
|
255
284
|
return runtime.stop();
|
|
@@ -258,4 +287,3 @@ export function serveMdRuntime(options) {
|
|
|
258
287
|
}
|
|
259
288
|
export { entrySeedOf } from './seed.js';
|
|
260
289
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
261
|
-
export { AUTHORED_SCHEMA, authoredBinding, authoredBy, authoredHolder, bindAuthored, openDatabase, STORE_SCHEMA, } from './store.js';
|
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,25 +1,43 @@
|
|
|
1
|
-
export type { AcceptedMessage, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult,
|
|
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, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnContext, 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, RunningTurn, } from './conversation.js';
|
|
6
|
+
export type { MdRuntimeOptions } from './connection.js';
|
|
7
|
+
export type { HistoryQuery } from './actions.js';
|
|
8
|
+
export type { AppRoom, AppTypedSelection } from './listing.js';
|
|
9
|
+
export type { ConnectionRefusal, ConnectionRefusalCode } from './socket.js';
|
|
10
|
+
export type { MdRuntime, RoomSchemas } from './surface.js';
|
|
11
|
+
export type { BinaryFileSurface, SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
6
12
|
export type { Observation } from './observation.js';
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
13
|
+
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
14
|
+
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
15
|
+
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
16
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
17
|
+
export type { BinaryFileRecord } from './binary.js';
|
|
9
18
|
export type { RuntimeError } from './failure.js';
|
|
10
19
|
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
11
20
|
export type { SaveRefusal } from './save.js';
|
|
12
|
-
export type {
|
|
21
|
+
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
22
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
13
23
|
export { departure } from './change.js';
|
|
14
|
-
export { partsAfter } from './room-draft.js';
|
|
15
|
-
export {
|
|
24
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
25
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
26
|
+
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
27
|
+
export { contextFigure } from './context.js';
|
|
28
|
+
export { jobsRunning, openJobs, sessionEnded, type OpenJob, type RunningJob } from './job.js';
|
|
16
29
|
export { changeBatchIdentity } from './identity.js';
|
|
30
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
31
|
+
export { untilAnswered } from './recovery.js';
|
|
32
|
+
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
17
33
|
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
|
18
34
|
export { expectedList, expecting, type ExpectedOf, type Expecting } from './expectation.js';
|
|
19
|
-
export type { RuntimeShell,
|
|
20
|
-
export type {
|
|
35
|
+
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
36
|
+
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
37
|
+
export type { ObservedRead } from './reads.js';
|
|
21
38
|
export type { AttentionEntry, SyncStatus } from './status.js';
|
|
22
|
-
export type {
|
|
39
|
+
export type { Direction, DocumentQuery, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, Key, LocalQuery, OrderOptions, Predicate, Related, Select, Value, Where, } from '@agentshouse/mdmodel';
|
|
40
|
+
export type { Awaits, Backlink, CoveredRoom, DocumentResult, GroupResult, GroupTotal, PendingResult, PendingRoom, QueryCoverage, QueryDocument, QueryGroup, QueryResult, QueryRows, } from './query.js';
|
|
23
41
|
export type { MdType, ModelIdentity, ModelSnapshot, ModelState, ModelResult, TypesResult, ValidationReceipt, } from './model.js';
|
|
24
42
|
export type { OperationScopes, ReplicaAdmission, ScopedRefusal } from './adapter.js';
|
|
25
43
|
//# 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,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cA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M,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
1
3
|
export { departure } from './change.js';
|
|
2
|
-
export { partsAfter } from './room-draft.js';
|
|
3
|
-
export {
|
|
4
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
5
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
6
|
+
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
7
|
+
export { contextFigure } from './context.js';
|
|
8
|
+
export { jobsRunning, openJobs, sessionEnded } from './job.js';
|
|
4
9
|
export { changeBatchIdentity } from './identity.js';
|
|
10
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
11
|
+
export { untilAnswered } from './recovery.js';
|
|
12
|
+
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
5
13
|
export { attempts, identities, intentOf, } from './attempt.js';
|
|
6
14
|
export { expectedList, expecting } from './expectation.js';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AdapterFailure, Authorization, DiscoveredRoom, NotReady, RetryableRefusal } from './adapter.js';
|
|
2
|
+
import { type Reads } from './bootstrap.js';
|
|
3
|
+
import type { Installation, 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 declare function installationOf(store: Store, coverage: readonly RoomCoverage[], held: ReadonlyMap<string, CoveredRoom>): Installation;
|
|
37
|
+
export declare function roomInFlight(store: Store, locator: string): boolean;
|
|
38
|
+
export declare function sweep({ store, socket, journal }: Runtime): void;
|
|
39
|
+
export declare function forgetInstall(store: Store, locator: string): void;
|
|
40
|
+
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
|
41
|
+
export declare function catching(store: Store, locator: string): void;
|
|
42
|
+
export declare function confirmedAgain(store: Store, locator: string): void;
|
|
43
|
+
export declare function standingAt(store: Store, locator: string, held: Pick<ReplicaRecord, 'key'> | undefined): Standing;
|
|
44
|
+
export declare function showing(system: Runtime, locator: string, roomVersion: string, held: string | undefined): void;
|
|
45
|
+
export declare function olderThan(system: Runtime, locator: string, roomVersion: string, held: string | undefined): boolean;
|
|
46
|
+
export declare function replaced(store: Store, locators: readonly string[]): void;
|
|
47
|
+
export declare function reachedBy({ store, socket }: Runtime, locator: string, roomVersion: string): Promise<boolean>;
|
|
48
|
+
export declare function behind({ store, socket }: Runtime, room: DiscoveredRoom): Promise<boolean>;
|
|
49
|
+
export declare function writtenAfter({ store, socket }: Runtime, locator: string, roomVersion: string, path: string): Promise<boolean>;
|
|
50
|
+
export declare function pullRefresh(runtime: Runtime, authorized: Authorization, record: ReplicaRecord, liveness: Live, hold: InstallHold, refresh: Refresher): Promise<Refreshed>;
|
|
51
|
+
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 | Unconfirmed | {
|
|
52
|
+
readonly kind: 'transport-uncertainty';
|
|
53
|
+
} | RetryableRefusal | import("./adapter.js").ScopedRefusal>;
|
|
54
|
+
export declare function publish(runtime: Runtime, local: RuntimeStore, room: DiscoveredRoom, reached: ReplicaRecord, landing: Landing, live: Live): Promise<boolean>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,QAAQ,EACR,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkC,KAAK,KAAK,EAAgB,MAAM,gBAAgB,CAAC;AAM1F,OAAO,KAAK,EACV,YAAY,EAGZ,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAmB,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,K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