@agentshouse/mdruntime 0.1.0-cd26b960b7262 → 0.1.0-cd35ccee27a19
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/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +58 -135
- package/dist/actions.js +5 -5
- package/dist/adapter.d.ts +26 -45
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -19
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/client.d.ts +4 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -8
- package/dist/collection.d.ts +22 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +12 -2
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +17 -13
- package/dist/conversation-live.d.ts +5 -5
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +7 -6
- package/dist/conversation.d.ts +18 -6
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +115 -82
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +11 -38
- package/dist/failure.d.ts +1 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -0
- package/dist/host.d.ts +17 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +34 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/install.d.ts +0 -2
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +47 -63
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +28 -24
- package/dist/listing.d.ts +6 -11
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +25 -62
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +3 -1
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +10 -38
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +10 -21
- package/dist/memory.d.ts +4 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +22 -9
- package/dist/messages.d.ts +0 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +5 -17
- package/dist/model.d.ts +0 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -5
- package/dist/models.d.ts +4 -8
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +97 -136
- package/dist/opened.d.ts +1 -1
- 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 +6 -4
- package/dist/overlay.d.ts +2 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +32 -21
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +3 -52
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +15 -120
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +20 -13
- package/dist/presence.d.ts +52 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +220 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +4 -6
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +455 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +23 -4
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +4 -1
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -3
- package/dist/replica.d.ts +5 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +12 -14
- package/dist/room-draft.d.ts +3 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +33 -49
- package/dist/room-drafts.js +3 -3
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -4
- package/dist/runtime.d.ts +7 -16
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +41 -90
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +220 -110
- package/dist/saves.d.ts +2 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +106 -698
- package/dist/seed.js +2 -2
- package/dist/shown.d.ts +4 -3
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +24 -26
- package/dist/socket.d.ts +0 -3
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +0 -5
- package/dist/store/records.d.ts +2 -2
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +2 -3
- package/dist/store.d.ts +8 -5
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +32 -12
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +3 -3
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +8 -8
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +55 -66
- package/dist/tables.d.ts +0 -4
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +1 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/wire.d.ts +40 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +12 -3
- package/package.json +3 -2
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/socket/rooms.d.ts +0 -44
- package/dist/socket/rooms.d.ts.map +0 -1
- package/dist/socket/rooms.js +0 -90
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/dist/host.d.ts
CHANGED
|
@@ -2,10 +2,24 @@ import { type MdRuntimeOptions } from './connection.js';
|
|
|
2
2
|
import type { PortReach } from './reach.js';
|
|
3
3
|
import type { CodeAvailability, Persistence, Readiness } from './readiness.js';
|
|
4
4
|
import type { EntrySeed } from './seed.js';
|
|
5
|
+
import { type CallResult } from './outcome.js';
|
|
5
6
|
import { type RuntimePort } from './wire.js';
|
|
6
7
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
7
8
|
deploymentFacts?: unknown;
|
|
8
9
|
};
|
|
10
|
+
export type Admitted = {
|
|
11
|
+
readonly admitted: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
readonly refused: CallResult;
|
|
14
|
+
};
|
|
15
|
+
export type ActionAdmission = (name: string, input: unknown) => Promise<Admitted>;
|
|
16
|
+
export type AttachOptions = {
|
|
17
|
+
readonly app: string;
|
|
18
|
+
readonly release?: string;
|
|
19
|
+
readonly reach?: PortReach;
|
|
20
|
+
readonly admission?: ActionAdmission;
|
|
21
|
+
readonly code?: CodeAvailability;
|
|
22
|
+
};
|
|
9
23
|
export type AttachedPort = {
|
|
10
24
|
detach(): void;
|
|
11
25
|
narrow(reach: PortReach): void;
|
|
@@ -13,7 +27,7 @@ export type AttachedPort = {
|
|
|
13
27
|
answered(queries: readonly unknown[], done: () => void): void;
|
|
14
28
|
};
|
|
15
29
|
export type MdRuntimeHost = {
|
|
16
|
-
attach(port: RuntimePort,
|
|
30
|
+
attach(port: RuntimePort, options: AttachOptions): AttachedPort;
|
|
17
31
|
present(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
18
32
|
seed(entry: EntrySeed): void;
|
|
19
33
|
persisted(answer: Persistence): void;
|
|
@@ -25,5 +39,6 @@ export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
|
25
39
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
26
40
|
export type { CodeAvailability, Persistence, Space } from './readiness.js';
|
|
27
41
|
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
28
|
-
export
|
|
42
|
+
export { undeclared } from './outcome.js';
|
|
43
|
+
export { wireAnswer, wireRequest, type RuntimePort, type WireAnswer, type WireRequest, } from './wire.js';
|
|
29
44
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAUxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEL,KAAK,WAAW,EAQjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,M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AAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -3,7 +3,7 @@ import { composeRuntime } from './connection.js';
|
|
|
3
3
|
import { untilAnswered } from './recovery.js';
|
|
4
4
|
import { described } from './failure.js';
|
|
5
5
|
import { answeredResult } from './outcome.js';
|
|
6
|
-
import { AUTHORIZATION_ENDED,
|
|
6
|
+
import { AUTHORIZATION_ENDED, WIRE, wireRequest, } from './wire.js';
|
|
7
7
|
const NARROWED = new Set(['within', 'whole']);
|
|
8
8
|
function answered(md, app, writtenBy, member, input) {
|
|
9
9
|
switch (member) {
|
|
@@ -83,6 +83,24 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
83
83
|
return md.conversation.kill(input[0]);
|
|
84
84
|
case 'conversation.delete':
|
|
85
85
|
return md.conversation.delete(input[0]);
|
|
86
|
+
case 'conversation.takeOut':
|
|
87
|
+
return md.conversation.takeOut(input[0], input[1], input[2]);
|
|
88
|
+
case 'conversation.decide':
|
|
89
|
+
return md.conversation.decide(input[0], input[1], input[2]);
|
|
90
|
+
case 'conversation.rename':
|
|
91
|
+
return md.conversation.rename(input[0], input[1], input[2]);
|
|
92
|
+
case 'conversation.option':
|
|
93
|
+
return md.conversation.option(input[0], input[1], input[2], input[3]);
|
|
94
|
+
case 'conversation.retry':
|
|
95
|
+
return md.conversation.retry(input[0], input[1], input[2]);
|
|
96
|
+
case 'conversation.pins':
|
|
97
|
+
return md.conversation.pins();
|
|
98
|
+
case 'conversation.pin':
|
|
99
|
+
return md.conversation.pin(input[0]);
|
|
100
|
+
case 'conversation.openedTurns':
|
|
101
|
+
return md.conversation.openedTurns();
|
|
102
|
+
case 'conversation.openTurn':
|
|
103
|
+
return md.conversation.openTurn(input[0], input[1]);
|
|
86
104
|
case 'chatDraft.write':
|
|
87
105
|
return md.chatDraft.write(input[0], input[1], input[2]);
|
|
88
106
|
case 'chatDraft.prepend':
|
|
@@ -123,9 +141,10 @@ export function serveMdRuntime(options) {
|
|
|
123
141
|
deliver(structuredClone(deploymentFacts));
|
|
124
142
|
return () => { };
|
|
125
143
|
};
|
|
126
|
-
function attach(port,
|
|
144
|
+
function attach(port, options) {
|
|
127
145
|
if (!authorized)
|
|
128
146
|
throw new Error(AUTHORIZATION_ENDED);
|
|
147
|
+
const { app, release, reach, admission, code = 'stored' } = options;
|
|
129
148
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
130
149
|
const view = runtime.within(reach ?? null, { target: app, code });
|
|
131
150
|
const observations = new Map();
|
|
@@ -190,6 +209,15 @@ export function serveMdRuntime(options) {
|
|
|
190
209
|
send({ kind: 'failure', id, ...described(error) });
|
|
191
210
|
}
|
|
192
211
|
};
|
|
212
|
+
const admitted = admission === undefined
|
|
213
|
+
? view.md
|
|
214
|
+
: {
|
|
215
|
+
...view.md,
|
|
216
|
+
async call(name, input) {
|
|
217
|
+
const decided = await admission(name, input);
|
|
218
|
+
return 'refused' in decided ? decided.refused : view.md.call(name, decided.admitted);
|
|
219
|
+
},
|
|
220
|
+
};
|
|
193
221
|
const serve = async (message) => {
|
|
194
222
|
if (message.kind === 'hello')
|
|
195
223
|
return;
|
|
@@ -215,13 +243,13 @@ export function serveMdRuntime(options) {
|
|
|
215
243
|
return;
|
|
216
244
|
}
|
|
217
245
|
const { id, member, input } = message;
|
|
218
|
-
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ?
|
|
246
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
219
247
|
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
220
248
|
};
|
|
221
249
|
port.addEventListener('message', (event) => {
|
|
222
250
|
if (!serving)
|
|
223
251
|
return;
|
|
224
|
-
const message =
|
|
252
|
+
const message = wireRequest(event.data);
|
|
225
253
|
if (message === null)
|
|
226
254
|
return;
|
|
227
255
|
void serve(message);
|
|
@@ -287,3 +315,5 @@ export function serveMdRuntime(options) {
|
|
|
287
315
|
}
|
|
288
316
|
export { entrySeedOf } from './seed.js';
|
|
289
317
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
318
|
+
export { undeclared } from './outcome.js';
|
|
319
|
+
export { wireAnswer, wireRequest, } from './wire.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty,
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, AgentEnvironment, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
3
|
export { heldFacts } from './conversation-row.js';
|
|
4
4
|
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
5
|
-
export type { ChatDraft, ChatDraftSurface, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationRead, ConversationState, ConversationSurface, ConversationView, RunningTurn, } from './conversation.js';
|
|
5
|
+
export type { ChatDraft, ChatDraftSurface, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationRead, ConversationState, ConversationSurface, ConversationView, RequestDecision, RunningTurn, } from './conversation.js';
|
|
6
6
|
export type { MdRuntimeOptions } from './connection.js';
|
|
7
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
8
|
+
export { writeRule, type WriteRefusal } from './declaration.js';
|
|
7
9
|
export type { HistoryQuery } from './actions.js';
|
|
8
10
|
export type { AppRoom, AppTypedSelection } from './listing.js';
|
|
9
11
|
export type { ConnectionRefusal, ConnectionRefusalCode } from './socket.js';
|
|
@@ -22,14 +24,14 @@ export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './sear
|
|
|
22
24
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
23
25
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
24
26
|
export { departure } from './change.js';
|
|
27
|
+
export { definitionsIn, selected } from './collection.js';
|
|
25
28
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
26
29
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
27
30
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
28
31
|
export { contextFigure } from './context.js';
|
|
29
|
-
export { jobsRunning, openJobs, sessionEnded, type OpenJob, type RunningJob } from './job.js';
|
|
30
32
|
export { changeBatchIdentity } from './identity.js';
|
|
31
33
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
32
|
-
export { authoredAt } from './paths.js';
|
|
34
|
+
export { authoredAt, covered } from './paths.js';
|
|
33
35
|
export { untilAnswered } from './recovery.js';
|
|
34
36
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
35
37
|
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,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EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
3
|
+
export { writeRule } from './declaration.js';
|
|
2
4
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
3
5
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
4
6
|
export { departure } from './change.js';
|
|
7
|
+
export { definitionsIn, selected } from './collection.js';
|
|
5
8
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
6
9
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
7
10
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
8
11
|
export { contextFigure } from './context.js';
|
|
9
|
-
export { jobsRunning, openJobs, sessionEnded } from './job.js';
|
|
10
12
|
export { changeBatchIdentity } from './identity.js';
|
|
11
13
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
12
|
-
export { authoredAt } from './paths.js';
|
|
14
|
+
export { authoredAt, covered } from './paths.js';
|
|
13
15
|
export { untilAnswered } from './recovery.js';
|
|
14
16
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
15
17
|
export { attempts, identities, intentOf, } from './attempt.js';
|
package/dist/install.d.ts
CHANGED
|
@@ -36,10 +36,8 @@ export declare const ERASE_BATCH = 512;
|
|
|
36
36
|
export declare function installationOf(store: Store, coverage: readonly RoomCoverage[], held: ReadonlyMap<string, CoveredRoom>): Installation;
|
|
37
37
|
export declare function roomInFlight(store: Store, locator: string): boolean;
|
|
38
38
|
export declare function sweep({ store, socket, journal }: Runtime): void;
|
|
39
|
-
export declare function forgetInstall(store: Store, locator: string): void;
|
|
40
39
|
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
|
41
40
|
export declare function catching(store: Store, locator: string): void;
|
|
42
|
-
export declare function confirmedAgain(store: Store, locator: string): void;
|
|
43
41
|
export declare function standingAt(store: Store, locator: string, held: Pick<ReplicaRecord, 'key'> | undefined): Standing;
|
|
44
42
|
export declare function showing(system: Runtime, locator: string, roomVersion: string, held: string | undefined): void;
|
|
45
43
|
export declare function olderThan(system: Runtime, locator: string, roomVersion: string, held: string | undefined): boolean;
|
package/dist/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,QAAQ,EACR,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkC,KAAK,KAAK,EAAgB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,QAAQ,EACR,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkC,KAAK,KAAK,EAAgB,MAAM,gBAAgB,CAAC;AAO1F,OAAO,KAAK,EACV,YAAY,EAGZ,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAmB,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA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AE,MAAM,EAAE,EAAE,OAAO,EAC1B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAUlB;AAiFD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,aAAa,EACzB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,SAAS,CAAC,CA+CpB;AA2ID,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,aAAa,EACzB,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,IAAI,GAAE,KAA4B,EAClC,MAAM,CAAC,EAAE,MAAM;mBAgCI,uBAAuB;6DAc3C;AAED,wBAAgB,OAAO,CACrB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,OAAO,CAAC,CAkElB"}
|
package/dist/install.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { attachedModel } from './attached-model.js';
|
|
2
2
|
import { bootstrapRoom } from './bootstrap.js';
|
|
3
3
|
import { refusedForSpace } from './durability.js';
|
|
4
|
-
import {
|
|
4
|
+
import { uncaught } from './failure.js';
|
|
5
|
+
import { name } from './listing.js';
|
|
5
6
|
import { NO_MODEL } from './model.js';
|
|
7
|
+
import { settle } from './queue.js';
|
|
6
8
|
import { advancement } from './refresh.js';
|
|
7
|
-
import { recoverReads
|
|
8
|
-
import { NO_INSTALL, } from './store.js';
|
|
9
|
+
import { recoverReads } from './shown.js';
|
|
9
10
|
import { unconfirmed } from './transfer.js';
|
|
10
11
|
import { ROW_WEIGHT, yielded } from './turn.js';
|
|
11
12
|
// Bytes still arriving are reported at most this often, so readiness is not rebuilt for every chunk the network hands over while a slow link still moves the figure.
|
|
@@ -130,17 +131,15 @@ export function sweep({ store, socket, journal }) {
|
|
|
130
131
|
await yielded();
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
catch {
|
|
134
|
+
catch (error) {
|
|
134
135
|
journal.record('erasure failed');
|
|
136
|
+
uncaught(error);
|
|
135
137
|
}
|
|
136
138
|
finally {
|
|
137
139
|
store.device.set({ sweeping: false });
|
|
138
140
|
}
|
|
139
141
|
})();
|
|
140
142
|
}
|
|
141
|
-
export function forgetInstall(store, locator) {
|
|
142
|
-
store.installs.change(locator, ({ installing }) => ({ ...NO_INSTALL, installing }));
|
|
143
|
-
}
|
|
144
143
|
export function caughtUpTo(runtime, locator) {
|
|
145
144
|
if (!runtime.store.installs.of(locator).catching)
|
|
146
145
|
return;
|
|
@@ -150,12 +149,6 @@ export function caughtUpTo(runtime, locator) {
|
|
|
150
149
|
export function catching(store, locator) {
|
|
151
150
|
store.installs.change(locator, (held) => ({ ...held, catching: true }));
|
|
152
151
|
}
|
|
153
|
-
export function confirmedAgain(store, locator) {
|
|
154
|
-
store.installs.change(locator, (held) => ({
|
|
155
|
-
...held,
|
|
156
|
-
confirmations: held.confirmations + 1,
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
152
|
export function standingAt(store, locator, held) {
|
|
160
153
|
return { key: held?.key ?? null, confirmed: store.installs.of(locator).confirmations };
|
|
161
154
|
}
|
|
@@ -394,7 +387,9 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
394
387
|
if (!liveness())
|
|
395
388
|
return null;
|
|
396
389
|
const prior = unheld === undefined ? await store.record(locator) : undefined;
|
|
397
|
-
const published = prior !== undefined && prior.replica.selection === record.selection
|
|
390
|
+
const published = prior !== undefined && prior.declaration.replica.selection === record.selection
|
|
391
|
+
? prior.key
|
|
392
|
+
: null;
|
|
398
393
|
const kept = unheld?.staged ?? (await local.held()).staged.has(locator);
|
|
399
394
|
if (published === null && !kept)
|
|
400
395
|
return { record: null, staged: new Set() };
|
|
@@ -450,7 +445,7 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
450
445
|
}
|
|
451
446
|
try {
|
|
452
447
|
const result = await bootstrapRoom(from, authorized, room, {
|
|
453
|
-
collection: prior?.model ?? runtime.
|
|
448
|
+
collection: prior?.model ?? runtime.presence.unheldModel(room.locator) ?? NO_MODEL,
|
|
454
449
|
}, runtime.builtIn, runtime.typedPaths, (models, held) => (liveness() ? remodel(runtime, models, held) : held), liveness, staging(runtime, local, liveness, unheld));
|
|
455
450
|
const detail = result.kind === 'staged' ? result.record.roomVersion : result.kind;
|
|
456
451
|
journal.record(`transfer bootstrap ${room.locator} ${detail}`);
|
|
@@ -479,21 +474,22 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
479
474
|
}
|
|
480
475
|
export function publish(runtime, local, room, reached, landing, live) {
|
|
481
476
|
const { store } = runtime;
|
|
482
|
-
|
|
477
|
+
let published = true;
|
|
478
|
+
const landed = settle(runtime, [room.locator], async (held) => {
|
|
483
479
|
if (!live()) {
|
|
484
480
|
caughtUpTo(runtime, room.locator);
|
|
485
|
-
return
|
|
481
|
+
return [];
|
|
486
482
|
}
|
|
487
|
-
const
|
|
488
|
-
const prior = work.replica;
|
|
483
|
+
const prior = held.get(room.locator)?.replica;
|
|
489
484
|
if (!standsAt(store, room.locator, prior?.record, landing.from)) {
|
|
485
|
+
published = false;
|
|
490
486
|
if (landing.kind === 'refreshed') {
|
|
491
487
|
await local.unrefresh(reached.key);
|
|
492
|
-
return
|
|
488
|
+
return [];
|
|
493
489
|
}
|
|
494
490
|
caughtUpTo(runtime, room.locator);
|
|
495
491
|
await abandoned(runtime, local, room.locator);
|
|
496
|
-
return
|
|
492
|
+
return [];
|
|
497
493
|
}
|
|
498
494
|
const record = landing.kind === 'refreshed' && prior !== undefined
|
|
499
495
|
? {
|
|
@@ -502,51 +498,39 @@ export function publish(runtime, local, room, reached, landing, live) {
|
|
|
502
498
|
...(landing.remodelled ? { model: reached.model } : {}),
|
|
503
499
|
}
|
|
504
500
|
: reached;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
: {
|
|
514
|
-
room: true,
|
|
515
|
-
view: landing.refreshed ? 'refreshed' : 'confirmed',
|
|
516
|
-
commit: {
|
|
501
|
+
return [
|
|
502
|
+
{
|
|
503
|
+
locator: room.locator,
|
|
504
|
+
record,
|
|
505
|
+
installed: landing.kind === 'refreshed'
|
|
506
|
+
? { refreshed: true }
|
|
507
|
+
: {
|
|
517
508
|
published: { from: prior?.record.key ?? null },
|
|
518
509
|
...(landing.refreshed ? { refreshed: true } : {}),
|
|
519
510
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
void runtime.store.changed(set);
|
|
544
|
-
await runtime.unpair(local);
|
|
545
|
-
void statusShown(runtime);
|
|
546
|
-
if (landing.kind === 'bootstrapped' && work.queue.length > 0) {
|
|
547
|
-
runtime.submitLater(room.locator);
|
|
548
|
-
}
|
|
549
|
-
return true;
|
|
511
|
+
after() {
|
|
512
|
+
runtime.presence.installed(room.locator, landing.kind === 'bootstrapped');
|
|
513
|
+
store.prepareAgain(room.locator);
|
|
514
|
+
if (landing.kind === 'bootstrapped') {
|
|
515
|
+
store.installs.change(room.locator, (held) => ({
|
|
516
|
+
...transferGone(held),
|
|
517
|
+
highest: null,
|
|
518
|
+
beyondHorizon: false,
|
|
519
|
+
startedOver: null,
|
|
520
|
+
catching: false,
|
|
521
|
+
}));
|
|
522
|
+
if (prior !== undefined && prior.record.key !== record.key)
|
|
523
|
+
sweep(runtime);
|
|
524
|
+
void name(runtime, room.locator);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
];
|
|
529
|
+
}).then(() => published, (error) => {
|
|
530
|
+
if (!refusedForSpace(error))
|
|
531
|
+
throw error;
|
|
532
|
+
caughtUpTo(runtime, room.locator);
|
|
533
|
+
return published;
|
|
550
534
|
});
|
|
551
535
|
return landing.kind === 'refreshed'
|
|
552
536
|
? landed
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Runtime } from './runtime.js';
|
|
2
2
|
export declare function scheduleCurrency(runtime: Runtime): void;
|
|
3
3
|
export declare function spaceFreed(runtime: Runtime): void;
|
|
4
|
-
export declare function close({ store, socket, conversations, recovery, liveQueries, figures }: Runtime): void;
|
|
4
|
+
export declare function close({ store, socket, presence, conversations, recovery, liveQueries, figures, }: Runtime): void;
|
|
5
5
|
export declare function stop(runtime: Runtime): Promise<void>;
|
|
6
6
|
export declare function start(runtime: Runtime, signal: AbortSignal | undefined): void;
|
|
7
7
|
//# sourceMappingURL=lifecycle.d.ts.map
|
package/dist/lifecycle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAyN5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAOhD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,QAS1C;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,WAAW,EACX,OAAO,GACR,EAAE,OAAO,QAST;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,iBAS1C;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,QAyCtE"}
|
package/dist/lifecycle.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { submitAll } from './acceptance.js';
|
|
2
1
|
import { catchUpConversations, receiveConversationEvent, reconcileConversations, } from './conversation.js';
|
|
2
|
+
import { declared } from './declaration.js';
|
|
3
|
+
import { uncaught } from './failure.js';
|
|
3
4
|
import { catching, replaced } from './install.js';
|
|
4
5
|
import { connectionLost } from './locks.js';
|
|
5
6
|
import { fenceLive } from './lost.js';
|
|
6
7
|
import { cachedModels, revoked, settleModels } from './models.js';
|
|
7
8
|
import { refuse } from './refusal.js';
|
|
8
|
-
import { moveTo, recoverReads, rest, SERVICE_MODE_TOPIC, show, transferring } from './shown.js';
|
|
9
|
+
import { moveTo, recoverReads, rest, SERVICE_MODE_TOPIC, show, submissionDue, transferring, } from './shown.js';
|
|
9
10
|
import { applyRoom, changeAuthority, countAuthorityChange, finishOpening, loadRoom, OPENING_LANE, reload, resynchronize, sync, } from './sync.js';
|
|
10
11
|
const CONVERSATION_LANE = 'conversations';
|
|
11
12
|
function closing(runtime, opened) {
|
|
@@ -20,10 +21,10 @@ function closing(runtime, opened) {
|
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
function closedSocket(runtime, lapsed, lost, opened) {
|
|
23
|
-
const { socket, conversations } = runtime;
|
|
24
|
+
const { socket, presence, conversations } = runtime;
|
|
24
25
|
const { session } = socket;
|
|
25
26
|
socket.notifyReady();
|
|
26
|
-
|
|
27
|
+
presence.stopAsking();
|
|
27
28
|
connectionLost(runtime);
|
|
28
29
|
if (lost)
|
|
29
30
|
conversations.lost();
|
|
@@ -43,9 +44,9 @@ function closedSocket(runtime, lapsed, lost, opened) {
|
|
|
43
44
|
void closing(runtime, opened);
|
|
44
45
|
}
|
|
45
46
|
function owedReloads(runtime, expired, held) {
|
|
46
|
-
const { store,
|
|
47
|
-
const reloading =
|
|
48
|
-
.
|
|
47
|
+
const { store, presence } = runtime;
|
|
48
|
+
const reloading = presence
|
|
49
|
+
.rooms()
|
|
49
50
|
.filter((room) => !expired.includes(room.locator) && revoked(held.get(room.locator)?.record.model))
|
|
50
51
|
.map((room) => room.locator);
|
|
51
52
|
for (const locator of reloading)
|
|
@@ -54,15 +55,15 @@ function owedReloads(runtime, expired, held) {
|
|
|
54
55
|
return reloading;
|
|
55
56
|
}
|
|
56
57
|
async function reloadNow(runtime, replacing, progress, held, installing) {
|
|
57
|
-
const { store, socket } = runtime;
|
|
58
|
-
const {
|
|
59
|
-
const discovered = rooms
|
|
58
|
+
const { store, socket, presence } = runtime;
|
|
59
|
+
const { lanes } = socket;
|
|
60
|
+
const discovered = presence.rooms();
|
|
60
61
|
const reloaded = discovered.filter((room) => held.has(room.locator) && !installing.has(room.locator) && replacing(room));
|
|
61
62
|
const acquired = discovered.filter((room) => (!held.has(room.locator) || installing.has(room.locator)) &&
|
|
62
63
|
room.replica.admission === 'admitted' &&
|
|
63
64
|
replacing(room));
|
|
64
65
|
for (const room of reloaded)
|
|
65
|
-
|
|
66
|
+
presence.reload(room.locator, true);
|
|
66
67
|
try {
|
|
67
68
|
const local = await store.open();
|
|
68
69
|
const kept = acquired.length === 0 ? new Set() : (await local.held()).staged;
|
|
@@ -80,12 +81,12 @@ async function reloadNow(runtime, replacing, progress, held, installing) {
|
|
|
80
81
|
}
|
|
81
82
|
catch {
|
|
82
83
|
for (const room of reloaded)
|
|
83
|
-
|
|
84
|
+
presence.reload(room.locator, false);
|
|
84
85
|
progress.reachable = false;
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
function caughtUpRooms(runtime, expired) {
|
|
88
|
-
const { store, socket } = runtime;
|
|
89
|
+
const { store, socket, presence } = runtime;
|
|
89
90
|
const { session } = socket;
|
|
90
91
|
const progress = session.now().underway;
|
|
91
92
|
session.set({ underway: null });
|
|
@@ -112,11 +113,12 @@ function caughtUpRooms(runtime, expired) {
|
|
|
112
113
|
if (progress.reachable) {
|
|
113
114
|
const stored = await held;
|
|
114
115
|
const owed = await reloading;
|
|
115
|
-
await settleModels(runtime,
|
|
116
|
-
.
|
|
116
|
+
await settleModels(runtime, new Map(presence
|
|
117
|
+
.rooms()
|
|
117
118
|
.filter((room) => stored.has(room.locator) &&
|
|
118
119
|
!expired.includes(room.locator) &&
|
|
119
|
-
!owed.includes(room.locator))
|
|
120
|
+
!owed.includes(room.locator))
|
|
121
|
+
.map((room) => [room.locator, declared(room)])), 'current', local);
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
catch {
|
|
@@ -145,7 +147,7 @@ function signalled(runtime, mode) {
|
|
|
145
147
|
store.tell(SERVICE_MODE_TOPIC, mode);
|
|
146
148
|
}
|
|
147
149
|
if (releasing)
|
|
148
|
-
|
|
150
|
+
void submissionDue(runtime);
|
|
149
151
|
}
|
|
150
152
|
async function runCurrency(runtime, live) {
|
|
151
153
|
const { socket, conversations } = runtime;
|
|
@@ -182,7 +184,7 @@ export function scheduleCurrency(runtime) {
|
|
|
182
184
|
}
|
|
183
185
|
export function spaceFreed(runtime) {
|
|
184
186
|
const { store, socket, journal } = runtime;
|
|
185
|
-
|
|
187
|
+
store.prepareAgain();
|
|
186
188
|
journal.record('space freed');
|
|
187
189
|
store.readiness.queue();
|
|
188
190
|
const { closed, authorization } = socket.session.now();
|
|
@@ -193,10 +195,11 @@ export function spaceFreed(runtime) {
|
|
|
193
195
|
else
|
|
194
196
|
void resynchronize(runtime);
|
|
195
197
|
}
|
|
196
|
-
export function close({ store, socket, conversations, recovery, liveQueries, figures }) {
|
|
198
|
+
export function close({ store, socket, presence, conversations, recovery, liveQueries, figures, }) {
|
|
197
199
|
if (socket.closed())
|
|
198
200
|
return;
|
|
199
201
|
socket.close();
|
|
202
|
+
presence.close();
|
|
200
203
|
conversations.close();
|
|
201
204
|
void recovery.retire();
|
|
202
205
|
liveQueries.close();
|
|
@@ -204,9 +207,9 @@ export function close({ store, socket, conversations, recovery, liveQueries, fig
|
|
|
204
207
|
store.close();
|
|
205
208
|
}
|
|
206
209
|
export async function stop(runtime) {
|
|
207
|
-
const { store, socket, recovery } = runtime;
|
|
210
|
+
const { store, socket, presence, recovery } = runtime;
|
|
208
211
|
socket.session.set({ stopping: true });
|
|
209
|
-
|
|
212
|
+
presence.stopAsking();
|
|
210
213
|
socket.stopReads();
|
|
211
214
|
await recovery.retire();
|
|
212
215
|
await socket.lanes.finished();
|
|
@@ -214,7 +217,7 @@ export async function stop(runtime) {
|
|
|
214
217
|
close(runtime);
|
|
215
218
|
}
|
|
216
219
|
export function start(runtime, signal) {
|
|
217
|
-
const { store, socket, conversations, lastAnswers, recovery } = runtime;
|
|
220
|
+
const { store, socket, presence, conversations, lastAnswers, recovery } = runtime;
|
|
218
221
|
const closeRuntime = () => close(runtime);
|
|
219
222
|
socket.observeServiceMode((mode) => signalled(runtime, mode));
|
|
220
223
|
socket.observeConversations((event) => {
|
|
@@ -231,7 +234,7 @@ export function start(runtime, signal) {
|
|
|
231
234
|
closeRuntime();
|
|
232
235
|
socket.observe((event) => {
|
|
233
236
|
if (event.kind === 'opened') {
|
|
234
|
-
|
|
237
|
+
presence.connectionLive();
|
|
235
238
|
conversations.reopened();
|
|
236
239
|
lastAnswers.reopened();
|
|
237
240
|
recovery.resume();
|
|
@@ -260,8 +263,9 @@ export function start(runtime, signal) {
|
|
|
260
263
|
if ((await local.facts()).capabilities.length > 0)
|
|
261
264
|
socket.readyFromStore();
|
|
262
265
|
})
|
|
263
|
-
.catch(() => {
|
|
266
|
+
.catch((error) => {
|
|
264
267
|
socket.readyFromStore();
|
|
268
|
+
uncaught(error);
|
|
265
269
|
});
|
|
266
270
|
if (!socket.streamed)
|
|
267
271
|
void sync(runtime, 'unstreamed', null);
|