@agentshouse/mdruntime 0.1.0-cf6d5f0a5c9c8 → 0.1.0-cf96c797c5fa8
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 +96 -31
- package/README.md +11 -1
- package/dist/adapter.d.ts +41 -14
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attempt.d.ts +16 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +57 -0
- package/dist/binary.d.ts +23 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +5 -8
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +8 -7
- package/dist/change.d.ts +15 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +26 -1
- package/dist/chat/acts.d.ts +34 -0
- package/dist/chat/acts.d.ts.map +1 -0
- package/dist/chat/acts.js +36 -0
- package/dist/chat/context.d.ts +3 -0
- package/dist/chat/context.d.ts.map +1 -0
- package/dist/chat/context.js +10 -0
- package/dist/chat/input.d.ts +9 -0
- package/dist/chat/input.d.ts.map +1 -0
- package/dist/chat/input.js +99 -0
- package/dist/chat/kit.d.ts +60 -0
- package/dist/chat/kit.d.ts.map +1 -0
- package/dist/chat/kit.js +123 -0
- package/dist/chat/lasting.d.ts +6 -0
- package/dist/chat/lasting.d.ts.map +1 -0
- package/dist/chat/lasting.js +19 -0
- package/dist/chat/list.d.ts +20 -0
- package/dist/chat/list.d.ts.map +1 -0
- package/dist/chat/list.js +59 -0
- package/dist/chat/markdown.d.ts +19 -0
- package/dist/chat/markdown.d.ts.map +1 -0
- package/dist/chat/markdown.js +187 -0
- package/dist/chat/message.d.ts +6 -0
- package/dist/chat/message.d.ts.map +1 -0
- package/dist/chat/message.js +192 -0
- package/dist/chat/messages.d.ts +21 -0
- package/dist/chat/messages.d.ts.map +1 -0
- package/dist/chat/messages.js +151 -0
- package/dist/chat/name.d.ts +6 -0
- package/dist/chat/name.d.ts.map +1 -0
- package/dist/chat/name.js +37 -0
- package/dist/chat/opened.d.ts +11 -0
- package/dist/chat/opened.d.ts.map +1 -0
- package/dist/chat/opened.js +17 -0
- package/dist/chat/overlay.d.ts +31 -0
- package/dist/chat/overlay.d.ts.map +1 -0
- package/dist/chat/overlay.js +97 -0
- package/dist/chat/parts.d.ts +57 -0
- package/dist/chat/parts.d.ts.map +1 -0
- package/dist/chat/parts.js +119 -0
- package/dist/chat/process.d.ts +20 -0
- package/dist/chat/process.d.ts.map +1 -0
- package/dist/chat/process.js +32 -0
- package/dist/chat/provider.d.ts +63 -0
- package/dist/chat/provider.d.ts.map +1 -0
- package/dist/chat/provider.js +645 -0
- package/dist/chat/question.d.ts +9 -0
- package/dist/chat/question.d.ts.map +1 -0
- package/dist/chat/question.js +80 -0
- package/dist/chat/questions.d.ts +31 -0
- package/dist/chat/questions.d.ts.map +1 -0
- package/dist/chat/questions.js +111 -0
- package/dist/chat/read.d.ts +5 -0
- package/dist/chat/read.d.ts.map +1 -0
- package/dist/chat/read.js +13 -0
- package/dist/chat/ready.d.ts +33 -0
- package/dist/chat/ready.d.ts.map +1 -0
- package/dist/chat/ready.js +91 -0
- package/dist/chat/style.d.ts +4 -0
- package/dist/chat/style.d.ts.map +1 -0
- package/dist/chat/style.js +302 -0
- package/dist/chat.d.ts +14 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +8 -0
- package/dist/client.d.ts +12 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +30 -15
- package/dist/connection.d.ts +19 -9
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +312 -96
- package/dist/conversation.d.ts +11 -3
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +47 -7
- package/dist/expectation.d.ts +21 -0
- package/dist/expectation.d.ts.map +1 -0
- package/dist/expectation.js +70 -0
- package/dist/failure.d.ts +13 -0
- package/dist/failure.d.ts.map +1 -0
- package/dist/failure.js +19 -0
- package/dist/host.d.ts +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +9 -9
- package/dist/identity.d.ts +2 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +6 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/memory.d.ts +3 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +47 -16
- package/dist/model.d.ts +3 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/open.d.ts +2 -0
- package/dist/open.d.ts.map +1 -0
- package/dist/open.js +1 -0
- package/dist/outcome.d.ts +28 -3
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +41 -1
- package/dist/overlay.d.ts +14 -3
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +75 -37
- package/dist/query.d.ts +4 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -0
- package/dist/reach.d.ts +2 -0
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +43 -19
- package/dist/react.d.ts +4 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +3 -2
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +9 -2
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +12 -17
- package/dist/replica.d.ts +6 -3
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +46 -32
- package/dist/room-draft.d.ts +26 -9
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +131 -22
- package/dist/rows.d.ts +3 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -1
- package/dist/save.d.ts +27 -1
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +323 -22
- package/dist/search.d.ts +3 -2
- package/dist/search.d.ts.map +1 -1
- package/dist/status.d.ts +2 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -8
- package/dist/store.d.ts +13 -12
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +150 -157
- package/dist/wire.d.ts +6 -3
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +14 -2
- package/package.json +17 -9
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.js +0 -8
package/dist/reach.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,SAAS,EAAe,YAAY,EAAc,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAW,SAAS,EAAe,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAajG,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAU/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG,CAClB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,OAAO,EAAE,OAAO,KACb,MAAM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,GAAG,SAAS,GAAG,IAAI,CASnE;AA8ED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,YAAY,CA4KlF"}
|
package/dist/reach.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { unheldView } from './conversation.js';
|
|
2
2
|
import { modelTypes, NO_MODEL } from './model.js';
|
|
3
3
|
import { applied, observing } from './observation.js';
|
|
4
|
+
import { runtimeError } from './failure.js';
|
|
5
|
+
import { failure, undeclared, } from './outcome.js';
|
|
4
6
|
import { beneath } from './paths.js';
|
|
5
7
|
import { reconciled } from './read-side.js';
|
|
6
|
-
import { moveTarget, readParts } from './room-draft.js';
|
|
8
|
+
import { moveTarget, readParts, staleWrite, } from './room-draft.js';
|
|
7
9
|
import { documentKey } from './rows.js';
|
|
8
10
|
const UNHELD_TYPES = { collection: modelTypes(NO_MODEL), typedSelection: null };
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return Promise.resolve(UNDECLARED);
|
|
11
|
+
function unconversed(name) {
|
|
12
|
+
return () => Promise.resolve(undeclared(name));
|
|
12
13
|
}
|
|
13
14
|
const NO_CONVERSATION = {
|
|
14
15
|
list: () => Promise.resolve([]),
|
|
15
16
|
read: (conversation) => Promise.resolve(unheldView(conversation)),
|
|
16
|
-
create:
|
|
17
|
-
send:
|
|
18
|
-
answer:
|
|
19
|
-
interrupt:
|
|
20
|
-
kill:
|
|
21
|
-
cancel:
|
|
22
|
-
delete:
|
|
17
|
+
create: unconversed('conversation.create'),
|
|
18
|
+
send: unconversed('conversation.send'),
|
|
19
|
+
answer: unconversed('conversation.answer'),
|
|
20
|
+
interrupt: unconversed('conversation.interrupt'),
|
|
21
|
+
kill: unconversed('conversation.kill'),
|
|
22
|
+
cancel: unconversed('conversation.cancel'),
|
|
23
|
+
delete: unconversed('conversation.delete'),
|
|
23
24
|
};
|
|
24
25
|
const NO_CHAT_DRAFT = {
|
|
25
26
|
write: () => Promise.resolve(),
|
|
@@ -51,6 +52,20 @@ function covers(reach, room, path) {
|
|
|
51
52
|
function conversing(reach) {
|
|
52
53
|
return reach === null || reach.conversations;
|
|
53
54
|
}
|
|
55
|
+
function refers(reach, scope) {
|
|
56
|
+
if (reach === null)
|
|
57
|
+
return true;
|
|
58
|
+
if (scope === null)
|
|
59
|
+
return false;
|
|
60
|
+
if (scope.kind === 'conversations')
|
|
61
|
+
return reach.conversations;
|
|
62
|
+
return scope.path === undefined
|
|
63
|
+
? wholly(reach, scope.locator)
|
|
64
|
+
: covers(reach, scope.locator, scope.path);
|
|
65
|
+
}
|
|
66
|
+
function unreachedReference(fileRef) {
|
|
67
|
+
return { kind: 'absent', code: 'binary-file-absent', fields: { fileRef }, retryable: false };
|
|
68
|
+
}
|
|
54
69
|
export function planReach(reach) {
|
|
55
70
|
return reach === null
|
|
56
71
|
? null
|
|
@@ -88,7 +103,7 @@ function shownDraft(reach, draft) {
|
|
|
88
103
|
function writeWithin(reach, write) {
|
|
89
104
|
return write.outcome === 'written'
|
|
90
105
|
? { outcome: 'written', roomDraft: shownDraft(reach, write.roomDraft) }
|
|
91
|
-
:
|
|
106
|
+
: staleWrite(shownDraft(reach, write.current));
|
|
92
107
|
}
|
|
93
108
|
function savedWithin(reach, room, result) {
|
|
94
109
|
if (reach === null || result.outcome === 'saved')
|
|
@@ -115,7 +130,7 @@ function queueWithin(reach, room, entries) {
|
|
|
115
130
|
(change.kind !== 'move' || covers(reach, room, change.to))));
|
|
116
131
|
}
|
|
117
132
|
function unreached(room) {
|
|
118
|
-
return
|
|
133
|
+
return runtimeError('room-not-held', `No Local Replica for ${room}`);
|
|
119
134
|
}
|
|
120
135
|
export function narrowed(runtime, given) {
|
|
121
136
|
const { md, watch } = runtime;
|
|
@@ -186,7 +201,7 @@ export function narrowed(runtime, given) {
|
|
|
186
201
|
return () => { };
|
|
187
202
|
});
|
|
188
203
|
}
|
|
189
|
-
if (topic === 'conversations') {
|
|
204
|
+
if (topic === 'conversations' || topic === 'agents') {
|
|
190
205
|
return following(() => {
|
|
191
206
|
if (conversing(reach))
|
|
192
207
|
return watch(topic, input, deliver);
|
|
@@ -216,13 +231,22 @@ export function narrowed(runtime, given) {
|
|
|
216
231
|
throw unreached(room);
|
|
217
232
|
const outside = roomDrafts.find(({ path }) => !covers(reach, room, path) ||
|
|
218
233
|
!moves(reach, room, md.roomDraft.read(room, path)?.parts.move));
|
|
219
|
-
if (outside !== undefined)
|
|
220
|
-
return { outcome: 'refused',
|
|
234
|
+
if (outside !== undefined) {
|
|
235
|
+
return { outcome: 'refused', code: 'stale', retryable: false, file: outside.path };
|
|
236
|
+
}
|
|
221
237
|
return savedWithin(reach, room, await md.save(room, roomDrafts, writtenBy));
|
|
222
238
|
},
|
|
223
239
|
history: (room, path, query) => covers(reach, room, path)
|
|
224
240
|
? md.history(room, path, query)
|
|
225
|
-
: Promise.resolve({ kind: 'room-not-readable', locator: room }),
|
|
241
|
+
: Promise.resolve(failure({ kind: 'room-not-readable', locator: room })),
|
|
242
|
+
binaryFile: {
|
|
243
|
+
read: (room, path, revision) => covers(reach, room, path)
|
|
244
|
+
? md.binaryFile.read(room, path, revision)
|
|
245
|
+
: Promise.resolve(failure({ kind: 'room-not-readable', locator: room })),
|
|
246
|
+
readReference: (reference) => refers(reach, runtime.referrerScope(reference.referrer))
|
|
247
|
+
? md.binaryFile.readReference(reference)
|
|
248
|
+
: Promise.resolve(unreachedReference(reference.fileRef)),
|
|
249
|
+
},
|
|
226
250
|
reached: (room, roomVersion, path) => (path === undefined ? wholly(reach, room) : covers(reach, room, path)) &&
|
|
227
251
|
md.reached(room, roomVersion, path),
|
|
228
252
|
log: () => (reach === null ? md.log() : ''),
|
|
@@ -237,7 +261,7 @@ export function narrowed(runtime, given) {
|
|
|
237
261
|
},
|
|
238
262
|
async discard(room, path, revision) {
|
|
239
263
|
if (!covers(reach, room, path))
|
|
240
|
-
return
|
|
264
|
+
return staleWrite(null);
|
|
241
265
|
return writeWithin(reach, await md.roomDraft.discard(room, path, revision));
|
|
242
266
|
},
|
|
243
267
|
},
|
|
@@ -253,7 +277,7 @@ export function narrowed(runtime, given) {
|
|
|
253
277
|
delete: (id) => conversation().delete(id),
|
|
254
278
|
},
|
|
255
279
|
chatDraft: {
|
|
256
|
-
write: (id, draft) => chatDraft().write(id, draft),
|
|
280
|
+
write: (id, draft, revision) => chatDraft().write(id, draft, revision),
|
|
257
281
|
discard: (id) => chatDraft().discard(id),
|
|
258
282
|
},
|
|
259
283
|
observe: observing(within),
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './client.js';
|
|
2
2
|
import type { AppRoom, ConnectionRefusal, SaveResult } from './connection.js';
|
|
3
3
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
|
-
import type { ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
4
|
+
import type { ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
5
|
+
import { type RuntimeError } from './failure.js';
|
|
5
6
|
import type { QueueEntry } from './outcome.js';
|
|
6
7
|
import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult } from './query.js';
|
|
7
8
|
import type { RoomDraft, RoomDraftParts } from './room-draft.js';
|
|
@@ -27,10 +28,11 @@ export declare function useObserve(client: Client, topic: 'room-drafts'): Observ
|
|
|
27
28
|
export declare function useObserve(client: Client, topic: 'presentation'): Observed<unknown>;
|
|
28
29
|
export declare function useObserve(client: Client, topic: 'conversation', conversation: string, options: ConversationOptions): Observed<ConversationView>;
|
|
29
30
|
export declare function useObserve(client: Client, topic: 'conversations'): Observed<readonly ConversationEntry[]>;
|
|
31
|
+
export declare function useObserve(client: Client, topic: 'agents'): Observed<readonly ConversationAgent[]>;
|
|
30
32
|
export type Saving = {
|
|
31
33
|
readonly busy: boolean;
|
|
32
34
|
readonly outcome: SaveResult | null;
|
|
33
|
-
readonly failure:
|
|
35
|
+
readonly failure: RuntimeError | null;
|
|
34
36
|
save(room: string, roomDrafts: ReadonlyMap<string, RoomDraftParts>): Promise<SaveResult>;
|
|
35
37
|
};
|
|
36
38
|
export declare function saveRoomDrafts(client: MdRuntimeClient, room: string, roomDrafts: ReadonlyMap<string, RoomDraftParts>): Promise<SaveResult>;
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAkB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAkB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9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UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,GAC9C,OAAO,CAAC,UAAU,CAAC,CAcrB;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAkBvD"}
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import { failed, runtimeError } from './failure.js';
|
|
2
3
|
const LOADING = { state: 'loading' };
|
|
3
4
|
export function useObserve(client, topic, ...input) {
|
|
4
5
|
const key = JSON.stringify([topic, ...input]);
|
|
@@ -38,7 +39,7 @@ export async function saveRoomDrafts(client, room, roomDrafts) {
|
|
|
38
39
|
const prior = await client.roomDraft.read(room, path);
|
|
39
40
|
const write = await client.roomDraft.write(room, path, prior?.revision ?? null, parts);
|
|
40
41
|
if (write.outcome !== 'written' || write.roomDraft === null) {
|
|
41
|
-
throw
|
|
42
|
+
throw runtimeError(write.outcome === 'stale' ? write.code : 'room-draft-unwritten', `the Room Draft at ${path} was not written`);
|
|
42
43
|
}
|
|
43
44
|
kept.push({ path, revision: write.roomDraft.revision });
|
|
44
45
|
}
|
|
@@ -54,7 +55,7 @@ export function useSave(client) {
|
|
|
54
55
|
return outcome;
|
|
55
56
|
}
|
|
56
57
|
catch (error) {
|
|
57
|
-
const failure =
|
|
58
|
+
const failure = failed(error);
|
|
58
59
|
setState({ busy: false, outcome: null, failure });
|
|
59
60
|
throw failure;
|
|
60
61
|
}
|
package/dist/read-side.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-side.d.ts","sourceRoot":"","sources":["../src/read-side.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-side.d.ts","sourceRoot":"","sources":["../src/read-side.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,EAOV,IAAI,EAIJ,WAAW,EAIZ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAuDpD,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CACH,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,KAAK,IAAI,GACpD,MAAM,IAAI,CAAC;IACd,SAAS,IAAI,SAAS,gBAAgB,EAAE,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAC9D,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAuVF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,WAAW,GAChB;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CA4BpD;AAED,wBAAgB,cAAc,IAAI,QAAQ,CA4HzC"}
|
package/dist/read-side.js
CHANGED
|
@@ -121,6 +121,7 @@ function documents(q, rows, plan, shape) {
|
|
|
121
121
|
room: d.room,
|
|
122
122
|
path: d.path,
|
|
123
123
|
type: d.type,
|
|
124
|
+
binary: d.binary,
|
|
124
125
|
...(shape.fields === null ? {} : { fields: d.fields }),
|
|
125
126
|
...(shape.sections === 'all' ? { sections: b.sections } : {}),
|
|
126
127
|
...(Array.isArray(shape.sections) ? named('section', shape.sections, b.sections) : {}),
|
|
@@ -229,8 +230,14 @@ function selected(fields, pointers) {
|
|
|
229
230
|
return (cut(fields, masked(pointers)) ?? {});
|
|
230
231
|
}
|
|
231
232
|
function documentOf(row, shape) {
|
|
232
|
-
if (row.type === null)
|
|
233
|
-
|
|
233
|
+
if (row.type === null) {
|
|
234
|
+
const binary = row.binary;
|
|
235
|
+
return {
|
|
236
|
+
room: row.room,
|
|
237
|
+
path: row.path,
|
|
238
|
+
...(binary === null ? {} : { binaryFile: binary }),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
234
241
|
return {
|
|
235
242
|
room: row.room,
|
|
236
243
|
path: row.path,
|
package/dist/refresh.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../src/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,aAAa,EAGb,gBAAgB,
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../src/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,aAAa,EAGb,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5E,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B,gBAAgB,GAChB,WAAW,GACX,cAAc,CAAC;AAEnB,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,cAAc,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B,gBAAgB,GAChB,WAAW,GACX,OAAO,GACP,cAAc,CAAC;AAEnB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,OAAO,GACxB,OAAO,CAAC,WAAW,CAAC,CAwEtB;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,OAAO,GACxB,OAAO,CAAC,cAAc,CAAC,CAKzB"}
|
package/dist/refresh.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { acceptedBinaries } from './overlay.js';
|
|
2
2
|
import { readStaged } from './replica.js';
|
|
3
3
|
import { unconfirmed } from './transfer.js';
|
|
4
4
|
export async function advancement(adapter, authorization, held, remodel, continuing) {
|
|
@@ -20,32 +20,28 @@ export async function advancement(adapter, authorization, held, remodel, continu
|
|
|
20
20
|
const revisions = { ...held.revisions };
|
|
21
21
|
const changes = { ...held.changes };
|
|
22
22
|
const written = { ...held.written };
|
|
23
|
-
const
|
|
24
|
-
const attachments = [];
|
|
23
|
+
const binaries = { ...held.binaries };
|
|
25
24
|
const stage = (page) => {
|
|
26
|
-
if (page.attachments !== undefined)
|
|
27
|
-
attachments.push(page.attachments);
|
|
28
|
-
Object.assign(documents, page.documents);
|
|
29
|
-
Object.assign(revisions, page.revisions);
|
|
30
25
|
for (const path of Object.keys(page.documents)) {
|
|
31
|
-
|
|
26
|
+
delete binaries[path];
|
|
32
27
|
delete changes[path];
|
|
33
28
|
written[path] = roomVersion;
|
|
34
29
|
}
|
|
35
|
-
for (const
|
|
36
|
-
delete documents[
|
|
37
|
-
delete
|
|
38
|
-
delete
|
|
39
|
-
delete written[target];
|
|
40
|
-
binaryTargets.add(target);
|
|
30
|
+
for (const path of Object.keys(page.binaryFiles)) {
|
|
31
|
+
delete documents[path];
|
|
32
|
+
delete changes[path];
|
|
33
|
+
delete written[path];
|
|
41
34
|
}
|
|
35
|
+
Object.assign(documents, page.documents);
|
|
36
|
+
Object.assign(binaries, acceptedBinaries(page.binaryFiles));
|
|
37
|
+
Object.assign(revisions, page.revisions);
|
|
42
38
|
Object.assign(changes, page.changes);
|
|
43
39
|
for (const path of page.removals) {
|
|
44
40
|
delete documents[path];
|
|
45
41
|
delete revisions[path];
|
|
46
42
|
delete changes[path];
|
|
47
43
|
delete written[path];
|
|
48
|
-
|
|
44
|
+
delete binaries[path];
|
|
49
45
|
}
|
|
50
46
|
};
|
|
51
47
|
stage(first);
|
|
@@ -76,11 +72,10 @@ export async function advancement(adapter, authorization, held, remodel, continu
|
|
|
76
72
|
selectionModel: models.selection,
|
|
77
73
|
roomVersion,
|
|
78
74
|
documents,
|
|
79
|
-
|
|
75
|
+
binaries,
|
|
80
76
|
revisions,
|
|
81
77
|
changes,
|
|
82
78
|
written,
|
|
83
|
-
attachments: attachments.length === 0 ? held.attachments : declaredAttachments(attachments),
|
|
84
79
|
},
|
|
85
80
|
};
|
|
86
81
|
}
|
package/dist/replica.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ChangeBatch } from './change.js';
|
|
2
2
|
import { type Collection, type Composition } from './collection.js';
|
|
3
3
|
import { type Layer } from './overlay.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MutationResult } from './adapter.js';
|
|
5
5
|
import type { ReplicaRecord } from './store.js';
|
|
6
6
|
import type { Refused } from './transfer.js';
|
|
7
7
|
export type ConfirmedLayer = {
|
|
@@ -35,9 +35,12 @@ export declare function readStaged(record: ReplicaRecord, previous?: ConfirmedLa
|
|
|
35
35
|
export declare function readReclassified(record: ReplicaRecord, previous: ConfirmedLayer): Staged | {
|
|
36
36
|
kind: 'deferred';
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
type Accepted = Extract<MutationResult, {
|
|
39
|
+
kind: 'accepted';
|
|
40
|
+
}>;
|
|
41
|
+
export declare function applyReturned(confirmed: ConfirmedLayer, submitted: ChangeBatch, accepted: Accepted, roomVersion: string, writtenAt: string): Staged;
|
|
39
42
|
export declare function replicaOf(confirmed: ConfirmedLayer, queue: readonly ChangeBatch[], previous?: Replica): Replica;
|
|
40
43
|
export declare function landed(batch: ChangeBatch, confirmed: ConfirmedLayer, current?: Readonly<Record<string, string>>): boolean;
|
|
41
|
-
export declare function withdrawals(confirmed: ConfirmedLayer, queue: readonly ChangeBatch[], withdrawable: (batch: ChangeBatch) => boolean): readonly ChangeBatch[];
|
|
44
|
+
export declare function withdrawals(confirmed: ConfirmedLayer, queue: readonly ChangeBatch[], withdrawable: (batch: ChangeBatch) => boolean, local: boolean): readonly ChangeBatch[];
|
|
42
45
|
export {};
|
|
43
46
|
//# sourceMappingURL=replica.d.ts.map
|
package/dist/replica.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../src/replica.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../src/replica.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,WAAW,EAAqB,MAAM,aAAa,CAAC;AACnG,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAML,KAAK,KAAK,EACX,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE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A;CAAE,CAAC,CAAC;AAE9D,wBAAgB,aAAa,CAC3B,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CA+BR;AAgDD,wBAAgB,SAAS,CACvB,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,QAAQ,CAAC,EAAE,OAAO,GACjB,OAAO,CA8BT;AA0ED,wBAAgB,MAAM,CACpB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,EACzB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAC7C,OAAO,CAiBT;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,YAAY,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,EAC7C,KAAK,EAAE,OAAO,GACb,SAAS,WAAW,EAAE,CA2BxB"}
|
package/dist/replica.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { parse } from '@agentshouse/mdmodel';
|
|
2
|
-
import { immutable } from './change.js';
|
|
1
|
+
import { equalValue, parse } from '@agentshouse/mdmodel';
|
|
2
|
+
import { immutable, landing } from './change.js';
|
|
3
3
|
import { collectionOf, unreadable, validateCollection, } from './collection.js';
|
|
4
|
-
import { overlay, overlayChanged, sameLayerText } from './overlay.js';
|
|
4
|
+
import { acceptedBinaries, overlay, overlayChanged, sameLayerText, } from './overlay.js';
|
|
5
5
|
import { providerRewritten } from './save.js';
|
|
6
|
-
import { equalValue } from './room-draft.js';
|
|
7
|
-
import { declaredAttachments } from './attachment.js';
|
|
8
6
|
export function compositionOf(record) {
|
|
9
7
|
return {
|
|
10
8
|
model: record.model,
|
|
@@ -30,7 +28,7 @@ export function readStaged(record, previous) {
|
|
|
30
28
|
(textChanged ||
|
|
31
29
|
record.model !== previous?.record.model ||
|
|
32
30
|
record.selectionModel !== previous?.record.selectionModel)) {
|
|
33
|
-
const verdict = validateCollection(record.documents, record.
|
|
31
|
+
const verdict = validateCollection(record.documents, Object.keys(record.binaries), compositionOf(record));
|
|
34
32
|
if (verdict.verdict === 'refuse' && verdict.rule !== 'model-unavailable') {
|
|
35
33
|
return { kind: 'refused', refusal: verdict };
|
|
36
34
|
}
|
|
@@ -48,14 +46,31 @@ export function readStaged(record, previous) {
|
|
|
48
46
|
return { kind: 'staged', confirmed: confirmedOf(record, previous) };
|
|
49
47
|
}
|
|
50
48
|
export function readReclassified(record, previous) {
|
|
51
|
-
const verdict = validateCollection(record.documents, record.
|
|
49
|
+
const verdict = validateCollection(record.documents, Object.keys(record.binaries), compositionOf(record));
|
|
52
50
|
if (verdict.verdict !== 'refuse')
|
|
53
51
|
return { kind: 'staged', confirmed: confirmedOf(record, previous) };
|
|
54
52
|
return verdict.rule === 'model-unavailable'
|
|
55
53
|
? { kind: 'deferred' }
|
|
56
54
|
: { kind: 'refused', refusal: verdict };
|
|
57
55
|
}
|
|
58
|
-
|
|
56
|
+
function returnedBinaries(held, submitted, accepted) {
|
|
57
|
+
const binaries = { ...held };
|
|
58
|
+
for (const change of submitted.changes) {
|
|
59
|
+
if (change.kind !== 'move')
|
|
60
|
+
continue;
|
|
61
|
+
const moved = binaries[change.path];
|
|
62
|
+
if (moved === undefined || accepted.revisions[change.to] === undefined)
|
|
63
|
+
continue;
|
|
64
|
+
binaries[change.to] = moved;
|
|
65
|
+
delete binaries[change.path];
|
|
66
|
+
}
|
|
67
|
+
Object.assign(binaries, acceptedBinaries(accepted.binaryFiles ?? {}));
|
|
68
|
+
for (const path of accepted.removals)
|
|
69
|
+
delete binaries[path];
|
|
70
|
+
return binaries;
|
|
71
|
+
}
|
|
72
|
+
export function applyReturned(confirmed, submitted, accepted, roomVersion, writtenAt) {
|
|
73
|
+
const { documents, revisions, changes, removals } = accepted;
|
|
59
74
|
const nextDocuments = { ...confirmed.record.documents, ...documents };
|
|
60
75
|
const nextRevisions = { ...confirmed.record.revisions, ...revisions };
|
|
61
76
|
const nextChanges = { ...confirmed.record.changes };
|
|
@@ -63,7 +78,6 @@ export function applyReturned(confirmed, documents, revisions, changes, removals
|
|
|
63
78
|
...confirmed.record.written,
|
|
64
79
|
...Object.fromEntries(Object.keys(documents).map((path) => [path, writtenAt])),
|
|
65
80
|
};
|
|
66
|
-
const binaryTargets = new Set(confirmed.record.binaryTargets);
|
|
67
81
|
for (const [path, revision] of Object.entries(revisions)) {
|
|
68
82
|
if (confirmed.record.revisions[path] !== revision)
|
|
69
83
|
delete nextChanges[path];
|
|
@@ -74,7 +88,6 @@ export function applyReturned(confirmed, documents, revisions, changes, removals
|
|
|
74
88
|
delete nextRevisions[path];
|
|
75
89
|
delete nextChanges[path];
|
|
76
90
|
delete nextWritten[path];
|
|
77
|
-
binaryTargets.delete(path);
|
|
78
91
|
}
|
|
79
92
|
return readStaged({
|
|
80
93
|
...confirmed.record,
|
|
@@ -83,10 +96,7 @@ export function applyReturned(confirmed, documents, revisions, changes, removals
|
|
|
83
96
|
revisions: nextRevisions,
|
|
84
97
|
changes: nextChanges,
|
|
85
98
|
written: nextWritten,
|
|
86
|
-
|
|
87
|
-
attachments: attachments === undefined
|
|
88
|
-
? confirmed.record.attachments
|
|
89
|
-
: declaredAttachments([attachments]),
|
|
99
|
+
binaries: returnedBinaries(confirmed.record.binaries, submitted, accepted),
|
|
90
100
|
}, confirmed);
|
|
91
101
|
}
|
|
92
102
|
function predicted(confirmed, batches, previous) {
|
|
@@ -136,7 +146,7 @@ export function replicaOf(confirmed, queue, previous) {
|
|
|
136
146
|
queue: batches,
|
|
137
147
|
visible: {
|
|
138
148
|
documents: confirmed.record.documents,
|
|
139
|
-
|
|
149
|
+
binaries: confirmed.record.binaries,
|
|
140
150
|
revisions: confirmed.record.revisions,
|
|
141
151
|
changes: confirmed.record.changes,
|
|
142
152
|
collection: confirmed.collection,
|
|
@@ -156,7 +166,7 @@ export function replicaOf(confirmed, queue, previous) {
|
|
|
156
166
|
};
|
|
157
167
|
}
|
|
158
168
|
function present(layer, path) {
|
|
159
|
-
return layer.documents[path] !== undefined || layer.
|
|
169
|
+
return layer.documents[path] !== undefined || layer.binaries[path] !== undefined;
|
|
160
170
|
}
|
|
161
171
|
function holds(layer, preconditions) {
|
|
162
172
|
const parsed = new Map();
|
|
@@ -177,6 +187,8 @@ function holds(layer, preconditions) {
|
|
|
177
187
|
if (precondition.kind === 'revision') {
|
|
178
188
|
return present(layer, path) && layer.revisions[path] === precondition.revision;
|
|
179
189
|
}
|
|
190
|
+
if (precondition.kind === 'content')
|
|
191
|
+
return layer.documents[path] === precondition.content;
|
|
180
192
|
const document = documentAt(path);
|
|
181
193
|
if (document === null)
|
|
182
194
|
return false;
|
|
@@ -221,36 +233,30 @@ function effects(change) {
|
|
|
221
233
|
{ kind: 'present', path: change.to },
|
|
222
234
|
];
|
|
223
235
|
}
|
|
236
|
+
if (change.kind === 'binary')
|
|
237
|
+
return [{ kind: 'present', path }];
|
|
224
238
|
return [{ kind: 'absent', path }];
|
|
225
239
|
}
|
|
226
|
-
function after(changes, index, path) {
|
|
227
|
-
let at = path;
|
|
228
|
-
for (const change of changes.slice(index + 1)) {
|
|
229
|
-
if (change.path !== at)
|
|
230
|
-
continue;
|
|
231
|
-
if (change.kind === 'remove')
|
|
232
|
-
return null;
|
|
233
|
-
if (change.kind === 'move')
|
|
234
|
-
at = change.to;
|
|
235
|
-
}
|
|
236
|
-
return at;
|
|
237
|
-
}
|
|
238
240
|
export function landed(batch, confirmed, current = {}) {
|
|
239
241
|
const layer = { ...confirmed.record, documents: { ...confirmed.record.documents, ...current } };
|
|
240
242
|
return batch.changes.every((change, index) => {
|
|
241
243
|
if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
|
|
242
|
-
const at =
|
|
244
|
+
const at = landing(batch.changes, index, change.path);
|
|
243
245
|
return at === null || layer.documents[at] === change.content;
|
|
244
246
|
}
|
|
247
|
+
if (change.kind === 'binary') {
|
|
248
|
+
const at = landing(batch.changes, index, change.path);
|
|
249
|
+
return at === null || layer.binaries[at]?.sha256 === change.sha256;
|
|
250
|
+
}
|
|
245
251
|
return effects(change).every((effect) => {
|
|
246
252
|
if (effect.kind === 'absent')
|
|
247
253
|
return holds(layer, [effect]);
|
|
248
|
-
const at =
|
|
254
|
+
const at = landing(batch.changes, index, effect.path);
|
|
249
255
|
return at === null || holds(layer, [{ ...effect, path: at }]);
|
|
250
256
|
});
|
|
251
257
|
});
|
|
252
258
|
}
|
|
253
|
-
export function withdrawals(confirmed, queue, withdrawable) {
|
|
259
|
+
export function withdrawals(confirmed, queue, withdrawable, local) {
|
|
254
260
|
if (!queue.some(withdrawable))
|
|
255
261
|
return [];
|
|
256
262
|
const composition = compositionOf(confirmed.record);
|
|
@@ -267,7 +273,15 @@ export function withdrawals(confirmed, queue, withdrawable) {
|
|
|
267
273
|
collection: collectionOf(layer.documents, composition),
|
|
268
274
|
})
|
|
269
275
|
: batch;
|
|
270
|
-
|
|
276
|
+
let unapplied = false;
|
|
277
|
+
const next = overlay(layer, [effective], () => {
|
|
278
|
+
unapplied = true;
|
|
279
|
+
});
|
|
280
|
+
if (local && unapplied) {
|
|
281
|
+
withdrawn.push(batch);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
layer = next;
|
|
271
285
|
}
|
|
272
286
|
return withdrawn;
|
|
273
287
|
}
|
package/dist/room-draft.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderRefusal } from './adapter.js';
|
|
2
|
+
import type { Open } from './open.js';
|
|
2
3
|
import type { Change, Precondition } from './change.js';
|
|
3
4
|
import type { VisibleLayer } from './replica.js';
|
|
4
5
|
export type FieldValue = {
|
|
@@ -36,6 +37,17 @@ export type RoomDraftParts = {
|
|
|
36
37
|
readonly removal?: {
|
|
37
38
|
readonly base?: string | null;
|
|
38
39
|
};
|
|
40
|
+
readonly file?: {
|
|
41
|
+
readonly blob: Blob;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type HeldFile = {
|
|
45
|
+
readonly blob: Blob;
|
|
46
|
+
readonly localId: string;
|
|
47
|
+
readonly byteLength: number;
|
|
48
|
+
readonly mediaType: string;
|
|
49
|
+
readonly sha256: string;
|
|
50
|
+
readonly base: string | null;
|
|
39
51
|
};
|
|
40
52
|
type HeldParts = {
|
|
41
53
|
readonly fields?: Readonly<Record<string, {
|
|
@@ -62,6 +74,7 @@ type HeldParts = {
|
|
|
62
74
|
readonly removal?: {
|
|
63
75
|
readonly base: string | null;
|
|
64
76
|
};
|
|
77
|
+
readonly file?: HeldFile;
|
|
65
78
|
};
|
|
66
79
|
type ChangedUnderneath = {
|
|
67
80
|
readonly fields?: Readonly<Record<string, FieldValue>>;
|
|
@@ -71,14 +84,12 @@ type ChangedUnderneath = {
|
|
|
71
84
|
readonly creation?: string;
|
|
72
85
|
readonly move?: string | null;
|
|
73
86
|
readonly removal?: string | null;
|
|
87
|
+
readonly file?: string | null;
|
|
74
88
|
};
|
|
75
|
-
export type ReturnReason =
|
|
76
|
-
readonly kind: 'conflicted' | 'rejected';
|
|
77
|
-
}) | {
|
|
78
|
-
readonly kind: 'expired';
|
|
79
|
-
} | {
|
|
80
|
-
readonly kind: 'withdrawn';
|
|
89
|
+
export type ReturnReason = ProviderRefusal & {
|
|
90
|
+
readonly kind: 'conflicted' | 'rejected' | 'expired' | 'withdrawn';
|
|
81
91
|
};
|
|
92
|
+
export declare function returnedBy(kind: 'expired' | 'withdrawn'): ReturnReason;
|
|
82
93
|
export type RoomDraft = {
|
|
83
94
|
readonly room: string;
|
|
84
95
|
readonly path: string;
|
|
@@ -92,11 +103,14 @@ export type RoomDraftWrite = {
|
|
|
92
103
|
readonly roomDraft: RoomDraft | null;
|
|
93
104
|
} | {
|
|
94
105
|
readonly outcome: 'stale';
|
|
106
|
+
readonly code: string;
|
|
107
|
+
readonly retryable: boolean;
|
|
95
108
|
readonly current: RoomDraft | null;
|
|
96
109
|
};
|
|
110
|
+
export declare function staleWrite(current: RoomDraft | null): RoomDraftWrite;
|
|
97
111
|
export type ChangedPart = {
|
|
98
112
|
readonly path: string;
|
|
99
|
-
readonly part: 'field' | 'section' | 'preamble' | 'markdown' | 'creation' | 'move' | 'removal'
|
|
113
|
+
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | 'creation' | 'move' | 'removal' | 'file'>;
|
|
100
114
|
readonly name?: string;
|
|
101
115
|
};
|
|
102
116
|
export type RoomDraftRecord = {
|
|
@@ -111,9 +125,10 @@ export type SavedDraft = {
|
|
|
111
125
|
readonly parts: HeldParts;
|
|
112
126
|
};
|
|
113
127
|
export declare function readParts(value: unknown): RoomDraftParts;
|
|
114
|
-
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts): HeldParts;
|
|
115
|
-
export declare function equalValue(left: unknown, right: unknown): boolean;
|
|
128
|
+
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts, file?: HeldFile): HeldParts;
|
|
116
129
|
export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
|
|
130
|
+
export declare function heldFile(blob: Blob, base: string | null): Promise<HeldFile>;
|
|
131
|
+
export declare function binaryBase(visible: VisibleLayer | undefined, path: string): string | null;
|
|
117
132
|
export declare function changedParts(path: string, report: ChangedUnderneath): readonly ChangedPart[];
|
|
118
133
|
export declare function returnedInto(existing: HeldParts | undefined, returned: HeldParts): HeldParts;
|
|
119
134
|
export declare function moveTarget(move: {
|
|
@@ -123,5 +138,7 @@ export declare function changesOf(path: string, parts: HeldParts): {
|
|
|
123
138
|
changes: readonly Change[];
|
|
124
139
|
bases: readonly Precondition[];
|
|
125
140
|
};
|
|
141
|
+
export declare function joinedDraft(carried: SavedDraft, saved: readonly SavedDraft[]): SavedDraft;
|
|
142
|
+
export declare function withdrawnDrafts(drafts: readonly SavedDraft[], changes: readonly Change[]): readonly SavedDraft[];
|
|
126
143
|
export {};
|
|
127
144
|
//# sourceMappingURL=room-draft.d.ts.map
|
package/dist/room-draft.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD,GACD;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CACxB,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC,CACxE,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,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