@stll/folio-agents 0.2.0 → 0.4.0

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.
@@ -0,0 +1,1576 @@
1
+ import { FolioDocumentOperationBatch } from "@stll/folio-core/server";
2
+
3
+ //#region src/operation-schema.d.ts
4
+ /**
5
+ * JSON Schema for the contract's `textRange` handle (a serializable range
6
+ * over the visible text of one main-story block, as returned by `find_text`
7
+ * style tools). Shared between {@link FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA}
8
+ * and the `suggest_changes` tool schema in `tools.ts` so the two cannot
9
+ * drift. `endOffset` must be greater than `startOffset`; JSON Schema cannot
10
+ * express that relation, the parser enforces it.
11
+ */
12
+ declare const FOLIO_TEXT_RANGE_JSON_SCHEMA: {
13
+ readonly type: "object";
14
+ readonly description: string;
15
+ readonly properties: {
16
+ readonly type: {
17
+ readonly type: "string";
18
+ readonly enum: readonly ["textRange"];
19
+ };
20
+ readonly story: {
21
+ readonly type: "string";
22
+ readonly enum: readonly ["main"];
23
+ };
24
+ readonly blockId: {
25
+ readonly type: "string";
26
+ readonly minLength: 1;
27
+ };
28
+ readonly startOffset: {
29
+ readonly type: "integer";
30
+ readonly minimum: 0;
31
+ };
32
+ readonly endOffset: {
33
+ readonly type: "integer";
34
+ readonly minimum: 1;
35
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
36
+ };
37
+ readonly selectedTextHash: {
38
+ readonly type: "string";
39
+ readonly pattern: "^h[0-9a-z]+$";
40
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
41
+ };
42
+ };
43
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
44
+ readonly additionalProperties: false;
45
+ };
46
+ /**
47
+ * JSON Schema (draft-07 compatible) for ONE document operation: the full
48
+ * ten-variant union accepted by `parseFolioDocumentOperationBatch` in
49
+ * `@stll/folio-core`, one `oneOf` variant per entry in
50
+ * `FOLIO_DOCUMENT_OPERATION_TYPES`. Intended for LLM tool definitions and
51
+ * other consumers that need the contract's wire shape without re-declaring
52
+ * it; note that the `suggest_changes` tool in `tools.ts` deliberately
53
+ * narrows this union (see the comment there).
54
+ */
55
+ declare const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA: {
56
+ readonly description: string;
57
+ readonly oneOf: readonly [{
58
+ readonly type: "object";
59
+ readonly description: "Replace an exact text match inside one block.";
60
+ readonly properties: {
61
+ readonly type: {
62
+ readonly type: "string";
63
+ readonly enum: readonly ["replaceInBlock"];
64
+ };
65
+ readonly blockId: {
66
+ readonly type: "string";
67
+ readonly description: "Id of the target block, from a prior document read.";
68
+ };
69
+ readonly find: {
70
+ readonly type: "string";
71
+ readonly description: "The exact text to find within the block.";
72
+ };
73
+ readonly replace: {
74
+ readonly type: "string";
75
+ readonly description: "The replacement text.";
76
+ };
77
+ readonly comment: {
78
+ readonly type: "object";
79
+ readonly description: "A comment attached to the text affected by this operation.";
80
+ readonly properties: {
81
+ readonly text: {
82
+ readonly type: "string";
83
+ readonly description: "The comment body.";
84
+ };
85
+ };
86
+ readonly required: readonly ["text"];
87
+ readonly additionalProperties: false;
88
+ };
89
+ readonly id: {
90
+ readonly type: "string";
91
+ readonly description: string;
92
+ };
93
+ readonly severity: {
94
+ readonly type: "string";
95
+ readonly enum: readonly ["low", "medium", "high"];
96
+ readonly description: "Optional review severity for structured-review workflows.";
97
+ };
98
+ readonly area: {
99
+ readonly type: "string";
100
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
101
+ };
102
+ readonly precondition: {
103
+ readonly type: "object";
104
+ readonly description: string;
105
+ readonly properties: {
106
+ readonly blockTextHash: {
107
+ readonly type: "string";
108
+ readonly pattern: "^h[0-9a-z]+$";
109
+ readonly description: "Normalized hash of the target block's text.";
110
+ };
111
+ };
112
+ readonly required: readonly ["blockTextHash"];
113
+ readonly additionalProperties: false;
114
+ };
115
+ };
116
+ readonly required: readonly ["id", "type", "blockId", "find", "replace"];
117
+ readonly additionalProperties: false;
118
+ }, {
119
+ readonly type: "object";
120
+ readonly description: "Replace the text covered by a range handle.";
121
+ readonly properties: {
122
+ readonly type: {
123
+ readonly type: "string";
124
+ readonly enum: readonly ["replaceRange"];
125
+ };
126
+ readonly range: {
127
+ readonly type: "object";
128
+ readonly description: string;
129
+ readonly properties: {
130
+ readonly type: {
131
+ readonly type: "string";
132
+ readonly enum: readonly ["textRange"];
133
+ };
134
+ readonly story: {
135
+ readonly type: "string";
136
+ readonly enum: readonly ["main"];
137
+ };
138
+ readonly blockId: {
139
+ readonly type: "string";
140
+ readonly minLength: 1;
141
+ };
142
+ readonly startOffset: {
143
+ readonly type: "integer";
144
+ readonly minimum: 0;
145
+ };
146
+ readonly endOffset: {
147
+ readonly type: "integer";
148
+ readonly minimum: 1;
149
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
150
+ };
151
+ readonly selectedTextHash: {
152
+ readonly type: "string";
153
+ readonly pattern: "^h[0-9a-z]+$";
154
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
155
+ };
156
+ };
157
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
158
+ readonly additionalProperties: false;
159
+ };
160
+ readonly replace: {
161
+ readonly type: "string";
162
+ readonly description: "The replacement text.";
163
+ };
164
+ readonly comment: {
165
+ readonly type: "object";
166
+ readonly description: "A comment attached to the text affected by this operation.";
167
+ readonly properties: {
168
+ readonly text: {
169
+ readonly type: "string";
170
+ readonly description: "The comment body.";
171
+ };
172
+ };
173
+ readonly required: readonly ["text"];
174
+ readonly additionalProperties: false;
175
+ };
176
+ readonly id: {
177
+ readonly type: "string";
178
+ readonly description: string;
179
+ };
180
+ readonly severity: {
181
+ readonly type: "string";
182
+ readonly enum: readonly ["low", "medium", "high"];
183
+ readonly description: "Optional review severity for structured-review workflows.";
184
+ };
185
+ readonly area: {
186
+ readonly type: "string";
187
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
188
+ };
189
+ readonly precondition: {
190
+ readonly type: "object";
191
+ readonly description: string;
192
+ readonly properties: {
193
+ readonly blockTextHash: {
194
+ readonly type: "string";
195
+ readonly pattern: "^h[0-9a-z]+$";
196
+ readonly description: "Normalized hash of the target block's text.";
197
+ };
198
+ };
199
+ readonly required: readonly ["blockTextHash"];
200
+ readonly additionalProperties: false;
201
+ };
202
+ };
203
+ readonly required: readonly ["id", "type", "range", "replace"];
204
+ readonly additionalProperties: false;
205
+ }, {
206
+ readonly type: "object";
207
+ readonly description: "Attach a comment to the text covered by a range handle.";
208
+ readonly properties: {
209
+ readonly type: {
210
+ readonly type: "string";
211
+ readonly enum: readonly ["commentOnRange"];
212
+ };
213
+ readonly range: {
214
+ readonly type: "object";
215
+ readonly description: string;
216
+ readonly properties: {
217
+ readonly type: {
218
+ readonly type: "string";
219
+ readonly enum: readonly ["textRange"];
220
+ };
221
+ readonly story: {
222
+ readonly type: "string";
223
+ readonly enum: readonly ["main"];
224
+ };
225
+ readonly blockId: {
226
+ readonly type: "string";
227
+ readonly minLength: 1;
228
+ };
229
+ readonly startOffset: {
230
+ readonly type: "integer";
231
+ readonly minimum: 0;
232
+ };
233
+ readonly endOffset: {
234
+ readonly type: "integer";
235
+ readonly minimum: 1;
236
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
237
+ };
238
+ readonly selectedTextHash: {
239
+ readonly type: "string";
240
+ readonly pattern: "^h[0-9a-z]+$";
241
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
242
+ };
243
+ };
244
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
245
+ readonly additionalProperties: false;
246
+ };
247
+ readonly comment: {
248
+ readonly type: "object";
249
+ readonly description: "A comment attached to the text affected by this operation.";
250
+ readonly properties: {
251
+ readonly text: {
252
+ readonly type: "string";
253
+ readonly description: "The comment body.";
254
+ };
255
+ };
256
+ readonly required: readonly ["text"];
257
+ readonly additionalProperties: false;
258
+ };
259
+ readonly id: {
260
+ readonly type: "string";
261
+ readonly description: string;
262
+ };
263
+ readonly severity: {
264
+ readonly type: "string";
265
+ readonly enum: readonly ["low", "medium", "high"];
266
+ readonly description: "Optional review severity for structured-review workflows.";
267
+ };
268
+ readonly area: {
269
+ readonly type: "string";
270
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
271
+ };
272
+ readonly precondition: {
273
+ readonly type: "object";
274
+ readonly description: string;
275
+ readonly properties: {
276
+ readonly blockTextHash: {
277
+ readonly type: "string";
278
+ readonly pattern: "^h[0-9a-z]+$";
279
+ readonly description: "Normalized hash of the target block's text.";
280
+ };
281
+ };
282
+ readonly required: readonly ["blockTextHash"];
283
+ readonly additionalProperties: false;
284
+ };
285
+ };
286
+ readonly required: readonly ["id", "type", "range", "comment"];
287
+ readonly additionalProperties: false;
288
+ }, {
289
+ readonly type: "object";
290
+ readonly description: string;
291
+ readonly properties: {
292
+ readonly type: {
293
+ readonly type: "string";
294
+ readonly enum: readonly ["formatRange"];
295
+ };
296
+ readonly range: {
297
+ readonly type: "object";
298
+ readonly description: string;
299
+ readonly properties: {
300
+ readonly type: {
301
+ readonly type: "string";
302
+ readonly enum: readonly ["textRange"];
303
+ };
304
+ readonly story: {
305
+ readonly type: "string";
306
+ readonly enum: readonly ["main"];
307
+ };
308
+ readonly blockId: {
309
+ readonly type: "string";
310
+ readonly minLength: 1;
311
+ };
312
+ readonly startOffset: {
313
+ readonly type: "integer";
314
+ readonly minimum: 0;
315
+ };
316
+ readonly endOffset: {
317
+ readonly type: "integer";
318
+ readonly minimum: 1;
319
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
320
+ };
321
+ readonly selectedTextHash: {
322
+ readonly type: "string";
323
+ readonly pattern: "^h[0-9a-z]+$";
324
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
325
+ };
326
+ };
327
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
328
+ readonly additionalProperties: false;
329
+ };
330
+ readonly formatting: {
331
+ readonly type: "object";
332
+ readonly description: "Inline formatting to apply; at least one property is required.";
333
+ readonly properties: {
334
+ readonly bold: {
335
+ readonly type: "boolean";
336
+ };
337
+ readonly italic: {
338
+ readonly type: "boolean";
339
+ };
340
+ readonly underline: {
341
+ readonly type: "boolean";
342
+ };
343
+ };
344
+ readonly minProperties: 1;
345
+ readonly additionalProperties: false;
346
+ };
347
+ readonly id: {
348
+ readonly type: "string";
349
+ readonly description: string;
350
+ };
351
+ readonly severity: {
352
+ readonly type: "string";
353
+ readonly enum: readonly ["low", "medium", "high"];
354
+ readonly description: "Optional review severity for structured-review workflows.";
355
+ };
356
+ readonly area: {
357
+ readonly type: "string";
358
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
359
+ };
360
+ readonly precondition: {
361
+ readonly type: "object";
362
+ readonly description: string;
363
+ readonly properties: {
364
+ readonly blockTextHash: {
365
+ readonly type: "string";
366
+ readonly pattern: "^h[0-9a-z]+$";
367
+ readonly description: "Normalized hash of the target block's text.";
368
+ };
369
+ };
370
+ readonly required: readonly ["blockTextHash"];
371
+ readonly additionalProperties: false;
372
+ };
373
+ };
374
+ readonly required: readonly ["id", "type", "range", "formatting"];
375
+ readonly additionalProperties: false;
376
+ }, {
377
+ readonly type: "object";
378
+ readonly description: "Insert a new paragraph after the anchor block.";
379
+ readonly properties: {
380
+ readonly type: {
381
+ readonly type: "string";
382
+ readonly enum: readonly ["insertAfterBlock"];
383
+ };
384
+ readonly blockId: {
385
+ readonly type: "string";
386
+ readonly description: "Id of the target block, from a prior document read.";
387
+ };
388
+ readonly text: {
389
+ readonly type: "string";
390
+ readonly description: "The paragraph text to insert.";
391
+ };
392
+ readonly inheritFormatting: {
393
+ readonly type: "boolean";
394
+ readonly description: "Inherit the anchor block's formatting for the inserted paragraph.";
395
+ };
396
+ readonly pageBreakBefore: {
397
+ readonly type: "boolean";
398
+ readonly description: "Start the inserted paragraph on a new page (`pageBreakBefore`).";
399
+ };
400
+ readonly styleId: {
401
+ readonly type: "string";
402
+ readonly description: "Paragraph style id for the inserted block (e.g. \"ClauseHeading1\").";
403
+ };
404
+ readonly comment: {
405
+ readonly type: "object";
406
+ readonly description: "A comment attached to the text affected by this operation.";
407
+ readonly properties: {
408
+ readonly text: {
409
+ readonly type: "string";
410
+ readonly description: "The comment body.";
411
+ };
412
+ };
413
+ readonly required: readonly ["text"];
414
+ readonly additionalProperties: false;
415
+ };
416
+ readonly id: {
417
+ readonly type: "string";
418
+ readonly description: string;
419
+ };
420
+ readonly severity: {
421
+ readonly type: "string";
422
+ readonly enum: readonly ["low", "medium", "high"];
423
+ readonly description: "Optional review severity for structured-review workflows.";
424
+ };
425
+ readonly area: {
426
+ readonly type: "string";
427
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
428
+ };
429
+ readonly precondition: {
430
+ readonly type: "object";
431
+ readonly description: string;
432
+ readonly properties: {
433
+ readonly blockTextHash: {
434
+ readonly type: "string";
435
+ readonly pattern: "^h[0-9a-z]+$";
436
+ readonly description: "Normalized hash of the target block's text.";
437
+ };
438
+ };
439
+ readonly required: readonly ["blockTextHash"];
440
+ readonly additionalProperties: false;
441
+ };
442
+ };
443
+ readonly required: readonly ["id", "type", "blockId", "text"];
444
+ readonly additionalProperties: false;
445
+ }, {
446
+ readonly type: "object";
447
+ readonly description: "Insert a new paragraph before the anchor block.";
448
+ readonly properties: {
449
+ readonly type: {
450
+ readonly type: "string";
451
+ readonly enum: readonly ["insertBeforeBlock"];
452
+ };
453
+ readonly blockId: {
454
+ readonly type: "string";
455
+ readonly description: "Id of the target block, from a prior document read.";
456
+ };
457
+ readonly text: {
458
+ readonly type: "string";
459
+ readonly description: "The paragraph text to insert.";
460
+ };
461
+ readonly inheritFormatting: {
462
+ readonly type: "boolean";
463
+ readonly description: "Inherit the anchor block's formatting for the inserted paragraph.";
464
+ };
465
+ readonly pageBreakBefore: {
466
+ readonly type: "boolean";
467
+ readonly description: "Start the inserted paragraph on a new page (`pageBreakBefore`).";
468
+ };
469
+ readonly styleId: {
470
+ readonly type: "string";
471
+ readonly description: "Paragraph style id for the inserted block (e.g. \"ClauseHeading1\").";
472
+ };
473
+ readonly comment: {
474
+ readonly type: "object";
475
+ readonly description: "A comment attached to the text affected by this operation.";
476
+ readonly properties: {
477
+ readonly text: {
478
+ readonly type: "string";
479
+ readonly description: "The comment body.";
480
+ };
481
+ };
482
+ readonly required: readonly ["text"];
483
+ readonly additionalProperties: false;
484
+ };
485
+ readonly id: {
486
+ readonly type: "string";
487
+ readonly description: string;
488
+ };
489
+ readonly severity: {
490
+ readonly type: "string";
491
+ readonly enum: readonly ["low", "medium", "high"];
492
+ readonly description: "Optional review severity for structured-review workflows.";
493
+ };
494
+ readonly area: {
495
+ readonly type: "string";
496
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
497
+ };
498
+ readonly precondition: {
499
+ readonly type: "object";
500
+ readonly description: string;
501
+ readonly properties: {
502
+ readonly blockTextHash: {
503
+ readonly type: "string";
504
+ readonly pattern: "^h[0-9a-z]+$";
505
+ readonly description: "Normalized hash of the target block's text.";
506
+ };
507
+ };
508
+ readonly required: readonly ["blockTextHash"];
509
+ readonly additionalProperties: false;
510
+ };
511
+ };
512
+ readonly required: readonly ["id", "type", "blockId", "text"];
513
+ readonly additionalProperties: false;
514
+ }, {
515
+ readonly type: "object";
516
+ readonly description: "Replace one block's entire text.";
517
+ readonly properties: {
518
+ readonly type: {
519
+ readonly type: "string";
520
+ readonly enum: readonly ["replaceBlock"];
521
+ };
522
+ readonly blockId: {
523
+ readonly type: "string";
524
+ readonly description: "Id of the target block, from a prior document read.";
525
+ };
526
+ readonly text: {
527
+ readonly type: "string";
528
+ readonly description: "The new block text.";
529
+ };
530
+ readonly preserveFormatting: {
531
+ readonly type: "boolean";
532
+ readonly description: "Keep the block's existing formatting for the replacement text.";
533
+ };
534
+ readonly styleId: {
535
+ readonly type: "string";
536
+ readonly description: "Paragraph style id to set on the replaced block.";
537
+ };
538
+ readonly comment: {
539
+ readonly type: "object";
540
+ readonly description: "A comment attached to the text affected by this operation.";
541
+ readonly properties: {
542
+ readonly text: {
543
+ readonly type: "string";
544
+ readonly description: "The comment body.";
545
+ };
546
+ };
547
+ readonly required: readonly ["text"];
548
+ readonly additionalProperties: false;
549
+ };
550
+ readonly id: {
551
+ readonly type: "string";
552
+ readonly description: string;
553
+ };
554
+ readonly severity: {
555
+ readonly type: "string";
556
+ readonly enum: readonly ["low", "medium", "high"];
557
+ readonly description: "Optional review severity for structured-review workflows.";
558
+ };
559
+ readonly area: {
560
+ readonly type: "string";
561
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
562
+ };
563
+ readonly precondition: {
564
+ readonly type: "object";
565
+ readonly description: string;
566
+ readonly properties: {
567
+ readonly blockTextHash: {
568
+ readonly type: "string";
569
+ readonly pattern: "^h[0-9a-z]+$";
570
+ readonly description: "Normalized hash of the target block's text.";
571
+ };
572
+ };
573
+ readonly required: readonly ["blockTextHash"];
574
+ readonly additionalProperties: false;
575
+ };
576
+ };
577
+ readonly required: readonly ["id", "type", "blockId", "text"];
578
+ readonly additionalProperties: false;
579
+ }, {
580
+ readonly type: "object";
581
+ readonly description: "Delete one block.";
582
+ readonly properties: {
583
+ readonly type: {
584
+ readonly type: "string";
585
+ readonly enum: readonly ["deleteBlock"];
586
+ };
587
+ readonly blockId: {
588
+ readonly type: "string";
589
+ readonly description: "Id of the target block, from a prior document read.";
590
+ };
591
+ readonly comment: {
592
+ readonly type: "object";
593
+ readonly description: "A comment attached to the text affected by this operation.";
594
+ readonly properties: {
595
+ readonly text: {
596
+ readonly type: "string";
597
+ readonly description: "The comment body.";
598
+ };
599
+ };
600
+ readonly required: readonly ["text"];
601
+ readonly additionalProperties: false;
602
+ };
603
+ readonly id: {
604
+ readonly type: "string";
605
+ readonly description: string;
606
+ };
607
+ readonly severity: {
608
+ readonly type: "string";
609
+ readonly enum: readonly ["low", "medium", "high"];
610
+ readonly description: "Optional review severity for structured-review workflows.";
611
+ };
612
+ readonly area: {
613
+ readonly type: "string";
614
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
615
+ };
616
+ readonly precondition: {
617
+ readonly type: "object";
618
+ readonly description: string;
619
+ readonly properties: {
620
+ readonly blockTextHash: {
621
+ readonly type: "string";
622
+ readonly pattern: "^h[0-9a-z]+$";
623
+ readonly description: "Normalized hash of the target block's text.";
624
+ };
625
+ };
626
+ readonly required: readonly ["blockTextHash"];
627
+ readonly additionalProperties: false;
628
+ };
629
+ };
630
+ readonly required: readonly ["id", "type", "blockId"];
631
+ readonly additionalProperties: false;
632
+ }, {
633
+ readonly type: "object";
634
+ readonly description: "Attach a comment to one block, optionally quoting text within it.";
635
+ readonly properties: {
636
+ readonly type: {
637
+ readonly type: "string";
638
+ readonly enum: readonly ["commentOnBlock"];
639
+ };
640
+ readonly blockId: {
641
+ readonly type: "string";
642
+ readonly description: "Id of the target block, from a prior document read.";
643
+ };
644
+ readonly quote: {
645
+ readonly type: "string";
646
+ readonly description: "Exact text within the block the comment is about.";
647
+ };
648
+ readonly comment: {
649
+ readonly type: "object";
650
+ readonly description: "A comment attached to the text affected by this operation.";
651
+ readonly properties: {
652
+ readonly text: {
653
+ readonly type: "string";
654
+ readonly description: "The comment body.";
655
+ };
656
+ };
657
+ readonly required: readonly ["text"];
658
+ readonly additionalProperties: false;
659
+ };
660
+ readonly id: {
661
+ readonly type: "string";
662
+ readonly description: string;
663
+ };
664
+ readonly severity: {
665
+ readonly type: "string";
666
+ readonly enum: readonly ["low", "medium", "high"];
667
+ readonly description: "Optional review severity for structured-review workflows.";
668
+ };
669
+ readonly area: {
670
+ readonly type: "string";
671
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
672
+ };
673
+ readonly precondition: {
674
+ readonly type: "object";
675
+ readonly description: string;
676
+ readonly properties: {
677
+ readonly blockTextHash: {
678
+ readonly type: "string";
679
+ readonly pattern: "^h[0-9a-z]+$";
680
+ readonly description: "Normalized hash of the target block's text.";
681
+ };
682
+ };
683
+ readonly required: readonly ["blockTextHash"];
684
+ readonly additionalProperties: false;
685
+ };
686
+ };
687
+ readonly required: readonly ["id", "type", "blockId", "comment"];
688
+ readonly additionalProperties: false;
689
+ }, {
690
+ readonly type: "object";
691
+ readonly description: string;
692
+ readonly properties: {
693
+ readonly type: {
694
+ readonly type: "string";
695
+ readonly enum: readonly ["insertSignatureTable"];
696
+ };
697
+ readonly blockId: {
698
+ readonly type: "string";
699
+ readonly description: "Id of the target block, from a prior document read.";
700
+ };
701
+ readonly position: {
702
+ readonly type: "string";
703
+ readonly enum: readonly ["after", "before"];
704
+ readonly description: "Insert after the anchor block (default) or before it. Defaults to \"after\".";
705
+ };
706
+ readonly parties: {
707
+ readonly type: "array";
708
+ readonly description: "The signing parties, one table cell per party.";
709
+ readonly items: {
710
+ readonly type: "object";
711
+ readonly properties: {
712
+ readonly name: {
713
+ readonly type: "string";
714
+ readonly description: "Party name (rendered bold).";
715
+ };
716
+ readonly signatory: {
717
+ readonly type: "string";
718
+ readonly description: "Name of the person signing.";
719
+ };
720
+ readonly title: {
721
+ readonly type: "string";
722
+ readonly description: "Signatory title (rendered in italics).";
723
+ };
724
+ };
725
+ readonly required: readonly ["name"];
726
+ readonly additionalProperties: false;
727
+ };
728
+ };
729
+ readonly comment: {
730
+ readonly type: "object";
731
+ readonly description: "A comment attached to the text affected by this operation.";
732
+ readonly properties: {
733
+ readonly text: {
734
+ readonly type: "string";
735
+ readonly description: "The comment body.";
736
+ };
737
+ };
738
+ readonly required: readonly ["text"];
739
+ readonly additionalProperties: false;
740
+ };
741
+ readonly id: {
742
+ readonly type: "string";
743
+ readonly description: string;
744
+ };
745
+ readonly severity: {
746
+ readonly type: "string";
747
+ readonly enum: readonly ["low", "medium", "high"];
748
+ readonly description: "Optional review severity for structured-review workflows.";
749
+ };
750
+ readonly area: {
751
+ readonly type: "string";
752
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
753
+ };
754
+ readonly precondition: {
755
+ readonly type: "object";
756
+ readonly description: string;
757
+ readonly properties: {
758
+ readonly blockTextHash: {
759
+ readonly type: "string";
760
+ readonly pattern: "^h[0-9a-z]+$";
761
+ readonly description: "Normalized hash of the target block's text.";
762
+ };
763
+ };
764
+ readonly required: readonly ["blockTextHash"];
765
+ readonly additionalProperties: false;
766
+ };
767
+ };
768
+ readonly required: readonly ["id", "type", "blockId", "parties"];
769
+ readonly additionalProperties: false;
770
+ }];
771
+ };
772
+ /**
773
+ * JSON Schema (draft-07 compatible) for the versioned batch envelope accepted
774
+ * by `parseFolioDocumentOperationBatch`: `version` (always
775
+ * `FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION`), `operations`, and the
776
+ * optional `mode` / `atomic` / `dryRun` flags — the exact wire shape of
777
+ * `FolioDocumentOperationBatch`. Hand this to an LLM tool definition (or any
778
+ * JSON Schema consumer) instead of re-declaring the contract.
779
+ */
780
+ declare const FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA: {
781
+ readonly type: "object";
782
+ readonly description: string;
783
+ readonly properties: {
784
+ readonly version: {
785
+ readonly type: "integer";
786
+ readonly enum: readonly [1];
787
+ readonly description: "Document-operation contract version.";
788
+ };
789
+ readonly operations: {
790
+ readonly type: "array";
791
+ readonly description: "The operations to apply, in order.";
792
+ readonly items: {
793
+ readonly description: string;
794
+ readonly oneOf: readonly [{
795
+ readonly type: "object";
796
+ readonly description: "Replace an exact text match inside one block.";
797
+ readonly properties: {
798
+ readonly type: {
799
+ readonly type: "string";
800
+ readonly enum: readonly ["replaceInBlock"];
801
+ };
802
+ readonly blockId: {
803
+ readonly type: "string";
804
+ readonly description: "Id of the target block, from a prior document read.";
805
+ };
806
+ readonly find: {
807
+ readonly type: "string";
808
+ readonly description: "The exact text to find within the block.";
809
+ };
810
+ readonly replace: {
811
+ readonly type: "string";
812
+ readonly description: "The replacement text.";
813
+ };
814
+ readonly comment: {
815
+ readonly type: "object";
816
+ readonly description: "A comment attached to the text affected by this operation.";
817
+ readonly properties: {
818
+ readonly text: {
819
+ readonly type: "string";
820
+ readonly description: "The comment body.";
821
+ };
822
+ };
823
+ readonly required: readonly ["text"];
824
+ readonly additionalProperties: false;
825
+ };
826
+ readonly id: {
827
+ readonly type: "string";
828
+ readonly description: string;
829
+ };
830
+ readonly severity: {
831
+ readonly type: "string";
832
+ readonly enum: readonly ["low", "medium", "high"];
833
+ readonly description: "Optional review severity for structured-review workflows.";
834
+ };
835
+ readonly area: {
836
+ readonly type: "string";
837
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
838
+ };
839
+ readonly precondition: {
840
+ readonly type: "object";
841
+ readonly description: string;
842
+ readonly properties: {
843
+ readonly blockTextHash: {
844
+ readonly type: "string";
845
+ readonly pattern: "^h[0-9a-z]+$";
846
+ readonly description: "Normalized hash of the target block's text.";
847
+ };
848
+ };
849
+ readonly required: readonly ["blockTextHash"];
850
+ readonly additionalProperties: false;
851
+ };
852
+ };
853
+ readonly required: readonly ["id", "type", "blockId", "find", "replace"];
854
+ readonly additionalProperties: false;
855
+ }, {
856
+ readonly type: "object";
857
+ readonly description: "Replace the text covered by a range handle.";
858
+ readonly properties: {
859
+ readonly type: {
860
+ readonly type: "string";
861
+ readonly enum: readonly ["replaceRange"];
862
+ };
863
+ readonly range: {
864
+ readonly type: "object";
865
+ readonly description: string;
866
+ readonly properties: {
867
+ readonly type: {
868
+ readonly type: "string";
869
+ readonly enum: readonly ["textRange"];
870
+ };
871
+ readonly story: {
872
+ readonly type: "string";
873
+ readonly enum: readonly ["main"];
874
+ };
875
+ readonly blockId: {
876
+ readonly type: "string";
877
+ readonly minLength: 1;
878
+ };
879
+ readonly startOffset: {
880
+ readonly type: "integer";
881
+ readonly minimum: 0;
882
+ };
883
+ readonly endOffset: {
884
+ readonly type: "integer";
885
+ readonly minimum: 1;
886
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
887
+ };
888
+ readonly selectedTextHash: {
889
+ readonly type: "string";
890
+ readonly pattern: "^h[0-9a-z]+$";
891
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
892
+ };
893
+ };
894
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
895
+ readonly additionalProperties: false;
896
+ };
897
+ readonly replace: {
898
+ readonly type: "string";
899
+ readonly description: "The replacement text.";
900
+ };
901
+ readonly comment: {
902
+ readonly type: "object";
903
+ readonly description: "A comment attached to the text affected by this operation.";
904
+ readonly properties: {
905
+ readonly text: {
906
+ readonly type: "string";
907
+ readonly description: "The comment body.";
908
+ };
909
+ };
910
+ readonly required: readonly ["text"];
911
+ readonly additionalProperties: false;
912
+ };
913
+ readonly id: {
914
+ readonly type: "string";
915
+ readonly description: string;
916
+ };
917
+ readonly severity: {
918
+ readonly type: "string";
919
+ readonly enum: readonly ["low", "medium", "high"];
920
+ readonly description: "Optional review severity for structured-review workflows.";
921
+ };
922
+ readonly area: {
923
+ readonly type: "string";
924
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
925
+ };
926
+ readonly precondition: {
927
+ readonly type: "object";
928
+ readonly description: string;
929
+ readonly properties: {
930
+ readonly blockTextHash: {
931
+ readonly type: "string";
932
+ readonly pattern: "^h[0-9a-z]+$";
933
+ readonly description: "Normalized hash of the target block's text.";
934
+ };
935
+ };
936
+ readonly required: readonly ["blockTextHash"];
937
+ readonly additionalProperties: false;
938
+ };
939
+ };
940
+ readonly required: readonly ["id", "type", "range", "replace"];
941
+ readonly additionalProperties: false;
942
+ }, {
943
+ readonly type: "object";
944
+ readonly description: "Attach a comment to the text covered by a range handle.";
945
+ readonly properties: {
946
+ readonly type: {
947
+ readonly type: "string";
948
+ readonly enum: readonly ["commentOnRange"];
949
+ };
950
+ readonly range: {
951
+ readonly type: "object";
952
+ readonly description: string;
953
+ readonly properties: {
954
+ readonly type: {
955
+ readonly type: "string";
956
+ readonly enum: readonly ["textRange"];
957
+ };
958
+ readonly story: {
959
+ readonly type: "string";
960
+ readonly enum: readonly ["main"];
961
+ };
962
+ readonly blockId: {
963
+ readonly type: "string";
964
+ readonly minLength: 1;
965
+ };
966
+ readonly startOffset: {
967
+ readonly type: "integer";
968
+ readonly minimum: 0;
969
+ };
970
+ readonly endOffset: {
971
+ readonly type: "integer";
972
+ readonly minimum: 1;
973
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
974
+ };
975
+ readonly selectedTextHash: {
976
+ readonly type: "string";
977
+ readonly pattern: "^h[0-9a-z]+$";
978
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
979
+ };
980
+ };
981
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
982
+ readonly additionalProperties: false;
983
+ };
984
+ readonly comment: {
985
+ readonly type: "object";
986
+ readonly description: "A comment attached to the text affected by this operation.";
987
+ readonly properties: {
988
+ readonly text: {
989
+ readonly type: "string";
990
+ readonly description: "The comment body.";
991
+ };
992
+ };
993
+ readonly required: readonly ["text"];
994
+ readonly additionalProperties: false;
995
+ };
996
+ readonly id: {
997
+ readonly type: "string";
998
+ readonly description: string;
999
+ };
1000
+ readonly severity: {
1001
+ readonly type: "string";
1002
+ readonly enum: readonly ["low", "medium", "high"];
1003
+ readonly description: "Optional review severity for structured-review workflows.";
1004
+ };
1005
+ readonly area: {
1006
+ readonly type: "string";
1007
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1008
+ };
1009
+ readonly precondition: {
1010
+ readonly type: "object";
1011
+ readonly description: string;
1012
+ readonly properties: {
1013
+ readonly blockTextHash: {
1014
+ readonly type: "string";
1015
+ readonly pattern: "^h[0-9a-z]+$";
1016
+ readonly description: "Normalized hash of the target block's text.";
1017
+ };
1018
+ };
1019
+ readonly required: readonly ["blockTextHash"];
1020
+ readonly additionalProperties: false;
1021
+ };
1022
+ };
1023
+ readonly required: readonly ["id", "type", "range", "comment"];
1024
+ readonly additionalProperties: false;
1025
+ }, {
1026
+ readonly type: "object";
1027
+ readonly description: string;
1028
+ readonly properties: {
1029
+ readonly type: {
1030
+ readonly type: "string";
1031
+ readonly enum: readonly ["formatRange"];
1032
+ };
1033
+ readonly range: {
1034
+ readonly type: "object";
1035
+ readonly description: string;
1036
+ readonly properties: {
1037
+ readonly type: {
1038
+ readonly type: "string";
1039
+ readonly enum: readonly ["textRange"];
1040
+ };
1041
+ readonly story: {
1042
+ readonly type: "string";
1043
+ readonly enum: readonly ["main"];
1044
+ };
1045
+ readonly blockId: {
1046
+ readonly type: "string";
1047
+ readonly minLength: 1;
1048
+ };
1049
+ readonly startOffset: {
1050
+ readonly type: "integer";
1051
+ readonly minimum: 0;
1052
+ };
1053
+ readonly endOffset: {
1054
+ readonly type: "integer";
1055
+ readonly minimum: 1;
1056
+ readonly description: "Exclusive end offset; must be greater than `startOffset`.";
1057
+ };
1058
+ readonly selectedTextHash: {
1059
+ readonly type: "string";
1060
+ readonly pattern: "^h[0-9a-z]+$";
1061
+ readonly description: "Normalized hash of the selected text, used to detect stale ranges.";
1062
+ };
1063
+ };
1064
+ readonly required: readonly ["type", "story", "blockId", "startOffset", "endOffset", "selectedTextHash"];
1065
+ readonly additionalProperties: false;
1066
+ };
1067
+ readonly formatting: {
1068
+ readonly type: "object";
1069
+ readonly description: "Inline formatting to apply; at least one property is required.";
1070
+ readonly properties: {
1071
+ readonly bold: {
1072
+ readonly type: "boolean";
1073
+ };
1074
+ readonly italic: {
1075
+ readonly type: "boolean";
1076
+ };
1077
+ readonly underline: {
1078
+ readonly type: "boolean";
1079
+ };
1080
+ };
1081
+ readonly minProperties: 1;
1082
+ readonly additionalProperties: false;
1083
+ };
1084
+ readonly id: {
1085
+ readonly type: "string";
1086
+ readonly description: string;
1087
+ };
1088
+ readonly severity: {
1089
+ readonly type: "string";
1090
+ readonly enum: readonly ["low", "medium", "high"];
1091
+ readonly description: "Optional review severity for structured-review workflows.";
1092
+ };
1093
+ readonly area: {
1094
+ readonly type: "string";
1095
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1096
+ };
1097
+ readonly precondition: {
1098
+ readonly type: "object";
1099
+ readonly description: string;
1100
+ readonly properties: {
1101
+ readonly blockTextHash: {
1102
+ readonly type: "string";
1103
+ readonly pattern: "^h[0-9a-z]+$";
1104
+ readonly description: "Normalized hash of the target block's text.";
1105
+ };
1106
+ };
1107
+ readonly required: readonly ["blockTextHash"];
1108
+ readonly additionalProperties: false;
1109
+ };
1110
+ };
1111
+ readonly required: readonly ["id", "type", "range", "formatting"];
1112
+ readonly additionalProperties: false;
1113
+ }, {
1114
+ readonly type: "object";
1115
+ readonly description: "Insert a new paragraph after the anchor block.";
1116
+ readonly properties: {
1117
+ readonly type: {
1118
+ readonly type: "string";
1119
+ readonly enum: readonly ["insertAfterBlock"];
1120
+ };
1121
+ readonly blockId: {
1122
+ readonly type: "string";
1123
+ readonly description: "Id of the target block, from a prior document read.";
1124
+ };
1125
+ readonly text: {
1126
+ readonly type: "string";
1127
+ readonly description: "The paragraph text to insert.";
1128
+ };
1129
+ readonly inheritFormatting: {
1130
+ readonly type: "boolean";
1131
+ readonly description: "Inherit the anchor block's formatting for the inserted paragraph.";
1132
+ };
1133
+ readonly pageBreakBefore: {
1134
+ readonly type: "boolean";
1135
+ readonly description: "Start the inserted paragraph on a new page (`pageBreakBefore`).";
1136
+ };
1137
+ readonly styleId: {
1138
+ readonly type: "string";
1139
+ readonly description: "Paragraph style id for the inserted block (e.g. \"ClauseHeading1\").";
1140
+ };
1141
+ readonly comment: {
1142
+ readonly type: "object";
1143
+ readonly description: "A comment attached to the text affected by this operation.";
1144
+ readonly properties: {
1145
+ readonly text: {
1146
+ readonly type: "string";
1147
+ readonly description: "The comment body.";
1148
+ };
1149
+ };
1150
+ readonly required: readonly ["text"];
1151
+ readonly additionalProperties: false;
1152
+ };
1153
+ readonly id: {
1154
+ readonly type: "string";
1155
+ readonly description: string;
1156
+ };
1157
+ readonly severity: {
1158
+ readonly type: "string";
1159
+ readonly enum: readonly ["low", "medium", "high"];
1160
+ readonly description: "Optional review severity for structured-review workflows.";
1161
+ };
1162
+ readonly area: {
1163
+ readonly type: "string";
1164
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1165
+ };
1166
+ readonly precondition: {
1167
+ readonly type: "object";
1168
+ readonly description: string;
1169
+ readonly properties: {
1170
+ readonly blockTextHash: {
1171
+ readonly type: "string";
1172
+ readonly pattern: "^h[0-9a-z]+$";
1173
+ readonly description: "Normalized hash of the target block's text.";
1174
+ };
1175
+ };
1176
+ readonly required: readonly ["blockTextHash"];
1177
+ readonly additionalProperties: false;
1178
+ };
1179
+ };
1180
+ readonly required: readonly ["id", "type", "blockId", "text"];
1181
+ readonly additionalProperties: false;
1182
+ }, {
1183
+ readonly type: "object";
1184
+ readonly description: "Insert a new paragraph before the anchor block.";
1185
+ readonly properties: {
1186
+ readonly type: {
1187
+ readonly type: "string";
1188
+ readonly enum: readonly ["insertBeforeBlock"];
1189
+ };
1190
+ readonly blockId: {
1191
+ readonly type: "string";
1192
+ readonly description: "Id of the target block, from a prior document read.";
1193
+ };
1194
+ readonly text: {
1195
+ readonly type: "string";
1196
+ readonly description: "The paragraph text to insert.";
1197
+ };
1198
+ readonly inheritFormatting: {
1199
+ readonly type: "boolean";
1200
+ readonly description: "Inherit the anchor block's formatting for the inserted paragraph.";
1201
+ };
1202
+ readonly pageBreakBefore: {
1203
+ readonly type: "boolean";
1204
+ readonly description: "Start the inserted paragraph on a new page (`pageBreakBefore`).";
1205
+ };
1206
+ readonly styleId: {
1207
+ readonly type: "string";
1208
+ readonly description: "Paragraph style id for the inserted block (e.g. \"ClauseHeading1\").";
1209
+ };
1210
+ readonly comment: {
1211
+ readonly type: "object";
1212
+ readonly description: "A comment attached to the text affected by this operation.";
1213
+ readonly properties: {
1214
+ readonly text: {
1215
+ readonly type: "string";
1216
+ readonly description: "The comment body.";
1217
+ };
1218
+ };
1219
+ readonly required: readonly ["text"];
1220
+ readonly additionalProperties: false;
1221
+ };
1222
+ readonly id: {
1223
+ readonly type: "string";
1224
+ readonly description: string;
1225
+ };
1226
+ readonly severity: {
1227
+ readonly type: "string";
1228
+ readonly enum: readonly ["low", "medium", "high"];
1229
+ readonly description: "Optional review severity for structured-review workflows.";
1230
+ };
1231
+ readonly area: {
1232
+ readonly type: "string";
1233
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1234
+ };
1235
+ readonly precondition: {
1236
+ readonly type: "object";
1237
+ readonly description: string;
1238
+ readonly properties: {
1239
+ readonly blockTextHash: {
1240
+ readonly type: "string";
1241
+ readonly pattern: "^h[0-9a-z]+$";
1242
+ readonly description: "Normalized hash of the target block's text.";
1243
+ };
1244
+ };
1245
+ readonly required: readonly ["blockTextHash"];
1246
+ readonly additionalProperties: false;
1247
+ };
1248
+ };
1249
+ readonly required: readonly ["id", "type", "blockId", "text"];
1250
+ readonly additionalProperties: false;
1251
+ }, {
1252
+ readonly type: "object";
1253
+ readonly description: "Replace one block's entire text.";
1254
+ readonly properties: {
1255
+ readonly type: {
1256
+ readonly type: "string";
1257
+ readonly enum: readonly ["replaceBlock"];
1258
+ };
1259
+ readonly blockId: {
1260
+ readonly type: "string";
1261
+ readonly description: "Id of the target block, from a prior document read.";
1262
+ };
1263
+ readonly text: {
1264
+ readonly type: "string";
1265
+ readonly description: "The new block text.";
1266
+ };
1267
+ readonly preserveFormatting: {
1268
+ readonly type: "boolean";
1269
+ readonly description: "Keep the block's existing formatting for the replacement text.";
1270
+ };
1271
+ readonly styleId: {
1272
+ readonly type: "string";
1273
+ readonly description: "Paragraph style id to set on the replaced block.";
1274
+ };
1275
+ readonly comment: {
1276
+ readonly type: "object";
1277
+ readonly description: "A comment attached to the text affected by this operation.";
1278
+ readonly properties: {
1279
+ readonly text: {
1280
+ readonly type: "string";
1281
+ readonly description: "The comment body.";
1282
+ };
1283
+ };
1284
+ readonly required: readonly ["text"];
1285
+ readonly additionalProperties: false;
1286
+ };
1287
+ readonly id: {
1288
+ readonly type: "string";
1289
+ readonly description: string;
1290
+ };
1291
+ readonly severity: {
1292
+ readonly type: "string";
1293
+ readonly enum: readonly ["low", "medium", "high"];
1294
+ readonly description: "Optional review severity for structured-review workflows.";
1295
+ };
1296
+ readonly area: {
1297
+ readonly type: "string";
1298
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1299
+ };
1300
+ readonly precondition: {
1301
+ readonly type: "object";
1302
+ readonly description: string;
1303
+ readonly properties: {
1304
+ readonly blockTextHash: {
1305
+ readonly type: "string";
1306
+ readonly pattern: "^h[0-9a-z]+$";
1307
+ readonly description: "Normalized hash of the target block's text.";
1308
+ };
1309
+ };
1310
+ readonly required: readonly ["blockTextHash"];
1311
+ readonly additionalProperties: false;
1312
+ };
1313
+ };
1314
+ readonly required: readonly ["id", "type", "blockId", "text"];
1315
+ readonly additionalProperties: false;
1316
+ }, {
1317
+ readonly type: "object";
1318
+ readonly description: "Delete one block.";
1319
+ readonly properties: {
1320
+ readonly type: {
1321
+ readonly type: "string";
1322
+ readonly enum: readonly ["deleteBlock"];
1323
+ };
1324
+ readonly blockId: {
1325
+ readonly type: "string";
1326
+ readonly description: "Id of the target block, from a prior document read.";
1327
+ };
1328
+ readonly comment: {
1329
+ readonly type: "object";
1330
+ readonly description: "A comment attached to the text affected by this operation.";
1331
+ readonly properties: {
1332
+ readonly text: {
1333
+ readonly type: "string";
1334
+ readonly description: "The comment body.";
1335
+ };
1336
+ };
1337
+ readonly required: readonly ["text"];
1338
+ readonly additionalProperties: false;
1339
+ };
1340
+ readonly id: {
1341
+ readonly type: "string";
1342
+ readonly description: string;
1343
+ };
1344
+ readonly severity: {
1345
+ readonly type: "string";
1346
+ readonly enum: readonly ["low", "medium", "high"];
1347
+ readonly description: "Optional review severity for structured-review workflows.";
1348
+ };
1349
+ readonly area: {
1350
+ readonly type: "string";
1351
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1352
+ };
1353
+ readonly precondition: {
1354
+ readonly type: "object";
1355
+ readonly description: string;
1356
+ readonly properties: {
1357
+ readonly blockTextHash: {
1358
+ readonly type: "string";
1359
+ readonly pattern: "^h[0-9a-z]+$";
1360
+ readonly description: "Normalized hash of the target block's text.";
1361
+ };
1362
+ };
1363
+ readonly required: readonly ["blockTextHash"];
1364
+ readonly additionalProperties: false;
1365
+ };
1366
+ };
1367
+ readonly required: readonly ["id", "type", "blockId"];
1368
+ readonly additionalProperties: false;
1369
+ }, {
1370
+ readonly type: "object";
1371
+ readonly description: "Attach a comment to one block, optionally quoting text within it.";
1372
+ readonly properties: {
1373
+ readonly type: {
1374
+ readonly type: "string";
1375
+ readonly enum: readonly ["commentOnBlock"];
1376
+ };
1377
+ readonly blockId: {
1378
+ readonly type: "string";
1379
+ readonly description: "Id of the target block, from a prior document read.";
1380
+ };
1381
+ readonly quote: {
1382
+ readonly type: "string";
1383
+ readonly description: "Exact text within the block the comment is about.";
1384
+ };
1385
+ readonly comment: {
1386
+ readonly type: "object";
1387
+ readonly description: "A comment attached to the text affected by this operation.";
1388
+ readonly properties: {
1389
+ readonly text: {
1390
+ readonly type: "string";
1391
+ readonly description: "The comment body.";
1392
+ };
1393
+ };
1394
+ readonly required: readonly ["text"];
1395
+ readonly additionalProperties: false;
1396
+ };
1397
+ readonly id: {
1398
+ readonly type: "string";
1399
+ readonly description: string;
1400
+ };
1401
+ readonly severity: {
1402
+ readonly type: "string";
1403
+ readonly enum: readonly ["low", "medium", "high"];
1404
+ readonly description: "Optional review severity for structured-review workflows.";
1405
+ };
1406
+ readonly area: {
1407
+ readonly type: "string";
1408
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1409
+ };
1410
+ readonly precondition: {
1411
+ readonly type: "object";
1412
+ readonly description: string;
1413
+ readonly properties: {
1414
+ readonly blockTextHash: {
1415
+ readonly type: "string";
1416
+ readonly pattern: "^h[0-9a-z]+$";
1417
+ readonly description: "Normalized hash of the target block's text.";
1418
+ };
1419
+ };
1420
+ readonly required: readonly ["blockTextHash"];
1421
+ readonly additionalProperties: false;
1422
+ };
1423
+ };
1424
+ readonly required: readonly ["id", "type", "blockId", "comment"];
1425
+ readonly additionalProperties: false;
1426
+ }, {
1427
+ readonly type: "object";
1428
+ readonly description: string;
1429
+ readonly properties: {
1430
+ readonly type: {
1431
+ readonly type: "string";
1432
+ readonly enum: readonly ["insertSignatureTable"];
1433
+ };
1434
+ readonly blockId: {
1435
+ readonly type: "string";
1436
+ readonly description: "Id of the target block, from a prior document read.";
1437
+ };
1438
+ readonly position: {
1439
+ readonly type: "string";
1440
+ readonly enum: readonly ["after", "before"];
1441
+ readonly description: "Insert after the anchor block (default) or before it. Defaults to \"after\".";
1442
+ };
1443
+ readonly parties: {
1444
+ readonly type: "array";
1445
+ readonly description: "The signing parties, one table cell per party.";
1446
+ readonly items: {
1447
+ readonly type: "object";
1448
+ readonly properties: {
1449
+ readonly name: {
1450
+ readonly type: "string";
1451
+ readonly description: "Party name (rendered bold).";
1452
+ };
1453
+ readonly signatory: {
1454
+ readonly type: "string";
1455
+ readonly description: "Name of the person signing.";
1456
+ };
1457
+ readonly title: {
1458
+ readonly type: "string";
1459
+ readonly description: "Signatory title (rendered in italics).";
1460
+ };
1461
+ };
1462
+ readonly required: readonly ["name"];
1463
+ readonly additionalProperties: false;
1464
+ };
1465
+ };
1466
+ readonly comment: {
1467
+ readonly type: "object";
1468
+ readonly description: "A comment attached to the text affected by this operation.";
1469
+ readonly properties: {
1470
+ readonly text: {
1471
+ readonly type: "string";
1472
+ readonly description: "The comment body.";
1473
+ };
1474
+ };
1475
+ readonly required: readonly ["text"];
1476
+ readonly additionalProperties: false;
1477
+ };
1478
+ readonly id: {
1479
+ readonly type: "string";
1480
+ readonly description: string;
1481
+ };
1482
+ readonly severity: {
1483
+ readonly type: "string";
1484
+ readonly enum: readonly ["low", "medium", "high"];
1485
+ readonly description: "Optional review severity for structured-review workflows.";
1486
+ };
1487
+ readonly area: {
1488
+ readonly type: "string";
1489
+ readonly description: "Optional review area label (e.g. \"Penalty\") for structured-review workflows.";
1490
+ };
1491
+ readonly precondition: {
1492
+ readonly type: "object";
1493
+ readonly description: string;
1494
+ readonly properties: {
1495
+ readonly blockTextHash: {
1496
+ readonly type: "string";
1497
+ readonly pattern: "^h[0-9a-z]+$";
1498
+ readonly description: "Normalized hash of the target block's text.";
1499
+ };
1500
+ };
1501
+ readonly required: readonly ["blockTextHash"];
1502
+ readonly additionalProperties: false;
1503
+ };
1504
+ };
1505
+ readonly required: readonly ["id", "type", "blockId", "parties"];
1506
+ readonly additionalProperties: false;
1507
+ }];
1508
+ };
1509
+ };
1510
+ readonly mode: {
1511
+ readonly type: "string";
1512
+ readonly enum: readonly ["direct", "tracked-changes"];
1513
+ readonly description: string;
1514
+ };
1515
+ readonly atomic: {
1516
+ readonly type: "boolean";
1517
+ readonly description: "Reject the whole batch when any operation would be skipped.";
1518
+ };
1519
+ readonly dryRun: {
1520
+ readonly type: "boolean";
1521
+ readonly description: "Preview the batch without mutating the document.";
1522
+ };
1523
+ };
1524
+ readonly required: readonly ["version", "operations"];
1525
+ readonly additionalProperties: false;
1526
+ };
1527
+ /**
1528
+ * Minimal structural subset of the Standard Schema V1 interface
1529
+ * (https://standardschema.dev). Declared locally instead of depending on
1530
+ * `@standard-schema/spec` — the spec is a tiny type-only interface designed
1531
+ * to be inlined, and this keeps the package dependency-free. Consumers that
1532
+ * accept the spec type (TanStack AI, tRPC, etc.) match it structurally.
1533
+ */
1534
+ type StandardSchemaV1Issue = {
1535
+ readonly message: string;
1536
+ readonly path?: readonly PropertyKey[] | undefined;
1537
+ };
1538
+ type StandardSchemaV1Result<Output> = {
1539
+ readonly value: Output;
1540
+ readonly issues?: undefined;
1541
+ } | {
1542
+ readonly issues: readonly StandardSchemaV1Issue[];
1543
+ };
1544
+ type StandardSchemaV1<Input = unknown, Output = Input> = {
1545
+ readonly "~standard": {
1546
+ readonly version: 1;
1547
+ readonly vendor: string;
1548
+ readonly validate: (value: unknown) => StandardSchemaV1Result<Output>;
1549
+ readonly types?: {
1550
+ readonly input: Input;
1551
+ readonly output: Output;
1552
+ } | undefined;
1553
+ };
1554
+ };
1555
+ type FolioDocumentOperationBatchSchema = StandardSchemaV1<unknown, FolioDocumentOperationBatch> & {
1556
+ /**
1557
+ * The batch envelope's JSON Schema
1558
+ * ({@link FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA}), attached so tool
1559
+ * builders get the runtime validator and the LLM-facing schema from one
1560
+ * import.
1561
+ */
1562
+ readonly jsonSchema: typeof FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA;
1563
+ };
1564
+ /**
1565
+ * Standard Schema V1 (https://standardschema.dev) validator for a document
1566
+ * operation batch, for spec-aware consumers (TanStack AI tool `inputSchema`,
1567
+ * tRPC input, etc.). Delegates to `parseFolioDocumentOperationBatch` from
1568
+ * `@stll/folio-core`, so the strict parser stays the single source of truth:
1569
+ * `validate` never throws, returning `{ value }` with the parser's exact
1570
+ * output on success and `{ issues }` (message plus a key path when the parser
1571
+ * reported one) on failure. The matching LLM-facing JSON schema is attached
1572
+ * as {@link FolioDocumentOperationBatchSchema.jsonSchema}.
1573
+ */
1574
+ declare const folioDocumentOperationBatchSchema: FolioDocumentOperationBatchSchema;
1575
+ //#endregion
1576
+ export { FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, folioDocumentOperationBatchSchema };