@agentshouse/mdruntime 0.1.0-cb8a03985803b → 0.1.0-cb9a984171ffb
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 +14 -13
- package/dist/acceptance.js +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +26 -6
- package/dist/adapter.d.ts +113 -21
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +2 -7
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +347 -0
- package/dist/binary.d.ts +6 -2
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +10 -3
- package/dist/change.d.ts +6 -2
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +3 -0
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +2 -4
- package/dist/client.d.ts +17 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +24 -54
- package/dist/collection.d.ts +6 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -9
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +2 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +72 -41
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +11 -6
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +18 -9
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +17 -8
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +20 -7
- package/dist/conversation.d.ts +16 -11
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +183 -139
- package/dist/declaration.js +1 -1
- package/dist/discovery.d.ts +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +30 -5
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +1 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +3 -0
- package/dist/entry.d.ts +14 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +45 -16
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +4 -2
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/host.d.ts +6 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +68 -27
- package/dist/house-query.d.ts +24 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +67 -0
- package/dist/index.d.ts +13 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/install.d.ts +8 -2
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +40 -33
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +38 -25
- package/dist/listing.d.ts +24 -12
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +50 -21
- package/dist/live.d.ts +19 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +94 -36
- package/dist/loaded.d.ts +7 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +46 -0
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +4 -2
- package/dist/lost.js +1 -1
- package/dist/media.d.ts +19 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +167 -33
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +60 -20
- package/dist/messages.d.ts +8 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +14 -3
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +4 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +3 -3
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/observation.d.ts +26 -10
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +200 -69
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +18 -2
- package/dist/outcome.d.ts +21 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +18 -3
- package/dist/overlay.d.ts +4 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +3 -5
- package/dist/parts.d.ts +3 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +30 -7
- package/dist/preparation.d.ts +33 -7
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +195 -78
- package/dist/presence.d.ts +8 -2
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +24 -13
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +114 -66
- package/dist/query.d.ts +2 -2
- package/dist/questions.d.ts +1 -0
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +51 -21
- package/dist/reach.d.ts +15 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +122 -23
- package/dist/react.d.ts +6 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +19 -3
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +17 -10
- package/dist/reads.d.ts +1 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +2 -2
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +2 -1
- package/dist/reference-forms.d.ts +4 -0
- package/dist/reference-forms.d.ts.map +1 -0
- package/dist/reference-forms.js +74 -0
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +4 -4
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +4 -4
- package/dist/room-draft.d.ts +28 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +235 -14
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +11 -6
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- package/dist/rows.d.ts +11 -2
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +24 -10
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runtime.d.ts +4 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +17 -86
- package/dist/saves.d.ts +4 -2
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +75 -22
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -2
- package/dist/shown.d.ts +3 -1
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +72 -41
- package/dist/socket/session.d.ts +4 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +1 -0
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +1 -0
- package/dist/source.d.ts +7 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +15 -2
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +18 -3
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +57 -21
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store.d.ts +14 -9
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +12 -5
- package/dist/stored.d.ts +38 -14
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +210 -52
- package/dist/surface.d.ts +13 -7
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +52 -17
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +49 -27
- package/dist/tables.d.ts +22 -49
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +70 -325
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +1 -2
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +50 -10
- package/dist/wire.d.ts +28 -13
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +17 -12
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"house-query.d.ts","sourceRoot":"","sources":["../src/house-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAA2C,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,CAAC,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,GAC7D,cAAc,CAAC;AAEnB,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACxC,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAC1C,OAAO,CAAC;AAyCZ,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { invalid, known, plain } from '@agentshouse/mdmodel';
|
|
2
|
+
import { listedOrHeld } from './listing.js';
|
|
3
|
+
import { normalize } from './paths.js';
|
|
4
|
+
import { failure, OFFLINE, UNCERTAIN, undeclared } from './outcome.js';
|
|
5
|
+
import { askedOnline, offline } from './online.js';
|
|
6
|
+
import { holds, queriedOnly } from './reach.js';
|
|
7
|
+
const HELD_ON_DEVICE = {
|
|
8
|
+
kind: 'rejected',
|
|
9
|
+
code: 'held-on-device',
|
|
10
|
+
fields: {},
|
|
11
|
+
retryable: false,
|
|
12
|
+
};
|
|
13
|
+
function freshOf(options) {
|
|
14
|
+
if (options === undefined)
|
|
15
|
+
return false;
|
|
16
|
+
if (!plain(options))
|
|
17
|
+
invalid('options', 'expects { fresh }');
|
|
18
|
+
known(options, ['fresh'], 'options');
|
|
19
|
+
const { fresh = false } = options;
|
|
20
|
+
if (typeof fresh !== 'boolean')
|
|
21
|
+
invalid('fresh', 'expects true or false');
|
|
22
|
+
return fresh;
|
|
23
|
+
}
|
|
24
|
+
function viewOf(query) {
|
|
25
|
+
known(query, ['path', 'after'], '');
|
|
26
|
+
const { path, after } = query;
|
|
27
|
+
if (typeof path !== 'string' || path === '' || normalize(path) !== path)
|
|
28
|
+
invalid('path', 'names a View by its Path in the Room');
|
|
29
|
+
if (after === undefined)
|
|
30
|
+
return { path };
|
|
31
|
+
if (typeof after !== 'string')
|
|
32
|
+
invalid('after', 'expects the next an earlier page answered');
|
|
33
|
+
return { path, after };
|
|
34
|
+
}
|
|
35
|
+
function houseQueryOf(input, options) {
|
|
36
|
+
if (!plain(input))
|
|
37
|
+
invalid('query', 'expects a query object');
|
|
38
|
+
const { rooms, ...query } = input;
|
|
39
|
+
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
40
|
+
invalid('rooms', 'names the one Room House answers');
|
|
41
|
+
const asked = { room: rooms[0], fresh: freshOf(options) };
|
|
42
|
+
return query.path === undefined ? { ...asked, query } : { ...asked, ...viewOf(query) };
|
|
43
|
+
}
|
|
44
|
+
async function heldHere(runtime, reach, room) {
|
|
45
|
+
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
46
|
+
}
|
|
47
|
+
export async function queriedHouse(runtime, input, reach, options) {
|
|
48
|
+
const { socket } = runtime;
|
|
49
|
+
const asked = houseQueryOf(input, options);
|
|
50
|
+
await socket.ready;
|
|
51
|
+
const query = socket.queryHouse();
|
|
52
|
+
if (query === undefined)
|
|
53
|
+
return undeclared('queryHouse');
|
|
54
|
+
if (!queriedOnly(reach, socket.session.now().queriesOnly, asked.room)) {
|
|
55
|
+
return (await heldHere(runtime, reach, asked.room))
|
|
56
|
+
? HELD_ON_DEVICE
|
|
57
|
+
: failure({ kind: 'room-not-readable', locator: asked.room });
|
|
58
|
+
}
|
|
59
|
+
if (await offline(runtime))
|
|
60
|
+
return OFFLINE;
|
|
61
|
+
const answer = await askedOnline(runtime, (authorization) => query(authorization, asked));
|
|
62
|
+
if (answer === null)
|
|
63
|
+
return UNCERTAIN;
|
|
64
|
+
return answer.kind === 'rows' || answer.kind === 'groups' || answer.kind === 'rejected'
|
|
65
|
+
? answer
|
|
66
|
+
: failure(answer);
|
|
67
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization,
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryCopy, Attachment, 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, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, HouseQueryAnswer, HouseQueryAsk, HouseQueryGroups, HouseQueryRows, 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';
|
|
@@ -10,26 +10,30 @@ export type { HistoryQuery } from './actions.js';
|
|
|
10
10
|
export type { AppRoom, AppTypedSelection } from './listing.js';
|
|
11
11
|
export type { ConnectionRefusal, ConnectionRefusalCode } from './socket.js';
|
|
12
12
|
export type { MdRuntime, RoomSchemas } from './surface.js';
|
|
13
|
-
export type {
|
|
13
|
+
export type { AttachmentSurface, SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
14
14
|
export type { Observation } from './observation.js';
|
|
15
15
|
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
16
16
|
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
17
17
|
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
18
|
-
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
19
|
-
export
|
|
18
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, ShownAnswer, ConversationAttachAnswer, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
19
|
+
export { blobOf, declaredType } from './outcome.js';
|
|
20
|
+
export type { AttachmentRecord } from './binary.js';
|
|
20
21
|
export type { RuntimeError } from './failure.js';
|
|
21
22
|
export { refusalError } from './failure.js';
|
|
22
|
-
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
23
|
+
export type { ChangedPart, FieldValue, Marks, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
23
24
|
export type { SaveRefusal } from './save.js';
|
|
24
25
|
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
25
|
-
export {
|
|
26
|
+
export type { HouseQuery, HouseQueryOptions, HouseQueryResult } from './house-query.js';
|
|
27
|
+
export { keptFile, keptLines } from './chat-types.js';
|
|
26
28
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
27
29
|
export { departure } from './change.js';
|
|
28
30
|
export { definitionsIn, selected } from './collection.js';
|
|
29
31
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
30
|
-
export { cutName, nameFrom
|
|
31
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
32
|
+
export { cutName, nameFrom } from './name.js';
|
|
33
|
+
export { HISTORY_CONVERSATIONS, newChat } from './conversation.js';
|
|
32
34
|
export { contextFigure } from './context.js';
|
|
35
|
+
export { runningWords } from './running.js';
|
|
36
|
+
export { turnLine, WORKING } from './parts.js';
|
|
33
37
|
export { changeBatchIdentity } from './identity.js';
|
|
34
38
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
35
39
|
export { authoredAt, covered } from './paths.js';
|
|
@@ -39,6 +43,7 @@ export { patching } from './shared.js';
|
|
|
39
43
|
export { acting, type Acting, type ActingRules, type Ended, type Lane, type LaneShown, type Send, } from './act-lanes.js';
|
|
40
44
|
export { expectation, expecting, type Descriptor, type Expectation, type Expected, type Expecting, } from './expectation.js';
|
|
41
45
|
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
46
|
+
export { leftToSend } from './durability.js';
|
|
42
47
|
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
43
48
|
export type { ObservedRead } from './reads.js';
|
|
44
49
|
export type { AttentionEntry, SyncStatus } from './status.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,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,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAi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,CAAC;AAC5C,YAAY,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvF,
|
|
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,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,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,cAAc,EACd,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,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,cAAc,EAC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Z,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,15 +1,18 @@
|
|
|
1
1
|
export { heldFacts } from './conversation-row.js';
|
|
2
2
|
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
3
3
|
export { writeRule } from './declaration.js';
|
|
4
|
+
export { blobOf, declaredType } from './outcome.js';
|
|
4
5
|
export { refusalError } from './failure.js';
|
|
5
|
-
export {
|
|
6
|
+
export { keptFile, keptLines } from './chat-types.js';
|
|
6
7
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
7
8
|
export { departure } from './change.js';
|
|
8
9
|
export { definitionsIn, selected } from './collection.js';
|
|
9
10
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
10
|
-
export { cutName, nameFrom
|
|
11
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
11
|
+
export { cutName, nameFrom } from './name.js';
|
|
12
|
+
export { HISTORY_CONVERSATIONS, newChat } from './conversation.js';
|
|
12
13
|
export { contextFigure } from './context.js';
|
|
14
|
+
export { runningWords } from './running.js';
|
|
15
|
+
export { turnLine, WORKING } from './parts.js';
|
|
13
16
|
export { changeBatchIdentity } from './identity.js';
|
|
14
17
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
15
18
|
export { authoredAt, covered } from './paths.js';
|
|
@@ -18,3 +21,4 @@ export { createRetries, STEPS, retrying, Unanswered, uncertainError, } from './r
|
|
|
18
21
|
export { patching } from './shared.js';
|
|
19
22
|
export { acting, } from './act-lanes.js';
|
|
20
23
|
export { expectation, expecting, } from './expectation.js';
|
|
24
|
+
export { leftToSend } from './durability.js';
|
package/dist/install.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AdapterFailure, Authorization, DiscoveredRoom, NotReady, RetryableRefusal } from './adapter.js';
|
|
2
2
|
import { type Reads } from './bootstrap.js';
|
|
3
|
-
import type { Installation, RoomCoverage } from './readiness.js';
|
|
3
|
+
import type { Installation, InstallationAmount, RoomCoverage } from './readiness.js';
|
|
4
4
|
import { advancement, type Refresher } from './refresh.js';
|
|
5
5
|
import type { ReplicaRecord } from './replica.js';
|
|
6
6
|
import type { Runtime } from './runtime.js';
|
|
@@ -33,7 +33,13 @@ type Refreshed = {
|
|
|
33
33
|
kind: 'advanced';
|
|
34
34
|
}>;
|
|
35
35
|
export declare const ERASE_BATCH = 512;
|
|
36
|
-
export
|
|
36
|
+
export type InstallShare = {
|
|
37
|
+
readonly installing: boolean;
|
|
38
|
+
readonly downloading: boolean;
|
|
39
|
+
readonly bytes: InstallationAmount;
|
|
40
|
+
};
|
|
41
|
+
export declare function installShare(store: Store, { room, state }: RoomCoverage, held: ReadonlyMap<string, CoveredRoom>): InstallShare;
|
|
42
|
+
export declare function installationOf(installing: number, downloading: number, bytes: InstallationAmount): Installation;
|
|
37
43
|
export declare function roomInFlight(store: Store, locator: string): boolean;
|
|
38
44
|
export declare function sweep({ store, socket }: Runtime): void;
|
|
39
45
|
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
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;AAO1F,OAAO,KAAK,EACV,YAAY,
|
|
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,EACZ,kBAAkB,EAElB,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;I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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,CA0CpB;AA8ID,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;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
|
@@ -79,28 +79,32 @@ function batchEnd(entries, from, bytes) {
|
|
|
79
79
|
}
|
|
80
80
|
return end;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
bytes
|
|
99
|
-
|
|
100
|
-
|
|
82
|
+
const UNSHARED = {
|
|
83
|
+
installing: false,
|
|
84
|
+
downloading: false,
|
|
85
|
+
bytes: { done: 0, total: 0 },
|
|
86
|
+
};
|
|
87
|
+
export function installShare(store, { room, state }, held) {
|
|
88
|
+
if (state === 'unadmitted')
|
|
89
|
+
return UNSHARED;
|
|
90
|
+
const install = store.installs.of(room);
|
|
91
|
+
const underway = state === 'acquiring' || (install.installing && state !== 'complete');
|
|
92
|
+
const kept = underway ? NOTHING_HELD.bytes : (held.get(room)?.bytes ?? NOTHING_HELD.bytes);
|
|
93
|
+
const now = amountOf(install, kept);
|
|
94
|
+
const earlier = underway ? install.startedOver : null;
|
|
95
|
+
return {
|
|
96
|
+
installing: underway,
|
|
97
|
+
downloading: underway && (install.streaming || install.arrived === null),
|
|
98
|
+
bytes: {
|
|
99
|
+
done: Math.max(now.done, earlier?.done ?? 0),
|
|
100
|
+
total: Math.max(now.total, earlier?.total ?? 0),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function installationOf(installing, downloading, bytes) {
|
|
101
105
|
const step = installing === 0
|
|
102
106
|
? null
|
|
103
|
-
: downloading
|
|
107
|
+
: downloading > 0
|
|
104
108
|
? 'downloading'
|
|
105
109
|
: bytes.done < bytes.total
|
|
106
110
|
? 'writing'
|
|
@@ -113,13 +117,13 @@ export function roomInFlight(store, locator) {
|
|
|
113
117
|
}
|
|
114
118
|
function installing(runtime, locator) {
|
|
115
119
|
runtime.store.installs.change(locator, (held) => ({ ...held, installing: true }));
|
|
116
|
-
runtime.store.readiness.queue();
|
|
120
|
+
runtime.store.readiness.queue([locator]);
|
|
117
121
|
}
|
|
118
122
|
function installed(runtime, locator) {
|
|
119
123
|
if (!runtime.store.installs.of(locator).installing)
|
|
120
124
|
return;
|
|
121
125
|
runtime.store.installs.change(locator, (held) => ({ ...held, installing: false }));
|
|
122
|
-
runtime.store.readiness.queue();
|
|
126
|
+
runtime.store.readiness.queue([locator]);
|
|
123
127
|
}
|
|
124
128
|
export function sweep({ store, socket }) {
|
|
125
129
|
if (store.device.now().sweeping || socket.closed())
|
|
@@ -143,7 +147,7 @@ export function caughtUpTo(runtime, locator) {
|
|
|
143
147
|
if (!runtime.store.installs.of(locator).catching)
|
|
144
148
|
return;
|
|
145
149
|
runtime.store.installs.change(locator, (held) => ({ ...held, catching: false }));
|
|
146
|
-
recoverReads(runtime);
|
|
150
|
+
recoverReads(runtime, [locator]);
|
|
147
151
|
}
|
|
148
152
|
export function catching(store, locator) {
|
|
149
153
|
store.installs.change(locator, (held) => ({ ...held, catching: true }));
|
|
@@ -294,7 +298,8 @@ export async function pullRefresh(runtime, authorized, record, liveness, hold, r
|
|
|
294
298
|
async function abandoned(runtime, local, locator) {
|
|
295
299
|
await local.abandon(locator);
|
|
296
300
|
runtime.store.installs.change(locator, (held) => transferGone(setBack(held)));
|
|
297
|
-
recoverReads(runtime);
|
|
301
|
+
recoverReads(runtime, [locator]);
|
|
302
|
+
runtime.store.readiness.queue([locator]);
|
|
298
303
|
sweep(runtime);
|
|
299
304
|
}
|
|
300
305
|
function staging(runtime, local, liveness, unheld) {
|
|
@@ -308,7 +313,7 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
308
313
|
if (done === null)
|
|
309
314
|
return false;
|
|
310
315
|
store.installs.change(locator, (held) => built(held, done.done, done.text));
|
|
311
|
-
runtime.store.readiness.queue();
|
|
316
|
+
runtime.store.readiness.queue([locator]);
|
|
312
317
|
if (done.done)
|
|
313
318
|
return true;
|
|
314
319
|
}
|
|
@@ -332,9 +337,9 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
332
337
|
arrived: bytes,
|
|
333
338
|
streaming: true,
|
|
334
339
|
}));
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
340
|
+
const due = store.installs.arrivalsDue(locator, performance.now(), ARRIVAL_REPORT_MS);
|
|
341
|
+
if (due.length > 0)
|
|
342
|
+
runtime.store.readiness.queue(due);
|
|
338
343
|
},
|
|
339
344
|
end() {
|
|
340
345
|
if (ended)
|
|
@@ -343,7 +348,7 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
343
348
|
if (!store.installs.of(locator).streaming)
|
|
344
349
|
return;
|
|
345
350
|
store.installs.change(locator, (held) => ({ ...held, streaming: false }));
|
|
346
|
-
runtime.store.readiness.queue();
|
|
351
|
+
runtime.store.readiness.queue([locator]);
|
|
347
352
|
},
|
|
348
353
|
};
|
|
349
354
|
},
|
|
@@ -371,7 +376,7 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
371
376
|
underived: owed,
|
|
372
377
|
}));
|
|
373
378
|
installing(runtime, locator);
|
|
374
|
-
recoverReads(runtime);
|
|
379
|
+
recoverReads(runtime, [locator]);
|
|
375
380
|
if (owed < store.deriveBytes())
|
|
376
381
|
return held;
|
|
377
382
|
return (await derived(locator, key, composition)) ? held : null;
|
|
@@ -406,7 +411,8 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
406
411
|
done: { bytes },
|
|
407
412
|
};
|
|
408
413
|
store.installs.change(locator, (room) => ({ ...room, transfer: held }));
|
|
409
|
-
recoverReads(runtime);
|
|
414
|
+
recoverReads(runtime, [locator]);
|
|
415
|
+
store.readiness.queue([locator]);
|
|
410
416
|
return { record: held, staged: parted };
|
|
411
417
|
},
|
|
412
418
|
derive: derived,
|
|
@@ -422,7 +428,8 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
422
428
|
if (!liveness())
|
|
423
429
|
return;
|
|
424
430
|
store.installs.change(locator, (held) => transferGone(setBack(held)));
|
|
425
|
-
recoverReads(runtime);
|
|
431
|
+
recoverReads(runtime, [locator]);
|
|
432
|
+
store.readiness.queue([locator]);
|
|
426
433
|
},
|
|
427
434
|
release: (key) => store.exclusive(async () => {
|
|
428
435
|
await local.release(key);
|
|
@@ -436,7 +443,7 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
436
443
|
const { store } = runtime;
|
|
437
444
|
if (prior !== undefined) {
|
|
438
445
|
catching(store, room.locator);
|
|
439
|
-
recoverReads(runtime);
|
|
446
|
+
recoverReads(runtime, [room.locator]);
|
|
440
447
|
}
|
|
441
448
|
try {
|
|
442
449
|
const result = await bootstrapRoom(from, authorized, room, {
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export declare function scheduleCurrency(runtime: Runtime): void;
|
|
|
3
3
|
export declare function spaceFreed(runtime: Runtime): void;
|
|
4
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
|
-
export declare function start(runtime: Runtime, signal: AbortSignal | undefined): void;
|
|
6
|
+
export declare function start(runtime: Runtime, signal: AbortSignal | undefined, onNeed: boolean): 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":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6O5C,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,EAAE,MAAM,EAAE,OAAO,QAwCvF"}
|
package/dist/lifecycle.js
CHANGED
|
@@ -6,6 +6,7 @@ import { connectionLost } from './locks.js';
|
|
|
6
6
|
import { fenceLive } from './lost.js';
|
|
7
7
|
import { cachedModels, revoked, settleModels } from './models.js';
|
|
8
8
|
import { refuse } from './refusal.js';
|
|
9
|
+
import { roomsListed } from './room-list.js';
|
|
9
10
|
import { moveTo, recoverReads, rest, SERVICE_MODE_TOPIC, show, submissionDue, transferring, } from './shown.js';
|
|
10
11
|
import { applyRoom, changeAuthority, countAuthorityChange, finishOpening, loadRoom, OPENING_LANE, reload, resynchronize, sync, } from './sync.js';
|
|
11
12
|
const CONVERSATION_LANE = 'conversations';
|
|
@@ -15,9 +16,11 @@ function closing(runtime, opened) {
|
|
|
15
16
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
16
17
|
if (!live())
|
|
17
18
|
return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (store.needed()) {
|
|
20
|
+
const local = await store.open();
|
|
21
|
+
if (!opened && !socket.isOpen())
|
|
22
|
+
await cachedModels(runtime, local);
|
|
23
|
+
}
|
|
21
24
|
await rest(runtime, null, live);
|
|
22
25
|
});
|
|
23
26
|
}
|
|
@@ -52,13 +55,13 @@ function owedReloads(runtime, expired, held) {
|
|
|
52
55
|
.map((room) => room.locator);
|
|
53
56
|
for (const locator of reloading)
|
|
54
57
|
catching(store, locator);
|
|
55
|
-
recoverReads(runtime);
|
|
58
|
+
recoverReads(runtime, reloading);
|
|
56
59
|
return reloading;
|
|
57
60
|
}
|
|
58
|
-
async function reloadNow(runtime, replacing, progress, held, installing) {
|
|
61
|
+
async function reloadNow(runtime, among, replacing, progress, held, installing) {
|
|
59
62
|
const { store, socket, presence } = runtime;
|
|
60
63
|
const { lanes } = socket;
|
|
61
|
-
const discovered = presence.rooms();
|
|
64
|
+
const discovered = among === null ? presence.rooms() : among.flatMap((locator) => presence.room(locator) ?? []);
|
|
62
65
|
const reloaded = discovered.filter((room) => held.has(room.locator) && !installing.has(room.locator) && replacing(room));
|
|
63
66
|
const acquired = discovered.filter((room) => (!held.has(room.locator) || installing.has(room.locator)) &&
|
|
64
67
|
room.replica.admission === 'admitted' &&
|
|
@@ -95,13 +98,24 @@ function caughtUpRooms(runtime, expired) {
|
|
|
95
98
|
session.set({ underway: null });
|
|
96
99
|
socket.named();
|
|
97
100
|
const cycle = progress ?? { complete: true, reachable: true };
|
|
101
|
+
if (!store.needed()) {
|
|
102
|
+
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
103
|
+
if (!live())
|
|
104
|
+
return;
|
|
105
|
+
if (progress === null)
|
|
106
|
+
await rest(runtime, cycle, live);
|
|
107
|
+
else
|
|
108
|
+
await finishOpening(runtime, progress, live);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
98
111
|
replaced(store, expired);
|
|
99
|
-
const
|
|
100
|
-
const
|
|
112
|
+
const among = progress === null ? expired : null;
|
|
113
|
+
const installing = store.installs.underway(among);
|
|
114
|
+
const held = among === null ? store.rooms() : store.rooms(among);
|
|
101
115
|
const reloading = progress === null
|
|
102
116
|
? Promise.resolve([])
|
|
103
117
|
: held.then((stored) => owedReloads(runtime, expired, stored));
|
|
104
|
-
const replacing = Promise.all([held, reloading]).then(([stored, owed]) => reloadNow(runtime, (room) => expired.includes(room.locator) || owed.includes(room.locator), cycle, stored, installing));
|
|
118
|
+
const replacing = Promise.all([held, reloading]).then(([stored, owed]) => reloadNow(runtime, among, (room) => expired.includes(room.locator) || owed.includes(room.locator), cycle, stored, installing));
|
|
105
119
|
return socket.lanes.task(OPENING_LANE, async (live) => {
|
|
106
120
|
if (!live())
|
|
107
121
|
return;
|
|
@@ -147,7 +161,7 @@ function signalled(runtime, mode) {
|
|
|
147
161
|
session.set({ haltedRefusal: false });
|
|
148
162
|
if (mode !== serviceMode) {
|
|
149
163
|
session.set({ serviceMode: mode });
|
|
150
|
-
store.readiness.queue();
|
|
164
|
+
store.readiness.queue([]);
|
|
151
165
|
store.tell(SERVICE_MODE_TOPIC, mode);
|
|
152
166
|
}
|
|
153
167
|
if (releasing)
|
|
@@ -162,7 +176,7 @@ async function runCurrency(runtime, live) {
|
|
|
162
176
|
return;
|
|
163
177
|
await reconcileConversations(conversations);
|
|
164
178
|
if (conversations.current()) {
|
|
165
|
-
|
|
179
|
+
await rest(runtime, null, live);
|
|
166
180
|
return;
|
|
167
181
|
}
|
|
168
182
|
const progress = {
|
|
@@ -196,7 +210,7 @@ export function spaceFreed(runtime) {
|
|
|
196
210
|
if (closed || authorization === undefined)
|
|
197
211
|
return;
|
|
198
212
|
if (!socket.streamed)
|
|
199
|
-
void
|
|
213
|
+
void runtime.discover();
|
|
200
214
|
else
|
|
201
215
|
void resynchronize(runtime);
|
|
202
216
|
}
|
|
@@ -221,13 +235,13 @@ export async function stop(runtime) {
|
|
|
221
235
|
await store.written();
|
|
222
236
|
close(runtime);
|
|
223
237
|
}
|
|
224
|
-
export function start(runtime, signal) {
|
|
238
|
+
export function start(runtime, signal, onNeed) {
|
|
225
239
|
const { store, socket, presence, conversations, lastAnswers, recovery } = runtime;
|
|
226
240
|
const closeRuntime = () => close(runtime);
|
|
227
241
|
socket.observeServiceMode((mode) => signalled(runtime, mode));
|
|
228
242
|
socket.observeConversations((event) => {
|
|
229
243
|
if (event.kind === 'list' || event.kind === 'listed' || event.kind === 'unlisted')
|
|
230
|
-
store.readiness.queue();
|
|
244
|
+
store.readiness.queue([]);
|
|
231
245
|
receiveConversationEvent(conversations, event);
|
|
232
246
|
if (event.kind !== 'gap' || conversations.current())
|
|
233
247
|
return;
|
|
@@ -245,8 +259,9 @@ export function start(runtime, signal) {
|
|
|
245
259
|
recovery.resume();
|
|
246
260
|
}
|
|
247
261
|
else if (event.kind === 'discovered') {
|
|
262
|
+
const listed = roomsListed(runtime, event.discovery.roomList);
|
|
248
263
|
if (event.missed)
|
|
249
|
-
countAuthorityChange(runtime);
|
|
264
|
+
countAuthorityChange(runtime, listed);
|
|
250
265
|
void sync(runtime, 'opened', event.discovery);
|
|
251
266
|
}
|
|
252
267
|
else if (event.kind === 'closed') {
|
|
@@ -254,6 +269,8 @@ export function start(runtime, signal) {
|
|
|
254
269
|
}
|
|
255
270
|
else if (event.kind === 'caught-up')
|
|
256
271
|
void caughtUpRooms(runtime, event.expired);
|
|
272
|
+
else if (event.kind === 'reported')
|
|
273
|
+
lastAnswers.again();
|
|
257
274
|
else if (event.kind === 'authority-changed') {
|
|
258
275
|
if (socket.isAnnounced() && socket.isOpen())
|
|
259
276
|
fenceLive(runtime, event.left);
|
|
@@ -262,16 +279,12 @@ export function start(runtime, signal) {
|
|
|
262
279
|
else
|
|
263
280
|
void applyRoom(runtime, event);
|
|
264
281
|
});
|
|
265
|
-
|
|
266
|
-
.open()
|
|
267
|
-
.then(async (local) => {
|
|
268
|
-
if ((await local.facts()).capabilities.length > 0)
|
|
282
|
+
if (!onNeed) {
|
|
283
|
+
void store.open().catch((error) => {
|
|
269
284
|
socket.readyFromStore();
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
uncaught(error);
|
|
274
|
-
});
|
|
285
|
+
uncaught(error);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
275
288
|
if (!socket.streamed)
|
|
276
|
-
void
|
|
289
|
+
void runtime.discover();
|
|
277
290
|
}
|
package/dist/listing.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import type { HeldRooms } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { DiscoveredRoom, HeldRoom, OperationScopes, ProviderRefusal, ReplicaAdmission, RoomDeclaration } from './adapter.js';
|
|
3
|
-
import type
|
|
4
|
-
import
|
|
3
|
+
import { type Composition } from './collection.js';
|
|
4
|
+
import type { KeyedChange } from './observation.js';
|
|
5
|
+
import { type MdType, type ModelState, type TypesResult } from './model.js';
|
|
5
6
|
import { type PortReach } from './reach.js';
|
|
6
7
|
import type { ReplicaRecord } from './replica.js';
|
|
7
8
|
import type { Runtime } from './runtime.js';
|
|
8
9
|
import type { Stored } from './store.js';
|
|
9
|
-
|
|
10
|
+
type Selection<Model> = {
|
|
10
11
|
roots: readonly string[];
|
|
11
|
-
model:
|
|
12
|
+
model: Model;
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
+
type Shown<Model> = {
|
|
14
15
|
name: string;
|
|
15
16
|
locator: string;
|
|
16
17
|
handle: string;
|
|
17
18
|
operations: OperationScopes;
|
|
18
19
|
replica: ReplicaAdmission;
|
|
19
|
-
model:
|
|
20
|
-
typedSelection:
|
|
20
|
+
model: Model;
|
|
21
|
+
typedSelection: Selection<Model> | null;
|
|
21
22
|
providerOwnedPaths: readonly string[];
|
|
22
23
|
authoredPaths: readonly string[];
|
|
23
24
|
roomVersion: string | null;
|
|
@@ -25,12 +26,21 @@ export type AppRoom = {
|
|
|
25
26
|
synchronizationAvailable: boolean;
|
|
26
27
|
refusal: ProviderRefusal | null;
|
|
27
28
|
locked: boolean;
|
|
29
|
+
queriesOnly?: true;
|
|
28
30
|
};
|
|
29
|
-
type
|
|
30
|
-
type
|
|
31
|
-
|
|
31
|
+
export type AppTypedSelection = Selection<TypesResult>;
|
|
32
|
+
export type AppRoom = Shown<TypesResult>;
|
|
33
|
+
export type ListedRoom = Shown<TypesResult<string>>;
|
|
34
|
+
export type ListedModels = Readonly<Record<string, readonly MdType[]>>;
|
|
35
|
+
export type ListedRooms = {
|
|
36
|
+
readonly rooms: readonly ListedRoom[];
|
|
37
|
+
readonly models: ListedModels;
|
|
32
38
|
};
|
|
39
|
+
export type ListedEntry = Omit<Shown<ModelState>, 'locked'>;
|
|
33
40
|
export type Listing = ReadonlyMap<string, ListedEntry>;
|
|
41
|
+
export type RoomsChange = KeyedChange<string, ListedRoom> & {
|
|
42
|
+
readonly models: ListedModels;
|
|
43
|
+
};
|
|
34
44
|
export declare function modelIn({ socket, presence }: Runtime, locator: string, stored: Stored | undefined): ModelState;
|
|
35
45
|
export declare function compositionFor(runtime: Runtime, record: ReplicaRecord): Composition;
|
|
36
46
|
export declare function declarationOf({ presence }: Runtime, locator: string, stored: Stored | undefined): {
|
|
@@ -38,9 +48,11 @@ export declare function declarationOf({ presence }: Runtime, locator: string, st
|
|
|
38
48
|
readonly available: boolean;
|
|
39
49
|
} | undefined;
|
|
40
50
|
export declare function listedLocators({ presence }: Runtime, held: ReadonlyMap<string, unknown>): string[];
|
|
41
|
-
export declare function
|
|
51
|
+
export declare function listedOrHeld({ presence }: Runtime, held: ReadonlyMap<string, unknown>, locator: string): boolean;
|
|
52
|
+
export declare function listedEntries(runtime: Runtime, touched: readonly string[]): Promise<readonly ListedEntry[] | null>;
|
|
42
53
|
export declare function listingNow(runtime: Runtime): Promise<Listing>;
|
|
43
|
-
export declare function shownRooms(
|
|
54
|
+
export declare function shownRooms(runtime: Runtime, listing: Listing): ListedRooms;
|
|
55
|
+
export declare function shownChange(runtime: Runtime, entries: readonly ListedEntry[]): RoomsChange;
|
|
44
56
|
export declare function roomFacts(runtime: Runtime, reach?: PortReach | null): Promise<HeldRooms>;
|
|
45
57
|
export declare function heldRooms({ store }: Runtime, listed: readonly DiscoveredRoom[]): Promise<HeldRoom[]>;
|
|
46
58
|
export declare function name(runtime: Runtime, locator: string): Promise<void>;
|
package/dist/listing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../src/listing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../src/listing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OA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