@agentshouse/mdruntime 0.1.0-c0136de3edfbe → 0.1.0-c014edb0e9d9b
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 +8 -8
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +74 -145
- package/dist/act-lanes.d.ts +33 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +177 -0
- package/dist/actions.d.ts +7 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +44 -31
- package/dist/adapter.d.ts +30 -44
- 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 -18
- 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/chat-types.d.ts +2 -0
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +11 -0
- package/dist/client.d.ts +9 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +29 -14
- 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.map +1 -1
- package/dist/compile.js +15 -21
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +30 -17
- package/dist/conversation-live.d.ts +138 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +249 -0
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +7 -1
- package/dist/conversation.d.ts +44 -44
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +904 -1024
- 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 +18 -40
- package/dist/durability.d.ts +12 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/expectation.d.ts +4 -2
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +33 -11
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +6 -0
- package/dist/figures.d.ts +1 -0
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +2 -2
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +17 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +38 -8
- package/dist/index.d.ts +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/install.d.ts +1 -3
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +49 -70
- package/dist/lifecycle.d.ts +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +42 -30
- package/dist/listing.d.ts +6 -11
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +25 -61
- 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 -38
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +10 -21
- 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 +38 -20
- package/dist/messages.d.ts +1 -4
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +14 -32
- 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 -134
- 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 +8 -5
- package/dist/outcome.d.ts +6 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +15 -0
- 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 -51
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +14 -111
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +22 -15
- 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 +5 -7
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +2 -0
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +5 -1
- 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 +28 -9
- package/dist/react.d.ts +15 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +15 -1
- package/dist/readiness.d.ts +0 -1
- package/dist/readiness.d.ts.map +1 -1
- package/dist/reads.d.ts +4 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +47 -5
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -4
- package/dist/replica.d.ts +5 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +15 -16
- 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 +36 -52
- 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 +11 -17
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +41 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +232 -112
- package/dist/saves.d.ts +2 -40
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +107 -698
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -3
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +4 -3
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +29 -33
- package/dist/socket/lanes.d.ts +2 -1
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +5 -2
- package/dist/socket/session.d.ts +0 -1
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket.d.ts +2 -4
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +4 -8
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +5 -4
- package/dist/store/records.d.ts +4 -4
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +33 -11
- 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 +1 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +22 -10
- package/dist/surface.d.ts +4 -2
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +20 -14
- package/dist/sync.d.ts +0 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +91 -82
- package/dist/tables.d.ts +13 -8
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +25 -12
- 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 +41 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +13 -3
- 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/socket/rooms.d.ts +0 -43
- 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.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) {
|
|
@@ -76,13 +76,31 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
76
76
|
case 'conversation.send':
|
|
77
77
|
return md.conversation.send(input[0], input[1], input[2]);
|
|
78
78
|
case 'conversation.answer':
|
|
79
|
-
return md.conversation.answer(input[0], input[1]);
|
|
79
|
+
return md.conversation.answer(input[0], input[1], input[2]);
|
|
80
80
|
case 'conversation.interrupt':
|
|
81
|
-
return md.conversation.interrupt(input[0]);
|
|
81
|
+
return md.conversation.interrupt(input[0], input[1]);
|
|
82
82
|
case 'conversation.kill':
|
|
83
|
-
return md.conversation.kill(input[0]);
|
|
83
|
+
return md.conversation.kill(input[0], input[1]);
|
|
84
84
|
case 'conversation.delete':
|
|
85
|
-
return md.conversation.delete(input[0]);
|
|
85
|
+
return md.conversation.delete(input[0], input[1]);
|
|
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';
|
|
@@ -11,27 +13,32 @@ export type { MdRuntime, RoomSchemas } from './surface.js';
|
|
|
11
13
|
export type { BinaryFileSurface, SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
12
14
|
export type { Observation } from './observation.js';
|
|
13
15
|
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
16
|
+
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
14
17
|
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
15
18
|
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
16
19
|
export type { BinaryFileRecord } from './binary.js';
|
|
17
20
|
export type { RuntimeError } from './failure.js';
|
|
21
|
+
export { refusalError } from './failure.js';
|
|
18
22
|
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
19
23
|
export type { SaveRefusal } from './save.js';
|
|
20
24
|
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
21
|
-
export { CHAT_MESSAGE_TYPE, CHAT_TYPE } from './chat-types.js';
|
|
25
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
26
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
22
27
|
export { departure } from './change.js';
|
|
28
|
+
export { definitionsIn, selected } from './collection.js';
|
|
23
29
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
24
30
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
25
31
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
26
32
|
export { contextFigure } from './context.js';
|
|
27
|
-
export { jobsRunning, openJobs, sessionEnded, type OpenJob, type RunningJob } from './job.js';
|
|
28
33
|
export { changeBatchIdentity } from './identity.js';
|
|
29
34
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
35
|
+
export { authoredAt, covered } from './paths.js';
|
|
30
36
|
export { untilAnswered } from './recovery.js';
|
|
37
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, type RetriedFailure, type Retries, type Step, } from './retried.js';
|
|
31
38
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
32
|
-
export {
|
|
39
|
+
export { acting, type Acting, type ActingRules, type Ended, type Lane, type LaneShown, type Send, } from './act-lanes.js';
|
|
33
40
|
export { expectedList, expecting, type ExpectedOf, type Expecting } from './expectation.js';
|
|
34
|
-
export type { RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
41
|
+
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
35
42
|
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
36
43
|
export type { ObservedRead } from './reads.js';
|
|
37
44
|
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,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,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AC;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,14 +1,20 @@
|
|
|
1
1
|
export { heldFacts } from './conversation-row.js';
|
|
2
|
-
export {
|
|
2
|
+
export { PAGE_METADATA_WORDS } from './page-metadata.js';
|
|
3
|
+
export { writeRule } from './declaration.js';
|
|
4
|
+
export { refusalError } from './failure.js';
|
|
5
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
6
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
3
7
|
export { departure } from './change.js';
|
|
8
|
+
export { definitionsIn, selected } from './collection.js';
|
|
4
9
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
5
10
|
export { cutName, nameFrom, transliterated } from './name.js';
|
|
6
11
|
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
7
12
|
export { contextFigure } from './context.js';
|
|
8
|
-
export { jobsRunning, openJobs, sessionEnded } from './job.js';
|
|
9
13
|
export { changeBatchIdentity } from './identity.js';
|
|
10
14
|
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
15
|
+
export { authoredAt, covered } from './paths.js';
|
|
11
16
|
export { untilAnswered } from './recovery.js';
|
|
17
|
+
export { createRetries, STEPS, retrying, Unanswered, uncertainError, } from './retried.js';
|
|
12
18
|
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
13
|
-
export {
|
|
19
|
+
export { acting, } from './act-lanes.js';
|
|
14
20
|
export { expectedList, expecting } from './expectation.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;
|
|
@@ -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/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|
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.
|
|
@@ -79,16 +80,12 @@ function batchEnd(entries, from, bytes) {
|
|
|
79
80
|
return end;
|
|
80
81
|
}
|
|
81
82
|
export function installationOf(store, coverage, held) {
|
|
82
|
-
const rooms = { done: 0, total: 0 };
|
|
83
83
|
const bytes = { done: 0, total: 0 };
|
|
84
84
|
let installing = 0;
|
|
85
85
|
let downloading = false;
|
|
86
86
|
for (const { room, state } of coverage) {
|
|
87
87
|
if (state === 'unadmitted')
|
|
88
88
|
continue;
|
|
89
|
-
rooms.total += 1;
|
|
90
|
-
if (state === 'complete')
|
|
91
|
-
rooms.done += 1;
|
|
92
89
|
const install = store.installs.of(room);
|
|
93
90
|
const underway = state === 'acquiring' || (install.installing && state !== 'complete');
|
|
94
91
|
if (underway)
|
|
@@ -108,7 +105,7 @@ export function installationOf(store, coverage, held) {
|
|
|
108
105
|
: bytes.done < bytes.total
|
|
109
106
|
? 'writing'
|
|
110
107
|
: 'replaying';
|
|
111
|
-
return { step,
|
|
108
|
+
return { step, bytes };
|
|
112
109
|
}
|
|
113
110
|
export function roomInFlight(store, locator) {
|
|
114
111
|
const { catching, transfer } = store.installs.of(locator);
|
|
@@ -134,17 +131,15 @@ export function sweep({ store, socket, journal }) {
|
|
|
134
131
|
await yielded();
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
|
-
catch {
|
|
134
|
+
catch (error) {
|
|
138
135
|
journal.record('erasure failed');
|
|
136
|
+
uncaught(error);
|
|
139
137
|
}
|
|
140
138
|
finally {
|
|
141
139
|
store.device.set({ sweeping: false });
|
|
142
140
|
}
|
|
143
141
|
})();
|
|
144
142
|
}
|
|
145
|
-
export function forgetInstall(store, locator) {
|
|
146
|
-
store.installs.change(locator, ({ installing }) => ({ ...NO_INSTALL, installing }));
|
|
147
|
-
}
|
|
148
143
|
export function caughtUpTo(runtime, locator) {
|
|
149
144
|
if (!runtime.store.installs.of(locator).catching)
|
|
150
145
|
return;
|
|
@@ -154,12 +149,6 @@ export function caughtUpTo(runtime, locator) {
|
|
|
154
149
|
export function catching(store, locator) {
|
|
155
150
|
store.installs.change(locator, (held) => ({ ...held, catching: true }));
|
|
156
151
|
}
|
|
157
|
-
export function confirmedAgain(store, locator) {
|
|
158
|
-
store.installs.change(locator, (held) => ({
|
|
159
|
-
...held,
|
|
160
|
-
confirmations: held.confirmations + 1,
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
163
152
|
export function standingAt(store, locator, held) {
|
|
164
153
|
return { key: held?.key ?? null, confirmed: store.installs.of(locator).confirmations };
|
|
165
154
|
}
|
|
@@ -386,8 +375,6 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
386
375
|
transfer: held,
|
|
387
376
|
underived: owed,
|
|
388
377
|
}));
|
|
389
|
-
if (before.transfer === null)
|
|
390
|
-
recoverReads(runtime);
|
|
391
378
|
installing(runtime, locator);
|
|
392
379
|
recoverReads(runtime);
|
|
393
380
|
if (owed < store.deriveBytes())
|
|
@@ -400,7 +387,9 @@ function staging(runtime, local, liveness, unheld) {
|
|
|
400
387
|
if (!liveness())
|
|
401
388
|
return null;
|
|
402
389
|
const prior = unheld === undefined ? await store.record(locator) : undefined;
|
|
403
|
-
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;
|
|
404
393
|
const kept = unheld?.staged ?? (await local.held()).staged.has(locator);
|
|
405
394
|
if (published === null && !kept)
|
|
406
395
|
return { record: null, staged: new Set() };
|
|
@@ -456,7 +445,7 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
456
445
|
}
|
|
457
446
|
try {
|
|
458
447
|
const result = await bootstrapRoom(from, authorized, room, {
|
|
459
|
-
collection: prior?.model ?? runtime.
|
|
448
|
+
collection: prior?.model ?? runtime.presence.unheldModel(room.locator) ?? NO_MODEL,
|
|
460
449
|
}, runtime.builtIn, runtime.typedPaths, (models, held) => (liveness() ? remodel(runtime, models, held) : held), liveness, staging(runtime, local, liveness, unheld));
|
|
461
450
|
const detail = result.kind === 'staged' ? result.record.roomVersion : result.kind;
|
|
462
451
|
journal.record(`transfer bootstrap ${room.locator} ${detail}`);
|
|
@@ -485,21 +474,22 @@ export async function pullBootstrap(runtime, authorized, room, local, liveness,
|
|
|
485
474
|
}
|
|
486
475
|
export function publish(runtime, local, room, reached, landing, live) {
|
|
487
476
|
const { store } = runtime;
|
|
488
|
-
|
|
477
|
+
let published = true;
|
|
478
|
+
const landed = settle(runtime, [room.locator], async (held) => {
|
|
489
479
|
if (!live()) {
|
|
490
480
|
caughtUpTo(runtime, room.locator);
|
|
491
|
-
return
|
|
481
|
+
return [];
|
|
492
482
|
}
|
|
493
|
-
const
|
|
494
|
-
const prior = work.replica;
|
|
483
|
+
const prior = held.get(room.locator)?.replica;
|
|
495
484
|
if (!standsAt(store, room.locator, prior?.record, landing.from)) {
|
|
485
|
+
published = false;
|
|
496
486
|
if (landing.kind === 'refreshed') {
|
|
497
487
|
await local.unrefresh(reached.key);
|
|
498
|
-
return
|
|
488
|
+
return [];
|
|
499
489
|
}
|
|
500
490
|
caughtUpTo(runtime, room.locator);
|
|
501
491
|
await abandoned(runtime, local, room.locator);
|
|
502
|
-
return
|
|
492
|
+
return [];
|
|
503
493
|
}
|
|
504
494
|
const record = landing.kind === 'refreshed' && prior !== undefined
|
|
505
495
|
? {
|
|
@@ -508,51 +498,40 @@ export function publish(runtime, local, room, reached, landing, live) {
|
|
|
508
498
|
...(landing.remodelled ? { model: reached.model } : {}),
|
|
509
499
|
}
|
|
510
500
|
: reached;
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}
|
|
519
|
-
: {
|
|
520
|
-
room: true,
|
|
521
|
-
view: landing.refreshed ? 'refreshed' : 'confirmed',
|
|
522
|
-
commit: {
|
|
501
|
+
return [
|
|
502
|
+
{
|
|
503
|
+
locator: room.locator,
|
|
504
|
+
record,
|
|
505
|
+
installed: landing.kind === 'refreshed'
|
|
506
|
+
? { refreshed: true }
|
|
507
|
+
: {
|
|
523
508
|
published: { from: prior?.record.key ?? null },
|
|
524
509
|
...(landing.refreshed ? { refreshed: true } : {}),
|
|
525
510
|
},
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
await runtime.unpair(local);
|
|
551
|
-
void statusShown(runtime);
|
|
552
|
-
if (landing.kind === 'bootstrapped' && work.queue.length > 0) {
|
|
553
|
-
runtime.submitLater(room.locator);
|
|
554
|
-
}
|
|
555
|
-
return true;
|
|
511
|
+
after() {
|
|
512
|
+
runtime.presence.installed(room.locator, landing.kind === 'bootstrapped');
|
|
513
|
+
runtime.retries.succeeded('download', room.locator);
|
|
514
|
+
store.prepareAgain(room.locator);
|
|
515
|
+
if (landing.kind === 'bootstrapped') {
|
|
516
|
+
store.installs.change(room.locator, (held) => ({
|
|
517
|
+
...transferGone(held),
|
|
518
|
+
highest: null,
|
|
519
|
+
beyondHorizon: false,
|
|
520
|
+
startedOver: null,
|
|
521
|
+
catching: false,
|
|
522
|
+
}));
|
|
523
|
+
if (prior !== undefined && prior.record.key !== record.key)
|
|
524
|
+
sweep(runtime);
|
|
525
|
+
void name(runtime, room.locator);
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
];
|
|
530
|
+
}).then(() => published, (error) => {
|
|
531
|
+
if (!refusedForSpace(error))
|
|
532
|
+
throw error;
|
|
533
|
+
caughtUpTo(runtime, room.locator);
|
|
534
|
+
return published;
|
|
556
535
|
});
|
|
557
536
|
return landing.kind === 'refreshed'
|
|
558
537
|
? 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;AAiO5C,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"}
|