@claritylabs/cl-sdk 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -498,6 +498,7 @@ type CoverageValueType = z.infer<typeof CoverageValueTypeSchema>;
498
498
  declare const CoverageSchema: z.ZodObject<{
499
499
  name: z.ZodString;
500
500
  limit: z.ZodString;
501
+ limitType: z.ZodOptional<z.ZodEnum<["per_occurrence", "per_claim", "aggregate", "per_person", "per_accident", "statutory", "blanket", "scheduled"]>>;
501
502
  limitValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
502
503
  deductible: z.ZodOptional<z.ZodString>;
503
504
  deductibleValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
@@ -510,6 +511,7 @@ declare const CoverageSchema: z.ZodObject<{
510
511
  limit: string;
511
512
  formNumber?: string | undefined;
512
513
  deductible?: string | undefined;
514
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
513
515
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
514
516
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
515
517
  pageNumber?: number | undefined;
@@ -520,6 +522,7 @@ declare const CoverageSchema: z.ZodObject<{
520
522
  limit: string;
521
523
  formNumber?: string | undefined;
522
524
  deductible?: string | undefined;
525
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
523
526
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
524
527
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
525
528
  pageNumber?: number | undefined;
@@ -556,6 +559,7 @@ declare const EnrichedCoverageSchema: z.ZodObject<{
556
559
  included: boolean;
557
560
  formNumber?: string | undefined;
558
561
  deductible?: string | undefined;
562
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
559
563
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
560
564
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
561
565
  pageNumber?: number | undefined;
@@ -563,7 +567,6 @@ declare const EnrichedCoverageSchema: z.ZodObject<{
563
567
  originalContent?: string | undefined;
564
568
  coverageCode?: string | undefined;
565
569
  formEditionDate?: string | undefined;
566
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
567
570
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
568
571
  sir?: string | undefined;
569
572
  sublimit?: string | undefined;
@@ -579,6 +582,7 @@ declare const EnrichedCoverageSchema: z.ZodObject<{
579
582
  included: boolean;
580
583
  formNumber?: string | undefined;
581
584
  deductible?: string | undefined;
585
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
582
586
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
583
587
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
584
588
  pageNumber?: number | undefined;
@@ -586,7 +590,6 @@ declare const EnrichedCoverageSchema: z.ZodObject<{
586
590
  originalContent?: string | undefined;
587
591
  coverageCode?: string | undefined;
588
592
  formEditionDate?: string | undefined;
589
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
590
593
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
591
594
  sir?: string | undefined;
592
595
  sublimit?: string | undefined;
@@ -6257,6 +6260,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6257
6260
  coverages: z.ZodArray<z.ZodObject<{
6258
6261
  name: z.ZodString;
6259
6262
  limit: z.ZodString;
6263
+ limitType: z.ZodOptional<z.ZodEnum<["per_occurrence", "per_claim", "aggregate", "per_person", "per_accident", "statutory", "blanket", "scheduled"]>>;
6260
6264
  limitValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
6261
6265
  deductible: z.ZodOptional<z.ZodString>;
6262
6266
  deductibleValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
@@ -6269,6 +6273,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6269
6273
  limit: string;
6270
6274
  formNumber?: string | undefined;
6271
6275
  deductible?: string | undefined;
6276
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6272
6277
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6273
6278
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6274
6279
  pageNumber?: number | undefined;
@@ -6279,6 +6284,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6279
6284
  limit: string;
6280
6285
  formNumber?: string | undefined;
6281
6286
  deductible?: string | undefined;
6287
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6282
6288
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6283
6289
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6284
6290
  pageNumber?: number | undefined;
@@ -6455,6 +6461,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6455
6461
  included: boolean;
6456
6462
  formNumber?: string | undefined;
6457
6463
  deductible?: string | undefined;
6464
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6458
6465
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6459
6466
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6460
6467
  pageNumber?: number | undefined;
@@ -6462,7 +6469,6 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6462
6469
  originalContent?: string | undefined;
6463
6470
  coverageCode?: string | undefined;
6464
6471
  formEditionDate?: string | undefined;
6465
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6466
6472
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
6467
6473
  sir?: string | undefined;
6468
6474
  sublimit?: string | undefined;
@@ -6478,6 +6484,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6478
6484
  included: boolean;
6479
6485
  formNumber?: string | undefined;
6480
6486
  deductible?: string | undefined;
6487
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6481
6488
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6482
6489
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
6483
6490
  pageNumber?: number | undefined;
@@ -6485,7 +6492,6 @@ declare const PolicyDocumentSchema: z.ZodObject<{
6485
6492
  originalContent?: string | undefined;
6486
6493
  coverageCode?: string | undefined;
6487
6494
  formEditionDate?: string | undefined;
6488
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
6489
6495
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
6490
6496
  sir?: string | undefined;
6491
6497
  sublimit?: string | undefined;
@@ -9765,6 +9771,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
9765
9771
  limit: string;
9766
9772
  formNumber?: string | undefined;
9767
9773
  deductible?: string | undefined;
9774
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
9768
9775
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
9769
9776
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
9770
9777
  pageNumber?: number | undefined;
@@ -10442,6 +10449,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
10442
10449
  included: boolean;
10443
10450
  formNumber?: string | undefined;
10444
10451
  deductible?: string | undefined;
10452
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
10445
10453
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
10446
10454
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
10447
10455
  pageNumber?: number | undefined;
@@ -10449,7 +10457,6 @@ declare const PolicyDocumentSchema: z.ZodObject<{
10449
10457
  originalContent?: string | undefined;
10450
10458
  coverageCode?: string | undefined;
10451
10459
  formEditionDate?: string | undefined;
10452
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
10453
10460
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
10454
10461
  sir?: string | undefined;
10455
10462
  sublimit?: string | undefined;
@@ -10689,6 +10696,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
10689
10696
  limit: string;
10690
10697
  formNumber?: string | undefined;
10691
10698
  deductible?: string | undefined;
10699
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
10692
10700
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
10693
10701
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
10694
10702
  pageNumber?: number | undefined;
@@ -11366,6 +11374,7 @@ declare const PolicyDocumentSchema: z.ZodObject<{
11366
11374
  included: boolean;
11367
11375
  formNumber?: string | undefined;
11368
11376
  deductible?: string | undefined;
11377
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11369
11378
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11370
11379
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11371
11380
  pageNumber?: number | undefined;
@@ -11373,7 +11382,6 @@ declare const PolicyDocumentSchema: z.ZodObject<{
11373
11382
  originalContent?: string | undefined;
11374
11383
  coverageCode?: string | undefined;
11375
11384
  formEditionDate?: string | undefined;
11376
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11377
11385
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
11378
11386
  sir?: string | undefined;
11379
11387
  sublimit?: string | undefined;
@@ -11700,6 +11708,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11700
11708
  coverages: z.ZodArray<z.ZodObject<{
11701
11709
  name: z.ZodString;
11702
11710
  limit: z.ZodString;
11711
+ limitType: z.ZodOptional<z.ZodEnum<["per_occurrence", "per_claim", "aggregate", "per_person", "per_accident", "statutory", "blanket", "scheduled"]>>;
11703
11712
  limitValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
11704
11713
  deductible: z.ZodOptional<z.ZodString>;
11705
11714
  deductibleValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
@@ -11712,6 +11721,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11712
11721
  limit: string;
11713
11722
  formNumber?: string | undefined;
11714
11723
  deductible?: string | undefined;
11724
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11715
11725
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11716
11726
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11717
11727
  pageNumber?: number | undefined;
@@ -11722,6 +11732,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11722
11732
  limit: string;
11723
11733
  formNumber?: string | undefined;
11724
11734
  deductible?: string | undefined;
11735
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11725
11736
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11726
11737
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11727
11738
  pageNumber?: number | undefined;
@@ -11898,6 +11909,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11898
11909
  included: boolean;
11899
11910
  formNumber?: string | undefined;
11900
11911
  deductible?: string | undefined;
11912
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11901
11913
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11902
11914
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11903
11915
  pageNumber?: number | undefined;
@@ -11905,7 +11917,6 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11905
11917
  originalContent?: string | undefined;
11906
11918
  coverageCode?: string | undefined;
11907
11919
  formEditionDate?: string | undefined;
11908
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11909
11920
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
11910
11921
  sir?: string | undefined;
11911
11922
  sublimit?: string | undefined;
@@ -11921,6 +11932,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11921
11932
  included: boolean;
11922
11933
  formNumber?: string | undefined;
11923
11934
  deductible?: string | undefined;
11935
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11924
11936
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11925
11937
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
11926
11938
  pageNumber?: number | undefined;
@@ -11928,7 +11940,6 @@ declare const QuoteDocumentSchema: z.ZodObject<{
11928
11940
  originalContent?: string | undefined;
11929
11941
  coverageCode?: string | undefined;
11930
11942
  formEditionDate?: string | undefined;
11931
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
11932
11943
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
11933
11944
  sir?: string | undefined;
11934
11945
  sublimit?: string | undefined;
@@ -15207,6 +15218,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
15207
15218
  limit: string;
15208
15219
  formNumber?: string | undefined;
15209
15220
  deductible?: string | undefined;
15221
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
15210
15222
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
15211
15223
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
15212
15224
  pageNumber?: number | undefined;
@@ -15880,6 +15892,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
15880
15892
  included: boolean;
15881
15893
  formNumber?: string | undefined;
15882
15894
  deductible?: string | undefined;
15895
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
15883
15896
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
15884
15897
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
15885
15898
  pageNumber?: number | undefined;
@@ -15887,7 +15900,6 @@ declare const QuoteDocumentSchema: z.ZodObject<{
15887
15900
  originalContent?: string | undefined;
15888
15901
  coverageCode?: string | undefined;
15889
15902
  formEditionDate?: string | undefined;
15890
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
15891
15903
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
15892
15904
  sir?: string | undefined;
15893
15905
  sublimit?: string | undefined;
@@ -16160,6 +16172,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
16160
16172
  limit: string;
16161
16173
  formNumber?: string | undefined;
16162
16174
  deductible?: string | undefined;
16175
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
16163
16176
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
16164
16177
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
16165
16178
  pageNumber?: number | undefined;
@@ -16833,6 +16846,7 @@ declare const QuoteDocumentSchema: z.ZodObject<{
16833
16846
  included: boolean;
16834
16847
  formNumber?: string | undefined;
16835
16848
  deductible?: string | undefined;
16849
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
16836
16850
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
16837
16851
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
16838
16852
  pageNumber?: number | undefined;
@@ -16840,7 +16854,6 @@ declare const QuoteDocumentSchema: z.ZodObject<{
16840
16854
  originalContent?: string | undefined;
16841
16855
  coverageCode?: string | undefined;
16842
16856
  formEditionDate?: string | undefined;
16843
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
16844
16857
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
16845
16858
  sir?: string | undefined;
16846
16859
  sublimit?: string | undefined;
@@ -17126,6 +17139,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17126
17139
  coverages: z.ZodArray<z.ZodObject<{
17127
17140
  name: z.ZodString;
17128
17141
  limit: z.ZodString;
17142
+ limitType: z.ZodOptional<z.ZodEnum<["per_occurrence", "per_claim", "aggregate", "per_person", "per_accident", "statutory", "blanket", "scheduled"]>>;
17129
17143
  limitValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
17130
17144
  deductible: z.ZodOptional<z.ZodString>;
17131
17145
  deductibleValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
@@ -17138,6 +17152,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17138
17152
  limit: string;
17139
17153
  formNumber?: string | undefined;
17140
17154
  deductible?: string | undefined;
17155
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17141
17156
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17142
17157
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17143
17158
  pageNumber?: number | undefined;
@@ -17148,6 +17163,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17148
17163
  limit: string;
17149
17164
  formNumber?: string | undefined;
17150
17165
  deductible?: string | undefined;
17166
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17151
17167
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17152
17168
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17153
17169
  pageNumber?: number | undefined;
@@ -17324,6 +17340,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17324
17340
  included: boolean;
17325
17341
  formNumber?: string | undefined;
17326
17342
  deductible?: string | undefined;
17343
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17327
17344
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17328
17345
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17329
17346
  pageNumber?: number | undefined;
@@ -17331,7 +17348,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17331
17348
  originalContent?: string | undefined;
17332
17349
  coverageCode?: string | undefined;
17333
17350
  formEditionDate?: string | undefined;
17334
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17335
17351
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
17336
17352
  sir?: string | undefined;
17337
17353
  sublimit?: string | undefined;
@@ -17347,6 +17363,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17347
17363
  included: boolean;
17348
17364
  formNumber?: string | undefined;
17349
17365
  deductible?: string | undefined;
17366
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17350
17367
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17351
17368
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
17352
17369
  pageNumber?: number | undefined;
@@ -17354,7 +17371,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
17354
17371
  originalContent?: string | undefined;
17355
17372
  coverageCode?: string | undefined;
17356
17373
  formEditionDate?: string | undefined;
17357
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
17358
17374
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
17359
17375
  sir?: string | undefined;
17360
17376
  sublimit?: string | undefined;
@@ -20634,6 +20650,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
20634
20650
  limit: string;
20635
20651
  formNumber?: string | undefined;
20636
20652
  deductible?: string | undefined;
20653
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
20637
20654
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
20638
20655
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
20639
20656
  pageNumber?: number | undefined;
@@ -21311,6 +21328,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
21311
21328
  included: boolean;
21312
21329
  formNumber?: string | undefined;
21313
21330
  deductible?: string | undefined;
21331
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
21314
21332
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
21315
21333
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
21316
21334
  pageNumber?: number | undefined;
@@ -21318,7 +21336,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
21318
21336
  originalContent?: string | undefined;
21319
21337
  coverageCode?: string | undefined;
21320
21338
  formEditionDate?: string | undefined;
21321
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
21322
21339
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
21323
21340
  sir?: string | undefined;
21324
21341
  sublimit?: string | undefined;
@@ -21558,6 +21575,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
21558
21575
  limit: string;
21559
21576
  formNumber?: string | undefined;
21560
21577
  deductible?: string | undefined;
21578
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
21561
21579
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
21562
21580
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
21563
21581
  pageNumber?: number | undefined;
@@ -22235,6 +22253,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22235
22253
  included: boolean;
22236
22254
  formNumber?: string | undefined;
22237
22255
  deductible?: string | undefined;
22256
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22238
22257
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22239
22258
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22240
22259
  pageNumber?: number | undefined;
@@ -22242,7 +22261,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22242
22261
  originalContent?: string | undefined;
22243
22262
  coverageCode?: string | undefined;
22244
22263
  formEditionDate?: string | undefined;
22245
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22246
22264
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
22247
22265
  sir?: string | undefined;
22248
22266
  sublimit?: string | undefined;
@@ -22567,6 +22585,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22567
22585
  coverages: z.ZodArray<z.ZodObject<{
22568
22586
  name: z.ZodString;
22569
22587
  limit: z.ZodString;
22588
+ limitType: z.ZodOptional<z.ZodEnum<["per_occurrence", "per_claim", "aggregate", "per_person", "per_accident", "statutory", "blanket", "scheduled"]>>;
22570
22589
  limitValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
22571
22590
  deductible: z.ZodOptional<z.ZodString>;
22572
22591
  deductibleValueType: z.ZodOptional<z.ZodEnum<["numeric", "included", "not_included", "as_stated", "waiting_period", "referential", "other"]>>;
@@ -22579,6 +22598,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22579
22598
  limit: string;
22580
22599
  formNumber?: string | undefined;
22581
22600
  deductible?: string | undefined;
22601
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22582
22602
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22583
22603
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22584
22604
  pageNumber?: number | undefined;
@@ -22589,6 +22609,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22589
22609
  limit: string;
22590
22610
  formNumber?: string | undefined;
22591
22611
  deductible?: string | undefined;
22612
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22592
22613
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22593
22614
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22594
22615
  pageNumber?: number | undefined;
@@ -22765,6 +22786,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22765
22786
  included: boolean;
22766
22787
  formNumber?: string | undefined;
22767
22788
  deductible?: string | undefined;
22789
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22768
22790
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22769
22791
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22770
22792
  pageNumber?: number | undefined;
@@ -22772,7 +22794,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22772
22794
  originalContent?: string | undefined;
22773
22795
  coverageCode?: string | undefined;
22774
22796
  formEditionDate?: string | undefined;
22775
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22776
22797
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
22777
22798
  sir?: string | undefined;
22778
22799
  sublimit?: string | undefined;
@@ -22788,6 +22809,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22788
22809
  included: boolean;
22789
22810
  formNumber?: string | undefined;
22790
22811
  deductible?: string | undefined;
22812
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22791
22813
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22792
22814
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
22793
22815
  pageNumber?: number | undefined;
@@ -22795,7 +22817,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
22795
22817
  originalContent?: string | undefined;
22796
22818
  coverageCode?: string | undefined;
22797
22819
  formEditionDate?: string | undefined;
22798
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
22799
22820
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
22800
22821
  sir?: string | undefined;
22801
22822
  sublimit?: string | undefined;
@@ -26074,6 +26095,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
26074
26095
  limit: string;
26075
26096
  formNumber?: string | undefined;
26076
26097
  deductible?: string | undefined;
26098
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
26077
26099
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
26078
26100
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
26079
26101
  pageNumber?: number | undefined;
@@ -26747,6 +26769,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
26747
26769
  included: boolean;
26748
26770
  formNumber?: string | undefined;
26749
26771
  deductible?: string | undefined;
26772
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
26750
26773
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
26751
26774
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
26752
26775
  pageNumber?: number | undefined;
@@ -26754,7 +26777,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
26754
26777
  originalContent?: string | undefined;
26755
26778
  coverageCode?: string | undefined;
26756
26779
  formEditionDate?: string | undefined;
26757
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
26758
26780
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
26759
26781
  sir?: string | undefined;
26760
26782
  sublimit?: string | undefined;
@@ -27027,6 +27049,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
27027
27049
  limit: string;
27028
27050
  formNumber?: string | undefined;
27029
27051
  deductible?: string | undefined;
27052
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
27030
27053
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
27031
27054
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
27032
27055
  pageNumber?: number | undefined;
@@ -27700,6 +27723,7 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
27700
27723
  included: boolean;
27701
27724
  formNumber?: string | undefined;
27702
27725
  deductible?: string | undefined;
27726
+ limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
27703
27727
  limitValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
27704
27728
  deductibleValueType?: "other" | "waiting_period" | "numeric" | "included" | "not_included" | "as_stated" | "referential" | undefined;
27705
27729
  pageNumber?: number | undefined;
@@ -27707,7 +27731,6 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
27707
27731
  originalContent?: string | undefined;
27708
27732
  coverageCode?: string | undefined;
27709
27733
  formEditionDate?: string | undefined;
27710
- limitType?: "per_occurrence" | "per_claim" | "aggregate" | "per_person" | "per_accident" | "statutory" | "blanket" | "scheduled" | undefined;
27711
27734
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
27712
27735
  sir?: string | undefined;
27713
27736
  sublimit?: string | undefined;
package/dist/index.js CHANGED
@@ -787,6 +787,7 @@ var CoverageValueTypeSchema = import_zod4.z.enum([
787
787
  var CoverageSchema = import_zod4.z.object({
788
788
  name: import_zod4.z.string(),
789
789
  limit: import_zod4.z.string(),
790
+ limitType: LimitTypeSchema.optional(),
790
791
  limitValueType: CoverageValueTypeSchema.optional(),
791
792
  deductible: import_zod4.z.string().optional(),
792
793
  deductibleValueType: CoverageValueTypeSchema.optional(),
@@ -2238,6 +2239,7 @@ function mergeCoverageLimits(existing, incoming) {
2238
2239
  const incomingCoverages = Array.isArray(incoming.coverages) ? incoming.coverages : [];
2239
2240
  const coverageKey = (coverage) => [
2240
2241
  String(coverage.name ?? "").toLowerCase(),
2242
+ String(coverage.limitType ?? "").toLowerCase(),
2241
2243
  String(coverage.limit ?? "").toLowerCase(),
2242
2244
  String(coverage.deductible ?? "").toLowerCase(),
2243
2245
  String(coverage.formNumber ?? "").toLowerCase()
@@ -3203,6 +3205,7 @@ Available extractors:
3203
3205
  - supplementary
3204
3206
 
3205
3207
  Rules:
3208
+ - Identify the broad section or form context first, then assign focused extractors within that context.
3206
3209
  - Use specific extractors for declarations, schedules, endorsements, exclusions, conditions, premium pages, and loss runs.
3207
3210
  - Use "sections" for pages that contain substantive policy text or mixed content that should still be preserved as raw sections.
3208
3211
  - Avoid assigning broad ranges mentally; decide page by page.
@@ -3213,6 +3216,8 @@ Rules:
3213
3216
  - Headings like "Limits of Insurance", "Deductible", "Coinsurance", "Loss Conditions", or "Definitions" inside a policy form usually indicate form language, not declarations or schedules.
3214
3217
  - Continuation pages near the end of a form should stay mapped to "sections" plus "conditions"/"exclusions" when applicable, even if they mention limits or deductibles.
3215
3218
  - When a form inventory entry identifies a page range as a specific form type (e.g., endorsement, coverage, application), use that classification to guide your extractor choice. Do not assign "coverage_limits" to pages the inventory identifies as endorsement or condition/exclusion forms unless the page contains actual schedule values.
3219
+ - Do not tag a page with "exclusions" or "conditions" if it only contains a table of contents, page-number reference, running header/footer, or a heading that points to another page without substantive wording.
3220
+ - If a page appears to be part of a larger exclusion, conditions, or endorsement section within the same form, keep the assignment consistent across nearby pages in that section rather than isolating a single page fragment.
3216
3221
  - Return every page in the supplied chunk exactly once.
3217
3222
 
3218
3223
  Return JSON:
@@ -3397,7 +3402,7 @@ Extract only insured-specific declaration, schedule, or endorsement entries that
3397
3402
 
3398
3403
  Focus on:
3399
3404
  - Every coverage listed on the declarations page or coverage schedule
3400
- - Per-occurrence, aggregate, and sub-limits for each coverage
3405
+ - Per-occurrence, individual/occurrence, aggregate, and sub-limits for each coverage
3401
3406
  - Deductible or self-insured retention for each coverage
3402
3407
  - Coverage form type: occurrence-based, claims-made, or accident
3403
3408
  - Retroactive date for claims-made policies
@@ -3409,6 +3414,7 @@ For EACH coverage, also extract:
3409
3414
  - pageNumber: the original page number where the coverage row/value appears
3410
3415
  - sectionRef: the declarations/schedule/endorsement section heading where it appears
3411
3416
  - originalContent: the verbatim row or short source snippet used for this coverage
3417
+ - limitType: when applicable, classify the limit as per_occurrence, per_claim, aggregate, per_person, per_accident, statutory, blanket, or scheduled
3412
3418
  - limitValueType: classify the limit as numeric, included, not_included, as_stated, waiting_period, referential, or other
3413
3419
  - deductibleValueType: classify the deductible/value term similarly when deductible is present
3414
3420
 
@@ -3420,6 +3426,7 @@ Critical rules:
3420
3426
  - If a waiting period or hour deductible is shown as part of a specific declarations/schedule row, it may be captured in deductible. Otherwise omit it.
3421
3427
  - Use limitValueType or deductibleValueType to preserve non-numeric terms precisely instead of forcing them into numeric semantics.
3422
3428
  - Preserve one row per real coverage entry. Do not merge adjacent schedule rows into malformed names.
3429
+ - Keep individual/per-occurrence limits separate from aggregate limits even when they have the same coverage name, limit amount, deductible, and form number. Use limitType to distinguish them.
3423
3430
 
3424
3431
  Return JSON only.`;
3425
3432
  }
@@ -4297,7 +4304,7 @@ function createExtractor(config) {
4297
4304
  ranges.push({ startPage: start, endPage: previous });
4298
4305
  return ranges;
4299
4306
  }
4300
- function buildPlanFromPageAssignments(pageAssignments, pageCount) {
4307
+ function buildPlanFromPageAssignments(pageAssignments, pageCount, formInventory) {
4301
4308
  const extractorPages = /* @__PURE__ */ new Map();
4302
4309
  for (const assignment of pageAssignments) {
4303
4310
  const extractors = assignment.extractorNames.length > 0 ? assignment.extractorNames : ["sections"];
@@ -4314,8 +4321,30 @@ function createExtractor(config) {
4314
4321
  extractorPages.set("sections", [...extractorPages.get("sections") ?? [], page]);
4315
4322
  }
4316
4323
  }
4324
+ const contextualExtractors = /* @__PURE__ */ new Set(["conditions", "exclusions", "endorsements"]);
4325
+ const contextualForms = (formInventory?.forms ?? []).filter(
4326
+ (form) => form.pageStart != null && (form.pageEnd ?? form.pageStart) != null
4327
+ );
4328
+ const expandPagesToFormRanges = (extractorName, pages) => {
4329
+ if (!contextualExtractors.has(extractorName)) return pages;
4330
+ const expanded = new Set(pages);
4331
+ for (const page of pages) {
4332
+ for (const form of contextualForms) {
4333
+ const pageStart = form.pageStart;
4334
+ const pageEnd = form.pageEnd ?? form.pageStart;
4335
+ const formType = form.formType;
4336
+ const supportsContextualExpansion = extractorName === "endorsements" ? formType === "endorsement" : formType === "coverage" || formType === "endorsement";
4337
+ if (!supportsContextualExpansion) continue;
4338
+ if (page < pageStart || page > pageEnd) continue;
4339
+ for (let current = pageStart; current <= pageEnd; current += 1) {
4340
+ expanded.add(current);
4341
+ }
4342
+ }
4343
+ }
4344
+ return [...expanded].sort((a, b) => a - b);
4345
+ };
4317
4346
  const tasks = [...extractorPages.entries()].flatMap(
4318
- ([extractorName, pages]) => groupContiguousPages(pages).map(({ startPage, endPage }) => ({
4347
+ ([extractorName, pages]) => groupContiguousPages(expandPagesToFormRanges(extractorName, pages)).map(({ startPage, endPage }) => ({
4319
4348
  extractorName,
4320
4349
  startPage,
4321
4350
  endPage,
@@ -4483,7 +4512,7 @@ function createExtractor(config) {
4483
4512
  onProgress?.("Resuming from checkpoint (plan complete)...");
4484
4513
  } else {
4485
4514
  onProgress?.(`Building extraction plan from page map for ${primaryType} ${documentType}...`);
4486
- plan = buildPlanFromPageAssignments(pageAssignments, pageCount);
4515
+ plan = buildPlanFromPageAssignments(pageAssignments, pageCount, formInventory);
4487
4516
  await pipelineCtx.save("plan", {
4488
4517
  id,
4489
4518
  pageCount,