@agentshouse/mdruntime 0.1.0-cf04ede9fb796 → 0.1.0-cf0c43fc48aad
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 +12 -12
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +74 -164
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +8 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +118 -67
- package/dist/adapter.d.ts +27 -48
- 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/change.d.ts.map +1 -1
- package/dist/change.js +4 -2
- package/dist/client.d.ts +9 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +32 -15
- package/dist/collection.d.ts +22 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +12 -2
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -24
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +26 -21
- package/dist/conversation-live.d.ts +10 -6
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +8 -6
- package/dist/conversation.d.ts +28 -10
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +194 -141
- 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 +19 -44
- package/dist/durability.d.ts +3 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.js +1 -1
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +6 -0
- package/dist/host.d.ts +17 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +45 -11
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/dist/install.d.ts +2 -4
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +52 -78
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +40 -31
- 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 -3
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +10 -39
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +10 -22
- package/dist/media.d.ts +1 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +4 -4
- package/dist/memory.d.ts +4 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +44 -23
- package/dist/messages.d.ts +9 -5
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +25 -35
- 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 +95 -137
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +12 -17
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +5 -9
- package/dist/outcome.d.ts +3 -0
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +15 -0
- package/dist/overlay.d.ts +5 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +36 -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 -59
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +10 -123
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +25 -24
- 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 +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +24 -14
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +0 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +0 -7
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +450 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +67 -22
- package/dist/react.d.ts +5 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/reads.d.ts +3 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +9 -2
- package/dist/recovery.d.ts +3 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +29 -7
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -6
- package/dist/replica.d.ts +5 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +13 -15
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +4 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +46 -57
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +17 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -4
- package/dist/runtime.d.ts +9 -18
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +42 -90
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +334 -167
- package/dist/saves.d.ts +2 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +107 -705
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -3
- package/dist/shared.d.ts +0 -5
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -90
- package/dist/shown.d.ts +4 -3
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +26 -31
- package/dist/socket/lanes.d.ts +12 -4
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +34 -8
- package/dist/socket/session.d.ts +0 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket.d.ts +3 -6
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +5 -16
- package/dist/source.d.ts +0 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +5 -4
- package/dist/store/records.d.ts +8 -6
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +13 -6
- package/dist/store/space.d.ts +1 -1
- package/dist/store/space.d.ts.map +1 -1
- package/dist/store/space.js +0 -2
- package/dist/store/watchers.js +1 -2
- package/dist/store.d.ts +11 -6
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +38 -13
- package/dist/stored.d.ts +2 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +11 -11
- package/dist/surface.d.ts +1 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +13 -16
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +88 -85
- package/dist/tables.d.ts +6 -8
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +41 -20
- package/dist/tallies.js +5 -5
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/wire.d.ts +51 -7
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +15 -4
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- 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/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';
|
|
@@ -16,24 +18,26 @@ export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
|
16
18
|
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
17
19
|
export type { BinaryFileRecord } from './binary.js';
|
|
18
20
|
export type { RuntimeError } from './failure.js';
|
|
21
|
+
export { refusalError } from './failure.js';
|
|
19
22
|
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
20
23
|
export type { SaveRefusal } from './save.js';
|
|
21
24
|
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
22
25
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
23
26
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
24
27
|
export { departure } from './change.js';
|
|
28
|
+
export { definitionsIn, selected } from './collection.js';
|
|
25
29
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
26
30
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
27
|
-
export { HISTORY_CONVERSATIONS
|
|
31
|
+
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
28
32
|
export { contextFigure } from './context.js';
|
|
29
|
-
export { jobsRunning, openJobs, sessionEnded, type OpenJob, type RunningJob } from './job.js';
|
|
30
33
|
export { changeBatchIdentity } from './identity.js';
|
|
31
34
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
32
|
-
export { authoredAt } from './paths.js';
|
|
35
|
+
export { authoredAt, covered } from './paths.js';
|
|
33
36
|
export { untilAnswered } from './recovery.js';
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, type RetriedFailure, type Retries, type Step, } from './retried.js';
|
|
38
|
+
export { patching } from './shared.js';
|
|
39
|
+
export { acting, type Acting, type ActingRules, type Ended, type Lane, type LaneShown, type Send, } from './act-lanes.js';
|
|
40
|
+
export { expectation, expecting, type Descriptor, type Expectation, type Expected, type Expecting, } from './expectation.js';
|
|
37
41
|
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
38
42
|
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
39
43
|
export type { ObservedRead } from './reads.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,E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AgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/F,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,eAAe,EACf,YAAY,EACZ,eAAe,EACf,KAAK,EACL,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,SAAS,EACT,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,GAAG,EACH,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,MAAM,EACN,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,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,16 +1,20 @@
|
|
|
1
1
|
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
3
|
+
export { writeRule } from './declaration.js';
|
|
4
|
+
export { refusalError } from './failure.js';
|
|
2
5
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
3
6
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
4
7
|
export { departure } from './change.js';
|
|
8
|
+
export { definitionsIn, selected } from './collection.js';
|
|
5
9
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
6
10
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
7
|
-
export { HISTORY_CONVERSATIONS
|
|
11
|
+
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
8
12
|
export { contextFigure } from './context.js';
|
|
9
|
-
export { jobsRunning, openJobs, sessionEnded } from './job.js';
|
|
10
13
|
export { changeBatchIdentity } from './identity.js';
|
|
11
14
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
12
|
-
export { authoredAt } from './paths.js';
|
|
15
|
+
export { authoredAt, covered } from './paths.js';
|
|
13
16
|
export { untilAnswered } from './recovery.js';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, } from './retried.js';
|
|
18
|
+
export { patching } from './shared.js';
|
|
19
|
+
export { acting, } from './act-lanes.js';
|
|
20
|
+
export { expectation, expecting, } from './expectation.js';
|
package/dist/install.d.ts
CHANGED
|
@@ -35,11 +35,9 @@ type Refreshed = {
|
|
|
35
35
|
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
|
-
export declare function sweep({ store, socket
|
|
39
|
-
export declare function forgetInstall(store: Store, locator: string): void;
|
|
38
|
+
export declare function sweep({ store, socket }: Runtime): 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;
|
|
@@ -48,7 +46,7 @@ export declare function reachedBy({ store, socket }: Runtime, locator: string, r
|
|
|
48
46
|
export declare function behind({ store, socket }: Runtime, room: DiscoveredRoom): Promise<boolean>;
|
|
49
47
|
export declare function writtenAfter({ store, socket }: Runtime, locator: string, roomVersion: string, path: string): Promise<boolean>;
|
|
50
48
|
export declare function pullRefresh(runtime: Runtime, authorized: Authorization, record: ReplicaRecord, liveness: Live, hold: InstallHold, refresh: Refresher): Promise<Refreshed>;
|
|
51
|
-
export declare function pullBootstrap(runtime: Runtime, authorized: Authorization, room: DiscoveredRoom, local: RuntimeStore, liveness: Live, prior: ReplicaRecord | undefined, from?: Reads, unheld?: Unheld): Promise<import("./bootstrap.js").Bootstrapped | NotReady | import("./adapter.js").RevokedAuthorization | import("./adapter.js").RoomNotReadable | Unconfirmed | {
|
|
49
|
+
export declare function pullBootstrap(runtime: Runtime, authorized: Authorization, room: DiscoveredRoom, local: RuntimeStore, liveness: Live, prior: ReplicaRecord | undefined, from?: Reads, unheld?: Unheld): Promise<import("./bootstrap.js").Bootstrapped | NotReady | import("./adapter.js").RevokedAuthorization | import("./adapter.js").RoomNotReadable | import("./adapter.js").TransportUncertainty | Unconfirmed | {
|
|
52
50
|
readonly kind: 'transport-uncertainty';
|
|
53
51
|
} | RetryableRefusal | import("./adapter.js").ScopedRefusal>;
|
|
54
52
|
export declare function publish(runtime: Runtime, local: RuntimeStore, room: DiscoveredRoom, reached: ReplicaRecord, landing: Landing, live: Live): Promise<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;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,KAAK,YAAY,EACjB,KAAK,KAAK,EAGX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,QAAQ,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,QAAQ,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AE,IAAI,EACd,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,IAAI,GAAE,KAA4B,EAClC,MAAM,CAAC,EAAE,MAAM;mBA6BI,uBAAuB;6DAa3C;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,CAmElB"}
|
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.
|
|
@@ -120,7 +121,7 @@ function installed(runtime, locator) {
|
|
|
120
121
|
runtime.store.installs.change(locator, (held) => ({ ...held, installing: false }));
|
|
121
122
|
runtime.store.readiness.queue();
|
|
122
123
|
}
|
|
123
|
-
export function sweep({ store, socket
|
|
124
|
+
export function sweep({ store, socket }) {
|
|
124
125
|
if (store.device.now().sweeping || socket.closed())
|
|
125
126
|
return;
|
|
126
127
|
store.device.set({ sweeping: true });
|
|
@@ -130,17 +131,14 @@ export function sweep({ store, socket, journal }) {
|
|
|
130
131
|
await yielded();
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
catch {
|
|
134
|
-
|
|
134
|
+
catch (error) {
|
|
135
|
+
uncaught(error);
|
|
135
136
|
}
|
|
136
137
|
finally {
|
|
137
138
|
store.device.set({ sweeping: false });
|
|
138
139
|
}
|
|
139
140
|
})();
|
|
140
141
|
}
|
|
141
|
-
export function forgetInstall(store, locator) {
|
|
142
|
-
store.installs.change(locator, ({ installing }) => ({ ...NO_INSTALL, installing }));
|
|
143
|
-
}
|
|
144
142
|
export function caughtUpTo(runtime, locator) {
|
|
145
143
|
if (!runtime.store.installs.of(locator).catching)
|
|
146
144
|
return;
|
|
@@ -150,12 +148,6 @@ export function caughtUpTo(runtime, locator) {
|
|
|
150
148
|
export function catching(store, locator) {
|
|
151
149
|
store.installs.change(locator, (held) => ({ ...held, catching: true }));
|
|
152
150
|
}
|
|
153
|
-
export function confirmedAgain(store, locator) {
|
|
154
|
-
store.installs.change(locator, (held) => ({
|
|
155
|
-
...held,
|
|
156
|
-
confirmations: held.confirmations + 1,
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
151
|
export function standingAt(store, locator, held) {
|
|
160
152
|
return { key: held?.key ?? null, confirmed: store.installs.of(locator).confirmations };
|
|
161
153
|
}
|
|
@@ -270,7 +262,7 @@ function refreshingOf(runtime, local, locator, key, composition, liveness, repla
|
|
|
270
262
|
export async function pullRefresh(runtime, authorized, record, liveness, hold, refresh) {
|
|
271
263
|
if (!liveness())
|
|
272
264
|
return unconfirmed;
|
|
273
|
-
const { store
|
|
265
|
+
const { store } = runtime;
|
|
274
266
|
const from = standingAt(store, record.locator, record);
|
|
275
267
|
const local = await store.open();
|
|
276
268
|
try {
|
|
@@ -284,11 +276,8 @@ export async function pullRefresh(runtime, authorized, record, liveness, hold, r
|
|
|
284
276
|
hold.take();
|
|
285
277
|
}
|
|
286
278
|
}, authorized, record, (models, kept) => (liveness() ? remodel(runtime, models, kept) : kept), liveness, refreshingOf(runtime, local, record.locator, record.key, store.composed(record), liveness, false, record.roomVersion));
|
|
287
|
-
if (result.kind !== 'advanced')
|
|
288
|
-
journal.record(`transfer refresh ${record.locator} ${result.kind}`);
|
|
279
|
+
if (result.kind !== 'advanced')
|
|
289
280
|
return result;
|
|
290
|
-
}
|
|
291
|
-
journal.record(`transfer refresh ${record.locator} ${result.record.roomVersion}`);
|
|
292
281
|
return {
|
|
293
282
|
kind: 'advanced',
|
|
294
283
|
record: result.record,
|
|
@@ -299,7 +288,6 @@ export async function pullRefresh(runtime, authorized, record, liveness, hold, r
|
|
|
299
288
|
catch (error) {
|
|
300
289
|
if (refusedForSpace(error))
|
|
301
290
|
return unconfirmed;
|
|
302
|
-
journal.record(`transfer refresh ${record.locator} transport-uncertainty`);
|
|
303
291
|
throw error;
|
|
304
292
|
}
|
|
305
293
|
}
|
|
@@ -382,8 +370,6 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
382
370
|
transfer: held,
|
|
383
371
|
underived: owed,
|
|
384
372
|
}));
|
|
385
|
-
if (before.transfer === null)
|
|
386
|
-
recoverReads(runtime);
|
|
387
373
|
installing(runtime, locator);
|
|
388
374
|
recoverReads(runtime);
|
|
389
375
|
if (owed < store.deriveBytes())
|
|
@@ -396,7 +382,9 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
396
382
|
if (!liveness())
|
|
397
383
|
return null;
|
|
398
384
|
const prior = unheld === undefined ? await store.record(locator) : undefined;
|
|
399
|
-
const published = prior !== undefined && prior.replica.selection === record.selection
|
|
385
|
+
const published = prior !== undefined && prior.declaration.replica.selection === record.selection
|
|
386
|
+
? prior.key
|
|
387
|
+
: null;
|
|
400
388
|
const kept = unheld?.staged ?? (await local.held()).staged.has(locator);
|
|
401
389
|
if (published === null && !kept)
|
|
402
390
|
return { record: null, staged: new Set() };
|
|
@@ -445,23 +433,20 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
445
433
|
export async function pullBootstrap(runtime, authorized, room, local, liveness, prior, from = runtime.socket.reads, unheld) {
|
|
446
434
|
if (!liveness())
|
|
447
435
|
return unconfirmed;
|
|
448
|
-
const { store
|
|
436
|
+
const { store } = runtime;
|
|
449
437
|
if (prior !== undefined) {
|
|
450
438
|
catching(store, room.locator);
|
|
451
439
|
recoverReads(runtime);
|
|
452
440
|
}
|
|
453
441
|
try {
|
|
454
442
|
const result = await bootstrapRoom(from, authorized, room, {
|
|
455
|
-
collection: prior?.model ?? runtime.
|
|
443
|
+
collection: prior?.model ?? runtime.presence.unheldModel(room.locator) ?? NO_MODEL,
|
|
456
444
|
}, runtime.builtIn, runtime.typedPaths, (models, held) => (liveness() ? remodel(runtime, models, held) : held), liveness, staging(runtime, local, liveness, unheld));
|
|
457
|
-
const detail = result.kind === 'staged' ? result.record.roomVersion : result.kind;
|
|
458
|
-
journal.record(`transfer bootstrap ${room.locator} ${detail}`);
|
|
459
445
|
if (result.kind === 'staged' &&
|
|
460
446
|
(await older(runtime, room.locator, result.record.roomVersion))) {
|
|
461
447
|
caughtUpTo(runtime, room.locator);
|
|
462
448
|
installed(runtime, room.locator);
|
|
463
449
|
await abandoned(runtime, local, room.locator);
|
|
464
|
-
journal.record(`transfer bootstrap ${room.locator} older than shown`);
|
|
465
450
|
return { kind: 'transport-uncertainty' };
|
|
466
451
|
}
|
|
467
452
|
if (result.kind !== 'staged') {
|
|
@@ -475,27 +460,27 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
475
460
|
installed(runtime, room.locator);
|
|
476
461
|
if (refusedForSpace(error))
|
|
477
462
|
return unconfirmed;
|
|
478
|
-
journal.record(`transfer bootstrap ${room.locator} transport-uncertainty`);
|
|
479
463
|
throw error;
|
|
480
464
|
}
|
|
481
465
|
}
|
|
482
466
|
export function publish(runtime, local, room, reached, landing, live) {
|
|
483
467
|
const { store } = runtime;
|
|
484
|
-
|
|
468
|
+
let published = true;
|
|
469
|
+
const landed = settle(runtime, [room.locator], async (held) => {
|
|
485
470
|
if (!live()) {
|
|
486
471
|
caughtUpTo(runtime, room.locator);
|
|
487
|
-
return
|
|
472
|
+
return [];
|
|
488
473
|
}
|
|
489
|
-
const
|
|
490
|
-
const prior = work.replica;
|
|
474
|
+
const prior = held.get(room.locator)?.replica;
|
|
491
475
|
if (!standsAt(store, room.locator, prior?.record, landing.from)) {
|
|
476
|
+
published = false;
|
|
492
477
|
if (landing.kind === 'refreshed') {
|
|
493
478
|
await local.unrefresh(reached.key);
|
|
494
|
-
return
|
|
479
|
+
return [];
|
|
495
480
|
}
|
|
496
481
|
caughtUpTo(runtime, room.locator);
|
|
497
482
|
await abandoned(runtime, local, room.locator);
|
|
498
|
-
return
|
|
483
|
+
return [];
|
|
499
484
|
}
|
|
500
485
|
const record = landing.kind === 'refreshed' && prior !== undefined
|
|
501
486
|
? {
|
|
@@ -504,51 +489,40 @@ export function publish(runtime, local, room, reached, landing, live) {
|
|
|
504
489
|
...(landing.remodelled ? { model: reached.model } : {}),
|
|
505
490
|
}
|
|
506
491
|
: reached;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
: {
|
|
516
|
-
room: true,
|
|
517
|
-
view: landing.refreshed ? 'refreshed' : 'confirmed',
|
|
518
|
-
commit: {
|
|
492
|
+
return [
|
|
493
|
+
{
|
|
494
|
+
locator: room.locator,
|
|
495
|
+
record,
|
|
496
|
+
installed: landing.kind === 'refreshed'
|
|
497
|
+
? { refreshed: true }
|
|
498
|
+
: {
|
|
519
499
|
published: { from: prior?.record.key ?? null },
|
|
520
500
|
...(landing.refreshed ? { refreshed: true } : {}),
|
|
521
501
|
},
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
await runtime.unpair(local);
|
|
547
|
-
void statusShown(runtime);
|
|
548
|
-
if (landing.kind === 'bootstrapped' && work.queue.length > 0) {
|
|
549
|
-
runtime.submitLater(room.locator);
|
|
550
|
-
}
|
|
551
|
-
return true;
|
|
502
|
+
after() {
|
|
503
|
+
runtime.presence.installed(room.locator, landing.kind === 'bootstrapped');
|
|
504
|
+
runtime.retries.succeeded('download', room.locator);
|
|
505
|
+
store.prepareAgain(room.locator);
|
|
506
|
+
if (landing.kind === 'bootstrapped') {
|
|
507
|
+
store.installs.change(room.locator, (held) => ({
|
|
508
|
+
...transferGone(held),
|
|
509
|
+
highest: null,
|
|
510
|
+
beyondHorizon: false,
|
|
511
|
+
startedOver: null,
|
|
512
|
+
catching: false,
|
|
513
|
+
}));
|
|
514
|
+
if (prior !== undefined && prior.record.key !== record.key)
|
|
515
|
+
sweep(runtime);
|
|
516
|
+
void name(runtime, room.locator);
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
];
|
|
521
|
+
}).then(() => published, (error) => {
|
|
522
|
+
if (!refusedForSpace(error))
|
|
523
|
+
throw error;
|
|
524
|
+
caughtUpTo(runtime, room.locator);
|
|
525
|
+
return published;
|
|
552
526
|
});
|
|
553
527
|
return landing.kind === 'refreshed'
|
|
554
528
|
? 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;AAgO5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAOhD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,QAQ1C;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,13 +1,15 @@
|
|
|
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';
|
|
12
|
+
const RELOADING = 'reloading';
|
|
11
13
|
function closing(runtime, opened) {
|
|
12
14
|
const { store, socket } = runtime;
|
|
13
15
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
@@ -20,10 +22,10 @@ function closing(runtime, opened) {
|
|
|
20
22
|
});
|
|
21
23
|
}
|
|
22
24
|
function closedSocket(runtime, lapsed, lost, opened) {
|
|
23
|
-
const { socket, conversations } = runtime;
|
|
25
|
+
const { socket, presence, conversations } = runtime;
|
|
24
26
|
const { session } = socket;
|
|
25
27
|
socket.notifyReady();
|
|
26
|
-
|
|
28
|
+
presence.stopAsking();
|
|
27
29
|
connectionLost(runtime);
|
|
28
30
|
if (lost)
|
|
29
31
|
conversations.lost();
|
|
@@ -43,9 +45,9 @@ function closedSocket(runtime, lapsed, lost, opened) {
|
|
|
43
45
|
void closing(runtime, opened);
|
|
44
46
|
}
|
|
45
47
|
function owedReloads(runtime, expired, held) {
|
|
46
|
-
const { store,
|
|
47
|
-
const reloading =
|
|
48
|
-
.
|
|
48
|
+
const { store, presence } = runtime;
|
|
49
|
+
const reloading = presence
|
|
50
|
+
.rooms()
|
|
49
51
|
.filter((room) => !expired.includes(room.locator) && revoked(held.get(room.locator)?.record.model))
|
|
50
52
|
.map((room) => room.locator);
|
|
51
53
|
for (const locator of reloading)
|
|
@@ -54,15 +56,15 @@ function owedReloads(runtime, expired, held) {
|
|
|
54
56
|
return reloading;
|
|
55
57
|
}
|
|
56
58
|
async function reloadNow(runtime, replacing, progress, held, installing) {
|
|
57
|
-
const { store, socket } = runtime;
|
|
58
|
-
const {
|
|
59
|
-
const discovered = rooms
|
|
59
|
+
const { store, socket, presence } = runtime;
|
|
60
|
+
const { lanes } = socket;
|
|
61
|
+
const discovered = presence.rooms();
|
|
60
62
|
const reloaded = discovered.filter((room) => held.has(room.locator) && !installing.has(room.locator) && replacing(room));
|
|
61
63
|
const acquired = discovered.filter((room) => (!held.has(room.locator) || installing.has(room.locator)) &&
|
|
62
64
|
room.replica.admission === 'admitted' &&
|
|
63
65
|
replacing(room));
|
|
64
66
|
for (const room of reloaded)
|
|
65
|
-
|
|
67
|
+
presence.reload(room.locator, true);
|
|
66
68
|
try {
|
|
67
69
|
const local = await store.open();
|
|
68
70
|
const kept = acquired.length === 0 ? new Set() : (await local.held()).staged;
|
|
@@ -77,15 +79,17 @@ async function reloadNow(runtime, replacing, progress, held, installing) {
|
|
|
77
79
|
.roomTask(room.locator, (live) => loadRoom(runtime, room, local, progress, live, unheld))
|
|
78
80
|
.then(() => rest(runtime, progress));
|
|
79
81
|
}
|
|
82
|
+
runtime.retries.succeeded('download', RELOADING);
|
|
80
83
|
}
|
|
81
|
-
catch {
|
|
84
|
+
catch (error) {
|
|
85
|
+
runtime.retries.failed('download', RELOADING, error);
|
|
82
86
|
for (const room of reloaded)
|
|
83
|
-
|
|
87
|
+
presence.reload(room.locator, false);
|
|
84
88
|
progress.reachable = false;
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
function caughtUpRooms(runtime, expired) {
|
|
88
|
-
const { store, socket } = runtime;
|
|
92
|
+
const { store, socket, presence } = runtime;
|
|
89
93
|
const { session } = socket;
|
|
90
94
|
const progress = session.now().underway;
|
|
91
95
|
session.set({ underway: null });
|
|
@@ -112,14 +116,17 @@ function caughtUpRooms(runtime, expired) {
|
|
|
112
116
|
if (progress.reachable) {
|
|
113
117
|
const stored = await held;
|
|
114
118
|
const owed = await reloading;
|
|
115
|
-
await settleModels(runtime,
|
|
116
|
-
.
|
|
119
|
+
await settleModels(runtime, new Map(presence
|
|
120
|
+
.rooms()
|
|
117
121
|
.filter((room) => stored.has(room.locator) &&
|
|
118
122
|
!expired.includes(room.locator) &&
|
|
119
|
-
!owed.includes(room.locator))
|
|
123
|
+
!owed.includes(room.locator))
|
|
124
|
+
.map((room) => [room.locator, declared(room)])), 'current', local);
|
|
120
125
|
}
|
|
126
|
+
runtime.retries.succeeded('download', OPENING_LANE);
|
|
121
127
|
}
|
|
122
|
-
catch {
|
|
128
|
+
catch (error) {
|
|
129
|
+
runtime.retries.failed('download', OPENING_LANE, error);
|
|
123
130
|
progress.complete = false;
|
|
124
131
|
progress.reachable = false;
|
|
125
132
|
}
|
|
@@ -128,7 +135,7 @@ function caughtUpRooms(runtime, expired) {
|
|
|
128
135
|
});
|
|
129
136
|
}
|
|
130
137
|
function signalled(runtime, mode) {
|
|
131
|
-
const { store, socket
|
|
138
|
+
const { store, socket } = runtime;
|
|
132
139
|
const { session } = socket;
|
|
133
140
|
const { closed, serviceMode, haltedRefusal, openSignals } = session.now();
|
|
134
141
|
if (closed)
|
|
@@ -141,11 +148,10 @@ function signalled(runtime, mode) {
|
|
|
141
148
|
if (mode !== serviceMode) {
|
|
142
149
|
session.set({ serviceMode: mode });
|
|
143
150
|
store.readiness.queue();
|
|
144
|
-
journal.record(`service mode ${mode}`);
|
|
145
151
|
store.tell(SERVICE_MODE_TOPIC, mode);
|
|
146
152
|
}
|
|
147
153
|
if (releasing)
|
|
148
|
-
|
|
154
|
+
void submissionDue(runtime);
|
|
149
155
|
}
|
|
150
156
|
async function runCurrency(runtime, live) {
|
|
151
157
|
const { socket, conversations } = runtime;
|
|
@@ -166,8 +172,10 @@ async function runCurrency(runtime, live) {
|
|
|
166
172
|
moveTo(runtime, transferring(runtime));
|
|
167
173
|
try {
|
|
168
174
|
await catchUpConversations(conversations, progress);
|
|
175
|
+
runtime.retries.succeeded('conversations', CONVERSATION_LANE);
|
|
169
176
|
}
|
|
170
|
-
catch {
|
|
177
|
+
catch (error) {
|
|
178
|
+
runtime.retries.failed('conversations', CONVERSATION_LANE, error);
|
|
171
179
|
progress.reachable = false;
|
|
172
180
|
}
|
|
173
181
|
await rest(runtime, progress, live);
|
|
@@ -181,9 +189,8 @@ export function scheduleCurrency(runtime) {
|
|
|
181
189
|
void socket.lanes.task(CONVERSATION_LANE, (live) => runCurrency(runtime, live));
|
|
182
190
|
}
|
|
183
191
|
export function spaceFreed(runtime) {
|
|
184
|
-
const { store, socket
|
|
185
|
-
|
|
186
|
-
journal.record('space freed');
|
|
192
|
+
const { store, socket } = runtime;
|
|
193
|
+
store.prepareAgain();
|
|
187
194
|
store.readiness.queue();
|
|
188
195
|
const { closed, authorization } = socket.session.now();
|
|
189
196
|
if (closed || authorization === undefined)
|
|
@@ -193,10 +200,11 @@ export function spaceFreed(runtime) {
|
|
|
193
200
|
else
|
|
194
201
|
void resynchronize(runtime);
|
|
195
202
|
}
|
|
196
|
-
export function close({ store, socket, conversations, recovery, liveQueries, figures }) {
|
|
203
|
+
export function close({ store, socket, presence, conversations, recovery, liveQueries, figures, }) {
|
|
197
204
|
if (socket.closed())
|
|
198
205
|
return;
|
|
199
206
|
socket.close();
|
|
207
|
+
presence.close();
|
|
200
208
|
conversations.close();
|
|
201
209
|
void recovery.retire();
|
|
202
210
|
liveQueries.close();
|
|
@@ -204,9 +212,9 @@ export function close({ store, socket, conversations, recovery, liveQueries, fig
|
|
|
204
212
|
store.close();
|
|
205
213
|
}
|
|
206
214
|
export async function stop(runtime) {
|
|
207
|
-
const { store, socket, recovery } = runtime;
|
|
215
|
+
const { store, socket, presence, recovery } = runtime;
|
|
208
216
|
socket.session.set({ stopping: true });
|
|
209
|
-
|
|
217
|
+
presence.stopAsking();
|
|
210
218
|
socket.stopReads();
|
|
211
219
|
await recovery.retire();
|
|
212
220
|
await socket.lanes.finished();
|
|
@@ -214,7 +222,7 @@ export async function stop(runtime) {
|
|
|
214
222
|
close(runtime);
|
|
215
223
|
}
|
|
216
224
|
export function start(runtime, signal) {
|
|
217
|
-
const { store, socket, conversations, lastAnswers, recovery } = runtime;
|
|
225
|
+
const { store, socket, presence, conversations, lastAnswers, recovery } = runtime;
|
|
218
226
|
const closeRuntime = () => close(runtime);
|
|
219
227
|
socket.observeServiceMode((mode) => signalled(runtime, mode));
|
|
220
228
|
socket.observeConversations((event) => {
|
|
@@ -231,7 +239,7 @@ export function start(runtime, signal) {
|
|
|
231
239
|
closeRuntime();
|
|
232
240
|
socket.observe((event) => {
|
|
233
241
|
if (event.kind === 'opened') {
|
|
234
|
-
|
|
242
|
+
presence.connectionLive();
|
|
235
243
|
conversations.reopened();
|
|
236
244
|
lastAnswers.reopened();
|
|
237
245
|
recovery.resume();
|
|
@@ -260,8 +268,9 @@ export function start(runtime, signal) {
|
|
|
260
268
|
if ((await local.facts()).capabilities.length > 0)
|
|
261
269
|
socket.readyFromStore();
|
|
262
270
|
})
|
|
263
|
-
.catch(() => {
|
|
271
|
+
.catch((error) => {
|
|
264
272
|
socket.readyFromStore();
|
|
273
|
+
uncaught(error);
|
|
265
274
|
});
|
|
266
275
|
if (!socket.streamed)
|
|
267
276
|
void sync(runtime, 'unstreamed', null);
|