@agentshouse/mdruntime 0.1.0-c5d3fa6fb67bc → 0.1.0-c6636685d0c4b
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/AGENTS.md +205 -205
- package/README.md +8 -8
- package/dist/adapter.d.ts +36 -9
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +2 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/change-set.d.ts +5 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -1
- package/dist/chat/earlier.d.ts +10 -0
- package/dist/chat/earlier.d.ts.map +1 -0
- package/dist/chat/earlier.js +54 -0
- package/dist/chat/kit.js +1 -1
- package/dist/chat/list.d.ts +2 -1
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +45 -5
- package/dist/chat/markdown.d.ts +1 -0
- package/dist/chat/markdown.d.ts.map +1 -1
- package/dist/chat/markdown.js +78 -20
- package/dist/chat/message.d.ts +1 -0
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +12 -2
- package/dist/chat/messages.d.ts +2 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +52 -20
- package/dist/chat/overlay.d.ts +1 -0
- package/dist/chat/overlay.d.ts.map +1 -1
- package/dist/chat/overlay.js +10 -0
- package/dist/chat/pieces.d.ts +62 -0
- package/dist/chat/pieces.d.ts.map +1 -0
- package/dist/chat/pieces.js +1110 -0
- package/dist/chat/provider.d.ts +1 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +23 -14
- package/dist/chat/question.d.ts +1 -1
- package/dist/chat/question.d.ts.map +1 -1
- package/dist/chat/question.js +7 -18
- package/dist/chat/ready.d.ts +1 -1
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +1 -1
- package/dist/chat/steady.d.ts +3 -0
- package/dist/chat/steady.d.ts.map +1 -0
- package/dist/chat/steady.js +26 -0
- package/dist/chat/style.js +1 -1
- package/dist/chat.d.ts +2 -2
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/client.d.ts +6 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -5
- package/dist/collection.d.ts +4 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +128 -63
- package/dist/connection.d.ts +12 -4
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +577 -217
- package/dist/conversation.d.ts +12 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +196 -41
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +2 -1
- package/dist/host.d.ts +5 -4
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +45 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/memory.d.ts +6 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +17 -11
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +9 -3
- package/dist/outcome.d.ts +14 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +7 -0
- package/dist/overlay.d.ts +4 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +181 -140
- package/dist/query.d.ts +26 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +34 -6
- package/dist/reach.d.ts +4 -1
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +90 -21
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/read-side.d.ts +3 -1
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +271 -82
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +98 -0
- package/dist/refresh.d.ts +4 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +35 -16
- package/dist/replica.d.ts +11 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +69 -40
- package/dist/room-draft.d.ts +12 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +11 -12
- package/dist/rows.d.ts +1 -0
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +5 -0
- package/dist/save.d.ts +4 -2
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +195 -111
- package/dist/search.d.ts +17 -2
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +81 -7
- package/dist/seed.d.ts +16 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +75 -0
- package/dist/shared.d.ts +4 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +63 -33
- package/dist/store.d.ts +18 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +398 -316
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +26 -7
- package/dist/windows.d.ts +26 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +93 -0
- package/dist/wire.d.ts +16 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +4 -0
- package/package.json +2 -2
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
package/dist/host.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { composeRuntime, } from './connection.js';
|
|
2
|
+
import { queryKey } from './query.js';
|
|
2
3
|
import { described } from './failure.js';
|
|
3
4
|
import { removeRuntimeStore } from './store.js';
|
|
4
5
|
import { AUTHORIZATION_ENDED, request, WIRE, } from './wire.js';
|
|
@@ -15,10 +16,14 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
15
16
|
return md.types(input[0]);
|
|
16
17
|
case 'save':
|
|
17
18
|
return md.save(input[0], input[1], writtenBy);
|
|
19
|
+
case 'saveParts':
|
|
20
|
+
return md.saveParts(input[0], input[1], writtenBy);
|
|
18
21
|
case 'history':
|
|
19
22
|
return md.history(input[0], input[1], input[2]);
|
|
20
23
|
case 'binaryFile.read':
|
|
21
24
|
return md.binaryFile.read(input[0], input[1], input[2]);
|
|
25
|
+
case 'binaryFile.link':
|
|
26
|
+
return md.binaryFile.link(input[0], input[1], input[2]);
|
|
22
27
|
case 'binaryFile.readReference':
|
|
23
28
|
return md.binaryFile.readReference(input[0]);
|
|
24
29
|
case 'call':
|
|
@@ -45,6 +50,8 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
45
50
|
return md.presentation.read(app);
|
|
46
51
|
case 'presentation.write':
|
|
47
52
|
return md.presentation.write(app, input[0]);
|
|
53
|
+
case 'presentation.edit':
|
|
54
|
+
return md.presentation.edit(app, input[0]);
|
|
48
55
|
case 'conversation.list':
|
|
49
56
|
return md.conversation.list();
|
|
50
57
|
case 'conversation.read':
|
|
@@ -65,10 +72,20 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
65
72
|
return md.conversation.delete(input[0]);
|
|
66
73
|
case 'chatDraft.write':
|
|
67
74
|
return md.chatDraft.write(input[0], input[1], input[2]);
|
|
75
|
+
case 'chatDraft.prepend':
|
|
76
|
+
return md.chatDraft.prepend(input[0], input[1]);
|
|
68
77
|
case 'chatDraft.discard':
|
|
69
78
|
return md.chatDraft.discard(input[0]);
|
|
70
79
|
}
|
|
71
80
|
}
|
|
81
|
+
function answeredResult(value) {
|
|
82
|
+
return typeof value === 'object' && value !== null && !('pending' in value);
|
|
83
|
+
}
|
|
84
|
+
function answeredMessage(value) {
|
|
85
|
+
if (typeof value !== 'object' || value === null)
|
|
86
|
+
return false;
|
|
87
|
+
return !('result' in value) || answeredResult(value.result);
|
|
88
|
+
}
|
|
72
89
|
export function serveMdRuntime(options) {
|
|
73
90
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
74
91
|
const closing = new AbortController();
|
|
@@ -94,7 +111,17 @@ export function serveMdRuntime(options) {
|
|
|
94
111
|
const view = runtime.within(reach ?? null, facts);
|
|
95
112
|
const observations = new Map();
|
|
96
113
|
const followed = new Set();
|
|
114
|
+
const answeredKeys = new Set();
|
|
115
|
+
let awaited = null;
|
|
97
116
|
let serving = true;
|
|
117
|
+
const answeredQuery = (query) => {
|
|
118
|
+
answeredKeys.add(queryKey(query));
|
|
119
|
+
if (awaited === null || !awaited.keys.every((key) => answeredKeys.has(key)))
|
|
120
|
+
return;
|
|
121
|
+
const { done } = awaited;
|
|
122
|
+
awaited = null;
|
|
123
|
+
done();
|
|
124
|
+
};
|
|
98
125
|
const send = (message) => {
|
|
99
126
|
port.postMessage(message);
|
|
100
127
|
};
|
|
@@ -116,6 +143,8 @@ export function serveMdRuntime(options) {
|
|
|
116
143
|
return;
|
|
117
144
|
send(resolved ? { kind: 'event', id, value } : { kind: 'result', id, value });
|
|
118
145
|
resolved = true;
|
|
146
|
+
if (topic === 'query' && answeredMessage(value))
|
|
147
|
+
answeredQuery(input[0]);
|
|
119
148
|
};
|
|
120
149
|
observations.set(id, topic === 'deployment-facts'
|
|
121
150
|
? watchFacts(deliver)
|
|
@@ -138,8 +167,11 @@ export function serveMdRuntime(options) {
|
|
|
138
167
|
return;
|
|
139
168
|
}
|
|
140
169
|
const value = await answered(NARROWED.has(WIRE.members[message.member].reach) ? view.md : md, app, writtenBy, message.member, message.input);
|
|
141
|
-
if (serving)
|
|
142
|
-
|
|
170
|
+
if (!serving)
|
|
171
|
+
return;
|
|
172
|
+
send({ kind: 'result', id: message.id, value });
|
|
173
|
+
if (message.member === 'query' && answeredResult(value))
|
|
174
|
+
answeredQuery(message.input[0]);
|
|
143
175
|
}
|
|
144
176
|
catch (error) {
|
|
145
177
|
if (serving)
|
|
@@ -175,6 +207,13 @@ export function serveMdRuntime(options) {
|
|
|
175
207
|
facts = { ...facts, search: next };
|
|
176
208
|
view.facts(facts);
|
|
177
209
|
},
|
|
210
|
+
answered(queries, done) {
|
|
211
|
+
const keys = queries.map(queryKey);
|
|
212
|
+
if (keys.every((key) => answeredKeys.has(key)))
|
|
213
|
+
done();
|
|
214
|
+
else
|
|
215
|
+
awaited = { keys, done };
|
|
216
|
+
},
|
|
178
217
|
readiness(deliver) {
|
|
179
218
|
if (!serving)
|
|
180
219
|
return () => { };
|
|
@@ -193,8 +232,8 @@ export function serveMdRuntime(options) {
|
|
|
193
232
|
}
|
|
194
233
|
return {
|
|
195
234
|
attach,
|
|
196
|
-
|
|
197
|
-
runtime.
|
|
235
|
+
seed(entry) {
|
|
236
|
+
runtime.seed(entry);
|
|
198
237
|
},
|
|
199
238
|
persisted(answer) {
|
|
200
239
|
runtime.persisted(answer);
|
|
@@ -217,5 +256,6 @@ export function serveMdRuntime(options) {
|
|
|
217
256
|
},
|
|
218
257
|
};
|
|
219
258
|
}
|
|
259
|
+
export { entrySeedOf } from './seed.js';
|
|
220
260
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
221
|
-
export { AUTHORED_SCHEMA, authoredBinding, authoredBy, authoredHolder, bindAuthored, openDatabase, STORE_SCHEMA, } from './store.js';
|
|
261
|
+
export { AUTHORED_SCHEMA, authoredBinding, authoredBy, authoredHolder, bindAuthored, openDatabase, STORE_SCHEMA, transacted, } from './store.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { AcceptedMessage, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, ReferrerScope, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationAgents, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, DiscoveryScope, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, HeldContent, HeldRoom, KeptReceipt, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, ServiceMode, ServiceModeSignal, StreamReceipts, TransportUncertainty, TurnContext, TurnOperation, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, WrittenBy } from './change.js';
|
|
3
3
|
export type { ChatDraft, ChatDraftSurface, ConversationAgent, ConversationEntry, ConversationOptions, ConversationState, ConversationSurface, ConversationView, RunningTurn, } from './conversation.js';
|
|
4
4
|
export type { ChatDraftFile, FileDeclaration } from './file.js';
|
|
5
|
-
export type { AppRoom, AppTypedSelection, BinaryFileSurface, ConnectionRefusal, ConnectionRefusalCode, HistoryQuery, MdRuntime, MdRuntimeOptions, PresentationSurface, RoomDraftSurface, RoomSchemas, SavedRoomDraft, SaveResult, } from './connection.js';
|
|
5
|
+
export type { AppRoom, AppTypedSelection, BinaryFileSurface, ConnectionRefusal, ConnectionRefusalCode, HistoryQuery, MdRuntime, MdRuntimeOptions, PresentationSurface, RoomDraftSurface, RoomSchemas, SavedParts, SavedRoomDraft, SaveResult, } from './connection.js';
|
|
6
6
|
export type { Observation } from './observation.js';
|
|
7
|
-
export type { BinaryAnswer, CallResult, Failure, HistoryAnswer, Offline, QueueEntry, Submission, } from './outcome.js';
|
|
7
|
+
export type { BinaryAnswer, BinaryLinkAnswer, CallResult, Failure, HistoryAnswer, Offline, QueueEntry, Submission, } from './outcome.js';
|
|
8
8
|
export type { BinaryFileRecord, BinaryReference } from './binary.js';
|
|
9
9
|
export type { RuntimeError } from './failure.js';
|
|
10
|
-
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, } from './room-draft.js';
|
|
10
|
+
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
11
11
|
export type { SaveRefusal } from './save.js';
|
|
12
12
|
export type { DocumentHit, DocumentPart, MessageHit, PendingConversation, SearchCoverage, SearchHits, SearchPending, SearchRequest, SearchResult, SearchUndeclared, } from './search.js';
|
|
13
13
|
export { departure } from './change.js';
|
|
14
|
+
export { partsAfter } from './room-draft.js';
|
|
14
15
|
export { SESSION_STARTED } from './conversation.js';
|
|
15
16
|
export { changeBatchIdentity } from './identity.js';
|
|
16
17
|
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,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,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb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B,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/memory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelResult } from './model.js';
|
|
2
|
-
import { type AcceptedMessage, type ActionResult, type Adapter, type BinaryFile, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type HeadChange, type ListedConversation, type Member, type ProviderLimit, type Retention, type
|
|
2
|
+
import { type AcceptedMessage, type ActionResult, type Adapter, type BinaryFile, type Capability, type ConversationAction, type ConversationEvent, type DiscoveryScope, type DiscoveredRoom, type HeadChange, type ListedConversation, type Member, type ProviderLimit, type Retention, type ServiceMode } from './adapter.js';
|
|
3
3
|
export type MemoryRoom = DiscoveredRoom & {
|
|
4
4
|
model?: ModelResult;
|
|
5
5
|
selectionModel?: ModelResult;
|
|
@@ -33,16 +33,19 @@ export type MemoryAdapter = Adapter & {
|
|
|
33
33
|
setConversations(conversations: readonly MemoryConversation[]): void;
|
|
34
34
|
script(operation: keyof Adapter, answer: unknown): void;
|
|
35
35
|
open(): void;
|
|
36
|
-
close(
|
|
36
|
+
close(closing?: {
|
|
37
|
+
revoked?: boolean;
|
|
38
|
+
lost?: boolean;
|
|
39
|
+
}): void;
|
|
37
40
|
expire(locators: readonly string[]): void;
|
|
38
41
|
notifyRoomVersion(notification: {
|
|
39
42
|
locator: string;
|
|
40
43
|
roomVersion: string;
|
|
41
44
|
}): void;
|
|
45
|
+
notifyAuthorityChanged(scope?: DiscoveryScope): void;
|
|
42
46
|
notifyConversation(event: ConversationEvent): void;
|
|
43
47
|
notifyServiceMode(mode: ServiceMode): void;
|
|
44
48
|
heldRooms(): readonly string[];
|
|
45
|
-
heldDemand(): AcquiredDemand | null;
|
|
46
49
|
replicatedConversations(): readonly string[];
|
|
47
50
|
};
|
|
48
51
|
export declare function createMemoryAdapter(options?: MemoryAdapterOptions): MemoryAdapter;
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EAEZ,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAMf,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAItB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EAGf,KAAK,kBAAkB,EACvB,KAAK,MAAM,EAGX,KAAK,aAAa,EAIlB,KAAK,SAAS,EAGd,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAkBtB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG;IACxC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IACnD,KAAK,CAA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;KAAE,GAAG,IAAI,CAAC;IAC7D,MAAM,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C,iBAAiB,CAAC,YAAY,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChF,sBAAsB,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACrD,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACnD,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C,SAAS,IAAI,SAAS,MAAM,EAAE,CAAC;IAC/B,uBAAuB,IAAI,SAAS,MAAM,EAAE,CAAC;CAC9C,CAAC;AAiDF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CA2frF"}
|
package/dist/memory.js
CHANGED
|
@@ -58,7 +58,6 @@ export function createMemoryAdapter(options = {}) {
|
|
|
58
58
|
const sentTurns = new Map();
|
|
59
59
|
const historyPageSize = options.historyPageSize;
|
|
60
60
|
let held = [];
|
|
61
|
-
let heldDemand = null;
|
|
62
61
|
let expiring = [];
|
|
63
62
|
let replicated = [];
|
|
64
63
|
let issued = 0;
|
|
@@ -281,9 +280,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
281
280
|
for (const observer of observers)
|
|
282
281
|
observer({ kind: 'opened' });
|
|
283
282
|
},
|
|
284
|
-
close(revoked = false) {
|
|
283
|
+
close({ revoked = false, lost = !revoked } = {}) {
|
|
285
284
|
for (const observer of observers)
|
|
286
|
-
observer({ kind: 'closed', revoked });
|
|
285
|
+
observer({ kind: 'closed', revoked, lost });
|
|
287
286
|
},
|
|
288
287
|
expire(locators) {
|
|
289
288
|
expiring = [...locators];
|
|
@@ -292,6 +291,13 @@ export function createMemoryAdapter(options = {}) {
|
|
|
292
291
|
for (const observer of observers)
|
|
293
292
|
observer({ kind: 'room-version', locator, roomVersion });
|
|
294
293
|
},
|
|
294
|
+
notifyAuthorityChanged(scope) {
|
|
295
|
+
for (const observer of observers) {
|
|
296
|
+
observer(scope === undefined
|
|
297
|
+
? { kind: 'authority-changed' }
|
|
298
|
+
: { kind: 'authority-changed', scope });
|
|
299
|
+
}
|
|
300
|
+
},
|
|
295
301
|
notifyConversation(event) {
|
|
296
302
|
if (event.kind === 'accepted-message') {
|
|
297
303
|
sealed.add(event.message.turn);
|
|
@@ -307,9 +313,6 @@ export function createMemoryAdapter(options = {}) {
|
|
|
307
313
|
heldRooms() {
|
|
308
314
|
return held;
|
|
309
315
|
},
|
|
310
|
-
heldDemand() {
|
|
311
|
-
return heldDemand;
|
|
312
|
-
},
|
|
313
316
|
replicatedConversations() {
|
|
314
317
|
return replicated;
|
|
315
318
|
},
|
|
@@ -333,9 +336,8 @@ export function createMemoryAdapter(options = {}) {
|
|
|
333
336
|
},
|
|
334
337
|
},
|
|
335
338
|
roomStream: {
|
|
336
|
-
hold(asked
|
|
339
|
+
hold(asked) {
|
|
337
340
|
held = asked.map((room) => room.locator);
|
|
338
|
-
heldDemand = demand;
|
|
339
341
|
const expired = expiring.filter((locator) => held.includes(locator));
|
|
340
342
|
expiring = [];
|
|
341
343
|
const moved = asked.flatMap((room) => {
|
|
@@ -356,8 +358,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
356
358
|
},
|
|
357
359
|
reopen() {
|
|
358
360
|
queueMicrotask(() => {
|
|
359
|
-
for (const observer of observers)
|
|
360
|
-
observer({ kind: 'closed', revoked: false });
|
|
361
|
+
for (const observer of observers) {
|
|
362
|
+
observer({ kind: 'closed', revoked: false, lost: false });
|
|
363
|
+
}
|
|
361
364
|
});
|
|
362
365
|
},
|
|
363
366
|
published() { },
|
|
@@ -367,7 +370,7 @@ export function createMemoryAdapter(options = {}) {
|
|
|
367
370
|
if (!observers.has(notify))
|
|
368
371
|
return;
|
|
369
372
|
if (options.unopened === true) {
|
|
370
|
-
notify({ kind: 'closed', revoked: false });
|
|
373
|
+
notify({ kind: 'closed', revoked: false, lost: true });
|
|
371
374
|
return;
|
|
372
375
|
}
|
|
373
376
|
announceList();
|
|
@@ -478,6 +481,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
478
481
|
: { kind: 'binary', blob };
|
|
479
482
|
}, request);
|
|
480
483
|
},
|
|
484
|
+
async link(_authorization, request) {
|
|
485
|
+
return resolveScript(scripts.link, () => ({ kind: 'rejected', code: 'unscripted-link', fields: {}, retryable: false }), request);
|
|
486
|
+
},
|
|
481
487
|
referrerScope(referrer) {
|
|
482
488
|
if (typeof referrer !== 'object' || referrer === null)
|
|
483
489
|
return null;
|
package/dist/observation.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../src/observation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,OAAO,IAAI,CAAC,CAAC;IACb,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACpD,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC;IACpE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,QAAQ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CAAC,EAAE,CAGnF;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,WAAW,CAEnE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAG,WAAW,CAwB9E;AAiBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,CAkCnF;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,EAC1D,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAiB/B;AAED,wBAAgB,SAAS,CAAC,KAAK,SAAS,MAAM,EAC5C,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAChC,MAAM,IAAI,WAEA,KAAK,YAAY,OAAO,EAAE,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAQ1E"}
|
package/dist/observation.js
CHANGED
|
@@ -19,12 +19,18 @@ export function applied(keyed, message) {
|
|
|
19
19
|
for (const [key, row] of message.changed)
|
|
20
20
|
byKey.set(key, row);
|
|
21
21
|
const keys = message.order ?? keyed.keys.filter((key) => byKey.has(key));
|
|
22
|
-
const
|
|
22
|
+
const kept = keys.map((key) => byKey.get(key));
|
|
23
23
|
const coverage = message.coverage ?? result.coverage;
|
|
24
|
+
const next = message.next === undefined ? result.next : (message.next ?? undefined);
|
|
25
|
+
const total = message.total ?? result.total;
|
|
26
|
+
const window = {
|
|
27
|
+
...(next === undefined ? {} : { next }),
|
|
28
|
+
...(total === undefined ? {} : { total }),
|
|
29
|
+
};
|
|
24
30
|
return {
|
|
25
31
|
result: 'groups' in result
|
|
26
|
-
? { groups:
|
|
27
|
-
: { documents:
|
|
32
|
+
? { groups: kept, coverage, ...window }
|
|
33
|
+
: { documents: kept, coverage, ...window },
|
|
28
34
|
keys,
|
|
29
35
|
};
|
|
30
36
|
}
|
package/dist/outcome.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { ActionResult, AdapterFailure, BinaryResult, HistoryResult, ProviderRefusal, RoomVersionAt, ScopedRefusal } from './adapter.js';
|
|
1
|
+
import type { ActionResult, AdapterFailure, BinaryLinkResult, BinaryResult, HistoryResult, ProviderRefusal, RoomVersionAt, ScopedRefusal } from './adapter.js';
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
3
|
type Refused<Kind extends string> = ProviderRefusal & {
|
|
4
4
|
kind: Kind;
|
|
5
5
|
};
|
|
6
6
|
export type Failure = Refused<'transport-uncertainty'> | Refused<'revoked-authorization'> | (Refused<'room-not-readable'> & {
|
|
7
7
|
locator: string;
|
|
8
|
+
}) | (Refused<'room-locked'> & {
|
|
9
|
+
locator: string;
|
|
8
10
|
}) | ScopedRefusal;
|
|
9
11
|
export type CallResult = {
|
|
10
12
|
kind: 'action';
|
|
@@ -18,8 +20,18 @@ export type BinaryAnswer = {
|
|
|
18
20
|
kind: 'binary';
|
|
19
21
|
blob: Blob;
|
|
20
22
|
} | Refused<'rejected'> | Refused<'absent'> | Failure;
|
|
21
|
-
export
|
|
23
|
+
export type BinaryLinkAnswer = {
|
|
24
|
+
kind: 'link';
|
|
25
|
+
url: string;
|
|
26
|
+
name: string;
|
|
27
|
+
} | Refused<'rejected'> | Refused<'absent'> | Failure;
|
|
28
|
+
export declare function absentBinary(path: string): Refused<'absent'>;
|
|
22
29
|
export declare function binaryAnswer(result: BinaryResult): BinaryAnswer;
|
|
30
|
+
export declare function binaryLinkAnswer(result: BinaryLinkResult): BinaryLinkAnswer;
|
|
31
|
+
export declare const ROOM_LOCKED = "room-locked";
|
|
32
|
+
export declare function lockedRoom(locator: string): Refused<'room-locked'> & {
|
|
33
|
+
locator: string;
|
|
34
|
+
};
|
|
23
35
|
export type Offline = {
|
|
24
36
|
readonly kind: 'offline';
|
|
25
37
|
};
|
package/dist/outcome.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../src/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,KAAK,OAAO,CAAC,IAAI,SAAS,MAAM,IAAI,eAAe,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,OAAO,GACf,OAAO,CAAC,uBAAuB,CAAC,GAChC,OAAO,CAAC,uBAAuB,CAAC,GAChC,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACpD,aAAa,CAAC;AAElB,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,aAAa,CAAA;CAAE,GACvD,OAAO,CAAC,UAAU,CAAC,GACnB,OAAO,CAAC,YAAY,CAAC,GACrB,OAAO,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC;AAExF,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAC9B,OAAO,CAAC,UAAU,CAAC,GACnB,OAAO,CAAC,QAAQ,CAAC,GACjB,O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AU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG,CACvD,UAAU,GACV;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAC/D,CAAC"}
|
package/dist/outcome.js
CHANGED
|
@@ -4,6 +4,13 @@ export function absentBinary(path) {
|
|
|
4
4
|
export function binaryAnswer(result) {
|
|
5
5
|
return result.kind === 'binary' || result.kind === 'rejected' ? result : failure(result);
|
|
6
6
|
}
|
|
7
|
+
export function binaryLinkAnswer(result) {
|
|
8
|
+
return result.kind === 'link' || result.kind === 'rejected' ? result : failure(result);
|
|
9
|
+
}
|
|
10
|
+
export const ROOM_LOCKED = 'room-locked';
|
|
11
|
+
export function lockedRoom(locator) {
|
|
12
|
+
return { kind: ROOM_LOCKED, locator, code: ROOM_LOCKED, fields: {}, retryable: true };
|
|
13
|
+
}
|
|
7
14
|
export const OFFLINE = { kind: 'offline' };
|
|
8
15
|
export const UNCERTAIN = {
|
|
9
16
|
kind: 'transport-uncertainty',
|
package/dist/overlay.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ export type Layer = Heads & {
|
|
|
21
21
|
export declare function acceptedBinaries(files: Readonly<Record<string, BinaryFile>>): Record<string, HeldBinary>;
|
|
22
22
|
export declare function sameBinary(left: HeldBinary | undefined, right: HeldBinary | undefined): boolean;
|
|
23
23
|
export declare function sameChange(left: HeadChange | undefined, right: HeadChange | undefined): boolean;
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function
|
|
26
|
-
export declare function changedPaths(left: Layer, right: Layer): ReadonlySet<string>;
|
|
27
|
-
export declare function overlayChanged(base: Layer,
|
|
24
|
+
export declare function overlaying(base: Layer, queue: readonly ChangeBatch[], unapplied?: () => void): Generator<number, Layer, void>;
|
|
25
|
+
export declare function sameText(left: Layer, right: Layer): Generator<number, boolean, void>;
|
|
26
|
+
export declare function changedPaths(left: Layer, right: Layer): Generator<number, ReadonlySet<string>, void>;
|
|
27
|
+
export declare function overlayChanged(base: Layer, batch: ChangeBatch, previousBase: Layer, previousBatch: ChangeBatch, previousVisible: Layer): Generator<number, Layer, void>;
|
|
28
28
|
//# sourceMappingURL=overlay.d.ts.map
|
package/dist/overlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAU,WAAW,EAAgB,MAAM,aAAa,CAAC;AAIrE,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,CAAC,GAC7C;IACE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG;IAC1B,SAAS,EAA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