@agentshouse/mdruntime 0.1.0-ccbb89b0ca151 → 0.1.0-ccc0e3407f107
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 +1 -1
- package/dist/adapter.d.ts +74 -57
- 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 +29 -47
- package/dist/bootstrap.d.ts +11 -18
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +85 -108
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/client.d.ts +9 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -17
- package/dist/compile.d.ts +1 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +91 -270
- package/dist/connection.d.ts +10 -9
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1009 -1063
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation.d.ts +16 -13
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +229 -155
- 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 +17 -8
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +22 -27
- 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 +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +28 -0
- package/dist/live.d.ts +2 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +10 -7
- package/dist/media.d.ts +1 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +27 -4
- package/dist/memory.d.ts +11 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +167 -84
- package/dist/messages.d.ts +2 -2
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +15 -16
- package/dist/model.d.ts +8 -8
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -12
- 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 +0 -3
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +3 -1
- 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 +4 -209
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/reach.d.ts +9 -8
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +37 -48
- package/dist/react.d.ts +3 -1
- package/dist/react.d.ts.map +1 -1
- 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 +26 -0
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +29 -5
- package/dist/replica.d.ts +10 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +29 -14
- 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 +14 -21
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +48 -184
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +20 -12
- 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/status.d.ts +4 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -1
- package/dist/store.d.ts +21 -34
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +34 -77
- package/dist/stored.d.ts +11 -34
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +158 -241
- package/dist/tables.d.ts +23 -48
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +29 -66
- 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 +9 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +3 -1
- package/package.json +2 -2
- 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/store.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { BootstrapInventory, Capability,
|
|
1
|
+
import type { BootstrapInventory, Capability, ListedConversation, Member, ProviderLimit } from './adapter.js';
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type Composition } from './collection.js';
|
|
4
4
|
import type { Plan } from './query.js';
|
|
5
5
|
import type { ReplicaRecord } from './replica.js';
|
|
6
6
|
import type { Submission } from './outcome.js';
|
|
7
7
|
import type { RoomDraftRecord, SavedDraft } from './room-draft.js';
|
|
8
|
-
import type { ModelState } from './model.js';
|
|
9
|
-
import type {
|
|
10
|
-
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, KeptPart, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, SearchAsk, StoredEntry, StoredFile, TypedEntry, View, Walked } from './tables.js';
|
|
8
|
+
import type { ModelState, StoredModel } from './model.js';
|
|
9
|
+
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, TypedEntry, View } from './tables.js';
|
|
11
10
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './tables.js';
|
|
12
11
|
export type TransferRecord = {
|
|
13
12
|
readonly locator: string;
|
|
@@ -15,20 +14,20 @@ export type TransferRecord = {
|
|
|
15
14
|
readonly selection: string;
|
|
16
15
|
readonly from: string;
|
|
17
16
|
readonly last: string;
|
|
18
|
-
readonly pageToken: string | null;
|
|
19
|
-
readonly inventory: BootstrapInventory | null;
|
|
20
17
|
readonly done: BootstrapInventory;
|
|
21
18
|
readonly models: {
|
|
22
19
|
readonly collection: ModelState;
|
|
23
20
|
};
|
|
24
21
|
readonly key: number | null;
|
|
25
22
|
};
|
|
23
|
+
export type StoredReplica = Omit<ReplicaRecord, 'model'> & {
|
|
24
|
+
readonly model: StoredModel;
|
|
25
|
+
};
|
|
26
26
|
export type PendingState = {
|
|
27
27
|
readonly drafts: readonly SavedDraft[];
|
|
28
28
|
readonly submission: Submission;
|
|
29
29
|
readonly lost: boolean;
|
|
30
30
|
readonly upload?: unknown;
|
|
31
|
-
readonly accepted?: string;
|
|
32
31
|
};
|
|
33
32
|
export type TargetRecord = {
|
|
34
33
|
established: boolean;
|
|
@@ -68,10 +67,6 @@ export type AuthoredWrite = {
|
|
|
68
67
|
saved?: ReadonlyMap<string, readonly SavedDraft[]>;
|
|
69
68
|
roomDrafts?: readonly RoomDraftRecord[];
|
|
70
69
|
consumedRoomDrafts?: readonly string[];
|
|
71
|
-
accepted?: readonly {
|
|
72
|
-
readonly id: string;
|
|
73
|
-
readonly roomVersion: string;
|
|
74
|
-
}[];
|
|
75
70
|
};
|
|
76
71
|
export type StagedPage = {
|
|
77
72
|
readonly entries: readonly StoredEntry[];
|
|
@@ -82,9 +77,7 @@ export type RefreshedPage = StagedPage & {
|
|
|
82
77
|
readonly folderRemovals: readonly string[];
|
|
83
78
|
};
|
|
84
79
|
export type Opened = {
|
|
85
|
-
readonly rooms: ReadonlyMap<string,
|
|
86
|
-
readonly transfers: ReadonlyMap<string, TransferRecord>;
|
|
87
|
-
readonly kept: ReadonlyMap<string, ReadonlyMap<string, number>>;
|
|
80
|
+
readonly rooms: ReadonlyMap<string, StoredReplica>;
|
|
88
81
|
readonly unindexed: ReadonlySet<number>;
|
|
89
82
|
readonly overlaid: ReadonlyMap<number, ReadonlySet<string>>;
|
|
90
83
|
readonly erasing: boolean;
|
|
@@ -95,13 +88,14 @@ export type Opened = {
|
|
|
95
88
|
readonly member: Member | null;
|
|
96
89
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
97
90
|
readonly presentation: readonly PresentationRecord[];
|
|
91
|
+
readonly conversationList: readonly ListedConversation[] | null;
|
|
92
|
+
readonly conversationCursor: string | null;
|
|
98
93
|
};
|
|
99
94
|
export type Commit = {
|
|
100
95
|
readonly rooms: readonly RoomCommit[];
|
|
101
96
|
readonly writes?: readonly AuthoredWrite[];
|
|
102
97
|
readonly files?: readonly StoredFile[];
|
|
103
98
|
readonly whole?: boolean;
|
|
104
|
-
readonly discards?: readonly string[];
|
|
105
99
|
};
|
|
106
100
|
export type RuntimeStore = {
|
|
107
101
|
opened(): Promise<Opened>;
|
|
@@ -110,25 +104,25 @@ export type RuntimeStore = {
|
|
|
110
104
|
changes(keys: readonly number[]): number;
|
|
111
105
|
entries(key: number, view: View, paths: readonly string[]): Promise<readonly HeldEntry[]>;
|
|
112
106
|
typed(key: number, view: View, paths: readonly string[]): Promise<readonly TypedEntry[]>;
|
|
113
|
-
referrers(key: number, view: View, targets: readonly string[]
|
|
114
|
-
walk(key: number, view: View, after: string | null, bytes: number): Promise<Walked>;
|
|
107
|
+
referrers(key: number, view: View, targets: readonly string[]): Promise<readonly Referrer[]>;
|
|
115
108
|
files(key: number, view: View, after: string | null, limit: number): Promise<readonly {
|
|
116
109
|
readonly path: string;
|
|
117
110
|
readonly revision: string;
|
|
118
111
|
}[]>;
|
|
112
|
+
folders(key: number, view: View, paths: readonly string[]): Promise<readonly string[]>;
|
|
119
113
|
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
transferPart(locator: string, token: string): Promise<Uint8Array | null>;
|
|
123
|
-
keepParts(parts: readonly KeptPart[]): Promise<void>;
|
|
124
|
-
refresh(key: number, page: RefreshedPage): Promise<void>;
|
|
114
|
+
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
115
|
+
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
125
116
|
unrefresh(key: number): Promise<void>;
|
|
126
117
|
commit(commit: Commit): Promise<CommittedWrite>;
|
|
127
118
|
fence(locators: readonly string[]): Promise<void>;
|
|
128
119
|
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
129
|
-
abandon(locator: string
|
|
120
|
+
abandon(locator: string): Promise<void>;
|
|
130
121
|
release(key: number): Promise<void>;
|
|
131
|
-
rederive(key: number, bytes: number): Promise<
|
|
122
|
+
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
123
|
+
readonly done: boolean;
|
|
124
|
+
readonly text: number;
|
|
125
|
+
}>;
|
|
132
126
|
fact(name: string, value: unknown): Promise<void>;
|
|
133
127
|
queues(): Promise<readonly QueueRecord[]>;
|
|
134
128
|
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
@@ -137,8 +131,8 @@ export type RuntimeStore = {
|
|
|
137
131
|
present(record: PresentationRecord): Promise<void>;
|
|
138
132
|
conversations(): Promise<readonly HeldConversation[]>;
|
|
139
133
|
keepMessages(write: ConversationWrite): Promise<void>;
|
|
140
|
-
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null): Promise<MessageWindow>;
|
|
141
|
-
messageCount(conversation: string): Promise<number>;
|
|
134
|
+
messageWindow(conversation: string, limit: number, before: readonly [string, string] | null, phrase?: string | null): Promise<MessageWindow>;
|
|
135
|
+
messageCount(conversation: string, phrase?: string | null): Promise<number>;
|
|
142
136
|
turnArrived(conversation: string, turn: string): Promise<boolean>;
|
|
143
137
|
dropConversations(conversations: readonly string[]): Promise<void>;
|
|
144
138
|
chatDrafts(): Promise<readonly ChatDraftRecord[]>;
|
|
@@ -150,13 +144,6 @@ export type RuntimeStore = {
|
|
|
150
144
|
keepRoomDraft(record: RoomDraftRecord, files: readonly StoredFile[]): Promise<void>;
|
|
151
145
|
discardRoomDraft(locator: string, path: string): Promise<void>;
|
|
152
146
|
fences(): Promise<readonly string[]>;
|
|
153
|
-
receivedHeads(): Promise<readonly KeptReceipt[]>;
|
|
154
|
-
receivedParts(key: string, count: number): Promise<readonly unknown[]>;
|
|
155
|
-
keepReceived(key: string, head: unknown, part?: {
|
|
156
|
-
index: number;
|
|
157
|
-
value: unknown;
|
|
158
|
-
}): Promise<void>;
|
|
159
|
-
dropReceived(keys: readonly string[]): Promise<void>;
|
|
160
147
|
generation(): Promise<string | null>;
|
|
161
148
|
rememberGeneration(value: string): Promise<void>;
|
|
162
149
|
file(key: string, type: string): Promise<Blob>;
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,aAAa,EACd,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BAAkB,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;AA6FF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,EACpC,QAAQ,EAAE,eAAe,GACxB,YAAY,CA6Rd"}
|
package/dist/store.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { composedOf } from './collection.js';
|
|
1
2
|
import { binaryLocalId } from './identity.js';
|
|
2
3
|
const FILE = '\u0000file';
|
|
3
4
|
function batchFiles(batch) {
|
|
@@ -9,7 +10,7 @@ function draftFiles(drafts) {
|
|
|
9
10
|
function roomDraftRow(record) {
|
|
10
11
|
return { path: record.path, record: JSON.stringify(record), files: draftFiles([record]) };
|
|
11
12
|
}
|
|
12
|
-
function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoomDrafts
|
|
13
|
+
function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoomDrafts }, held) {
|
|
13
14
|
return {
|
|
14
15
|
locator,
|
|
15
16
|
...(queue === undefined
|
|
@@ -43,14 +44,6 @@ function authoredRows({ locator, queue, founded, saved, roomDrafts, consumedRoom
|
|
|
43
44
|
}),
|
|
44
45
|
...(roomDrafts === undefined ? {} : { roomDrafts: roomDrafts.map(roomDraftRow) }),
|
|
45
46
|
...(consumedRoomDrafts === undefined ? {} : { consumedRoomDrafts }),
|
|
46
|
-
...(accepted === undefined
|
|
47
|
-
? {}
|
|
48
|
-
: {
|
|
49
|
-
amendments: accepted.map(({ id, roomVersion }) => ({
|
|
50
|
-
id,
|
|
51
|
-
amendment: JSON.stringify({ accepted: roomVersion }),
|
|
52
|
-
})),
|
|
53
|
-
}),
|
|
54
47
|
};
|
|
55
48
|
}
|
|
56
49
|
function marked(value) {
|
|
@@ -120,7 +113,7 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
120
113
|
return {
|
|
121
114
|
async opened() {
|
|
122
115
|
const held = await authored.ask({ kind: 'replica.open' });
|
|
123
|
-
const unindexed = new Set(held.keys.flatMap(({ key, rederiving
|
|
116
|
+
const unindexed = new Set(held.keys.flatMap(({ key, rederiving }) => (rederiving === null ? [] : [key])));
|
|
124
117
|
const overlaid = new Map();
|
|
125
118
|
for (const { key, path } of held.overlaid) {
|
|
126
119
|
const paths = overlaid.get(key) ?? new Set();
|
|
@@ -134,15 +127,6 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
134
127
|
locator,
|
|
135
128
|
{ ...JSON.parse(record), key },
|
|
136
129
|
])),
|
|
137
|
-
transfers: new Map(held.transfers
|
|
138
|
-
.filter(({ locator }) => !fenced(locator))
|
|
139
|
-
.map(({ locator, key, record }) => [
|
|
140
|
-
locator,
|
|
141
|
-
{ ...JSON.parse(record), key },
|
|
142
|
-
])),
|
|
143
|
-
kept: held.kept
|
|
144
|
-
.filter(({ locator }) => !fenced(locator))
|
|
145
|
-
.reduce((parts, { locator, token, bytes }) => parts.set(locator, new Map(parts.get(locator)).set(token, bytes)), new Map()),
|
|
146
130
|
unindexed,
|
|
147
131
|
overlaid,
|
|
148
132
|
erasing: held.erasing.length > 0,
|
|
@@ -156,6 +140,8 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
156
140
|
app,
|
|
157
141
|
value: JSON.parse(value),
|
|
158
142
|
})),
|
|
143
|
+
conversationList: json(held.facts.conversationList, null),
|
|
144
|
+
conversationCursor: json(held.facts.conversationCursor, null),
|
|
159
145
|
};
|
|
160
146
|
},
|
|
161
147
|
counts(rooms) {
|
|
@@ -173,51 +159,36 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
173
159
|
typed(key, view, paths) {
|
|
174
160
|
return authored.ask({ kind: 'replica.typed', key, view, paths });
|
|
175
161
|
},
|
|
176
|
-
referrers(key, view, targets
|
|
177
|
-
return authored.ask({ kind: 'replica.referrers', key, view, targets
|
|
178
|
-
},
|
|
179
|
-
walk(key, view, after, bytes) {
|
|
180
|
-
return authored.ask({ kind: 'replica.walk', key, view, after, bytes });
|
|
162
|
+
referrers(key, view, targets) {
|
|
163
|
+
return authored.ask({ kind: 'replica.referrers', key, view, targets });
|
|
181
164
|
},
|
|
182
165
|
files(key, view, after, limit) {
|
|
183
166
|
return authored.ask({ kind: 'replica.files', key, view, after, limit });
|
|
184
167
|
},
|
|
168
|
+
folders(key, view, paths) {
|
|
169
|
+
return authored.ask({ kind: 'replica.folders', key, view, paths });
|
|
170
|
+
},
|
|
185
171
|
typedWithin(key, view, roots, within) {
|
|
186
172
|
return authored.ask({ kind: 'replica.typedWithin', key, view, roots, within });
|
|
187
173
|
},
|
|
188
|
-
|
|
189
|
-
return authored.ask({ kind: 'replica.search', ...ask });
|
|
190
|
-
},
|
|
191
|
-
async stage(record, composition, page, written) {
|
|
174
|
+
async stage(record, composition, page) {
|
|
192
175
|
if (fenced(record.locator))
|
|
193
176
|
return null;
|
|
194
|
-
const { key, ...kept } = record;
|
|
195
177
|
return authored.ask({
|
|
196
178
|
kind: 'replica.stage',
|
|
197
179
|
locator: record.locator,
|
|
198
180
|
transfer: record.transfer,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
composition,
|
|
181
|
+
key: record.key,
|
|
182
|
+
fingerprint: composedOf(composition).fingerprint,
|
|
202
183
|
entries: page.entries,
|
|
203
184
|
folders: page.folders,
|
|
204
|
-
...(written === undefined ? {} : { written }),
|
|
205
185
|
});
|
|
206
186
|
},
|
|
207
|
-
async
|
|
208
|
-
if (fenced(locator))
|
|
209
|
-
return null;
|
|
210
|
-
return authored.ask({ kind: 'replica.transferPart', locator, token });
|
|
211
|
-
},
|
|
212
|
-
async keepParts(parts) {
|
|
213
|
-
const kept = parts.filter(({ locator }) => !fenced(locator));
|
|
214
|
-
if (kept.length > 0)
|
|
215
|
-
await authored.ask({ kind: 'replica.keepParts', parts: kept });
|
|
216
|
-
},
|
|
217
|
-
async refresh(key, page) {
|
|
187
|
+
async refresh(key, composition, page) {
|
|
218
188
|
await authored.ask({
|
|
219
189
|
kind: 'replica.refresh',
|
|
220
190
|
key,
|
|
191
|
+
composed: composedOf(composition),
|
|
221
192
|
entries: page.entries,
|
|
222
193
|
removals: page.removals,
|
|
223
194
|
folders: page.folders,
|
|
@@ -227,7 +198,7 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
227
198
|
async unrefresh(key) {
|
|
228
199
|
await authored.ask({ kind: 'replica.unrefresh', key });
|
|
229
200
|
},
|
|
230
|
-
async commit({ rooms, writes = [], files = [], whole = false
|
|
201
|
+
async commit({ rooms, writes = [], files = [], whole = false }) {
|
|
231
202
|
const kept = whole ? writes : writes.filter(({ locator }) => !fenced(locator));
|
|
232
203
|
const refused = whole ? kept.find(({ locator }) => fenced(locator)) : undefined;
|
|
233
204
|
if (refused !== undefined) {
|
|
@@ -237,15 +208,13 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
237
208
|
change(room.key);
|
|
238
209
|
const committed = await authored.ask({
|
|
239
210
|
kind: 'replica.commit',
|
|
240
|
-
...(kept.length === 0 && files.length === 0
|
|
211
|
+
...(kept.length === 0 && files.length === 0
|
|
241
212
|
? {}
|
|
242
|
-
: { authored: { writes: rows(kept), files, whole
|
|
213
|
+
: { authored: { writes: rows(kept), files, whole } }),
|
|
243
214
|
rooms: rooms.filter(({ locator }) => !fenced(locator)),
|
|
244
215
|
});
|
|
245
216
|
if (committed.fenced === null || !whole)
|
|
246
217
|
noted(kept);
|
|
247
|
-
for (const locator of discards)
|
|
248
|
-
queued.delete(locator);
|
|
249
218
|
return committed;
|
|
250
219
|
},
|
|
251
220
|
async fence(locators) {
|
|
@@ -256,17 +225,24 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
256
225
|
async erase(locator, limit) {
|
|
257
226
|
return (await authored.ask({ kind: 'replica.erase', locator, limit })).remaining;
|
|
258
227
|
},
|
|
259
|
-
async abandon(locator
|
|
228
|
+
async abandon(locator) {
|
|
260
229
|
if (fenced(locator))
|
|
261
|
-
return
|
|
262
|
-
|
|
230
|
+
return;
|
|
231
|
+
await authored.ask({ kind: 'replica.abandon', locator });
|
|
263
232
|
},
|
|
264
233
|
async release(key) {
|
|
265
234
|
await authored.ask({ kind: 'replica.release', key });
|
|
266
235
|
},
|
|
267
|
-
async rederive(key, bytes) {
|
|
236
|
+
async rederive(key, composition, bytes, ms, floor) {
|
|
268
237
|
change(key);
|
|
269
|
-
return
|
|
238
|
+
return authored.ask({
|
|
239
|
+
kind: 'replica.rederive',
|
|
240
|
+
key,
|
|
241
|
+
composed: composedOf(composition),
|
|
242
|
+
bytes,
|
|
243
|
+
ms,
|
|
244
|
+
floor,
|
|
245
|
+
});
|
|
270
246
|
},
|
|
271
247
|
async fact(name, value) {
|
|
272
248
|
await authored.ask({ kind: 'replica.fact', name, value: JSON.stringify(value) });
|
|
@@ -317,11 +293,11 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
317
293
|
async keepMessages(write) {
|
|
318
294
|
await authored.ask({ kind: 'conversation.keep', ...write });
|
|
319
295
|
},
|
|
320
|
-
messageWindow(conversation, limit, before) {
|
|
321
|
-
return authored.ask({ kind: 'conversation.window', conversation, limit, before });
|
|
296
|
+
messageWindow(conversation, limit, before, phrase = null) {
|
|
297
|
+
return authored.ask({ kind: 'conversation.window', conversation, limit, before, phrase });
|
|
322
298
|
},
|
|
323
|
-
messageCount(conversation) {
|
|
324
|
-
return authored.ask({ kind: 'conversation.count', conversation });
|
|
299
|
+
messageCount(conversation, phrase = null) {
|
|
300
|
+
return authored.ask({ kind: 'conversation.count', conversation, phrase });
|
|
325
301
|
},
|
|
326
302
|
turnArrived(conversation, turn) {
|
|
327
303
|
return authored.ask({ kind: 'conversation.turn', conversation, turn });
|
|
@@ -381,25 +357,6 @@ export function openRuntimeStore(fenced, authored) {
|
|
|
381
357
|
fences() {
|
|
382
358
|
return authored.ask({ kind: 'authored.fences' });
|
|
383
359
|
},
|
|
384
|
-
receivedHeads() {
|
|
385
|
-
return authored.ask({ kind: 'replica.received' });
|
|
386
|
-
},
|
|
387
|
-
receivedParts(key, count) {
|
|
388
|
-
return authored.ask({ kind: 'replica.receivedParts', key, count });
|
|
389
|
-
},
|
|
390
|
-
async keepReceived(key, head, part) {
|
|
391
|
-
await authored.ask({
|
|
392
|
-
kind: 'replica.receive',
|
|
393
|
-
key,
|
|
394
|
-
head: JSON.stringify(head),
|
|
395
|
-
...(part === undefined
|
|
396
|
-
? {}
|
|
397
|
-
: { part: { index: part.index, value: JSON.stringify(part.value) } }),
|
|
398
|
-
});
|
|
399
|
-
},
|
|
400
|
-
async dropReceived(keys) {
|
|
401
|
-
await authored.ask({ kind: 'replica.unreceive', keys });
|
|
402
|
-
},
|
|
403
360
|
generation() {
|
|
404
361
|
return fact('generation');
|
|
405
362
|
},
|
package/dist/stored.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HeadChange } from './adapter.js';
|
|
2
|
-
import type
|
|
1
|
+
import type { SavedFacts, HeadChange } from './adapter.js';
|
|
2
|
+
import { type Composed, type Composition } from './collection.js';
|
|
3
3
|
import type { HeldBinary } from './overlay.js';
|
|
4
4
|
import type { Connection } from './tables.js';
|
|
5
5
|
export declare const REPLICA_TABLES: readonly string[];
|
|
@@ -12,6 +12,7 @@ export type StoredEntry = {
|
|
|
12
12
|
readonly fileId: string | null;
|
|
13
13
|
readonly change: HeadChange | null;
|
|
14
14
|
readonly written: string | null;
|
|
15
|
+
readonly facts: SavedFacts | null;
|
|
15
16
|
};
|
|
16
17
|
export type OverlayEntry = StoredEntry & {
|
|
17
18
|
readonly present: boolean;
|
|
@@ -27,14 +28,12 @@ export type TypedEntry = {
|
|
|
27
28
|
export type Referrer = {
|
|
28
29
|
readonly path: string;
|
|
29
30
|
readonly target: string;
|
|
30
|
-
readonly kind: string;
|
|
31
31
|
};
|
|
32
32
|
export type HeldKey = {
|
|
33
33
|
readonly key: number;
|
|
34
34
|
readonly locator: string;
|
|
35
35
|
readonly transfer: string;
|
|
36
36
|
readonly rederiving: number | null;
|
|
37
|
-
readonly searching: number | null;
|
|
38
37
|
};
|
|
39
38
|
export type ReplicaOpened = {
|
|
40
39
|
readonly rooms: readonly {
|
|
@@ -42,16 +41,6 @@ export type ReplicaOpened = {
|
|
|
42
41
|
readonly key: number;
|
|
43
42
|
readonly record: string;
|
|
44
43
|
}[];
|
|
45
|
-
readonly transfers: readonly {
|
|
46
|
-
readonly locator: string;
|
|
47
|
-
readonly key: number;
|
|
48
|
-
readonly record: string;
|
|
49
|
-
}[];
|
|
50
|
-
readonly kept: readonly {
|
|
51
|
-
readonly locator: string;
|
|
52
|
-
readonly token: string;
|
|
53
|
-
readonly bytes: number;
|
|
54
|
-
}[];
|
|
55
44
|
readonly keys: readonly HeldKey[];
|
|
56
45
|
readonly facts: Readonly<Record<string, string>>;
|
|
57
46
|
readonly presentation: readonly {
|
|
@@ -77,7 +66,7 @@ export type RoomCommit = {
|
|
|
77
66
|
readonly from: number | null;
|
|
78
67
|
};
|
|
79
68
|
readonly refreshed?: true;
|
|
80
|
-
readonly
|
|
69
|
+
readonly composed: Composed;
|
|
81
70
|
readonly confirmed?: {
|
|
82
71
|
readonly set: readonly StoredEntry[];
|
|
83
72
|
readonly removed: readonly string[];
|
|
@@ -96,24 +85,18 @@ export type CountedRoom = {
|
|
|
96
85
|
readonly key: number;
|
|
97
86
|
readonly roots: readonly string[];
|
|
98
87
|
};
|
|
99
|
-
export type Walked = {
|
|
100
|
-
readonly entries: readonly HeldEntry[];
|
|
101
|
-
readonly next: string | null;
|
|
102
|
-
};
|
|
103
|
-
export declare function fingerprint(composition: Composition): string;
|
|
104
88
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
105
89
|
export declare function stage(connection: Connection, request: {
|
|
106
90
|
readonly locator: string;
|
|
107
91
|
readonly transfer: string;
|
|
108
|
-
readonly record: string;
|
|
109
92
|
readonly key: number | null;
|
|
110
|
-
readonly
|
|
93
|
+
readonly fingerprint: string;
|
|
111
94
|
readonly entries: readonly StoredEntry[];
|
|
112
95
|
readonly folders: readonly string[];
|
|
113
|
-
readonly written?: string;
|
|
114
96
|
}): number;
|
|
115
97
|
export declare function refreshing(connection: Connection, request: {
|
|
116
98
|
readonly key: number;
|
|
99
|
+
readonly composed: Composed;
|
|
117
100
|
readonly entries: readonly StoredEntry[];
|
|
118
101
|
readonly removals: readonly string[];
|
|
119
102
|
readonly folders: readonly string[];
|
|
@@ -123,30 +106,24 @@ export declare function unrefresh(connection: Connection, key: number): null;
|
|
|
123
106
|
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
124
107
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
125
108
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
126
|
-
export declare function abandon(connection: Connection, locator: string
|
|
109
|
+
export declare function abandon(connection: Connection, locator: string): null;
|
|
127
110
|
export declare function release(connection: Connection, key: number): null;
|
|
128
111
|
export declare function erase(connection: Connection, locator: string | null, limit: number): {
|
|
129
112
|
readonly remaining: boolean;
|
|
130
113
|
};
|
|
131
|
-
export declare function rederive(connection: Connection, key: number, bytes: number): {
|
|
114
|
+
export declare function rederive(connection: Connection, key: number, composed: Composed, bytes: number, ms: number, floor: number): {
|
|
132
115
|
readonly done: boolean;
|
|
116
|
+
readonly text: number;
|
|
133
117
|
};
|
|
134
118
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
135
119
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
136
|
-
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]
|
|
137
|
-
export declare function walk(connection: Connection, key: number, view: View, after: string | null, bytes: number): Walked;
|
|
120
|
+
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]): Referrer[];
|
|
138
121
|
export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
|
|
139
122
|
readonly path: string;
|
|
140
123
|
readonly revision: string;
|
|
141
124
|
}[];
|
|
125
|
+
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
142
126
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
143
|
-
export declare function transferPart(connection: Connection, locator: string, token: string): Uint8Array | null;
|
|
144
|
-
export type KeptPart = {
|
|
145
|
-
readonly locator: string;
|
|
146
|
-
readonly token: string;
|
|
147
|
-
readonly part: Uint8Array;
|
|
148
|
-
};
|
|
149
|
-
export declare function keepParts(connection: Connection, parts: readonly KeptPart[]): null;
|
|
150
127
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
151
128
|
export declare function ended(connection: Connection): void;
|
|
152
129
|
//# sourceMappingURL=stored.d.ts.map
|
package/dist/stored.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stored.d.ts","sourceRoot":"","sources":["../src/stored.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAc,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAE1D,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAiB3C,CAAC;AAmBF,MAAM,MAAM,IAAI,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;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