@agentshouse/mdruntime-families 0.1.0-cbbc2294ffb59 → 0.1.0-cbcba985a6e71

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.
Files changed (43) hide show
  1. package/README.md +6 -3
  2. package/dist/mdruntime/adapter.d.ts +504 -0
  3. package/dist/mdruntime/binary.d.ts +22 -0
  4. package/dist/mdruntime/change-set.d.ts +37 -0
  5. package/dist/mdruntime/change.d.ts +88 -0
  6. package/dist/mdruntime/client.d.ts +86 -0
  7. package/dist/mdruntime/collection.d.ts +39 -0
  8. package/dist/mdruntime/connection.d.ts +146 -0
  9. package/dist/mdruntime/conversation.d.ts +115 -0
  10. package/dist/mdruntime/durability.d.ts +14 -0
  11. package/dist/mdruntime/failure.d.ts +12 -0
  12. package/dist/mdruntime/file.d.ts +19 -0
  13. package/dist/mdruntime/model.d.ts +57 -0
  14. package/dist/mdruntime/observation.d.ts +31 -0
  15. package/dist/mdruntime/open.d.ts +1 -0
  16. package/dist/mdruntime/outcome.d.ts +52 -0
  17. package/dist/mdruntime/overlay.d.ts +27 -0
  18. package/dist/mdruntime/query.d.ts +273 -0
  19. package/dist/mdruntime/reach.d.ts +44 -0
  20. package/dist/mdruntime/readiness.d.ts +52 -0
  21. package/dist/mdruntime/recovery.d.ts +24 -0
  22. package/dist/mdruntime/replica.d.ts +51 -0
  23. package/dist/mdruntime/room-draft.d.ts +155 -0
  24. package/dist/mdruntime/rows.d.ts +38 -0
  25. package/dist/mdruntime/save.d.ts +65 -0
  26. package/dist/mdruntime/search.d.ts +104 -0
  27. package/dist/mdruntime/seed.d.ts +15 -0
  28. package/dist/mdruntime/shared.d.ts +14 -0
  29. package/dist/mdruntime/status.d.ts +26 -0
  30. package/dist/mdruntime/store.d.ts +176 -0
  31. package/dist/mdruntime/transfer.d.ts +9 -0
  32. package/dist/mdruntime/turn.d.ts +8 -0
  33. package/dist/mdruntime/wire.d.ts +222 -0
  34. package/dist/react-admin.d.ts +1 -2
  35. package/dist/react-admin.d.ts.map +1 -1
  36. package/dist/react-admin.js +6 -7
  37. package/dist/records.d.ts +10 -3
  38. package/dist/records.d.ts.map +1 -1
  39. package/dist/records.js +432 -102
  40. package/dist/refine.d.ts +1 -2
  41. package/dist/refine.d.ts.map +1 -1
  42. package/dist/refine.js +5 -6
  43. package/package.json +2 -3
package/README.md CHANGED
@@ -40,12 +40,15 @@ compare for equality, a list for membership, and the suffixes `_gt`, `_gte`,
40
40
  `lt`, `gt`, `lte`, `gte`, `in`, `nin`, `or` and `and`. A field the Room schema
41
41
  declares a reference, at any depth, holds the referenced record's id; `id` and
42
42
  a reference compare only for equality and membership. Pages and totals are
43
- counted over every matching record. react-admin's `update` writes the fields
43
+ counted over every matching record, and a page reads only its own window of
44
+ the Room; a list asked for without a page reads every record, window by
45
+ window. react-admin's `update` writes the fields
44
46
  that differ from `previousData`, based on it, so the Save of a field another
45
47
  writer changed meanwhile is refused; Refine's `update` and either `updateMany`
46
48
  compare with the stored record. A list stays current: react-admin's queries of
47
- a resource are invalidated, and Refine's live mode refetches, when a document
48
- of the resource changes.
49
+ a resource are invalidated, and Refine's live mode refetches, when a record a
50
+ page or a read shows changes, a record a filter names starts or stops matching
51
+ it, or a page's total changes.
49
52
 
50
53
  ## License
51
54
 
@@ -0,0 +1,504 @@
1
+ import type { ModelResult } from './model.js';
2
+ import type { Open } from './open.js';
3
+ import type { ChangeBatch } from './change.js';
4
+ export type Authorization = object;
5
+ export type MdModelIdentity = {
6
+ identity: string;
7
+ version: string;
8
+ };
9
+ export type TypedSelection = {
10
+ roots: readonly string[];
11
+ };
12
+ export type OperationScopes = {
13
+ read: readonly string[];
14
+ sync: readonly string[];
15
+ write: readonly string[];
16
+ delete: readonly string[];
17
+ };
18
+ export type ReplicaAdmission = {
19
+ selection: string;
20
+ admission: Open<'admitted' | 'unavailable'>;
21
+ };
22
+ export type DiscoveredRoom = {
23
+ name: string;
24
+ locator: string;
25
+ handle: string;
26
+ roomVersion: string;
27
+ operations: OperationScopes;
28
+ replica: ReplicaAdmission;
29
+ typedSelection?: TypedSelection;
30
+ providerOwnedPaths: readonly string[];
31
+ };
32
+ export type Capability = {
33
+ name: string;
34
+ limits?: readonly ProviderLimit[];
35
+ actions?: readonly ActionDeclaration[];
36
+ conversationAgents?: ConversationAgents;
37
+ };
38
+ export type ConversationAgents = {
39
+ locator: string;
40
+ type: string;
41
+ identity: string;
42
+ name: string;
43
+ retired?: string;
44
+ };
45
+ export type ListedConversation = {
46
+ conversation: string;
47
+ agent: string;
48
+ name: string;
49
+ created: string;
50
+ finished: string | null;
51
+ outcome: string | null;
52
+ };
53
+ export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.answer' | 'conversation.interrupt' | 'conversation.kill' | 'conversation.cancel' | 'conversation.delete' | 'conversation.history';
54
+ export type ConversationMessage = {
55
+ identity: string;
56
+ turn: string;
57
+ text: string;
58
+ message: unknown;
59
+ };
60
+ export type AcceptedMessage = ConversationMessage & {
61
+ position: string;
62
+ };
63
+ export type ConversationHistoryRequest = {
64
+ conversations: readonly {
65
+ conversation: string;
66
+ after?: string;
67
+ }[];
68
+ };
69
+ export type ConversationHistoryPage = {
70
+ conversation: string;
71
+ messages: readonly AcceptedMessage[];
72
+ next?: string;
73
+ };
74
+ export type ConversationHistories = {
75
+ histories: readonly ConversationHistoryPage[];
76
+ };
77
+ export type TurnContext = {
78
+ used: number;
79
+ window: number;
80
+ };
81
+ export type TurnOperation = {
82
+ op: 'begin';
83
+ at: string;
84
+ } | {
85
+ op: 'start';
86
+ index: number;
87
+ part: unknown;
88
+ } | {
89
+ op: 'append';
90
+ index: number;
91
+ text: string;
92
+ } | {
93
+ op: 'status';
94
+ index: number;
95
+ status: string;
96
+ result: unknown;
97
+ } | {
98
+ op: 'count';
99
+ index: number;
100
+ count: number;
101
+ } | {
102
+ op: 'plan';
103
+ index: number;
104
+ entries: readonly unknown[];
105
+ } | ({
106
+ op: 'context';
107
+ } & TurnContext);
108
+ export type ProcessCommand = {
109
+ [field: string]: unknown;
110
+ name: string;
111
+ description: string;
112
+ input?: {
113
+ [field: string]: unknown;
114
+ hint: string;
115
+ } | null;
116
+ };
117
+ type SelectValue = {
118
+ [field: string]: unknown;
119
+ value: string;
120
+ name: string;
121
+ description?: string | null;
122
+ };
123
+ type SelectGroup = {
124
+ [field: string]: unknown;
125
+ group: string;
126
+ name: string;
127
+ options: readonly SelectValue[];
128
+ };
129
+ type SessionOptionNaming = {
130
+ [field: string]: unknown;
131
+ id: string;
132
+ name: string;
133
+ description?: string | null;
134
+ category?: string | null;
135
+ };
136
+ export type SessionOption = (SessionOptionNaming & {
137
+ type: 'select';
138
+ currentValue: string;
139
+ options: readonly SelectValue[] | readonly SelectGroup[];
140
+ }) | (SessionOptionNaming & {
141
+ type: 'boolean';
142
+ currentValue: boolean;
143
+ });
144
+ export type ConversationEvent = {
145
+ kind: 'turn';
146
+ conversation: string;
147
+ turn: string;
148
+ operation: TurnOperation;
149
+ } | {
150
+ kind: 'questions';
151
+ conversation: string;
152
+ questions: readonly unknown[];
153
+ } | {
154
+ kind: 'process';
155
+ conversation: string;
156
+ running: boolean;
157
+ } | {
158
+ kind: 'commands';
159
+ conversation: string;
160
+ commands: readonly ProcessCommand[];
161
+ } | {
162
+ kind: 'options';
163
+ conversation: string;
164
+ options: readonly SessionOption[];
165
+ } | {
166
+ kind: 'starting';
167
+ conversation: string;
168
+ step: string | null;
169
+ } | {
170
+ kind: 'link';
171
+ conversation: string;
172
+ connected: boolean;
173
+ } | {
174
+ kind: 'deliveries';
175
+ conversation: string;
176
+ unknown: readonly string[];
177
+ } | {
178
+ kind: 'accepted-message';
179
+ conversation: string;
180
+ message: AcceptedMessage;
181
+ } | {
182
+ kind: 'gap';
183
+ conversation: string;
184
+ } | {
185
+ kind: 'list';
186
+ entries: readonly ListedConversation[];
187
+ } | {
188
+ kind: 'listed';
189
+ entry: ListedConversation;
190
+ } | {
191
+ kind: 'unlisted';
192
+ conversation: string;
193
+ };
194
+ export type ConversationStream = {
195
+ replicate(conversations: readonly string[]): void;
196
+ observe(notify: (event: ConversationEvent) => void): () => void;
197
+ };
198
+ export type ActionDeclaration = {
199
+ name: string;
200
+ inputShape: unknown;
201
+ resultKind: unknown;
202
+ };
203
+ export type ProviderLimit = {
204
+ name: string;
205
+ value?: number | string;
206
+ };
207
+ export type HistoryRetention = {
208
+ kind: 'duration';
209
+ seconds: number;
210
+ } | {
211
+ kind: 'no-declared-time-bound';
212
+ };
213
+ export type Retention = {
214
+ history: HistoryRetention;
215
+ outcome: number;
216
+ refreshHorizon: number;
217
+ };
218
+ export type Discovery = {
219
+ kind: 'discovery';
220
+ rooms: readonly DiscoveredRoom[];
221
+ capabilities: readonly Capability[];
222
+ providerLimits: readonly ProviderLimit[];
223
+ retention: Retention;
224
+ member?: Member;
225
+ covered?: readonly string[];
226
+ };
227
+ export type DiscoveryScope = {
228
+ readonly authorities: readonly string[];
229
+ };
230
+ export type TransportUncertainty = {
231
+ kind: 'transport-uncertainty';
232
+ };
233
+ export type RoomNotReadable = {
234
+ kind: 'room-not-readable';
235
+ locator: string;
236
+ };
237
+ export type RevokedAuthorization = {
238
+ kind: 'revoked-authorization';
239
+ };
240
+ export type ProviderRefusal = {
241
+ code: string;
242
+ fields: Readonly<Record<string, unknown>>;
243
+ retryable: boolean;
244
+ };
245
+ export type ScopedRefusal = ProviderRefusal & {
246
+ kind: 'scoped-refusal';
247
+ locator: string;
248
+ scope: Open<'content' | 'sync' | 'model' | 'operation' | 'undisclosed'>;
249
+ };
250
+ export type AdapterFailure = TransportUncertainty | RoomNotReadable | RevokedAuthorization | ScopedRefusal;
251
+ export type ContractUnavailable = ProviderRefusal & {
252
+ kind: 'contract-unavailable';
253
+ };
254
+ export type DiscoverResult = Discovery | TransportUncertainty | RevokedAuthorization | ContractUnavailable;
255
+ export type PageToken = string;
256
+ export type ChangeAuthor = {
257
+ kind: Open<'user' | 'site'>;
258
+ id: string;
259
+ name: string;
260
+ };
261
+ export type Member = {
262
+ kind: Open<'user'>;
263
+ id: string;
264
+ name: string;
265
+ };
266
+ export type HeadChange = {
267
+ author: ChangeAuthor | null;
268
+ time: string;
269
+ };
270
+ export type BinaryFile = {
271
+ fileRef: string;
272
+ byteLength: number;
273
+ mediaType: string;
274
+ sha256: string;
275
+ };
276
+ export type HeldContent = {
277
+ documents: Readonly<Record<string, string>>;
278
+ revisions: Readonly<Record<string, string>>;
279
+ };
280
+ export type BootstrapRequest = {
281
+ locator: string;
282
+ selection: string;
283
+ pageToken?: PageToken;
284
+ held?: HeldContent;
285
+ };
286
+ export type RoomModels = {
287
+ collection?: ModelResult;
288
+ selection?: ModelResult;
289
+ };
290
+ export type BootstrapPage = {
291
+ kind: 'bootstrap';
292
+ roomVersion: string;
293
+ models?: RoomModels;
294
+ documents: Readonly<Record<string, string>>;
295
+ revisions: Readonly<Record<string, string>>;
296
+ fileIds?: Readonly<Record<string, string>>;
297
+ changes: Readonly<Record<string, HeadChange>>;
298
+ binaryFiles: Readonly<Record<string, BinaryFile>>;
299
+ pageToken?: PageToken;
300
+ };
301
+ export type BootstrapResult = BootstrapPage | {
302
+ kind: 'beyond-horizon';
303
+ } | AdapterFailure;
304
+ export type RefreshRequest = {
305
+ locator: string;
306
+ selection: string;
307
+ fromRoomVersion: string;
308
+ pageToken?: PageToken;
309
+ };
310
+ export type RefreshPage = {
311
+ kind: 'net-advancement';
312
+ roomVersion: string;
313
+ models?: RoomModels;
314
+ documents: Readonly<Record<string, string>>;
315
+ revisions: Readonly<Record<string, string>>;
316
+ fileIds?: Readonly<Record<string, string>>;
317
+ changes: Readonly<Record<string, HeadChange>>;
318
+ binaryFiles: Readonly<Record<string, BinaryFile>>;
319
+ removals: readonly string[];
320
+ pageToken?: PageToken;
321
+ };
322
+ export type RefreshResult = {
323
+ kind: 'still-current';
324
+ } | RefreshPage | {
325
+ kind: 'beyond-horizon';
326
+ } | RetryableRefusal | AdapterFailure;
327
+ export type MutationRequest = {
328
+ locator: string;
329
+ changeBatch: ChangeBatch;
330
+ upload?: unknown;
331
+ };
332
+ export type RetryableRefusal = ProviderRefusal & {
333
+ kind: 'retryable-refusal';
334
+ reset?: string;
335
+ };
336
+ export type ServiceMode = Open<'open' | 'write-halted'>;
337
+ export type ServiceModeSignal = {
338
+ observe(notify: (mode: ServiceMode) => void): () => void;
339
+ };
340
+ export type MutationResult = {
341
+ kind: 'accepted';
342
+ roomVersion: string;
343
+ documents: Readonly<Record<string, string>>;
344
+ revisions: Readonly<Record<string, string>>;
345
+ fileIds?: Readonly<Record<string, string>>;
346
+ changes: Readonly<Record<string, HeadChange>>;
347
+ removals: readonly string[];
348
+ binaryFiles?: Readonly<Record<string, BinaryFile>>;
349
+ author?: string;
350
+ time?: string;
351
+ } | (ProviderRefusal & {
352
+ kind: 'conflicted';
353
+ roomVersion?: string;
354
+ affected: Readonly<Record<string, string>>;
355
+ }) | (ProviderRefusal & {
356
+ kind: 'rejected';
357
+ affected: Readonly<Record<string, string>>;
358
+ }) | RetryableRefusal | {
359
+ kind: 'write-halted';
360
+ } | {
361
+ kind: 'expired';
362
+ restored?: true;
363
+ } | AdapterFailure;
364
+ export type HistoryAuthor = {
365
+ kind: 'user';
366
+ id: string;
367
+ } | {
368
+ kind: 'site';
369
+ id: string;
370
+ name: string;
371
+ };
372
+ export type HistoryRevision = {
373
+ revision: string;
374
+ author: HistoryAuthor;
375
+ time: string;
376
+ binaryFile?: BinaryFile;
377
+ };
378
+ export type HistoryRequest = {
379
+ locator: string;
380
+ path: string;
381
+ revision?: string;
382
+ pageToken?: PageToken;
383
+ };
384
+ export type HistoryResult = {
385
+ kind: 'history';
386
+ revisions: readonly HistoryRevision[];
387
+ pageToken?: PageToken;
388
+ deleted?: true;
389
+ } | {
390
+ kind: 'revision';
391
+ content: string;
392
+ } | {
393
+ kind: 'no-history';
394
+ } | AdapterFailure;
395
+ export type BinaryRequest = {
396
+ kind: 'path';
397
+ locator: string;
398
+ path: string;
399
+ revision: string;
400
+ fileRef?: string;
401
+ } | {
402
+ kind: 'reference';
403
+ fileRef: string;
404
+ referrer: unknown;
405
+ };
406
+ export type ReferrerScope = {
407
+ kind: 'room';
408
+ locator: string;
409
+ path?: string;
410
+ } | {
411
+ kind: 'conversations';
412
+ };
413
+ export type BinaryResult = {
414
+ kind: 'binary';
415
+ blob: Blob;
416
+ } | (ProviderRefusal & {
417
+ kind: 'rejected';
418
+ }) | AdapterFailure;
419
+ export type BinaryLinkResult = {
420
+ kind: 'link';
421
+ url: string;
422
+ name: string;
423
+ } | (ProviderRefusal & {
424
+ kind: 'rejected';
425
+ }) | AdapterFailure;
426
+ export type ActionRequest = {
427
+ name: string;
428
+ input: unknown;
429
+ };
430
+ export type RoomVersionAt = {
431
+ locator: string;
432
+ roomVersion: string;
433
+ };
434
+ export type ActionResult = {
435
+ kind: 'action';
436
+ result: unknown;
437
+ at?: RoomVersionAt;
438
+ } | (ProviderRefusal & {
439
+ kind: 'rejected';
440
+ }) | AdapterFailure;
441
+ export type HeldRoom = {
442
+ locator: string;
443
+ roomVersion: string;
444
+ documents: Readonly<Record<string, string>>;
445
+ revisions: Readonly<Record<string, string>>;
446
+ };
447
+ export type RoomStreamEvent = {
448
+ kind: 'opened';
449
+ } | {
450
+ kind: 'closed';
451
+ revoked: boolean;
452
+ lost: boolean;
453
+ } | {
454
+ kind: 'opening';
455
+ expired: readonly string[];
456
+ } | {
457
+ kind: 'authority-changed';
458
+ scope?: DiscoveryScope;
459
+ } | {
460
+ kind: 'room-version';
461
+ locator: string;
462
+ roomVersion: string;
463
+ };
464
+ export type KeptReceipt = {
465
+ key: string;
466
+ head: unknown;
467
+ };
468
+ export type StreamReceipts = {
469
+ heads(): Promise<readonly KeptReceipt[]>;
470
+ parts(key: string, count: number): Promise<readonly unknown[]>;
471
+ keep(key: string, head: unknown, part?: {
472
+ index: number;
473
+ value: unknown;
474
+ }): Promise<void>;
475
+ drop(keys: readonly string[]): Promise<void>;
476
+ };
477
+ export type RoomStream = {
478
+ hold(rooms: readonly HeldRoom[]): void;
479
+ reopen(): void;
480
+ published(locator: string, roomVersion: string): void;
481
+ observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
482
+ };
483
+ export type Adapter = {
484
+ readonly localSaves?: true;
485
+ readonly exhaustiveDiscovery?: true;
486
+ authorize(): Promise<Authorization>;
487
+ discover(authorization: Authorization, scope?: DiscoveryScope): Promise<DiscoverResult>;
488
+ bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
489
+ refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;
490
+ mutate(authorization: Authorization, request: MutationRequest, keep: (upload: unknown) => Promise<void>): Promise<MutationResult>;
491
+ history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
492
+ binary(authorization: Authorization, request: BinaryRequest): Promise<BinaryResult>;
493
+ link(authorization: Authorization, request: Extract<BinaryRequest, {
494
+ kind: 'path';
495
+ }>): Promise<BinaryLinkResult>;
496
+ referrerScope(referrer: unknown): ReferrerScope | null;
497
+ action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
498
+ reached(locator: string, roomVersion: string, target: string): boolean;
499
+ follows(locator: string, roomVersion: string, next: string): boolean;
500
+ roomStream?: RoomStream;
501
+ conversations?: ConversationStream;
502
+ serviceMode?: ServiceModeSignal;
503
+ };
504
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { HeldBinary } from './overlay.js';
2
+ export type BinaryFileRecord = {
3
+ readonly state: 'accepted';
4
+ readonly revision: string;
5
+ readonly path: string;
6
+ readonly fileRef: string;
7
+ readonly byteLength: number;
8
+ readonly mediaType: string;
9
+ readonly sha256: string;
10
+ } | {
11
+ readonly state: 'pending';
12
+ readonly localId: string;
13
+ readonly path: string;
14
+ readonly byteLength: number;
15
+ readonly mediaType: string;
16
+ readonly sha256: string;
17
+ };
18
+ export type BinaryReference = {
19
+ readonly fileRef: string;
20
+ readonly referrer: unknown;
21
+ };
22
+ export declare function binaryRecord(path: string, held: HeldBinary, revision: string | undefined): BinaryFileRecord;
@@ -0,0 +1,37 @@
1
+ import { type Replica } from './replica.js';
2
+ import { type Row } from './rows.js';
3
+ export type DocumentChange = {
4
+ locator: string;
5
+ path: string;
6
+ before: readonly Row[];
7
+ after: readonly Row[];
8
+ };
9
+ export type MessageChange = {
10
+ conversation: string;
11
+ identity: string;
12
+ text: string | null;
13
+ };
14
+ export type ChangeSet = {
15
+ documents: readonly DocumentChange[];
16
+ drafts: readonly {
17
+ locator: string;
18
+ path: string;
19
+ }[];
20
+ rooms: readonly string[];
21
+ queues: readonly string[];
22
+ presentations: readonly string[];
23
+ messages: readonly MessageChange[];
24
+ conversations: readonly string[];
25
+ };
26
+ type Changed = {
27
+ drafts?: readonly string[];
28
+ room?: boolean;
29
+ queue?: boolean;
30
+ presentation?: string;
31
+ };
32
+ export declare function changeSet(locator: string, before: Replica | null, after: Replica | null, changed?: Changed): ChangeSet;
33
+ export declare function changing(locator: string, before: Replica | null, after: Replica | null, changed?: Changed): Generator<number, ChangeSet, void>;
34
+ export declare function entering(locator: string, replica: Replica, paths: readonly string[]): ChangeSet;
35
+ export declare function conversationChangeSet(messages: readonly MessageChange[], conversations: readonly string[]): ChangeSet;
36
+ export declare function mergeChangeSets(sets: readonly ChangeSet[]): ChangeSet;
37
+ export {};
@@ -0,0 +1,88 @@
1
+ export type Change = {
2
+ readonly kind: 'field';
3
+ readonly path: string;
4
+ readonly name: string;
5
+ readonly value: unknown;
6
+ } | {
7
+ readonly kind: 'section';
8
+ readonly path: string;
9
+ readonly name: string;
10
+ readonly value: string;
11
+ } | {
12
+ readonly kind: 'preamble';
13
+ readonly path: string;
14
+ readonly value: string;
15
+ } | {
16
+ readonly kind: 'create';
17
+ readonly path: string;
18
+ readonly fields: Readonly<Record<string, unknown>>;
19
+ readonly sections: Readonly<Record<string, string>>;
20
+ } | {
21
+ readonly kind: 'create';
22
+ readonly path: string;
23
+ readonly content: string;
24
+ } | {
25
+ readonly kind: 'replace';
26
+ readonly path: string;
27
+ readonly content: string;
28
+ } | {
29
+ readonly kind: 'binary';
30
+ readonly path: string;
31
+ readonly localId: string;
32
+ readonly blob: Blob;
33
+ readonly byteLength: number;
34
+ readonly mediaType: string;
35
+ readonly sha256: string;
36
+ } | {
37
+ readonly kind: 'move';
38
+ readonly path: string;
39
+ readonly to: string;
40
+ } | {
41
+ readonly kind: 'remove';
42
+ readonly path: string;
43
+ };
44
+ export type Precondition = {
45
+ readonly kind: 'field';
46
+ readonly path: string;
47
+ readonly name: string;
48
+ readonly value: unknown;
49
+ } | {
50
+ readonly kind: 'section';
51
+ readonly path: string;
52
+ readonly name: string;
53
+ readonly value: string;
54
+ } | {
55
+ readonly kind: 'preamble';
56
+ readonly path: string;
57
+ readonly value: string;
58
+ } | {
59
+ readonly kind: 'revision';
60
+ readonly path: string;
61
+ readonly revision: string;
62
+ } | {
63
+ readonly kind: 'content';
64
+ readonly path: string;
65
+ readonly content: string;
66
+ } | {
67
+ readonly kind: 'present';
68
+ readonly path: string;
69
+ } | {
70
+ readonly kind: 'absent';
71
+ readonly path: string;
72
+ };
73
+ export type WrittenBy = {
74
+ readonly app: string;
75
+ readonly release: string;
76
+ };
77
+ export type ChangeBatch = {
78
+ validation?: import('./model.js').ValidationReceipt;
79
+ readonly id: string;
80
+ readonly baseRoomVersion: string;
81
+ readonly changes: readonly Change[];
82
+ readonly preconditions: readonly Precondition[];
83
+ readonly writtenBy?: WrittenBy;
84
+ };
85
+ export declare function immutable(batch: ChangeBatch): ChangeBatch;
86
+ export declare function landing(changes: readonly Change[], index: number, path: string): string | null;
87
+ export declare function departure(changes: readonly Change[], index: number): string;
88
+ export declare function queuedFile(batch: ChangeBatch, path: string, localId: string): number;