@agentshouse/mdruntime 0.1.0-ce41fec66d91b → 0.1.0-ce5b3c1e6ea87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/acceptance.d.ts +6 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +389 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +251 -0
- package/dist/adapter.d.ts +44 -25
- 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 +8 -4
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +209 -78
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/change.d.ts +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +20 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -0
- 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 +231 -300
- package/dist/connection.d.ts +5 -141
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +101 -5058
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-live.d.ts +136 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +248 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +53 -0
- package/dist/conversation.d.ts +34 -38
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +856 -850
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/durability.d.ts +15 -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/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +4 -5
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +23 -22
- 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 +23 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/install.d.ts +56 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +560 -0
- package/dist/job.d.ts +33 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +54 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +268 -0
- package/dist/listing.d.ts +53 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +175 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +62 -20
- package/dist/locks.d.ts +9 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +61 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +61 -0
- package/dist/memory.d.ts +5 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +47 -8
- 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/models.d.ts +14 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +193 -0
- package/dist/observation.d.ts +2 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +7 -2
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +57 -0
- package/dist/outcome.d.ts +4 -1
- 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/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +226 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +272 -0
- package/dist/query.d.ts +13 -208
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +34 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +122 -0
- package/dist/reach.d.ts +14 -12
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +167 -114
- package/dist/react.d.ts +10 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +0 -2
- package/dist/readiness.d.ts.map +1 -1
- package/dist/reads.d.ts +37 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +171 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +9 -1
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +7 -0
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +56 -0
- package/dist/replica.d.ts +8 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +52 -16
- package/dist/room-draft.d.ts +4 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +65 -52
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +216 -0
- package/dist/rows.d.ts +14 -21
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +48 -184
- package/dist/runtime.d.ts +43 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +3 -1
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +16 -11
- package/dist/saves.d.ts +70 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +1006 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/seed.d.ts +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -0
- package/dist/shared.d.ts +1 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +9 -5
- package/dist/shown.d.ts +31 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +295 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/rooms.d.ts +43 -0
- package/dist/socket/rooms.d.ts.map +1 -0
- package/dist/socket/rooms.js +90 -0
- package/dist/socket/session.d.ts +39 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +70 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +175 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +81 -0
- package/dist/status.d.ts +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/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +408 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- package/dist/store/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +43 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +57 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +107 -145
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +143 -366
- package/dist/stored.d.ts +58 -32
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +264 -187
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +223 -0
- package/dist/sync.d.ts +20 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +532 -0
- package/dist/tables.d.ts +117 -27
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +211 -49
- 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 +17 -1
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +7 -0
- 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
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { BootstrapInventory, Capability, ListedConversation, Member, ProviderLimit } from '../adapter.js';
|
|
2
|
+
import type { ChangeBatch } from '../change.js';
|
|
3
|
+
import { type Composition } from '../collection.js';
|
|
4
|
+
import type { Plan } from '../query.js';
|
|
5
|
+
import type { ReplicaRecord } from '../replica.js';
|
|
6
|
+
import type { Submission } from '../outcome.js';
|
|
7
|
+
import type { RoomDraftRecord, SavedDraft } from '../room-draft.js';
|
|
8
|
+
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
|
+
import type { JobMarker } from '../job.js';
|
|
11
|
+
export type { ConversationWrite, HeldConversation, MessageWindow } from '../tables.js';
|
|
12
|
+
export type TransferRecord = {
|
|
13
|
+
readonly locator: string;
|
|
14
|
+
readonly transfer: string;
|
|
15
|
+
readonly selection: string;
|
|
16
|
+
readonly from: string;
|
|
17
|
+
readonly last: string;
|
|
18
|
+
readonly done: BootstrapInventory;
|
|
19
|
+
readonly models: {
|
|
20
|
+
readonly collection: ModelState;
|
|
21
|
+
};
|
|
22
|
+
readonly key: number | null;
|
|
23
|
+
};
|
|
24
|
+
export type StoredReplica = Omit<ReplicaRecord, 'model'> & {
|
|
25
|
+
readonly model: StoredModel;
|
|
26
|
+
};
|
|
27
|
+
export type PendingState = {
|
|
28
|
+
readonly drafts: readonly SavedDraft[];
|
|
29
|
+
readonly submission: Submission;
|
|
30
|
+
readonly lost: boolean;
|
|
31
|
+
readonly upload?: unknown;
|
|
32
|
+
};
|
|
33
|
+
export type TargetRecord = {
|
|
34
|
+
established: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type PresentationRecord = {
|
|
37
|
+
app: string;
|
|
38
|
+
value: unknown;
|
|
39
|
+
};
|
|
40
|
+
export type ChatSubmission = {
|
|
41
|
+
readonly operation: string;
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly turn: string | null;
|
|
44
|
+
};
|
|
45
|
+
export type ChatDraftRecord = {
|
|
46
|
+
conversation: string;
|
|
47
|
+
text: string;
|
|
48
|
+
revision: string;
|
|
49
|
+
submitted?: readonly ChatSubmission[];
|
|
50
|
+
moves?: readonly string[];
|
|
51
|
+
};
|
|
52
|
+
export type CallRecord = {
|
|
53
|
+
readonly operation: string;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly input: unknown;
|
|
56
|
+
};
|
|
57
|
+
export type AuthoredWrite = {
|
|
58
|
+
locator: string;
|
|
59
|
+
queue?: readonly ChangeBatch[];
|
|
60
|
+
stored?: readonly ChangeBatch[];
|
|
61
|
+
founded?: readonly ChangeBatch[];
|
|
62
|
+
saved?: ReadonlyMap<string, readonly SavedDraft[]>;
|
|
63
|
+
roomDrafts?: readonly RoomDraftRecord[];
|
|
64
|
+
consumedRoomDrafts?: readonly string[];
|
|
65
|
+
};
|
|
66
|
+
export type StagedPage = {
|
|
67
|
+
readonly entries: readonly StoredEntry[];
|
|
68
|
+
readonly folders: readonly string[];
|
|
69
|
+
readonly part?: string;
|
|
70
|
+
};
|
|
71
|
+
export type ResumedTransfer = {
|
|
72
|
+
readonly key: number | null;
|
|
73
|
+
readonly transfer: string;
|
|
74
|
+
readonly staged: readonly string[];
|
|
75
|
+
};
|
|
76
|
+
export type RefreshedPage = StagedPage & {
|
|
77
|
+
readonly removals: readonly string[];
|
|
78
|
+
readonly folderRemovals: readonly string[];
|
|
79
|
+
};
|
|
80
|
+
export type HeldRoom = {
|
|
81
|
+
readonly record: StoredReplica;
|
|
82
|
+
readonly indexed: boolean;
|
|
83
|
+
readonly documents: number;
|
|
84
|
+
};
|
|
85
|
+
export type QueuedChange = {
|
|
86
|
+
readonly batch: ChangeBatch;
|
|
87
|
+
readonly state: PendingState;
|
|
88
|
+
};
|
|
89
|
+
export type HeldWork = {
|
|
90
|
+
readonly room: (HeldRoom & {
|
|
91
|
+
readonly overlaid: ReadonlySet<string>;
|
|
92
|
+
}) | null;
|
|
93
|
+
readonly queue: readonly QueuedChange[];
|
|
94
|
+
};
|
|
95
|
+
export type CoveredRoom = {
|
|
96
|
+
readonly key: number;
|
|
97
|
+
readonly transfer: string;
|
|
98
|
+
readonly roomVersion: string;
|
|
99
|
+
readonly indexed: boolean;
|
|
100
|
+
readonly documents: number;
|
|
101
|
+
readonly bytes: number;
|
|
102
|
+
readonly offline: string;
|
|
103
|
+
};
|
|
104
|
+
export type HeldCover = {
|
|
105
|
+
readonly rooms: ReadonlyMap<string, CoveredRoom>;
|
|
106
|
+
readonly queues: ReadonlyMap<string, readonly string[]>;
|
|
107
|
+
};
|
|
108
|
+
export type HeldStatus = {
|
|
109
|
+
readonly queued: readonly string[];
|
|
110
|
+
readonly lastCompleted: string | null;
|
|
111
|
+
readonly unsent: readonly {
|
|
112
|
+
readonly room: string;
|
|
113
|
+
readonly path: string;
|
|
114
|
+
}[];
|
|
115
|
+
readonly resets: readonly {
|
|
116
|
+
readonly locator: string;
|
|
117
|
+
readonly reset: string;
|
|
118
|
+
}[];
|
|
119
|
+
readonly returned: readonly RoomDraftRecord[];
|
|
120
|
+
};
|
|
121
|
+
export type Facts = {
|
|
122
|
+
readonly lastCompleted: string | null;
|
|
123
|
+
readonly providerLimits: readonly ProviderLimit[];
|
|
124
|
+
readonly capabilities: readonly Capability[];
|
|
125
|
+
readonly member: Member | null;
|
|
126
|
+
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
127
|
+
readonly conversationList: readonly ListedConversation[] | null;
|
|
128
|
+
readonly conversationCursor: string | null;
|
|
129
|
+
};
|
|
130
|
+
export type Commit = {
|
|
131
|
+
readonly rooms: readonly RoomCommit[];
|
|
132
|
+
readonly writes?: readonly AuthoredWrite[];
|
|
133
|
+
readonly files?: readonly StoredFile[];
|
|
134
|
+
readonly whole?: boolean;
|
|
135
|
+
};
|
|
136
|
+
export type RuntimeStore = {
|
|
137
|
+
opened(): Promise<ReplicaOpened>;
|
|
138
|
+
rooms(locators?: readonly string[]): Promise<readonly HeldRoom[]>;
|
|
139
|
+
room(locator: string): Promise<HeldWork>;
|
|
140
|
+
covering(): Promise<HeldCover>;
|
|
141
|
+
offline(locator: string): Promise<string | null>;
|
|
142
|
+
held(): Promise<{
|
|
143
|
+
readonly held: ReadonlySet<string>;
|
|
144
|
+
readonly staged: ReadonlySet<string>;
|
|
145
|
+
}>;
|
|
146
|
+
status(): Promise<HeldStatus>;
|
|
147
|
+
batch(locator: string, id: string): Promise<ChangeBatch | null>;
|
|
148
|
+
order(locator: string): Promise<readonly string[]>;
|
|
149
|
+
queued(): Promise<readonly string[]>;
|
|
150
|
+
moving(): Promise<{
|
|
151
|
+
readonly queued: ReadonlyMap<string, readonly string[]>;
|
|
152
|
+
readonly moving: readonly (QueuedChange & {
|
|
153
|
+
readonly locator: string;
|
|
154
|
+
})[];
|
|
155
|
+
}>;
|
|
156
|
+
pending(locator: string, id: string): Promise<{
|
|
157
|
+
readonly state: PendingState | undefined;
|
|
158
|
+
readonly room: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
facts(): Promise<Facts>;
|
|
161
|
+
presentation(app: string): Promise<unknown>;
|
|
162
|
+
demote(): Promise<void>;
|
|
163
|
+
query(plan: Plan, rooms: readonly QueryRoom[], budget: number | null): Promise<QueryAnswer>;
|
|
164
|
+
changes(keys: readonly number[]): number;
|
|
165
|
+
entries(key: number, view: View, paths: readonly string[]): Promise<readonly HeldEntry[]>;
|
|
166
|
+
typed(key: number, view: View, paths: readonly string[]): Promise<readonly TypedEntry[]>;
|
|
167
|
+
referrers(key: number, view: View, targets: readonly string[]): Promise<readonly Referrer[]>;
|
|
168
|
+
folders(key: number, view: View, paths: readonly string[]): Promise<readonly string[]>;
|
|
169
|
+
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
170
|
+
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
171
|
+
resume(record: TransferRecord, composition: Composition, parts: readonly string[], published: number | null): Promise<ResumedTransfer | null>;
|
|
172
|
+
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
173
|
+
unrefresh(key: number): Promise<void>;
|
|
174
|
+
commit(commit: Commit): Promise<CommittedWrite>;
|
|
175
|
+
fence(locators: readonly string[]): Promise<void>;
|
|
176
|
+
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
177
|
+
abandon(locator: string): Promise<void>;
|
|
178
|
+
unfence(locators: readonly string[]): Promise<ReadonlySet<string>>;
|
|
179
|
+
release(key: number): Promise<void>;
|
|
180
|
+
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
181
|
+
readonly done: boolean;
|
|
182
|
+
readonly text: number;
|
|
183
|
+
}>;
|
|
184
|
+
fact(name: string, value: unknown): Promise<void>;
|
|
185
|
+
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
186
|
+
keepUpload(locator: string, id: string, upload: unknown): Promise<void>;
|
|
187
|
+
roomDrafts(locator?: string, paths?: readonly string[]): Promise<readonly RoomDraftRecord[]>;
|
|
188
|
+
present(record: PresentationRecord): Promise<void>;
|
|
189
|
+
conversations(conversations?: readonly string[]): Promise<readonly HeldConversation[]>;
|
|
190
|
+
keepMessages(write: ConversationWrite): Promise<void>;
|
|
191
|
+
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null, phrase?: string | null): Promise<MessageWindow>;
|
|
192
|
+
messageCount(conversation: string, phrase?: string | null): Promise<number>;
|
|
193
|
+
turnArrived(conversation: string, turn: string): Promise<boolean>;
|
|
194
|
+
conversationRows(conversations: readonly string[]): Promise<readonly HeldRow[]>;
|
|
195
|
+
jobMarkers(conversation: string): Promise<readonly JobMarker[]>;
|
|
196
|
+
dropConversations(conversations: readonly string[]): Promise<void>;
|
|
197
|
+
chatDrafts(): Promise<readonly ChatDraftRecord[]>;
|
|
198
|
+
chatDraft(conversation: string): Promise<ChatDraftRecord | null>;
|
|
199
|
+
keepChatDrafts(records: readonly ChatDraftRecord[]): Promise<void>;
|
|
200
|
+
dropChatDraft(conversation: string): Promise<void>;
|
|
201
|
+
calls(): Promise<readonly CallRecord[]>;
|
|
202
|
+
keepCall(record: CallRecord): Promise<void>;
|
|
203
|
+
dropCall(operation: string): Promise<void>;
|
|
204
|
+
keepRoomDraft(record: RoomDraftRecord, files: readonly StoredFile[]): Promise<void>;
|
|
205
|
+
discardRoomDraft(locator: string, path: string): Promise<void>;
|
|
206
|
+
fences(): Promise<readonly string[]>;
|
|
207
|
+
generation(): Promise<string | null>;
|
|
208
|
+
rememberGeneration(value: string): Promise<void>;
|
|
209
|
+
file(key: string, type: string): Promise<Blob>;
|
|
210
|
+
};
|
|
211
|
+
export declare function openRuntimeStore(authored: RuntimeDatabase): RuntimeStore;
|
|
212
|
+
//# sourceMappingURL=records.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/store/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kBA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AAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IACrC,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD,CAAC;AAiHF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,YAAY,CAuTxE"}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { composedOf } from '../collection.js';
|
|
2
|
+
import { binaryLocalId } from '../identity.js';
|
|
3
|
+
const FILE = '\u0000file';
|
|
4
|
+
function batchFacts(batch) {
|
|
5
|
+
return { paths: batch.changes.map(({ path }) => path), moving: batch.between !== undefined };
|
|
6
|
+
}
|
|
7
|
+
function batchFiles(batch) {
|
|
8
|
+
return batch.changes.flatMap((change) => (change.kind === 'binary' ? [change.localId] : []));
|
|
9
|
+
}
|
|
10
|
+
function draftFiles(drafts) {
|
|
11
|
+
return drafts.flatMap(({ parts }) => (parts.file === undefined ? [] : [parts.file.localId]));
|
|
12
|
+
}
|
|
13
|
+
function roomDraftRow(record) {
|
|
14
|
+
return { path: record.path, record: JSON.stringify(record), files: draftFiles([record]) };
|
|
15
|
+
}
|
|
16
|
+
function authoredRows({ locator, queue, stored, founded, saved, roomDrafts, consumedRoomDrafts, }) {
|
|
17
|
+
const held = new Set((stored ?? []).map(({ id }) => id));
|
|
18
|
+
return {
|
|
19
|
+
locator,
|
|
20
|
+
...(queue === undefined
|
|
21
|
+
? {}
|
|
22
|
+
: {
|
|
23
|
+
order: queue.map(({ id }) => id),
|
|
24
|
+
added: queue
|
|
25
|
+
.filter(({ id }) => !held.has(id))
|
|
26
|
+
.map((batch) => {
|
|
27
|
+
const drafts = saved?.get(batch.id) ?? [];
|
|
28
|
+
return {
|
|
29
|
+
id: batch.id,
|
|
30
|
+
batch: JSON.stringify(batch),
|
|
31
|
+
state: JSON.stringify({
|
|
32
|
+
drafts,
|
|
33
|
+
submission: { state: 'waiting' },
|
|
34
|
+
lost: false,
|
|
35
|
+
}),
|
|
36
|
+
files: [...batchFiles(batch), ...draftFiles(drafts)],
|
|
37
|
+
...batchFacts(batch),
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
40
|
+
}),
|
|
41
|
+
...(founded === undefined
|
|
42
|
+
? {}
|
|
43
|
+
: {
|
|
44
|
+
founded: founded.map((batch) => ({
|
|
45
|
+
id: batch.id,
|
|
46
|
+
batch: JSON.stringify(batch),
|
|
47
|
+
files: batchFiles(batch),
|
|
48
|
+
...batchFacts(batch),
|
|
49
|
+
})),
|
|
50
|
+
}),
|
|
51
|
+
...(roomDrafts === undefined ? {} : { roomDrafts: roomDrafts.map(roomDraftRow) }),
|
|
52
|
+
...(consumedRoomDrafts === undefined ? {} : { consumedRoomDrafts }),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function marked(value) {
|
|
56
|
+
return typeof value === 'object' && value !== null && FILE in value;
|
|
57
|
+
}
|
|
58
|
+
function keyed(keys, value) {
|
|
59
|
+
const stored = [];
|
|
60
|
+
const files = [];
|
|
61
|
+
const record = JSON.stringify(value, (_name, held) => {
|
|
62
|
+
if (!(held instanceof Blob))
|
|
63
|
+
return held;
|
|
64
|
+
let key = keys.get(held);
|
|
65
|
+
if (key === undefined) {
|
|
66
|
+
key = binaryLocalId();
|
|
67
|
+
keys.set(held, key);
|
|
68
|
+
}
|
|
69
|
+
stored.push({ key, blob: held });
|
|
70
|
+
files.push(key);
|
|
71
|
+
return { [FILE]: key, type: held.type };
|
|
72
|
+
});
|
|
73
|
+
return { record, files, stored };
|
|
74
|
+
}
|
|
75
|
+
async function filed(value, read) {
|
|
76
|
+
if (Array.isArray(value))
|
|
77
|
+
return Promise.all(value.map((item) => filed(item, read)));
|
|
78
|
+
if (marked(value))
|
|
79
|
+
return read(value[FILE], value.type);
|
|
80
|
+
if (typeof value !== 'object' || value === null)
|
|
81
|
+
return value;
|
|
82
|
+
const restored = {};
|
|
83
|
+
for (const [name, item] of Object.entries(value))
|
|
84
|
+
restored[name] = await filed(item, read);
|
|
85
|
+
return restored;
|
|
86
|
+
}
|
|
87
|
+
function roomOf(row) {
|
|
88
|
+
return {
|
|
89
|
+
record: { ...JSON.parse(row.record), key: row.key },
|
|
90
|
+
indexed: row.indexed,
|
|
91
|
+
documents: row.documents,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function json(value, fallback) {
|
|
95
|
+
return value === undefined ? fallback : JSON.parse(value);
|
|
96
|
+
}
|
|
97
|
+
export function openRuntimeStore(authored) {
|
|
98
|
+
const keys = new WeakMap();
|
|
99
|
+
const read = async (key, type) => {
|
|
100
|
+
const blob = await authored.ask({ kind: 'authored.file', key, type });
|
|
101
|
+
keys.set(blob, key);
|
|
102
|
+
return blob;
|
|
103
|
+
};
|
|
104
|
+
const restored = async (records) => Promise.all(records.map(async (record) => (await filed(JSON.parse(record), read))));
|
|
105
|
+
const amend = async (locator, id, amendment) => {
|
|
106
|
+
await authored.ask({
|
|
107
|
+
kind: 'authored.amend',
|
|
108
|
+
locator,
|
|
109
|
+
id,
|
|
110
|
+
amendment: JSON.stringify(amendment),
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const fact = (name) => authored.ask({ kind: 'authored.fact', name });
|
|
114
|
+
const changed = new Map();
|
|
115
|
+
const change = (key) => changed.set(key, (changed.get(key) ?? 0) + 1);
|
|
116
|
+
return {
|
|
117
|
+
opened() {
|
|
118
|
+
return authored.ask({ kind: 'replica.open' });
|
|
119
|
+
},
|
|
120
|
+
async rooms(locators) {
|
|
121
|
+
const held = await authored.ask({ kind: 'replica.rooms', locators: locators ?? null });
|
|
122
|
+
return held.map(roomOf);
|
|
123
|
+
},
|
|
124
|
+
async room(locator) {
|
|
125
|
+
const { room, queue } = await authored.ask({ kind: 'replica.room', locator });
|
|
126
|
+
return {
|
|
127
|
+
room: room === null ? null : { ...roomOf(room), overlaid: new Set(room.overlaid) },
|
|
128
|
+
queue: queue.map(({ batch, state }) => ({
|
|
129
|
+
batch: JSON.parse(batch),
|
|
130
|
+
state: JSON.parse(state),
|
|
131
|
+
})),
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
async covering() {
|
|
135
|
+
const { rooms, queues } = await authored.ask({ kind: 'replica.covering' });
|
|
136
|
+
return {
|
|
137
|
+
rooms: new Map(rooms.map(({ locator, ...room }) => [locator, room])),
|
|
138
|
+
queues: new Map(queues.map(({ locator, ids }) => [locator, ids])),
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
offline(locator) {
|
|
142
|
+
return authored.ask({ kind: 'replica.offline', locator });
|
|
143
|
+
},
|
|
144
|
+
async held() {
|
|
145
|
+
const { held, staged } = await authored.ask({ kind: 'replica.held' });
|
|
146
|
+
return { held: new Set(held), staged: new Set(staged) };
|
|
147
|
+
},
|
|
148
|
+
async status() {
|
|
149
|
+
const { queued, lastCompleted, changes, resets, returned } = await authored.ask({
|
|
150
|
+
kind: 'authored.status',
|
|
151
|
+
});
|
|
152
|
+
return {
|
|
153
|
+
queued,
|
|
154
|
+
lastCompleted: json(lastCompleted ?? undefined, null),
|
|
155
|
+
unsent: changes.map(({ locator, path }) => ({ room: locator, path })),
|
|
156
|
+
resets,
|
|
157
|
+
returned: returned.map((record) => JSON.parse(record)),
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
async batch(locator, id) {
|
|
161
|
+
const held = await authored.ask({ kind: 'authored.batch', locator, id });
|
|
162
|
+
return held === null ? null : JSON.parse(held);
|
|
163
|
+
},
|
|
164
|
+
order(locator) {
|
|
165
|
+
return authored.ask({ kind: 'authored.order', locator });
|
|
166
|
+
},
|
|
167
|
+
queued() {
|
|
168
|
+
return authored.ask({ kind: 'authored.queued' });
|
|
169
|
+
},
|
|
170
|
+
async moving() {
|
|
171
|
+
const { queues, pending } = await authored.ask({ kind: 'authored.moving' });
|
|
172
|
+
return {
|
|
173
|
+
queued: new Map(queues.map(({ locator, ids }) => [locator, ids])),
|
|
174
|
+
moving: pending.map(({ locator, batch, state }) => ({
|
|
175
|
+
locator,
|
|
176
|
+
batch: JSON.parse(batch),
|
|
177
|
+
state: JSON.parse(state),
|
|
178
|
+
})),
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
async pending(locator, id) {
|
|
182
|
+
const { state, room } = await authored.ask({ kind: 'authored.pending', locator, id });
|
|
183
|
+
return { state: state === null ? undefined : JSON.parse(state), room };
|
|
184
|
+
},
|
|
185
|
+
async facts() {
|
|
186
|
+
const held = await authored.ask({ kind: 'replica.facts' });
|
|
187
|
+
return {
|
|
188
|
+
lastCompleted: json(held.lastCompleted, null),
|
|
189
|
+
providerLimits: json(held.providerLimits, []),
|
|
190
|
+
capabilities: json(held.capabilities, []),
|
|
191
|
+
member: json(held.member, null),
|
|
192
|
+
targets: json(held.targets, {}),
|
|
193
|
+
conversationList: json(held.conversationList, null),
|
|
194
|
+
conversationCursor: json(held.conversationCursor, null),
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
async presentation(app) {
|
|
198
|
+
const held = await authored.ask({ kind: 'replica.presentation', app });
|
|
199
|
+
return held === null ? undefined : JSON.parse(held);
|
|
200
|
+
},
|
|
201
|
+
async demote() {
|
|
202
|
+
await authored.ask({ kind: 'replica.demote' });
|
|
203
|
+
},
|
|
204
|
+
query(plan, rooms, budget) {
|
|
205
|
+
return authored.ask({ kind: 'replica.query', plan, rooms, budget });
|
|
206
|
+
},
|
|
207
|
+
changes(keys) {
|
|
208
|
+
return keys.reduce((total, key) => total + (changed.get(key) ?? 0), 0);
|
|
209
|
+
},
|
|
210
|
+
entries(key, view, paths) {
|
|
211
|
+
return authored.ask({ kind: 'replica.entries', key, view, paths });
|
|
212
|
+
},
|
|
213
|
+
typed(key, view, paths) {
|
|
214
|
+
return authored.ask({ kind: 'replica.typed', key, view, paths });
|
|
215
|
+
},
|
|
216
|
+
referrers(key, view, targets) {
|
|
217
|
+
return authored.ask({ kind: 'replica.referrers', key, view, targets });
|
|
218
|
+
},
|
|
219
|
+
folders(key, view, paths) {
|
|
220
|
+
return authored.ask({ kind: 'replica.folders', key, view, paths });
|
|
221
|
+
},
|
|
222
|
+
typedWithin(key, view, roots, within) {
|
|
223
|
+
return authored.ask({ kind: 'replica.typedWithin', key, view, roots, within });
|
|
224
|
+
},
|
|
225
|
+
stage(record, composition, page) {
|
|
226
|
+
return authored.ask({
|
|
227
|
+
kind: 'replica.stage',
|
|
228
|
+
locator: record.locator,
|
|
229
|
+
transfer: record.transfer,
|
|
230
|
+
key: record.key,
|
|
231
|
+
fingerprint: composedOf(composition).fingerprint,
|
|
232
|
+
entries: page.entries,
|
|
233
|
+
folders: page.folders,
|
|
234
|
+
part: page.part ?? null,
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
resume(record, composition, parts, published) {
|
|
238
|
+
return authored.ask({
|
|
239
|
+
kind: 'replica.resume',
|
|
240
|
+
locator: record.locator,
|
|
241
|
+
transfer: record.transfer,
|
|
242
|
+
fingerprint: composedOf(composition).fingerprint,
|
|
243
|
+
parts,
|
|
244
|
+
published,
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
async refresh(key, composition, page) {
|
|
248
|
+
await authored.ask({
|
|
249
|
+
kind: 'replica.refresh',
|
|
250
|
+
key,
|
|
251
|
+
composed: composedOf(composition),
|
|
252
|
+
entries: page.entries,
|
|
253
|
+
removals: page.removals,
|
|
254
|
+
folders: page.folders,
|
|
255
|
+
folderRemovals: page.folderRemovals,
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
async unrefresh(key) {
|
|
259
|
+
await authored.ask({ kind: 'replica.unrefresh', key });
|
|
260
|
+
},
|
|
261
|
+
commit({ rooms, writes = [], files = [], whole = false }) {
|
|
262
|
+
for (const room of rooms)
|
|
263
|
+
change(room.key);
|
|
264
|
+
return authored.ask({
|
|
265
|
+
kind: 'replica.commit',
|
|
266
|
+
...(writes.length === 0 && files.length === 0
|
|
267
|
+
? {}
|
|
268
|
+
: { authored: { writes: writes.map(authoredRows), files, whole } }),
|
|
269
|
+
rooms,
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
async fence(locators) {
|
|
273
|
+
await authored.ask({ kind: 'replica.fence', locators });
|
|
274
|
+
},
|
|
275
|
+
async erase(locator, limit) {
|
|
276
|
+
return (await authored.ask({ kind: 'replica.erase', locator, limit })).remaining;
|
|
277
|
+
},
|
|
278
|
+
async abandon(locator) {
|
|
279
|
+
await authored.ask({ kind: 'replica.abandon', locator });
|
|
280
|
+
},
|
|
281
|
+
async unfence(locators) {
|
|
282
|
+
return new Set(await authored.ask({ kind: 'replica.unfence', locators }));
|
|
283
|
+
},
|
|
284
|
+
async release(key) {
|
|
285
|
+
await authored.ask({ kind: 'replica.release', key });
|
|
286
|
+
},
|
|
287
|
+
async rederive(key, composition, bytes, ms, floor) {
|
|
288
|
+
change(key);
|
|
289
|
+
return authored.ask({
|
|
290
|
+
kind: 'replica.rederive',
|
|
291
|
+
key,
|
|
292
|
+
composed: composedOf(composition),
|
|
293
|
+
bytes,
|
|
294
|
+
ms,
|
|
295
|
+
floor,
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
async fact(name, value) {
|
|
299
|
+
await authored.ask({ kind: 'replica.fact', name, value: JSON.stringify(value) });
|
|
300
|
+
},
|
|
301
|
+
submit(locator, id, submission, lost) {
|
|
302
|
+
return amend(locator, id, { submission, lost });
|
|
303
|
+
},
|
|
304
|
+
keepUpload(locator, id, upload) {
|
|
305
|
+
return amend(locator, id, { upload });
|
|
306
|
+
},
|
|
307
|
+
async roomDrafts(locator, paths) {
|
|
308
|
+
const held = await authored.ask({
|
|
309
|
+
kind: 'authored.roomDrafts',
|
|
310
|
+
locator: locator ?? null,
|
|
311
|
+
paths: paths ?? null,
|
|
312
|
+
});
|
|
313
|
+
return held.map((record) => JSON.parse(record));
|
|
314
|
+
},
|
|
315
|
+
async present(record) {
|
|
316
|
+
await authored.ask({
|
|
317
|
+
kind: 'replica.present',
|
|
318
|
+
app: record.app,
|
|
319
|
+
value: JSON.stringify(record.value ?? null),
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
conversations(conversations) {
|
|
323
|
+
return authored.ask({ kind: 'conversation.held', conversations: conversations ?? null });
|
|
324
|
+
},
|
|
325
|
+
async keepMessages(write) {
|
|
326
|
+
await authored.ask({ kind: 'conversation.keep', ...write });
|
|
327
|
+
},
|
|
328
|
+
messageWindow(conversation, limit, before, phrase = null) {
|
|
329
|
+
return authored.ask({ kind: 'conversation.window', conversation, limit, before, phrase });
|
|
330
|
+
},
|
|
331
|
+
messageCount(conversation, phrase = null) {
|
|
332
|
+
return authored.ask({ kind: 'conversation.count', conversation, phrase });
|
|
333
|
+
},
|
|
334
|
+
turnArrived(conversation, turn) {
|
|
335
|
+
return authored.ask({ kind: 'conversation.turn', conversation, turn });
|
|
336
|
+
},
|
|
337
|
+
conversationRows(conversations) {
|
|
338
|
+
return authored.ask({ kind: 'conversation.rows', conversations });
|
|
339
|
+
},
|
|
340
|
+
jobMarkers(conversation) {
|
|
341
|
+
return authored.ask({ kind: 'conversation.jobs', conversation });
|
|
342
|
+
},
|
|
343
|
+
async dropConversations(conversations) {
|
|
344
|
+
await authored.ask({ kind: 'conversation.drop', conversations });
|
|
345
|
+
},
|
|
346
|
+
async chatDrafts() {
|
|
347
|
+
const records = await authored.ask({ kind: 'authored.chatDrafts' });
|
|
348
|
+
return records.map((record) => JSON.parse(record));
|
|
349
|
+
},
|
|
350
|
+
async chatDraft(conversation) {
|
|
351
|
+
const record = await authored.ask({ kind: 'authored.chatDraft.read', conversation });
|
|
352
|
+
return record === null ? null : JSON.parse(record);
|
|
353
|
+
},
|
|
354
|
+
async keepChatDrafts(records) {
|
|
355
|
+
await authored.ask({
|
|
356
|
+
kind: 'authored.chatDraft',
|
|
357
|
+
kept: records.map((record) => ({
|
|
358
|
+
conversation: record.conversation,
|
|
359
|
+
record: JSON.stringify(record),
|
|
360
|
+
})),
|
|
361
|
+
dropped: [],
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
async dropChatDraft(conversation) {
|
|
365
|
+
await authored.ask({ kind: 'authored.chatDraft', kept: [], dropped: [conversation] });
|
|
366
|
+
},
|
|
367
|
+
async calls() {
|
|
368
|
+
return restored(await authored.ask({ kind: 'authored.calls' }));
|
|
369
|
+
},
|
|
370
|
+
async keepCall(record) {
|
|
371
|
+
const { stored, ...kept } = keyed(keys, record);
|
|
372
|
+
await authored.ask({
|
|
373
|
+
kind: 'authored.call',
|
|
374
|
+
operation: record.operation,
|
|
375
|
+
kept,
|
|
376
|
+
files: stored,
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
async dropCall(operation) {
|
|
380
|
+
await authored.ask({ kind: 'authored.call', operation, kept: null, files: [] });
|
|
381
|
+
},
|
|
382
|
+
async keepRoomDraft(record, files) {
|
|
383
|
+
const { path, ...kept } = roomDraftRow(record);
|
|
384
|
+
await authored.ask({
|
|
385
|
+
kind: 'authored.roomDraft',
|
|
386
|
+
locator: record.locator,
|
|
387
|
+
path,
|
|
388
|
+
kept,
|
|
389
|
+
files,
|
|
390
|
+
});
|
|
391
|
+
},
|
|
392
|
+
async discardRoomDraft(locator, path) {
|
|
393
|
+
await authored.ask({ kind: 'authored.roomDraft', locator, path, kept: null, files: [] });
|
|
394
|
+
},
|
|
395
|
+
fences() {
|
|
396
|
+
return authored.ask({ kind: 'authored.fences' });
|
|
397
|
+
},
|
|
398
|
+
generation() {
|
|
399
|
+
return fact('generation');
|
|
400
|
+
},
|
|
401
|
+
async rememberGeneration(value) {
|
|
402
|
+
await authored.ask({ kind: 'authored.remember', name: 'generation', value });
|
|
403
|
+
},
|
|
404
|
+
file(key, type) {
|
|
405
|
+
return authored.ask({ kind: 'authored.file', key, type });
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type RoomHeld<T> = {
|
|
2
|
+
of(locator: string, key: string): T | undefined;
|
|
3
|
+
hold(locator: string, key: string, value: T): void;
|
|
4
|
+
drop(locator: string, key: string): void;
|
|
5
|
+
forget(locator: string): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function createRoomHeld<T>(): RoomHeld<T>;
|
|
8
|
+
//# sourceMappingURL=room-held.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-held.d.ts","sourceRoot":"","sources":["../../src/store/room-held.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;IACxB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACnD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAgB/C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function createRoomHeld() {
|
|
2
|
+
const rooms = new Map();
|
|
3
|
+
return {
|
|
4
|
+
of: (locator, key) => rooms.get(locator)?.get(key),
|
|
5
|
+
hold(locator, key, value) {
|
|
6
|
+
const room = rooms.get(locator) ?? new Map();
|
|
7
|
+
room.set(key, value);
|
|
8
|
+
rooms.set(locator, room);
|
|
9
|
+
},
|
|
10
|
+
drop(locator, key) {
|
|
11
|
+
rooms.get(locator)?.delete(key);
|
|
12
|
+
},
|
|
13
|
+
forget(locator) {
|
|
14
|
+
rooms.delete(locator);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RuntimeDatabase } from '../tables.js';
|
|
2
|
+
export type Space = {
|
|
3
|
+
full(): boolean;
|
|
4
|
+
fill(): boolean;
|
|
5
|
+
probing(): boolean;
|
|
6
|
+
probeEachMinute(): void;
|
|
7
|
+
probe(): Promise<boolean>;
|
|
8
|
+
stop(): void;
|
|
9
|
+
};
|
|
10
|
+
export declare function createSpace(database: RuntimeDatabase, freed: () => void): Space;
|
|
11
|
+
//# sourceMappingURL=space.d.ts.map
|