@agentshouse/mdruntime 0.1.0-cefbc8bb8a1c0 → 0.1.0-cf04ede9fb796
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 +2 -2
- 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 +251 -0
- package/dist/adapter.d.ts +86 -67
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +21 -56
- package/dist/bootstrap.d.ts +10 -9
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +211 -81
- 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 +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/change.d.ts +1 -0
- package/dist/change.d.ts.map +1 -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 +21 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -1
- package/dist/collection.d.ts +2 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +1 -17
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +263 -319
- package/dist/connection.d.ts +5 -143
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +102 -5311
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-live.d.ts +136 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +248 -0
- 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 +41 -45
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +859 -870
- 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 +15 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +2 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +17 -7
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- 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 +23 -30
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +25 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/install.d.ts +56 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +556 -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 +268 -0
- package/dist/listing.d.ts +53 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +176 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +63 -22
- 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/memory.d.ts +11 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +172 -82
- package/dist/messages.d.ts +27 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +97 -19
- package/dist/model.d.ts +2 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -18
- package/dist/models.d.ts +14 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +195 -0
- package/dist/observation.d.ts +2 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +7 -2
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +57 -0
- package/dist/outcome.d.ts +4 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +3 -0
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +11 -0
- package/dist/parts.d.ts +60 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +126 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts +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 +14 -209
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +34 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +122 -0
- package/dist/reach.d.ts +15 -13
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +183 -137
- package/dist/react.d.ts +10 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +2 -16
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/reads.d.ts +36 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +158 -78
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +9 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +33 -5
- 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 +9 -9
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +52 -20
- package/dist/room-draft.d.ts +4 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +65 -52
- 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 +14 -21
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +48 -184
- package/dist/runtime.d.ts +43 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +5 -1
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +19 -13
- package/dist/saves.d.ts +70 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +1008 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- 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 +1 -2
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +9 -15
- package/dist/shown.d.ts +31 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +295 -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 +44 -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 +0 -6
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -6
- 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 +431 -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 +107 -157
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +143 -395
- package/dist/stored.d.ts +58 -37
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +276 -207
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +223 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +532 -0
- package/dist/tables.d.ts +120 -55
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +212 -93
- 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/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +42 -100
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +17 -5
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +7 -1
- package/package.json +2 -2
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -370
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -156
package/dist/holdings.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const NO_CODE = { house: 0, apps: [] };
|
|
2
|
+
export const CLEANED_TOPIC = 'cleaned';
|
|
3
|
+
function heldRooms(figures) {
|
|
4
|
+
if ('pending' in figures)
|
|
5
|
+
return figures;
|
|
6
|
+
return figures.rooms.map(({ room, total }) => ({ room, documents: total.documents }));
|
|
7
|
+
}
|
|
8
|
+
function heldApp(app, measured) {
|
|
9
|
+
if (!measured.has(app))
|
|
10
|
+
return { app, state: 'asking' };
|
|
11
|
+
const code = measured.get(app) ?? null;
|
|
12
|
+
return code === null ? { app, state: 'unknown' } : { app, state: 'measured', ...code };
|
|
13
|
+
}
|
|
14
|
+
function summed(values) {
|
|
15
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
16
|
+
}
|
|
17
|
+
function holdingsOf(rooms, opened, code, measured) {
|
|
18
|
+
const apps = code.apps.map((app) => heldApp(app, measured));
|
|
19
|
+
const known = apps.flatMap((app) => (app.state === 'measured' ? [app] : []));
|
|
20
|
+
const whole = known.length === apps.length;
|
|
21
|
+
const files = {
|
|
22
|
+
count: summed(opened.rooms.map(({ count }) => count)),
|
|
23
|
+
size: summed(opened.rooms.map(({ size }) => size)),
|
|
24
|
+
};
|
|
25
|
+
const documents = 'pending' in rooms ? null : summed(rooms.map(({ documents: d }) => d.size));
|
|
26
|
+
const older = whole ? summed(known.map((app) => app.older)) : null;
|
|
27
|
+
return {
|
|
28
|
+
rooms,
|
|
29
|
+
opened: { ...files, rooms: opened.rooms },
|
|
30
|
+
apps,
|
|
31
|
+
house: code.house,
|
|
32
|
+
total: documents === null || code.house === null || older === null
|
|
33
|
+
? null
|
|
34
|
+
: documents + files.size + summed(known.map((app) => app.running)) + older + code.house,
|
|
35
|
+
cleanUp: older === null ? null : opened.cleanable + older,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function watchHoldings({ store, figures, shell }, deliver, fail) {
|
|
39
|
+
let open = true;
|
|
40
|
+
let asked = 0;
|
|
41
|
+
let rooms = null;
|
|
42
|
+
let opened = null;
|
|
43
|
+
let code = null;
|
|
44
|
+
let measured = new Map();
|
|
45
|
+
function told() {
|
|
46
|
+
if (open && rooms !== null && opened !== null && code !== null) {
|
|
47
|
+
deliver(holdingsOf(rooms, opened, code, measured));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function failed(error) {
|
|
51
|
+
if (!open)
|
|
52
|
+
return;
|
|
53
|
+
stop();
|
|
54
|
+
fail(error);
|
|
55
|
+
}
|
|
56
|
+
function ask() {
|
|
57
|
+
asked += 1;
|
|
58
|
+
const at = asked;
|
|
59
|
+
const current = () => open && at === asked;
|
|
60
|
+
opened = null;
|
|
61
|
+
code = null;
|
|
62
|
+
measured = new Map();
|
|
63
|
+
store.ask({ kind: 'opened.held' }).then((held) => {
|
|
64
|
+
if (!current())
|
|
65
|
+
return;
|
|
66
|
+
opened = held;
|
|
67
|
+
told();
|
|
68
|
+
}, failed);
|
|
69
|
+
const answers = measured;
|
|
70
|
+
const measuring = shell.measure?.((app, answer) => {
|
|
71
|
+
if (!current())
|
|
72
|
+
return;
|
|
73
|
+
answers.set(app, answer);
|
|
74
|
+
told();
|
|
75
|
+
}) ?? Promise.resolve(NO_CODE);
|
|
76
|
+
measuring.then((held) => {
|
|
77
|
+
if (!current())
|
|
78
|
+
return;
|
|
79
|
+
code = held;
|
|
80
|
+
told();
|
|
81
|
+
}, failed);
|
|
82
|
+
}
|
|
83
|
+
const stopFigures = figures.watch((answer) => {
|
|
84
|
+
rooms = heldRooms(answer);
|
|
85
|
+
told();
|
|
86
|
+
}, failed);
|
|
87
|
+
const cleaned = store.watch(CLEANED_TOPIC, ask);
|
|
88
|
+
function stop() {
|
|
89
|
+
open = false;
|
|
90
|
+
stopFigures();
|
|
91
|
+
cleaned.stop();
|
|
92
|
+
}
|
|
93
|
+
ask();
|
|
94
|
+
return stop;
|
|
95
|
+
}
|
package/dist/host.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MdRuntimeOptions } from './connection.js';
|
|
2
2
|
import type { PortReach } from './reach.js';
|
|
3
|
-
import type { CodeAvailability, Persistence, Readiness
|
|
3
|
+
import type { CodeAvailability, Persistence, Readiness } from './readiness.js';
|
|
4
4
|
import type { EntrySeed } from './seed.js';
|
|
5
5
|
import { type RuntimePort } from './wire.js';
|
|
6
6
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
@@ -11,22 +11,19 @@ export type AttachedPort = {
|
|
|
11
11
|
narrow(reach: PortReach): void;
|
|
12
12
|
readiness(deliver: (readiness: Readiness) => void): () => void;
|
|
13
13
|
answered(queries: readonly unknown[], done: () => void): void;
|
|
14
|
-
code(code: CodeAvailability, space: Space | null): void;
|
|
15
|
-
search(search: SearchObligation): void;
|
|
16
14
|
};
|
|
17
15
|
export type MdRuntimeHost = {
|
|
18
|
-
attach(port: RuntimePort, app: string, release?: string, reach?: PortReach, code?: CodeAvailability
|
|
16
|
+
attach(port: RuntimePort, app: string, release?: string, reach?: PortReach, code?: CodeAvailability): AttachedPort;
|
|
17
|
+
present(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
19
18
|
seed(entry: EntrySeed): void;
|
|
20
19
|
persisted(answer: Persistence): void;
|
|
21
|
-
shown(onScreen: boolean): void;
|
|
22
20
|
endAuthorization(holder?: string): Promise<void>;
|
|
23
|
-
lose(locators: readonly string[]): Promise<void>;
|
|
24
21
|
stop(): Promise<void>;
|
|
25
22
|
};
|
|
26
23
|
export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
|
|
27
24
|
export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
28
25
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
29
|
-
export type { CodeAvailability, Persistence,
|
|
26
|
+
export type { CodeAvailability, Persistence, Space } from './readiness.js';
|
|
30
27
|
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
31
28
|
export type { RuntimePort } from './wire.js';
|
|
32
29
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAGL,KAAK,WAAW,EAOjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,YAAY,G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d,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
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
3
|
import { untilAnswered } from './recovery.js';
|
|
4
4
|
import { described } from './failure.js';
|
|
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) {
|
|
@@ -40,6 +41,12 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
40
41
|
return md.log();
|
|
41
42
|
case 'cleanUp':
|
|
42
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();
|
|
43
50
|
case 'persistence':
|
|
44
51
|
return md.persistence();
|
|
45
52
|
case 'retry':
|
|
@@ -74,8 +81,6 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
74
81
|
return md.conversation.interrupt(input[0]);
|
|
75
82
|
case 'conversation.kill':
|
|
76
83
|
return md.conversation.kill(input[0]);
|
|
77
|
-
case 'conversation.cancel':
|
|
78
|
-
return md.conversation.cancel(input[0], input[1]);
|
|
79
84
|
case 'conversation.delete':
|
|
80
85
|
return md.conversation.delete(input[0]);
|
|
81
86
|
case 'chatDraft.write':
|
|
@@ -94,9 +99,6 @@ function attempted(work) {
|
|
|
94
99
|
return Promise.reject(error);
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
|
-
function answeredResult(value) {
|
|
98
|
-
return typeof value === 'object' && value !== null && !('pending' in value);
|
|
99
|
-
}
|
|
100
102
|
function answeredMessage(value) {
|
|
101
103
|
if (typeof value !== 'object' || value === null)
|
|
102
104
|
return false;
|
|
@@ -121,12 +123,11 @@ export function serveMdRuntime(options) {
|
|
|
121
123
|
deliver(structuredClone(deploymentFacts));
|
|
122
124
|
return () => { };
|
|
123
125
|
};
|
|
124
|
-
function attach(port, app, release, reach, code = 'stored'
|
|
126
|
+
function attach(port, app, release, reach, code = 'stored') {
|
|
125
127
|
if (!authorized)
|
|
126
128
|
throw new Error(AUTHORIZATION_ENDED);
|
|
127
129
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
128
|
-
|
|
129
|
-
const view = runtime.within(reach ?? null, facts);
|
|
130
|
+
const view = runtime.within(reach ?? null, { target: app, code });
|
|
130
131
|
const observations = new Map();
|
|
131
132
|
const followed = new Set();
|
|
132
133
|
const answeredKeys = new Set();
|
|
@@ -164,9 +165,16 @@ export function serveMdRuntime(options) {
|
|
|
164
165
|
if (topic === 'query' && answeredMessage(value))
|
|
165
166
|
answeredQuery(input[0]);
|
|
166
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
|
+
};
|
|
167
175
|
observations.set(id, topic === 'deployment-facts'
|
|
168
176
|
? watchFacts(deliver)
|
|
169
|
-
: (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));
|
|
170
178
|
};
|
|
171
179
|
const reply = async (id, query, pending) => {
|
|
172
180
|
try {
|
|
@@ -227,18 +235,6 @@ export function serveMdRuntime(options) {
|
|
|
227
235
|
if (serving)
|
|
228
236
|
view.narrow(next);
|
|
229
237
|
},
|
|
230
|
-
code(next, space) {
|
|
231
|
-
if (!serving)
|
|
232
|
-
return;
|
|
233
|
-
facts = { ...facts, code: next, space };
|
|
234
|
-
view.facts(facts);
|
|
235
|
-
},
|
|
236
|
-
search(next) {
|
|
237
|
-
if (!serving)
|
|
238
|
-
return;
|
|
239
|
-
facts = { ...facts, search: next };
|
|
240
|
-
view.facts(facts);
|
|
241
|
-
},
|
|
242
238
|
answered(queries, done) {
|
|
243
239
|
const keys = queries.map(queryKey);
|
|
244
240
|
if (keys.every((key) => answeredKeys.has(key)))
|
|
@@ -252,7 +248,7 @@ export function serveMdRuntime(options) {
|
|
|
252
248
|
const stop = view.watch('readiness', [], (value) => {
|
|
253
249
|
if (serving)
|
|
254
250
|
deliver(value);
|
|
255
|
-
});
|
|
251
|
+
}, () => { });
|
|
256
252
|
const end = () => {
|
|
257
253
|
followed.delete(end);
|
|
258
254
|
stop();
|
|
@@ -264,15 +260,15 @@ export function serveMdRuntime(options) {
|
|
|
264
260
|
}
|
|
265
261
|
return {
|
|
266
262
|
attach,
|
|
263
|
+
present(app, members) {
|
|
264
|
+
return md.presentation.edit(app, members);
|
|
265
|
+
},
|
|
267
266
|
seed(entry) {
|
|
268
267
|
runtime.seed(entry);
|
|
269
268
|
},
|
|
270
269
|
persisted(answer) {
|
|
271
270
|
runtime.persisted(answer);
|
|
272
271
|
},
|
|
273
|
-
shown(onScreen) {
|
|
274
|
-
runtime.shown(onScreen);
|
|
275
|
-
},
|
|
276
272
|
async endAuthorization(holder) {
|
|
277
273
|
authorized = false;
|
|
278
274
|
for (const [detach, send] of [...attachments]) {
|
|
@@ -284,9 +280,6 @@ export function serveMdRuntime(options) {
|
|
|
284
280
|
await options.shell.dropGeneration();
|
|
285
281
|
}
|
|
286
282
|
},
|
|
287
|
-
lose(locators) {
|
|
288
|
-
return runtime.lose(locators);
|
|
289
|
-
},
|
|
290
283
|
stop() {
|
|
291
284
|
return runtime.stop();
|
|
292
285
|
},
|
package/dist/identity.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
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;
|
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);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction,
|
|
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
2
|
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
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';
|
|
5
12
|
export type { Observation } from './observation.js';
|
|
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';
|
|
6
16
|
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
7
17
|
export type { BinaryFileRecord } from './binary.js';
|
|
8
18
|
export type { RuntimeError } from './failure.js';
|
|
9
19
|
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
10
20
|
export type { SaveRefusal } from './save.js';
|
|
11
|
-
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';
|
|
23
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
12
24
|
export { departure } from './change.js';
|
|
13
|
-
export { partsAfter, partsChanges } from './room-draft.js';
|
|
25
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
14
26
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
15
27
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
28
|
+
export { contextFigure } from './context.js';
|
|
29
|
+
export { jobsRunning, openJobs, sessionEnded, type OpenJob, type RunningJob } from './job.js';
|
|
16
30
|
export { changeBatchIdentity } from './identity.js';
|
|
17
31
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
32
|
+
export { authoredAt } from './paths.js';
|
|
18
33
|
export { untilAnswered } from './recovery.js';
|
|
19
34
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
20
35
|
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
|
21
36
|
export { expectedList, expecting, type ExpectedOf, type Expecting } from './expectation.js';
|
|
22
|
-
export type { RuntimeShell } from './durability.js';
|
|
23
|
-
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount,
|
|
37
|
+
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
38
|
+
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
39
|
+
export type { ObservedRead } from './reads.js';
|
|
24
40
|
export type { AttentionEntry, SyncStatus } from './status.js';
|
|
25
|
-
export type {
|
|
41
|
+
export type { Direction, DocumentQuery, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, Key, LocalQuery, OrderOptions, Predicate, Related, Select, Value, Where, } from '@agentshouse/mdmodel';
|
|
42
|
+
export type { Awaits, Backlink, CoveredRoom, DocumentResult, GroupResult, GroupTotal, PendingResult, PendingRoom, QueryCoverage, QueryDocument, QueryGroup, QueryResult, QueryRows, } from './query.js';
|
|
26
43
|
export type { MdType, ModelIdentity, ModelSnapshot, ModelState, ModelResult, TypesResult, ValidationReceipt, } from './model.js';
|
|
27
44
|
export type { OperationScopes, ReplicaAdmission, ScopedRefusal } from './adapter.js';
|
|
28
45
|
//# 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,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
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,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,E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GED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
3
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
1
4
|
export { departure } from './change.js';
|
|
2
|
-
export { partsAfter, partsChanges } from './room-draft.js';
|
|
5
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
3
6
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
4
7
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
8
|
+
export { contextFigure } from './context.js';
|
|
9
|
+
export { jobsRunning, openJobs, sessionEnded } from './job.js';
|
|
5
10
|
export { changeBatchIdentity } from './identity.js';
|
|
6
11
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
12
|
+
export { authoredAt } from './paths.js';
|
|
7
13
|
export { untilAnswered } from './recovery.js';
|
|
8
14
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
9
15
|
export { attempts, identities, intentOf, } from './attempt.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,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,KAAK,YAA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