@agentshouse/mdruntime 0.1.0-cd71aba4d0215 → 0.1.0-cd8d184c6fbe0
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 +21 -19
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +32 -22
- package/dist/act-lanes.d.ts +11 -14
- package/dist/act-lanes.d.ts.map +1 -1
- package/dist/act-lanes.js +53 -5
- package/dist/actions.d.ts +1 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +135 -55
- package/dist/adapter.d.ts +168 -29
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +2 -7
- package/dist/{binary.d.ts → attachment.d.ts} +8 -4
- package/dist/attachment.d.ts.map +1 -0
- package/dist/attachment.js +15 -0
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +347 -0
- package/dist/chain.d.ts +1 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +5 -2
- package/dist/change.d.ts +6 -2
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +3 -0
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +2 -4
- package/dist/client.d.ts +27 -15
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +29 -57
- package/dist/collection.d.ts +6 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -9
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +4 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +88 -44
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +15 -14
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +21 -9
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +19 -8
- package/dist/conversation-row.d.ts +20 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +30 -7
- package/dist/conversation.d.ts +30 -12
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +273 -193
- package/dist/declaration.js +3 -3
- package/dist/discovery.d.ts +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +30 -8
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +2 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +25 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +111 -34
- package/dist/expectation.d.ts +25 -14
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +51 -20
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -1
- package/dist/figures.d.ts +1 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +6 -4
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/host.d.ts +7 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +77 -31
- package/dist/house-query.d.ts +24 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +102 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +23 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/install.d.ts +9 -3
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +44 -46
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +42 -29
- package/dist/listing.d.ts +24 -12
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +50 -21
- package/dist/live.d.ts +19 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +94 -36
- package/dist/loaded.d.ts +7 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +46 -0
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +4 -3
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +2 -3
- package/dist/media.d.ts +19 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +181 -34
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +66 -22
- package/dist/messages.d.ts +21 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +43 -13
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +10 -7
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +5 -8
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +206 -69
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opened.d.ts +5 -5
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +2 -2
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +22 -10
- package/dist/outcome.d.ts +30 -13
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +21 -6
- package/dist/overlay.d.ts +21 -7
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +112 -39
- package/dist/parts.d.ts +4 -9
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +30 -15
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/preparation.d.ts +33 -7
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +198 -87
- package/dist/presence.d.ts +8 -2
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +24 -13
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +133 -73
- package/dist/query.d.ts +2 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +1 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -8
- package/dist/queue.d.ts +2 -2
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +73 -48
- package/dist/reach.d.ts +15 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +180 -39
- package/dist/react.d.ts +16 -11
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +22 -4
- package/dist/readiness.d.ts +23 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +18 -10
- package/dist/reads.d.ts +1 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +17 -6
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +2 -1
- package/dist/reference-forms.d.ts +4 -0
- package/dist/reference-forms.d.ts.map +1 -0
- package/dist/reference-forms.js +74 -0
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +4 -4
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +1 -3
- package/dist/replica.d.ts +3 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +5 -5
- package/dist/room-draft.d.ts +31 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +262 -36
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +12 -7
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +47 -0
- package/dist/rows.d.ts +11 -2
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +24 -10
- package/dist/run-tables.d.ts +25 -0
- package/dist/run-tables.d.ts.map +1 -0
- package/dist/run-tables.js +98 -0
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runs.d.ts +27 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +92 -0
- package/dist/runtime.d.ts +5 -4
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +105 -124
- package/dist/saves.d.ts +7 -5
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +107 -57
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -2
- package/dist/selector.d.ts +3 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +22 -0
- package/dist/shown.d.ts +5 -2
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +79 -43
- package/dist/socket/lanes.d.ts +10 -3
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +29 -6
- package/dist/socket/session.d.ts +4 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +6 -4
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +10 -9
- package/dist/source.d.ts +18 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +36 -2
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +30 -8
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +70 -26
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store.d.ts +15 -10
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +12 -5
- package/dist/stored.d.ts +41 -16
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +215 -57
- package/dist/surface.d.ts +20 -8
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +62 -27
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +52 -35
- package/dist/tables.d.ts +41 -52
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +110 -326
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +3 -4
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +50 -10
- package/dist/wire.d.ts +40 -16
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +22 -14
- package/package.json +4 -4
- package/dist/binary.d.ts.map +0 -1
- package/dist/binary.js +0 -8
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
package/dist/socket/lanes.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import type { CallResult } from '../outcome.js';
|
|
1
2
|
export type Live = () => boolean;
|
|
3
|
+
export type KeptSender = {
|
|
4
|
+
next(): Promise<CallResult>;
|
|
5
|
+
};
|
|
2
6
|
type LaneRules = {
|
|
3
7
|
generation(): number;
|
|
4
8
|
continuing(): boolean;
|
|
@@ -12,9 +16,12 @@ export type Lanes = {
|
|
|
12
16
|
roomWork(): number;
|
|
13
17
|
current(): Promise<unknown>;
|
|
14
18
|
finished(): Promise<unknown>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
sender(operation: string): KeptSender | undefined;
|
|
20
|
+
sending(operation: string, sender: KeptSender): void;
|
|
21
|
+
sent(operation: string, sender: KeptSender): void;
|
|
22
|
+
settled(operation: string): Promise<void>;
|
|
23
|
+
settle(operation: string, lost: boolean): void;
|
|
24
|
+
unclaimed(operation: string): boolean;
|
|
18
25
|
};
|
|
19
26
|
export declare function createLanes({ generation, continuing, stopping, failed }: LaneRules): Lanes;
|
|
20
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lanes.d.ts","sourceRoot":"","sources":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S,CAAC;IAClD,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACrD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAClD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CACvC,CAAC;AAIF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,GAAG,KAAK,CAqG1F"}
|
package/dist/socket/lanes.js
CHANGED
|
@@ -4,7 +4,9 @@ export function createLanes({ generation, continuing, stopping, failed }) {
|
|
|
4
4
|
const roomLanes = new Map();
|
|
5
5
|
const roomReads = { free: ROOM_READS, waiting: [] };
|
|
6
6
|
const working = new Set();
|
|
7
|
-
const
|
|
7
|
+
const senders = new Map();
|
|
8
|
+
const settlements = new Map();
|
|
9
|
+
const unclaimed = new Set();
|
|
8
10
|
let roomWork = 0;
|
|
9
11
|
async function admittedRead(work) {
|
|
10
12
|
while (roomReads.free === 0) {
|
|
@@ -69,12 +71,33 @@ export function createLanes({ generation, continuing, stopping, failed }) {
|
|
|
69
71
|
.filter((held) => held.generation === generation())
|
|
70
72
|
.map((held) => held.chain)),
|
|
71
73
|
finished: () => Promise.all(working),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
sender: (operation) => senders.get(operation),
|
|
75
|
+
sending(operation, sender) {
|
|
76
|
+
senders.set(operation, sender);
|
|
75
77
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
sent(operation, sender) {
|
|
79
|
+
if (senders.get(operation) === sender)
|
|
80
|
+
senders.delete(operation);
|
|
78
81
|
},
|
|
82
|
+
settled(operation) {
|
|
83
|
+
if (unclaimed.delete(operation))
|
|
84
|
+
return Promise.resolve();
|
|
85
|
+
return new Promise((settle) => {
|
|
86
|
+
const earlier = settlements.get(operation);
|
|
87
|
+
settlements.set(operation, () => {
|
|
88
|
+
earlier?.();
|
|
89
|
+
settle();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
settle(operation, lost) {
|
|
94
|
+
const settle = settlements.get(operation);
|
|
95
|
+
settlements.delete(operation);
|
|
96
|
+
if (settle !== undefined)
|
|
97
|
+
settle();
|
|
98
|
+
else if (lost)
|
|
99
|
+
unclaimed.add(operation);
|
|
100
|
+
},
|
|
101
|
+
unclaimed: (operation) => unclaimed.has(operation),
|
|
79
102
|
};
|
|
80
103
|
}
|
package/dist/socket/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Authorization, ProviderRefusal, ServiceMode } from '../adapter.js';
|
|
1
|
+
import type { Authorization, Discovery, ProviderRefusal, QueriedRoom, ServiceMode } from '../adapter.js';
|
|
2
2
|
import { type Cell } from '../cell.js';
|
|
3
3
|
import type { Open } from '../open.js';
|
|
4
4
|
import type { CycleProgress, SyncStatus } from '../status.js';
|
|
@@ -23,6 +23,9 @@ export type Session = {
|
|
|
23
23
|
readonly discoveries: number;
|
|
24
24
|
readonly roomsNamed: boolean;
|
|
25
25
|
readonly roomsListed: boolean;
|
|
26
|
+
readonly queriesOnly: readonly QueriedRoom[];
|
|
27
|
+
readonly unstored: Discovery | null;
|
|
28
|
+
readonly lastCompleted: string | null;
|
|
26
29
|
readonly serviceMode: ServiceMode;
|
|
27
30
|
readonly haltedRefusal: boolean;
|
|
28
31
|
readonly openSignals: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/socket/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sour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WAAW,EAAE,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAwBrF"}
|
package/dist/socket/session.js
CHANGED
package/dist/socket.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { Adapter, Authorization, ConversationEvent, Discovery, HeldRoom, RoomStreamEvent, ServiceMode } from './adapter.js';
|
|
1
|
+
import type { Adapter, Authorization, ConversationEvent, Discovery, HeldRoom, RoomStreamEvent, RunEvent, ServiceMode } from './adapter.js';
|
|
2
2
|
import type { Reads } from './bootstrap.js';
|
|
3
3
|
import type { Cell } from './cell.js';
|
|
4
|
-
import type { Log } from './log.js';
|
|
5
4
|
import type { Retries } from './retried.js';
|
|
6
5
|
import { type Admission } from './socket/admission.js';
|
|
7
6
|
import { type Answers } from './socket/answers.js';
|
|
8
7
|
import { type Lanes } from './socket/lanes.js';
|
|
9
8
|
import { type Session } from './socket/session.js';
|
|
10
|
-
export type { Live } from './socket/lanes.js';
|
|
9
|
+
export type { KeptSender, Live } from './socket/lanes.js';
|
|
11
10
|
export type { ConnectionRefusal, ConnectionRefusalCode, Moving, RefusalReason, } from './socket/session.js';
|
|
12
11
|
type SocketEvent = {
|
|
13
12
|
readonly kind: 'opened';
|
|
@@ -31,7 +30,9 @@ export type RuntimeSocket = Admission & Answers & {
|
|
|
31
30
|
readonly ready: Promise<void>;
|
|
32
31
|
readonly firstDiscovery: Promise<void>;
|
|
33
32
|
conversations(): Adapter['conversations'];
|
|
33
|
+
runs(): Adapter['runs'];
|
|
34
34
|
search(): Adapter['search'];
|
|
35
|
+
queryHouse(): Adapter['queryHouse'];
|
|
35
36
|
discover(authorized: Authorization): ReturnType<NonNullable<Adapter['discover']>> | undefined;
|
|
36
37
|
follows: Adapter['follows'];
|
|
37
38
|
mutate: Adapter['mutate'];
|
|
@@ -43,6 +44,7 @@ export type RuntimeSocket = Admission & Answers & {
|
|
|
43
44
|
authorize(): Promise<void>;
|
|
44
45
|
observe(listen: (event: SocketEvent) => void): void;
|
|
45
46
|
observeConversations(listen: (event: ConversationEvent) => void): void;
|
|
47
|
+
observeRuns(listen: (event: RunEvent) => void): void;
|
|
46
48
|
observeServiceMode(listen: (mode: ServiceMode) => void): void;
|
|
47
49
|
close(): void;
|
|
48
50
|
readyFromStore(): void;
|
|
@@ -64,5 +66,5 @@ export type RuntimeSocket = Admission & Answers & {
|
|
|
64
66
|
abortReads(): void;
|
|
65
67
|
stopReads(): void;
|
|
66
68
|
};
|
|
67
|
-
export declare function createSocket(adapter: Adapter,
|
|
69
|
+
export declare function createSocket(adapter: Adapter, retries: Retries, authorization: Authorization | undefined): RuntimeSocket;
|
|
68
70
|
//# sourceMappingURL=socket.d.ts.map
|
package/dist/socket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../src/socket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OA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AE,aAAa,GAAG,SAAS,GACvC,aAAa,CAgKf"}
|
package/dist/socket.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createAnswers } from './socket/answers.js';
|
|
|
3
3
|
import { createLanes } from './socket/lanes.js';
|
|
4
4
|
import { createReads } from './socket/reads.js';
|
|
5
5
|
import { createSession } from './socket/session.js';
|
|
6
|
-
export function createSocket(adapter,
|
|
6
|
+
export function createSocket(adapter, retries, authorization) {
|
|
7
7
|
const held = createReads(adapter);
|
|
8
8
|
const admission = createAdmission();
|
|
9
9
|
const answers = createAnswers();
|
|
@@ -18,6 +18,7 @@ export function createSocket(adapter, journal, retries, authorization) {
|
|
|
18
18
|
});
|
|
19
19
|
let withdrawStream;
|
|
20
20
|
let withdrawConversations;
|
|
21
|
+
let withdrawRuns;
|
|
21
22
|
let withdrawServiceMode;
|
|
22
23
|
let socketOpen = false;
|
|
23
24
|
let announced = false;
|
|
@@ -76,7 +77,9 @@ export function createSocket(adapter, journal, retries, authorization) {
|
|
|
76
77
|
ready,
|
|
77
78
|
firstDiscovery,
|
|
78
79
|
conversations: () => adapter.conversations,
|
|
80
|
+
runs: () => adapter.runs,
|
|
79
81
|
search: () => adapter.search,
|
|
82
|
+
queryHouse: () => adapter.queryHouse,
|
|
80
83
|
discover: (authorized) => adapter.discover?.(authorized),
|
|
81
84
|
follows: (locator, roomVersion, next) => adapter.follows(locator, roomVersion, next),
|
|
82
85
|
mutate: (authorized, request, keepUpload) => adapter.mutate(authorized, request, keepUpload),
|
|
@@ -88,14 +91,7 @@ export function createSocket(adapter, journal, retries, authorization) {
|
|
|
88
91
|
async authorize() {
|
|
89
92
|
if (session.now().authorization !== undefined)
|
|
90
93
|
return;
|
|
91
|
-
|
|
92
|
-
session.set({ authorization: await adapter.authorize() });
|
|
93
|
-
journal.record('connection authorize');
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
journal.record('connection authorize transport-uncertainty');
|
|
97
|
-
throw error;
|
|
98
|
-
}
|
|
94
|
+
session.set({ authorization: await adapter.authorize() });
|
|
99
95
|
},
|
|
100
96
|
observe(listen) {
|
|
101
97
|
const stream = adapter.roomStream;
|
|
@@ -113,6 +109,9 @@ export function createSocket(adapter, journal, retries, authorization) {
|
|
|
113
109
|
return;
|
|
114
110
|
withdrawConversations = stream.observe(listen);
|
|
115
111
|
},
|
|
112
|
+
observeRuns(listen) {
|
|
113
|
+
withdrawRuns = adapter.runs?.observe(listen);
|
|
114
|
+
},
|
|
116
115
|
observeServiceMode(listen) {
|
|
117
116
|
withdrawServiceMode = adapter.serviceMode?.observe(listen);
|
|
118
117
|
},
|
|
@@ -123,6 +122,8 @@ export function createSocket(adapter, journal, retries, authorization) {
|
|
|
123
122
|
withdrawStream = undefined;
|
|
124
123
|
withdrawConversations?.();
|
|
125
124
|
withdrawConversations = undefined;
|
|
125
|
+
withdrawRuns?.();
|
|
126
|
+
withdrawRuns = undefined;
|
|
126
127
|
withdrawServiceMode?.();
|
|
127
128
|
},
|
|
128
129
|
readyFromStore: () => readyFromStore(),
|
package/dist/source.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type RequestAnswer = 'at_once' | 'ask_me' | 'off';
|
|
1
2
|
export type HouseSource = {
|
|
2
3
|
readonly kind: 'request';
|
|
3
4
|
readonly request: string;
|
|
@@ -8,8 +9,12 @@ export type HouseSource = {
|
|
|
8
9
|
};
|
|
9
10
|
readonly room: {
|
|
10
11
|
readonly ref: string;
|
|
12
|
+
readonly handle: string;
|
|
11
13
|
readonly name: string;
|
|
12
14
|
};
|
|
15
|
+
readonly sent: string;
|
|
16
|
+
readonly instruction: string | null;
|
|
17
|
+
readonly answer: RequestAnswer | null;
|
|
13
18
|
readonly approved: string | null;
|
|
14
19
|
} | {
|
|
15
20
|
readonly kind: 'mail';
|
|
@@ -39,19 +44,25 @@ export type HouseSource = {
|
|
|
39
44
|
readonly kind: 'declined';
|
|
40
45
|
readonly agent: string;
|
|
41
46
|
readonly owner: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'restart';
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'instructions_proposal';
|
|
51
|
+
readonly proposal: string;
|
|
52
|
+
readonly room: {
|
|
53
|
+
readonly ref: string;
|
|
54
|
+
readonly handle: string;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
};
|
|
57
|
+
readonly text: string;
|
|
58
|
+
readonly baseVersion: number | null;
|
|
59
|
+
readonly waiting: boolean;
|
|
42
60
|
};
|
|
43
61
|
export type ChatRequest = {
|
|
44
62
|
readonly request: string;
|
|
45
63
|
readonly room: string;
|
|
46
64
|
readonly message?: string;
|
|
47
65
|
};
|
|
48
|
-
export type ChatRoomRequest = {
|
|
49
|
-
readonly request: string;
|
|
50
|
-
readonly room: {
|
|
51
|
-
readonly ref: string;
|
|
52
|
-
readonly name: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
66
|
type RequestAgentFunction = {
|
|
56
67
|
readonly name: string;
|
|
57
68
|
readonly version: number;
|
package/dist/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;IACtE,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.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AEF,KAAK,oBAAoB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAmEhF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CA+ClF"}
|
package/dist/source.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { record, text } from './read.js';
|
|
2
|
+
const ANSWERS = ['at_once', 'ask_me', 'off'];
|
|
2
3
|
function agentFunctionOf(value) {
|
|
3
4
|
if (value === null)
|
|
4
5
|
return null;
|
|
@@ -7,6 +8,9 @@ function agentFunctionOf(value) {
|
|
|
7
8
|
const version = agentFunction.version;
|
|
8
9
|
return name === null || typeof version !== 'number' ? undefined : { name, version };
|
|
9
10
|
}
|
|
11
|
+
function answerOf(value) {
|
|
12
|
+
return ANSWERS.find((one) => one === value) ?? null;
|
|
13
|
+
}
|
|
10
14
|
function requestOf(source) {
|
|
11
15
|
const request = text(source, 'request');
|
|
12
16
|
const agentFunction = agentFunctionOf(source.agent_function);
|
|
@@ -14,26 +18,56 @@ function requestOf(source) {
|
|
|
14
18
|
const by = text(requester, 'name');
|
|
15
19
|
const room = record(source.room);
|
|
16
20
|
const ref = text(room, 'ref');
|
|
21
|
+
const handle = text(room, 'handle');
|
|
17
22
|
const called = text(room, 'name');
|
|
23
|
+
const sent = typeof source.sent === 'string' ? source.sent : null;
|
|
18
24
|
if (request === null ||
|
|
19
25
|
agentFunction === undefined ||
|
|
20
26
|
by === null ||
|
|
21
27
|
ref === null ||
|
|
22
|
-
|
|
28
|
+
handle === null ||
|
|
29
|
+
called === null ||
|
|
30
|
+
sent === null)
|
|
23
31
|
return null;
|
|
24
32
|
return {
|
|
25
33
|
kind: 'request',
|
|
26
34
|
request,
|
|
27
35
|
agentFunction,
|
|
28
36
|
requester: { name: by, room: text(requester, 'room') !== null },
|
|
29
|
-
room: { ref, name: called },
|
|
37
|
+
room: { ref, handle, name: called },
|
|
38
|
+
sent,
|
|
39
|
+
instruction: text(source, 'instruction'),
|
|
40
|
+
answer: answerOf(source.answer),
|
|
30
41
|
approved: text(source, 'approved_at'),
|
|
31
42
|
};
|
|
32
43
|
}
|
|
44
|
+
function proposalOf(source) {
|
|
45
|
+
const proposal = text(source, 'proposal');
|
|
46
|
+
const room = record(source.room);
|
|
47
|
+
const ref = text(room, 'ref');
|
|
48
|
+
const handle = text(room, 'handle');
|
|
49
|
+
const called = text(room, 'name');
|
|
50
|
+
const proposed = typeof source.text === 'string' ? source.text : null;
|
|
51
|
+
const base = source.base_version;
|
|
52
|
+
if (proposal === null || ref === null || handle === null || called === null || proposed === null)
|
|
53
|
+
return null;
|
|
54
|
+
return {
|
|
55
|
+
kind: 'instructions_proposal',
|
|
56
|
+
proposal,
|
|
57
|
+
room: { ref, handle, name: called },
|
|
58
|
+
text: proposed,
|
|
59
|
+
baseVersion: typeof base === 'number' ? base : null,
|
|
60
|
+
waiting: source.state === 'waiting',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
33
63
|
export function sourceOf(value, sender) {
|
|
34
64
|
const source = record(value);
|
|
35
65
|
if (source.kind === 'request')
|
|
36
66
|
return requestOf(source);
|
|
67
|
+
if (source.kind === 'instructions_proposal')
|
|
68
|
+
return proposalOf(source);
|
|
69
|
+
if (source.kind === 'restart')
|
|
70
|
+
return { kind: 'restart' };
|
|
37
71
|
if (source.kind === 'trigger') {
|
|
38
72
|
const trigger = text(record(source.trigger), 'description');
|
|
39
73
|
const room = record(source.room);
|
package/dist/store/installs.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export declare const NO_INSTALL: RoomInstall;
|
|
|
21
21
|
export type Installs = {
|
|
22
22
|
of(locator: string): RoomInstall;
|
|
23
23
|
change(locator: string, next: (held: RoomInstall) => RoomInstall): void;
|
|
24
|
-
underway(): ReadonlySet<string>;
|
|
24
|
+
underway(among: readonly string[] | null): ReadonlySet<string>;
|
|
25
25
|
transferring(): readonly string[];
|
|
26
|
-
|
|
26
|
+
arrivalsDue(locator: string, now: number, everyMs: number): readonly string[];
|
|
27
27
|
};
|
|
28
28
|
export declare function createInstalls(): Installs;
|
|
29
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installs.d.ts","sourceRoot":"","sources":["../../src/store/installs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,SAAS,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,SAAS,EAAE,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAYxB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,M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I,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAC;IACxE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/D,YAAY,IAAI,SAAS,MAAM,EAAE,CAAC;IAClC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CAC/E,CAAC;AAEF,wBAAgB,cAAc,IAAI,QAAQ,CA8BzC"}
|
package/dist/store/installs.js
CHANGED
|
@@ -14,6 +14,7 @@ export const NO_INSTALL = {
|
|
|
14
14
|
export function createInstalls() {
|
|
15
15
|
const rooms = new Map();
|
|
16
16
|
let arrivalReported = 0;
|
|
17
|
+
const arrived = new Set();
|
|
17
18
|
function matching(held) {
|
|
18
19
|
return [...rooms].filter(([, room]) => held(room)).map(([locator]) => locator);
|
|
19
20
|
}
|
|
@@ -22,13 +23,18 @@ export function createInstalls() {
|
|
|
22
23
|
change(locator, next) {
|
|
23
24
|
rooms.set(locator, next(rooms.get(locator) ?? NO_INSTALL));
|
|
24
25
|
},
|
|
25
|
-
underway: () => new Set(
|
|
26
|
+
underway: (among) => new Set(among === null
|
|
27
|
+
? matching(({ installing }) => installing)
|
|
28
|
+
: among.filter((locator) => rooms.get(locator)?.installing === true)),
|
|
26
29
|
transferring: () => matching(({ transfer }) => transfer !== null),
|
|
27
|
-
|
|
30
|
+
arrivalsDue(locator, now, everyMs) {
|
|
31
|
+
arrived.add(locator);
|
|
28
32
|
if (now - arrivalReported < everyMs)
|
|
29
|
-
return
|
|
33
|
+
return [];
|
|
30
34
|
arrivalReported = now;
|
|
31
|
-
|
|
35
|
+
const due = [...arrived];
|
|
36
|
+
arrived.clear();
|
|
37
|
+
return due;
|
|
32
38
|
},
|
|
33
39
|
};
|
|
34
40
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export type ReadinessQueue<W> = {
|
|
1
|
+
export type ReadinessQueue<W, S> = {
|
|
2
2
|
add(watch: W): () => void;
|
|
3
3
|
held(watch: W): boolean;
|
|
4
|
-
|
|
4
|
+
kept(watch: W): S | undefined;
|
|
5
|
+
keep(watch: W, shown: S): void;
|
|
5
6
|
owe(watches: readonly W[]): void;
|
|
6
|
-
queue(): void;
|
|
7
|
+
queue(rooms?: readonly string[]): void;
|
|
7
8
|
close(): void;
|
|
8
9
|
};
|
|
9
|
-
export declare function createReadinessQueue<W>(deliver: (owed: readonly W[]) => Promise<void>, unpublished: (error: unknown) => void): ReadinessQueue<W>;
|
|
10
|
+
export declare function createReadinessQueue<W, S>(deliver: (owed: readonly W[], rooms: ReadonlySet<string> | null) => Promise<void>, unpublished: (error: unknown) => void): ReadinessQueue<W, S>;
|
|
10
11
|
//# sourceMappingURL=readiness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../../src/store/readiness.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../../src/store/readiness.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,IAAI;IACjC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC;IAC1B,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IACxB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAC/B,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAWF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EACvC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,EACjF,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACpC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAwDtB"}
|
package/dist/store/readiness.js
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
|
+
function joined(held, rooms) {
|
|
2
|
+
if (held === null || rooms === null)
|
|
3
|
+
return null;
|
|
4
|
+
for (const room of rooms)
|
|
5
|
+
held.add(room);
|
|
6
|
+
return held;
|
|
7
|
+
}
|
|
1
8
|
export function createReadinessQueue(deliver, unpublished) {
|
|
2
9
|
const watches = new Set();
|
|
3
10
|
const owed = new Set();
|
|
4
11
|
const lastShown = new Map();
|
|
12
|
+
let owedRooms = new Set();
|
|
5
13
|
let queued = false;
|
|
14
|
+
let queuedRooms = new Set();
|
|
6
15
|
let shown = Promise.resolve();
|
|
7
|
-
function owe
|
|
16
|
+
function owing(owe, rooms) {
|
|
8
17
|
const waiting = owed.size > 0;
|
|
9
|
-
for (const watch of
|
|
18
|
+
for (const watch of owe)
|
|
10
19
|
owed.add(watch);
|
|
20
|
+
owedRooms = joined(owedRooms, rooms);
|
|
11
21
|
if (waiting)
|
|
12
22
|
return;
|
|
13
23
|
shown = shown
|
|
14
24
|
.then(async () => {
|
|
15
25
|
const due = [...owed];
|
|
26
|
+
const touched = owedRooms;
|
|
16
27
|
owed.clear();
|
|
17
|
-
|
|
28
|
+
owedRooms = new Set();
|
|
29
|
+
await deliver(due, touched);
|
|
18
30
|
})
|
|
19
31
|
.catch(unpublished);
|
|
20
32
|
}
|
|
@@ -27,21 +39,25 @@ export function createReadinessQueue(deliver, unpublished) {
|
|
|
27
39
|
};
|
|
28
40
|
},
|
|
29
41
|
held: (watch) => watches.has(watch),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return true;
|
|
42
|
+
kept: (watch) => lastShown.get(watch),
|
|
43
|
+
keep(watch, kept) {
|
|
44
|
+
if (watches.has(watch))
|
|
45
|
+
lastShown.set(watch, kept);
|
|
35
46
|
},
|
|
36
|
-
owe,
|
|
37
|
-
queue() {
|
|
38
|
-
if (
|
|
47
|
+
owe: (owe) => owing(owe, null),
|
|
48
|
+
queue(rooms) {
|
|
49
|
+
if (watches.size === 0)
|
|
50
|
+
return;
|
|
51
|
+
queuedRooms = joined(queuedRooms, rooms ?? null);
|
|
52
|
+
if (queued)
|
|
39
53
|
return;
|
|
40
54
|
queued = true;
|
|
41
55
|
queueMicrotask(() => {
|
|
42
56
|
queued = false;
|
|
57
|
+
const touched = queuedRooms;
|
|
58
|
+
queuedRooms = new Set();
|
|
43
59
|
if (watches.size > 0)
|
|
44
|
-
|
|
60
|
+
owing([...watches], touched);
|
|
45
61
|
});
|
|
46
62
|
},
|
|
47
63
|
close() {
|
package/dist/store/records.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { BootstrapInventory, Capability, ListedConversation, Member, ProviderLimit } from '../adapter.js';
|
|
1
|
+
import type { BootstrapInventory, Capability, ListedAgent, ListedConversation, Member, ProviderLimit, QueriedRoom, RoomDeclaration, RoomList } from '../adapter.js';
|
|
2
2
|
import type { ChangeBatch } from '../change.js';
|
|
3
3
|
import { type Composition } from '../collection.js';
|
|
4
4
|
import type { Plan } from '../query.js';
|
|
5
|
-
import type { ReplicaRecord } from '../replica.js';
|
|
6
5
|
import type { Submission } from '../outcome.js';
|
|
7
6
|
import type { RoomDraftRecord, SavedDraft } from '../room-draft.js';
|
|
8
7
|
import type { ModelState, StoredModel } from '../model.js';
|
|
9
|
-
import type { CommittedWrite, ConversationWrite, HeldConversation, HeldRow, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, ReplicaOpened, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, TypedEntry, View } from '../tables.js';
|
|
10
|
-
export type { ConversationWrite, HeldConversation, MessageWindow } from '../tables.js';
|
|
8
|
+
import type { CommittedWrite, ConversationWrite, HeldConversation, HeldFact, HeldRow, HeldEntry, Holder, MessageWindow, QueryAnswer, QueryRoom, Referrer, ReplicaOpened, RoomCommit, RuntimeDatabase, Sought, StoredEntry, StoredFile, TypedEntry, View } from '../tables.js';
|
|
9
|
+
export type { ConversationFact, ConversationWrite, HeldConversation, MessageWindow, } from '../tables.js';
|
|
10
|
+
declare const FILE = "\0file";
|
|
11
11
|
export type TransferRecord = {
|
|
12
12
|
readonly locator: string;
|
|
13
13
|
readonly transfer: string;
|
|
@@ -20,8 +20,14 @@ export type TransferRecord = {
|
|
|
20
20
|
};
|
|
21
21
|
readonly key: number | null;
|
|
22
22
|
};
|
|
23
|
-
export type StoredReplica =
|
|
23
|
+
export type StoredReplica = {
|
|
24
|
+
readonly locator: string;
|
|
25
|
+
readonly declaration: RoomDeclaration;
|
|
24
26
|
readonly model: StoredModel;
|
|
27
|
+
readonly roomVersion: string;
|
|
28
|
+
readonly transfer: string;
|
|
29
|
+
readonly inventory: BootstrapInventory;
|
|
30
|
+
readonly key: number;
|
|
25
31
|
};
|
|
26
32
|
export type PendingState = {
|
|
27
33
|
readonly drafts: readonly SavedDraft[];
|
|
@@ -92,6 +98,7 @@ export type HeldWork = {
|
|
|
92
98
|
readonly queue: readonly QueuedChange[];
|
|
93
99
|
};
|
|
94
100
|
export type CoveredRoom = {
|
|
101
|
+
readonly handle: string;
|
|
95
102
|
readonly key: number;
|
|
96
103
|
readonly transfer: string;
|
|
97
104
|
readonly roomVersion: string;
|
|
@@ -102,6 +109,7 @@ export type CoveredRoom = {
|
|
|
102
109
|
};
|
|
103
110
|
export type HeldCover = {
|
|
104
111
|
readonly rooms: ReadonlyMap<string, CoveredRoom>;
|
|
112
|
+
readonly locking: ReadonlySet<string>;
|
|
105
113
|
readonly queues: ReadonlyMap<string, readonly string[]>;
|
|
106
114
|
};
|
|
107
115
|
export type HeldStatus = {
|
|
@@ -122,11 +130,15 @@ export type Facts = {
|
|
|
122
130
|
readonly providerLimits: readonly ProviderLimit[];
|
|
123
131
|
readonly capabilities: readonly Capability[];
|
|
124
132
|
readonly member: Member | null;
|
|
133
|
+
readonly timeZone: string | null;
|
|
125
134
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
126
135
|
readonly conversationList: readonly ListedConversation[] | null;
|
|
136
|
+
readonly agentList: readonly ListedAgent[] | null;
|
|
127
137
|
readonly conversationCursor: string | null;
|
|
128
138
|
readonly chatPins: readonly string[];
|
|
129
|
-
readonly
|
|
139
|
+
readonly readUntil: string | null;
|
|
140
|
+
readonly roomList: RoomList | null;
|
|
141
|
+
readonly queriesOnly: readonly QueriedRoom[];
|
|
130
142
|
};
|
|
131
143
|
export type Commit = {
|
|
132
144
|
readonly rooms: readonly RoomCommit[];
|
|
@@ -159,13 +171,16 @@ export type RuntimeStore = {
|
|
|
159
171
|
readonly room: boolean;
|
|
160
172
|
}>;
|
|
161
173
|
facts(): Promise<Facts>;
|
|
174
|
+
facts<K extends keyof Facts>(names: readonly K[]): Promise<Pick<Facts, K>>;
|
|
162
175
|
presentation(app: string): Promise<unknown>;
|
|
163
176
|
demote(): Promise<void>;
|
|
164
|
-
query(plan: Plan, rooms: readonly QueryRoom[], budget: number | null): Promise<QueryAnswer>;
|
|
177
|
+
query(plan: Plan, rooms: readonly QueryRoom[], follows: readonly QueryRoom[], budget: number | null): Promise<QueryAnswer>;
|
|
178
|
+
named(plan: Plan, rooms: readonly QueryRoom[], handles: readonly string[]): Promise<readonly string[]>;
|
|
165
179
|
changes(keys: readonly number[]): number;
|
|
166
180
|
entries(key: number, view: View, paths: readonly string[]): Promise<readonly HeldEntry[]>;
|
|
167
181
|
typed(key: number, view: View, paths: readonly string[]): Promise<readonly TypedEntry[]>;
|
|
168
182
|
referrers(key: number, view: View, targets: readonly string[]): Promise<readonly Referrer[]>;
|
|
183
|
+
holders(key: number, view: View, sought: readonly Sought[]): Promise<readonly Holder[]>;
|
|
169
184
|
folders(key: number, paths: readonly string[]): Promise<readonly string[]>;
|
|
170
185
|
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
171
186
|
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
@@ -193,7 +208,10 @@ export type RuntimeStore = {
|
|
|
193
208
|
messageCount(conversation: string, phrase?: string | null): Promise<number>;
|
|
194
209
|
turnArrived(conversation: string, turn: string): Promise<boolean>;
|
|
195
210
|
conversationRows(conversations: readonly string[]): Promise<readonly HeldRow[]>;
|
|
196
|
-
|
|
211
|
+
conversationFacts(): Promise<readonly HeldFact[]>;
|
|
212
|
+
keepConversationFact(fact: HeldFact): Promise<void>;
|
|
213
|
+
storedConversations(): Promise<readonly string[]>;
|
|
214
|
+
dropConversations(conversations: readonly string[]): Promise<readonly string[]>;
|
|
197
215
|
chatDrafts(): Promise<readonly ChatDraftRecord[]>;
|
|
198
216
|
chatDraft(conversation: string): Promise<ChatDraftRecord | null>;
|
|
199
217
|
keepChatDrafts(records: readonly ChatDraftRecord[]): Promise<void>;
|
|
@@ -208,5 +226,9 @@ export type RuntimeStore = {
|
|
|
208
226
|
rememberGeneration(value: string): Promise<void>;
|
|
209
227
|
file(key: string, type: string): Promise<Blob>;
|
|
210
228
|
};
|
|
229
|
+
export type FileMark = {
|
|
230
|
+
readonly [FILE]: string;
|
|
231
|
+
readonly type: string;
|
|
232
|
+
};
|
|
211
233
|
export declare function openRuntimeStore(database: RuntimeDatabase): RuntimeStore;
|
|
212
234
|
//# sourceMappingURL=records.d.ts.map
|