@agentshouse/mdruntime 0.1.0-ce5c5bb29be5a → 0.1.0-ce6bc9239a3ee
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 +26 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +384 -0
- package/dist/adapter.d.ts +81 -49
- 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 +9 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +209 -75
- 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 +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +2 -0
- package/dist/client.d.ts +16 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -1
- package/dist/collection.d.ts +2 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +262 -318
- package/dist/connection.d.ts +20 -44
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1438 -3393
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +47 -0
- package/dist/conversation.d.ts +26 -17
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +441 -307
- package/dist/durability.d.ts +6 -0
- 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 +48 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/host.d.ts +4 -6
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +22 -26
- 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 +18 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/install.d.ts +86 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/job.d.ts +33 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +54 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +63 -22
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/memory.d.ts +11 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +171 -81
- 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 -9
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -9
- package/dist/observation.d.ts +2 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +7 -2
- package/dist/outcome.d.ts +1 -0
- 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 +59 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +118 -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 +32 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +118 -0
- package/dist/reach.d.ts +12 -12
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +182 -136
- package/dist/react.d.ts +5 -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 +0 -2
- package/dist/readiness.d.ts.map +1 -1
- package/dist/reads.d.ts +36 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +136 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +9 -1
- package/dist/refresh.d.ts +6 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +32 -4
- package/dist/replica.d.ts +8 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +50 -15
- 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 +29 -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/save.d.ts.map +1 -1
- package/dist/save.js +11 -8
- package/dist/saves.d.ts +96 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +999 -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 +16 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +66 -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/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket.d.ts +43 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +96 -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 -2
- 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/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/watchers.d.ts +15 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +36 -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 +78 -145
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +117 -367
- package/dist/stored.d.ts +58 -32
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +264 -187
- package/dist/tables.d.ts +107 -25
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +193 -47
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +7 -4
- 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 +15 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +6 -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/reach.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppRoom, MdRuntime, ReadinessPort, RuntimeTopic } from './connection.js';
|
|
2
2
|
import type { Plan, PlanReach, QueryResult } from './query.js';
|
|
3
3
|
import type { Readiness } from './readiness.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { SearchResult } from './search.js';
|
|
5
5
|
export type ReachedDocument = {
|
|
6
6
|
readonly room: string;
|
|
7
7
|
readonly path: string;
|
|
@@ -9,7 +9,7 @@ export type ReachedDocument = {
|
|
|
9
9
|
export type ReachedArea = {
|
|
10
10
|
readonly room: string;
|
|
11
11
|
readonly path: string;
|
|
12
|
-
readonly
|
|
12
|
+
readonly open: readonly string[];
|
|
13
13
|
};
|
|
14
14
|
export type PortReach = {
|
|
15
15
|
readonly rooms: readonly string[];
|
|
@@ -18,26 +18,26 @@ export type PortReach = {
|
|
|
18
18
|
readonly conversations: boolean;
|
|
19
19
|
};
|
|
20
20
|
export type Deliver = (message: unknown) => void;
|
|
21
|
-
export type
|
|
21
|
+
export type Fail = (error: unknown) => void;
|
|
22
|
+
export type Watch = (topic: RuntimeTopic, input: readonly unknown[], deliver: Deliver, fail: Fail) => () => void;
|
|
22
23
|
export type RuntimeView = {
|
|
23
24
|
md: MdRuntime;
|
|
24
25
|
watch: Watch;
|
|
25
26
|
};
|
|
26
27
|
export type NarrowedView = RuntimeView & {
|
|
27
28
|
narrow(reach: PortReach | null): void;
|
|
28
|
-
facts(port: ReadinessPort): void;
|
|
29
29
|
};
|
|
30
30
|
export type Reachable = RuntimeView & {
|
|
31
|
-
plan(input: unknown, reach: PortReach | null): Plan
|
|
31
|
+
plan(input: unknown, reach: PortReach | null): Promise<Plan>;
|
|
32
32
|
query(plan: Plan): Promise<QueryResult>;
|
|
33
|
-
watchPlan(plan: Plan, deliver:
|
|
34
|
-
search(input: unknown, reach: PortReach | null
|
|
33
|
+
watchPlan(plan: Plan, deliver: Deliver, fail: Fail): () => void;
|
|
34
|
+
search(input: unknown, reach: PortReach | null): Promise<SearchResult>;
|
|
35
35
|
watchReadiness(port: ReadinessPort, reach: PortReach | null, deliver: (readiness: Readiness) => void): () => void;
|
|
36
|
-
locked(room: string): boolean
|
|
37
|
-
lockedRooms(): readonly string[]
|
|
36
|
+
locked(room: string): Promise<boolean>;
|
|
37
|
+
lockedRooms(): Promise<readonly string[]>;
|
|
38
38
|
watchLocks(notify: () => void): () => void;
|
|
39
|
-
located(room: string, path: string, destination: string): ReachedDocument | null
|
|
40
|
-
room(locator: string): AppRoom | undefined
|
|
39
|
+
located(room: string, path: string, destination: string): Promise<ReachedDocument | null>;
|
|
40
|
+
room(locator: string): Promise<AppRoom | undefined>;
|
|
41
41
|
};
|
|
42
42
|
export declare function holds(reach: PortReach | null, room: string): boolean;
|
|
43
43
|
export declare function governs(reach: PortReach | null, room: {
|
|
@@ -50,5 +50,5 @@ export declare function governs(reach: PortReach | null, room: {
|
|
|
50
50
|
readonly selection: boolean;
|
|
51
51
|
};
|
|
52
52
|
export declare function planReach(reach: PortReach | null): PlanReach | null;
|
|
53
|
-
export declare function narrowed(runtime: Reachable, given: PortReach | null,
|
|
53
|
+
export declare function narrowed(runtime: Reachable, given: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
54
54
|
//# sourceMappingURL=reach.d.ts.map
|
package/dist/reach.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA2BpG,OAAO,KAAK,EAAiB,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAS9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MA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E,OAAO,CAAA;CAAE,CAU/D;AAeD,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAcnE;AA2GD,wBAAgB,QAAQ,CACtB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,IAAI,EAAE,aAAa,GAClB,YAAY,CAiYd"}
|
package/dist/reach.js
CHANGED
|
@@ -6,7 +6,6 @@ import { failure, lockedRoom, ROOM_LOCKED, undeclared, UNREADABLE, } from './out
|
|
|
6
6
|
import { beneath } from './paths.js';
|
|
7
7
|
import { moveTarget, readParts, staleWrite, } from './room-draft.js';
|
|
8
8
|
import { documentKey } from './rows.js';
|
|
9
|
-
import { undeclaredSearch } from './search.js';
|
|
10
9
|
const UNHELD_TYPES = { collection: modelTypes(NO_MODEL), typedSelection: null };
|
|
11
10
|
function unconversed(name) {
|
|
12
11
|
return () => Promise.resolve(undeclared(name));
|
|
@@ -14,13 +13,12 @@ function unconversed(name) {
|
|
|
14
13
|
const NO_CONVERSATION = {
|
|
15
14
|
list: () => Promise.resolve([]),
|
|
16
15
|
read: (conversation) => Promise.resolve(unheldView(conversation)),
|
|
17
|
-
create: unconversed('
|
|
18
|
-
send: unconversed('
|
|
19
|
-
answer: unconversed('
|
|
20
|
-
interrupt: unconversed('
|
|
21
|
-
kill: unconversed('
|
|
22
|
-
|
|
23
|
-
delete: unconversed('conversation.delete'),
|
|
16
|
+
create: unconversed('conversations/create'),
|
|
17
|
+
send: unconversed('conversations/send'),
|
|
18
|
+
answer: unconversed('conversations/interaction/answer'),
|
|
19
|
+
interrupt: unconversed('conversations/interrupt'),
|
|
20
|
+
kill: unconversed('conversations/kill'),
|
|
21
|
+
delete: unconversed('conversations/delete'),
|
|
24
22
|
};
|
|
25
23
|
const NO_CHAT_DRAFT = {
|
|
26
24
|
write: () => Promise.resolve(),
|
|
@@ -30,17 +28,15 @@ const NO_CHAT_DRAFT = {
|
|
|
30
28
|
function areasOf(reach) {
|
|
31
29
|
return reach.areas ?? [];
|
|
32
30
|
}
|
|
33
|
-
function typedAreas(reach, room) {
|
|
34
|
-
return areasOf(reach).filter((area) => area.room === room && area.types.length > 0);
|
|
35
|
-
}
|
|
36
31
|
function fenced(reach, room, path) {
|
|
37
|
-
return areasOf(reach).some((area) => area.room === room &&
|
|
32
|
+
return areasOf(reach).some((area) => area.room === room &&
|
|
33
|
+
beneath(area.path, path) &&
|
|
34
|
+
!area.open.some((open) => beneath(open, path)));
|
|
38
35
|
}
|
|
39
36
|
export function holds(reach, room) {
|
|
40
37
|
return (reach === null ||
|
|
41
38
|
reach.rooms.includes(room) ||
|
|
42
|
-
reach.documents.some((document) => document.room === room)
|
|
43
|
-
typedAreas(reach, room).length > 0);
|
|
39
|
+
reach.documents.some((document) => document.room === room));
|
|
44
40
|
}
|
|
45
41
|
function wholly(reach, room) {
|
|
46
42
|
return reach === null || reach.rooms.includes(room);
|
|
@@ -50,12 +46,9 @@ export function governs(reach, room) {
|
|
|
50
46
|
return { collection: true, selection: room.typedSelection !== null };
|
|
51
47
|
}
|
|
52
48
|
const selected = (path) => room.typedSelection?.roots.some((root) => beneath(root, path)) ?? false;
|
|
53
|
-
const paths =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.map(({ path }) => path),
|
|
57
|
-
...typedAreas(reach, room.locator).map(({ path }) => path),
|
|
58
|
-
];
|
|
49
|
+
const paths = reach.documents
|
|
50
|
+
.filter((document) => document.room === room.locator)
|
|
51
|
+
.map(({ path }) => path);
|
|
59
52
|
return { collection: paths.some((path) => !selected(path)), selection: paths.some(selected) };
|
|
60
53
|
}
|
|
61
54
|
function covers(reach, room, path) {
|
|
@@ -76,7 +69,7 @@ export function planReach(reach) {
|
|
|
76
69
|
...new Set(reach.documents.map(({ room, path }) => documentKey(room, path))),
|
|
77
70
|
].sort(),
|
|
78
71
|
areas: areasOf(reach)
|
|
79
|
-
.map(({ room, path,
|
|
72
|
+
.map(({ room, path, open }) => ({ room, path, open: [...new Set(open)].sort() }))
|
|
80
73
|
.sort((left, right) => documentKey(left.room, left.path) < documentKey(right.room, right.path) ? -1 : 1),
|
|
81
74
|
};
|
|
82
75
|
}
|
|
@@ -144,13 +137,13 @@ function queueWithin(reach, room, entries) {
|
|
|
144
137
|
});
|
|
145
138
|
}
|
|
146
139
|
function unreached(room) {
|
|
147
|
-
return runtimeError('room
|
|
140
|
+
return runtimeError('unknown-room', `Unknown Room ${room}`);
|
|
148
141
|
}
|
|
149
142
|
function lockedError(room) {
|
|
150
143
|
return runtimeError(ROOM_LOCKED, `${room} is locked until House confirms its access`, true);
|
|
151
144
|
}
|
|
152
145
|
function deviceUnreached() {
|
|
153
|
-
return runtimeError('device-unreached', 'Only the panel
|
|
146
|
+
return runtimeError('device-unreached', 'Only the panel reaches this device');
|
|
154
147
|
}
|
|
155
148
|
const ATTACH_REQUIRED = 'attach-required';
|
|
156
149
|
function attachRequired() {
|
|
@@ -159,10 +152,9 @@ function attachRequired() {
|
|
|
159
152
|
function carriesFile(parts) {
|
|
160
153
|
return parts !== null && typeof parts === 'object' && Object.hasOwn(parts, 'file');
|
|
161
154
|
}
|
|
162
|
-
export function narrowed(runtime, given,
|
|
155
|
+
export function narrowed(runtime, given, port) {
|
|
163
156
|
const { md, watch } = runtime;
|
|
164
157
|
let reach = given;
|
|
165
|
-
let port = told;
|
|
166
158
|
const open = new Set();
|
|
167
159
|
function following(begin, locking = false) {
|
|
168
160
|
let stop = begin();
|
|
@@ -178,70 +170,127 @@ export function narrowed(runtime, given, told) {
|
|
|
178
170
|
stop();
|
|
179
171
|
};
|
|
180
172
|
}
|
|
181
|
-
const unlocking = (rooms) => {
|
|
182
|
-
const
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
173
|
+
const unlocking = (rooms, locked) => {
|
|
174
|
+
const held = (rooms ?? []).filter((room) => locked.includes(room));
|
|
175
|
+
return held.length === 0 ? null : { pending: held.map((room) => ({ room, awaits: 'unlock' })) };
|
|
176
|
+
};
|
|
177
|
+
const unlocked = (entries, locked) => entries.filter((entry) => !locked.includes(entry.room));
|
|
178
|
+
const intoLocked = async (held) => {
|
|
179
|
+
for (const move of held) {
|
|
180
|
+
if (move?.room !== undefined && (await runtime.locked(move.room)))
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
186
184
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
function ordered(deliver) {
|
|
186
|
+
let open = true;
|
|
187
|
+
let shown = Promise.resolve();
|
|
188
|
+
return {
|
|
189
|
+
push(making) {
|
|
190
|
+
shown = shown.then(() => making.then((value) => {
|
|
191
|
+
if (open)
|
|
192
|
+
deliver(value);
|
|
193
|
+
}, () => { }), () => { });
|
|
194
|
+
},
|
|
195
|
+
stop() {
|
|
196
|
+
open = false;
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function unlockedWatch(topic, input, deliver, fail, within) {
|
|
201
|
+
const shown = ordered(deliver);
|
|
202
|
+
const stop = watch(topic, input, (message) => {
|
|
203
|
+
shown.push(runtime.lockedRooms().then((locked) => within(message, locked)));
|
|
204
|
+
}, fail);
|
|
205
|
+
return () => {
|
|
206
|
+
shown.stop();
|
|
207
|
+
stop();
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function lockedFirst(room, start, shut) {
|
|
211
|
+
let open = true;
|
|
212
|
+
let stop = () => { };
|
|
213
|
+
void (async () => {
|
|
214
|
+
const closed = !holds(reach, room) || (await runtime.locked(room));
|
|
215
|
+
if (!open)
|
|
216
|
+
return;
|
|
217
|
+
if (closed)
|
|
218
|
+
shut();
|
|
219
|
+
else
|
|
220
|
+
stop = start();
|
|
221
|
+
})();
|
|
222
|
+
return () => {
|
|
223
|
+
open = false;
|
|
224
|
+
stop();
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const within = (topic, input, deliver, fail) => {
|
|
228
|
+
if (topic === 'read' && reach !== null) {
|
|
229
|
+
fail(deviceUnreached());
|
|
230
|
+
return () => { };
|
|
231
|
+
}
|
|
190
232
|
if (topic === 'rooms') {
|
|
191
|
-
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms))));
|
|
233
|
+
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms)), fail));
|
|
192
234
|
}
|
|
193
235
|
if (topic === 'readiness') {
|
|
194
236
|
return following(() => runtime.watchReadiness(port, reach, deliver));
|
|
195
237
|
}
|
|
196
238
|
if (topic === 'sync-status') {
|
|
197
|
-
return following(() =>
|
|
198
|
-
const
|
|
199
|
-
|
|
239
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (status, locked) => {
|
|
240
|
+
const shown = statusWithin(reach, status);
|
|
241
|
+
return { ...shown, attentionRequired: unlocked(shown.attentionRequired, locked) };
|
|
200
242
|
}), true);
|
|
201
243
|
}
|
|
202
244
|
if (topic === 'room-drafts') {
|
|
203
|
-
return following(() =>
|
|
245
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (drafts, locked) => unlocked(draftsWithin(reach, drafts), locked)), true);
|
|
204
246
|
}
|
|
205
247
|
if (topic === 'queue') {
|
|
206
248
|
const room = input[0];
|
|
207
|
-
return following(() =>
|
|
208
|
-
if (!holds(reach, room) || runtime.locked(room)) {
|
|
209
|
-
deliver([]);
|
|
210
|
-
return () => { };
|
|
211
|
-
}
|
|
212
|
-
return watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)));
|
|
213
|
-
}, true);
|
|
249
|
+
return following(() => lockedFirst(room, () => watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)), fail), () => deliver([])), true);
|
|
214
250
|
}
|
|
215
251
|
if (topic === 'query') {
|
|
216
|
-
const
|
|
252
|
+
const planning = runtime.plan(input[0], reach);
|
|
217
253
|
let held = null;
|
|
218
254
|
return following(() => {
|
|
219
|
-
const locked = unlocking(plan.rooms);
|
|
220
|
-
if (locked !== null) {
|
|
221
|
-
const answer = { result: locked, keys: [] };
|
|
222
|
-
if (held === null || changeOf(held, answer) !== null)
|
|
223
|
-
deliver(answer);
|
|
224
|
-
held = digestOf(answer);
|
|
225
|
-
return () => { };
|
|
226
|
-
}
|
|
227
|
-
let first = true;
|
|
228
255
|
let open = true;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
256
|
+
let stop = () => { };
|
|
257
|
+
void (async () => {
|
|
258
|
+
const plan = await planning;
|
|
259
|
+
const locked = await runtime.lockedRooms();
|
|
260
|
+
if (!open)
|
|
261
|
+
return;
|
|
262
|
+
const pending = unlocking(plan.rooms, locked);
|
|
263
|
+
if (pending !== null) {
|
|
264
|
+
const answer = { result: pending, keys: [] };
|
|
265
|
+
if (held === null || changeOf(held, answer) !== null)
|
|
266
|
+
deliver(answer);
|
|
267
|
+
held = digestOf(answer);
|
|
233
268
|
return;
|
|
234
269
|
}
|
|
235
|
-
first =
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
270
|
+
let first = true;
|
|
271
|
+
const heard = (message) => {
|
|
272
|
+
if (!first) {
|
|
273
|
+
held = digestApplied(held, message);
|
|
274
|
+
deliver(message);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
first = false;
|
|
278
|
+
const change = held === null ? message : changeOf(held, message);
|
|
279
|
+
held = digestOf(message);
|
|
280
|
+
if (change !== null)
|
|
281
|
+
deliver(change);
|
|
282
|
+
};
|
|
283
|
+
const current = { ...plan, reach: planReach(reach), locked };
|
|
284
|
+
stop = runtime.watchPlan(current, (message) => {
|
|
285
|
+
if (open)
|
|
286
|
+
heard(message);
|
|
287
|
+
}, (error) => {
|
|
288
|
+
if (open)
|
|
289
|
+
fail(error);
|
|
290
|
+
});
|
|
291
|
+
})().catch((error) => {
|
|
243
292
|
if (open)
|
|
244
|
-
|
|
293
|
+
fail(error);
|
|
245
294
|
});
|
|
246
295
|
return () => {
|
|
247
296
|
open = false;
|
|
@@ -252,7 +301,7 @@ export function narrowed(runtime, given, told) {
|
|
|
252
301
|
if (topic === 'conversation') {
|
|
253
302
|
return following(() => {
|
|
254
303
|
if (conversing(reach))
|
|
255
|
-
return watch(topic, input, deliver);
|
|
304
|
+
return watch(topic, input, deliver, fail);
|
|
256
305
|
deliver(unheldView(input[0]));
|
|
257
306
|
return () => { };
|
|
258
307
|
});
|
|
@@ -260,12 +309,18 @@ export function narrowed(runtime, given, told) {
|
|
|
260
309
|
if (topic === 'conversations' || topic === 'agents') {
|
|
261
310
|
return following(() => {
|
|
262
311
|
if (conversing(reach))
|
|
263
|
-
return watch(topic, input, deliver);
|
|
312
|
+
return watch(topic, input, deliver, fail);
|
|
264
313
|
deliver([]);
|
|
265
314
|
return () => { };
|
|
266
315
|
});
|
|
267
316
|
}
|
|
268
|
-
|
|
317
|
+
if (topic === 'figures') {
|
|
318
|
+
if (reach === null)
|
|
319
|
+
return watch(topic, input, deliver, fail);
|
|
320
|
+
fail(deviceUnreached());
|
|
321
|
+
return () => { };
|
|
322
|
+
}
|
|
323
|
+
return watch(topic, input, deliver, fail);
|
|
269
324
|
};
|
|
270
325
|
const files = new Map();
|
|
271
326
|
let handed = 0;
|
|
@@ -283,33 +338,33 @@ export function narrowed(runtime, given, told) {
|
|
|
283
338
|
const view = {
|
|
284
339
|
...md,
|
|
285
340
|
rooms: () => md.rooms().then((rooms) => roomsWithin(reach, rooms)),
|
|
286
|
-
query: ((input) => {
|
|
287
|
-
const plan = runtime.plan(input, reach);
|
|
288
|
-
|
|
341
|
+
query: (async (input) => {
|
|
342
|
+
const plan = await runtime.plan(input, reach);
|
|
343
|
+
const locked = await runtime.lockedRooms();
|
|
344
|
+
return unlocking(plan.rooms, locked) ?? runtime.query({ ...plan, locked });
|
|
289
345
|
}),
|
|
290
|
-
search: (input) =>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
types(room) {
|
|
294
|
-
if (holds(reach, room) && runtime.locked(room))
|
|
346
|
+
search: (input) => runtime.search(input, reach),
|
|
347
|
+
async types(room) {
|
|
348
|
+
if (holds(reach, room) && (await runtime.locked(room)))
|
|
295
349
|
throw lockedError(room);
|
|
296
350
|
if (wholly(reach, room))
|
|
297
351
|
return md.types(room);
|
|
298
352
|
if (!holds(reach, room))
|
|
299
353
|
return structuredClone(UNHELD_TYPES);
|
|
300
|
-
return typesWithin(reach, runtime.room(room), md.types(room));
|
|
354
|
+
return typesWithin(reach, await runtime.room(room), await md.types(room));
|
|
301
355
|
},
|
|
302
356
|
async save(room, roomDrafts, writtenBy) {
|
|
303
357
|
if (!holds(reach, room))
|
|
304
358
|
throw unreached(room);
|
|
305
|
-
if (runtime.locked(room))
|
|
359
|
+
if (await runtime.locked(room)) {
|
|
306
360
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
361
|
+
}
|
|
307
362
|
const held = (await Promise.all(roomDrafts.map(({ path }) => md.roomDraft.read(room, path)))).map((draft) => draft?.parts.move);
|
|
308
363
|
const outside = roomDrafts.find(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]));
|
|
309
364
|
if (outside !== undefined) {
|
|
310
365
|
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
311
366
|
}
|
|
312
|
-
if (intoLocked(held))
|
|
367
|
+
if (await intoLocked(held))
|
|
313
368
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
314
369
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
315
370
|
},
|
|
@@ -320,47 +375,48 @@ export function narrowed(runtime, given, told) {
|
|
|
320
375
|
if (filed !== undefined) {
|
|
321
376
|
return { outcome: 'refused', code: ATTACH_REQUIRED, retryable: false, file: filed.path };
|
|
322
377
|
}
|
|
323
|
-
if (runtime.locked(room))
|
|
378
|
+
if (await runtime.locked(room)) {
|
|
324
379
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
325
|
-
|
|
380
|
+
}
|
|
381
|
+
const held = parts.map(({ path, parts: one }) => readParts(one, path).move);
|
|
326
382
|
if (parts.some(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]))) {
|
|
327
383
|
throw unreached(room);
|
|
328
384
|
}
|
|
329
|
-
if (intoLocked(held))
|
|
385
|
+
if (await intoLocked(held))
|
|
330
386
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
331
387
|
return savedWithin(reach, room, await md.saveParts(room, parts, writtenBy));
|
|
332
388
|
},
|
|
333
|
-
resolve(room, path, destination) {
|
|
334
|
-
const at = runtime.located(room, path, destination);
|
|
389
|
+
async resolve(room, path, destination) {
|
|
390
|
+
const at = await runtime.located(room, path, destination);
|
|
335
391
|
return at !== null && !covers(reach, at.room, at.path)
|
|
336
|
-
?
|
|
392
|
+
? UNREADABLE
|
|
337
393
|
: md.resolve(room, path, destination);
|
|
338
394
|
},
|
|
339
|
-
history: (room, path, query) => !covers(reach, room, path)
|
|
340
|
-
?
|
|
341
|
-
: runtime.locked(room)
|
|
342
|
-
?
|
|
395
|
+
history: async (room, path, query) => !covers(reach, room, path)
|
|
396
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
397
|
+
: (await runtime.locked(room))
|
|
398
|
+
? lockedRoom(room)
|
|
343
399
|
: md.history(room, path, query),
|
|
344
400
|
binaryFile: {
|
|
345
|
-
read: (room, path, revision) => !covers(reach, room, path)
|
|
346
|
-
?
|
|
347
|
-
: runtime.locked(room)
|
|
348
|
-
?
|
|
401
|
+
read: async (room, path, revision) => !covers(reach, room, path)
|
|
402
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
403
|
+
: (await runtime.locked(room))
|
|
404
|
+
? lockedRoom(room)
|
|
349
405
|
: hand(md.binaryFile.read(room, path, revision)),
|
|
350
|
-
link: (room, path, revision) => !covers(reach, room, path)
|
|
351
|
-
?
|
|
352
|
-
: runtime.locked(room)
|
|
353
|
-
?
|
|
406
|
+
link: async (room, path, revision) => !covers(reach, room, path)
|
|
407
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
408
|
+
: (await runtime.locked(room))
|
|
409
|
+
? lockedRoom(room)
|
|
354
410
|
: md.binaryFile.link(room, path, revision),
|
|
355
|
-
show: (room, path, revision) => !covers(reach, room, path)
|
|
356
|
-
?
|
|
357
|
-
: runtime.locked(room)
|
|
358
|
-
?
|
|
411
|
+
show: async (room, path, revision) => !covers(reach, room, path)
|
|
412
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
413
|
+
: (await runtime.locked(room))
|
|
414
|
+
? lockedRoom(room)
|
|
359
415
|
: hand(md.binaryFile.show(room, path, revision)),
|
|
360
|
-
attach: (room, file) => !wholly(reach, room)
|
|
361
|
-
?
|
|
362
|
-
: runtime.locked(room)
|
|
363
|
-
?
|
|
416
|
+
attach: async (room, file) => !wholly(reach, room)
|
|
417
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
418
|
+
: (await runtime.locked(room))
|
|
419
|
+
? lockedRoom(room)
|
|
364
420
|
: md.binaryFile.attach(room, file),
|
|
365
421
|
async part(file, part) {
|
|
366
422
|
const key = files.get(file);
|
|
@@ -373,42 +429,38 @@ export function narrowed(runtime, given, told) {
|
|
|
373
429
|
},
|
|
374
430
|
},
|
|
375
431
|
reached: async (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
376
|
-
!runtime.locked(room) &&
|
|
432
|
+
!(await runtime.locked(room)) &&
|
|
377
433
|
(await md.reached(room, roomVersion, path)),
|
|
378
434
|
log: () => (reach === null ? md.log() : ''),
|
|
379
435
|
cleanUp: () => (reach === null ? md.cleanUp() : Promise.reject(deviceUnreached())),
|
|
436
|
+
unsent: () => (reach === null ? md.unsent() : Promise.reject(deviceUnreached())),
|
|
437
|
+
reset: () => (reach === null ? md.reset() : Promise.reject(deviceUnreached())),
|
|
438
|
+
readAgain: () => (reach === null ? md.readAgain() : Promise.reject(deviceUnreached())),
|
|
380
439
|
roomDraft: {
|
|
381
|
-
list: () => md.roomDraft.list()
|
|
440
|
+
list: async () => unlocked(draftsWithin(reach, await md.roomDraft.list()), await runtime.lockedRooms()),
|
|
382
441
|
async read(room, path) {
|
|
383
442
|
if (!covers(reach, room, path))
|
|
384
443
|
return null;
|
|
385
|
-
if (runtime.locked(room))
|
|
444
|
+
if (await runtime.locked(room))
|
|
386
445
|
throw lockedError(room);
|
|
387
446
|
return shownDraft(reach, await md.roomDraft.read(room, path));
|
|
388
447
|
},
|
|
389
|
-
write(room, path, revision, parts, next) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
catch (error) {
|
|
402
|
-
return Promise.reject(error);
|
|
403
|
-
}
|
|
404
|
-
return md.roomDraft
|
|
405
|
-
.write(room, path, revision, parts, next)
|
|
406
|
-
.then((written) => writeWithin(reach, written));
|
|
448
|
+
async write(room, path, revision, parts, next) {
|
|
449
|
+
if (reach !== null && carriesFile(parts))
|
|
450
|
+
throw attachRequired();
|
|
451
|
+
const move = readParts(parts, path).move;
|
|
452
|
+
if (!covers(reach, room, path) || !moves(reach, room, move))
|
|
453
|
+
throw unreached(room);
|
|
454
|
+
if (await runtime.locked(room))
|
|
455
|
+
throw lockedError(room);
|
|
456
|
+
if (await intoLocked([move]))
|
|
457
|
+
throw lockedError(move.room);
|
|
458
|
+
return writeWithin(reach, await md.roomDraft.write(room, path, revision, parts, next));
|
|
407
459
|
},
|
|
408
460
|
async discard(room, path, revision) {
|
|
409
461
|
if (!covers(reach, room, path))
|
|
410
462
|
return staleWrite(null);
|
|
411
|
-
if (runtime.locked(room))
|
|
463
|
+
if (await runtime.locked(room))
|
|
412
464
|
throw lockedError(room);
|
|
413
465
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
414
466
|
},
|
|
@@ -421,7 +473,6 @@ export function narrowed(runtime, given, told) {
|
|
|
421
473
|
answer: (id, answer) => conversation().answer(id, answer),
|
|
422
474
|
interrupt: (id) => conversation().interrupt(id),
|
|
423
475
|
kill: (id) => conversation().kill(id),
|
|
424
|
-
cancel: (id, turn) => conversation().cancel(id, turn),
|
|
425
476
|
delete: (id) => conversation().delete(id),
|
|
426
477
|
},
|
|
427
478
|
chatDraft: {
|
|
@@ -439,10 +490,5 @@ export function narrowed(runtime, given, told) {
|
|
|
439
490
|
for (const restart of [...open])
|
|
440
491
|
restart();
|
|
441
492
|
},
|
|
442
|
-
facts(next) {
|
|
443
|
-
port = next;
|
|
444
|
-
for (const restart of [...open])
|
|
445
|
-
restart();
|
|
446
|
-
},
|
|
447
493
|
};
|
|
448
494
|
}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import type { AppRoom, ConnectionRefusal
|
|
3
|
+
import type { AppRoom, ConnectionRefusal } from './connection.js';
|
|
4
|
+
import type { SavedRoomDraft, SaveResult } from './saves.js';
|
|
3
5
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
6
|
import type { ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
5
7
|
import { type RuntimeError } from './failure.js';
|
|
6
8
|
import type { QueueEntry } from './outcome.js';
|
|
7
|
-
import type {
|
|
9
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
8
10
|
import type { Readiness } from './readiness.js';
|
|
9
11
|
import type { RoomDraft, RoomDraftParts } from './room-draft.js';
|
|
10
12
|
import type { SyncStatus } from './status.js';
|
|
@@ -23,6 +25,7 @@ export declare function useObserve(client: Client, topic: 'storage-loss'): Obser
|
|
|
23
25
|
export declare function useObserve(client: Client, topic: 'sync-status'): Observed<SyncStatus>;
|
|
24
26
|
export declare function useObserve(client: Client, topic: 'service-mode'): Observed<ServiceMode>;
|
|
25
27
|
export declare function useObserve(client: Client, topic: 'member'): Observed<Member | null>;
|
|
28
|
+
export declare function useObserve(client: Client, topic: 'authority-changes'): Observed<number>;
|
|
26
29
|
export declare function useObserve(client: Client, topic: 'query', query: DocumentQuery): Observed<DocumentResult | PendingResult>;
|
|
27
30
|
export declare function useObserve(client: Client, topic: 'query', query: GroupQuery): Observed<GroupResult | PendingResult>;
|
|
28
31
|
export declare function useObserve(client: Client, topic: 'queue', locator: string): Observed<readonly QueueEntry[]>;
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,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C,SAAS,iBAAiB,EAAE,CAAC,CAAC;AAsCpG,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACpF,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACvF,CAAC;AAMF,wBAAgB,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA8BvD"}
|
package/dist/read.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type Fields = Readonly<Record<string, unknown>>;
|
|
2
|
+
export declare const EXCERPT = 512;
|
|
3
|
+
export declare function excerpt(said: string): string;
|
|
4
|
+
export declare function record(entry: unknown): Fields;
|
|
5
|
+
export declare function text(fields: Fields, name: string): string | null;
|
|
6
|
+
export declare function list(fields: Fields, name: string): readonly unknown[];
|
|
7
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvD,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI7C;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhE;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,OAAO,EAAE,CAGrE"}
|