@agentshouse/mdruntime 0.1.0-c0bed82db8d73 → 0.1.0-c0c1e81da9166
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 +3 -2
- package/dist/adapter.d.ts +101 -71
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +4 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +35 -46
- package/dist/bootstrap.d.ts +16 -15
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +273 -131
- 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 +15 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +54 -6
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +24 -19
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +278 -282
- package/dist/connection.d.ts +16 -11
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +2312 -1988
- 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 +27 -18
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +489 -260
- package/dist/durability.d.ts +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- 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 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +26 -29
- 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 +16 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- 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 +62 -20
- 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 +13 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +218 -91
- 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 +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -18
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +8 -3
- package/dist/outcome.d.ts +13 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +16 -2
- 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/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/query.d.ts +18 -207
- 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 +18 -11
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +201 -126
- package/dist/react.d.ts +3 -1
- 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 +3 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +35 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +34 -10
- package/dist/replica.d.ts +10 -9
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +53 -21
- package/dist/room-draft.d.ts +21 -5
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +98 -51
- package/dist/rows.d.ts +18 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +45 -153
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +22 -13
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- 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.d.ts +104 -62
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +159 -161
- package/dist/stored.d.ts +66 -55
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +343 -273
- package/dist/tables.d.ts +110 -65
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +188 -99
- 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 +18 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +6 -2
- package/package.json +2 -3
- package/AGENTS.md +0 -312
- 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 -368
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -100
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -150
package/dist/reach.d.ts
CHANGED
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
import type { MdRuntime, ReadinessPort, RuntimeTopic } from './connection.js';
|
|
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;
|
|
8
8
|
};
|
|
9
|
+
export type ReachedArea = {
|
|
10
|
+
readonly room: string;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly open: readonly string[];
|
|
13
|
+
};
|
|
9
14
|
export type PortReach = {
|
|
10
15
|
readonly rooms: readonly string[];
|
|
11
16
|
readonly documents: readonly ReachedDocument[];
|
|
17
|
+
readonly areas?: readonly ReachedArea[];
|
|
12
18
|
readonly conversations: boolean;
|
|
13
19
|
};
|
|
14
20
|
export type Deliver = (message: unknown) => void;
|
|
15
|
-
export type
|
|
21
|
+
export type Fail = (error: unknown) => void;
|
|
22
|
+
export type Watch = (topic: RuntimeTopic, input: readonly unknown[], deliver: Deliver, fail: Fail) => () => void;
|
|
16
23
|
export type RuntimeView = {
|
|
17
24
|
md: MdRuntime;
|
|
18
25
|
watch: Watch;
|
|
19
26
|
};
|
|
20
27
|
export type NarrowedView = RuntimeView & {
|
|
21
28
|
narrow(reach: PortReach | null): void;
|
|
22
|
-
facts(port: ReadinessPort): void;
|
|
23
29
|
};
|
|
24
30
|
export type Reachable = RuntimeView & {
|
|
25
|
-
plan(input: unknown, reach: PortReach | null): Plan
|
|
31
|
+
plan(input: unknown, reach: PortReach | null): Promise<Plan>;
|
|
26
32
|
query(plan: Plan): Promise<QueryResult>;
|
|
27
|
-
watchPlan(plan: Plan, deliver:
|
|
28
|
-
search(input: unknown, reach: PortReach | null
|
|
33
|
+
watchPlan(plan: Plan, deliver: Deliver, fail: Fail): () => void;
|
|
34
|
+
search(input: unknown, reach: PortReach | null): Promise<SearchResult>;
|
|
29
35
|
watchReadiness(port: ReadinessPort, reach: PortReach | null, deliver: (readiness: Readiness) => void): () => void;
|
|
30
|
-
locked(room: string): boolean
|
|
31
|
-
lockedRooms(): readonly string[]
|
|
36
|
+
locked(room: string): Promise<boolean>;
|
|
37
|
+
lockedRooms(): Promise<readonly string[]>;
|
|
32
38
|
watchLocks(notify: () => void): () => void;
|
|
33
|
-
located(room: string, path: string, destination: string): ReachedDocument | null
|
|
39
|
+
located(room: string, path: string, destination: string): Promise<ReachedDocument | null>;
|
|
40
|
+
room(locator: string): Promise<AppRoom | undefined>;
|
|
34
41
|
};
|
|
35
42
|
export declare function holds(reach: PortReach | null, room: string): boolean;
|
|
36
43
|
export declare function governs(reach: PortReach | null, room: {
|
|
@@ -43,5 +50,5 @@ export declare function governs(reach: PortReach | null, room: {
|
|
|
43
50
|
readonly selection: boolean;
|
|
44
51
|
};
|
|
45
52
|
export declare function planReach(reach: PortReach | null): PlanReach | null;
|
|
46
|
-
export declare function narrowed(runtime: Reachable, given: PortReach | null,
|
|
53
|
+
export declare function narrowed(runtime: Reachable, given: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
47
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,EACV,OAAO,EACP,SAAS,EACT,aAAa,EAEb,YAAY,EAEb,MAAM,iBAAiB,CAAC;AA0BzB,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,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjD,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG,CAClB,KAAK,EAAE,YA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e,GAAG,IAAI,CAAC,CAAC;IAC1F,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACrD,CAAC;AAsCF,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpE;AAMD,wBAAgB,OAAO,CACrB,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,IAAI,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,GAC/F;IAAE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,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,CA4Xd"}
|
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,20 +13,26 @@ 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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
cancel: unconversed('conversation.cancel'),
|
|
24
|
-
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'),
|
|
25
22
|
};
|
|
26
23
|
const NO_CHAT_DRAFT = {
|
|
27
24
|
write: () => Promise.resolve(),
|
|
28
25
|
prepend: () => Promise.resolve(),
|
|
29
26
|
discard: () => Promise.resolve(),
|
|
30
27
|
};
|
|
28
|
+
function areasOf(reach) {
|
|
29
|
+
return reach.areas ?? [];
|
|
30
|
+
}
|
|
31
|
+
function fenced(reach, room, path) {
|
|
32
|
+
return areasOf(reach).some((area) => area.room === room &&
|
|
33
|
+
beneath(area.path, path) &&
|
|
34
|
+
!area.open.some((open) => beneath(open, path)));
|
|
35
|
+
}
|
|
31
36
|
export function holds(reach, room) {
|
|
32
37
|
return (reach === null ||
|
|
33
38
|
reach.rooms.includes(room) ||
|
|
@@ -48,8 +53,9 @@ export function governs(reach, room) {
|
|
|
48
53
|
}
|
|
49
54
|
function covers(reach, room, path) {
|
|
50
55
|
return (reach === null ||
|
|
51
|
-
reach
|
|
52
|
-
|
|
56
|
+
(!fenced(reach, room, path) &&
|
|
57
|
+
(reach.rooms.includes(room) ||
|
|
58
|
+
reach.documents.some((document) => document.room === room && document.path === path))));
|
|
53
59
|
}
|
|
54
60
|
function conversing(reach) {
|
|
55
61
|
return reach === null || reach.conversations;
|
|
@@ -62,6 +68,9 @@ export function planReach(reach) {
|
|
|
62
68
|
documents: [
|
|
63
69
|
...new Set(reach.documents.map(({ room, path }) => documentKey(room, path))),
|
|
64
70
|
].sort(),
|
|
71
|
+
areas: areasOf(reach)
|
|
72
|
+
.map(({ room, path, open }) => ({ room, path, open: [...new Set(open)].sort() }))
|
|
73
|
+
.sort((left, right) => documentKey(left.room, left.path) < documentKey(right.room, right.path) ? -1 : 1),
|
|
65
74
|
};
|
|
66
75
|
}
|
|
67
76
|
function roomsWithin(reach, rooms) {
|
|
@@ -110,7 +119,8 @@ function savedWithin(reach, room, result) {
|
|
|
110
119
|
function statusWithin(reach, status) {
|
|
111
120
|
return {
|
|
112
121
|
...status,
|
|
113
|
-
attentionRequired: status.attentionRequired.filter((entry) =>
|
|
122
|
+
attentionRequired: status.attentionRequired.filter((entry) => covers(reach, entry.room, entry.path)),
|
|
123
|
+
unsent: status.unsent.filter((change) => covers(reach, change.room, change.path)),
|
|
114
124
|
};
|
|
115
125
|
}
|
|
116
126
|
function queueWithin(reach, room, entries) {
|
|
@@ -127,18 +137,24 @@ function queueWithin(reach, room, entries) {
|
|
|
127
137
|
});
|
|
128
138
|
}
|
|
129
139
|
function unreached(room) {
|
|
130
|
-
return runtimeError('room
|
|
140
|
+
return runtimeError('unknown-room', `Unknown Room ${room}`);
|
|
131
141
|
}
|
|
132
142
|
function lockedError(room) {
|
|
133
143
|
return runtimeError(ROOM_LOCKED, `${room} is locked until House confirms its access`, true);
|
|
134
144
|
}
|
|
135
145
|
function deviceUnreached() {
|
|
136
|
-
return runtimeError('device-unreached', 'Only the panel
|
|
146
|
+
return runtimeError('device-unreached', 'Only the panel reaches this device');
|
|
147
|
+
}
|
|
148
|
+
const ATTACH_REQUIRED = 'attach-required';
|
|
149
|
+
function attachRequired() {
|
|
150
|
+
return runtimeError(ATTACH_REQUIRED, 'App code takes a file in with binaryFile.attach');
|
|
151
|
+
}
|
|
152
|
+
function carriesFile(parts) {
|
|
153
|
+
return parts !== null && typeof parts === 'object' && Object.hasOwn(parts, 'file');
|
|
137
154
|
}
|
|
138
|
-
export function narrowed(runtime, given,
|
|
155
|
+
export function narrowed(runtime, given, port) {
|
|
139
156
|
const { md, watch } = runtime;
|
|
140
157
|
let reach = given;
|
|
141
|
-
let port = told;
|
|
142
158
|
const open = new Set();
|
|
143
159
|
function following(begin, locking = false) {
|
|
144
160
|
let stop = begin();
|
|
@@ -154,70 +170,123 @@ export function narrowed(runtime, given, told) {
|
|
|
154
170
|
stop();
|
|
155
171
|
};
|
|
156
172
|
}
|
|
157
|
-
const unlocking = (rooms) => {
|
|
158
|
-
const
|
|
159
|
-
return
|
|
160
|
-
? null
|
|
161
|
-
: { pending: locked.map((room) => ({ room, awaits: 'unlock' })) };
|
|
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' })) };
|
|
162
176
|
};
|
|
163
|
-
const unlocked = (entries) => entries.filter((entry) => !
|
|
164
|
-
const intoLocked = (held) =>
|
|
165
|
-
|
|
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;
|
|
184
|
+
};
|
|
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) => {
|
|
166
228
|
if (topic === 'rooms') {
|
|
167
|
-
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms))));
|
|
229
|
+
return following(() => watch(topic, input, (rooms) => deliver(roomsWithin(reach, rooms)), fail));
|
|
168
230
|
}
|
|
169
231
|
if (topic === 'readiness') {
|
|
170
232
|
return following(() => runtime.watchReadiness(port, reach, deliver));
|
|
171
233
|
}
|
|
172
234
|
if (topic === 'sync-status') {
|
|
173
|
-
return following(() =>
|
|
174
|
-
const
|
|
175
|
-
|
|
235
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (status, locked) => {
|
|
236
|
+
const shown = statusWithin(reach, status);
|
|
237
|
+
return { ...shown, attentionRequired: unlocked(shown.attentionRequired, locked) };
|
|
176
238
|
}), true);
|
|
177
239
|
}
|
|
178
240
|
if (topic === 'room-drafts') {
|
|
179
|
-
return following(() =>
|
|
241
|
+
return following(() => unlockedWatch(topic, input, deliver, fail, (drafts, locked) => unlocked(draftsWithin(reach, drafts), locked)), true);
|
|
180
242
|
}
|
|
181
243
|
if (topic === 'queue') {
|
|
182
244
|
const room = input[0];
|
|
183
|
-
return following(() =>
|
|
184
|
-
if (!holds(reach, room) || runtime.locked(room)) {
|
|
185
|
-
deliver([]);
|
|
186
|
-
return () => { };
|
|
187
|
-
}
|
|
188
|
-
return watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)));
|
|
189
|
-
}, true);
|
|
245
|
+
return following(() => lockedFirst(room, () => watch(topic, input, (entries) => deliver(queueWithin(reach, room, entries)), fail), () => deliver([])), true);
|
|
190
246
|
}
|
|
191
247
|
if (topic === 'query') {
|
|
192
|
-
const
|
|
248
|
+
const planning = runtime.plan(input[0], reach);
|
|
193
249
|
let held = null;
|
|
194
250
|
return following(() => {
|
|
195
|
-
const locked = unlocking(plan.rooms);
|
|
196
|
-
if (locked !== null) {
|
|
197
|
-
const answer = { result: locked, keys: [] };
|
|
198
|
-
if (held === null || changeOf(held, answer) !== null)
|
|
199
|
-
deliver(answer);
|
|
200
|
-
held = digestOf(answer);
|
|
201
|
-
return () => { };
|
|
202
|
-
}
|
|
203
|
-
let first = true;
|
|
204
251
|
let open = true;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
252
|
+
let stop = () => { };
|
|
253
|
+
void (async () => {
|
|
254
|
+
const plan = await planning;
|
|
255
|
+
const locked = await runtime.lockedRooms();
|
|
256
|
+
if (!open)
|
|
257
|
+
return;
|
|
258
|
+
const pending = unlocking(plan.rooms, locked);
|
|
259
|
+
if (pending !== null) {
|
|
260
|
+
const answer = { result: pending, keys: [] };
|
|
261
|
+
if (held === null || changeOf(held, answer) !== null)
|
|
262
|
+
deliver(answer);
|
|
263
|
+
held = digestOf(answer);
|
|
209
264
|
return;
|
|
210
265
|
}
|
|
211
|
-
first =
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
266
|
+
let first = true;
|
|
267
|
+
const heard = (message) => {
|
|
268
|
+
if (!first) {
|
|
269
|
+
held = digestApplied(held, message);
|
|
270
|
+
deliver(message);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
first = false;
|
|
274
|
+
const change = held === null ? message : changeOf(held, message);
|
|
275
|
+
held = digestOf(message);
|
|
276
|
+
if (change !== null)
|
|
277
|
+
deliver(change);
|
|
278
|
+
};
|
|
279
|
+
const current = { ...plan, reach: planReach(reach), locked };
|
|
280
|
+
stop = runtime.watchPlan(current, (message) => {
|
|
281
|
+
if (open)
|
|
282
|
+
heard(message);
|
|
283
|
+
}, (error) => {
|
|
284
|
+
if (open)
|
|
285
|
+
fail(error);
|
|
286
|
+
});
|
|
287
|
+
})().catch((error) => {
|
|
219
288
|
if (open)
|
|
220
|
-
|
|
289
|
+
fail(error);
|
|
221
290
|
});
|
|
222
291
|
return () => {
|
|
223
292
|
open = false;
|
|
@@ -228,7 +297,7 @@ export function narrowed(runtime, given, told) {
|
|
|
228
297
|
if (topic === 'conversation') {
|
|
229
298
|
return following(() => {
|
|
230
299
|
if (conversing(reach))
|
|
231
|
-
return watch(topic, input, deliver);
|
|
300
|
+
return watch(topic, input, deliver, fail);
|
|
232
301
|
deliver(unheldView(input[0]));
|
|
233
302
|
return () => { };
|
|
234
303
|
});
|
|
@@ -236,16 +305,22 @@ export function narrowed(runtime, given, told) {
|
|
|
236
305
|
if (topic === 'conversations' || topic === 'agents') {
|
|
237
306
|
return following(() => {
|
|
238
307
|
if (conversing(reach))
|
|
239
|
-
return watch(topic, input, deliver);
|
|
308
|
+
return watch(topic, input, deliver, fail);
|
|
240
309
|
deliver([]);
|
|
241
310
|
return () => { };
|
|
242
311
|
});
|
|
243
312
|
}
|
|
244
|
-
|
|
313
|
+
if (topic === 'figures') {
|
|
314
|
+
if (reach === null)
|
|
315
|
+
return watch(topic, input, deliver, fail);
|
|
316
|
+
fail(deviceUnreached());
|
|
317
|
+
return () => { };
|
|
318
|
+
}
|
|
319
|
+
return watch(topic, input, deliver, fail);
|
|
245
320
|
};
|
|
246
321
|
const files = new Map();
|
|
247
322
|
let handed = 0;
|
|
248
|
-
|
|
323
|
+
async function hand(reading) {
|
|
249
324
|
const answer = await reading;
|
|
250
325
|
if (answer.kind !== 'binary')
|
|
251
326
|
return answer;
|
|
@@ -253,78 +328,92 @@ export function narrowed(runtime, given, told) {
|
|
|
253
328
|
const file = String(handed);
|
|
254
329
|
files.set(file, answer.file);
|
|
255
330
|
return { ...answer, file };
|
|
256
|
-
}
|
|
331
|
+
}
|
|
257
332
|
const conversation = () => (conversing(reach) ? md.conversation : NO_CONVERSATION);
|
|
258
333
|
const chatDraft = () => (conversing(reach) ? md.chatDraft : NO_CHAT_DRAFT);
|
|
259
334
|
const view = {
|
|
260
335
|
...md,
|
|
261
|
-
rooms: () => roomsWithin(reach,
|
|
262
|
-
query: ((input) => {
|
|
263
|
-
const plan = runtime.plan(input, reach);
|
|
264
|
-
|
|
336
|
+
rooms: () => md.rooms().then((rooms) => roomsWithin(reach, rooms)),
|
|
337
|
+
query: (async (input) => {
|
|
338
|
+
const plan = await runtime.plan(input, reach);
|
|
339
|
+
const locked = await runtime.lockedRooms();
|
|
340
|
+
return unlocking(plan.rooms, locked) ?? runtime.query({ ...plan, locked });
|
|
265
341
|
}),
|
|
266
|
-
search: (input) =>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
types(room) {
|
|
270
|
-
if (holds(reach, room) && runtime.locked(room))
|
|
342
|
+
search: (input) => runtime.search(input, reach),
|
|
343
|
+
async types(room) {
|
|
344
|
+
if (holds(reach, room) && (await runtime.locked(room)))
|
|
271
345
|
throw lockedError(room);
|
|
272
346
|
if (wholly(reach, room))
|
|
273
347
|
return md.types(room);
|
|
274
348
|
if (!holds(reach, room))
|
|
275
349
|
return structuredClone(UNHELD_TYPES);
|
|
276
|
-
|
|
277
|
-
return typesWithin(reach, listed, md.types(room));
|
|
350
|
+
return typesWithin(reach, await runtime.room(room), await md.types(room));
|
|
278
351
|
},
|
|
279
352
|
async save(room, roomDrafts, writtenBy) {
|
|
280
353
|
if (!holds(reach, room))
|
|
281
354
|
throw unreached(room);
|
|
282
|
-
if (runtime.locked(room))
|
|
355
|
+
if (await runtime.locked(room)) {
|
|
283
356
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
357
|
+
}
|
|
284
358
|
const held = (await Promise.all(roomDrafts.map(({ path }) => md.roomDraft.read(room, path)))).map((draft) => draft?.parts.move);
|
|
285
359
|
const outside = roomDrafts.find(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]));
|
|
286
360
|
if (outside !== undefined) {
|
|
287
361
|
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
288
362
|
}
|
|
289
|
-
if (intoLocked(held))
|
|
363
|
+
if (await intoLocked(held))
|
|
290
364
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
291
365
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
292
366
|
},
|
|
293
367
|
async saveParts(room, parts, writtenBy) {
|
|
294
368
|
if (!holds(reach, room))
|
|
295
369
|
throw unreached(room);
|
|
296
|
-
|
|
370
|
+
const filed = reach === null ? undefined : parts.find(({ parts: one }) => carriesFile(one));
|
|
371
|
+
if (filed !== undefined) {
|
|
372
|
+
return { outcome: 'refused', code: ATTACH_REQUIRED, retryable: false, file: filed.path };
|
|
373
|
+
}
|
|
374
|
+
if (await runtime.locked(room)) {
|
|
297
375
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
298
|
-
|
|
376
|
+
}
|
|
377
|
+
const held = parts.map(({ path, parts: one }) => readParts(one, path).move);
|
|
299
378
|
if (parts.some(({ path }, at) => !covers(reach, room, path) || !moves(reach, room, held[at]))) {
|
|
300
379
|
throw unreached(room);
|
|
301
380
|
}
|
|
302
|
-
if (intoLocked(held))
|
|
381
|
+
if (await intoLocked(held))
|
|
303
382
|
return { outcome: 'refused', code: ROOM_LOCKED, retryable: true };
|
|
304
383
|
return savedWithin(reach, room, await md.saveParts(room, parts, writtenBy));
|
|
305
384
|
},
|
|
306
|
-
resolve(room, path, destination) {
|
|
307
|
-
const at = runtime.located(room, path, destination);
|
|
385
|
+
async resolve(room, path, destination) {
|
|
386
|
+
const at = await runtime.located(room, path, destination);
|
|
308
387
|
return at !== null && !covers(reach, at.room, at.path)
|
|
309
|
-
?
|
|
388
|
+
? UNREADABLE
|
|
310
389
|
: md.resolve(room, path, destination);
|
|
311
390
|
},
|
|
312
|
-
history: (room, path, query) => !covers(reach, room, path)
|
|
313
|
-
?
|
|
314
|
-
: runtime.locked(room)
|
|
315
|
-
?
|
|
391
|
+
history: async (room, path, query) => !covers(reach, room, path)
|
|
392
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
393
|
+
: (await runtime.locked(room))
|
|
394
|
+
? lockedRoom(room)
|
|
316
395
|
: md.history(room, path, query),
|
|
317
396
|
binaryFile: {
|
|
318
|
-
read: (room, path, revision) => !covers(reach, room, path)
|
|
319
|
-
?
|
|
320
|
-
: runtime.locked(room)
|
|
321
|
-
?
|
|
397
|
+
read: async (room, path, revision) => !covers(reach, room, path)
|
|
398
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
399
|
+
: (await runtime.locked(room))
|
|
400
|
+
? lockedRoom(room)
|
|
322
401
|
: hand(md.binaryFile.read(room, path, revision)),
|
|
323
|
-
link: (room, path, revision) => !covers(reach, room, path)
|
|
324
|
-
?
|
|
325
|
-
: runtime.locked(room)
|
|
326
|
-
?
|
|
402
|
+
link: async (room, path, revision) => !covers(reach, room, path)
|
|
403
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
404
|
+
: (await runtime.locked(room))
|
|
405
|
+
? lockedRoom(room)
|
|
327
406
|
: md.binaryFile.link(room, path, revision),
|
|
407
|
+
show: async (room, path, revision) => !covers(reach, room, path)
|
|
408
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
409
|
+
: (await runtime.locked(room))
|
|
410
|
+
? lockedRoom(room)
|
|
411
|
+
: hand(md.binaryFile.show(room, path, revision)),
|
|
412
|
+
attach: async (room, file) => !wholly(reach, room)
|
|
413
|
+
? failure({ kind: 'room-not-readable', locator: room })
|
|
414
|
+
: (await runtime.locked(room))
|
|
415
|
+
? lockedRoom(room)
|
|
416
|
+
: md.binaryFile.attach(room, file),
|
|
328
417
|
async part(file, part) {
|
|
329
418
|
const key = files.get(file);
|
|
330
419
|
if (key === undefined)
|
|
@@ -336,40 +425,37 @@ export function narrowed(runtime, given, told) {
|
|
|
336
425
|
},
|
|
337
426
|
},
|
|
338
427
|
reached: async (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
339
|
-
!runtime.locked(room) &&
|
|
428
|
+
!(await runtime.locked(room)) &&
|
|
340
429
|
(await md.reached(room, roomVersion, path)),
|
|
341
430
|
log: () => (reach === null ? md.log() : ''),
|
|
342
431
|
cleanUp: () => (reach === null ? md.cleanUp() : Promise.reject(deviceUnreached())),
|
|
432
|
+
unsent: () => (reach === null ? md.unsent() : Promise.reject(deviceUnreached())),
|
|
433
|
+
reset: () => (reach === null ? md.reset() : Promise.reject(deviceUnreached())),
|
|
343
434
|
roomDraft: {
|
|
344
|
-
list: () => md.roomDraft.list()
|
|
435
|
+
list: async () => unlocked(draftsWithin(reach, await md.roomDraft.list()), await runtime.lockedRooms()),
|
|
345
436
|
async read(room, path) {
|
|
346
437
|
if (!covers(reach, room, path))
|
|
347
438
|
return null;
|
|
348
|
-
if (runtime.locked(room))
|
|
439
|
+
if (await runtime.locked(room))
|
|
349
440
|
throw lockedError(room);
|
|
350
441
|
return shownDraft(reach, await md.roomDraft.read(room, path));
|
|
351
442
|
},
|
|
352
|
-
write(room, path, revision, parts, next) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return Promise.reject(error);
|
|
364
|
-
}
|
|
365
|
-
return md.roomDraft
|
|
366
|
-
.write(room, path, revision, parts, next)
|
|
367
|
-
.then((written) => writeWithin(reach, written));
|
|
443
|
+
async write(room, path, revision, parts, next) {
|
|
444
|
+
if (reach !== null && carriesFile(parts))
|
|
445
|
+
throw attachRequired();
|
|
446
|
+
const move = readParts(parts, path).move;
|
|
447
|
+
if (!covers(reach, room, path) || !moves(reach, room, move))
|
|
448
|
+
throw unreached(room);
|
|
449
|
+
if (await runtime.locked(room))
|
|
450
|
+
throw lockedError(room);
|
|
451
|
+
if (await intoLocked([move]))
|
|
452
|
+
throw lockedError(move.room);
|
|
453
|
+
return writeWithin(reach, await md.roomDraft.write(room, path, revision, parts, next));
|
|
368
454
|
},
|
|
369
455
|
async discard(room, path, revision) {
|
|
370
456
|
if (!covers(reach, room, path))
|
|
371
457
|
return staleWrite(null);
|
|
372
|
-
if (runtime.locked(room))
|
|
458
|
+
if (await runtime.locked(room))
|
|
373
459
|
throw lockedError(room);
|
|
374
460
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
375
461
|
},
|
|
@@ -379,15 +465,9 @@ export function narrowed(runtime, given, told) {
|
|
|
379
465
|
read: (id, options) => conversation().read(id, options),
|
|
380
466
|
create: (input) => conversation().create(input),
|
|
381
467
|
send: (id, operation, draft) => conversation().send(id, operation, draft),
|
|
382
|
-
attach: (room, file) => !wholly(reach, room)
|
|
383
|
-
? Promise.resolve(failure({ kind: 'room-not-readable', locator: room }))
|
|
384
|
-
: runtime.locked(room)
|
|
385
|
-
? Promise.resolve(lockedRoom(room))
|
|
386
|
-
: conversation().attach(room, file),
|
|
387
468
|
answer: (id, answer) => conversation().answer(id, answer),
|
|
388
469
|
interrupt: (id) => conversation().interrupt(id),
|
|
389
470
|
kill: (id) => conversation().kill(id),
|
|
390
|
-
cancel: (id, turn) => conversation().cancel(id, turn),
|
|
391
471
|
delete: (id) => conversation().delete(id),
|
|
392
472
|
},
|
|
393
473
|
chatDraft: {
|
|
@@ -405,10 +485,5 @@ export function narrowed(runtime, given, told) {
|
|
|
405
485
|
for (const restart of [...open])
|
|
406
486
|
restart();
|
|
407
487
|
},
|
|
408
|
-
facts(next) {
|
|
409
|
-
port = next;
|
|
410
|
-
for (const restart of [...open])
|
|
411
|
-
restart();
|
|
412
|
-
},
|
|
413
488
|
};
|
|
414
489
|
}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { MdRuntimeClient } from './client.js';
|
|
2
3
|
import type { AppRoom, ConnectionRefusal, SavedRoomDraft, SaveResult } from './connection.js';
|
|
3
4
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
5
|
import type { ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
5
6
|
import { type RuntimeError } from './failure.js';
|
|
6
7
|
import type { QueueEntry } from './outcome.js';
|
|
7
|
-
import type {
|
|
8
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
8
9
|
import type { Readiness } from './readiness.js';
|
|
9
10
|
import type { RoomDraft, RoomDraftParts } from './room-draft.js';
|
|
10
11
|
import type { SyncStatus } from './status.js';
|
|
@@ -23,6 +24,7 @@ export declare function useObserve(client: Client, topic: 'storage-loss'): Obser
|
|
|
23
24
|
export declare function useObserve(client: Client, topic: 'sync-status'): Observed<SyncStatus>;
|
|
24
25
|
export declare function useObserve(client: Client, topic: 'service-mode'): Observed<ServiceMode>;
|
|
25
26
|
export declare function useObserve(client: Client, topic: 'member'): Observed<Member | null>;
|
|
27
|
+
export declare function useObserve(client: Client, topic: 'authority-changes'): Observed<number>;
|
|
26
28
|
export declare function useObserve(client: Client, topic: 'query', query: DocumentQuery): Observed<DocumentResult | PendingResult>;
|
|
27
29
|
export declare function useObserve(client: Client, topic: 'query', query: GroupQuery): Observed<GroupResult | PendingResult>;
|
|
28
30
|
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,iBAAiB,CAAC;AAC9F,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,
|
|
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,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9F,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,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACh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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"}
|