@noldova/checkpoints.protocol 0.0.2 → 0.0.4

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 (124) hide show
  1. package/README.md +3 -2
  2. package/package.json +5 -3
  3. package/src/api/index.d.ts +248 -535
  4. package/src/api/index.js +3 -11
  5. package/src/api/index.js.map +1 -1
  6. package/src/exceptions/{missing-field.exception.js → capture-content-mismatch.exception.js} +6 -8
  7. package/src/exceptions/capture-content-mismatch.exception.js.map +1 -0
  8. package/src/exceptions/{not-an-object.exception.js → earlier-paths-mismatch.exception.js} +6 -6
  9. package/src/exceptions/earlier-paths-mismatch.exception.js.map +1 -0
  10. package/src/exceptions/{field-not-a-list.exception.js → restore-content-mismatch.exception.js} +6 -8
  11. package/src/exceptions/restore-content-mismatch.exception.js.map +1 -0
  12. package/src/models/capture-mode.js +2 -1
  13. package/src/models/capture-mode.js.map +1 -1
  14. package/src/models/capture-outcome.js +4 -2
  15. package/src/models/capture-outcome.js.map +1 -1
  16. package/src/models/capture-paused-event.js +2 -3
  17. package/src/models/capture-paused-event.js.map +1 -1
  18. package/src/models/capture-request.js +17 -8
  19. package/src/models/capture-request.js.map +1 -1
  20. package/src/models/capture-result.js +26 -13
  21. package/src/models/capture-result.js.map +1 -1
  22. package/src/models/capture-resumed-event.js +2 -3
  23. package/src/models/capture-resumed-event.js.map +1 -1
  24. package/src/models/change-side.js +6 -6
  25. package/src/models/change-side.js.map +1 -1
  26. package/src/models/change-status.js +2 -1
  27. package/src/models/change-status.js.map +1 -1
  28. package/src/models/change.js +12 -12
  29. package/src/models/change.js.map +1 -1
  30. package/src/models/checkpoint-list.js +3 -4
  31. package/src/models/checkpoint-list.js.map +1 -1
  32. package/src/models/checkpoint.js +5 -9
  33. package/src/models/checkpoint.js.map +1 -1
  34. package/src/models/compare-outcome.js +2 -1
  35. package/src/models/compare-outcome.js.map +1 -1
  36. package/src/models/compare-request.js +5 -5
  37. package/src/models/compare-request.js.map +1 -1
  38. package/src/models/compare-result.js +3 -4
  39. package/src/models/compare-result.js.map +1 -1
  40. package/src/models/delete-folder-outcome.js +2 -1
  41. package/src/models/delete-folder-outcome.js.map +1 -1
  42. package/src/models/delete-folder-request.js +3 -4
  43. package/src/models/delete-folder-request.js.map +1 -1
  44. package/src/models/delete-folder-result.js +3 -4
  45. package/src/models/delete-folder-result.js.map +1 -1
  46. package/src/models/diff-target.js +5 -5
  47. package/src/models/diff-target.js.map +1 -1
  48. package/src/models/folder-reference.js +2 -3
  49. package/src/models/folder-reference.js.map +1 -1
  50. package/src/models/folder-usage.js +5 -5
  51. package/src/models/folder-usage.js.map +1 -1
  52. package/src/models/keep-reason.js +4 -2
  53. package/src/models/keep-reason.js.map +1 -1
  54. package/src/models/kept-path.js +3 -4
  55. package/src/models/kept-path.js.map +1 -1
  56. package/src/models/list-request.js +3 -4
  57. package/src/models/list-request.js.map +1 -1
  58. package/src/models/path-kind.js +2 -1
  59. package/src/models/path-kind.js.map +1 -1
  60. package/src/models/preview-outcome.js +2 -1
  61. package/src/models/preview-outcome.js.map +1 -1
  62. package/src/models/preview-request.js +3 -4
  63. package/src/models/preview-request.js.map +1 -1
  64. package/src/models/preview-result.js +7 -7
  65. package/src/models/preview-result.js.map +1 -1
  66. package/src/models/read-outcome.js +2 -1
  67. package/src/models/read-outcome.js.map +1 -1
  68. package/src/models/read-request.js +6 -6
  69. package/src/models/read-request.js.map +1 -1
  70. package/src/models/read-result.js +3 -4
  71. package/src/models/read-result.js.map +1 -1
  72. package/src/models/restore-action.js +2 -1
  73. package/src/models/restore-action.js.map +1 -1
  74. package/src/models/restore-held-up-event.js +3 -4
  75. package/src/models/restore-held-up-event.js.map +1 -1
  76. package/src/models/restore-outcome.js +5 -2
  77. package/src/models/restore-outcome.js.map +1 -1
  78. package/src/models/restore-plan.js +15 -7
  79. package/src/models/restore-plan.js.map +1 -1
  80. package/src/models/restore-request.js +3 -4
  81. package/src/models/restore-request.js.map +1 -1
  82. package/src/models/restore-result.js +27 -11
  83. package/src/models/restore-result.js.map +1 -1
  84. package/src/models/restore-step.js +9 -9
  85. package/src/models/restore-step.js.map +1 -1
  86. package/src/models/restored-event.js +2 -3
  87. package/src/models/restored-event.js.map +1 -1
  88. package/src/models/storage-list.js +3 -4
  89. package/src/models/storage-list.js.map +1 -1
  90. package/src/models/storage-request.js +2 -2
  91. package/src/models/storage-request.js.map +1 -1
  92. package/src/models/unread-path.js +5 -5
  93. package/src/models/unread-path.js.map +1 -1
  94. package/src/models/unread-reason.js +4 -2
  95. package/src/models/unread-reason.js.map +1 -1
  96. package/src/resources.js +20 -32
  97. package/src/resources.js.map +1 -1
  98. package/src/services/scope-paths.js +3 -2
  99. package/src/services/scope-paths.js.map +1 -1
  100. package/src/services/wire-form.js +43 -0
  101. package/src/services/wire-form.js.map +1 -0
  102. package/src/exceptions/field-not-a-boolean.exception.js +0 -19
  103. package/src/exceptions/field-not-a-boolean.exception.js.map +0 -1
  104. package/src/exceptions/field-not-a-list.exception.js.map +0 -1
  105. package/src/exceptions/field-not-a-number-or-null.exception.js +0 -19
  106. package/src/exceptions/field-not-a-number-or-null.exception.js.map +0 -1
  107. package/src/exceptions/field-not-a-number.exception.js +0 -19
  108. package/src/exceptions/field-not-a-number.exception.js.map +0 -1
  109. package/src/exceptions/field-not-a-string-list.exception.js +0 -19
  110. package/src/exceptions/field-not-a-string-list.exception.js.map +0 -1
  111. package/src/exceptions/field-not-a-string-or-null.exception.js +0 -19
  112. package/src/exceptions/field-not-a-string-or-null.exception.js.map +0 -1
  113. package/src/exceptions/field-not-a-string.exception.js +0 -19
  114. package/src/exceptions/field-not-a-string.exception.js.map +0 -1
  115. package/src/exceptions/missing-field.exception.js.map +0 -1
  116. package/src/exceptions/not-an-object.exception.js.map +0 -1
  117. package/src/exceptions/unknown-field.exception.js +0 -19
  118. package/src/exceptions/unknown-field.exception.js.map +0 -1
  119. package/src/services/json-object.reader.js +0 -89
  120. package/src/services/json-object.reader.js.map +0 -1
  121. package/src/types/json-object.js +0 -9
  122. package/src/types/json-object.js.map +0 -1
  123. package/src/types/json-value.js +0 -9
  124. package/src/types/json-value.js.map +0 -1
@@ -7,34 +7,22 @@
7
7
  */
8
8
 
9
9
  import { Exception, type ExceptionOptions } from "@noldova/context.exceptions";
10
-
11
- /**
12
- * A JSON object whose values are JSON values.
13
- */
14
- export type JsonObject = { readonly [key: string]: JsonValue };
15
-
16
- /**
17
- * A value that JSON can represent.
18
- */
19
- export type JsonValue = string | number | boolean | null | JsonObject | readonly JsonValue[];
20
-
21
- /**
22
- * The base of the checkpoints protocol's exceptions, thrown when a model is built from values it refuses, or read from JSON that isn't
23
- * its wire form. Its subclasses: {@link CaptureCheckpointMismatchException}, {@link CaptureSpaceMismatchException},
24
- * {@link ChangeSidesMismatchException}, {@link CompareChangesMismatchException}, {@link ContentTooLongException},
25
- * {@link FieldNotABooleanException}, {@link FieldNotAListException}, {@link FieldNotANumberException},
26
- * {@link FieldNotANumberOrNullException}, {@link FieldNotAStringException}, {@link FieldNotAStringListException},
27
- * {@link FieldNotAStringOrNullException}, {@link InvalidBase64Exception}, {@link InvalidCheckpointIdException},
28
- * {@link InvalidDateException}, {@link InvalidFolderPathException}, {@link InvalidIdentityException}, {@link InvalidPlanStateException},
29
- * {@link InvalidReadLimitException}, {@link InvalidRelativePathException}, {@link InvalidSizeException}, {@link InvalidTimeException},
30
- * {@link LabelTooLongException}, {@link MissingFieldException}, {@link NotAnObjectException}, {@link PreviewPlanMismatchException},
31
- * {@link ReadCutMismatchException}, {@link ReadOutcomeMismatchException}, {@link RestoreCheckpointsMismatchException},
32
- * {@link SideSizeMismatchException}, {@link StepSidesMismatchException}, {@link UnknownCaptureModeException},
33
- * {@link UnknownCaptureOutcomeException}, {@link UnknownChangeStatusException}, {@link UnknownCompareOutcomeException},
34
- * {@link UnknownDeleteFolderOutcomeException}, {@link UnknownFieldException}, {@link UnknownKeepReasonException},
35
- * {@link UnknownPathKindException}, {@link UnknownPreviewOutcomeException}, {@link UnknownReadOutcomeException},
36
- * {@link UnknownRestoreActionException}, {@link UnknownRestoreOutcomeException}, {@link UnknownUnreadReasonException},
37
- * {@link UnreadCodeMismatchException}, {@link UnreadReasonMismatchException}.
10
+ import type { JsonObject } from "@noldova/context.json";
11
+
12
+ /**
13
+ * The base of the checkpoints protocol's exceptions, thrown when a model is built from values it refuses; JSON that isn't a model's wire
14
+ * form fails with `JsonException` from `@noldova/context.json` instead. Its subclasses: {@link CaptureCheckpointMismatchException}, {@link
15
+ * CaptureSpaceMismatchException}, {@link ChangeSidesMismatchException}, {@link CompareChangesMismatchException}, {@link
16
+ * ContentTooLongException}, {@link InvalidBase64Exception}, {@link InvalidCheckpointIdException}, {@link InvalidDateException}, {@link
17
+ * InvalidFolderPathException}, {@link InvalidIdentityException}, {@link InvalidPlanStateException}, {@link InvalidReadLimitException},
18
+ * {@link InvalidRelativePathException}, {@link InvalidSizeException}, {@link InvalidTimeException}, {@link LabelTooLongException}, {@link
19
+ * PreviewPlanMismatchException}, {@link ReadCutMismatchException}, {@link ReadOutcomeMismatchException}, {@link
20
+ * RestoreCheckpointsMismatchException}, {@link SideSizeMismatchException}, {@link StepSidesMismatchException}, {@link
21
+ * UnknownCaptureModeException}, {@link UnknownCaptureOutcomeException}, {@link UnknownChangeStatusException}, {@link
22
+ * UnknownCompareOutcomeException}, {@link UnknownDeleteFolderOutcomeException}, {@link UnknownKeepReasonException}, {@link
23
+ * UnknownPathKindException}, {@link UnknownPreviewOutcomeException}, {@link UnknownReadOutcomeException}, {@link
24
+ * UnknownRestoreActionException}, {@link UnknownRestoreOutcomeException}, {@link UnknownUnreadReasonException}, {@link
25
+ * UnreadCodeMismatchException}, {@link UnreadReasonMismatchException}.
38
26
  *
39
27
  * @example
40
28
  * ```ts
@@ -82,6 +70,30 @@ export declare class CaptureCheckpointMismatchException extends ProtocolExceptio
82
70
  public constructor(outcome: CaptureOutcome);
83
71
  }
84
72
 
73
+ /**
74
+ * Thrown when a capture result holds the content size and its limit other than exactly when its outcome is TooLarge.
75
+ */
76
+ export declare class CaptureContentMismatchException extends ProtocolException {
77
+ /**
78
+ * The outcome the result was given.
79
+ */
80
+ public readonly outcome: CaptureOutcome;
81
+
82
+ /**
83
+ * Formats the exception's message from its facts.
84
+ *
85
+ * @param outcome The outcome the result was given.
86
+ * @example
87
+ * ```ts
88
+ * import { CaptureContentMismatchException, CaptureOutcome } from "@noldova/checkpoints.protocol";
89
+ *
90
+ * const exception = new CaptureContentMismatchException(CaptureOutcome.Captured);
91
+ * console.log(exception.message, exception.outcome);
92
+ * ```
93
+ */
94
+ public constructor(outcome: CaptureOutcome);
95
+ }
96
+
85
97
  /**
86
98
  * Thrown when a capture result holds the space free and the space needed other than exactly when its outcome is LowDiskSpace.
87
99
  */
@@ -155,243 +167,57 @@ export declare class CompareChangesMismatchException extends ProtocolException {
155
167
  }
156
168
 
157
169
  /**
158
- * Thrown when a read result's content is longer than its size.
159
- */
160
- export declare class ContentTooLongException extends ProtocolException {
161
- /**
162
- * The content's length, in bytes.
163
- */
164
- public readonly length: number;
165
-
166
- /**
167
- * The size the result was given, in bytes.
168
- */
169
- public readonly size: number;
170
-
171
- /**
172
- * Formats the exception's message from its facts.
173
- *
174
- * @param length The content's length, in bytes.
175
- * @param size The size the result was given, in bytes.
176
- * @example
177
- * ```ts
178
- * import { ContentTooLongException } from "@noldova/checkpoints.protocol";
179
- *
180
- * const exception = new ContentTooLongException(3, 2);
181
- * console.log(exception.message, exception.length, exception.size);
182
- * ```
183
- */
184
- public constructor(length: number, size: number);
185
- }
186
-
187
- /**
188
- * Thrown when a model's field is neither `true` nor `false`.
189
- */
190
- export declare class FieldNotABooleanException extends ProtocolException {
191
- /**
192
- * The field's name.
193
- */
194
- public readonly field: string;
195
-
196
- /**
197
- * The model's name.
198
- */
199
- public readonly model: string;
200
-
201
- /**
202
- * Formats the exception's message from its facts.
203
- *
204
- * @param model The model's name.
205
- * @param field The field's name.
206
- * @example
207
- * ```ts
208
- * import { FieldNotABooleanException } from "@noldova/checkpoints.protocol";
209
- *
210
- * const exception = new FieldNotABooleanException("Model", "number");
211
- * console.log(exception.message, exception.model, exception.field);
212
- * ```
213
- */
214
- public constructor(model: string, field: string);
215
- }
216
-
217
- /**
218
- * Thrown when a model's field isn't a list.
219
- */
220
- export declare class FieldNotAListException extends ProtocolException {
221
- /**
222
- * The field's name.
223
- */
224
- public readonly field: string;
225
-
226
- /**
227
- * The model's name.
228
- */
229
- public readonly model: string;
230
-
231
- /**
232
- * Formats the exception's message from its facts.
233
- *
234
- * @param model The model's name.
235
- * @param field The field's name.
236
- * @example
237
- * ```ts
238
- * import { FieldNotAListException } from "@noldova/checkpoints.protocol";
239
- *
240
- * const exception = new FieldNotAListException("Model", "number");
241
- * console.log(exception.message, exception.model, exception.field);
242
- * ```
243
- */
244
- public constructor(model: string, field: string);
245
- }
246
-
247
- /**
248
- * Thrown when a model's field isn't a number.
249
- */
250
- export declare class FieldNotANumberException extends ProtocolException {
251
- /**
252
- * The field's name.
253
- */
254
- public readonly field: string;
255
-
256
- /**
257
- * The model's name.
258
- */
259
- public readonly model: string;
260
-
261
- /**
262
- * Formats the exception's message from its facts.
263
- *
264
- * @param model The model's name.
265
- * @param field The field's name.
266
- * @example
267
- * ```ts
268
- * import { FieldNotANumberException } from "@noldova/checkpoints.protocol";
269
- *
270
- * const exception = new FieldNotANumberException("Model", "text");
271
- * console.log(exception.message, exception.model, exception.field);
272
- * ```
273
- */
274
- public constructor(model: string, field: string);
275
- }
276
-
277
- /**
278
- * Thrown when a model's field is neither a number nor `null`.
279
- */
280
- export declare class FieldNotANumberOrNullException extends ProtocolException {
281
- /**
282
- * The field's name.
283
- */
284
- public readonly field: string;
285
-
286
- /**
287
- * The model's name.
288
- */
289
- public readonly model: string;
290
-
291
- /**
292
- * Formats the exception's message from its facts.
293
- *
294
- * @param model The model's name.
295
- * @param field The field's name.
296
- * @example
297
- * ```ts
298
- * import { FieldNotANumberOrNullException } from "@noldova/checkpoints.protocol";
299
- *
300
- * const exception = new FieldNotANumberOrNullException("Model", "text");
301
- * console.log(exception.message, exception.model, exception.field);
302
- * ```
303
- */
304
- public constructor(model: string, field: string);
305
- }
306
-
307
- /**
308
- * Thrown when a model's field isn't text.
170
+ * Thrown when a restore plan names an earlier path that none of its steps writes, or names one twice.
309
171
  */
310
- export declare class FieldNotAStringException extends ProtocolException {
172
+ export declare class EarlierPathsMismatchException extends ProtocolException {
311
173
  /**
312
- * The field's name.
174
+ * The earlier path the plan refused.
313
175
  */
314
- public readonly field: string;
315
-
316
- /**
317
- * The model's name.
318
- */
319
- public readonly model: string;
320
-
321
- /**
322
- * Formats the exception's message from its facts.
323
- *
324
- * @param model The model's name.
325
- * @param field The field's name.
326
- * @example
327
- * ```ts
328
- * import { FieldNotAStringException } from "@noldova/checkpoints.protocol";
329
- *
330
- * const exception = new FieldNotAStringException("Model", "number");
331
- * console.log(exception.message, exception.model, exception.field);
332
- * ```
333
- */
334
- public constructor(model: string, field: string);
335
- }
336
-
337
- /**
338
- * Thrown when a model's field isn't a list of text.
339
- */
340
- export declare class FieldNotAStringListException extends ProtocolException {
341
- /**
342
- * The field's name.
343
- */
344
- public readonly field: string;
345
-
346
- /**
347
- * The model's name.
348
- */
349
- public readonly model: string;
176
+ public readonly path: string;
350
177
 
351
178
  /**
352
179
  * Formats the exception's message from its facts.
353
180
  *
354
- * @param model The model's name.
355
- * @param field The field's name.
181
+ * @param path The earlier path the plan refused.
356
182
  * @example
357
183
  * ```ts
358
- * import { FieldNotAStringListException } from "@noldova/checkpoints.protocol";
184
+ * import { EarlierPathsMismatchException } from "@noldova/checkpoints.protocol";
359
185
  *
360
- * const exception = new FieldNotAStringListException("Model", "mixed");
361
- * console.log(exception.message, exception.model, exception.field);
186
+ * const exception = new EarlierPathsMismatchException("src/a.txt");
187
+ * console.log(exception.message, exception.path);
362
188
  * ```
363
189
  */
364
- public constructor(model: string, field: string);
190
+ public constructor(path: string);
365
191
  }
366
192
 
367
193
  /**
368
- * Thrown when a model's field is neither text nor `null`.
194
+ * Thrown when a read result's content is longer than its size.
369
195
  */
370
- export declare class FieldNotAStringOrNullException extends ProtocolException {
196
+ export declare class ContentTooLongException extends ProtocolException {
371
197
  /**
372
- * The field's name.
198
+ * The content's length, in bytes.
373
199
  */
374
- public readonly field: string;
200
+ public readonly length: number;
375
201
 
376
202
  /**
377
- * The model's name.
203
+ * The size the result was given, in bytes.
378
204
  */
379
- public readonly model: string;
205
+ public readonly size: number;
380
206
 
381
207
  /**
382
208
  * Formats the exception's message from its facts.
383
209
  *
384
- * @param model The model's name.
385
- * @param field The field's name.
210
+ * @param length The content's length, in bytes.
211
+ * @param size The size the result was given, in bytes.
386
212
  * @example
387
213
  * ```ts
388
- * import { FieldNotAStringOrNullException } from "@noldova/checkpoints.protocol";
214
+ * import { ContentTooLongException } from "@noldova/checkpoints.protocol";
389
215
  *
390
- * const exception = new FieldNotAStringOrNullException("Model", "number");
391
- * console.log(exception.message, exception.model, exception.field);
216
+ * const exception = new ContentTooLongException(3, 2);
217
+ * console.log(exception.message, exception.length, exception.size);
392
218
  * ```
393
219
  */
394
- public constructor(model: string, field: string);
220
+ public constructor(length: number, size: number);
395
221
  }
396
222
 
397
223
  /**
@@ -477,7 +303,7 @@ export declare class InvalidFolderPathException extends ProtocolException {
477
303
  }
478
304
 
479
305
  /**
480
- * Thrown when a folder's identity isn't 1 to 64 letters, digits or hyphens.
306
+ * Thrown when a folder's identity isn't 1 to 64 lower-case letters, digits or hyphens.
481
307
  */
482
308
  export declare class InvalidIdentityException extends ProtocolException {
483
309
  /**
@@ -645,60 +471,6 @@ export declare class LabelTooLongException extends ProtocolException {
645
471
  public constructor(length: number);
646
472
  }
647
473
 
648
- /**
649
- * Thrown when a model's wire form lacks a field it needs.
650
- */
651
- export declare class MissingFieldException extends ProtocolException {
652
- /**
653
- * The field's name.
654
- */
655
- public readonly field: string;
656
-
657
- /**
658
- * The model's name.
659
- */
660
- public readonly model: string;
661
-
662
- /**
663
- * Formats the exception's message from its facts.
664
- *
665
- * @param model The model's name.
666
- * @param field The field's name.
667
- * @example
668
- * ```ts
669
- * import { MissingFieldException } from "@noldova/checkpoints.protocol";
670
- *
671
- * const exception = new MissingFieldException("Model", "missing");
672
- * console.log(exception.message, exception.model, exception.field);
673
- * ```
674
- */
675
- public constructor(model: string, field: string);
676
- }
677
-
678
- /**
679
- * Thrown when a model's wire form isn't a JSON object.
680
- */
681
- export declare class NotAnObjectException extends ProtocolException {
682
- /**
683
- * The model's name.
684
- */
685
- public readonly model: string;
686
-
687
- /**
688
- * Formats the exception's message from its facts.
689
- *
690
- * @param model The model's name.
691
- * @example
692
- * ```ts
693
- * import { NotAnObjectException } from "@noldova/checkpoints.protocol";
694
- *
695
- * const exception = new NotAnObjectException("Model");
696
- * console.log(exception.message, exception.model);
697
- * ```
698
- */
699
- public constructor(model: string);
700
- }
701
-
702
474
  /**
703
475
  * Thrown when a preview result holds a plan other than exactly when its outcome is Planned.
704
476
  */
@@ -795,6 +567,30 @@ export declare class RestoreCheckpointsMismatchException extends ProtocolExcepti
795
567
  public constructor(outcome: RestoreOutcome);
796
568
  }
797
569
 
570
+ /**
571
+ * Thrown when a restore result holds the content size and its limit other than exactly when its outcome is TooLarge.
572
+ */
573
+ export declare class RestoreContentMismatchException extends ProtocolException {
574
+ /**
575
+ * The outcome the result was given.
576
+ */
577
+ public readonly outcome: RestoreOutcome;
578
+
579
+ /**
580
+ * Formats the exception's message from its facts.
581
+ *
582
+ * @param outcome The outcome the result was given.
583
+ * @example
584
+ * ```ts
585
+ * import { RestoreContentMismatchException, RestoreOutcome } from "@noldova/checkpoints.protocol";
586
+ *
587
+ * const exception = new RestoreContentMismatchException(RestoreOutcome.MovedOn);
588
+ * console.log(exception.message, exception.outcome);
589
+ * ```
590
+ */
591
+ public constructor(outcome: RestoreOutcome);
592
+ }
593
+
798
594
  /**
799
595
  * Thrown when a side has a size other than exactly when it isn't a folder, or is a folder taken as text.
800
596
  */
@@ -963,36 +759,6 @@ export declare class UnknownDeleteFolderOutcomeException extends ProtocolExcepti
963
759
  public constructor(value: string);
964
760
  }
965
761
 
966
- /**
967
- * Thrown when a model's wire form has a field the model doesn't.
968
- */
969
- export declare class UnknownFieldException extends ProtocolException {
970
- /**
971
- * The field's name.
972
- */
973
- public readonly field: string;
974
-
975
- /**
976
- * The model's name.
977
- */
978
- public readonly model: string;
979
-
980
- /**
981
- * Formats the exception's message from its facts.
982
- *
983
- * @param model The model's name.
984
- * @param field The field's name.
985
- * @example
986
- * ```ts
987
- * import { UnknownFieldException } from "@noldova/checkpoints.protocol";
988
- *
989
- * const exception = new UnknownFieldException("Model", "other");
990
- * console.log(exception.message, exception.model, exception.field);
991
- * ```
992
- */
993
- public constructor(model: string, field: string);
994
- }
995
-
996
762
  /**
997
763
  * Thrown when a wire value names no reason a restore keeps a path.
998
764
  */
@@ -1267,7 +1033,7 @@ export declare class CaptureOutcome {
1267
1033
  public static readonly Captured: CaptureOutcome;
1268
1034
 
1269
1035
  /**
1270
- * The folder's path is missing, so no checkpoint was taken; a missing folder is never captured as empty.
1036
+ * The folder's path is missing, or the folder was deleted or renamed while it was walked, so no checkpoint was taken; a missing folder is never captured as empty.
1271
1037
  */
1272
1038
  public static readonly FolderMissing: CaptureOutcome;
1273
1039
 
@@ -1282,6 +1048,12 @@ export declare class CaptureOutcome {
1282
1048
  */
1283
1049
  public static readonly LowDiskSpace: CaptureOutcome;
1284
1050
 
1051
+ /**
1052
+ * The new and changed content the checkpoint would write is over 1 GiB, so no checkpoint was taken; the result says the content's size
1053
+ * and the limit. Nothing was written.
1054
+ */
1055
+ public static readonly TooLarge: CaptureOutcome;
1056
+
1285
1057
  /**
1286
1058
  * Whether the capture took a checkpoint.
1287
1059
  */
@@ -1340,6 +1112,11 @@ export declare class UnreadReason {
1340
1112
  */
1341
1113
  public static readonly InvalidName: UnreadReason;
1342
1114
 
1115
+ /**
1116
+ * The file is over 10 MiB, more than a checkpoint keeps, so its content isn't read or kept; a restore leaves it as it is.
1117
+ */
1118
+ public static readonly TooLarge: UnreadReason;
1119
+
1343
1120
  /**
1344
1121
  * The system gave an error reading the path that is about this one path only, such as a name too long for it, a network share that timed out,
1345
1122
  * or a cloud file that isn't on the computer; {@link UnreadPath.code} holds the error's code.
@@ -1421,7 +1198,8 @@ export declare class UnreadPath {
1421
1198
  *
1422
1199
  * @param value The wire form.
1423
1200
  * @returns The path.
1424
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a path.
1201
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a path: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1202
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1425
1203
  * @example
1426
1204
  * ```ts
1427
1205
  * import { UnreadPath } from "@noldova/checkpoints.protocol";
@@ -1497,7 +1275,8 @@ export declare class Checkpoint {
1497
1275
  *
1498
1276
  * @param value The wire form.
1499
1277
  * @returns The checkpoint.
1500
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a checkpoint.
1278
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a checkpoint: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1279
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1501
1280
  * @example
1502
1281
  * ```ts
1503
1282
  * import { Checkpoint } from "@noldova/checkpoints.protocol";
@@ -1528,7 +1307,7 @@ export declare class Checkpoint {
1528
1307
  */
1529
1308
  export declare class FolderReference {
1530
1309
  /**
1531
- * The identity the app owns, 1 to 64 letters, digits and `-`, such as a project's id.
1310
+ * The identity the app owns, 1 to 64 lower-case letters, digits and `-`, such as a project's id.
1532
1311
  */
1533
1312
  public readonly identity: string;
1534
1313
 
@@ -1540,7 +1319,7 @@ export declare class FolderReference {
1540
1319
  /**
1541
1320
  * @param identity The identity the app owns.
1542
1321
  * @param path The folder's absolute path on this device now.
1543
- * @throws {ProtocolException} Thrown synchronously when the identity isn't 1 to 64 letters, digits and `-`, or the path isn't absolute.
1322
+ * @throws {ProtocolException} Thrown synchronously when the identity isn't 1 to 64 lower-case letters, digits and `-`, or the path isn't absolute.
1544
1323
  * @example
1545
1324
  * ```ts
1546
1325
  * import { FolderReference } from "@noldova/checkpoints.protocol";
@@ -1556,7 +1335,8 @@ export declare class FolderReference {
1556
1335
  *
1557
1336
  * @param value The wire form.
1558
1337
  * @returns The folder.
1559
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a folder.
1338
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a folder: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1339
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1560
1340
  * @example
1561
1341
  * ```ts
1562
1342
  * import { FolderReference } from "@noldova/checkpoints.protocol";
@@ -1589,6 +1369,17 @@ export declare class CaptureRequest {
1589
1369
  */
1590
1370
  public static readonly method: string;
1591
1371
 
1372
+ /**
1373
+ * The time the checkpoint stands for, such as when an agent's turn started, or `null` for the folder as the capture reads it. A file
1374
+ * whose modification or change time is at or after it, less 2 seconds for file systems that keep times to 2 seconds, isn't read, nor is
1375
+ * one gone, rewritten or retargeted by the time it's read, nor one gone from a folder changed at or after it, nor one replaced by such a
1376
+ * folder: the checkpoint keeps the earlier checkpoint's copy,
1377
+ * or leaves the file out when that has none. So a capture taken beside the turn, which finishes after the turn changed files, keeps
1378
+ * the folder as the turn began, but for a file changed both since the earlier checkpoint and as the turn began, which it keeps as the
1379
+ * earlier checkpoint had it.
1380
+ */
1381
+ public readonly asOf: Date | null;
1382
+
1592
1383
  /**
1593
1384
  * The folder to take a checkpoint of.
1594
1385
  */
@@ -1602,7 +1393,9 @@ export declare class CaptureRequest {
1602
1393
  /**
1603
1394
  * @param folder The folder to take a checkpoint of.
1604
1395
  * @param label The label to attach, of up to 1,024 characters, or `null`.
1605
- * @throws {ProtocolException} Thrown synchronously when the label is longer than 1,024 characters.
1396
+ * @param asOf The time the checkpoint stands for, or `null`, the default, for the folder as the capture reads it; the request keeps a
1397
+ * copy.
1398
+ * @throws {ProtocolException} Thrown synchronously when the label is longer than 1,024 characters, or the time is no date.
1606
1399
  * @example
1607
1400
  * ```ts
1608
1401
  * import { CaptureRequest, FolderReference } from "@noldova/checkpoints.protocol";
@@ -1611,20 +1404,21 @@ export declare class CaptureRequest {
1611
1404
  * console.log(CaptureRequest.method, request.toJson());
1612
1405
  * ```
1613
1406
  */
1614
- public constructor(folder: FolderReference, label: string | null);
1407
+ public constructor(folder: FolderReference, label: string | null, asOf?: Date | null);
1615
1408
 
1616
1409
  /**
1617
1410
  * Reads a request from its wire form.
1618
1411
  *
1619
1412
  * @param value The wire form.
1620
1413
  * @returns The request.
1621
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
1414
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1415
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1622
1416
  * @example
1623
1417
  * ```ts
1624
1418
  * import { CaptureRequest } from "@noldova/checkpoints.protocol";
1625
1419
  *
1626
1420
  * const folderJson = { identity: "project-1", path: "/work/project" };
1627
- * const request = CaptureRequest.fromJson({ folder: folderJson, label: null });
1421
+ * const request = CaptureRequest.fromJson({ folder: folderJson, label: null, asOf: "2026-11-19T03:30:00.000Z" });
1628
1422
  * console.log(request.label);
1629
1423
  * ```
1630
1424
  */
@@ -1646,7 +1440,7 @@ export declare class CaptureRequest {
1646
1440
 
1647
1441
  /**
1648
1442
  * What a capture did: the checkpoint it took, or why it took none, with the space free and the space needed when it took none for want
1649
- * of space.
1443
+ * of space, and the content's size and its limit when it took none for having too much to write.
1650
1444
  */
1651
1445
  export declare class CaptureResult {
1652
1446
  /**
@@ -1654,6 +1448,16 @@ export declare class CaptureResult {
1654
1448
  */
1655
1449
  public readonly checkpoint: Checkpoint | null;
1656
1450
 
1451
+ /**
1452
+ * The most new and changed content a checkpoint writes, 1 GiB, when the outcome is `TooLarge`, or `null`.
1453
+ */
1454
+ public readonly contentLimit: number | null;
1455
+
1456
+ /**
1457
+ * The bytes of new and changed content the checkpoint would have written, when the outcome is `TooLarge`, or `null`.
1458
+ */
1459
+ public readonly contentSize: number | null;
1460
+
1657
1461
  /**
1658
1462
  * Whether the capture took a checkpoint.
1659
1463
  */
@@ -1674,8 +1478,10 @@ export declare class CaptureResult {
1674
1478
  * @param checkpoint The checkpoint taken, or `null` when none was.
1675
1479
  * @param spaceFree The bytes free, when the outcome is `LowDiskSpace`, or `null`.
1676
1480
  * @param spaceNeeded The bytes needed, when the outcome is `LowDiskSpace`, or `null`.
1677
- * @throws {ProtocolException} Thrown synchronously when the outcome and the checkpoint or the space disagree, or a size isn't a whole
1678
- * number of bytes.
1481
+ * @param contentSize The bytes of content to write, when the outcome is `TooLarge`, or `null`, the default.
1482
+ * @param contentLimit The content limit in bytes, when the outcome is `TooLarge`, or `null`, the default.
1483
+ * @throws {ProtocolException} Thrown synchronously when the outcome and the checkpoint, the space or the content disagree, or a size
1484
+ * isn't a whole number of bytes.
1679
1485
  * @example
1680
1486
  * ```ts
1681
1487
  * import { CaptureOutcome, CaptureResult } from "@noldova/checkpoints.protocol";
@@ -1684,19 +1490,24 @@ export declare class CaptureResult {
1684
1490
  * console.log(result.spaceNeeded);
1685
1491
  * ```
1686
1492
  */
1687
- public constructor(outcome: CaptureOutcome, checkpoint: Checkpoint | null, spaceFree: number | null, spaceNeeded: number | null);
1493
+ public constructor(
1494
+ outcome: CaptureOutcome, checkpoint: Checkpoint | null, spaceFree: number | null, spaceNeeded: number | null, contentSize?: number | null,
1495
+ contentLimit?: number | null);
1688
1496
 
1689
1497
  /**
1690
1498
  * Reads a result from its wire form.
1691
1499
  *
1692
1500
  * @param value The wire form.
1693
1501
  * @returns The result.
1694
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result.
1502
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1503
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1695
1504
  * @example
1696
1505
  * ```ts
1697
1506
  * import { CaptureResult } from "@noldova/checkpoints.protocol";
1698
1507
  *
1699
- * const result = CaptureResult.fromJson({ outcome: "FolderMissing", checkpoint: null, spaceFree: null, spaceNeeded: null });
1508
+ * const result = CaptureResult.fromJson({
1509
+ * outcome: "FolderMissing", checkpoint: null, spaceFree: null, spaceNeeded: null, contentSize: null, contentLimit: null
1510
+ * });
1700
1511
  * console.log(result.outcome.isCaptured);
1701
1512
  * ```
1702
1513
  */
@@ -1747,7 +1558,8 @@ export declare class ListRequest {
1747
1558
  *
1748
1559
  * @param value The wire form.
1749
1560
  * @returns The request.
1750
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
1561
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1562
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1751
1563
  * @example
1752
1564
  * ```ts
1753
1565
  * import { ListRequest } from "@noldova/checkpoints.protocol";
@@ -1799,7 +1611,8 @@ export declare class CheckpointList {
1799
1611
  *
1800
1612
  * @param value The wire form.
1801
1613
  * @returns The list.
1802
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a list.
1614
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a list: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1615
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1803
1616
  * @example
1804
1617
  * ```ts
1805
1618
  * import { CheckpointList } from "@noldova/checkpoints.protocol";
@@ -1984,7 +1797,8 @@ export declare class ChangeSide {
1984
1797
  *
1985
1798
  * @param value The wire form.
1986
1799
  * @returns The side.
1987
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a side.
1800
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a side: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1801
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
1988
1802
  * @example
1989
1803
  * ```ts
1990
1804
  * import { ChangeSide } from "@noldova/checkpoints.protocol";
@@ -2060,7 +1874,8 @@ export declare class Change {
2060
1874
  *
2061
1875
  * @param value The wire form.
2062
1876
  * @returns The change.
2063
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a change.
1877
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a change: it isn't an object, or a field is missing, of the wrong type or not one the model has.
1878
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2064
1879
  * @example
2065
1880
  * ```ts
2066
1881
  * import { Change } from "@noldova/checkpoints.protocol";
@@ -2094,7 +1909,7 @@ export declare class CompareOutcome {
2094
1909
  public static readonly Compared: CompareOutcome;
2095
1910
 
2096
1911
  /**
2097
- * The comparison was with the folder now, and the folder's path is missing; a missing folder is never compared as empty.
1912
+ * The comparison was with the folder now, and the folder's path is missing, or the folder was deleted or renamed while it was walked; a missing folder is never compared as empty.
2098
1913
  */
2099
1914
  public static readonly FolderMissing: CompareOutcome;
2100
1915
 
@@ -2186,7 +2001,8 @@ export declare class CompareRequest {
2186
2001
  *
2187
2002
  * @param value The wire form.
2188
2003
  * @returns The request.
2189
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
2004
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2005
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2190
2006
  * @example
2191
2007
  * ```ts
2192
2008
  * import { CompareRequest } from "@noldova/checkpoints.protocol";
@@ -2248,7 +2064,8 @@ export declare class CompareResult {
2248
2064
  *
2249
2065
  * @param value The wire form.
2250
2066
  * @returns The result.
2251
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result.
2067
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2068
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2252
2069
  * @example
2253
2070
  * ```ts
2254
2071
  * import { CompareResult } from "@noldova/checkpoints.protocol";
@@ -2299,7 +2116,8 @@ export declare class DiffTarget {
2299
2116
  *
2300
2117
  * @param value The wire form.
2301
2118
  * @returns The target.
2302
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a target.
2119
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a target: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2120
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2303
2121
  * @example
2304
2122
  * ```ts
2305
2123
  * import { DiffTarget } from "@noldova/checkpoints.protocol";
@@ -2455,7 +2273,8 @@ export declare class ReadRequest {
2455
2273
  *
2456
2274
  * @param value The wire form.
2457
2275
  * @returns The request.
2458
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
2276
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2277
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2459
2278
  * @example
2460
2279
  * ```ts
2461
2280
  * import { ReadRequest } from "@noldova/checkpoints.protocol";
@@ -2535,7 +2354,8 @@ export declare class ReadResult {
2535
2354
  *
2536
2355
  * @param value The wire form.
2537
2356
  * @returns The result.
2538
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result, such as content that isn't base64 text.
2357
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2358
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses, such as content that isn't base64 text.
2539
2359
  * @example
2540
2360
  * ```ts
2541
2361
  * import { ReadResult } from "@noldova/checkpoints.protocol";
@@ -2642,6 +2462,11 @@ export declare class KeepReason {
2642
2462
  */
2643
2463
  public static readonly LinkUnsupported: KeepReason;
2644
2464
 
2465
+ /**
2466
+ * The checkpoint didn't keep the file, since it was over 10 MiB when the checkpoint was taken.
2467
+ */
2468
+ public static readonly TooLarge: KeepReason;
2469
+
2645
2470
  /**
2646
2471
  * The reason's wire value.
2647
2472
  */
@@ -2721,7 +2546,8 @@ export declare class RestoreStep {
2721
2546
  *
2722
2547
  * @param value The wire form.
2723
2548
  * @returns The step.
2724
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a step.
2549
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a step: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2550
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2725
2551
  * @example
2726
2552
  * ```ts
2727
2553
  * import { RestoreStep } from "@noldova/checkpoints.protocol";
@@ -2778,7 +2604,8 @@ export declare class KeptPath {
2778
2604
  *
2779
2605
  * @param value The wire form.
2780
2606
  * @returns The kept path.
2781
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a kept path.
2607
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a kept path: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2608
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2782
2609
  * @example
2783
2610
  * ```ts
2784
2611
  * import { KeptPath } from "@noldova/checkpoints.protocol";
@@ -2817,6 +2644,13 @@ export declare class RestorePlan {
2817
2644
  */
2818
2645
  public readonly checkpoint: string;
2819
2646
 
2647
+ /**
2648
+ * The paths among the steps' that the restore writes as the earlier checkpoint had them, since they changed as the checkpoint's time
2649
+ * began, in their paths' byte order; such a file, if the person also changed it since the earlier checkpoint, comes back as it was
2650
+ * then rather than as the checkpoint's time found it.
2651
+ */
2652
+ public readonly earlierPaths: readonly string[];
2653
+
2820
2654
  /**
2821
2655
  * The paths the restore is limited to, as its preview asked, or `null` for the whole folder; the restore plans again with them. The
2822
2656
  * wire form always holds the paths, as `null` for the whole folder, and a wire form without them is refused.
@@ -2852,8 +2686,10 @@ export declare class RestorePlan {
2852
2686
  * @param spaceNeeded The free space in bytes the restore needs.
2853
2687
  * @param state The SHA-256 of the folder's state when planned.
2854
2688
  * @param paths The paths the restore is limited to, or `null` for the whole folder.
2689
+ * @param earlierPaths The steps' paths that the restore writes as the earlier checkpoint had them; none by default.
2855
2690
  * @throws {ProtocolException} Thrown synchronously when the id isn't a lowercase UUID version 7, a size isn't a whole number of 0 or
2856
- * more, the state isn't a lowercase SHA-256 in hexadecimal, or a path has an empty name, "." or "..", or holds "\" on any system.
2691
+ * more, the state isn't a lowercase SHA-256 in hexadecimal, a path has an empty name, "." or "..", or holds "\" on any system, or an
2692
+ * earlier path is no step's or is named twice.
2857
2693
  * @example
2858
2694
  * ```ts
2859
2695
  * import { KeepReason, KeptPath, RestorePlan } from "@noldova/checkpoints.protocol";
@@ -2866,21 +2702,24 @@ export declare class RestorePlan {
2866
2702
  */
2867
2703
  public constructor(
2868
2704
  checkpoint: string, steps: readonly RestoreStep[], stays: readonly KeptPath[], bytesToWrite: number, spaceNeeded: number, state: string,
2869
- paths: readonly string[] | null);
2705
+ paths: readonly string[] | null, earlierPaths?: readonly string[]);
2870
2706
 
2871
2707
  /**
2872
2708
  * Reads a plan from its wire form.
2873
2709
  *
2874
2710
  * @param value The wire form.
2875
2711
  * @returns The plan.
2876
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a plan.
2712
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a plan: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2713
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
2877
2714
  * @example
2878
2715
  * ```ts
2879
2716
  * import { RestorePlan } from "@noldova/checkpoints.protocol";
2880
2717
  *
2881
2718
  * const id = "01928f6e-7a3b-7c4d-8e5f-0a1b2c3d4e5f";
2882
2719
  * const state = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
2883
- * const plan = RestorePlan.fromJson({ checkpoint: id, steps: [], stays: [], bytesToWrite: 0, spaceNeeded: 0, state, paths: ["src"] });
2720
+ * const plan = RestorePlan.fromJson({
2721
+ * checkpoint: id, steps: [], stays: [], bytesToWrite: 0, spaceNeeded: 0, state, paths: ["src"], earlierPaths: []
2722
+ * });
2884
2723
  * console.log(plan.paths);
2885
2724
  * ```
2886
2725
  */
@@ -2916,7 +2755,7 @@ export declare class PreviewOutcome {
2916
2755
  public static readonly CheckpointMissing: PreviewOutcome;
2917
2756
 
2918
2757
  /**
2919
- * The folder's path is missing.
2758
+ * The folder's path is missing, or the folder was deleted or renamed while it was walked.
2920
2759
  */
2921
2760
  public static readonly FolderMissing: PreviewOutcome;
2922
2761
 
@@ -3016,7 +2855,8 @@ export declare class PreviewRequest {
3016
2855
  *
3017
2856
  * @param value The wire form.
3018
2857
  * @returns The request.
3019
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
2858
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2859
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3020
2860
  * @example
3021
2861
  * ```ts
3022
2862
  * import { PreviewRequest } from "@noldova/checkpoints.protocol";
@@ -3078,7 +2918,8 @@ export declare class PreviewResult {
3078
2918
  *
3079
2919
  * @param value The wire form.
3080
2920
  * @returns The result.
3081
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result.
2921
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
2922
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3082
2923
  * @example
3083
2924
  * ```ts
3084
2925
  * import { PreviewResult } from "@noldova/checkpoints.protocol";
@@ -3122,7 +2963,7 @@ export declare class RestoreOutcome {
3122
2963
  public static readonly CheckpointMissing: RestoreOutcome;
3123
2964
 
3124
2965
  /**
3125
- * The folder's path is missing.
2966
+ * The folder's path is missing, or the folder was deleted or renamed while it was walked; nothing was restored.
3126
2967
  */
3127
2968
  public static readonly FolderMissing: RestoreOutcome;
3128
2969
 
@@ -3142,6 +2983,12 @@ export declare class RestoreOutcome {
3142
2983
  */
3143
2984
  public static readonly RolledBack: RestoreOutcome;
3144
2985
 
2986
+ /**
2987
+ * The checkpoint taken before the restore would write over 1 GiB of new and changed content, so it wasn't taken and nothing was
2988
+ * changed; the result gives that size and the limit.
2989
+ */
2990
+ public static readonly TooLarge: RestoreOutcome;
2991
+
3145
2992
  /**
3146
2993
  * Whether the restore finished.
3147
2994
  */
@@ -3221,7 +3068,8 @@ export declare class RestoreRequest {
3221
3068
  *
3222
3069
  * @param value The wire form.
3223
3070
  * @returns The request.
3224
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
3071
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3072
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3225
3073
  * @example
3226
3074
  * ```ts
3227
3075
  * import { RestoreRequest } from "@noldova/checkpoints.protocol";
@@ -3229,7 +3077,7 @@ export declare class RestoreRequest {
3229
3077
  * const id = "01928f6e-7a3b-7c4d-8e5f-0a1b2c3d4e5f";
3230
3078
  * const state = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
3231
3079
  * const folderJson = { identity: "project-1", path: "/work/project" };
3232
- * const request = RestoreRequest.fromJson({ folder: folderJson, plan: { checkpoint: id, steps: [], stays: [], bytesToWrite: 0, spaceNeeded: 0, state, paths: null } });
3080
+ * const request = RestoreRequest.fromJson({ folder: folderJson, plan: { checkpoint: id, steps: [], stays: [], bytesToWrite: 0, spaceNeeded: 0, state, paths: null, earlierPaths: [] } });
3233
3081
  * console.log(request.plan.checkpoint);
3234
3082
  * ```
3235
3083
  */
@@ -3262,6 +3110,17 @@ export declare class RestoreResult {
3262
3110
  */
3263
3111
  public readonly before: Checkpoint | null;
3264
3112
 
3113
+ /**
3114
+ * The most new and changed content a checkpoint writes, 1 GiB, when the outcome is {@link RestoreOutcome.TooLarge}, or `null`.
3115
+ */
3116
+ public readonly contentLimit: number | null;
3117
+
3118
+ /**
3119
+ * The bytes of new and changed content the checkpoint taken before the restore would have written, when the outcome is
3120
+ * {@link RestoreOutcome.TooLarge}, or `null`.
3121
+ */
3122
+ public readonly contentSize: number | null;
3123
+
3265
3124
  /**
3266
3125
  * Whether the restore finished.
3267
3126
  */
@@ -3277,8 +3136,11 @@ export declare class RestoreResult {
3277
3136
  * @param outcome Whether the restore finished.
3278
3137
  * @param before The checkpoint taken before the restore, or `null`.
3279
3138
  * @param recovered The checkpoint that keeps what another program wrote, or `null`.
3139
+ * @param contentSize The bytes of content to write, when the outcome is {@link RestoreOutcome.TooLarge}, or `null`, the default.
3140
+ * @param contentLimit The content limit in bytes, when the outcome is {@link RestoreOutcome.TooLarge}, or `null`, the default.
3280
3141
  * @throws {ProtocolException} Thrown synchronously when the result holds a checkpoint before other than exactly when its outcome is
3281
- * {@link RestoreOutcome.Restored} or {@link RestoreOutcome.RolledBack}, or a recovered one when it isn't Restored.
3142
+ * {@link RestoreOutcome.Restored} or {@link RestoreOutcome.RolledBack}, a recovered one when it isn't Restored, or the content size
3143
+ * and its limit other than exactly when it is TooLarge, or a size isn't a whole number of bytes.
3282
3144
  * @example
3283
3145
  * ```ts
3284
3146
  * import { RestoreOutcome, RestoreResult } from "@noldova/checkpoints.protocol";
@@ -3287,19 +3149,20 @@ export declare class RestoreResult {
3287
3149
  * console.log(result.outcome.isRestored);
3288
3150
  * ```
3289
3151
  */
3290
- public constructor(outcome: RestoreOutcome, before: Checkpoint | null, recovered: Checkpoint | null);
3152
+ public constructor(outcome: RestoreOutcome, before: Checkpoint | null, recovered: Checkpoint | null, contentSize?: number | null, contentLimit?: number | null);
3291
3153
 
3292
3154
  /**
3293
3155
  * Reads a result from its wire form.
3294
3156
  *
3295
3157
  * @param value The wire form.
3296
3158
  * @returns The result.
3297
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result.
3159
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3160
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3298
3161
  * @example
3299
3162
  * ```ts
3300
3163
  * import { RestoreResult } from "@noldova/checkpoints.protocol";
3301
3164
  *
3302
- * const result = RestoreResult.fromJson({ outcome: "HeldUp", before: null, recovered: null });
3165
+ * const result = RestoreResult.fromJson({ outcome: "HeldUp", before: null, recovered: null, contentSize: null, contentLimit: null });
3303
3166
  * console.log(result.before);
3304
3167
  * ```
3305
3168
  */
@@ -3344,7 +3207,8 @@ export declare class StorageRequest {
3344
3207
  *
3345
3208
  * @param value The wire form.
3346
3209
  * @returns The request.
3347
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
3210
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3211
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3348
3212
  * @example
3349
3213
  * ```ts
3350
3214
  * import { StorageRequest } from "@noldova/checkpoints.protocol";
@@ -3389,7 +3253,7 @@ export declare class FolderUsage {
3389
3253
  public readonly path: string | null;
3390
3254
 
3391
3255
  /**
3392
- * @param identity The identity, 1 to 64 letters, digits and `-`.
3256
+ * @param identity The identity, 1 to 64 lower-case letters, digits and `-`.
3393
3257
  * @param path The folder's absolute path at its last capture, or `null`.
3394
3258
  * @param bytes The space used, a whole number of bytes, 0 or more.
3395
3259
  * @throws {ProtocolException} Thrown synchronously when the identity, the path or the size isn't valid.
@@ -3408,7 +3272,8 @@ export declare class FolderUsage {
3408
3272
  *
3409
3273
  * @param value The wire form.
3410
3274
  * @returns The folder's space used.
3411
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a folder's space used.
3275
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a folder's space used: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3276
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3412
3277
  * @example
3413
3278
  * ```ts
3414
3279
  * import { FolderUsage } from "@noldova/checkpoints.protocol";
@@ -3458,7 +3323,8 @@ export declare class StorageList {
3458
3323
  *
3459
3324
  * @param value The wire form.
3460
3325
  * @returns The list.
3461
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a list.
3326
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a list: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3327
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3462
3328
  * @example
3463
3329
  * ```ts
3464
3330
  * import { StorageList } from "@noldova/checkpoints.protocol";
@@ -3563,7 +3429,8 @@ export declare class DeleteFolderRequest {
3563
3429
  *
3564
3430
  * @param value The wire form.
3565
3431
  * @returns The request.
3566
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a request.
3432
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a request: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3433
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3567
3434
  * @example
3568
3435
  * ```ts
3569
3436
  * import { DeleteFolderRequest } from "@noldova/checkpoints.protocol";
@@ -3615,7 +3482,8 @@ export declare class DeleteFolderResult {
3615
3482
  *
3616
3483
  * @param value The wire form.
3617
3484
  * @returns The result.
3618
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of a result.
3485
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of a result: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3486
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3619
3487
  * @example
3620
3488
  * ```ts
3621
3489
  * import { DeleteFolderResult } from "@noldova/checkpoints.protocol";
@@ -3664,7 +3532,7 @@ export declare class RestoredEvent {
3664
3532
  public readonly identity: string;
3665
3533
 
3666
3534
  /**
3667
- * @param identity The folder's identity, 1 to 64 letters, digits or hyphens.
3535
+ * @param identity The folder's identity, 1 to 64 lower-case letters, digits or hyphens.
3668
3536
  * @param checkpoint The id of the checkpoint restored.
3669
3537
  * @param before The id of the checkpoint taken before the restore.
3670
3538
  * @throws {ProtocolException} Thrown synchronously when the identity or an id isn't one.
@@ -3685,7 +3553,8 @@ export declare class RestoredEvent {
3685
3553
  *
3686
3554
  * @param value The wire form.
3687
3555
  * @returns The event.
3688
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of the event.
3556
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of the event: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3557
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3689
3558
  * @example
3690
3559
  * ```ts
3691
3560
  * import { RestoredEvent } from "@noldova/checkpoints.protocol";
@@ -3739,7 +3608,7 @@ export declare class CapturePausedEvent {
3739
3608
  public readonly spaceNeeded: number;
3740
3609
 
3741
3610
  /**
3742
- * @param identity The folder's identity, 1 to 64 letters, digits or hyphens.
3611
+ * @param identity The folder's identity, 1 to 64 lower-case letters, digits or hyphens.
3743
3612
  * @param spaceFree The bytes free.
3744
3613
  * @param spaceNeeded The bytes needed.
3745
3614
  * @throws {ProtocolException} Thrown synchronously when the identity isn't one, or a size isn't a whole number of bytes.
@@ -3758,7 +3627,8 @@ export declare class CapturePausedEvent {
3758
3627
  *
3759
3628
  * @param value The wire form.
3760
3629
  * @returns The event.
3761
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of the event.
3630
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of the event: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3631
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3762
3632
  * @example
3763
3633
  * ```ts
3764
3634
  * import { CapturePausedEvent } from "@noldova/checkpoints.protocol";
@@ -3798,7 +3668,7 @@ export declare class CaptureResumedEvent {
3798
3668
  public readonly identity: string;
3799
3669
 
3800
3670
  /**
3801
- * @param identity The folder's identity, 1 to 64 letters, digits or hyphens.
3671
+ * @param identity The folder's identity, 1 to 64 lower-case letters, digits or hyphens.
3802
3672
  * @throws {ProtocolException} Thrown synchronously when the identity isn't one.
3803
3673
  * @example
3804
3674
  * ```ts
@@ -3815,7 +3685,8 @@ export declare class CaptureResumedEvent {
3815
3685
  *
3816
3686
  * @param value The wire form.
3817
3687
  * @returns The event.
3818
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of the event.
3688
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of the event: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3689
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3819
3690
  * @example
3820
3691
  * ```ts
3821
3692
  * import { CaptureResumedEvent } from "@noldova/checkpoints.protocol";
@@ -3860,7 +3731,7 @@ export declare class RestoreHeldUpEvent {
3860
3731
  public readonly paths: readonly string[];
3861
3732
 
3862
3733
  /**
3863
- * @param identity The folder's identity, 1 to 64 letters, digits or hyphens.
3734
+ * @param identity The folder's identity, 1 to 64 lower-case letters, digits or hyphens.
3864
3735
  * @param paths The paths the module couldn't change.
3865
3736
  * @throws {ProtocolException} Thrown synchronously when the identity isn't one, or a path isn't relative to the folder.
3866
3737
  * @example
@@ -3878,7 +3749,8 @@ export declare class RestoreHeldUpEvent {
3878
3749
  *
3879
3750
  * @param value The wire form.
3880
3751
  * @returns The event.
3881
- * @throws {ProtocolException} Thrown synchronously when the value isn't the wire form of the event.
3752
+ * @throws {JsonException} Thrown synchronously when the value isn't the wire form of the event: it isn't an object, or a field is missing, of the wrong type or not one the model has.
3753
+ * @throws {ProtocolException} Thrown synchronously when the wire form holds a value the model refuses.
3882
3754
  * @example
3883
3755
  * ```ts
3884
3756
  * import { RestoreHeldUpEvent } from "@noldova/checkpoints.protocol";
@@ -3901,162 +3773,3 @@ export declare class RestoreHeldUpEvent {
3901
3773
  */
3902
3774
  public toJson(): JsonObject;
3903
3775
  }
3904
-
3905
- /**
3906
- * Reads the fields of a JSON object that a model's wire form must be, failing with a {@link ProtocolException} that names the model.
3907
- */
3908
- export declare class JsonObjectReader {
3909
- /**
3910
- * @param value The value to read, which must be a JSON object.
3911
- * @param model The model's name, for the failures' messages.
3912
- * @throws {ProtocolException} Thrown synchronously when the value isn't an object.
3913
- * @example
3914
- * ```ts
3915
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3916
- *
3917
- * const reader = new JsonObjectReader({ label: "Turn 3" }, "Model");
3918
- * reader.refuseOtherFields(["label"]);
3919
- * console.log(reader.readString("label"));
3920
- * ```
3921
- */
3922
- public constructor(value: unknown, model: string);
3923
-
3924
- /**
3925
- * @param field The field's name.
3926
- * @returns The field's value.
3927
- * @throws {ProtocolException} Thrown synchronously when the object has no such field.
3928
- * @example
3929
- * ```ts
3930
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3931
- *
3932
- * const reader = new JsonObjectReader({ label: "Turn 3" }, "Model");
3933
- * console.log(reader.read("label"));
3934
- * ```
3935
- */
3936
- public read(field: string): unknown;
3937
-
3938
- /**
3939
- * @param field The field's name.
3940
- * @returns The field's `true` or `false`.
3941
- * @throws {ProtocolException} Thrown synchronously when the field is missing or is neither `true` nor `false`.
3942
- * @example
3943
- * ```ts
3944
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3945
- *
3946
- * const reader = new JsonObjectReader({ isText: true }, "Model");
3947
- * console.log(reader.readBoolean("isText"));
3948
- * ```
3949
- */
3950
- public readBoolean(field: string): boolean;
3951
-
3952
- /**
3953
- * @param field The field's name.
3954
- * @returns The field's list.
3955
- * @throws {ProtocolException} Thrown synchronously when the field is missing or isn't a list.
3956
- * @example
3957
- * ```ts
3958
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3959
- *
3960
- * const reader = new JsonObjectReader({ steps: [] }, "Model");
3961
- * console.log(reader.readList("steps").length);
3962
- * ```
3963
- */
3964
- public readList(field: string): readonly unknown[];
3965
-
3966
- /**
3967
- * @param field The field's name.
3968
- * @returns The field's number.
3969
- * @throws {ProtocolException} Thrown synchronously when the field is missing or isn't a number.
3970
- * @example
3971
- * ```ts
3972
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3973
- *
3974
- * const reader = new JsonObjectReader({ size: 1_024 }, "Model");
3975
- * console.log(reader.readNumber("size"));
3976
- * ```
3977
- */
3978
- public readNumber(field: string): number;
3979
-
3980
- /**
3981
- * @param field The field's name.
3982
- * @returns The field's number, or `null`.
3983
- * @throws {ProtocolException} Thrown synchronously when the field is missing or is neither a number nor `null`.
3984
- * @example
3985
- * ```ts
3986
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
3987
- *
3988
- * const reader = new JsonObjectReader({ size: null }, "Model");
3989
- * console.log(reader.readNumberOrNull("size"));
3990
- * ```
3991
- */
3992
- public readNumberOrNull(field: string): number | null;
3993
-
3994
- /**
3995
- * @param field The field's name.
3996
- * @returns The field's text.
3997
- * @throws {ProtocolException} Thrown synchronously when the field is missing or isn't text.
3998
- * @example
3999
- * ```ts
4000
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
4001
- *
4002
- * const reader = new JsonObjectReader({ label: "Turn 3" }, "Model");
4003
- * console.log(reader.readString("label"));
4004
- * ```
4005
- */
4006
- public readString(field: string): string;
4007
-
4008
- /**
4009
- * @param field The field's name.
4010
- * @returns The field's text, or `null`.
4011
- * @throws {ProtocolException} Thrown synchronously when the field is missing or is neither text nor `null`.
4012
- * @example
4013
- * ```ts
4014
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
4015
- *
4016
- * const reader = new JsonObjectReader({ label: null }, "Model");
4017
- * console.log(reader.readStringOrNull("label"));
4018
- * ```
4019
- */
4020
- public readStringOrNull(field: string): string | null;
4021
-
4022
- /**
4023
- * @param field The field's name.
4024
- * @returns The field's list of text.
4025
- * @throws {ProtocolException} Thrown synchronously when the field is missing or isn't a list of text.
4026
- * @example
4027
- * ```ts
4028
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
4029
- *
4030
- * const reader = new JsonObjectReader({ paths: ["src", "docs"] }, "Model");
4031
- * console.log(reader.readStringList("paths"));
4032
- * ```
4033
- */
4034
- public readStringList(field: string): readonly string[];
4035
-
4036
- /**
4037
- * @param field The field's name.
4038
- * @returns The field's list of text, or `null`.
4039
- * @throws {ProtocolException} Thrown synchronously when the field is missing or is neither a list of text nor `null`.
4040
- * @example
4041
- * ```ts
4042
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
4043
- *
4044
- * const reader = new JsonObjectReader({ paths: null }, "Model");
4045
- * console.log(reader.readStringListOrNull("paths"));
4046
- * ```
4047
- */
4048
- public readStringListOrNull(field: string): readonly string[] | null;
4049
-
4050
- /**
4051
- * @param known The fields the model has.
4052
- * @throws {ProtocolException} Thrown synchronously when the object has a field the model doesn't.
4053
- * @example
4054
- * ```ts
4055
- * import { JsonObjectReader } from "@noldova/checkpoints.protocol";
4056
- *
4057
- * const reader = new JsonObjectReader({ label: "Turn 3" }, "Model");
4058
- * reader.refuseOtherFields(["label"]);
4059
- * ```
4060
- */
4061
- public refuseOtherFields(known: readonly string[]): void;
4062
- }