@claritylabs/cl-sdk 3.2.13 → 4.1.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.
- package/README.md +10 -14
- package/dist/application.d.mts +1 -1
- package/dist/application.d.ts +1 -1
- package/dist/application.js +461 -402
- package/dist/application.js.map +1 -1
- package/dist/application.mjs +461 -402
- package/dist/application.mjs.map +1 -1
- package/dist/{index-WjheX6Dt.d.mts → index-BzrY6OMD.d.mts} +584 -261
- package/dist/{index-WjheX6Dt.d.ts → index-BzrY6OMD.d.ts} +584 -261
- package/dist/index.d.mts +103 -94
- package/dist/index.d.ts +103 -94
- package/dist/index.js +2281 -1800
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2266 -1795
- package/dist/index.mjs.map +1 -1
- package/dist/storage-sqlite.d.mts +188 -188
- package/dist/storage-sqlite.d.ts +188 -188
- package/dist/storage-sqlite.js +461 -402
- package/dist/storage-sqlite.js.map +1 -1
- package/dist/storage-sqlite.mjs +461 -402
- package/dist/storage-sqlite.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -294,57 +294,6 @@ function expectedOutputTokensFloor(taskKind, schemaTokens, expectedListLength, h
|
|
|
294
294
|
|
|
295
295
|
// src/schemas/enums.ts
|
|
296
296
|
import { z as z2 } from "zod";
|
|
297
|
-
var PolicyTypeSchema = z2.enum([
|
|
298
|
-
// Commercial lines
|
|
299
|
-
"general_liability",
|
|
300
|
-
"commercial_property",
|
|
301
|
-
"commercial_auto",
|
|
302
|
-
"non_owned_auto",
|
|
303
|
-
"workers_comp",
|
|
304
|
-
"umbrella",
|
|
305
|
-
"excess_liability",
|
|
306
|
-
"professional_liability",
|
|
307
|
-
"cyber",
|
|
308
|
-
"epli",
|
|
309
|
-
"directors_officers",
|
|
310
|
-
"fiduciary_liability",
|
|
311
|
-
"crime_fidelity",
|
|
312
|
-
"inland_marine",
|
|
313
|
-
"builders_risk",
|
|
314
|
-
"environmental",
|
|
315
|
-
"ocean_marine",
|
|
316
|
-
"surety",
|
|
317
|
-
"product_liability",
|
|
318
|
-
"bop",
|
|
319
|
-
"management_liability_package",
|
|
320
|
-
"property",
|
|
321
|
-
// Personal lines
|
|
322
|
-
"homeowners_ho3",
|
|
323
|
-
"homeowners_ho5",
|
|
324
|
-
"renters_ho4",
|
|
325
|
-
"condo_ho6",
|
|
326
|
-
"dwelling_fire",
|
|
327
|
-
"mobile_home",
|
|
328
|
-
"personal_auto",
|
|
329
|
-
"personal_umbrella",
|
|
330
|
-
"flood_nfip",
|
|
331
|
-
"flood_private",
|
|
332
|
-
"earthquake",
|
|
333
|
-
"personal_inland_marine",
|
|
334
|
-
"watercraft",
|
|
335
|
-
"recreational_vehicle",
|
|
336
|
-
"farm_ranch",
|
|
337
|
-
"life",
|
|
338
|
-
"critical_illness",
|
|
339
|
-
"disability",
|
|
340
|
-
"long_term_care",
|
|
341
|
-
"pet",
|
|
342
|
-
"travel",
|
|
343
|
-
"identity_theft",
|
|
344
|
-
"title",
|
|
345
|
-
"other"
|
|
346
|
-
]);
|
|
347
|
-
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
348
297
|
var EndorsementTypeSchema = z2.enum([
|
|
349
298
|
"additional_insured",
|
|
350
299
|
"waiver_of_subrogation",
|
|
@@ -565,85 +514,419 @@ var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
|
565
514
|
var PetSpeciesSchema = z2.enum(["dog", "cat", "other"]);
|
|
566
515
|
var PET_SPECIES = PetSpeciesSchema.options;
|
|
567
516
|
|
|
568
|
-
// src/schemas/
|
|
517
|
+
// src/schemas/lines-of-business.ts
|
|
569
518
|
import { z as z3 } from "zod";
|
|
570
|
-
var
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
519
|
+
var ACORD_LOB_CODES = [
|
|
520
|
+
"AAPPL",
|
|
521
|
+
"AGLIA",
|
|
522
|
+
"AGPP",
|
|
523
|
+
"AGPR",
|
|
524
|
+
"AIRC",
|
|
525
|
+
"AIRPFB",
|
|
526
|
+
"APKG",
|
|
527
|
+
"APKGE",
|
|
528
|
+
"APROD",
|
|
529
|
+
"ARVP",
|
|
530
|
+
"AUTO",
|
|
531
|
+
"AUTOB",
|
|
532
|
+
"AUTOP",
|
|
533
|
+
"AVPKG",
|
|
534
|
+
"BANDM",
|
|
535
|
+
"BLANK",
|
|
536
|
+
"BMISC",
|
|
537
|
+
"BOAT",
|
|
538
|
+
"BOP",
|
|
539
|
+
"BOPGL",
|
|
540
|
+
"BOPPR",
|
|
541
|
+
"CAVN",
|
|
542
|
+
"CEQFL",
|
|
543
|
+
"CFIRE",
|
|
544
|
+
"CFRM",
|
|
545
|
+
"CGL",
|
|
546
|
+
"COMAR",
|
|
547
|
+
"COMR",
|
|
548
|
+
"CONTR",
|
|
549
|
+
"CPKGE",
|
|
550
|
+
"CPMP",
|
|
551
|
+
"CRIME",
|
|
552
|
+
"DFIRE",
|
|
553
|
+
"DISAB",
|
|
554
|
+
"DO",
|
|
555
|
+
"EDP",
|
|
556
|
+
"EL",
|
|
557
|
+
"EO",
|
|
558
|
+
"EPLI",
|
|
559
|
+
"EQ",
|
|
560
|
+
"EQPFL",
|
|
561
|
+
"EXLIA",
|
|
562
|
+
"FIDTY",
|
|
563
|
+
"FIDUC",
|
|
564
|
+
"FINEA",
|
|
565
|
+
"FLOOD",
|
|
566
|
+
"GARAG",
|
|
567
|
+
"GL",
|
|
568
|
+
"GLASS",
|
|
569
|
+
"HANG",
|
|
570
|
+
"HBB",
|
|
571
|
+
"HOME",
|
|
572
|
+
"INBR",
|
|
573
|
+
"INMAR",
|
|
574
|
+
"INMRC",
|
|
575
|
+
"INMRP",
|
|
576
|
+
"JUDCL",
|
|
577
|
+
"KIDRA",
|
|
578
|
+
"LL",
|
|
579
|
+
"MHOME",
|
|
580
|
+
"MMAL",
|
|
581
|
+
"Motorcycle",
|
|
582
|
+
"MTRTK",
|
|
583
|
+
"OLIB",
|
|
584
|
+
"PHYS",
|
|
585
|
+
"PKG",
|
|
586
|
+
"PL",
|
|
587
|
+
"PLMSC",
|
|
588
|
+
"PPKGE",
|
|
589
|
+
"PROP",
|
|
590
|
+
"PROPC",
|
|
591
|
+
"PUBOF",
|
|
592
|
+
"RECV",
|
|
593
|
+
"SCHPR",
|
|
594
|
+
"SIGNS",
|
|
595
|
+
"SMP",
|
|
596
|
+
"SURE",
|
|
597
|
+
"TRANS",
|
|
598
|
+
"TRUCK",
|
|
599
|
+
"UMBRC",
|
|
600
|
+
"UMBRL",
|
|
601
|
+
"UMBRP",
|
|
602
|
+
"UN",
|
|
603
|
+
"WCMA",
|
|
604
|
+
"WIND",
|
|
605
|
+
"WORK",
|
|
606
|
+
"WORKP",
|
|
607
|
+
"WORKV"
|
|
608
|
+
];
|
|
609
|
+
var AcordLobCodeSchema = z3.enum(ACORD_LOB_CODES);
|
|
610
|
+
var ACORD_LOB_LABELS = {
|
|
611
|
+
AAPPL: "Aircraft / Aerial Applicator",
|
|
612
|
+
AGLIA: "Agricultural Liability",
|
|
613
|
+
AGPP: "Agricultural Personal Property",
|
|
614
|
+
AGPR: "Agricultural Property",
|
|
615
|
+
AIRC: "Aircraft",
|
|
616
|
+
AIRPFB: "Airport / Fixed Base Operator",
|
|
617
|
+
APKG: "Agricultural Package",
|
|
618
|
+
APKGE: "Agricultural Package (Extended)",
|
|
619
|
+
APROD: "Agricultural Products",
|
|
620
|
+
ARVP: "Recreational Vehicle Package",
|
|
621
|
+
AUTO: "Automobile",
|
|
622
|
+
AUTOB: "Business Auto",
|
|
623
|
+
AUTOP: "Personal Auto",
|
|
624
|
+
AVPKG: "Aviation Package",
|
|
625
|
+
BANDM: "Boiler & Machinery",
|
|
626
|
+
BLANK: "Blanket",
|
|
627
|
+
BMISC: "Business Miscellaneous",
|
|
628
|
+
BOAT: "Boat",
|
|
629
|
+
BOP: "Businessowners Policy",
|
|
630
|
+
BOPGL: "BOP - General Liability",
|
|
631
|
+
BOPPR: "BOP - Property",
|
|
632
|
+
CAVN: "Commercial Aviation",
|
|
633
|
+
CEQFL: "Contractors Equipment Floater",
|
|
634
|
+
CFIRE: "Commercial Fire",
|
|
635
|
+
CFRM: "Commercial Farm",
|
|
636
|
+
CGL: "Commercial General Liability",
|
|
637
|
+
COMAR: "Commercial Marine / Ocean Marine",
|
|
638
|
+
COMR: "Commercial (misc.)",
|
|
639
|
+
CONTR: "Contractors",
|
|
640
|
+
CPKGE: "Commercial Package",
|
|
641
|
+
CPMP: "Commercial Package (multi-peril)",
|
|
642
|
+
CRIME: "Crime",
|
|
643
|
+
DFIRE: "Dwelling Fire",
|
|
644
|
+
DISAB: "Disability",
|
|
645
|
+
DO: "Directors & Officers Liability",
|
|
646
|
+
EDP: "Electronic Data Processing",
|
|
647
|
+
EL: "Employers Liability",
|
|
648
|
+
EO: "Errors & Omissions",
|
|
649
|
+
EPLI: "Employment Practices Liability",
|
|
650
|
+
EQ: "Earthquake",
|
|
651
|
+
EQPFL: "Equipment Floater",
|
|
652
|
+
EXLIA: "Excess Liability",
|
|
653
|
+
FIDTY: "Fidelity",
|
|
654
|
+
FIDUC: "Fiduciary Liability",
|
|
655
|
+
FINEA: "Fine Arts",
|
|
656
|
+
FLOOD: "Flood",
|
|
657
|
+
GARAG: "Garage",
|
|
658
|
+
GL: "General Liability",
|
|
659
|
+
GLASS: "Glass",
|
|
660
|
+
HANG: "Hangar (Aviation)",
|
|
661
|
+
HBB: "Home-Based Business",
|
|
662
|
+
HOME: "Homeowners",
|
|
663
|
+
INBR: "Inland Marine - Brokers",
|
|
664
|
+
INMAR: "Inland Marine",
|
|
665
|
+
INMRC: "Inland Marine - Commercial",
|
|
666
|
+
INMRP: "Inland Marine - Personal",
|
|
667
|
+
JUDCL: "Judicial Bonds",
|
|
668
|
+
KIDRA: "Kidnap & Ransom",
|
|
669
|
+
LL: "Liquor Liability",
|
|
670
|
+
MHOME: "Mobile Home",
|
|
671
|
+
MMAL: "Medical Malpractice",
|
|
672
|
+
Motorcycle: "Motorcycle",
|
|
673
|
+
MTRTK: "Motor Truck Cargo",
|
|
674
|
+
OLIB: "Other Liability",
|
|
675
|
+
PHYS: "Physical Damage",
|
|
676
|
+
PKG: "Package",
|
|
677
|
+
PL: "Professional Liability",
|
|
678
|
+
PLMSC: "Personal Lines Miscellaneous",
|
|
679
|
+
PPKGE: "Personal Package",
|
|
680
|
+
PROP: "Property",
|
|
681
|
+
PROPC: "Property - Commercial",
|
|
682
|
+
PUBOF: "Public Officials Liability",
|
|
683
|
+
RECV: "Recreational Vehicle",
|
|
684
|
+
SCHPR: "Scheduled Property",
|
|
685
|
+
SIGNS: "Signs",
|
|
686
|
+
SMP: "Special Multi-Peril",
|
|
687
|
+
SURE: "Surety",
|
|
688
|
+
TRANS: "Transportation",
|
|
689
|
+
TRUCK: "Trucking",
|
|
690
|
+
UMBRC: "Umbrella - Commercial",
|
|
691
|
+
UMBRL: "Umbrella",
|
|
692
|
+
UMBRP: "Umbrella - Personal",
|
|
693
|
+
UN: "Unspecified / Unknown",
|
|
694
|
+
WCMA: "Workers Comp - Monopolistic/State",
|
|
695
|
+
WIND: "Wind",
|
|
696
|
+
WORK: "Workers Compensation",
|
|
697
|
+
WORKP: "Workers Compensation (Personal/Package)",
|
|
698
|
+
WORKV: "Workers Compensation (Voluntary)"
|
|
699
|
+
};
|
|
700
|
+
var EXCLUDED_ACORD_LOB_CODES = /* @__PURE__ */ new Set([
|
|
701
|
+
"ACHE",
|
|
702
|
+
"INTER",
|
|
703
|
+
"LICPT",
|
|
704
|
+
"LSTIN",
|
|
705
|
+
"NWFGR",
|
|
706
|
+
"PAPER",
|
|
707
|
+
"SCAP",
|
|
708
|
+
"SFRNC"
|
|
709
|
+
]);
|
|
710
|
+
var LEGACY_POLICY_TYPE_TO_LOB = {
|
|
711
|
+
general_liability: ["CGL"],
|
|
712
|
+
commercial_property: ["PROPC"],
|
|
713
|
+
commercial_auto: ["AUTOB"],
|
|
714
|
+
non_owned_auto: ["AUTOB"],
|
|
715
|
+
workers_comp: ["WORK"],
|
|
716
|
+
umbrella: ["UMBRC"],
|
|
717
|
+
excess_liability: ["EXLIA"],
|
|
718
|
+
professional_liability: ["EO"],
|
|
719
|
+
cyber: ["OLIB"],
|
|
720
|
+
epli: ["EPLI"],
|
|
721
|
+
directors_officers: ["DO"],
|
|
722
|
+
fiduciary_liability: ["FIDUC"],
|
|
723
|
+
crime_fidelity: ["CRIME"],
|
|
724
|
+
inland_marine: ["INMRC"],
|
|
725
|
+
builders_risk: ["INMRC"],
|
|
726
|
+
environmental: ["OLIB"],
|
|
727
|
+
ocean_marine: ["COMAR"],
|
|
728
|
+
surety: ["SURE"],
|
|
729
|
+
product_liability: ["OLIB"],
|
|
730
|
+
bop: ["BOP"],
|
|
731
|
+
management_liability_package: ["DO", "EPLI", "FIDUC"],
|
|
732
|
+
property: ["PROP"],
|
|
733
|
+
homeowners_ho3: ["HOME"],
|
|
734
|
+
homeowners_ho5: ["HOME"],
|
|
735
|
+
renters_ho4: ["HOME"],
|
|
736
|
+
condo_ho6: ["HOME"],
|
|
737
|
+
dwelling_fire: ["DFIRE"],
|
|
738
|
+
mobile_home: ["MHOME"],
|
|
739
|
+
personal_auto: ["AUTOP"],
|
|
740
|
+
personal_umbrella: ["UMBRP"],
|
|
741
|
+
flood_nfip: ["FLOOD"],
|
|
742
|
+
flood_private: ["FLOOD"],
|
|
743
|
+
earthquake: ["EQ"],
|
|
744
|
+
personal_inland_marine: ["INMRP"],
|
|
745
|
+
watercraft: ["BOAT"],
|
|
746
|
+
recreational_vehicle: ["RECV"],
|
|
747
|
+
farm_ranch: ["CFRM"],
|
|
748
|
+
life: ["UN"],
|
|
749
|
+
critical_illness: ["DISAB"],
|
|
750
|
+
disability: ["DISAB"],
|
|
751
|
+
long_term_care: ["UN"],
|
|
752
|
+
pet: ["UN"],
|
|
753
|
+
travel: ["UN"],
|
|
754
|
+
identity_theft: ["UN"],
|
|
755
|
+
title: ["UN"],
|
|
756
|
+
other: ["UN"],
|
|
757
|
+
unknown: ["UN"],
|
|
758
|
+
auto: ["AUTOB"],
|
|
759
|
+
crime: ["CRIME"],
|
|
760
|
+
crim: ["CRIME"],
|
|
761
|
+
fiduciary: ["FIDUC"],
|
|
762
|
+
d_and_o: ["DO"],
|
|
763
|
+
d_o: ["DO"],
|
|
764
|
+
homeowners: ["HOME"],
|
|
765
|
+
renters: ["HOME"],
|
|
766
|
+
flood: ["FLOOD"],
|
|
767
|
+
boat: ["BOAT"],
|
|
768
|
+
motorcycle: ["Motorcycle"]
|
|
769
|
+
};
|
|
770
|
+
var PERSONAL_LOB_CODES = /* @__PURE__ */ new Set([
|
|
771
|
+
"AUTOP",
|
|
772
|
+
"HOME",
|
|
773
|
+
"MHOME",
|
|
774
|
+
"DFIRE",
|
|
775
|
+
"FLOOD",
|
|
776
|
+
"EQ",
|
|
777
|
+
"INMRP",
|
|
778
|
+
"UMBRP",
|
|
779
|
+
"BOAT",
|
|
780
|
+
"RECV",
|
|
781
|
+
"Motorcycle",
|
|
782
|
+
"PPKGE",
|
|
783
|
+
"DISAB",
|
|
784
|
+
"PLMSC",
|
|
785
|
+
"HBB"
|
|
786
|
+
]);
|
|
787
|
+
function hasOwn(object, key) {
|
|
788
|
+
return Object.prototype.hasOwnProperty.call(object, key);
|
|
789
|
+
}
|
|
790
|
+
function canonicalLegacyKey(value) {
|
|
791
|
+
return value.trim().toLowerCase().replace(/&/g, " and ").replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").replace(/_+/g, "_");
|
|
792
|
+
}
|
|
793
|
+
function humanize(value) {
|
|
794
|
+
return value.trim().replace(/[_-]+/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
795
|
+
}
|
|
796
|
+
function isLobCode(value) {
|
|
797
|
+
return typeof value === "string" && hasOwn(ACORD_LOB_LABELS, value);
|
|
798
|
+
}
|
|
799
|
+
function resolveLobCode(value) {
|
|
800
|
+
const trimmed = value.trim();
|
|
801
|
+
if (!trimmed) return void 0;
|
|
802
|
+
if (isLobCode(trimmed)) return trimmed;
|
|
803
|
+
if (trimmed.toLowerCase() === "motorcycle") return "Motorcycle";
|
|
804
|
+
const legacy = LEGACY_POLICY_TYPE_TO_LOB[canonicalLegacyKey(trimmed)];
|
|
805
|
+
if (legacy?.[0]) return legacy[0];
|
|
806
|
+
const upper = trimmed.toUpperCase();
|
|
807
|
+
if (upper === "CRIM") return "CRIME";
|
|
808
|
+
if (isLobCode(upper)) return upper;
|
|
809
|
+
return void 0;
|
|
810
|
+
}
|
|
811
|
+
function normalizeOperationalLinesOfBusiness(values) {
|
|
812
|
+
const source = Array.isArray(values) ? values.filter((value) => typeof value === "string" && value.trim().length > 0) : [];
|
|
813
|
+
return toLobCodes(source);
|
|
814
|
+
}
|
|
815
|
+
function toLobCodes(values) {
|
|
816
|
+
const source = values?.filter((value) => typeof value === "string" && value.trim()) ?? [];
|
|
817
|
+
if (source.length === 0) return ["UN"];
|
|
818
|
+
const codes = [];
|
|
819
|
+
for (const value of source) {
|
|
820
|
+
const trimmed = value.trim();
|
|
821
|
+
if (isLobCode(trimmed)) {
|
|
822
|
+
codes.push(trimmed);
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
if (trimmed.toUpperCase() === "CRIM") {
|
|
826
|
+
codes.push("CRIME");
|
|
827
|
+
continue;
|
|
828
|
+
}
|
|
829
|
+
const mapped = LEGACY_POLICY_TYPE_TO_LOB[canonicalLegacyKey(trimmed)];
|
|
830
|
+
if (mapped) {
|
|
831
|
+
codes.push(...mapped);
|
|
832
|
+
continue;
|
|
833
|
+
}
|
|
834
|
+
const upper = trimmed.toUpperCase();
|
|
835
|
+
if (isLobCode(upper)) {
|
|
836
|
+
codes.push(upper);
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
codes.push("UN");
|
|
840
|
+
}
|
|
841
|
+
return Array.from(new Set(codes));
|
|
842
|
+
}
|
|
843
|
+
function lobLabel(value) {
|
|
844
|
+
const code = resolveLobCode(value);
|
|
845
|
+
return code ? ACORD_LOB_LABELS[code] : humanize(value);
|
|
846
|
+
}
|
|
847
|
+
function isPersonalLob(code) {
|
|
848
|
+
return isLobCode(code) && PERSONAL_LOB_CODES.has(code);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// src/schemas/shared.ts
|
|
852
|
+
import { z as z4 } from "zod";
|
|
853
|
+
var SourceProvenanceSchema = z4.object({
|
|
854
|
+
sourceSpanIds: z4.array(z4.string().min(1)).min(1),
|
|
855
|
+
documentNodeId: z4.string().optional(),
|
|
856
|
+
sourceTextHash: z4.string().optional(),
|
|
857
|
+
pageStart: z4.number().int().positive().optional(),
|
|
858
|
+
pageEnd: z4.number().int().positive().optional()
|
|
859
|
+
});
|
|
860
|
+
var AddressSchema = z4.object({
|
|
861
|
+
street1: z4.string(),
|
|
862
|
+
street2: z4.string().optional(),
|
|
863
|
+
city: z4.string(),
|
|
864
|
+
state: z4.string(),
|
|
865
|
+
zip: z4.string(),
|
|
866
|
+
country: z4.string().optional()
|
|
584
867
|
});
|
|
585
868
|
var SourceBackedAddressSchema = AddressSchema.merge(SourceProvenanceSchema);
|
|
586
|
-
var ContactSchema =
|
|
587
|
-
name:
|
|
588
|
-
title:
|
|
589
|
-
type:
|
|
590
|
-
phone:
|
|
591
|
-
fax:
|
|
592
|
-
email:
|
|
869
|
+
var ContactSchema = z4.object({
|
|
870
|
+
name: z4.string().optional(),
|
|
871
|
+
title: z4.string().optional(),
|
|
872
|
+
type: z4.string().optional(),
|
|
873
|
+
phone: z4.string().optional(),
|
|
874
|
+
fax: z4.string().optional(),
|
|
875
|
+
email: z4.string().optional(),
|
|
593
876
|
address: AddressSchema.optional(),
|
|
594
|
-
hours:
|
|
877
|
+
hours: z4.string().optional()
|
|
595
878
|
}).merge(SourceProvenanceSchema);
|
|
596
|
-
var FormReferenceSchema =
|
|
597
|
-
formNumber:
|
|
598
|
-
editionDate:
|
|
599
|
-
title:
|
|
600
|
-
formType:
|
|
601
|
-
pageStart:
|
|
602
|
-
pageEnd:
|
|
603
|
-
documentNodeId:
|
|
604
|
-
sourceSpanIds:
|
|
605
|
-
sourceTextHash:
|
|
606
|
-
});
|
|
607
|
-
var TaxFeeItemSchema =
|
|
608
|
-
name:
|
|
609
|
-
amount:
|
|
610
|
-
amountValue:
|
|
611
|
-
type:
|
|
612
|
-
description:
|
|
613
|
-
documentNodeId:
|
|
614
|
-
sourceSpanIds:
|
|
615
|
-
sourceTextHash:
|
|
616
|
-
});
|
|
617
|
-
var RatingBasisSchema =
|
|
879
|
+
var FormReferenceSchema = z4.object({
|
|
880
|
+
formNumber: z4.string(),
|
|
881
|
+
editionDate: z4.string().optional(),
|
|
882
|
+
title: z4.string().optional(),
|
|
883
|
+
formType: z4.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"]),
|
|
884
|
+
pageStart: z4.number().optional(),
|
|
885
|
+
pageEnd: z4.number().optional(),
|
|
886
|
+
documentNodeId: z4.string().optional(),
|
|
887
|
+
sourceSpanIds: z4.array(z4.string()).optional(),
|
|
888
|
+
sourceTextHash: z4.string().optional()
|
|
889
|
+
});
|
|
890
|
+
var TaxFeeItemSchema = z4.object({
|
|
891
|
+
name: z4.string(),
|
|
892
|
+
amount: z4.string(),
|
|
893
|
+
amountValue: z4.number().optional(),
|
|
894
|
+
type: z4.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
|
|
895
|
+
description: z4.string().optional(),
|
|
896
|
+
documentNodeId: z4.string().optional(),
|
|
897
|
+
sourceSpanIds: z4.array(z4.string()).optional(),
|
|
898
|
+
sourceTextHash: z4.string().optional()
|
|
899
|
+
});
|
|
900
|
+
var RatingBasisSchema = z4.object({
|
|
618
901
|
type: RatingBasisTypeSchema,
|
|
619
|
-
amount:
|
|
620
|
-
description:
|
|
621
|
-
});
|
|
622
|
-
var SublimitSchema =
|
|
623
|
-
name:
|
|
624
|
-
limit:
|
|
625
|
-
appliesTo:
|
|
626
|
-
deductible:
|
|
627
|
-
});
|
|
628
|
-
var SharedLimitSchema =
|
|
629
|
-
description:
|
|
630
|
-
limit:
|
|
631
|
-
coverageParts:
|
|
632
|
-
});
|
|
633
|
-
var ExtendedReportingPeriodSchema =
|
|
634
|
-
basicDays:
|
|
635
|
-
supplementalYears:
|
|
636
|
-
supplementalPremium:
|
|
637
|
-
});
|
|
638
|
-
var NamedInsuredSchema =
|
|
639
|
-
name:
|
|
640
|
-
relationship:
|
|
902
|
+
amount: z4.string().optional(),
|
|
903
|
+
description: z4.string().optional()
|
|
904
|
+
});
|
|
905
|
+
var SublimitSchema = z4.object({
|
|
906
|
+
name: z4.string(),
|
|
907
|
+
limit: z4.string(),
|
|
908
|
+
appliesTo: z4.string().optional(),
|
|
909
|
+
deductible: z4.string().optional()
|
|
910
|
+
});
|
|
911
|
+
var SharedLimitSchema = z4.object({
|
|
912
|
+
description: z4.string(),
|
|
913
|
+
limit: z4.string(),
|
|
914
|
+
coverageParts: z4.array(z4.string())
|
|
915
|
+
});
|
|
916
|
+
var ExtendedReportingPeriodSchema = z4.object({
|
|
917
|
+
basicDays: z4.number().optional(),
|
|
918
|
+
supplementalYears: z4.number().optional(),
|
|
919
|
+
supplementalPremium: z4.string().optional()
|
|
920
|
+
});
|
|
921
|
+
var NamedInsuredSchema = z4.object({
|
|
922
|
+
name: z4.string(),
|
|
923
|
+
relationship: z4.string().optional(),
|
|
641
924
|
address: AddressSchema.optional()
|
|
642
925
|
}).merge(SourceProvenanceSchema);
|
|
643
926
|
|
|
644
927
|
// src/schemas/coverage.ts
|
|
645
|
-
import { z as
|
|
646
|
-
var CoverageValueTypeSchema =
|
|
928
|
+
import { z as z5 } from "zod";
|
|
929
|
+
var CoverageValueTypeSchema = z5.enum([
|
|
647
930
|
"numeric",
|
|
648
931
|
"included",
|
|
649
932
|
"not_included",
|
|
@@ -652,116 +935,98 @@ var CoverageValueTypeSchema = z4.enum([
|
|
|
652
935
|
"referential",
|
|
653
936
|
"other"
|
|
654
937
|
]);
|
|
655
|
-
var CoverageSchema =
|
|
656
|
-
name:
|
|
657
|
-
limit:
|
|
658
|
-
limitAmount:
|
|
938
|
+
var CoverageSchema = z5.object({
|
|
939
|
+
name: z5.string(),
|
|
940
|
+
limit: z5.string(),
|
|
941
|
+
limitAmount: z5.number().optional(),
|
|
659
942
|
limitType: LimitTypeSchema.optional(),
|
|
660
943
|
limitValueType: CoverageValueTypeSchema.optional(),
|
|
661
|
-
deductible:
|
|
662
|
-
deductibleAmount:
|
|
944
|
+
deductible: z5.string().optional(),
|
|
945
|
+
deductibleAmount: z5.number().optional(),
|
|
663
946
|
deductibleValueType: CoverageValueTypeSchema.optional(),
|
|
664
947
|
trigger: CoverageTriggerSchema.optional(),
|
|
665
|
-
retroactiveDate:
|
|
666
|
-
formNumber:
|
|
667
|
-
pageNumber:
|
|
668
|
-
sectionRef:
|
|
669
|
-
originalContent:
|
|
670
|
-
recordId:
|
|
671
|
-
documentNodeId:
|
|
672
|
-
sourceSpanIds:
|
|
673
|
-
sourceTextHash:
|
|
948
|
+
retroactiveDate: z5.string().optional(),
|
|
949
|
+
formNumber: z5.string().optional(),
|
|
950
|
+
pageNumber: z5.number().optional(),
|
|
951
|
+
sectionRef: z5.string().optional(),
|
|
952
|
+
originalContent: z5.string().optional(),
|
|
953
|
+
recordId: z5.string().optional(),
|
|
954
|
+
documentNodeId: z5.string().optional(),
|
|
955
|
+
sourceSpanIds: z5.array(z5.string()).optional(),
|
|
956
|
+
sourceTextHash: z5.string().optional()
|
|
674
957
|
});
|
|
675
|
-
var EnrichedCoverageSchema =
|
|
676
|
-
name:
|
|
677
|
-
coverageCode:
|
|
678
|
-
formNumber:
|
|
679
|
-
formEditionDate:
|
|
680
|
-
limit:
|
|
681
|
-
limitAmount:
|
|
958
|
+
var EnrichedCoverageSchema = z5.object({
|
|
959
|
+
name: z5.string(),
|
|
960
|
+
coverageCode: z5.string().optional(),
|
|
961
|
+
formNumber: z5.string().optional(),
|
|
962
|
+
formEditionDate: z5.string().optional(),
|
|
963
|
+
limit: z5.string(),
|
|
964
|
+
limitAmount: z5.number().optional(),
|
|
682
965
|
limitType: LimitTypeSchema.optional(),
|
|
683
966
|
limitValueType: CoverageValueTypeSchema.optional(),
|
|
684
|
-
deductible:
|
|
685
|
-
deductibleAmount:
|
|
967
|
+
deductible: z5.string().optional(),
|
|
968
|
+
deductibleAmount: z5.number().optional(),
|
|
686
969
|
deductibleType: DeductibleTypeSchema.optional(),
|
|
687
970
|
deductibleValueType: CoverageValueTypeSchema.optional(),
|
|
688
|
-
sir:
|
|
689
|
-
sublimit:
|
|
690
|
-
coinsurance:
|
|
971
|
+
sir: z5.string().optional(),
|
|
972
|
+
sublimit: z5.string().optional(),
|
|
973
|
+
coinsurance: z5.string().optional(),
|
|
691
974
|
valuation: ValuationMethodSchema.optional(),
|
|
692
|
-
territory:
|
|
975
|
+
territory: z5.string().optional(),
|
|
693
976
|
trigger: CoverageTriggerSchema.optional(),
|
|
694
|
-
retroactiveDate:
|
|
695
|
-
included:
|
|
696
|
-
premium:
|
|
697
|
-
pageNumber:
|
|
698
|
-
sectionRef:
|
|
699
|
-
originalContent:
|
|
700
|
-
recordId: z4.string().optional(),
|
|
701
|
-
documentNodeId: z4.string().optional(),
|
|
702
|
-
sourceSpanIds: z4.array(z4.string()).optional(),
|
|
703
|
-
sourceTextHash: z4.string().optional()
|
|
704
|
-
});
|
|
705
|
-
|
|
706
|
-
// src/schemas/endorsement.ts
|
|
707
|
-
import { z as z5 } from "zod";
|
|
708
|
-
var EndorsementPartySchema = z5.object({
|
|
709
|
-
name: z5.string(),
|
|
710
|
-
role: EndorsementPartyRoleSchema,
|
|
711
|
-
address: AddressSchema.optional(),
|
|
712
|
-
relationship: z5.string().optional(),
|
|
713
|
-
scope: z5.string().optional()
|
|
714
|
-
}).merge(SourceProvenanceSchema);
|
|
715
|
-
var EndorsementSchema = z5.object({
|
|
716
|
-
formNumber: z5.string(),
|
|
717
|
-
editionDate: z5.string().optional(),
|
|
718
|
-
title: z5.string(),
|
|
719
|
-
endorsementType: EndorsementTypeSchema,
|
|
720
|
-
effectiveDate: z5.string().optional(),
|
|
721
|
-
affectedCoverageParts: z5.array(z5.string()).optional(),
|
|
722
|
-
namedParties: z5.array(EndorsementPartySchema).optional(),
|
|
723
|
-
keyTerms: z5.array(z5.string()).optional(),
|
|
724
|
-
premiumImpact: z5.string().optional(),
|
|
725
|
-
excerpt: z5.string().optional(),
|
|
726
|
-
content: z5.string().optional(),
|
|
727
|
-
pageStart: z5.number(),
|
|
728
|
-
pageEnd: z5.number().optional(),
|
|
977
|
+
retroactiveDate: z5.string().optional(),
|
|
978
|
+
included: z5.boolean(),
|
|
979
|
+
premium: z5.string().optional(),
|
|
980
|
+
pageNumber: z5.number().optional(),
|
|
981
|
+
sectionRef: z5.string().optional(),
|
|
982
|
+
originalContent: z5.string().optional(),
|
|
729
983
|
recordId: z5.string().optional(),
|
|
730
984
|
documentNodeId: z5.string().optional(),
|
|
731
985
|
sourceSpanIds: z5.array(z5.string()).optional(),
|
|
732
986
|
sourceTextHash: z5.string().optional()
|
|
733
987
|
});
|
|
734
988
|
|
|
735
|
-
// src/schemas/
|
|
989
|
+
// src/schemas/endorsement.ts
|
|
736
990
|
import { z as z6 } from "zod";
|
|
737
|
-
var
|
|
991
|
+
var EndorsementPartySchema = z6.object({
|
|
738
992
|
name: z6.string(),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
993
|
+
role: EndorsementPartyRoleSchema,
|
|
994
|
+
address: AddressSchema.optional(),
|
|
995
|
+
relationship: z6.string().optional(),
|
|
996
|
+
scope: z6.string().optional()
|
|
997
|
+
}).merge(SourceProvenanceSchema);
|
|
998
|
+
var EndorsementSchema = z6.object({
|
|
999
|
+
formNumber: z6.string(),
|
|
1000
|
+
editionDate: z6.string().optional(),
|
|
1001
|
+
title: z6.string(),
|
|
1002
|
+
endorsementType: EndorsementTypeSchema,
|
|
1003
|
+
effectiveDate: z6.string().optional(),
|
|
1004
|
+
affectedCoverageParts: z6.array(z6.string()).optional(),
|
|
1005
|
+
namedParties: z6.array(EndorsementPartySchema).optional(),
|
|
1006
|
+
keyTerms: z6.array(z6.string()).optional(),
|
|
1007
|
+
premiumImpact: z6.string().optional(),
|
|
1008
|
+
excerpt: z6.string().optional(),
|
|
1009
|
+
content: z6.string().optional(),
|
|
1010
|
+
pageStart: z6.number(),
|
|
1011
|
+
pageEnd: z6.number().optional(),
|
|
748
1012
|
recordId: z6.string().optional(),
|
|
749
1013
|
documentNodeId: z6.string().optional(),
|
|
750
1014
|
sourceSpanIds: z6.array(z6.string()).optional(),
|
|
751
1015
|
sourceTextHash: z6.string().optional()
|
|
752
1016
|
});
|
|
753
1017
|
|
|
754
|
-
// src/schemas/
|
|
1018
|
+
// src/schemas/exclusion.ts
|
|
755
1019
|
import { z as z7 } from "zod";
|
|
756
|
-
var
|
|
757
|
-
key: z7.string(),
|
|
758
|
-
value: z7.string()
|
|
759
|
-
});
|
|
760
|
-
var PolicyConditionSchema = z7.object({
|
|
1020
|
+
var ExclusionSchema = z7.object({
|
|
761
1021
|
name: z7.string(),
|
|
762
|
-
|
|
1022
|
+
formNumber: z7.string().optional(),
|
|
1023
|
+
excludedPerils: z7.array(z7.string()).optional(),
|
|
1024
|
+
isAbsolute: z7.boolean().optional(),
|
|
1025
|
+
exceptions: z7.array(z7.string()).optional(),
|
|
1026
|
+
buybackAvailable: z7.boolean().optional(),
|
|
1027
|
+
buybackEndorsement: z7.string().optional(),
|
|
1028
|
+
appliesTo: z7.array(z7.string()).optional(),
|
|
763
1029
|
content: z7.string(),
|
|
764
|
-
keyValues: z7.array(ConditionKeyValueSchema).optional(),
|
|
765
1030
|
pageNumber: z7.number().optional(),
|
|
766
1031
|
recordId: z7.string().optional(),
|
|
767
1032
|
documentNodeId: z7.string().optional(),
|
|
@@ -769,543 +1034,561 @@ var PolicyConditionSchema = z7.object({
|
|
|
769
1034
|
sourceTextHash: z7.string().optional()
|
|
770
1035
|
});
|
|
771
1036
|
|
|
772
|
-
// src/schemas/
|
|
1037
|
+
// src/schemas/condition.ts
|
|
773
1038
|
import { z as z8 } from "zod";
|
|
774
|
-
var
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
1039
|
+
var ConditionKeyValueSchema = z8.object({
|
|
1040
|
+
key: z8.string(),
|
|
1041
|
+
value: z8.string()
|
|
1042
|
+
});
|
|
1043
|
+
var PolicyConditionSchema = z8.object({
|
|
1044
|
+
name: z8.string(),
|
|
1045
|
+
conditionType: ConditionTypeSchema,
|
|
1046
|
+
content: z8.string(),
|
|
1047
|
+
keyValues: z8.array(ConditionKeyValueSchema).optional(),
|
|
1048
|
+
pageNumber: z8.number().optional(),
|
|
1049
|
+
recordId: z8.string().optional(),
|
|
1050
|
+
documentNodeId: z8.string().optional(),
|
|
1051
|
+
sourceSpanIds: z8.array(z8.string()).optional(),
|
|
1052
|
+
sourceTextHash: z8.string().optional()
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
// src/schemas/parties.ts
|
|
1056
|
+
import { z as z9 } from "zod";
|
|
1057
|
+
var InsurerInfoSchema = z9.object({
|
|
1058
|
+
legalName: z9.string(),
|
|
1059
|
+
naicNumber: z9.string().optional(),
|
|
1060
|
+
amBestRating: z9.string().optional(),
|
|
1061
|
+
amBestNumber: z9.string().optional(),
|
|
779
1062
|
admittedStatus: AdmittedStatusSchema.optional(),
|
|
780
|
-
stateOfDomicile:
|
|
1063
|
+
stateOfDomicile: z9.string().optional()
|
|
781
1064
|
}).merge(SourceProvenanceSchema);
|
|
782
|
-
var ProducerInfoSchema =
|
|
783
|
-
agencyName:
|
|
784
|
-
contactName:
|
|
785
|
-
licenseNumber:
|
|
786
|
-
phone:
|
|
787
|
-
email:
|
|
1065
|
+
var ProducerInfoSchema = z9.object({
|
|
1066
|
+
agencyName: z9.string(),
|
|
1067
|
+
contactName: z9.string().optional(),
|
|
1068
|
+
licenseNumber: z9.string().optional(),
|
|
1069
|
+
phone: z9.string().optional(),
|
|
1070
|
+
email: z9.string().optional(),
|
|
788
1071
|
address: AddressSchema.optional()
|
|
789
1072
|
}).merge(SourceProvenanceSchema);
|
|
790
1073
|
|
|
791
1074
|
// src/schemas/financial.ts
|
|
792
|
-
import { z as
|
|
793
|
-
var PaymentInstallmentSchema =
|
|
794
|
-
dueDate:
|
|
795
|
-
amount:
|
|
796
|
-
description:
|
|
1075
|
+
import { z as z10 } from "zod";
|
|
1076
|
+
var PaymentInstallmentSchema = z10.object({
|
|
1077
|
+
dueDate: z10.string(),
|
|
1078
|
+
amount: z10.string(),
|
|
1079
|
+
description: z10.string().optional()
|
|
797
1080
|
});
|
|
798
|
-
var PaymentPlanSchema =
|
|
799
|
-
installments:
|
|
800
|
-
financeCharge:
|
|
1081
|
+
var PaymentPlanSchema = z10.object({
|
|
1082
|
+
installments: z10.array(PaymentInstallmentSchema),
|
|
1083
|
+
financeCharge: z10.string().optional()
|
|
801
1084
|
});
|
|
802
|
-
var LocationPremiumSchema =
|
|
803
|
-
locationNumber:
|
|
804
|
-
premium:
|
|
805
|
-
description:
|
|
1085
|
+
var LocationPremiumSchema = z10.object({
|
|
1086
|
+
locationNumber: z10.number(),
|
|
1087
|
+
premium: z10.string(),
|
|
1088
|
+
description: z10.string().optional()
|
|
806
1089
|
});
|
|
807
1090
|
|
|
808
1091
|
// src/schemas/loss-history.ts
|
|
809
|
-
import { z as
|
|
810
|
-
var ClaimRecordSchema =
|
|
811
|
-
dateOfLoss:
|
|
812
|
-
claimNumber:
|
|
813
|
-
description:
|
|
1092
|
+
import { z as z11 } from "zod";
|
|
1093
|
+
var ClaimRecordSchema = z11.object({
|
|
1094
|
+
dateOfLoss: z11.string(),
|
|
1095
|
+
claimNumber: z11.string().optional(),
|
|
1096
|
+
description: z11.string(),
|
|
814
1097
|
status: ClaimStatusSchema,
|
|
815
|
-
paid:
|
|
816
|
-
reserved:
|
|
817
|
-
incurred:
|
|
818
|
-
claimant:
|
|
819
|
-
coverageLine:
|
|
820
|
-
});
|
|
821
|
-
var LossSummarySchema =
|
|
822
|
-
period:
|
|
823
|
-
totalClaims:
|
|
824
|
-
totalIncurred:
|
|
825
|
-
totalPaid:
|
|
826
|
-
totalReserved:
|
|
827
|
-
lossRatio:
|
|
828
|
-
});
|
|
829
|
-
var ExperienceModSchema =
|
|
830
|
-
factor:
|
|
831
|
-
effectiveDate:
|
|
832
|
-
state:
|
|
1098
|
+
paid: z11.string().optional(),
|
|
1099
|
+
reserved: z11.string().optional(),
|
|
1100
|
+
incurred: z11.string().optional(),
|
|
1101
|
+
claimant: z11.string().optional(),
|
|
1102
|
+
coverageLine: z11.string().optional()
|
|
1103
|
+
});
|
|
1104
|
+
var LossSummarySchema = z11.object({
|
|
1105
|
+
period: z11.string().optional(),
|
|
1106
|
+
totalClaims: z11.number().optional(),
|
|
1107
|
+
totalIncurred: z11.string().optional(),
|
|
1108
|
+
totalPaid: z11.string().optional(),
|
|
1109
|
+
totalReserved: z11.string().optional(),
|
|
1110
|
+
lossRatio: z11.string().optional()
|
|
1111
|
+
});
|
|
1112
|
+
var ExperienceModSchema = z11.object({
|
|
1113
|
+
factor: z11.number(),
|
|
1114
|
+
effectiveDate: z11.string().optional(),
|
|
1115
|
+
state: z11.string().optional()
|
|
833
1116
|
});
|
|
834
1117
|
|
|
835
1118
|
// src/schemas/underwriting.ts
|
|
836
|
-
import { z as
|
|
837
|
-
var EnrichedSubjectivitySchema =
|
|
838
|
-
description:
|
|
1119
|
+
import { z as z12 } from "zod";
|
|
1120
|
+
var EnrichedSubjectivitySchema = z12.object({
|
|
1121
|
+
description: z12.string(),
|
|
839
1122
|
category: SubjectivityCategorySchema.optional(),
|
|
840
|
-
dueDate:
|
|
841
|
-
status:
|
|
842
|
-
pageNumber:
|
|
1123
|
+
dueDate: z12.string().optional(),
|
|
1124
|
+
status: z12.enum(["open", "satisfied", "waived"]).optional(),
|
|
1125
|
+
pageNumber: z12.number().optional()
|
|
843
1126
|
});
|
|
844
|
-
var EnrichedUnderwritingConditionSchema =
|
|
845
|
-
description:
|
|
846
|
-
category:
|
|
847
|
-
pageNumber:
|
|
1127
|
+
var EnrichedUnderwritingConditionSchema = z12.object({
|
|
1128
|
+
description: z12.string(),
|
|
1129
|
+
category: z12.string().optional(),
|
|
1130
|
+
pageNumber: z12.number().optional()
|
|
848
1131
|
});
|
|
849
|
-
var BindingAuthoritySchema =
|
|
850
|
-
authorizedBy:
|
|
851
|
-
method:
|
|
852
|
-
expiration:
|
|
853
|
-
conditions:
|
|
1132
|
+
var BindingAuthoritySchema = z12.object({
|
|
1133
|
+
authorizedBy: z12.string().optional(),
|
|
1134
|
+
method: z12.string().optional(),
|
|
1135
|
+
expiration: z12.string().optional(),
|
|
1136
|
+
conditions: z12.array(z12.string()).optional()
|
|
854
1137
|
});
|
|
855
1138
|
|
|
856
1139
|
// src/schemas/declarations/index.ts
|
|
857
|
-
import { z as
|
|
1140
|
+
import { z as z16 } from "zod";
|
|
858
1141
|
|
|
859
1142
|
// src/schemas/declarations/personal.ts
|
|
860
|
-
import { z as
|
|
1143
|
+
import { z as z14 } from "zod";
|
|
861
1144
|
|
|
862
1145
|
// src/schemas/declarations/shared.ts
|
|
863
|
-
import { z as
|
|
864
|
-
var EmployersLiabilityLimitsSchema =
|
|
865
|
-
eachAccident:
|
|
866
|
-
diseasePolicyLimit:
|
|
867
|
-
diseaseEachEmployee:
|
|
868
|
-
});
|
|
869
|
-
var LimitScheduleSchema =
|
|
870
|
-
perOccurrence:
|
|
871
|
-
generalAggregate:
|
|
872
|
-
productsCompletedOpsAggregate:
|
|
873
|
-
personalAdvertisingInjury:
|
|
874
|
-
eachEmployee:
|
|
875
|
-
fireDamage:
|
|
876
|
-
medicalExpense:
|
|
877
|
-
combinedSingleLimit:
|
|
878
|
-
bodilyInjuryPerPerson:
|
|
879
|
-
bodilyInjuryPerAccident:
|
|
880
|
-
propertyDamage:
|
|
881
|
-
eachOccurrenceUmbrella:
|
|
882
|
-
umbrellaAggregate:
|
|
883
|
-
umbrellaRetention:
|
|
884
|
-
statutory:
|
|
1146
|
+
import { z as z13 } from "zod";
|
|
1147
|
+
var EmployersLiabilityLimitsSchema = z13.object({
|
|
1148
|
+
eachAccident: z13.string(),
|
|
1149
|
+
diseasePolicyLimit: z13.string(),
|
|
1150
|
+
diseaseEachEmployee: z13.string()
|
|
1151
|
+
});
|
|
1152
|
+
var LimitScheduleSchema = z13.object({
|
|
1153
|
+
perOccurrence: z13.string().optional(),
|
|
1154
|
+
generalAggregate: z13.string().optional(),
|
|
1155
|
+
productsCompletedOpsAggregate: z13.string().optional(),
|
|
1156
|
+
personalAdvertisingInjury: z13.string().optional(),
|
|
1157
|
+
eachEmployee: z13.string().optional(),
|
|
1158
|
+
fireDamage: z13.string().optional(),
|
|
1159
|
+
medicalExpense: z13.string().optional(),
|
|
1160
|
+
combinedSingleLimit: z13.string().optional(),
|
|
1161
|
+
bodilyInjuryPerPerson: z13.string().optional(),
|
|
1162
|
+
bodilyInjuryPerAccident: z13.string().optional(),
|
|
1163
|
+
propertyDamage: z13.string().optional(),
|
|
1164
|
+
eachOccurrenceUmbrella: z13.string().optional(),
|
|
1165
|
+
umbrellaAggregate: z13.string().optional(),
|
|
1166
|
+
umbrellaRetention: z13.string().optional(),
|
|
1167
|
+
statutory: z13.boolean().optional(),
|
|
885
1168
|
employersLiability: EmployersLiabilityLimitsSchema.optional(),
|
|
886
|
-
sublimits:
|
|
887
|
-
sharedLimits:
|
|
1169
|
+
sublimits: z13.array(SublimitSchema).optional(),
|
|
1170
|
+
sharedLimits: z13.array(SharedLimitSchema).optional(),
|
|
888
1171
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional()
|
|
889
1172
|
});
|
|
890
|
-
var DeductibleScheduleSchema =
|
|
891
|
-
perClaim:
|
|
892
|
-
perOccurrence:
|
|
893
|
-
aggregateDeductible:
|
|
894
|
-
selfInsuredRetention:
|
|
895
|
-
corridorDeductible:
|
|
896
|
-
waitingPeriod:
|
|
897
|
-
appliesTo:
|
|
898
|
-
});
|
|
899
|
-
var InsuredLocationSchema =
|
|
900
|
-
number:
|
|
1173
|
+
var DeductibleScheduleSchema = z13.object({
|
|
1174
|
+
perClaim: z13.string().optional(),
|
|
1175
|
+
perOccurrence: z13.string().optional(),
|
|
1176
|
+
aggregateDeductible: z13.string().optional(),
|
|
1177
|
+
selfInsuredRetention: z13.string().optional(),
|
|
1178
|
+
corridorDeductible: z13.string().optional(),
|
|
1179
|
+
waitingPeriod: z13.string().optional(),
|
|
1180
|
+
appliesTo: z13.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
|
|
1181
|
+
});
|
|
1182
|
+
var InsuredLocationSchema = z13.object({
|
|
1183
|
+
number: z13.number(),
|
|
901
1184
|
address: AddressSchema,
|
|
902
|
-
description:
|
|
903
|
-
buildingValue:
|
|
904
|
-
contentsValue:
|
|
905
|
-
businessIncomeValue:
|
|
906
|
-
constructionType:
|
|
907
|
-
yearBuilt:
|
|
908
|
-
squareFootage:
|
|
909
|
-
protectionClass:
|
|
910
|
-
sprinklered:
|
|
911
|
-
alarmType:
|
|
912
|
-
occupancy:
|
|
913
|
-
});
|
|
914
|
-
var VehicleCoverageSchema =
|
|
1185
|
+
description: z13.string().optional(),
|
|
1186
|
+
buildingValue: z13.string().optional(),
|
|
1187
|
+
contentsValue: z13.string().optional(),
|
|
1188
|
+
businessIncomeValue: z13.string().optional(),
|
|
1189
|
+
constructionType: z13.string().optional(),
|
|
1190
|
+
yearBuilt: z13.number().optional(),
|
|
1191
|
+
squareFootage: z13.number().optional(),
|
|
1192
|
+
protectionClass: z13.string().optional(),
|
|
1193
|
+
sprinklered: z13.boolean().optional(),
|
|
1194
|
+
alarmType: z13.string().optional(),
|
|
1195
|
+
occupancy: z13.string().optional()
|
|
1196
|
+
});
|
|
1197
|
+
var VehicleCoverageSchema = z13.object({
|
|
915
1198
|
type: VehicleCoverageTypeSchema,
|
|
916
|
-
limit:
|
|
917
|
-
deductible:
|
|
918
|
-
included:
|
|
919
|
-
});
|
|
920
|
-
var InsuredVehicleSchema =
|
|
921
|
-
number:
|
|
922
|
-
year:
|
|
923
|
-
make:
|
|
924
|
-
model:
|
|
925
|
-
vin:
|
|
926
|
-
costNew:
|
|
927
|
-
statedValue:
|
|
928
|
-
garageLocation:
|
|
929
|
-
coverages:
|
|
930
|
-
radius:
|
|
931
|
-
vehicleType:
|
|
932
|
-
});
|
|
933
|
-
var ClassificationCodeSchema =
|
|
934
|
-
code:
|
|
935
|
-
description:
|
|
936
|
-
premiumBasis:
|
|
937
|
-
basisAmount:
|
|
938
|
-
rate:
|
|
939
|
-
premium:
|
|
940
|
-
locationNumber:
|
|
941
|
-
});
|
|
942
|
-
var DwellingDetailsSchema =
|
|
1199
|
+
limit: z13.string().optional(),
|
|
1200
|
+
deductible: z13.string().optional(),
|
|
1201
|
+
included: z13.boolean()
|
|
1202
|
+
});
|
|
1203
|
+
var InsuredVehicleSchema = z13.object({
|
|
1204
|
+
number: z13.number(),
|
|
1205
|
+
year: z13.number(),
|
|
1206
|
+
make: z13.string(),
|
|
1207
|
+
model: z13.string(),
|
|
1208
|
+
vin: z13.string(),
|
|
1209
|
+
costNew: z13.string().optional(),
|
|
1210
|
+
statedValue: z13.string().optional(),
|
|
1211
|
+
garageLocation: z13.number().optional(),
|
|
1212
|
+
coverages: z13.array(VehicleCoverageSchema).optional(),
|
|
1213
|
+
radius: z13.string().optional(),
|
|
1214
|
+
vehicleType: z13.string().optional()
|
|
1215
|
+
});
|
|
1216
|
+
var ClassificationCodeSchema = z13.object({
|
|
1217
|
+
code: z13.string(),
|
|
1218
|
+
description: z13.string(),
|
|
1219
|
+
premiumBasis: z13.string(),
|
|
1220
|
+
basisAmount: z13.string().optional(),
|
|
1221
|
+
rate: z13.string().optional(),
|
|
1222
|
+
premium: z13.string().optional(),
|
|
1223
|
+
locationNumber: z13.number().optional()
|
|
1224
|
+
});
|
|
1225
|
+
var DwellingDetailsSchema = z13.object({
|
|
943
1226
|
constructionType: ConstructionTypeSchema.optional(),
|
|
944
|
-
yearBuilt:
|
|
945
|
-
squareFootage:
|
|
946
|
-
stories:
|
|
1227
|
+
yearBuilt: z13.number().optional(),
|
|
1228
|
+
squareFootage: z13.number().optional(),
|
|
1229
|
+
stories: z13.number().optional(),
|
|
947
1230
|
roofType: RoofTypeSchema.optional(),
|
|
948
|
-
roofAge:
|
|
949
|
-
heatingType:
|
|
1231
|
+
roofAge: z13.number().optional(),
|
|
1232
|
+
heatingType: z13.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
|
|
950
1233
|
foundationType: FoundationTypeSchema.optional(),
|
|
951
|
-
plumbingType:
|
|
952
|
-
electricalType:
|
|
953
|
-
electricalAmps:
|
|
954
|
-
hasSwimmingPool:
|
|
955
|
-
poolType:
|
|
956
|
-
hasTrampoline:
|
|
957
|
-
hasDog:
|
|
958
|
-
dogBreed:
|
|
959
|
-
protectiveDevices:
|
|
960
|
-
distanceToFireStation:
|
|
961
|
-
distanceToHydrant:
|
|
962
|
-
fireProtectionClass:
|
|
963
|
-
});
|
|
964
|
-
var DriverRecordSchema =
|
|
965
|
-
name:
|
|
966
|
-
dateOfBirth:
|
|
967
|
-
licenseNumber:
|
|
968
|
-
licenseState:
|
|
969
|
-
relationship:
|
|
970
|
-
yearsLicensed:
|
|
971
|
-
gender:
|
|
972
|
-
maritalStatus:
|
|
973
|
-
goodStudentDiscount:
|
|
974
|
-
defensiveDriverDiscount:
|
|
975
|
-
violations:
|
|
976
|
-
date:
|
|
977
|
-
type:
|
|
978
|
-
description:
|
|
1234
|
+
plumbingType: z13.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
|
|
1235
|
+
electricalType: z13.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
|
|
1236
|
+
electricalAmps: z13.number().optional(),
|
|
1237
|
+
hasSwimmingPool: z13.boolean().optional(),
|
|
1238
|
+
poolType: z13.enum(["in_ground", "above_ground"]).optional(),
|
|
1239
|
+
hasTrampoline: z13.boolean().optional(),
|
|
1240
|
+
hasDog: z13.boolean().optional(),
|
|
1241
|
+
dogBreed: z13.string().optional(),
|
|
1242
|
+
protectiveDevices: z13.array(z13.string()).optional(),
|
|
1243
|
+
distanceToFireStation: z13.string().optional(),
|
|
1244
|
+
distanceToHydrant: z13.string().optional(),
|
|
1245
|
+
fireProtectionClass: z13.string().optional()
|
|
1246
|
+
});
|
|
1247
|
+
var DriverRecordSchema = z13.object({
|
|
1248
|
+
name: z13.string(),
|
|
1249
|
+
dateOfBirth: z13.string().optional(),
|
|
1250
|
+
licenseNumber: z13.string().optional(),
|
|
1251
|
+
licenseState: z13.string().optional(),
|
|
1252
|
+
relationship: z13.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
|
|
1253
|
+
yearsLicensed: z13.number().optional(),
|
|
1254
|
+
gender: z13.string().optional(),
|
|
1255
|
+
maritalStatus: z13.string().optional(),
|
|
1256
|
+
goodStudentDiscount: z13.boolean().optional(),
|
|
1257
|
+
defensiveDriverDiscount: z13.boolean().optional(),
|
|
1258
|
+
violations: z13.array(z13.object({
|
|
1259
|
+
date: z13.string().optional(),
|
|
1260
|
+
type: z13.string().optional(),
|
|
1261
|
+
description: z13.string().optional()
|
|
979
1262
|
})).optional(),
|
|
980
|
-
accidents:
|
|
981
|
-
date:
|
|
982
|
-
atFault:
|
|
983
|
-
description:
|
|
984
|
-
amountPaid:
|
|
1263
|
+
accidents: z13.array(z13.object({
|
|
1264
|
+
date: z13.string().optional(),
|
|
1265
|
+
atFault: z13.boolean().optional(),
|
|
1266
|
+
description: z13.string().optional(),
|
|
1267
|
+
amountPaid: z13.string().optional()
|
|
985
1268
|
})).optional(),
|
|
986
|
-
sr22Required:
|
|
987
|
-
});
|
|
988
|
-
var PersonalVehicleDetailsSchema =
|
|
989
|
-
number:
|
|
990
|
-
year:
|
|
991
|
-
make:
|
|
992
|
-
model:
|
|
993
|
-
vin:
|
|
994
|
-
bodyType:
|
|
1269
|
+
sr22Required: z13.boolean().optional()
|
|
1270
|
+
});
|
|
1271
|
+
var PersonalVehicleDetailsSchema = z13.object({
|
|
1272
|
+
number: z13.number().optional(),
|
|
1273
|
+
year: z13.number().optional(),
|
|
1274
|
+
make: z13.string().optional(),
|
|
1275
|
+
model: z13.string().optional(),
|
|
1276
|
+
vin: z13.string().optional(),
|
|
1277
|
+
bodyType: z13.string().optional(),
|
|
995
1278
|
garagingAddress: AddressSchema.optional(),
|
|
996
1279
|
usage: PersonalAutoUsageSchema.optional(),
|
|
997
|
-
annualMileage:
|
|
998
|
-
odometerReading:
|
|
999
|
-
driverAssignment:
|
|
1280
|
+
annualMileage: z13.number().optional(),
|
|
1281
|
+
odometerReading: z13.number().optional(),
|
|
1282
|
+
driverAssignment: z13.string().optional(),
|
|
1000
1283
|
lienHolder: EndorsementPartySchema.optional(),
|
|
1001
|
-
collisionDeductible:
|
|
1002
|
-
comprehensiveDeductible:
|
|
1003
|
-
rentalReimbursement:
|
|
1004
|
-
towing:
|
|
1284
|
+
collisionDeductible: z13.string().optional(),
|
|
1285
|
+
comprehensiveDeductible: z13.string().optional(),
|
|
1286
|
+
rentalReimbursement: z13.boolean().optional(),
|
|
1287
|
+
towing: z13.boolean().optional()
|
|
1005
1288
|
});
|
|
1006
1289
|
|
|
1007
1290
|
// src/schemas/declarations/personal.ts
|
|
1008
|
-
var HomeownersDeclarationsSchema =
|
|
1009
|
-
line:
|
|
1291
|
+
var HomeownersDeclarationsSchema = z14.object({
|
|
1292
|
+
line: z14.literal("homeowners"),
|
|
1010
1293
|
formType: HomeownersFormTypeSchema,
|
|
1011
|
-
coverageA:
|
|
1012
|
-
coverageB:
|
|
1013
|
-
coverageC:
|
|
1014
|
-
coverageD:
|
|
1015
|
-
coverageE:
|
|
1016
|
-
coverageF:
|
|
1017
|
-
allPerilDeductible:
|
|
1018
|
-
windHailDeductible:
|
|
1019
|
-
hurricaneDeductible:
|
|
1294
|
+
coverageA: z14.string().optional(),
|
|
1295
|
+
coverageB: z14.string().optional(),
|
|
1296
|
+
coverageC: z14.string().optional(),
|
|
1297
|
+
coverageD: z14.string().optional(),
|
|
1298
|
+
coverageE: z14.string().optional(),
|
|
1299
|
+
coverageF: z14.string().optional(),
|
|
1300
|
+
allPerilDeductible: z14.string().optional(),
|
|
1301
|
+
windHailDeductible: z14.string().optional(),
|
|
1302
|
+
hurricaneDeductible: z14.string().optional(),
|
|
1020
1303
|
lossSettlement: LossSettlementSchema.optional(),
|
|
1021
1304
|
dwelling: DwellingDetailsSchema,
|
|
1022
1305
|
mortgagee: EndorsementPartySchema.optional(),
|
|
1023
|
-
additionalMortgagees:
|
|
1024
|
-
});
|
|
1025
|
-
var PersonalAutoDeclarationsSchema =
|
|
1026
|
-
line:
|
|
1027
|
-
vehicles:
|
|
1028
|
-
drivers:
|
|
1029
|
-
liabilityLimits:
|
|
1030
|
-
bodilyInjuryPerPerson:
|
|
1031
|
-
bodilyInjuryPerAccident:
|
|
1032
|
-
propertyDamage:
|
|
1033
|
-
combinedSingleLimit:
|
|
1306
|
+
additionalMortgagees: z14.array(EndorsementPartySchema).optional()
|
|
1307
|
+
});
|
|
1308
|
+
var PersonalAutoDeclarationsSchema = z14.object({
|
|
1309
|
+
line: z14.literal("personal_auto"),
|
|
1310
|
+
vehicles: z14.array(PersonalVehicleDetailsSchema),
|
|
1311
|
+
drivers: z14.array(DriverRecordSchema),
|
|
1312
|
+
liabilityLimits: z14.object({
|
|
1313
|
+
bodilyInjuryPerPerson: z14.string().optional(),
|
|
1314
|
+
bodilyInjuryPerAccident: z14.string().optional(),
|
|
1315
|
+
propertyDamage: z14.string().optional(),
|
|
1316
|
+
combinedSingleLimit: z14.string().optional()
|
|
1034
1317
|
}).optional(),
|
|
1035
|
-
umLimits:
|
|
1036
|
-
bodilyInjuryPerPerson:
|
|
1037
|
-
bodilyInjuryPerAccident:
|
|
1318
|
+
umLimits: z14.object({
|
|
1319
|
+
bodilyInjuryPerPerson: z14.string().optional(),
|
|
1320
|
+
bodilyInjuryPerAccident: z14.string().optional()
|
|
1038
1321
|
}).optional(),
|
|
1039
|
-
uimLimits:
|
|
1040
|
-
bodilyInjuryPerPerson:
|
|
1041
|
-
bodilyInjuryPerAccident:
|
|
1322
|
+
uimLimits: z14.object({
|
|
1323
|
+
bodilyInjuryPerPerson: z14.string().optional(),
|
|
1324
|
+
bodilyInjuryPerAccident: z14.string().optional()
|
|
1042
1325
|
}).optional(),
|
|
1043
|
-
pipLimit:
|
|
1044
|
-
medPayLimit:
|
|
1326
|
+
pipLimit: z14.string().optional(),
|
|
1327
|
+
medPayLimit: z14.string().optional()
|
|
1045
1328
|
});
|
|
1046
|
-
var DwellingFireDeclarationsSchema =
|
|
1047
|
-
line:
|
|
1329
|
+
var DwellingFireDeclarationsSchema = z14.object({
|
|
1330
|
+
line: z14.literal("dwelling_fire"),
|
|
1048
1331
|
formType: DwellingFireFormTypeSchema,
|
|
1049
|
-
dwellingLimit:
|
|
1050
|
-
otherStructuresLimit:
|
|
1051
|
-
personalPropertyLimit:
|
|
1052
|
-
fairRentalValueLimit:
|
|
1053
|
-
liabilityLimit:
|
|
1054
|
-
medicalPaymentsLimit:
|
|
1055
|
-
deductible:
|
|
1332
|
+
dwellingLimit: z14.string().optional(),
|
|
1333
|
+
otherStructuresLimit: z14.string().optional(),
|
|
1334
|
+
personalPropertyLimit: z14.string().optional(),
|
|
1335
|
+
fairRentalValueLimit: z14.string().optional(),
|
|
1336
|
+
liabilityLimit: z14.string().optional(),
|
|
1337
|
+
medicalPaymentsLimit: z14.string().optional(),
|
|
1338
|
+
deductible: z14.string().optional(),
|
|
1056
1339
|
dwelling: DwellingDetailsSchema
|
|
1057
1340
|
});
|
|
1058
|
-
var FloodDeclarationsSchema =
|
|
1059
|
-
line:
|
|
1060
|
-
programType:
|
|
1341
|
+
var FloodDeclarationsSchema = z14.object({
|
|
1342
|
+
line: z14.literal("flood"),
|
|
1343
|
+
programType: z14.enum(["nfip", "private"]),
|
|
1061
1344
|
floodZone: FloodZoneSchema.optional(),
|
|
1062
|
-
communityNumber:
|
|
1063
|
-
communityRating:
|
|
1064
|
-
buildingCoverage:
|
|
1065
|
-
contentsCoverage:
|
|
1066
|
-
iccCoverage:
|
|
1067
|
-
deductible:
|
|
1068
|
-
waitingPeriodDays:
|
|
1069
|
-
elevationCertificate:
|
|
1070
|
-
elevationDifference:
|
|
1071
|
-
buildingDiagramNumber:
|
|
1072
|
-
basementOrEnclosure:
|
|
1073
|
-
postFirmConstruction:
|
|
1074
|
-
});
|
|
1075
|
-
var EarthquakeDeclarationsSchema =
|
|
1076
|
-
line:
|
|
1077
|
-
dwellingCoverage:
|
|
1078
|
-
contentsCoverage:
|
|
1079
|
-
lossOfUseCoverage:
|
|
1080
|
-
deductiblePercent:
|
|
1081
|
-
retrofitDiscount:
|
|
1082
|
-
masonryVeneerCoverage:
|
|
1083
|
-
});
|
|
1084
|
-
var PersonalUmbrellaDeclarationsSchema =
|
|
1085
|
-
line:
|
|
1086
|
-
perOccurrenceLimit:
|
|
1087
|
-
aggregateLimit:
|
|
1088
|
-
retainedLimit:
|
|
1089
|
-
underlyingPolicies:
|
|
1090
|
-
carrier:
|
|
1091
|
-
policyNumber:
|
|
1092
|
-
policyType:
|
|
1093
|
-
limits:
|
|
1345
|
+
communityNumber: z14.string().optional(),
|
|
1346
|
+
communityRating: z14.number().optional(),
|
|
1347
|
+
buildingCoverage: z14.string().optional(),
|
|
1348
|
+
contentsCoverage: z14.string().optional(),
|
|
1349
|
+
iccCoverage: z14.string().optional(),
|
|
1350
|
+
deductible: z14.string().optional(),
|
|
1351
|
+
waitingPeriodDays: z14.number().optional(),
|
|
1352
|
+
elevationCertificate: z14.boolean().optional(),
|
|
1353
|
+
elevationDifference: z14.string().optional(),
|
|
1354
|
+
buildingDiagramNumber: z14.number().optional(),
|
|
1355
|
+
basementOrEnclosure: z14.boolean().optional(),
|
|
1356
|
+
postFirmConstruction: z14.boolean().optional()
|
|
1357
|
+
});
|
|
1358
|
+
var EarthquakeDeclarationsSchema = z14.object({
|
|
1359
|
+
line: z14.literal("earthquake"),
|
|
1360
|
+
dwellingCoverage: z14.string().optional(),
|
|
1361
|
+
contentsCoverage: z14.string().optional(),
|
|
1362
|
+
lossOfUseCoverage: z14.string().optional(),
|
|
1363
|
+
deductiblePercent: z14.number().optional(),
|
|
1364
|
+
retrofitDiscount: z14.boolean().optional(),
|
|
1365
|
+
masonryVeneerCoverage: z14.boolean().optional()
|
|
1366
|
+
});
|
|
1367
|
+
var PersonalUmbrellaDeclarationsSchema = z14.object({
|
|
1368
|
+
line: z14.literal("personal_umbrella"),
|
|
1369
|
+
perOccurrenceLimit: z14.string().optional(),
|
|
1370
|
+
aggregateLimit: z14.string().optional(),
|
|
1371
|
+
retainedLimit: z14.string().optional(),
|
|
1372
|
+
underlyingPolicies: z14.array(z14.object({
|
|
1373
|
+
carrier: z14.string().optional(),
|
|
1374
|
+
policyNumber: z14.string().optional(),
|
|
1375
|
+
policyType: z14.string().optional(),
|
|
1376
|
+
limits: z14.string().optional()
|
|
1094
1377
|
}))
|
|
1095
1378
|
});
|
|
1096
|
-
var PersonalArticlesDeclarationsSchema =
|
|
1097
|
-
line:
|
|
1098
|
-
scheduledItems:
|
|
1099
|
-
itemNumber:
|
|
1379
|
+
var PersonalArticlesDeclarationsSchema = z14.object({
|
|
1380
|
+
line: z14.literal("personal_articles"),
|
|
1381
|
+
scheduledItems: z14.array(z14.object({
|
|
1382
|
+
itemNumber: z14.number().optional(),
|
|
1100
1383
|
category: ScheduledItemCategorySchema.optional(),
|
|
1101
|
-
description:
|
|
1102
|
-
appraisedValue:
|
|
1103
|
-
appraisalDate:
|
|
1384
|
+
description: z14.string(),
|
|
1385
|
+
appraisedValue: z14.string(),
|
|
1386
|
+
appraisalDate: z14.string().optional()
|
|
1104
1387
|
})),
|
|
1105
|
-
blanketCoverage:
|
|
1106
|
-
deductible:
|
|
1107
|
-
worldwideCoverage:
|
|
1108
|
-
breakageCoverage:
|
|
1388
|
+
blanketCoverage: z14.string().optional(),
|
|
1389
|
+
deductible: z14.string().optional(),
|
|
1390
|
+
worldwideCoverage: z14.boolean().optional(),
|
|
1391
|
+
breakageCoverage: z14.boolean().optional()
|
|
1109
1392
|
});
|
|
1110
|
-
var WatercraftDeclarationsSchema =
|
|
1111
|
-
line:
|
|
1393
|
+
var WatercraftDeclarationsSchema = z14.object({
|
|
1394
|
+
line: z14.literal("watercraft"),
|
|
1112
1395
|
boatType: BoatTypeSchema.optional(),
|
|
1113
|
-
year:
|
|
1114
|
-
make:
|
|
1115
|
-
model:
|
|
1116
|
-
length:
|
|
1117
|
-
hullMaterial:
|
|
1118
|
-
hullValue:
|
|
1119
|
-
motorHorsepower:
|
|
1120
|
-
motorType:
|
|
1121
|
-
navigationLimits:
|
|
1122
|
-
layupPeriod:
|
|
1123
|
-
liabilityLimit:
|
|
1124
|
-
medicalPaymentsLimit:
|
|
1125
|
-
physicalDamageDeductible:
|
|
1126
|
-
uninsuredBoaterLimit:
|
|
1127
|
-
trailerCovered:
|
|
1128
|
-
trailerValue:
|
|
1129
|
-
});
|
|
1130
|
-
var RecreationalVehicleDeclarationsSchema =
|
|
1131
|
-
line:
|
|
1396
|
+
year: z14.number().optional(),
|
|
1397
|
+
make: z14.string().optional(),
|
|
1398
|
+
model: z14.string().optional(),
|
|
1399
|
+
length: z14.string().optional(),
|
|
1400
|
+
hullMaterial: z14.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
|
|
1401
|
+
hullValue: z14.string().optional(),
|
|
1402
|
+
motorHorsepower: z14.number().optional(),
|
|
1403
|
+
motorType: z14.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
|
|
1404
|
+
navigationLimits: z14.string().optional(),
|
|
1405
|
+
layupPeriod: z14.string().optional(),
|
|
1406
|
+
liabilityLimit: z14.string().optional(),
|
|
1407
|
+
medicalPaymentsLimit: z14.string().optional(),
|
|
1408
|
+
physicalDamageDeductible: z14.string().optional(),
|
|
1409
|
+
uninsuredBoaterLimit: z14.string().optional(),
|
|
1410
|
+
trailerCovered: z14.boolean().optional(),
|
|
1411
|
+
trailerValue: z14.string().optional()
|
|
1412
|
+
});
|
|
1413
|
+
var RecreationalVehicleDeclarationsSchema = z14.object({
|
|
1414
|
+
line: z14.literal("recreational_vehicle"),
|
|
1132
1415
|
vehicleType: RVTypeSchema,
|
|
1133
|
-
year:
|
|
1134
|
-
make:
|
|
1135
|
-
model:
|
|
1136
|
-
vin:
|
|
1137
|
-
value:
|
|
1138
|
-
liabilityLimit:
|
|
1139
|
-
collisionDeductible:
|
|
1140
|
-
comprehensiveDeductible:
|
|
1141
|
-
personalEffectsCoverage:
|
|
1142
|
-
fullTimerCoverage:
|
|
1143
|
-
});
|
|
1144
|
-
var FarmRanchDeclarationsSchema =
|
|
1145
|
-
line:
|
|
1146
|
-
dwellingCoverage:
|
|
1147
|
-
farmPersonalPropertyCoverage:
|
|
1148
|
-
farmLiabilityLimit:
|
|
1149
|
-
farmAutoIncluded:
|
|
1150
|
-
livestock:
|
|
1151
|
-
type:
|
|
1152
|
-
headCount:
|
|
1153
|
-
value:
|
|
1416
|
+
year: z14.number().optional(),
|
|
1417
|
+
make: z14.string().optional(),
|
|
1418
|
+
model: z14.string().optional(),
|
|
1419
|
+
vin: z14.string().optional(),
|
|
1420
|
+
value: z14.string().optional(),
|
|
1421
|
+
liabilityLimit: z14.string().optional(),
|
|
1422
|
+
collisionDeductible: z14.string().optional(),
|
|
1423
|
+
comprehensiveDeductible: z14.string().optional(),
|
|
1424
|
+
personalEffectsCoverage: z14.string().optional(),
|
|
1425
|
+
fullTimerCoverage: z14.boolean().optional()
|
|
1426
|
+
});
|
|
1427
|
+
var FarmRanchDeclarationsSchema = z14.object({
|
|
1428
|
+
line: z14.literal("farm_ranch"),
|
|
1429
|
+
dwellingCoverage: z14.string().optional(),
|
|
1430
|
+
farmPersonalPropertyCoverage: z14.string().optional(),
|
|
1431
|
+
farmLiabilityLimit: z14.string().optional(),
|
|
1432
|
+
farmAutoIncluded: z14.boolean().optional(),
|
|
1433
|
+
livestock: z14.array(z14.object({
|
|
1434
|
+
type: z14.string(),
|
|
1435
|
+
headCount: z14.number(),
|
|
1436
|
+
value: z14.string().optional()
|
|
1154
1437
|
})).optional(),
|
|
1155
|
-
equipmentSchedule:
|
|
1156
|
-
description:
|
|
1157
|
-
value:
|
|
1438
|
+
equipmentSchedule: z14.array(z14.object({
|
|
1439
|
+
description: z14.string(),
|
|
1440
|
+
value: z14.string()
|
|
1158
1441
|
})).optional(),
|
|
1159
|
-
acreage:
|
|
1442
|
+
acreage: z14.number().optional(),
|
|
1160
1443
|
dwelling: DwellingDetailsSchema.optional()
|
|
1161
1444
|
});
|
|
1162
|
-
var TitleDeclarationsSchema =
|
|
1163
|
-
line:
|
|
1445
|
+
var TitleDeclarationsSchema = z14.object({
|
|
1446
|
+
line: z14.literal("title"),
|
|
1164
1447
|
policyType: TitlePolicyTypeSchema,
|
|
1165
|
-
policyAmount:
|
|
1166
|
-
legalDescription:
|
|
1448
|
+
policyAmount: z14.string(),
|
|
1449
|
+
legalDescription: z14.string().optional(),
|
|
1167
1450
|
propertyAddress: AddressSchema.optional(),
|
|
1168
|
-
effectiveDate:
|
|
1169
|
-
exceptions:
|
|
1170
|
-
number:
|
|
1171
|
-
description:
|
|
1451
|
+
effectiveDate: z14.string().optional(),
|
|
1452
|
+
exceptions: z14.array(z14.object({
|
|
1453
|
+
number: z14.number(),
|
|
1454
|
+
description: z14.string()
|
|
1172
1455
|
})).optional(),
|
|
1173
|
-
underwriter:
|
|
1456
|
+
underwriter: z14.string().optional()
|
|
1174
1457
|
});
|
|
1175
|
-
var PetDeclarationsSchema =
|
|
1176
|
-
line:
|
|
1458
|
+
var PetDeclarationsSchema = z14.object({
|
|
1459
|
+
line: z14.literal("pet"),
|
|
1177
1460
|
species: PetSpeciesSchema,
|
|
1178
|
-
breed:
|
|
1179
|
-
petName:
|
|
1180
|
-
age:
|
|
1181
|
-
annualLimit:
|
|
1182
|
-
perIncidentLimit:
|
|
1183
|
-
deductible:
|
|
1184
|
-
reimbursementPercent:
|
|
1185
|
-
waitingPeriodDays:
|
|
1186
|
-
preExistingConditionsExcluded:
|
|
1187
|
-
wellnessCoverage:
|
|
1188
|
-
});
|
|
1189
|
-
var TravelDeclarationsSchema =
|
|
1190
|
-
line:
|
|
1191
|
-
tripDepartureDate:
|
|
1192
|
-
tripReturnDate:
|
|
1193
|
-
destinations:
|
|
1194
|
-
travelers:
|
|
1195
|
-
name:
|
|
1196
|
-
age:
|
|
1461
|
+
breed: z14.string().optional(),
|
|
1462
|
+
petName: z14.string().optional(),
|
|
1463
|
+
age: z14.number().optional(),
|
|
1464
|
+
annualLimit: z14.string().optional(),
|
|
1465
|
+
perIncidentLimit: z14.string().optional(),
|
|
1466
|
+
deductible: z14.string().optional(),
|
|
1467
|
+
reimbursementPercent: z14.number().optional(),
|
|
1468
|
+
waitingPeriodDays: z14.number().optional(),
|
|
1469
|
+
preExistingConditionsExcluded: z14.boolean().optional(),
|
|
1470
|
+
wellnessCoverage: z14.boolean().optional()
|
|
1471
|
+
});
|
|
1472
|
+
var TravelDeclarationsSchema = z14.object({
|
|
1473
|
+
line: z14.literal("travel"),
|
|
1474
|
+
tripDepartureDate: z14.string().optional(),
|
|
1475
|
+
tripReturnDate: z14.string().optional(),
|
|
1476
|
+
destinations: z14.array(z14.string()).optional(),
|
|
1477
|
+
travelers: z14.array(z14.object({
|
|
1478
|
+
name: z14.string(),
|
|
1479
|
+
age: z14.number().optional()
|
|
1197
1480
|
})).optional(),
|
|
1198
|
-
tripCost:
|
|
1199
|
-
tripCancellationLimit:
|
|
1200
|
-
medicalLimit:
|
|
1201
|
-
evacuationLimit:
|
|
1202
|
-
baggageLimit:
|
|
1481
|
+
tripCost: z14.string().optional(),
|
|
1482
|
+
tripCancellationLimit: z14.string().optional(),
|
|
1483
|
+
medicalLimit: z14.string().optional(),
|
|
1484
|
+
evacuationLimit: z14.string().optional(),
|
|
1485
|
+
baggageLimit: z14.string().optional()
|
|
1203
1486
|
});
|
|
1204
|
-
var IdentityTheftDeclarationsSchema =
|
|
1205
|
-
line:
|
|
1206
|
-
coverageLimit:
|
|
1207
|
-
expenseReimbursement:
|
|
1208
|
-
creditMonitoring:
|
|
1209
|
-
restorationServices:
|
|
1210
|
-
lostWagesLimit:
|
|
1487
|
+
var IdentityTheftDeclarationsSchema = z14.object({
|
|
1488
|
+
line: z14.literal("identity_theft"),
|
|
1489
|
+
coverageLimit: z14.string().optional(),
|
|
1490
|
+
expenseReimbursement: z14.string().optional(),
|
|
1491
|
+
creditMonitoring: z14.boolean().optional(),
|
|
1492
|
+
restorationServices: z14.boolean().optional(),
|
|
1493
|
+
lostWagesLimit: z14.string().optional()
|
|
1211
1494
|
});
|
|
1212
1495
|
|
|
1213
1496
|
// src/schemas/declarations/commercial.ts
|
|
1214
|
-
import { z as
|
|
1215
|
-
var GLDeclarationsSchema =
|
|
1216
|
-
line:
|
|
1497
|
+
import { z as z15 } from "zod";
|
|
1498
|
+
var GLDeclarationsSchema = z15.object({
|
|
1499
|
+
line: z15.literal("gl"),
|
|
1217
1500
|
coverageForm: CoverageFormSchema.optional(),
|
|
1218
|
-
perOccurrenceLimit:
|
|
1219
|
-
generalAggregate:
|
|
1220
|
-
productsCompletedOpsAggregate:
|
|
1221
|
-
personalAdvertisingInjury:
|
|
1222
|
-
fireDamage:
|
|
1223
|
-
medicalExpense:
|
|
1501
|
+
perOccurrenceLimit: z15.string().optional(),
|
|
1502
|
+
generalAggregate: z15.string().optional(),
|
|
1503
|
+
productsCompletedOpsAggregate: z15.string().optional(),
|
|
1504
|
+
personalAdvertisingInjury: z15.string().optional(),
|
|
1505
|
+
fireDamage: z15.string().optional(),
|
|
1506
|
+
medicalExpense: z15.string().optional(),
|
|
1224
1507
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1225
|
-
deductible:
|
|
1226
|
-
classifications:
|
|
1227
|
-
retroactiveDate:
|
|
1228
|
-
});
|
|
1229
|
-
var CommercialPropertyDeclarationsSchema =
|
|
1230
|
-
line:
|
|
1231
|
-
causesOfLossForm:
|
|
1232
|
-
coinsurancePercent:
|
|
1508
|
+
deductible: z15.string().optional(),
|
|
1509
|
+
classifications: z15.array(ClassificationCodeSchema).optional(),
|
|
1510
|
+
retroactiveDate: z15.string().optional()
|
|
1511
|
+
});
|
|
1512
|
+
var CommercialPropertyDeclarationsSchema = z15.object({
|
|
1513
|
+
line: z15.literal("commercial_property"),
|
|
1514
|
+
causesOfLossForm: z15.enum(["basic", "broad", "special"]).optional(),
|
|
1515
|
+
coinsurancePercent: z15.number().optional(),
|
|
1233
1516
|
valuationMethod: ValuationMethodSchema.optional(),
|
|
1234
|
-
locations:
|
|
1235
|
-
blanketLimit:
|
|
1236
|
-
businessIncomeLimit:
|
|
1237
|
-
extraExpenseLimit:
|
|
1238
|
-
});
|
|
1239
|
-
var CommercialAutoDeclarationsSchema =
|
|
1240
|
-
line:
|
|
1241
|
-
vehicles:
|
|
1242
|
-
coveredAutoSymbols:
|
|
1243
|
-
liabilityLimit:
|
|
1244
|
-
umLimit:
|
|
1245
|
-
uimLimit:
|
|
1246
|
-
hiredAutoLiability:
|
|
1247
|
-
nonOwnedAutoLiability:
|
|
1248
|
-
});
|
|
1249
|
-
var WorkersCompDeclarationsSchema =
|
|
1250
|
-
line:
|
|
1251
|
-
coveredStates:
|
|
1252
|
-
classifications:
|
|
1517
|
+
locations: z15.array(InsuredLocationSchema),
|
|
1518
|
+
blanketLimit: z15.string().optional(),
|
|
1519
|
+
businessIncomeLimit: z15.string().optional(),
|
|
1520
|
+
extraExpenseLimit: z15.string().optional()
|
|
1521
|
+
});
|
|
1522
|
+
var CommercialAutoDeclarationsSchema = z15.object({
|
|
1523
|
+
line: z15.literal("commercial_auto"),
|
|
1524
|
+
vehicles: z15.array(InsuredVehicleSchema),
|
|
1525
|
+
coveredAutoSymbols: z15.array(z15.number()).optional(),
|
|
1526
|
+
liabilityLimit: z15.string().optional(),
|
|
1527
|
+
umLimit: z15.string().optional(),
|
|
1528
|
+
uimLimit: z15.string().optional(),
|
|
1529
|
+
hiredAutoLiability: z15.boolean().optional(),
|
|
1530
|
+
nonOwnedAutoLiability: z15.boolean().optional()
|
|
1531
|
+
});
|
|
1532
|
+
var WorkersCompDeclarationsSchema = z15.object({
|
|
1533
|
+
line: z15.literal("workers_comp"),
|
|
1534
|
+
coveredStates: z15.array(z15.string()).optional(),
|
|
1535
|
+
classifications: z15.array(ClassificationCodeSchema),
|
|
1253
1536
|
experienceMod: ExperienceModSchema.optional(),
|
|
1254
1537
|
employersLiability: EmployersLiabilityLimitsSchema.optional()
|
|
1255
1538
|
});
|
|
1256
|
-
var UmbrellaExcessDeclarationsSchema =
|
|
1257
|
-
line:
|
|
1258
|
-
perOccurrenceLimit:
|
|
1259
|
-
aggregateLimit:
|
|
1260
|
-
retention:
|
|
1261
|
-
underlyingPolicies:
|
|
1262
|
-
carrier:
|
|
1263
|
-
policyNumber:
|
|
1264
|
-
policyType:
|
|
1265
|
-
limits:
|
|
1539
|
+
var UmbrellaExcessDeclarationsSchema = z15.object({
|
|
1540
|
+
line: z15.literal("umbrella_excess"),
|
|
1541
|
+
perOccurrenceLimit: z15.string().optional(),
|
|
1542
|
+
aggregateLimit: z15.string().optional(),
|
|
1543
|
+
retention: z15.string().optional(),
|
|
1544
|
+
underlyingPolicies: z15.array(z15.object({
|
|
1545
|
+
carrier: z15.string().optional(),
|
|
1546
|
+
policyNumber: z15.string().optional(),
|
|
1547
|
+
policyType: z15.string().optional(),
|
|
1548
|
+
limits: z15.string().optional()
|
|
1266
1549
|
}))
|
|
1267
1550
|
});
|
|
1268
|
-
var ProfessionalLiabilityDeclarationsSchema =
|
|
1269
|
-
line:
|
|
1270
|
-
perClaimLimit:
|
|
1271
|
-
aggregateLimit:
|
|
1272
|
-
retroactiveDate:
|
|
1551
|
+
var ProfessionalLiabilityDeclarationsSchema = z15.object({
|
|
1552
|
+
line: z15.literal("professional_liability"),
|
|
1553
|
+
perClaimLimit: z15.string().optional(),
|
|
1554
|
+
aggregateLimit: z15.string().optional(),
|
|
1555
|
+
retroactiveDate: z15.string().optional(),
|
|
1273
1556
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1274
1557
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
|
|
1275
1558
|
});
|
|
1276
|
-
var CyberDeclarationsSchema =
|
|
1277
|
-
line:
|
|
1278
|
-
aggregateLimit:
|
|
1279
|
-
retroactiveDate:
|
|
1280
|
-
waitingPeriodHours:
|
|
1281
|
-
sublimits:
|
|
1282
|
-
coverageName:
|
|
1283
|
-
limit:
|
|
1559
|
+
var CyberDeclarationsSchema = z15.object({
|
|
1560
|
+
line: z15.literal("cyber"),
|
|
1561
|
+
aggregateLimit: z15.string().optional(),
|
|
1562
|
+
retroactiveDate: z15.string().optional(),
|
|
1563
|
+
waitingPeriodHours: z15.number().optional(),
|
|
1564
|
+
sublimits: z15.array(z15.object({
|
|
1565
|
+
coverageName: z15.string(),
|
|
1566
|
+
limit: z15.string()
|
|
1284
1567
|
})).optional()
|
|
1285
1568
|
});
|
|
1286
|
-
var DODeclarationsSchema =
|
|
1287
|
-
line:
|
|
1288
|
-
sideALimit:
|
|
1289
|
-
sideBLimit:
|
|
1290
|
-
sideCLimit:
|
|
1291
|
-
sideARetention:
|
|
1292
|
-
sideBRetention:
|
|
1293
|
-
sideCRetention:
|
|
1294
|
-
continuityDate:
|
|
1295
|
-
});
|
|
1296
|
-
var CrimeDeclarationsSchema =
|
|
1297
|
-
line:
|
|
1298
|
-
formType:
|
|
1299
|
-
agreements:
|
|
1300
|
-
agreement:
|
|
1301
|
-
coverageName:
|
|
1302
|
-
limit:
|
|
1303
|
-
deductible:
|
|
1569
|
+
var DODeclarationsSchema = z15.object({
|
|
1570
|
+
line: z15.literal("directors_officers"),
|
|
1571
|
+
sideALimit: z15.string().optional(),
|
|
1572
|
+
sideBLimit: z15.string().optional(),
|
|
1573
|
+
sideCLimit: z15.string().optional(),
|
|
1574
|
+
sideARetention: z15.string().optional(),
|
|
1575
|
+
sideBRetention: z15.string().optional(),
|
|
1576
|
+
sideCRetention: z15.string().optional(),
|
|
1577
|
+
continuityDate: z15.string().optional()
|
|
1578
|
+
});
|
|
1579
|
+
var CrimeDeclarationsSchema = z15.object({
|
|
1580
|
+
line: z15.literal("crime"),
|
|
1581
|
+
formType: z15.enum(["discovery", "loss_sustained"]).optional(),
|
|
1582
|
+
agreements: z15.array(z15.object({
|
|
1583
|
+
agreement: z15.string(),
|
|
1584
|
+
coverageName: z15.string(),
|
|
1585
|
+
limit: z15.string(),
|
|
1586
|
+
deductible: z15.string()
|
|
1304
1587
|
}))
|
|
1305
1588
|
});
|
|
1306
1589
|
|
|
1307
1590
|
// src/schemas/declarations/index.ts
|
|
1308
|
-
var DeclarationsSchema =
|
|
1591
|
+
var DeclarationsSchema = z16.discriminatedUnion("line", [
|
|
1309
1592
|
// Personal lines
|
|
1310
1593
|
HomeownersDeclarationsSchema,
|
|
1311
1594
|
PersonalAutoDeclarationsSchema,
|
|
@@ -1334,251 +1617,251 @@ var DeclarationsSchema = z15.discriminatedUnion("line", [
|
|
|
1334
1617
|
]);
|
|
1335
1618
|
|
|
1336
1619
|
// src/schemas/document.ts
|
|
1337
|
-
import { z as
|
|
1338
|
-
var SubsectionSchema =
|
|
1339
|
-
title:
|
|
1340
|
-
sectionNumber:
|
|
1341
|
-
pageNumber:
|
|
1342
|
-
excerpt:
|
|
1343
|
-
content:
|
|
1344
|
-
documentNodeId:
|
|
1345
|
-
sourceSpanIds:
|
|
1346
|
-
sourceTextHash:
|
|
1347
|
-
});
|
|
1348
|
-
var SectionSchema =
|
|
1349
|
-
title:
|
|
1350
|
-
sectionNumber:
|
|
1351
|
-
pageStart:
|
|
1352
|
-
pageEnd:
|
|
1353
|
-
type:
|
|
1354
|
-
coverageType:
|
|
1355
|
-
excerpt:
|
|
1356
|
-
content:
|
|
1357
|
-
subsections:
|
|
1358
|
-
recordId:
|
|
1359
|
-
documentNodeId:
|
|
1360
|
-
sourceSpanIds:
|
|
1361
|
-
sourceTextHash:
|
|
1362
|
-
});
|
|
1363
|
-
var SubjectivitySchema =
|
|
1364
|
-
description:
|
|
1365
|
-
category:
|
|
1366
|
-
});
|
|
1367
|
-
var UnderwritingConditionSchema =
|
|
1368
|
-
description:
|
|
1369
|
-
});
|
|
1370
|
-
var PremiumLineSchema =
|
|
1371
|
-
line:
|
|
1372
|
-
amount:
|
|
1373
|
-
amountValue:
|
|
1374
|
-
documentNodeId:
|
|
1375
|
-
sourceSpanIds:
|
|
1376
|
-
sourceTextHash:
|
|
1377
|
-
});
|
|
1378
|
-
var AuxiliaryFactSchema =
|
|
1379
|
-
key:
|
|
1380
|
-
value:
|
|
1381
|
-
subject:
|
|
1382
|
-
context:
|
|
1383
|
-
documentNodeId:
|
|
1384
|
-
sourceSpanIds:
|
|
1385
|
-
sourceTextHash:
|
|
1386
|
-
});
|
|
1387
|
-
var DefinitionSchema =
|
|
1388
|
-
term:
|
|
1389
|
-
definition:
|
|
1390
|
-
pageNumber:
|
|
1391
|
-
formNumber:
|
|
1392
|
-
formTitle:
|
|
1393
|
-
sectionRef:
|
|
1394
|
-
originalContent:
|
|
1395
|
-
recordId:
|
|
1396
|
-
documentNodeId:
|
|
1397
|
-
sourceSpanIds:
|
|
1398
|
-
sourceTextHash:
|
|
1399
|
-
});
|
|
1400
|
-
var CoveredReasonSchema =
|
|
1401
|
-
coverageName:
|
|
1402
|
-
reasonNumber:
|
|
1403
|
-
title:
|
|
1404
|
-
content:
|
|
1405
|
-
conditions:
|
|
1406
|
-
exceptions:
|
|
1407
|
-
appliesTo:
|
|
1408
|
-
pageNumber:
|
|
1409
|
-
formNumber:
|
|
1410
|
-
formTitle:
|
|
1411
|
-
sectionRef:
|
|
1412
|
-
originalContent:
|
|
1413
|
-
recordId:
|
|
1414
|
-
documentNodeId:
|
|
1415
|
-
sourceSpanIds:
|
|
1416
|
-
sourceTextHash:
|
|
1417
|
-
});
|
|
1418
|
-
var DocumentTableOfContentsEntrySchema =
|
|
1419
|
-
title:
|
|
1420
|
-
level:
|
|
1421
|
-
pageStart:
|
|
1422
|
-
pageEnd:
|
|
1423
|
-
documentNodeId:
|
|
1424
|
-
sourceSpanIds:
|
|
1425
|
-
});
|
|
1426
|
-
var DocumentPageMapEntrySchema =
|
|
1427
|
-
page:
|
|
1428
|
-
label:
|
|
1429
|
-
formNumber:
|
|
1430
|
-
formTitle:
|
|
1431
|
-
sectionTitle:
|
|
1432
|
-
extractorNames:
|
|
1433
|
-
sourceSpanIds:
|
|
1434
|
-
});
|
|
1435
|
-
var DocumentAgentGuidanceSchema =
|
|
1436
|
-
kind:
|
|
1437
|
-
title:
|
|
1438
|
-
detail:
|
|
1439
|
-
sourceSpanIds:
|
|
1440
|
-
});
|
|
1441
|
-
var DocumentMetadataSchema =
|
|
1442
|
-
sourceTreeVersion:
|
|
1443
|
-
sourceTreeCanonical:
|
|
1444
|
-
formInventory:
|
|
1445
|
-
tableOfContents:
|
|
1446
|
-
pageMap:
|
|
1447
|
-
agentGuidance:
|
|
1448
|
-
});
|
|
1449
|
-
var DocumentNodeSchema =
|
|
1450
|
-
() =>
|
|
1451
|
-
id:
|
|
1452
|
-
title:
|
|
1453
|
-
originalTitle:
|
|
1454
|
-
type:
|
|
1455
|
-
label:
|
|
1456
|
-
level:
|
|
1457
|
-
sectionNumber:
|
|
1458
|
-
pageStart:
|
|
1459
|
-
pageEnd:
|
|
1460
|
-
formNumber:
|
|
1461
|
-
formTitle:
|
|
1462
|
-
excerpt:
|
|
1463
|
-
content:
|
|
1464
|
-
interpretationLabels:
|
|
1465
|
-
sourceSpanIds:
|
|
1466
|
-
sourceTextHash:
|
|
1467
|
-
children:
|
|
1620
|
+
import { z as z17 } from "zod";
|
|
1621
|
+
var SubsectionSchema = z17.object({
|
|
1622
|
+
title: z17.string(),
|
|
1623
|
+
sectionNumber: z17.string().optional(),
|
|
1624
|
+
pageNumber: z17.number().optional(),
|
|
1625
|
+
excerpt: z17.string().optional(),
|
|
1626
|
+
content: z17.string().optional(),
|
|
1627
|
+
documentNodeId: z17.string().optional(),
|
|
1628
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1629
|
+
sourceTextHash: z17.string().optional()
|
|
1630
|
+
});
|
|
1631
|
+
var SectionSchema = z17.object({
|
|
1632
|
+
title: z17.string(),
|
|
1633
|
+
sectionNumber: z17.string().optional(),
|
|
1634
|
+
pageStart: z17.number(),
|
|
1635
|
+
pageEnd: z17.number().optional(),
|
|
1636
|
+
type: z17.string(),
|
|
1637
|
+
coverageType: z17.string().optional(),
|
|
1638
|
+
excerpt: z17.string().optional(),
|
|
1639
|
+
content: z17.string().optional(),
|
|
1640
|
+
subsections: z17.array(SubsectionSchema).optional(),
|
|
1641
|
+
recordId: z17.string().optional(),
|
|
1642
|
+
documentNodeId: z17.string().optional(),
|
|
1643
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1644
|
+
sourceTextHash: z17.string().optional()
|
|
1645
|
+
});
|
|
1646
|
+
var SubjectivitySchema = z17.object({
|
|
1647
|
+
description: z17.string(),
|
|
1648
|
+
category: z17.string().optional()
|
|
1649
|
+
});
|
|
1650
|
+
var UnderwritingConditionSchema = z17.object({
|
|
1651
|
+
description: z17.string()
|
|
1652
|
+
});
|
|
1653
|
+
var PremiumLineSchema = z17.object({
|
|
1654
|
+
line: z17.string(),
|
|
1655
|
+
amount: z17.string(),
|
|
1656
|
+
amountValue: z17.number().optional(),
|
|
1657
|
+
documentNodeId: z17.string().optional(),
|
|
1658
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1659
|
+
sourceTextHash: z17.string().optional()
|
|
1660
|
+
});
|
|
1661
|
+
var AuxiliaryFactSchema = z17.object({
|
|
1662
|
+
key: z17.string(),
|
|
1663
|
+
value: z17.string(),
|
|
1664
|
+
subject: z17.string().optional(),
|
|
1665
|
+
context: z17.string().optional(),
|
|
1666
|
+
documentNodeId: z17.string().optional(),
|
|
1667
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1668
|
+
sourceTextHash: z17.string().optional()
|
|
1669
|
+
});
|
|
1670
|
+
var DefinitionSchema = z17.object({
|
|
1671
|
+
term: z17.string(),
|
|
1672
|
+
definition: z17.string(),
|
|
1673
|
+
pageNumber: z17.number().optional(),
|
|
1674
|
+
formNumber: z17.string().optional(),
|
|
1675
|
+
formTitle: z17.string().optional(),
|
|
1676
|
+
sectionRef: z17.string().optional(),
|
|
1677
|
+
originalContent: z17.string().optional(),
|
|
1678
|
+
recordId: z17.string().optional(),
|
|
1679
|
+
documentNodeId: z17.string().optional(),
|
|
1680
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1681
|
+
sourceTextHash: z17.string().optional()
|
|
1682
|
+
});
|
|
1683
|
+
var CoveredReasonSchema = z17.object({
|
|
1684
|
+
coverageName: z17.string(),
|
|
1685
|
+
reasonNumber: z17.string().optional(),
|
|
1686
|
+
title: z17.string().optional(),
|
|
1687
|
+
content: z17.string(),
|
|
1688
|
+
conditions: z17.array(z17.string()).optional(),
|
|
1689
|
+
exceptions: z17.array(z17.string()).optional(),
|
|
1690
|
+
appliesTo: z17.array(z17.string()).optional(),
|
|
1691
|
+
pageNumber: z17.number().optional(),
|
|
1692
|
+
formNumber: z17.string().optional(),
|
|
1693
|
+
formTitle: z17.string().optional(),
|
|
1694
|
+
sectionRef: z17.string().optional(),
|
|
1695
|
+
originalContent: z17.string().optional(),
|
|
1696
|
+
recordId: z17.string().optional(),
|
|
1697
|
+
documentNodeId: z17.string().optional(),
|
|
1698
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1699
|
+
sourceTextHash: z17.string().optional()
|
|
1700
|
+
});
|
|
1701
|
+
var DocumentTableOfContentsEntrySchema = z17.object({
|
|
1702
|
+
title: z17.string(),
|
|
1703
|
+
level: z17.number().int().positive().optional(),
|
|
1704
|
+
pageStart: z17.number().optional(),
|
|
1705
|
+
pageEnd: z17.number().optional(),
|
|
1706
|
+
documentNodeId: z17.string().optional(),
|
|
1707
|
+
sourceSpanIds: z17.array(z17.string()).optional()
|
|
1708
|
+
});
|
|
1709
|
+
var DocumentPageMapEntrySchema = z17.object({
|
|
1710
|
+
page: z17.number().int().positive(),
|
|
1711
|
+
label: z17.string().optional(),
|
|
1712
|
+
formNumber: z17.string().optional(),
|
|
1713
|
+
formTitle: z17.string().optional(),
|
|
1714
|
+
sectionTitle: z17.string().optional(),
|
|
1715
|
+
extractorNames: z17.array(z17.string()).optional(),
|
|
1716
|
+
sourceSpanIds: z17.array(z17.string()).optional()
|
|
1717
|
+
});
|
|
1718
|
+
var DocumentAgentGuidanceSchema = z17.object({
|
|
1719
|
+
kind: z17.string(),
|
|
1720
|
+
title: z17.string(),
|
|
1721
|
+
detail: z17.string(),
|
|
1722
|
+
sourceSpanIds: z17.array(z17.string()).optional()
|
|
1723
|
+
});
|
|
1724
|
+
var DocumentMetadataSchema = z17.object({
|
|
1725
|
+
sourceTreeVersion: z17.string().optional(),
|
|
1726
|
+
sourceTreeCanonical: z17.boolean().optional(),
|
|
1727
|
+
formInventory: z17.array(FormReferenceSchema).optional(),
|
|
1728
|
+
tableOfContents: z17.array(DocumentTableOfContentsEntrySchema).optional(),
|
|
1729
|
+
pageMap: z17.array(DocumentPageMapEntrySchema).optional(),
|
|
1730
|
+
agentGuidance: z17.array(DocumentAgentGuidanceSchema).optional()
|
|
1731
|
+
});
|
|
1732
|
+
var DocumentNodeSchema = z17.lazy(
|
|
1733
|
+
() => z17.object({
|
|
1734
|
+
id: z17.string(),
|
|
1735
|
+
title: z17.string(),
|
|
1736
|
+
originalTitle: z17.string().optional(),
|
|
1737
|
+
type: z17.string().optional(),
|
|
1738
|
+
label: z17.string().optional(),
|
|
1739
|
+
level: z17.number().int().positive().optional(),
|
|
1740
|
+
sectionNumber: z17.string().optional(),
|
|
1741
|
+
pageStart: z17.number().optional(),
|
|
1742
|
+
pageEnd: z17.number().optional(),
|
|
1743
|
+
formNumber: z17.string().optional(),
|
|
1744
|
+
formTitle: z17.string().optional(),
|
|
1745
|
+
excerpt: z17.string().optional(),
|
|
1746
|
+
content: z17.string().optional(),
|
|
1747
|
+
interpretationLabels: z17.array(z17.string()).optional(),
|
|
1748
|
+
sourceSpanIds: z17.array(z17.string()).optional(),
|
|
1749
|
+
sourceTextHash: z17.string().optional(),
|
|
1750
|
+
children: z17.array(DocumentNodeSchema).optional()
|
|
1468
1751
|
})
|
|
1469
1752
|
);
|
|
1470
1753
|
var BaseDocumentFields = {
|
|
1471
|
-
id:
|
|
1472
|
-
carrier:
|
|
1473
|
-
security:
|
|
1474
|
-
insuredName:
|
|
1475
|
-
premium:
|
|
1476
|
-
premiumAmount:
|
|
1477
|
-
summary:
|
|
1478
|
-
|
|
1479
|
-
coverages:
|
|
1754
|
+
id: z17.string(),
|
|
1755
|
+
carrier: z17.string(),
|
|
1756
|
+
security: z17.string().optional(),
|
|
1757
|
+
insuredName: z17.string(),
|
|
1758
|
+
premium: z17.string().optional(),
|
|
1759
|
+
premiumAmount: z17.number().optional(),
|
|
1760
|
+
summary: z17.string().optional(),
|
|
1761
|
+
linesOfBusiness: z17.array(z17.string()).optional(),
|
|
1762
|
+
coverages: z17.array(CoverageSchema),
|
|
1480
1763
|
documentMetadata: DocumentMetadataSchema,
|
|
1481
|
-
documentOutline:
|
|
1482
|
-
sections:
|
|
1483
|
-
definitions:
|
|
1484
|
-
coveredReasons:
|
|
1764
|
+
documentOutline: z17.array(DocumentNodeSchema),
|
|
1765
|
+
sections: z17.array(SectionSchema).optional(),
|
|
1766
|
+
definitions: z17.array(DefinitionSchema).optional(),
|
|
1767
|
+
coveredReasons: z17.array(CoveredReasonSchema).optional(),
|
|
1485
1768
|
// Enriched fields (v1.2+)
|
|
1486
|
-
carrierLegalName:
|
|
1487
|
-
carrierNaicNumber:
|
|
1488
|
-
carrierAmBestRating:
|
|
1489
|
-
carrierAdmittedStatus:
|
|
1490
|
-
mga:
|
|
1491
|
-
underwriter:
|
|
1492
|
-
brokerAgency:
|
|
1493
|
-
brokerContactName:
|
|
1494
|
-
brokerLicenseNumber:
|
|
1495
|
-
priorPolicyNumber:
|
|
1496
|
-
programName:
|
|
1497
|
-
isRenewal:
|
|
1498
|
-
isPackage:
|
|
1499
|
-
insuredDba:
|
|
1769
|
+
carrierLegalName: z17.string().optional(),
|
|
1770
|
+
carrierNaicNumber: z17.string().optional(),
|
|
1771
|
+
carrierAmBestRating: z17.string().optional(),
|
|
1772
|
+
carrierAdmittedStatus: z17.string().optional(),
|
|
1773
|
+
mga: z17.string().optional(),
|
|
1774
|
+
underwriter: z17.string().optional(),
|
|
1775
|
+
brokerAgency: z17.string().optional(),
|
|
1776
|
+
brokerContactName: z17.string().optional(),
|
|
1777
|
+
brokerLicenseNumber: z17.string().optional(),
|
|
1778
|
+
priorPolicyNumber: z17.string().optional(),
|
|
1779
|
+
programName: z17.string().optional(),
|
|
1780
|
+
isRenewal: z17.boolean().optional(),
|
|
1781
|
+
isPackage: z17.boolean().optional(),
|
|
1782
|
+
insuredDba: z17.string().optional(),
|
|
1500
1783
|
insuredAddress: SourceBackedAddressSchema.optional(),
|
|
1501
1784
|
insuredEntityType: EntityTypeSchema.optional(),
|
|
1502
|
-
additionalNamedInsureds:
|
|
1503
|
-
insuredSicCode:
|
|
1504
|
-
insuredNaicsCode:
|
|
1505
|
-
insuredFein:
|
|
1506
|
-
enrichedCoverages:
|
|
1507
|
-
endorsements:
|
|
1508
|
-
exclusions:
|
|
1509
|
-
conditions:
|
|
1785
|
+
additionalNamedInsureds: z17.array(NamedInsuredSchema).optional(),
|
|
1786
|
+
insuredSicCode: z17.string().optional(),
|
|
1787
|
+
insuredNaicsCode: z17.string().optional(),
|
|
1788
|
+
insuredFein: z17.string().optional(),
|
|
1789
|
+
enrichedCoverages: z17.array(EnrichedCoverageSchema).optional(),
|
|
1790
|
+
endorsements: z17.array(EndorsementSchema).optional(),
|
|
1791
|
+
exclusions: z17.array(ExclusionSchema).optional(),
|
|
1792
|
+
conditions: z17.array(PolicyConditionSchema).optional(),
|
|
1510
1793
|
limits: LimitScheduleSchema.optional(),
|
|
1511
1794
|
deductibles: DeductibleScheduleSchema.optional(),
|
|
1512
|
-
locations:
|
|
1513
|
-
vehicles:
|
|
1514
|
-
classifications:
|
|
1515
|
-
formInventory:
|
|
1795
|
+
locations: z17.array(InsuredLocationSchema).optional(),
|
|
1796
|
+
vehicles: z17.array(InsuredVehicleSchema).optional(),
|
|
1797
|
+
classifications: z17.array(ClassificationCodeSchema).optional(),
|
|
1798
|
+
formInventory: z17.array(FormReferenceSchema).optional(),
|
|
1516
1799
|
declarations: DeclarationsSchema.optional(),
|
|
1517
1800
|
coverageForm: CoverageFormSchema.optional(),
|
|
1518
|
-
retroactiveDate:
|
|
1801
|
+
retroactiveDate: z17.string().optional(),
|
|
1519
1802
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
|
|
1520
1803
|
insurer: InsurerInfoSchema.optional(),
|
|
1521
1804
|
producer: ProducerInfoSchema.optional(),
|
|
1522
|
-
claimsContacts:
|
|
1523
|
-
regulatoryContacts:
|
|
1524
|
-
thirdPartyAdministrators:
|
|
1525
|
-
additionalInsureds:
|
|
1526
|
-
lossPayees:
|
|
1527
|
-
mortgageHolders:
|
|
1528
|
-
taxesAndFees:
|
|
1529
|
-
totalCost:
|
|
1530
|
-
totalCostAmount:
|
|
1531
|
-
minimumPremium:
|
|
1532
|
-
minimumPremiumAmount:
|
|
1533
|
-
depositPremium:
|
|
1534
|
-
depositPremiumAmount:
|
|
1805
|
+
claimsContacts: z17.array(ContactSchema).optional(),
|
|
1806
|
+
regulatoryContacts: z17.array(ContactSchema).optional(),
|
|
1807
|
+
thirdPartyAdministrators: z17.array(ContactSchema).optional(),
|
|
1808
|
+
additionalInsureds: z17.array(EndorsementPartySchema).optional(),
|
|
1809
|
+
lossPayees: z17.array(EndorsementPartySchema).optional(),
|
|
1810
|
+
mortgageHolders: z17.array(EndorsementPartySchema).optional(),
|
|
1811
|
+
taxesAndFees: z17.array(TaxFeeItemSchema).optional(),
|
|
1812
|
+
totalCost: z17.string().optional(),
|
|
1813
|
+
totalCostAmount: z17.number().optional(),
|
|
1814
|
+
minimumPremium: z17.string().optional(),
|
|
1815
|
+
minimumPremiumAmount: z17.number().optional(),
|
|
1816
|
+
depositPremium: z17.string().optional(),
|
|
1817
|
+
depositPremiumAmount: z17.number().optional(),
|
|
1535
1818
|
paymentPlan: PaymentPlanSchema.optional(),
|
|
1536
1819
|
auditType: AuditTypeSchema.optional(),
|
|
1537
|
-
ratingBasis:
|
|
1538
|
-
premiumByLocation:
|
|
1820
|
+
ratingBasis: z17.array(RatingBasisSchema).optional(),
|
|
1821
|
+
premiumByLocation: z17.array(LocationPremiumSchema).optional(),
|
|
1539
1822
|
lossSummary: LossSummarySchema.optional(),
|
|
1540
|
-
individualClaims:
|
|
1823
|
+
individualClaims: z17.array(ClaimRecordSchema).optional(),
|
|
1541
1824
|
experienceMod: ExperienceModSchema.optional(),
|
|
1542
|
-
cancellationNoticeDays:
|
|
1543
|
-
nonrenewalNoticeDays:
|
|
1544
|
-
supplementaryFacts:
|
|
1825
|
+
cancellationNoticeDays: z17.number().optional(),
|
|
1826
|
+
nonrenewalNoticeDays: z17.number().optional(),
|
|
1827
|
+
supplementaryFacts: z17.array(AuxiliaryFactSchema).optional()
|
|
1545
1828
|
};
|
|
1546
|
-
var PolicyDocumentSchema =
|
|
1829
|
+
var PolicyDocumentSchema = z17.object({
|
|
1547
1830
|
...BaseDocumentFields,
|
|
1548
|
-
type:
|
|
1549
|
-
policyNumber:
|
|
1550
|
-
effectiveDate:
|
|
1551
|
-
expirationDate:
|
|
1831
|
+
type: z17.literal("policy"),
|
|
1832
|
+
policyNumber: z17.string(),
|
|
1833
|
+
effectiveDate: z17.string(),
|
|
1834
|
+
expirationDate: z17.string().optional(),
|
|
1552
1835
|
policyTermType: PolicyTermTypeSchema.optional(),
|
|
1553
|
-
nextReviewDate:
|
|
1554
|
-
effectiveTime:
|
|
1836
|
+
nextReviewDate: z17.string().optional(),
|
|
1837
|
+
effectiveTime: z17.string().optional()
|
|
1555
1838
|
});
|
|
1556
|
-
var QuoteDocumentSchema =
|
|
1839
|
+
var QuoteDocumentSchema = z17.object({
|
|
1557
1840
|
...BaseDocumentFields,
|
|
1558
|
-
type:
|
|
1559
|
-
quoteNumber:
|
|
1560
|
-
proposedEffectiveDate:
|
|
1561
|
-
proposedExpirationDate:
|
|
1562
|
-
quoteExpirationDate:
|
|
1563
|
-
subjectivities:
|
|
1564
|
-
underwritingConditions:
|
|
1565
|
-
premiumBreakdown:
|
|
1841
|
+
type: z17.literal("quote"),
|
|
1842
|
+
quoteNumber: z17.string(),
|
|
1843
|
+
proposedEffectiveDate: z17.string().optional(),
|
|
1844
|
+
proposedExpirationDate: z17.string().optional(),
|
|
1845
|
+
quoteExpirationDate: z17.string().optional(),
|
|
1846
|
+
subjectivities: z17.array(SubjectivitySchema).optional(),
|
|
1847
|
+
underwritingConditions: z17.array(UnderwritingConditionSchema).optional(),
|
|
1848
|
+
premiumBreakdown: z17.array(PremiumLineSchema).optional(),
|
|
1566
1849
|
// Enriched quote fields (v1.2+)
|
|
1567
|
-
enrichedSubjectivities:
|
|
1568
|
-
enrichedUnderwritingConditions:
|
|
1569
|
-
warrantyRequirements:
|
|
1570
|
-
lossControlRecommendations:
|
|
1850
|
+
enrichedSubjectivities: z17.array(EnrichedSubjectivitySchema).optional(),
|
|
1851
|
+
enrichedUnderwritingConditions: z17.array(EnrichedUnderwritingConditionSchema).optional(),
|
|
1852
|
+
warrantyRequirements: z17.array(z17.string()).optional(),
|
|
1853
|
+
lossControlRecommendations: z17.array(z17.string()).optional(),
|
|
1571
1854
|
bindingAuthority: BindingAuthoritySchema.optional()
|
|
1572
1855
|
});
|
|
1573
|
-
var InsuranceDocumentSchema =
|
|
1856
|
+
var InsuranceDocumentSchema = z17.discriminatedUnion("type", [
|
|
1574
1857
|
PolicyDocumentSchema,
|
|
1575
1858
|
QuoteDocumentSchema
|
|
1576
1859
|
]);
|
|
1577
1860
|
|
|
1578
1861
|
// src/schemas/platform.ts
|
|
1579
|
-
import { z as
|
|
1580
|
-
var PlatformSchema =
|
|
1581
|
-
var CommunicationIntentSchema =
|
|
1862
|
+
import { z as z18 } from "zod";
|
|
1863
|
+
var PlatformSchema = z18.enum(["email", "chat", "sms", "slack", "discord"]);
|
|
1864
|
+
var CommunicationIntentSchema = z18.enum(["direct", "mediated", "observed"]);
|
|
1582
1865
|
var PLATFORM_CONFIGS = {
|
|
1583
1866
|
email: {
|
|
1584
1867
|
supportsMarkdown: false,
|
|
@@ -1611,65 +1894,65 @@ var PLATFORM_CONFIGS = {
|
|
|
1611
1894
|
};
|
|
1612
1895
|
|
|
1613
1896
|
// src/schemas/pce.ts
|
|
1614
|
-
import { z as
|
|
1897
|
+
import { z as z20 } from "zod";
|
|
1615
1898
|
|
|
1616
1899
|
// src/case/index.ts
|
|
1617
|
-
import { z as
|
|
1618
|
-
var CaseEvidenceSourceSchema =
|
|
1619
|
-
id:
|
|
1620
|
-
label:
|
|
1621
|
-
documentId:
|
|
1622
|
-
page:
|
|
1623
|
-
fieldPath:
|
|
1624
|
-
text:
|
|
1625
|
-
metadata:
|
|
1626
|
-
});
|
|
1627
|
-
var CaseCitationSchema =
|
|
1628
|
-
sourceId:
|
|
1629
|
-
quote:
|
|
1630
|
-
page:
|
|
1631
|
-
fieldPath:
|
|
1632
|
-
});
|
|
1633
|
-
var ValidationIssueSeveritySchema =
|
|
1634
|
-
var CaseValidationIssueSchema =
|
|
1635
|
-
code:
|
|
1900
|
+
import { z as z19 } from "zod";
|
|
1901
|
+
var CaseEvidenceSourceSchema = z19.object({
|
|
1902
|
+
id: z19.string(),
|
|
1903
|
+
label: z19.string().optional(),
|
|
1904
|
+
documentId: z19.string().optional(),
|
|
1905
|
+
page: z19.number().optional(),
|
|
1906
|
+
fieldPath: z19.string().optional(),
|
|
1907
|
+
text: z19.string().describe("Source text available for span validation and citation"),
|
|
1908
|
+
metadata: z19.record(z19.string(), z19.string()).optional()
|
|
1909
|
+
});
|
|
1910
|
+
var CaseCitationSchema = z19.object({
|
|
1911
|
+
sourceId: z19.string(),
|
|
1912
|
+
quote: z19.string(),
|
|
1913
|
+
page: z19.number().optional(),
|
|
1914
|
+
fieldPath: z19.string().optional()
|
|
1915
|
+
});
|
|
1916
|
+
var ValidationIssueSeveritySchema = z19.enum(["info", "warning", "blocking"]);
|
|
1917
|
+
var CaseValidationIssueSchema = z19.object({
|
|
1918
|
+
code: z19.string(),
|
|
1636
1919
|
severity: ValidationIssueSeveritySchema,
|
|
1637
|
-
message:
|
|
1638
|
-
itemId:
|
|
1639
|
-
fieldPath:
|
|
1640
|
-
sourceId:
|
|
1641
|
-
});
|
|
1642
|
-
var MissingInfoQuestionSchema =
|
|
1643
|
-
id:
|
|
1644
|
-
itemId:
|
|
1645
|
-
fieldPath:
|
|
1646
|
-
question:
|
|
1647
|
-
reason:
|
|
1648
|
-
answer:
|
|
1649
|
-
});
|
|
1650
|
-
var CasePacketArtifactKindSchema =
|
|
1920
|
+
message: z19.string(),
|
|
1921
|
+
itemId: z19.string().optional(),
|
|
1922
|
+
fieldPath: z19.string().optional(),
|
|
1923
|
+
sourceId: z19.string().optional()
|
|
1924
|
+
});
|
|
1925
|
+
var MissingInfoQuestionSchema = z19.object({
|
|
1926
|
+
id: z19.string(),
|
|
1927
|
+
itemId: z19.string().optional(),
|
|
1928
|
+
fieldPath: z19.string().optional(),
|
|
1929
|
+
question: z19.string(),
|
|
1930
|
+
reason: z19.string(),
|
|
1931
|
+
answer: z19.string().optional()
|
|
1932
|
+
});
|
|
1933
|
+
var CasePacketArtifactKindSchema = z19.enum([
|
|
1651
1934
|
"underwriter_summary",
|
|
1652
1935
|
"carrier_email",
|
|
1653
1936
|
"missing_info_request",
|
|
1654
1937
|
"json_packet",
|
|
1655
1938
|
"validation_report"
|
|
1656
1939
|
]);
|
|
1657
|
-
var CasePacketArtifactSchema =
|
|
1658
|
-
id:
|
|
1940
|
+
var CasePacketArtifactSchema = z19.object({
|
|
1941
|
+
id: z19.string(),
|
|
1659
1942
|
kind: CasePacketArtifactKindSchema,
|
|
1660
|
-
title:
|
|
1661
|
-
content:
|
|
1662
|
-
citations:
|
|
1663
|
-
});
|
|
1664
|
-
var CaseSubmissionPacketSchema =
|
|
1665
|
-
id:
|
|
1666
|
-
caseId:
|
|
1667
|
-
artifacts:
|
|
1668
|
-
validationIssues:
|
|
1669
|
-
missingInfoQuestions:
|
|
1670
|
-
createdAt:
|
|
1671
|
-
});
|
|
1672
|
-
var CaseActionSchema =
|
|
1943
|
+
title: z19.string(),
|
|
1944
|
+
content: z19.string(),
|
|
1945
|
+
citations: z19.array(CaseCitationSchema).default([])
|
|
1946
|
+
});
|
|
1947
|
+
var CaseSubmissionPacketSchema = z19.object({
|
|
1948
|
+
id: z19.string(),
|
|
1949
|
+
caseId: z19.string(),
|
|
1950
|
+
artifacts: z19.array(CasePacketArtifactSchema),
|
|
1951
|
+
validationIssues: z19.array(CaseValidationIssueSchema),
|
|
1952
|
+
missingInfoQuestions: z19.array(MissingInfoQuestionSchema),
|
|
1953
|
+
createdAt: z19.number()
|
|
1954
|
+
});
|
|
1955
|
+
var CaseActionSchema = z19.enum([
|
|
1673
1956
|
"inspect_attachments",
|
|
1674
1957
|
"retrieve_policy_evidence",
|
|
1675
1958
|
"retrieve_prior_applications",
|
|
@@ -1682,23 +1965,23 @@ var CaseActionSchema = z18.enum([
|
|
|
1682
1965
|
"generate_packet",
|
|
1683
1966
|
"answer_field_or_case_question"
|
|
1684
1967
|
]);
|
|
1685
|
-
var AgenticExecutionModeSchema =
|
|
1686
|
-
var CaseProposalScoreSchema =
|
|
1687
|
-
grounding:
|
|
1688
|
-
completeness:
|
|
1689
|
-
consistency:
|
|
1690
|
-
determinism:
|
|
1691
|
-
risk:
|
|
1692
|
-
cost:
|
|
1693
|
-
});
|
|
1694
|
-
var CaseProposalSchema =
|
|
1695
|
-
id:
|
|
1696
|
-
sourceSpanIds:
|
|
1697
|
-
confidence:
|
|
1698
|
-
missingInfo:
|
|
1699
|
-
validationIssues:
|
|
1700
|
-
estimatedRisk:
|
|
1701
|
-
estimatedCost:
|
|
1968
|
+
var AgenticExecutionModeSchema = z19.enum(["deterministic_tree", "market_eval", "hybrid"]);
|
|
1969
|
+
var CaseProposalScoreSchema = z19.object({
|
|
1970
|
+
grounding: z19.number().min(0).max(1),
|
|
1971
|
+
completeness: z19.number().min(0).max(1),
|
|
1972
|
+
consistency: z19.number().min(0).max(1),
|
|
1973
|
+
determinism: z19.number().min(0).max(1),
|
|
1974
|
+
risk: z19.number().min(0).max(1),
|
|
1975
|
+
cost: z19.number().min(0).max(1)
|
|
1976
|
+
});
|
|
1977
|
+
var CaseProposalSchema = z19.object({
|
|
1978
|
+
id: z19.string(),
|
|
1979
|
+
sourceSpanIds: z19.array(z19.string()).default([]),
|
|
1980
|
+
confidence: z19.number().min(0).max(1),
|
|
1981
|
+
missingInfo: z19.array(z19.string()).default([]),
|
|
1982
|
+
validationIssues: z19.array(CaseValidationIssueSchema).default([]),
|
|
1983
|
+
estimatedRisk: z19.number().min(0).max(1).default(0.5),
|
|
1984
|
+
estimatedCost: z19.number().min(0).max(1).default(0.5),
|
|
1702
1985
|
score: CaseProposalScoreSchema.optional()
|
|
1703
1986
|
});
|
|
1704
1987
|
function stableCaseId(prefix, parts) {
|
|
@@ -1817,8 +2100,8 @@ function totalProposalScore(score) {
|
|
|
1817
2100
|
}
|
|
1818
2101
|
|
|
1819
2102
|
// src/schemas/pce.ts
|
|
1820
|
-
var PolicyChangeActionSchema =
|
|
1821
|
-
var PolicyChangeKindSchema =
|
|
2103
|
+
var PolicyChangeActionSchema = z20.enum(["add", "remove", "update", "replace", "clarify"]);
|
|
2104
|
+
var PolicyChangeKindSchema = z20.enum([
|
|
1822
2105
|
"named_insured_change",
|
|
1823
2106
|
"additional_insured_change",
|
|
1824
2107
|
"coverage_change",
|
|
@@ -1832,70 +2115,70 @@ var PolicyChangeKindSchema = z19.enum([
|
|
|
1832
2115
|
"renewal_submission_update",
|
|
1833
2116
|
"general_endorsement"
|
|
1834
2117
|
]);
|
|
1835
|
-
var PolicyChangeConfidenceSchema =
|
|
1836
|
-
var PolicyChangeStatusSchema =
|
|
1837
|
-
var PolicyChangeItemSchema =
|
|
1838
|
-
id:
|
|
2118
|
+
var PolicyChangeConfidenceSchema = z20.enum(["high", "medium", "low"]);
|
|
2119
|
+
var PolicyChangeStatusSchema = z20.enum(["draft", "needs_info", "ready", "blocked"]);
|
|
2120
|
+
var PolicyChangeItemSchema = z20.object({
|
|
2121
|
+
id: z20.string(),
|
|
1839
2122
|
kind: PolicyChangeKindSchema.default("general_endorsement"),
|
|
1840
2123
|
action: PolicyChangeActionSchema,
|
|
1841
|
-
affectedPolicyId:
|
|
1842
|
-
fieldPath:
|
|
1843
|
-
label:
|
|
1844
|
-
beforeValue:
|
|
1845
|
-
afterValue:
|
|
1846
|
-
requestedValue:
|
|
1847
|
-
effectiveDate:
|
|
1848
|
-
reason:
|
|
1849
|
-
sourceIds:
|
|
1850
|
-
sourceSpanIds:
|
|
1851
|
-
userSourceSpanIds:
|
|
1852
|
-
citations:
|
|
2124
|
+
affectedPolicyId: z20.string().default("unknown"),
|
|
2125
|
+
fieldPath: z20.string().describe("Stable policy field path or business field name"),
|
|
2126
|
+
label: z20.string(),
|
|
2127
|
+
beforeValue: z20.string().optional().describe("Existing policy value, when cited from policy evidence"),
|
|
2128
|
+
afterValue: z20.string().optional().describe("Requested new value"),
|
|
2129
|
+
requestedValue: z20.string().optional().describe("Alias for afterValue used by policy-change workflows"),
|
|
2130
|
+
effectiveDate: z20.string().optional(),
|
|
2131
|
+
reason: z20.string().optional(),
|
|
2132
|
+
sourceIds: z20.array(z20.string()).default([]),
|
|
2133
|
+
sourceSpanIds: z20.array(z20.string()).default([]),
|
|
2134
|
+
userSourceSpanIds: z20.array(z20.string()).optional(),
|
|
2135
|
+
citations: z20.array(CaseCitationSchema).default([]),
|
|
1853
2136
|
confidence: PolicyChangeConfidenceSchema.default("medium"),
|
|
1854
|
-
confidenceScore:
|
|
2137
|
+
confidenceScore: z20.number().min(0).max(1).optional(),
|
|
1855
2138
|
status: PolicyChangeStatusSchema.default("ready")
|
|
1856
2139
|
});
|
|
1857
|
-
var PceNormalizationResultSchema =
|
|
1858
|
-
summary:
|
|
1859
|
-
items:
|
|
1860
|
-
id:
|
|
2140
|
+
var PceNormalizationResultSchema = z20.object({
|
|
2141
|
+
summary: z20.string(),
|
|
2142
|
+
items: z20.array(PolicyChangeItemSchema.omit({ id: true, status: true }).extend({
|
|
2143
|
+
id: z20.string().optional(),
|
|
1861
2144
|
status: PolicyChangeStatusSchema.optional()
|
|
1862
2145
|
})),
|
|
1863
|
-
missingInfoQuestions:
|
|
1864
|
-
id:
|
|
2146
|
+
missingInfoQuestions: z20.array(MissingInfoQuestionSchema.omit({ id: true }).extend({
|
|
2147
|
+
id: z20.string().optional()
|
|
1865
2148
|
})).default([])
|
|
1866
2149
|
});
|
|
1867
|
-
var PolicyChangeImpactSchema =
|
|
1868
|
-
itemId:
|
|
1869
|
-
beforeValue:
|
|
1870
|
-
requestedValue:
|
|
1871
|
-
likelyEndorsementRequired:
|
|
1872
|
-
carrierApprovalLikelyRequired:
|
|
1873
|
-
affectedCoverageForms:
|
|
1874
|
-
sourceSpanIds:
|
|
1875
|
-
});
|
|
1876
|
-
var PceCaseStateSchema =
|
|
1877
|
-
id:
|
|
1878
|
-
requestText:
|
|
1879
|
-
summary:
|
|
2150
|
+
var PolicyChangeImpactSchema = z20.object({
|
|
2151
|
+
itemId: z20.string(),
|
|
2152
|
+
beforeValue: z20.string().optional(),
|
|
2153
|
+
requestedValue: z20.string().optional(),
|
|
2154
|
+
likelyEndorsementRequired: z20.boolean().default(true),
|
|
2155
|
+
carrierApprovalLikelyRequired: z20.boolean().default(true),
|
|
2156
|
+
affectedCoverageForms: z20.array(z20.string()).default([]),
|
|
2157
|
+
sourceSpanIds: z20.array(z20.string()).default([])
|
|
2158
|
+
});
|
|
2159
|
+
var PceCaseStateSchema = z20.object({
|
|
2160
|
+
id: z20.string(),
|
|
2161
|
+
requestText: z20.string(),
|
|
2162
|
+
summary: z20.string(),
|
|
1880
2163
|
executionMode: AgenticExecutionModeSchema.default("deterministic_tree"),
|
|
1881
|
-
items:
|
|
1882
|
-
impacts:
|
|
1883
|
-
evidenceSources:
|
|
1884
|
-
validationIssues:
|
|
1885
|
-
missingInfoQuestions:
|
|
1886
|
-
createdAt:
|
|
1887
|
-
updatedAt:
|
|
1888
|
-
});
|
|
1889
|
-
var PolicyChangeRequestSchema =
|
|
1890
|
-
id:
|
|
1891
|
-
text:
|
|
2164
|
+
items: z20.array(PolicyChangeItemSchema),
|
|
2165
|
+
impacts: z20.array(PolicyChangeImpactSchema),
|
|
2166
|
+
evidenceSources: z20.array(CaseEvidenceSourceSchema),
|
|
2167
|
+
validationIssues: z20.array(CaseValidationIssueSchema),
|
|
2168
|
+
missingInfoQuestions: z20.array(MissingInfoQuestionSchema),
|
|
2169
|
+
createdAt: z20.number(),
|
|
2170
|
+
updatedAt: z20.number()
|
|
2171
|
+
});
|
|
2172
|
+
var PolicyChangeRequestSchema = z20.object({
|
|
2173
|
+
id: z20.string(),
|
|
2174
|
+
text: z20.string(),
|
|
1892
2175
|
executionMode: AgenticExecutionModeSchema.optional(),
|
|
1893
|
-
userSourceSpanIds:
|
|
1894
|
-
createdAt:
|
|
2176
|
+
userSourceSpanIds: z20.array(z20.string()).optional(),
|
|
2177
|
+
createdAt: z20.number().optional()
|
|
1895
2178
|
});
|
|
1896
2179
|
var PceSubmissionPacketSchema = CaseSubmissionPacketSchema.extend({
|
|
1897
2180
|
pceCase: PceCaseStateSchema,
|
|
1898
|
-
artifacts:
|
|
2181
|
+
artifacts: z20.array(CasePacketArtifactSchema)
|
|
1899
2182
|
});
|
|
1900
2183
|
|
|
1901
2184
|
// src/schemas/context-keys.ts
|
|
@@ -1913,7 +2196,7 @@ var CONTEXT_KEY_MAP = [
|
|
|
1913
2196
|
{ extractedField: "totalPremium", category: "financial", contextKey: "current_premium", description: "Total policy premium" },
|
|
1914
2197
|
{ extractedField: "locations[].buildingValue", category: "financial", contextKey: "total_property_values", description: "Sum of building values" },
|
|
1915
2198
|
{ extractedField: "locations[].contentsValue", category: "financial", contextKey: "total_contents_values", description: "Sum of contents values" },
|
|
1916
|
-
{ extractedField: "
|
|
2199
|
+
{ extractedField: "linesOfBusiness", category: "coverage", contextKey: "coverage_types", description: "ACORD lines of business covered" },
|
|
1917
2200
|
{ extractedField: "coverages[].limit", category: "coverage", contextKey: "current_limits", description: "Current coverage limits" },
|
|
1918
2201
|
{ extractedField: "coverages[].deductible", category: "coverage", contextKey: "current_deductibles", description: "Current deductibles" },
|
|
1919
2202
|
{ extractedField: "experienceMod.factor", category: "loss_history", contextKey: "experience_mod", description: "Workers comp experience modification factor" },
|
|
@@ -1951,8 +2234,8 @@ var CONTEXT_KEY_MAP = [
|
|
|
1951
2234
|
];
|
|
1952
2235
|
|
|
1953
2236
|
// src/source/schemas.ts
|
|
1954
|
-
import { z as
|
|
1955
|
-
var SourceSpanKindSchema =
|
|
2237
|
+
import { z as z21 } from "zod";
|
|
2238
|
+
var SourceSpanKindSchema = z21.enum([
|
|
1956
2239
|
"pdf_text",
|
|
1957
2240
|
"pdf_image",
|
|
1958
2241
|
"html",
|
|
@@ -1960,7 +2243,7 @@ var SourceSpanKindSchema = z20.enum([
|
|
|
1960
2243
|
"plain_text",
|
|
1961
2244
|
"structured_field"
|
|
1962
2245
|
]);
|
|
1963
|
-
var SourceSpanUnitSchema =
|
|
2246
|
+
var SourceSpanUnitSchema = z21.enum([
|
|
1964
2247
|
"page",
|
|
1965
2248
|
"section",
|
|
1966
2249
|
"table",
|
|
@@ -1969,78 +2252,78 @@ var SourceSpanUnitSchema = z20.enum([
|
|
|
1969
2252
|
"key_value",
|
|
1970
2253
|
"text"
|
|
1971
2254
|
]);
|
|
1972
|
-
var SourceKindSchema =
|
|
2255
|
+
var SourceKindSchema = z21.enum([
|
|
1973
2256
|
"policy_pdf",
|
|
1974
2257
|
"application_pdf",
|
|
1975
2258
|
"email",
|
|
1976
2259
|
"attachment",
|
|
1977
2260
|
"manual_note"
|
|
1978
2261
|
]);
|
|
1979
|
-
var SourceSpanBBoxSchema =
|
|
1980
|
-
page:
|
|
1981
|
-
x:
|
|
1982
|
-
y:
|
|
1983
|
-
width:
|
|
1984
|
-
height:
|
|
1985
|
-
});
|
|
1986
|
-
var SourceSpanLocationSchema =
|
|
1987
|
-
page:
|
|
1988
|
-
startPage:
|
|
1989
|
-
endPage:
|
|
1990
|
-
charStart:
|
|
1991
|
-
charEnd:
|
|
1992
|
-
lineStart:
|
|
1993
|
-
lineEnd:
|
|
1994
|
-
fieldPath:
|
|
1995
|
-
});
|
|
1996
|
-
var SourceSpanTableLocationSchema =
|
|
1997
|
-
tableId:
|
|
1998
|
-
rowIndex:
|
|
1999
|
-
columnIndex:
|
|
2000
|
-
columnName:
|
|
2001
|
-
rowSpanId:
|
|
2002
|
-
tableSpanId:
|
|
2003
|
-
isHeader:
|
|
2004
|
-
});
|
|
2005
|
-
var SourceSpanSchema =
|
|
2006
|
-
id:
|
|
2007
|
-
documentId:
|
|
2262
|
+
var SourceSpanBBoxSchema = z21.object({
|
|
2263
|
+
page: z21.number().int().positive(),
|
|
2264
|
+
x: z21.number(),
|
|
2265
|
+
y: z21.number(),
|
|
2266
|
+
width: z21.number(),
|
|
2267
|
+
height: z21.number()
|
|
2268
|
+
});
|
|
2269
|
+
var SourceSpanLocationSchema = z21.object({
|
|
2270
|
+
page: z21.number().int().positive().optional(),
|
|
2271
|
+
startPage: z21.number().int().positive().optional(),
|
|
2272
|
+
endPage: z21.number().int().positive().optional(),
|
|
2273
|
+
charStart: z21.number().int().nonnegative().optional(),
|
|
2274
|
+
charEnd: z21.number().int().nonnegative().optional(),
|
|
2275
|
+
lineStart: z21.number().int().positive().optional(),
|
|
2276
|
+
lineEnd: z21.number().int().positive().optional(),
|
|
2277
|
+
fieldPath: z21.string().optional()
|
|
2278
|
+
});
|
|
2279
|
+
var SourceSpanTableLocationSchema = z21.object({
|
|
2280
|
+
tableId: z21.string().optional(),
|
|
2281
|
+
rowIndex: z21.number().int().nonnegative().optional(),
|
|
2282
|
+
columnIndex: z21.number().int().nonnegative().optional(),
|
|
2283
|
+
columnName: z21.string().optional(),
|
|
2284
|
+
rowSpanId: z21.string().optional(),
|
|
2285
|
+
tableSpanId: z21.string().optional(),
|
|
2286
|
+
isHeader: z21.boolean().optional()
|
|
2287
|
+
});
|
|
2288
|
+
var SourceSpanSchema = z21.object({
|
|
2289
|
+
id: z21.string().min(1),
|
|
2290
|
+
documentId: z21.string().min(1),
|
|
2008
2291
|
sourceKind: SourceKindSchema.optional(),
|
|
2009
|
-
chunkId:
|
|
2292
|
+
chunkId: z21.string().optional(),
|
|
2010
2293
|
kind: SourceSpanKindSchema,
|
|
2011
|
-
text:
|
|
2012
|
-
hash:
|
|
2013
|
-
textHash:
|
|
2014
|
-
pageStart:
|
|
2015
|
-
pageEnd:
|
|
2016
|
-
sectionId:
|
|
2017
|
-
formNumber:
|
|
2294
|
+
text: z21.string(),
|
|
2295
|
+
hash: z21.string().min(1),
|
|
2296
|
+
textHash: z21.string().optional(),
|
|
2297
|
+
pageStart: z21.number().int().positive().optional(),
|
|
2298
|
+
pageEnd: z21.number().int().positive().optional(),
|
|
2299
|
+
sectionId: z21.string().optional(),
|
|
2300
|
+
formNumber: z21.string().optional(),
|
|
2018
2301
|
sourceUnit: SourceSpanUnitSchema.optional(),
|
|
2019
|
-
parentSpanId:
|
|
2302
|
+
parentSpanId: z21.string().optional(),
|
|
2020
2303
|
table: SourceSpanTableLocationSchema.optional(),
|
|
2021
|
-
bbox:
|
|
2304
|
+
bbox: z21.array(SourceSpanBBoxSchema).optional(),
|
|
2022
2305
|
location: SourceSpanLocationSchema.optional(),
|
|
2023
|
-
metadata:
|
|
2024
|
-
});
|
|
2025
|
-
var SourceSpanRefSchema =
|
|
2026
|
-
sourceSpanId:
|
|
2027
|
-
documentId:
|
|
2028
|
-
chunkId:
|
|
2029
|
-
quote:
|
|
2030
|
-
hash:
|
|
2306
|
+
metadata: z21.record(z21.string(), z21.string()).optional()
|
|
2307
|
+
});
|
|
2308
|
+
var SourceSpanRefSchema = z21.object({
|
|
2309
|
+
sourceSpanId: z21.string().min(1),
|
|
2310
|
+
documentId: z21.string().min(1).optional(),
|
|
2311
|
+
chunkId: z21.string().optional(),
|
|
2312
|
+
quote: z21.string().optional(),
|
|
2313
|
+
hash: z21.string().optional(),
|
|
2031
2314
|
location: SourceSpanLocationSchema.optional()
|
|
2032
2315
|
});
|
|
2033
|
-
var SourceChunkSchema =
|
|
2034
|
-
id:
|
|
2035
|
-
documentId:
|
|
2036
|
-
sourceSpanIds:
|
|
2037
|
-
text:
|
|
2038
|
-
textHash:
|
|
2039
|
-
pageStart:
|
|
2040
|
-
pageEnd:
|
|
2041
|
-
metadata:
|
|
2042
|
-
});
|
|
2043
|
-
var DocumentSourceNodeKindSchema =
|
|
2316
|
+
var SourceChunkSchema = z21.object({
|
|
2317
|
+
id: z21.string().min(1),
|
|
2318
|
+
documentId: z21.string().min(1),
|
|
2319
|
+
sourceSpanIds: z21.array(z21.string().min(1)),
|
|
2320
|
+
text: z21.string(),
|
|
2321
|
+
textHash: z21.string().min(1),
|
|
2322
|
+
pageStart: z21.number().int().positive().optional(),
|
|
2323
|
+
pageEnd: z21.number().int().positive().optional(),
|
|
2324
|
+
metadata: z21.record(z21.string(), z21.string()).default({})
|
|
2325
|
+
});
|
|
2326
|
+
var DocumentSourceNodeKindSchema = z21.enum([
|
|
2044
2327
|
"document",
|
|
2045
2328
|
"page_group",
|
|
2046
2329
|
"page",
|
|
@@ -2054,31 +2337,65 @@ var DocumentSourceNodeKindSchema = z20.enum([
|
|
|
2054
2337
|
"table_cell",
|
|
2055
2338
|
"text"
|
|
2056
2339
|
]);
|
|
2057
|
-
var DocumentSourceNodeSchema =
|
|
2058
|
-
id:
|
|
2059
|
-
documentId:
|
|
2060
|
-
parentId:
|
|
2340
|
+
var DocumentSourceNodeSchema = z21.object({
|
|
2341
|
+
id: z21.string().min(1),
|
|
2342
|
+
documentId: z21.string().min(1),
|
|
2343
|
+
parentId: z21.string().optional(),
|
|
2061
2344
|
kind: DocumentSourceNodeKindSchema,
|
|
2062
|
-
title:
|
|
2063
|
-
description:
|
|
2064
|
-
textExcerpt:
|
|
2065
|
-
sourceSpanIds:
|
|
2066
|
-
pageStart:
|
|
2067
|
-
pageEnd:
|
|
2068
|
-
bbox:
|
|
2069
|
-
order:
|
|
2070
|
-
path:
|
|
2071
|
-
metadata:
|
|
2072
|
-
});
|
|
2073
|
-
var SourceBackedValueSchema =
|
|
2074
|
-
value:
|
|
2075
|
-
normalizedValue:
|
|
2076
|
-
confidence:
|
|
2077
|
-
sourceNodeIds:
|
|
2078
|
-
sourceSpanIds:
|
|
2079
|
-
});
|
|
2080
|
-
var
|
|
2081
|
-
|
|
2345
|
+
title: z21.string(),
|
|
2346
|
+
description: z21.string(),
|
|
2347
|
+
textExcerpt: z21.string().optional(),
|
|
2348
|
+
sourceSpanIds: z21.array(z21.string().min(1)),
|
|
2349
|
+
pageStart: z21.number().int().positive().optional(),
|
|
2350
|
+
pageEnd: z21.number().int().positive().optional(),
|
|
2351
|
+
bbox: z21.array(SourceSpanBBoxSchema).optional(),
|
|
2352
|
+
order: z21.number().int().nonnegative(),
|
|
2353
|
+
path: z21.string(),
|
|
2354
|
+
metadata: z21.record(z21.string(), z21.unknown()).optional()
|
|
2355
|
+
});
|
|
2356
|
+
var SourceBackedValueSchema = z21.object({
|
|
2357
|
+
value: z21.string(),
|
|
2358
|
+
normalizedValue: z21.string().optional(),
|
|
2359
|
+
confidence: z21.enum(["low", "medium", "high"]).default("medium"),
|
|
2360
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2361
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2362
|
+
});
|
|
2363
|
+
var OperationalAddressSchema = z21.object({
|
|
2364
|
+
street1: z21.string().optional(),
|
|
2365
|
+
street2: z21.string().optional(),
|
|
2366
|
+
city: z21.string().optional(),
|
|
2367
|
+
state: z21.string().optional(),
|
|
2368
|
+
zip: z21.string().optional(),
|
|
2369
|
+
country: z21.string().optional(),
|
|
2370
|
+
formatted: z21.string().optional()
|
|
2371
|
+
});
|
|
2372
|
+
var OperationalDeclarationFactSchema = z21.object({
|
|
2373
|
+
field: z21.enum([
|
|
2374
|
+
"namedInsured",
|
|
2375
|
+
"mailingAddress",
|
|
2376
|
+
"dba",
|
|
2377
|
+
"entityType",
|
|
2378
|
+
"taxId",
|
|
2379
|
+
"additionalNamedInsured",
|
|
2380
|
+
"policyNumber",
|
|
2381
|
+
"insurer",
|
|
2382
|
+
"broker",
|
|
2383
|
+
"effectiveDate",
|
|
2384
|
+
"expirationDate",
|
|
2385
|
+
"premium",
|
|
2386
|
+
"other"
|
|
2387
|
+
]),
|
|
2388
|
+
label: z21.string().optional(),
|
|
2389
|
+
value: z21.string(),
|
|
2390
|
+
normalizedValue: z21.string().optional(),
|
|
2391
|
+
valueKind: z21.enum(["string", "number", "date", "money", "address", "list", "unknown"]).default("string"),
|
|
2392
|
+
address: OperationalAddressSchema.optional(),
|
|
2393
|
+
confidence: z21.enum(["low", "medium", "high"]).default("medium"),
|
|
2394
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2395
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2396
|
+
});
|
|
2397
|
+
var OperationalCoverageTermSchema = z21.object({
|
|
2398
|
+
kind: z21.enum([
|
|
2082
2399
|
"each_claim_limit",
|
|
2083
2400
|
"each_occurrence_limit",
|
|
2084
2401
|
"each_loss_limit",
|
|
@@ -2090,182 +2407,133 @@ var OperationalCoverageTermSchema = z20.object({
|
|
|
2090
2407
|
"premium",
|
|
2091
2408
|
"other"
|
|
2092
2409
|
]).default("other"),
|
|
2093
|
-
label:
|
|
2094
|
-
value:
|
|
2095
|
-
amount:
|
|
2096
|
-
appliesTo:
|
|
2097
|
-
sourceNodeIds:
|
|
2098
|
-
sourceSpanIds:
|
|
2099
|
-
});
|
|
2100
|
-
var OperationalCoverageLineSchema =
|
|
2101
|
-
name:
|
|
2102
|
-
coverageCode:
|
|
2103
|
-
limit:
|
|
2104
|
-
deductible:
|
|
2105
|
-
premium:
|
|
2106
|
-
retroactiveDate:
|
|
2107
|
-
formNumber:
|
|
2108
|
-
sectionRef:
|
|
2109
|
-
endorsementNumber:
|
|
2110
|
-
limits:
|
|
2111
|
-
sourceNodeIds:
|
|
2112
|
-
sourceSpanIds:
|
|
2113
|
-
});
|
|
2114
|
-
var OperationalPartySchema =
|
|
2115
|
-
role:
|
|
2116
|
-
name:
|
|
2117
|
-
sourceNodeIds:
|
|
2118
|
-
sourceSpanIds:
|
|
2119
|
-
});
|
|
2120
|
-
var OperationalEndorsementSupportSchema =
|
|
2121
|
-
kind:
|
|
2122
|
-
status:
|
|
2123
|
-
summary:
|
|
2124
|
-
sourceNodeIds:
|
|
2125
|
-
sourceSpanIds:
|
|
2126
|
-
});
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2410
|
+
label: z21.string(),
|
|
2411
|
+
value: z21.string(),
|
|
2412
|
+
amount: z21.number().optional(),
|
|
2413
|
+
appliesTo: z21.string().optional(),
|
|
2414
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2415
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2416
|
+
});
|
|
2417
|
+
var OperationalCoverageLineSchema = z21.object({
|
|
2418
|
+
name: z21.string(),
|
|
2419
|
+
coverageCode: z21.string().optional(),
|
|
2420
|
+
limit: z21.string().optional(),
|
|
2421
|
+
deductible: z21.string().optional(),
|
|
2422
|
+
premium: z21.string().optional(),
|
|
2423
|
+
retroactiveDate: z21.string().optional(),
|
|
2424
|
+
formNumber: z21.string().optional(),
|
|
2425
|
+
sectionRef: z21.string().optional(),
|
|
2426
|
+
endorsementNumber: z21.string().optional(),
|
|
2427
|
+
limits: z21.array(OperationalCoverageTermSchema).default([]),
|
|
2428
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2429
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2430
|
+
});
|
|
2431
|
+
var OperationalPartySchema = z21.object({
|
|
2432
|
+
role: z21.string(),
|
|
2433
|
+
name: z21.string(),
|
|
2434
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2435
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2436
|
+
});
|
|
2437
|
+
var OperationalEndorsementSupportSchema = z21.object({
|
|
2438
|
+
kind: z21.string(),
|
|
2439
|
+
status: z21.enum(["supported", "excluded", "requires_review"]),
|
|
2440
|
+
summary: z21.string(),
|
|
2441
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2442
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([])
|
|
2443
|
+
});
|
|
2444
|
+
function legacyOperationalProfileInput(value) {
|
|
2445
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
2446
|
+
const record = value;
|
|
2447
|
+
if ("linesOfBusiness" in record) return value;
|
|
2448
|
+
if (!("policyTypes" in record)) return value;
|
|
2449
|
+
return {
|
|
2450
|
+
...record,
|
|
2451
|
+
linesOfBusiness: record.policyTypes
|
|
2452
|
+
};
|
|
2453
|
+
}
|
|
2454
|
+
var OperationalLinesOfBusinessSchema = z21.preprocess(
|
|
2455
|
+
(value) => Array.isArray(value) ? toLobCodes(value.filter((item) => typeof item === "string")) : void 0,
|
|
2456
|
+
z21.array(AcordLobCodeSchema).default(["UN"])
|
|
2457
|
+
);
|
|
2458
|
+
var PolicyOperationalProfileSchema = z21.preprocess(
|
|
2459
|
+
legacyOperationalProfileInput,
|
|
2460
|
+
z21.object({
|
|
2461
|
+
documentType: z21.enum(["policy", "quote"]).default("policy"),
|
|
2462
|
+
linesOfBusiness: OperationalLinesOfBusinessSchema,
|
|
2463
|
+
policyNumber: SourceBackedValueSchema.optional(),
|
|
2464
|
+
namedInsured: SourceBackedValueSchema.optional(),
|
|
2465
|
+
insurer: SourceBackedValueSchema.optional(),
|
|
2466
|
+
broker: SourceBackedValueSchema.optional(),
|
|
2467
|
+
effectiveDate: SourceBackedValueSchema.optional(),
|
|
2468
|
+
expirationDate: SourceBackedValueSchema.optional(),
|
|
2469
|
+
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
2470
|
+
premium: SourceBackedValueSchema.optional(),
|
|
2471
|
+
declarationFacts: z21.array(OperationalDeclarationFactSchema).default([]),
|
|
2472
|
+
coverages: z21.array(OperationalCoverageLineSchema).default([]),
|
|
2473
|
+
parties: z21.array(OperationalPartySchema).default([]),
|
|
2474
|
+
endorsementSupport: z21.array(OperationalEndorsementSupportSchema).default([]),
|
|
2475
|
+
sourceNodeIds: z21.array(z21.string().min(1)).default([]),
|
|
2476
|
+
sourceSpanIds: z21.array(z21.string().min(1)).default([]),
|
|
2477
|
+
warnings: z21.array(z21.string()).default([])
|
|
2478
|
+
})
|
|
2479
|
+
);
|
|
2145
2480
|
|
|
2146
2481
|
// src/source/policy-types.ts
|
|
2147
|
-
var
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
"
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
"motor truck cargo": "inland_marine",
|
|
2187
|
-
"motor truck cargo legal liability": "inland_marine",
|
|
2188
|
-
"builders risk insurance": "builders_risk",
|
|
2189
|
-
"pollution liability": "environmental",
|
|
2190
|
-
"premises pollution liability": "environmental",
|
|
2191
|
-
"environmental liability": "environmental",
|
|
2192
|
-
"ocean marine insurance": "ocean_marine",
|
|
2193
|
-
"surety bond": "surety",
|
|
2194
|
-
"product liability insurance": "product_liability",
|
|
2195
|
-
"life insurance": "life",
|
|
2196
|
-
"permanent life": "life",
|
|
2197
|
-
"term life": "life",
|
|
2198
|
-
"whole life": "life",
|
|
2199
|
-
"universal life": "life",
|
|
2200
|
-
"critical illness": "critical_illness",
|
|
2201
|
-
"critical illness insurance": "critical_illness",
|
|
2202
|
-
"disability insurance": "disability",
|
|
2203
|
-
"long term care": "long_term_care",
|
|
2204
|
-
"long-term care": "long_term_care"
|
|
2205
|
-
};
|
|
2206
|
-
var POLICY_TYPE_TEXT_PATTERNS = [
|
|
2207
|
-
{ type: "general_liability", pattern: /\b(?:commercial\s+)?general\s+liability\b|\bcgl\b/i },
|
|
2208
|
-
{ type: "commercial_property", pattern: /\bcommercial\s+property\b|\bproperty\s+insurance\b/i },
|
|
2209
|
-
{ type: "commercial_auto", pattern: /\bcommercial\s+auto(?:mobile)?\b|\bbusiness\s+auto(?:mobile)?\b|\bauto(?:mobile)?\s+physical\s+damage\b/i },
|
|
2210
|
-
{ type: "non_owned_auto", pattern: /\b(?:hired\s+(?:and\s+)?)?non[-\s]?owned\s+auto\b/i },
|
|
2211
|
-
{ type: "workers_comp", pattern: /\bworkers['’]?\s+comp(?:ensation)?\b/i },
|
|
2212
|
-
{ type: "umbrella", pattern: /\bcommercial\s+umbrella\b|\bumbrella\s+liability\b/i },
|
|
2213
|
-
{ type: "excess_liability", pattern: /\bexcess\s+liability\b/i },
|
|
2214
|
-
{ type: "professional_liability", pattern: /\bprofessional\s+liability\b|\berrors?\s*(?:and|&)\s*omissions?\b|\be&o\b/i },
|
|
2215
|
-
{ type: "cyber", pattern: /\bcyber\b|\bnetwork\s+security\b|\bprivacy\s+liability\b/i },
|
|
2216
|
-
{ type: "epli", pattern: /\bemployment\s+practices?\s+liability\b|\bepli\b/i },
|
|
2217
|
-
{ type: "directors_officers", pattern: /\bdirectors?\s*(?:and|&)\s*officers?\b|\bd&o\b/i },
|
|
2218
|
-
{ type: "fiduciary_liability", pattern: /\bfiduciary\s+liability\b/i },
|
|
2219
|
-
{ type: "crime_fidelity", pattern: /\bcrime\b|\bfidelity\b/i },
|
|
2220
|
-
{ type: "inland_marine", pattern: /\binland\s+marine\b|\bmotor\s+truck\s+cargo\b|\bcargo\s+legal\s+liability\b/i },
|
|
2221
|
-
{ type: "builders_risk", pattern: /\bbuilders?\s+risk\b/i },
|
|
2222
|
-
{ type: "environmental", pattern: /\bpollution\s+liability\b|\benvironmental\s+liability\b/i },
|
|
2223
|
-
{ type: "ocean_marine", pattern: /\bocean\s+marine\b/i },
|
|
2224
|
-
{ type: "surety", pattern: /\bsurety\b/i },
|
|
2225
|
-
{ type: "product_liability", pattern: /\bproduct\s+liability\b|\bproducts?\s+completed\s+operations\b/i },
|
|
2226
|
-
{ type: "bop", pattern: /\bbusiness\s*owners?\s+policy\b|\bbop\b/i },
|
|
2227
|
-
{ type: "homeowners_ho3", pattern: /\bhomeowners?\s*(?:ho[-\s]?3)?\b/i },
|
|
2228
|
-
{ type: "homeowners_ho5", pattern: /\bho[-\s]?5\b/i },
|
|
2229
|
-
{ type: "renters_ho4", pattern: /\brenters?\b|\bho[-\s]?4\b/i },
|
|
2230
|
-
{ type: "condo_ho6", pattern: /\bcondo(?:minium)?\b|\bho[-\s]?6\b/i },
|
|
2231
|
-
{ type: "dwelling_fire", pattern: /\bdwelling\s+fire\b/i },
|
|
2232
|
-
{ type: "personal_auto", pattern: /\bpersonal\s+auto\b/i },
|
|
2233
|
-
{ type: "personal_umbrella", pattern: /\bpersonal\s+umbrella\b/i },
|
|
2234
|
-
{ type: "flood_private", pattern: /\bflood\b/i },
|
|
2235
|
-
{ type: "earthquake", pattern: /\bearthquake\b/i },
|
|
2236
|
-
{ type: "personal_inland_marine", pattern: /\bpersonal\s+(?:articles|inland\s+marine)\b/i },
|
|
2237
|
-
{ type: "watercraft", pattern: /\bwatercraft\b|\bboat\s+insurance\b/i },
|
|
2238
|
-
{ type: "recreational_vehicle", pattern: /\brecreational\s+vehicle\b|\brv\s+insurance\b/i },
|
|
2239
|
-
{ type: "farm_ranch", pattern: /\bfarm\b|\branch\b/i },
|
|
2240
|
-
{ type: "life", pattern: /\blife\s+insurance\b|\bterm\s+life\b|\bwhole\s+life\b|\buniversal\s+life\b/i },
|
|
2241
|
-
{ type: "critical_illness", pattern: /\bcritical\s+illness\b/i },
|
|
2242
|
-
{ type: "disability", pattern: /\bdisability\s+insurance\b|\btotal\s+disability\b/i },
|
|
2243
|
-
{ type: "long_term_care", pattern: /\blong[-\s]?term\s+care\b/i },
|
|
2244
|
-
{ type: "pet", pattern: /\bpet\s+insurance\b/i },
|
|
2245
|
-
{ type: "travel", pattern: /\btravel\s+insurance\b/i },
|
|
2246
|
-
{ type: "identity_theft", pattern: /\bidentity\s+theft\b/i },
|
|
2247
|
-
{ type: "title", pattern: /\btitle\s+insurance\b/i }
|
|
2482
|
+
var LOB_TEXT_PATTERNS = [
|
|
2483
|
+
{ codes: ["CGL"], pattern: /\b(?:commercial\s+)?general\s+liability\b|\bcgl\b/i },
|
|
2484
|
+
{ codes: ["PROPC"], pattern: /\bcommercial\s+property\b|\bproperty\s+insurance\b/i },
|
|
2485
|
+
{ codes: ["PROP"], pattern: /\bproperty\b/i },
|
|
2486
|
+
{ codes: ["AUTOB"], pattern: /\bcommercial\s+auto(?:mobile)?\b|\bbusiness\s+auto(?:mobile)?\b|\bauto(?:mobile)?\s+physical\s+damage\b/i },
|
|
2487
|
+
{ codes: ["AUTOB"], pattern: /\b(?:hired\s+(?:and\s+)?)?non[-\s]?owned\s+auto\b/i },
|
|
2488
|
+
{ codes: ["WORK"], pattern: /\bworkers['’]?\s+comp(?:ensation)?\b/i },
|
|
2489
|
+
{ codes: ["UMBRC"], pattern: /\bcommercial\s+umbrella\b|\bumbrella\s+liability\b/i },
|
|
2490
|
+
{ codes: ["EXLIA"], pattern: /\bexcess\s+liability\b/i },
|
|
2491
|
+
{ codes: ["EO"], pattern: /\bprofessional\s+liability\b|\berrors?\s*(?:and|&)\s*omissions?\b|\be&o\b/i },
|
|
2492
|
+
{ codes: ["OLIB"], pattern: /\bcyber\b|\bnetwork\s+security\b|\bprivacy\s+liability\b/i },
|
|
2493
|
+
{ codes: ["EPLI"], pattern: /\bemployment\s+practices?\s+liability\b|\bepli\b/i },
|
|
2494
|
+
{ codes: ["DO"], pattern: /\bdirectors?\s*(?:and|&)\s*officers?\b|\bd&o\b/i },
|
|
2495
|
+
{ codes: ["FIDUC"], pattern: /\bfiduciary\s+liability\b/i },
|
|
2496
|
+
{ codes: ["CRIME"], pattern: /\bcrime\b|\bfidelity\b/i },
|
|
2497
|
+
{ codes: ["INMRC"], pattern: /\binland\s+marine\b|\bmotor\s+truck\s+cargo\b|\bcargo\s+legal\s+liability\b/i },
|
|
2498
|
+
{ codes: ["INMRC"], pattern: /\bbuilders?\s+risk\b/i },
|
|
2499
|
+
{ codes: ["OLIB"], pattern: /\bpollution\s+liability\b|\benvironmental\s+liability\b/i },
|
|
2500
|
+
{ codes: ["COMAR"], pattern: /\bocean\s+marine\b/i },
|
|
2501
|
+
{ codes: ["SURE"], pattern: /\bsurety\b/i },
|
|
2502
|
+
{ codes: ["OLIB"], pattern: /\bproduct\s+liability\b|\bproducts?\s+completed\s+operations\b/i },
|
|
2503
|
+
{ codes: ["BOP"], pattern: /\bbusiness\s*owners?\s+policy\b|\bbop\b/i },
|
|
2504
|
+
{ codes: ["DO", "EPLI", "FIDUC"], pattern: /\bmanagement\s+liability\b/i },
|
|
2505
|
+
{ codes: ["HOME"], pattern: /\bhomeowners?\s*(?:ho[-\s]?[35])?\b|\bho[-\s]?[35]\b/i },
|
|
2506
|
+
{ codes: ["HOME"], pattern: /\brenters?\b|\bho[-\s]?4\b/i },
|
|
2507
|
+
{ codes: ["HOME"], pattern: /\bcondo(?:minium)?\b|\bho[-\s]?6\b/i },
|
|
2508
|
+
{ codes: ["DFIRE"], pattern: /\bdwelling\s+fire\b/i },
|
|
2509
|
+
{ codes: ["MHOME"], pattern: /\bmobile\s+home\b|\bmanufactured\s+home\b/i },
|
|
2510
|
+
{ codes: ["AUTOP"], pattern: /\bpersonal\s+auto\b/i },
|
|
2511
|
+
{ codes: ["UMBRP"], pattern: /\bpersonal\s+umbrella\b/i },
|
|
2512
|
+
{ codes: ["FLOOD"], pattern: /\bflood\b/i },
|
|
2513
|
+
{ codes: ["EQ"], pattern: /\bearthquake\b/i },
|
|
2514
|
+
{ codes: ["INMRP"], pattern: /\bpersonal\s+(?:articles|inland\s+marine)\b/i },
|
|
2515
|
+
{ codes: ["BOAT"], pattern: /\bwatercraft\b|\bboat\s+insurance\b/i },
|
|
2516
|
+
{ codes: ["RECV"], pattern: /\brecreational\s+vehicle\b|\brv\s+insurance\b/i },
|
|
2517
|
+
{ codes: ["CFRM"], pattern: /\bfarm\b|\branch\b/i },
|
|
2518
|
+
{ codes: ["UN"], pattern: /\blife\s+insurance\b|\bterm\s+life\b|\bwhole\s+life\b|\buniversal\s+life\b/i },
|
|
2519
|
+
{ codes: ["DISAB"], pattern: /\bcritical\s+illness\b|\bdisability\s+insurance\b|\btotal\s+disability\b/i },
|
|
2520
|
+
{ codes: ["UN"], pattern: /\blong[-\s]?term\s+care\b|\bpet\s+insurance\b|\btravel\s+insurance\b|\bidentity\s+theft\b|\btitle\s+insurance\b/i }
|
|
2248
2521
|
];
|
|
2249
2522
|
function normalizeWhitespace(value) {
|
|
2250
2523
|
return value.replace(/\s+/g, " ").trim();
|
|
2251
2524
|
}
|
|
2252
|
-
function
|
|
2253
|
-
|
|
2254
|
-
const controlled = types.map((type) => type.trim().toLowerCase().replace(/\s+/g, " ")).map((type) => POLICY_TYPE_ALIASES[type] ?? type.replace(/[\s-]+/g, "_")).filter((type) => POLICY_TYPE_KEYS.has(type));
|
|
2255
|
-
const unique = [...new Set(controlled)].slice(0, 6);
|
|
2256
|
-
return unique.length ? unique : ["other"];
|
|
2525
|
+
function hasSpecificLineOfBusiness(codes) {
|
|
2526
|
+
return codes.some((code) => code !== "UN");
|
|
2257
2527
|
}
|
|
2258
|
-
function
|
|
2259
|
-
return types.some((type) => type !== "other");
|
|
2260
|
-
}
|
|
2261
|
-
function policyTypesFromText(value) {
|
|
2528
|
+
function linesOfBusinessFromText(value) {
|
|
2262
2529
|
const text = normalizeWhitespace(value ?? "");
|
|
2263
2530
|
if (!text) return [];
|
|
2264
|
-
const
|
|
2265
|
-
if (
|
|
2266
|
-
|
|
2531
|
+
const direct = toLobCodes([text]);
|
|
2532
|
+
if (direct.some((code) => code !== "UN") || isLobCode(text) || text.toUpperCase() === "UN") return direct;
|
|
2533
|
+
const inferred = LOB_TEXT_PATTERNS.flatMap(({ codes, pattern }) => pattern.test(text) ? codes : []);
|
|
2534
|
+
return Array.from(new Set(inferred));
|
|
2267
2535
|
}
|
|
2268
|
-
function
|
|
2536
|
+
function inferLinesOfBusinessFromOperationalCoverages(coverages) {
|
|
2269
2537
|
const inferred = [];
|
|
2270
2538
|
for (const coverage of coverages) {
|
|
2271
2539
|
const limits = coverage.limits ?? [];
|
|
@@ -2276,23 +2544,23 @@ function inferPolicyTypesFromOperationalCoverages(coverages) {
|
|
|
2276
2544
|
...limits.flatMap((term) => [term.appliesTo, term.label])
|
|
2277
2545
|
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
2278
2546
|
for (const value of text) {
|
|
2279
|
-
for (const
|
|
2280
|
-
if (!inferred.includes(
|
|
2547
|
+
for (const code of linesOfBusinessFromText(value)) {
|
|
2548
|
+
if (!inferred.includes(code)) inferred.push(code);
|
|
2281
2549
|
}
|
|
2282
2550
|
}
|
|
2283
2551
|
}
|
|
2284
2552
|
return inferred.slice(0, 6);
|
|
2285
2553
|
}
|
|
2286
|
-
function
|
|
2287
|
-
const inferred =
|
|
2288
|
-
if (inferred.
|
|
2289
|
-
return {
|
|
2554
|
+
function resolveOperationalProfileLinesOfBusiness(params) {
|
|
2555
|
+
const inferred = inferLinesOfBusinessFromOperationalCoverages(params.coverages ?? []);
|
|
2556
|
+
if (inferred.some((code) => code !== "UN")) {
|
|
2557
|
+
return { linesOfBusiness: inferred, source: "coverage" };
|
|
2290
2558
|
}
|
|
2291
|
-
const controlled =
|
|
2292
|
-
if (
|
|
2293
|
-
const existingControlled =
|
|
2294
|
-
if (
|
|
2295
|
-
return {
|
|
2559
|
+
const controlled = normalizeOperationalLinesOfBusiness(params.profileLinesOfBusiness);
|
|
2560
|
+
if (hasSpecificLineOfBusiness(controlled)) return { linesOfBusiness: controlled, source: "profile_hint" };
|
|
2561
|
+
const existingControlled = normalizeOperationalLinesOfBusiness(params.existingLinesOfBusiness);
|
|
2562
|
+
if (hasSpecificLineOfBusiness(existingControlled)) return { linesOfBusiness: existingControlled, source: "existing_hint" };
|
|
2563
|
+
return { linesOfBusiness: controlled, source: "default" };
|
|
2296
2564
|
}
|
|
2297
2565
|
|
|
2298
2566
|
// src/source/ids.ts
|
|
@@ -3524,7 +3792,7 @@ function shouldFailQualityGate(mode, status) {
|
|
|
3524
3792
|
}
|
|
3525
3793
|
|
|
3526
3794
|
// src/extraction/source-tree-extractor.ts
|
|
3527
|
-
import { z as
|
|
3795
|
+
import { z as z23 } from "zod";
|
|
3528
3796
|
|
|
3529
3797
|
// src/source/operational-profile.ts
|
|
3530
3798
|
function normalizeWhitespace4(value) {
|
|
@@ -3534,6 +3802,9 @@ function cleanValue(value) {
|
|
|
3534
3802
|
if (!value) return void 0;
|
|
3535
3803
|
return normalizeWhitespace4(value.replace(/^[\s:;#-]+|[\s;,.]+$/g, ""));
|
|
3536
3804
|
}
|
|
3805
|
+
function normalizedFactValue(value) {
|
|
3806
|
+
return value.toLowerCase().replace(/&/g, " and ").replace(/[.,#]/g, " ").replace(/\s+/g, " ").trim();
|
|
3807
|
+
}
|
|
3537
3808
|
var OPERATIONAL_COVERAGE_TERM_KINDS = /* @__PURE__ */ new Set([
|
|
3538
3809
|
"each_claim_limit",
|
|
3539
3810
|
"each_occurrence_limit",
|
|
@@ -3567,6 +3838,63 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3567
3838
|
sourceSpanIds: sourceSpanIds2
|
|
3568
3839
|
};
|
|
3569
3840
|
};
|
|
3841
|
+
const mergeDeclarationFact = (fact) => {
|
|
3842
|
+
if (!fact || typeof fact !== "object" || Array.isArray(fact)) return void 0;
|
|
3843
|
+
const record = fact;
|
|
3844
|
+
const field = typeof record.field === "string" ? cleanValue(record.field) : void 0;
|
|
3845
|
+
const value = typeof record.value === "string" ? cleanValue(record.value) : void 0;
|
|
3846
|
+
const sourceNodeIds2 = keepIds(record.sourceNodeIds, validNodeIds);
|
|
3847
|
+
const sourceSpanIds2 = keepIds(record.sourceSpanIds, validSpanIds);
|
|
3848
|
+
if (!field || !value || sourceNodeIds2.length === 0 && sourceSpanIds2.length === 0) return void 0;
|
|
3849
|
+
const address = record.address && typeof record.address === "object" && !Array.isArray(record.address) ? Object.fromEntries(
|
|
3850
|
+
Object.entries(record.address).flatMap(([key, item]) => {
|
|
3851
|
+
const text = typeof item === "string" ? cleanValue(item) : void 0;
|
|
3852
|
+
return text ? [[key, text]] : [];
|
|
3853
|
+
})
|
|
3854
|
+
) : void 0;
|
|
3855
|
+
return {
|
|
3856
|
+
field: [
|
|
3857
|
+
"namedInsured",
|
|
3858
|
+
"mailingAddress",
|
|
3859
|
+
"dba",
|
|
3860
|
+
"entityType",
|
|
3861
|
+
"taxId",
|
|
3862
|
+
"additionalNamedInsured",
|
|
3863
|
+
"policyNumber",
|
|
3864
|
+
"insurer",
|
|
3865
|
+
"broker",
|
|
3866
|
+
"effectiveDate",
|
|
3867
|
+
"expirationDate",
|
|
3868
|
+
"premium",
|
|
3869
|
+
"other"
|
|
3870
|
+
].includes(field) ? field : "other",
|
|
3871
|
+
label: typeof record.label === "string" ? cleanValue(record.label) : void 0,
|
|
3872
|
+
value,
|
|
3873
|
+
normalizedValue: typeof record.normalizedValue === "string" ? cleanValue(record.normalizedValue) : normalizedFactValue(value),
|
|
3874
|
+
valueKind: [
|
|
3875
|
+
"string",
|
|
3876
|
+
"number",
|
|
3877
|
+
"date",
|
|
3878
|
+
"money",
|
|
3879
|
+
"address",
|
|
3880
|
+
"list",
|
|
3881
|
+
"unknown"
|
|
3882
|
+
].includes(String(record.valueKind)) ? record.valueKind : "string",
|
|
3883
|
+
address,
|
|
3884
|
+
confidence: record.confidence === "high" || record.confidence === "low" || record.confidence === "medium" ? record.confidence : "medium",
|
|
3885
|
+
sourceNodeIds: sourceNodeIds2,
|
|
3886
|
+
sourceSpanIds: sourceSpanIds2
|
|
3887
|
+
};
|
|
3888
|
+
};
|
|
3889
|
+
const sourceBackedDeclarationFact = (field, value, valueKind = "string") => value ? {
|
|
3890
|
+
field,
|
|
3891
|
+
value: value.value,
|
|
3892
|
+
normalizedValue: value.normalizedValue ?? normalizedFactValue(value.value),
|
|
3893
|
+
valueKind,
|
|
3894
|
+
confidence: value.confidence,
|
|
3895
|
+
sourceNodeIds: value.sourceNodeIds,
|
|
3896
|
+
sourceSpanIds: value.sourceSpanIds
|
|
3897
|
+
} : void 0;
|
|
3570
3898
|
const policyNumber = mergeValue(base.policyNumber, candidate.policyNumber);
|
|
3571
3899
|
const namedInsured = mergeValue(base.namedInsured, candidate.namedInsured);
|
|
3572
3900
|
const insurer = mergeValue(base.insurer, candidate.insurer);
|
|
@@ -3575,6 +3903,22 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3575
3903
|
const expirationDate = mergeValue(base.expirationDate, candidate.expirationDate);
|
|
3576
3904
|
const retroactiveDate = mergeValue(base.retroactiveDate, candidate.retroactiveDate);
|
|
3577
3905
|
const premium = mergeValue(base.premium, candidate.premium);
|
|
3906
|
+
const candidateDeclarationFacts = Array.isArray(candidate.declarationFacts) ? candidate.declarationFacts.map(mergeDeclarationFact).filter((fact) => Boolean(fact)) : [];
|
|
3907
|
+
const declarationFacts = [
|
|
3908
|
+
...base.declarationFacts,
|
|
3909
|
+
sourceBackedDeclarationFact("policyNumber", policyNumber),
|
|
3910
|
+
sourceBackedDeclarationFact("namedInsured", namedInsured),
|
|
3911
|
+
sourceBackedDeclarationFact("insurer", insurer),
|
|
3912
|
+
sourceBackedDeclarationFact("broker", broker),
|
|
3913
|
+
sourceBackedDeclarationFact("effectiveDate", effectiveDate, "date"),
|
|
3914
|
+
sourceBackedDeclarationFact("expirationDate", expirationDate, "date"),
|
|
3915
|
+
sourceBackedDeclarationFact("premium", premium, "money"),
|
|
3916
|
+
...candidateDeclarationFacts
|
|
3917
|
+
].filter((fact) => Boolean(fact)).filter(
|
|
3918
|
+
(fact, index, rows) => rows.findIndex(
|
|
3919
|
+
(other) => other.field === fact.field && other.normalizedValue === fact.normalizedValue && other.sourceNodeIds.join(",") === fact.sourceNodeIds.join(",") && other.sourceSpanIds.join(",") === fact.sourceSpanIds.join(",")
|
|
3920
|
+
) === index
|
|
3921
|
+
);
|
|
3578
3922
|
const sourceValues = [
|
|
3579
3923
|
policyNumber,
|
|
3580
3924
|
namedInsured,
|
|
@@ -3679,6 +4023,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3679
4023
|
...base.sourceNodeIds,
|
|
3680
4024
|
...keepIds(candidate.sourceNodeIds, validNodeIds),
|
|
3681
4025
|
...sourceValues.flatMap((value) => value.sourceNodeIds),
|
|
4026
|
+
...declarationFacts.flatMap((fact) => fact.sourceNodeIds),
|
|
3682
4027
|
...coverages.flatMap((coverage) => coverage.sourceNodeIds),
|
|
3683
4028
|
...coverages.flatMap((coverage) => coverage.limits.flatMap((term) => term.sourceNodeIds)),
|
|
3684
4029
|
...parties.flatMap((party) => party.sourceNodeIds),
|
|
@@ -3688,6 +4033,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3688
4033
|
...base.sourceSpanIds,
|
|
3689
4034
|
...keepIds(candidate.sourceSpanIds, validSpanIds),
|
|
3690
4035
|
...sourceValues.flatMap((value) => value.sourceSpanIds),
|
|
4036
|
+
...declarationFacts.flatMap((fact) => fact.sourceSpanIds),
|
|
3691
4037
|
...coverages.flatMap((coverage) => coverage.sourceSpanIds),
|
|
3692
4038
|
...coverages.flatMap((coverage) => coverage.limits.flatMap((term) => term.sourceSpanIds)),
|
|
3693
4039
|
...parties.flatMap((party) => party.sourceSpanIds),
|
|
@@ -3697,15 +4043,17 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3697
4043
|
...base.warnings,
|
|
3698
4044
|
...Array.isArray(candidate.warnings) ? candidate.warnings.filter((warning) => typeof warning === "string" && warning.trim().length > 0) : []
|
|
3699
4045
|
];
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3702
|
-
|
|
4046
|
+
const candidateLinesOfBusiness = candidate.linesOfBusiness ?? candidate.policyTypes;
|
|
4047
|
+
const baseLinesOfBusiness = base.linesOfBusiness ?? base.policyTypes;
|
|
4048
|
+
const resolvedLinesOfBusiness = resolveOperationalProfileLinesOfBusiness({
|
|
4049
|
+
profileLinesOfBusiness: candidateLinesOfBusiness,
|
|
4050
|
+
existingLinesOfBusiness: baseLinesOfBusiness,
|
|
3703
4051
|
coverages
|
|
3704
4052
|
});
|
|
3705
4053
|
return PolicyOperationalProfileSchema.parse({
|
|
3706
4054
|
...base,
|
|
3707
4055
|
documentType: candidate.documentType === "policy" ? "policy" : base.documentType,
|
|
3708
|
-
|
|
4056
|
+
linesOfBusiness: resolvedLinesOfBusiness.linesOfBusiness,
|
|
3709
4057
|
policyNumber,
|
|
3710
4058
|
namedInsured,
|
|
3711
4059
|
insurer,
|
|
@@ -3714,6 +4062,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3714
4062
|
expirationDate,
|
|
3715
4063
|
retroactiveDate,
|
|
3716
4064
|
premium,
|
|
4065
|
+
declarationFacts,
|
|
3717
4066
|
coverages,
|
|
3718
4067
|
parties,
|
|
3719
4068
|
endorsementSupport,
|
|
@@ -3724,7 +4073,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3724
4073
|
}
|
|
3725
4074
|
|
|
3726
4075
|
// src/extraction/operational-profile-cleanup.ts
|
|
3727
|
-
import { z as
|
|
4076
|
+
import { z as z22 } from "zod";
|
|
3728
4077
|
var OPERATIONAL_COVERAGE_TERM_KINDS2 = [
|
|
3729
4078
|
"each_claim_limit",
|
|
3730
4079
|
"each_occurrence_limit",
|
|
@@ -3737,33 +4086,33 @@ var OPERATIONAL_COVERAGE_TERM_KINDS2 = [
|
|
|
3737
4086
|
"premium",
|
|
3738
4087
|
"other"
|
|
3739
4088
|
];
|
|
3740
|
-
var OperationalCoverageTermKindSchema =
|
|
3741
|
-
var OperationalProfileCleanupSchema =
|
|
3742
|
-
coverageDecisions:
|
|
3743
|
-
coverageIndex:
|
|
3744
|
-
action:
|
|
3745
|
-
reason:
|
|
3746
|
-
name:
|
|
3747
|
-
limit:
|
|
3748
|
-
deductible:
|
|
3749
|
-
premium:
|
|
3750
|
-
retroactiveDate:
|
|
3751
|
-
sourceNodeIds:
|
|
3752
|
-
sourceSpanIds:
|
|
3753
|
-
termDecisions:
|
|
3754
|
-
termIndex:
|
|
3755
|
-
action:
|
|
3756
|
-
reason:
|
|
4089
|
+
var OperationalCoverageTermKindSchema = z22.enum(OPERATIONAL_COVERAGE_TERM_KINDS2);
|
|
4090
|
+
var OperationalProfileCleanupSchema = z22.object({
|
|
4091
|
+
coverageDecisions: z22.array(z22.object({
|
|
4092
|
+
coverageIndex: z22.number().int().nonnegative(),
|
|
4093
|
+
action: z22.enum(["keep", "drop", "update"]),
|
|
4094
|
+
reason: z22.string().optional(),
|
|
4095
|
+
name: z22.string().optional(),
|
|
4096
|
+
limit: z22.string().nullable().optional(),
|
|
4097
|
+
deductible: z22.string().nullable().optional(),
|
|
4098
|
+
premium: z22.string().nullable().optional(),
|
|
4099
|
+
retroactiveDate: z22.string().nullable().optional(),
|
|
4100
|
+
sourceNodeIds: z22.array(z22.string()).optional(),
|
|
4101
|
+
sourceSpanIds: z22.array(z22.string()).optional(),
|
|
4102
|
+
termDecisions: z22.array(z22.object({
|
|
4103
|
+
termIndex: z22.number().int().nonnegative(),
|
|
4104
|
+
action: z22.enum(["keep", "drop", "update"]),
|
|
4105
|
+
reason: z22.string().optional(),
|
|
3757
4106
|
kind: OperationalCoverageTermKindSchema.optional(),
|
|
3758
|
-
label:
|
|
3759
|
-
value:
|
|
3760
|
-
amount:
|
|
3761
|
-
appliesTo:
|
|
3762
|
-
sourceNodeIds:
|
|
3763
|
-
sourceSpanIds:
|
|
4107
|
+
label: z22.string().optional(),
|
|
4108
|
+
value: z22.string().optional(),
|
|
4109
|
+
amount: z22.number().nullable().optional(),
|
|
4110
|
+
appliesTo: z22.string().nullable().optional(),
|
|
4111
|
+
sourceNodeIds: z22.array(z22.string()).optional(),
|
|
4112
|
+
sourceSpanIds: z22.array(z22.string()).optional()
|
|
3764
4113
|
})).optional()
|
|
3765
4114
|
})).default([]),
|
|
3766
|
-
warnings:
|
|
4115
|
+
warnings: z22.array(z22.string()).default([])
|
|
3767
4116
|
});
|
|
3768
4117
|
var CLEANUP_CANDIDATE_ID_LIMIT = 12;
|
|
3769
4118
|
var CLEANUP_SOURCE_NODE_LIMIT = 90;
|
|
@@ -3919,7 +4268,7 @@ function buildOperationalProfileCleanupPrompt(sourceTree, profile, options = {})
|
|
|
3919
4268
|
));
|
|
3920
4269
|
const candidate = {
|
|
3921
4270
|
documentType: profile.documentType,
|
|
3922
|
-
|
|
4271
|
+
linesOfBusiness: profile.linesOfBusiness,
|
|
3923
4272
|
coverages: coverageEntries.map(({ coverage, coverageIndex }) => compactCoverageForCleanup(coverage, coverageIndex))
|
|
3924
4273
|
};
|
|
3925
4274
|
return `Review and clean a source-backed operational profile projection for an insurance policy.
|
|
@@ -4217,16 +4566,50 @@ function applyOperationalProfileCleanup(profile, cleanup, validNodeIds, validSpa
|
|
|
4217
4566
|
}
|
|
4218
4567
|
|
|
4219
4568
|
// src/extraction/source-tree-extractor.ts
|
|
4220
|
-
var SourceBackedValueForPromptSchema =
|
|
4221
|
-
value:
|
|
4222
|
-
normalizedValue:
|
|
4223
|
-
confidence:
|
|
4224
|
-
sourceNodeIds:
|
|
4225
|
-
sourceSpanIds:
|
|
4226
|
-
});
|
|
4227
|
-
var
|
|
4228
|
-
|
|
4229
|
-
|
|
4569
|
+
var SourceBackedValueForPromptSchema = z23.object({
|
|
4570
|
+
value: z23.string(),
|
|
4571
|
+
normalizedValue: z23.string().optional(),
|
|
4572
|
+
confidence: z23.enum(["low", "medium", "high"]).optional(),
|
|
4573
|
+
sourceNodeIds: z23.array(z23.string()),
|
|
4574
|
+
sourceSpanIds: z23.array(z23.string())
|
|
4575
|
+
});
|
|
4576
|
+
var OperationalAddressForPromptSchema = z23.object({
|
|
4577
|
+
street1: z23.string().optional(),
|
|
4578
|
+
street2: z23.string().optional(),
|
|
4579
|
+
city: z23.string().optional(),
|
|
4580
|
+
state: z23.string().optional(),
|
|
4581
|
+
zip: z23.string().optional(),
|
|
4582
|
+
country: z23.string().optional(),
|
|
4583
|
+
formatted: z23.string().optional()
|
|
4584
|
+
});
|
|
4585
|
+
var OperationalDeclarationFactForPromptSchema = z23.object({
|
|
4586
|
+
field: z23.enum([
|
|
4587
|
+
"namedInsured",
|
|
4588
|
+
"mailingAddress",
|
|
4589
|
+
"dba",
|
|
4590
|
+
"entityType",
|
|
4591
|
+
"taxId",
|
|
4592
|
+
"additionalNamedInsured",
|
|
4593
|
+
"policyNumber",
|
|
4594
|
+
"insurer",
|
|
4595
|
+
"broker",
|
|
4596
|
+
"effectiveDate",
|
|
4597
|
+
"expirationDate",
|
|
4598
|
+
"premium",
|
|
4599
|
+
"other"
|
|
4600
|
+
]),
|
|
4601
|
+
label: z23.string().optional(),
|
|
4602
|
+
value: z23.string(),
|
|
4603
|
+
normalizedValue: z23.string().optional(),
|
|
4604
|
+
valueKind: z23.enum(["string", "number", "date", "money", "address", "list", "unknown"]).optional(),
|
|
4605
|
+
address: OperationalAddressForPromptSchema.optional(),
|
|
4606
|
+
confidence: z23.enum(["low", "medium", "high"]).optional(),
|
|
4607
|
+
sourceNodeIds: z23.array(z23.string()),
|
|
4608
|
+
sourceSpanIds: z23.array(z23.string())
|
|
4609
|
+
});
|
|
4610
|
+
var OperationalProfilePromptSchema = z23.object({
|
|
4611
|
+
documentType: z23.enum(["policy", "quote"]).optional(),
|
|
4612
|
+
linesOfBusiness: z23.array(z23.string()).optional(),
|
|
4230
4613
|
policyNumber: SourceBackedValueForPromptSchema.optional(),
|
|
4231
4614
|
namedInsured: SourceBackedValueForPromptSchema.optional(),
|
|
4232
4615
|
insurer: SourceBackedValueForPromptSchema.optional(),
|
|
@@ -4235,30 +4618,31 @@ var OperationalProfilePromptSchema = z22.object({
|
|
|
4235
4618
|
expirationDate: SourceBackedValueForPromptSchema.optional(),
|
|
4236
4619
|
retroactiveDate: SourceBackedValueForPromptSchema.optional(),
|
|
4237
4620
|
premium: SourceBackedValueForPromptSchema.optional(),
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4621
|
+
declarationFacts: z23.array(OperationalDeclarationFactForPromptSchema).optional(),
|
|
4622
|
+
coverages: z23.array(z23.object({
|
|
4623
|
+
name: z23.string(),
|
|
4624
|
+
coverageCode: z23.string().optional(),
|
|
4625
|
+
limit: z23.string().optional(),
|
|
4626
|
+
deductible: z23.string().optional(),
|
|
4627
|
+
premium: z23.string().optional(),
|
|
4628
|
+
retroactiveDate: z23.string().optional(),
|
|
4629
|
+
formNumber: z23.string().optional(),
|
|
4630
|
+
sectionRef: z23.string().optional(),
|
|
4631
|
+
endorsementNumber: z23.string().optional(),
|
|
4632
|
+
limits: z23.array(z23.object({
|
|
4249
4633
|
kind: OperationalCoverageTermKindSchema.optional(),
|
|
4250
|
-
label:
|
|
4251
|
-
value:
|
|
4252
|
-
amount:
|
|
4253
|
-
appliesTo:
|
|
4254
|
-
sourceNodeIds:
|
|
4255
|
-
sourceSpanIds:
|
|
4634
|
+
label: z23.string(),
|
|
4635
|
+
value: z23.string(),
|
|
4636
|
+
amount: z23.number().optional(),
|
|
4637
|
+
appliesTo: z23.string().optional(),
|
|
4638
|
+
sourceNodeIds: z23.array(z23.string()),
|
|
4639
|
+
sourceSpanIds: z23.array(z23.string())
|
|
4256
4640
|
})).optional(),
|
|
4257
|
-
sourceNodeIds:
|
|
4258
|
-
sourceSpanIds:
|
|
4641
|
+
sourceNodeIds: z23.array(z23.string()),
|
|
4642
|
+
sourceSpanIds: z23.array(z23.string())
|
|
4259
4643
|
})).optional(),
|
|
4260
|
-
sourceNodeIds:
|
|
4261
|
-
sourceSpanIds:
|
|
4644
|
+
sourceNodeIds: z23.array(z23.string()).optional(),
|
|
4645
|
+
sourceSpanIds: z23.array(z23.string()).optional()
|
|
4262
4646
|
});
|
|
4263
4647
|
function cleanText(value, fallback) {
|
|
4264
4648
|
const text = value?.replace(/\s+/g, " ").trim();
|
|
@@ -5265,7 +5649,8 @@ function operationalProfilePromptNodes(sourceTree) {
|
|
|
5265
5649
|
function emptyOperationalProfile() {
|
|
5266
5650
|
return {
|
|
5267
5651
|
documentType: "policy",
|
|
5268
|
-
|
|
5652
|
+
linesOfBusiness: ["UN"],
|
|
5653
|
+
declarationFacts: [],
|
|
5269
5654
|
coverages: [],
|
|
5270
5655
|
parties: [],
|
|
5271
5656
|
endorsementSupport: [],
|
|
@@ -5283,6 +5668,7 @@ function buildOperationalProfilePrompt(sourceTree, sourceSpans) {
|
|
|
5283
5668
|
|
|
5284
5669
|
Return only high-value operational facts needed for policy lists, Q&A, compliance, and certificate generation:
|
|
5285
5670
|
- policy number, named insured, insurer/carrier/security, broker/producer, policy period, retroactive date, premium
|
|
5671
|
+
- source-backed declarationFacts for named-insured identity details: named insured, mailing address, DBA, entity type, tax ID/FEIN, additional named insureds, and other durable declaration-page identity facts
|
|
5286
5672
|
- coverage units with their own nested limit terms, deductibles/retentions, retroactive dates, premiums, and form references
|
|
5287
5673
|
- coverage type labels
|
|
5288
5674
|
|
|
@@ -5291,6 +5677,8 @@ Rules:
|
|
|
5291
5677
|
- When citing an evidence entry, copy its sourceSpanId into the returned sourceSpanIds array.
|
|
5292
5678
|
- If a value is not directly supported, omit it.
|
|
5293
5679
|
- Prefer declarations, schedules, premium tables, and endorsement schedules over generic policy wording.
|
|
5680
|
+
- Put named-insured mailing address in declarationFacts[] with field "mailingAddress", valueKind "address", a user-facing value string, and structured address fields when present. Do not put producer, broker, insurer, mortgagee, loss-payee, or certificate-holder addresses in mailingAddress.
|
|
5681
|
+
- Put DBA or trade name in declarationFacts[] with field "dba"; entity/legal form in field "entityType"; FEIN/tax ID in field "taxId"; each additional named insured in field "additionalNamedInsured".
|
|
5294
5682
|
- For effective, expiration, retroactive, and other date fields, return a normalized YYYY-MM-DD value when the source date is unambiguous, including month-name dates such as "20 Feb 2026". Do not emit fragmented date text such as "20 2 2026".
|
|
5295
5683
|
- For broker/producer, extract the agency or company legal name, not the license role, credential, or type. In a block like "Bayshore Insurance Brokers, LLC" followed by "Surplus Lines Broker - CA License No. ...", broker.value must be "Bayshore Insurance Brokers, LLC"; the surplus-lines role and license number are not the broker name.
|
|
5296
5684
|
- On declarations pages, treat "Item N" labels as section boundaries. Use Item 6 or equivalent coverage-schedule rows for coverage limits, deductibles, aggregate terms, and retroactive dates; do not merge Item 7 premium, Item 8 ERP, Item 9 producer, or Item 10 forms into Item 6 coverage facts.
|
|
@@ -5364,6 +5752,60 @@ function provenanceOf(value) {
|
|
|
5364
5752
|
...value.sourceNodeIds[0] ? { documentNodeId: value.sourceNodeIds[0] } : {}
|
|
5365
5753
|
};
|
|
5366
5754
|
}
|
|
5755
|
+
function provenanceFromIds(sourceSpanIds, sourceNodeIds) {
|
|
5756
|
+
if (sourceSpanIds.length === 0) return void 0;
|
|
5757
|
+
return {
|
|
5758
|
+
sourceSpanIds,
|
|
5759
|
+
...sourceNodeIds[0] ? { documentNodeId: sourceNodeIds[0] } : {}
|
|
5760
|
+
};
|
|
5761
|
+
}
|
|
5762
|
+
function declarationFactsByField(profile, field) {
|
|
5763
|
+
return profile.declarationFacts.filter((fact) => fact.field === field && fact.value.trim());
|
|
5764
|
+
}
|
|
5765
|
+
function firstDeclarationFact(profile, field) {
|
|
5766
|
+
return declarationFactsByField(profile, field)[0];
|
|
5767
|
+
}
|
|
5768
|
+
function sourceBackedAddressFromFact(fact) {
|
|
5769
|
+
if (!fact?.address || fact.sourceSpanIds.length === 0) return void 0;
|
|
5770
|
+
const address = fact.address;
|
|
5771
|
+
if (!address.street1 || !address.city || !address.state || !address.zip) return void 0;
|
|
5772
|
+
return {
|
|
5773
|
+
street1: address.street1,
|
|
5774
|
+
street2: address.street2,
|
|
5775
|
+
city: address.city,
|
|
5776
|
+
state: address.state,
|
|
5777
|
+
zip: address.zip,
|
|
5778
|
+
country: address.country,
|
|
5779
|
+
...provenanceFromIds(fact.sourceSpanIds, fact.sourceNodeIds)
|
|
5780
|
+
};
|
|
5781
|
+
}
|
|
5782
|
+
function normalizedEntityType(value) {
|
|
5783
|
+
const normalized = cleanText(value, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
5784
|
+
if (normalized === "inc" || normalized === "incorporated" || normalized === "c_corporation" || normalized === "s_corporation") {
|
|
5785
|
+
return "corporation";
|
|
5786
|
+
}
|
|
5787
|
+
if (normalized === "limited_liability_company") return "llc";
|
|
5788
|
+
if (normalized === "non_profit") return "nonprofit";
|
|
5789
|
+
return [
|
|
5790
|
+
"corporation",
|
|
5791
|
+
"llc",
|
|
5792
|
+
"partnership",
|
|
5793
|
+
"sole_proprietor",
|
|
5794
|
+
"joint_venture",
|
|
5795
|
+
"trust",
|
|
5796
|
+
"nonprofit",
|
|
5797
|
+
"municipality",
|
|
5798
|
+
"individual",
|
|
5799
|
+
"married_couple",
|
|
5800
|
+
"other"
|
|
5801
|
+
].includes(normalized) ? normalized : void 0;
|
|
5802
|
+
}
|
|
5803
|
+
function declarationFieldName(fact) {
|
|
5804
|
+
if (fact.field === "mailingAddress") return "mailingAddress";
|
|
5805
|
+
if (fact.field === "taxId") return "fein";
|
|
5806
|
+
if (fact.field === "additionalNamedInsured") return "additionalNamedInsured";
|
|
5807
|
+
return fact.field;
|
|
5808
|
+
}
|
|
5367
5809
|
function materializeDocument(params) {
|
|
5368
5810
|
const profile = params.operationalProfile;
|
|
5369
5811
|
const policyNumber = valueOf(profile, "policyNumber") ?? "Unknown";
|
|
@@ -5375,6 +5817,15 @@ function materializeDocument(params) {
|
|
|
5375
5817
|
const insurerProvenance = provenanceOf(profile.insurer);
|
|
5376
5818
|
const broker = valueOf(profile, "broker");
|
|
5377
5819
|
const brokerProvenance = provenanceOf(profile.broker);
|
|
5820
|
+
const mailingAddressFact = firstDeclarationFact(profile, "mailingAddress");
|
|
5821
|
+
const insuredAddress = sourceBackedAddressFromFact(mailingAddressFact);
|
|
5822
|
+
const insuredDba = firstDeclarationFact(profile, "dba")?.value;
|
|
5823
|
+
const insuredEntityType = normalizedEntityType(firstDeclarationFact(profile, "entityType")?.value);
|
|
5824
|
+
const insuredFein = firstDeclarationFact(profile, "taxId")?.value;
|
|
5825
|
+
const additionalNamedInsureds = declarationFactsByField(profile, "additionalNamedInsured").flatMap((fact) => {
|
|
5826
|
+
const provenance = provenanceFromIds(fact.sourceSpanIds, fact.sourceNodeIds);
|
|
5827
|
+
return provenance ? [{ name: fact.value, ...provenance }] : [];
|
|
5828
|
+
});
|
|
5378
5829
|
const coverages = profile.coverages.map((coverage) => ({
|
|
5379
5830
|
name: coverage.name,
|
|
5380
5831
|
coverageCode: coverage.coverageCode,
|
|
@@ -5416,7 +5867,7 @@ function materializeDocument(params) {
|
|
|
5416
5867
|
carrier !== "Unknown" ? carrier : void 0,
|
|
5417
5868
|
policyNumber !== "Unknown" ? `#${policyNumber}` : void 0,
|
|
5418
5869
|
insuredName !== "Unknown" ? `for ${insuredName}` : void 0,
|
|
5419
|
-
profile.
|
|
5870
|
+
profile.linesOfBusiness.length ? `covering ${profile.linesOfBusiness.slice(0, 5).join(", ")}` : void 0
|
|
5420
5871
|
].filter(Boolean).join(" ");
|
|
5421
5872
|
const base = {
|
|
5422
5873
|
id: params.id,
|
|
@@ -5425,12 +5876,17 @@ function materializeDocument(params) {
|
|
|
5425
5876
|
security: carrier,
|
|
5426
5877
|
insuredName,
|
|
5427
5878
|
premium,
|
|
5879
|
+
insuredDba,
|
|
5880
|
+
insuredAddress,
|
|
5881
|
+
insuredEntityType,
|
|
5882
|
+
insuredFein,
|
|
5883
|
+
...additionalNamedInsureds.length > 0 ? { additionalNamedInsureds } : {},
|
|
5428
5884
|
...insurerProvenance ? { insurer: { legalName: carrier, ...insurerProvenance } } : {},
|
|
5429
5885
|
...broker && brokerProvenance ? {
|
|
5430
5886
|
brokerAgency: broker,
|
|
5431
5887
|
producer: { agencyName: broker, ...brokerProvenance }
|
|
5432
5888
|
} : {},
|
|
5433
|
-
|
|
5889
|
+
linesOfBusiness: profile.linesOfBusiness,
|
|
5434
5890
|
formInventory: params.formInventory.filter((form) => typeof form.formNumber === "string" && form.formNumber.trim().length > 0).map((form) => ({
|
|
5435
5891
|
formNumber: form.formNumber,
|
|
5436
5892
|
editionDate: form.editionDate,
|
|
@@ -5448,7 +5904,12 @@ function materializeDocument(params) {
|
|
|
5448
5904
|
profile.namedInsured ? { field: "namedInsured", value: profile.namedInsured.value, sourceSpanIds: profile.namedInsured.sourceSpanIds } : void 0,
|
|
5449
5905
|
profile.insurer ? { field: "insurer", value: profile.insurer.value, sourceSpanIds: profile.insurer.sourceSpanIds } : void 0,
|
|
5450
5906
|
profile.effectiveDate ? { field: "policyPeriodStart", value: profile.effectiveDate.value, sourceSpanIds: profile.effectiveDate.sourceSpanIds } : void 0,
|
|
5451
|
-
profile.expirationDate ? { field: "policyPeriodEnd", value: profile.expirationDate.value, sourceSpanIds: profile.expirationDate.sourceSpanIds } : void 0
|
|
5907
|
+
profile.expirationDate ? { field: "policyPeriodEnd", value: profile.expirationDate.value, sourceSpanIds: profile.expirationDate.sourceSpanIds } : void 0,
|
|
5908
|
+
...profile.declarationFacts.map((fact) => ({
|
|
5909
|
+
field: declarationFieldName(fact),
|
|
5910
|
+
value: fact.value,
|
|
5911
|
+
sourceSpanIds: fact.sourceSpanIds
|
|
5912
|
+
}))
|
|
5452
5913
|
].filter(Boolean)
|
|
5453
5914
|
},
|
|
5454
5915
|
supplementaryFacts: profile.endorsementSupport.map((item) => ({
|
|
@@ -5816,13 +6277,13 @@ function chunkDocument(doc) {
|
|
|
5816
6277
|
};
|
|
5817
6278
|
const chunks = [];
|
|
5818
6279
|
const docId = doc.id;
|
|
5819
|
-
const
|
|
6280
|
+
const linesOfBusinessStr = doc.linesOfBusiness?.length ? doc.linesOfBusiness.join(",") : void 0;
|
|
5820
6281
|
const extendedDoc = doc;
|
|
5821
6282
|
function stringMetadata(entries) {
|
|
5822
6283
|
const base = Object.fromEntries(
|
|
5823
6284
|
Object.entries(entries).filter(([, value]) => value !== void 0 && value !== null && String(value).length > 0).map(([key, value]) => [key, String(value)])
|
|
5824
6285
|
);
|
|
5825
|
-
if (
|
|
6286
|
+
if (linesOfBusinessStr) base.linesOfBusiness = linesOfBusinessStr;
|
|
5826
6287
|
return base;
|
|
5827
6288
|
}
|
|
5828
6289
|
function lines(values) {
|
|
@@ -5856,7 +6317,7 @@ function chunkDocument(doc) {
|
|
|
5856
6317
|
doc.isRenewal != null ? `Renewal: ${doc.isRenewal ? "Yes" : "No"}` : null,
|
|
5857
6318
|
doc.isPackage != null ? `Package: ${doc.isPackage ? "Yes" : "No"}` : null,
|
|
5858
6319
|
doc.security ? `Security: ${doc.security}` : null,
|
|
5859
|
-
doc.
|
|
6320
|
+
doc.linesOfBusiness?.length ? `Lines of Business: ${doc.linesOfBusiness.join(", ")}` : null
|
|
5860
6321
|
]),
|
|
5861
6322
|
{ carrier: doc.carrier, documentType: doc.type }
|
|
5862
6323
|
);
|
|
@@ -7191,8 +7652,8 @@ Respond with JSON only:
|
|
|
7191
7652
|
}`;
|
|
7192
7653
|
|
|
7193
7654
|
// src/schemas/application.ts
|
|
7194
|
-
import { z as
|
|
7195
|
-
var FieldTypeSchema =
|
|
7655
|
+
import { z as z24 } from "zod";
|
|
7656
|
+
var FieldTypeSchema = z24.enum([
|
|
7196
7657
|
"text",
|
|
7197
7658
|
"numeric",
|
|
7198
7659
|
"currency",
|
|
@@ -7201,223 +7662,223 @@ var FieldTypeSchema = z23.enum([
|
|
|
7201
7662
|
"table",
|
|
7202
7663
|
"declaration"
|
|
7203
7664
|
]);
|
|
7204
|
-
var ApplicationFieldSchema =
|
|
7205
|
-
id:
|
|
7206
|
-
label:
|
|
7207
|
-
section:
|
|
7665
|
+
var ApplicationFieldSchema = z24.object({
|
|
7666
|
+
id: z24.string(),
|
|
7667
|
+
label: z24.string(),
|
|
7668
|
+
section: z24.string(),
|
|
7208
7669
|
fieldType: FieldTypeSchema,
|
|
7209
|
-
required:
|
|
7210
|
-
options:
|
|
7211
|
-
columns:
|
|
7212
|
-
requiresExplanationIfYes:
|
|
7213
|
-
condition:
|
|
7214
|
-
dependsOn:
|
|
7215
|
-
whenValue:
|
|
7670
|
+
required: z24.boolean(),
|
|
7671
|
+
options: z24.array(z24.string()).optional(),
|
|
7672
|
+
columns: z24.array(z24.string()).optional(),
|
|
7673
|
+
requiresExplanationIfYes: z24.boolean().optional(),
|
|
7674
|
+
condition: z24.object({
|
|
7675
|
+
dependsOn: z24.string(),
|
|
7676
|
+
whenValue: z24.string()
|
|
7216
7677
|
}).optional(),
|
|
7217
|
-
value:
|
|
7218
|
-
source:
|
|
7219
|
-
confidence:
|
|
7220
|
-
sourceSpanIds:
|
|
7221
|
-
userSourceSpanIds:
|
|
7222
|
-
pageNumber:
|
|
7223
|
-
fieldAnchorId:
|
|
7224
|
-
acroFormName:
|
|
7225
|
-
validationStatus:
|
|
7226
|
-
});
|
|
7227
|
-
var ApplicationQuestionConditionSchema =
|
|
7228
|
-
dependsOn:
|
|
7229
|
-
operator:
|
|
7230
|
-
value:
|
|
7231
|
-
whenValue:
|
|
7232
|
-
values:
|
|
7233
|
-
});
|
|
7234
|
-
var ApplicationRepeatSchema =
|
|
7235
|
-
min:
|
|
7236
|
-
max:
|
|
7237
|
-
label:
|
|
7238
|
-
});
|
|
7239
|
-
var ApplicationQuestionNodeSchema =
|
|
7240
|
-
() =>
|
|
7241
|
-
id:
|
|
7242
|
-
nodeType:
|
|
7243
|
-
fieldId:
|
|
7244
|
-
fieldPath:
|
|
7245
|
-
parentId:
|
|
7246
|
-
order:
|
|
7247
|
-
label:
|
|
7248
|
-
section:
|
|
7678
|
+
value: z24.string().optional(),
|
|
7679
|
+
source: z24.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
|
|
7680
|
+
confidence: z24.enum(["confirmed", "high", "medium", "low"]).optional(),
|
|
7681
|
+
sourceSpanIds: z24.array(z24.string()).optional().describe("Stable source spans that support the field value or field anchor"),
|
|
7682
|
+
userSourceSpanIds: z24.array(z24.string()).optional().describe("Message or attachment spans that support user-provided values"),
|
|
7683
|
+
pageNumber: z24.number().int().positive().optional().describe("Application page where the field label or anchor appears"),
|
|
7684
|
+
fieldAnchorId: z24.string().optional().describe("Stable field anchor ID derived from page, section, label, and form metadata"),
|
|
7685
|
+
acroFormName: z24.string().optional().describe("Native PDF AcroForm field name when available"),
|
|
7686
|
+
validationStatus: z24.enum(["valid", "needs_review", "unsupported", "missing"]).optional()
|
|
7687
|
+
});
|
|
7688
|
+
var ApplicationQuestionConditionSchema = z24.object({
|
|
7689
|
+
dependsOn: z24.string(),
|
|
7690
|
+
operator: z24.enum(["equals", "not_equals", "in", "not_in", "exists"]).optional(),
|
|
7691
|
+
value: z24.string().optional(),
|
|
7692
|
+
whenValue: z24.string().optional(),
|
|
7693
|
+
values: z24.array(z24.string()).optional()
|
|
7694
|
+
});
|
|
7695
|
+
var ApplicationRepeatSchema = z24.object({
|
|
7696
|
+
min: z24.number().int().nonnegative().optional(),
|
|
7697
|
+
max: z24.number().int().positive().optional(),
|
|
7698
|
+
label: z24.string().optional()
|
|
7699
|
+
});
|
|
7700
|
+
var ApplicationQuestionNodeSchema = z24.lazy(
|
|
7701
|
+
() => z24.object({
|
|
7702
|
+
id: z24.string(),
|
|
7703
|
+
nodeType: z24.enum(["group", "question", "repeat_group", "table"]),
|
|
7704
|
+
fieldId: z24.string().optional(),
|
|
7705
|
+
fieldPath: z24.string().optional(),
|
|
7706
|
+
parentId: z24.string().optional(),
|
|
7707
|
+
order: z24.number().int().nonnegative().optional(),
|
|
7708
|
+
label: z24.string(),
|
|
7709
|
+
section: z24.string().optional(),
|
|
7249
7710
|
fieldType: FieldTypeSchema.optional(),
|
|
7250
|
-
required:
|
|
7251
|
-
prompt:
|
|
7252
|
-
options:
|
|
7253
|
-
columns:
|
|
7711
|
+
required: z24.boolean().optional(),
|
|
7712
|
+
prompt: z24.string().optional(),
|
|
7713
|
+
options: z24.array(z24.string()).optional(),
|
|
7714
|
+
columns: z24.array(z24.string()).optional(),
|
|
7254
7715
|
condition: ApplicationQuestionConditionSchema.optional(),
|
|
7255
7716
|
repeat: ApplicationRepeatSchema.optional(),
|
|
7256
|
-
children:
|
|
7717
|
+
children: z24.array(ApplicationQuestionNodeSchema).optional()
|
|
7257
7718
|
})
|
|
7258
7719
|
);
|
|
7259
|
-
var ApplicationQuestionGraphSchema =
|
|
7260
|
-
id:
|
|
7261
|
-
version:
|
|
7262
|
-
title:
|
|
7263
|
-
applicationType:
|
|
7264
|
-
source:
|
|
7265
|
-
rootNodeIds:
|
|
7266
|
-
nodes:
|
|
7267
|
-
});
|
|
7268
|
-
var ApplicationTemplateSchema =
|
|
7269
|
-
id:
|
|
7270
|
-
version:
|
|
7271
|
-
title:
|
|
7272
|
-
applicationType:
|
|
7720
|
+
var ApplicationQuestionGraphSchema = z24.object({
|
|
7721
|
+
id: z24.string(),
|
|
7722
|
+
version: z24.string(),
|
|
7723
|
+
title: z24.string().optional(),
|
|
7724
|
+
applicationType: z24.string().nullable().optional(),
|
|
7725
|
+
source: z24.enum(["pdf", "manual", "imported", "generated"]).default("generated"),
|
|
7726
|
+
rootNodeIds: z24.array(z24.string()).optional(),
|
|
7727
|
+
nodes: z24.array(ApplicationQuestionNodeSchema)
|
|
7728
|
+
});
|
|
7729
|
+
var ApplicationTemplateSchema = z24.object({
|
|
7730
|
+
id: z24.string(),
|
|
7731
|
+
version: z24.string(),
|
|
7732
|
+
title: z24.string(),
|
|
7733
|
+
applicationType: z24.string().nullable().optional(),
|
|
7273
7734
|
questionGraph: ApplicationQuestionGraphSchema,
|
|
7274
|
-
fields:
|
|
7735
|
+
fields: z24.array(ApplicationFieldSchema).optional()
|
|
7275
7736
|
});
|
|
7276
|
-
var ApplicationClassifyResultSchema =
|
|
7277
|
-
isApplication:
|
|
7278
|
-
confidence:
|
|
7279
|
-
applicationType:
|
|
7280
|
-
});
|
|
7281
|
-
var FieldExtractionResultSchema =
|
|
7282
|
-
fields:
|
|
7283
|
-
});
|
|
7284
|
-
var AutoFillMatchSchema =
|
|
7285
|
-
fieldId:
|
|
7286
|
-
value:
|
|
7287
|
-
confidence:
|
|
7288
|
-
contextKey:
|
|
7289
|
-
});
|
|
7290
|
-
var AutoFillResultSchema =
|
|
7291
|
-
matches:
|
|
7292
|
-
});
|
|
7293
|
-
var QuestionBatchResultSchema =
|
|
7294
|
-
batches:
|
|
7295
|
-
});
|
|
7296
|
-
var LookupRequestSchema =
|
|
7297
|
-
type:
|
|
7298
|
-
description:
|
|
7299
|
-
url:
|
|
7300
|
-
targetFieldIds:
|
|
7301
|
-
});
|
|
7302
|
-
var ReplyIntentSchema =
|
|
7303
|
-
primaryIntent:
|
|
7304
|
-
hasAnswers:
|
|
7305
|
-
questionText:
|
|
7306
|
-
questionFieldIds:
|
|
7307
|
-
lookupRequests:
|
|
7308
|
-
});
|
|
7309
|
-
var ParsedAnswerSchema =
|
|
7310
|
-
fieldId:
|
|
7311
|
-
value:
|
|
7312
|
-
explanation:
|
|
7313
|
-
});
|
|
7314
|
-
var AnswerParsingResultSchema =
|
|
7315
|
-
answers:
|
|
7316
|
-
unanswered:
|
|
7317
|
-
});
|
|
7318
|
-
var LookupFillSchema =
|
|
7319
|
-
fieldId:
|
|
7320
|
-
value:
|
|
7321
|
-
source:
|
|
7322
|
-
sourceSpanIds:
|
|
7323
|
-
});
|
|
7324
|
-
var LookupFillResultSchema =
|
|
7325
|
-
fills:
|
|
7326
|
-
unfillable:
|
|
7327
|
-
explanation:
|
|
7328
|
-
});
|
|
7329
|
-
var FlatPdfPlacementSchema =
|
|
7330
|
-
fieldId:
|
|
7331
|
-
page:
|
|
7332
|
-
x:
|
|
7333
|
-
y:
|
|
7334
|
-
text:
|
|
7335
|
-
fontSize:
|
|
7336
|
-
isCheckmark:
|
|
7337
|
-
});
|
|
7338
|
-
var AcroFormMappingSchema =
|
|
7339
|
-
fieldId:
|
|
7340
|
-
acroFormName:
|
|
7341
|
-
value:
|
|
7342
|
-
});
|
|
7343
|
-
var QualityGateStatusSchema =
|
|
7344
|
-
var QualitySeveritySchema =
|
|
7345
|
-
var ApplicationQualityIssueSchema =
|
|
7346
|
-
code:
|
|
7737
|
+
var ApplicationClassifyResultSchema = z24.object({
|
|
7738
|
+
isApplication: z24.boolean(),
|
|
7739
|
+
confidence: z24.number().min(0).max(1),
|
|
7740
|
+
applicationType: z24.string().nullable()
|
|
7741
|
+
});
|
|
7742
|
+
var FieldExtractionResultSchema = z24.object({
|
|
7743
|
+
fields: z24.array(ApplicationFieldSchema)
|
|
7744
|
+
});
|
|
7745
|
+
var AutoFillMatchSchema = z24.object({
|
|
7746
|
+
fieldId: z24.string(),
|
|
7747
|
+
value: z24.string(),
|
|
7748
|
+
confidence: z24.enum(["confirmed"]),
|
|
7749
|
+
contextKey: z24.string()
|
|
7750
|
+
});
|
|
7751
|
+
var AutoFillResultSchema = z24.object({
|
|
7752
|
+
matches: z24.array(AutoFillMatchSchema)
|
|
7753
|
+
});
|
|
7754
|
+
var QuestionBatchResultSchema = z24.object({
|
|
7755
|
+
batches: z24.array(z24.array(z24.string()).describe("Array of field IDs in this batch"))
|
|
7756
|
+
});
|
|
7757
|
+
var LookupRequestSchema = z24.object({
|
|
7758
|
+
type: z24.string().describe("Type of lookup: 'records', 'website', 'policy'"),
|
|
7759
|
+
description: z24.string(),
|
|
7760
|
+
url: z24.string().optional(),
|
|
7761
|
+
targetFieldIds: z24.array(z24.string())
|
|
7762
|
+
});
|
|
7763
|
+
var ReplyIntentSchema = z24.object({
|
|
7764
|
+
primaryIntent: z24.enum(["answers_only", "question", "lookup_request", "mixed"]),
|
|
7765
|
+
hasAnswers: z24.boolean(),
|
|
7766
|
+
questionText: z24.string().optional(),
|
|
7767
|
+
questionFieldIds: z24.array(z24.string()).optional(),
|
|
7768
|
+
lookupRequests: z24.array(LookupRequestSchema).optional()
|
|
7769
|
+
});
|
|
7770
|
+
var ParsedAnswerSchema = z24.object({
|
|
7771
|
+
fieldId: z24.string(),
|
|
7772
|
+
value: z24.string(),
|
|
7773
|
+
explanation: z24.string().optional()
|
|
7774
|
+
});
|
|
7775
|
+
var AnswerParsingResultSchema = z24.object({
|
|
7776
|
+
answers: z24.array(ParsedAnswerSchema),
|
|
7777
|
+
unanswered: z24.array(z24.string()).describe("Field IDs that were not answered")
|
|
7778
|
+
});
|
|
7779
|
+
var LookupFillSchema = z24.object({
|
|
7780
|
+
fieldId: z24.string(),
|
|
7781
|
+
value: z24.string(),
|
|
7782
|
+
source: z24.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'"),
|
|
7783
|
+
sourceSpanIds: z24.array(z24.string()).optional()
|
|
7784
|
+
});
|
|
7785
|
+
var LookupFillResultSchema = z24.object({
|
|
7786
|
+
fills: z24.array(LookupFillSchema),
|
|
7787
|
+
unfillable: z24.array(z24.string()),
|
|
7788
|
+
explanation: z24.string().optional()
|
|
7789
|
+
});
|
|
7790
|
+
var FlatPdfPlacementSchema = z24.object({
|
|
7791
|
+
fieldId: z24.string(),
|
|
7792
|
+
page: z24.number(),
|
|
7793
|
+
x: z24.number().describe("Percentage from left edge (0-100)"),
|
|
7794
|
+
y: z24.number().describe("Percentage from top edge (0-100)"),
|
|
7795
|
+
text: z24.string(),
|
|
7796
|
+
fontSize: z24.number().optional(),
|
|
7797
|
+
isCheckmark: z24.boolean().optional()
|
|
7798
|
+
});
|
|
7799
|
+
var AcroFormMappingSchema = z24.object({
|
|
7800
|
+
fieldId: z24.string(),
|
|
7801
|
+
acroFormName: z24.string(),
|
|
7802
|
+
value: z24.string()
|
|
7803
|
+
});
|
|
7804
|
+
var QualityGateStatusSchema = z24.enum(["passed", "warning", "failed"]);
|
|
7805
|
+
var QualitySeveritySchema = z24.enum(["info", "warning", "blocking"]);
|
|
7806
|
+
var ApplicationQualityIssueSchema = z24.object({
|
|
7807
|
+
code: z24.string(),
|
|
7347
7808
|
severity: QualitySeveritySchema,
|
|
7348
|
-
message:
|
|
7349
|
-
fieldId:
|
|
7809
|
+
message: z24.string(),
|
|
7810
|
+
fieldId: z24.string().optional()
|
|
7350
7811
|
});
|
|
7351
|
-
var ApplicationQualityRoundSchema =
|
|
7352
|
-
round:
|
|
7353
|
-
kind:
|
|
7812
|
+
var ApplicationQualityRoundSchema = z24.object({
|
|
7813
|
+
round: z24.number(),
|
|
7814
|
+
kind: z24.string(),
|
|
7354
7815
|
status: QualityGateStatusSchema,
|
|
7355
|
-
summary:
|
|
7816
|
+
summary: z24.string().optional()
|
|
7356
7817
|
});
|
|
7357
|
-
var ApplicationQualityArtifactSchema =
|
|
7358
|
-
kind:
|
|
7359
|
-
label:
|
|
7360
|
-
itemCount:
|
|
7818
|
+
var ApplicationQualityArtifactSchema = z24.object({
|
|
7819
|
+
kind: z24.string(),
|
|
7820
|
+
label: z24.string().optional(),
|
|
7821
|
+
itemCount: z24.number().optional()
|
|
7361
7822
|
});
|
|
7362
|
-
var ApplicationEmailReviewSchema =
|
|
7363
|
-
issues:
|
|
7823
|
+
var ApplicationEmailReviewSchema = z24.object({
|
|
7824
|
+
issues: z24.array(ApplicationQualityIssueSchema),
|
|
7364
7825
|
qualityGateStatus: QualityGateStatusSchema
|
|
7365
7826
|
});
|
|
7366
|
-
var ApplicationQualityReportSchema =
|
|
7367
|
-
issues:
|
|
7368
|
-
rounds:
|
|
7369
|
-
artifacts:
|
|
7827
|
+
var ApplicationQualityReportSchema = z24.object({
|
|
7828
|
+
issues: z24.array(ApplicationQualityIssueSchema),
|
|
7829
|
+
rounds: z24.array(ApplicationQualityRoundSchema).optional(),
|
|
7830
|
+
artifacts: z24.array(ApplicationQualityArtifactSchema).optional(),
|
|
7370
7831
|
emailReview: ApplicationEmailReviewSchema.optional(),
|
|
7371
7832
|
qualityGateStatus: QualityGateStatusSchema
|
|
7372
7833
|
});
|
|
7373
|
-
var ApplicationContextProposalSchema =
|
|
7374
|
-
id:
|
|
7375
|
-
fieldId:
|
|
7376
|
-
key:
|
|
7377
|
-
value:
|
|
7378
|
-
category:
|
|
7379
|
-
source:
|
|
7380
|
-
confidence:
|
|
7381
|
-
sourceSpanIds:
|
|
7382
|
-
userSourceSpanIds:
|
|
7383
|
-
});
|
|
7384
|
-
var ApplicationPacketAnswerSchema =
|
|
7385
|
-
fieldId:
|
|
7386
|
-
label:
|
|
7387
|
-
section:
|
|
7388
|
-
value:
|
|
7389
|
-
source:
|
|
7390
|
-
confidence:
|
|
7391
|
-
sourceSpanIds:
|
|
7392
|
-
userSourceSpanIds:
|
|
7393
|
-
});
|
|
7394
|
-
var ApplicationPacketSchema =
|
|
7395
|
-
id:
|
|
7396
|
-
applicationId:
|
|
7397
|
-
title:
|
|
7398
|
-
status:
|
|
7399
|
-
answers:
|
|
7400
|
-
missingFieldIds:
|
|
7834
|
+
var ApplicationContextProposalSchema = z24.object({
|
|
7835
|
+
id: z24.string(),
|
|
7836
|
+
fieldId: z24.string().optional(),
|
|
7837
|
+
key: z24.string(),
|
|
7838
|
+
value: z24.string(),
|
|
7839
|
+
category: z24.string(),
|
|
7840
|
+
source: z24.enum(["application", "user", "lookup", "policy", "email", "chat", "imessage", "mcp"]),
|
|
7841
|
+
confidence: z24.enum(["confirmed", "high", "medium", "low"]),
|
|
7842
|
+
sourceSpanIds: z24.array(z24.string()).optional(),
|
|
7843
|
+
userSourceSpanIds: z24.array(z24.string()).optional()
|
|
7844
|
+
});
|
|
7845
|
+
var ApplicationPacketAnswerSchema = z24.object({
|
|
7846
|
+
fieldId: z24.string(),
|
|
7847
|
+
label: z24.string(),
|
|
7848
|
+
section: z24.string(),
|
|
7849
|
+
value: z24.string(),
|
|
7850
|
+
source: z24.string(),
|
|
7851
|
+
confidence: z24.enum(["confirmed", "high", "medium", "low"]).optional(),
|
|
7852
|
+
sourceSpanIds: z24.array(z24.string()).optional(),
|
|
7853
|
+
userSourceSpanIds: z24.array(z24.string()).optional()
|
|
7854
|
+
});
|
|
7855
|
+
var ApplicationPacketSchema = z24.object({
|
|
7856
|
+
id: z24.string(),
|
|
7857
|
+
applicationId: z24.string(),
|
|
7858
|
+
title: z24.string(),
|
|
7859
|
+
status: z24.enum(["draft", "broker_ready", "submitted"]),
|
|
7860
|
+
answers: z24.array(ApplicationPacketAnswerSchema),
|
|
7861
|
+
missingFieldIds: z24.array(z24.string()),
|
|
7401
7862
|
qualityReport: ApplicationQualityReportSchema,
|
|
7402
|
-
submissionNotes:
|
|
7403
|
-
createdAt:
|
|
7404
|
-
});
|
|
7405
|
-
var ApplicationStateSchema =
|
|
7406
|
-
id:
|
|
7407
|
-
pdfBase64:
|
|
7408
|
-
templateId:
|
|
7409
|
-
templateVersion:
|
|
7863
|
+
submissionNotes: z24.string().optional(),
|
|
7864
|
+
createdAt: z24.number()
|
|
7865
|
+
});
|
|
7866
|
+
var ApplicationStateSchema = z24.object({
|
|
7867
|
+
id: z24.string(),
|
|
7868
|
+
pdfBase64: z24.string().optional().describe("Original PDF, omitted after extraction"),
|
|
7869
|
+
templateId: z24.string().optional(),
|
|
7870
|
+
templateVersion: z24.string().optional(),
|
|
7410
7871
|
templateSnapshot: ApplicationTemplateSchema.optional(),
|
|
7411
|
-
title:
|
|
7412
|
-
applicationType:
|
|
7872
|
+
title: z24.string().optional(),
|
|
7873
|
+
applicationType: z24.string().nullable().optional(),
|
|
7413
7874
|
questionGraph: ApplicationQuestionGraphSchema.optional(),
|
|
7414
|
-
fields:
|
|
7415
|
-
batches:
|
|
7416
|
-
currentBatchIndex:
|
|
7417
|
-
contextProposals:
|
|
7875
|
+
fields: z24.array(ApplicationFieldSchema),
|
|
7876
|
+
batches: z24.array(z24.array(z24.string())).optional(),
|
|
7877
|
+
currentBatchIndex: z24.number().default(0),
|
|
7878
|
+
contextProposals: z24.array(ApplicationContextProposalSchema).optional(),
|
|
7418
7879
|
packet: ApplicationPacketSchema.optional(),
|
|
7419
7880
|
qualityReport: ApplicationQualityReportSchema.optional(),
|
|
7420
|
-
status:
|
|
7881
|
+
status: z24.enum([
|
|
7421
7882
|
"classifying",
|
|
7422
7883
|
"extracting",
|
|
7423
7884
|
"auto_filling",
|
|
@@ -7431,8 +7892,8 @@ var ApplicationStateSchema = z23.object({
|
|
|
7431
7892
|
"cancelled",
|
|
7432
7893
|
"complete"
|
|
7433
7894
|
]),
|
|
7434
|
-
createdAt:
|
|
7435
|
-
updatedAt:
|
|
7895
|
+
createdAt: z24.number(),
|
|
7896
|
+
updatedAt: z24.number()
|
|
7436
7897
|
});
|
|
7437
7898
|
|
|
7438
7899
|
// src/application/agents/classifier.ts
|
|
@@ -9166,106 +9627,106 @@ Respond with the final answer, deduplicated citations array, overall confidence
|
|
|
9166
9627
|
}
|
|
9167
9628
|
|
|
9168
9629
|
// src/schemas/query.ts
|
|
9169
|
-
import { z as
|
|
9170
|
-
var QueryIntentSchema =
|
|
9630
|
+
import { z as z25 } from "zod";
|
|
9631
|
+
var QueryIntentSchema = z25.enum([
|
|
9171
9632
|
"policy_question",
|
|
9172
9633
|
"coverage_comparison",
|
|
9173
9634
|
"document_search",
|
|
9174
9635
|
"claims_inquiry",
|
|
9175
9636
|
"general_knowledge"
|
|
9176
9637
|
]);
|
|
9177
|
-
var QueryAttachmentKindSchema =
|
|
9178
|
-
var QueryAttachmentSchema =
|
|
9179
|
-
id:
|
|
9638
|
+
var QueryAttachmentKindSchema = z25.enum(["image", "pdf", "text"]);
|
|
9639
|
+
var QueryAttachmentSchema = z25.object({
|
|
9640
|
+
id: z25.string().optional().describe("Optional stable attachment ID from the caller"),
|
|
9180
9641
|
kind: QueryAttachmentKindSchema,
|
|
9181
|
-
name:
|
|
9182
|
-
mimeType:
|
|
9183
|
-
base64:
|
|
9184
|
-
text:
|
|
9185
|
-
description:
|
|
9642
|
+
name: z25.string().optional().describe("Original filename or user-facing label"),
|
|
9643
|
+
mimeType: z25.string().optional().describe("MIME type such as image/jpeg or application/pdf"),
|
|
9644
|
+
base64: z25.string().optional().describe("Base64-encoded file content for image/pdf attachments"),
|
|
9645
|
+
text: z25.string().optional().describe("Plain-text attachment content when available"),
|
|
9646
|
+
description: z25.string().optional().describe("Caller-provided description of the attachment")
|
|
9186
9647
|
});
|
|
9187
|
-
var QueryRetrievalModeSchema =
|
|
9648
|
+
var QueryRetrievalModeSchema = z25.enum([
|
|
9188
9649
|
"graph_only",
|
|
9189
9650
|
"source_rag",
|
|
9190
9651
|
"long_context",
|
|
9191
9652
|
"hybrid"
|
|
9192
9653
|
]);
|
|
9193
|
-
var SubQuestionSchema =
|
|
9194
|
-
question:
|
|
9654
|
+
var SubQuestionSchema = z25.object({
|
|
9655
|
+
question: z25.string().describe("Atomic sub-question to retrieve and answer independently"),
|
|
9195
9656
|
intent: QueryIntentSchema,
|
|
9196
|
-
chunkTypes:
|
|
9197
|
-
documentFilters:
|
|
9198
|
-
type:
|
|
9199
|
-
carrier:
|
|
9200
|
-
insuredName:
|
|
9201
|
-
policyNumber:
|
|
9202
|
-
quoteNumber:
|
|
9203
|
-
|
|
9657
|
+
chunkTypes: z25.array(z25.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
|
|
9658
|
+
documentFilters: z25.object({
|
|
9659
|
+
type: z25.enum(["policy", "quote"]).optional(),
|
|
9660
|
+
carrier: z25.string().optional(),
|
|
9661
|
+
insuredName: z25.string().optional(),
|
|
9662
|
+
policyNumber: z25.string().optional(),
|
|
9663
|
+
quoteNumber: z25.string().optional(),
|
|
9664
|
+
linesOfBusiness: z25.array(AcordLobCodeSchema).optional().describe("Filter by ACORD line of business code (e.g. HOME, AUTOP, DISAB) to avoid mixing up similar policies")
|
|
9204
9665
|
}).optional().describe("Structured filters to narrow document lookup")
|
|
9205
9666
|
});
|
|
9206
|
-
var QueryClassifyResultSchema =
|
|
9667
|
+
var QueryClassifyResultSchema = z25.object({
|
|
9207
9668
|
intent: QueryIntentSchema,
|
|
9208
|
-
subQuestions:
|
|
9209
|
-
requiresDocumentLookup:
|
|
9210
|
-
requiresChunkSearch:
|
|
9211
|
-
requiresConversationHistory:
|
|
9669
|
+
subQuestions: z25.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
|
|
9670
|
+
requiresDocumentLookup: z25.boolean().describe("Whether structured document lookup is needed"),
|
|
9671
|
+
requiresChunkSearch: z25.boolean().describe("Whether semantic chunk search is needed"),
|
|
9672
|
+
requiresConversationHistory: z25.boolean().describe("Whether conversation history is relevant"),
|
|
9212
9673
|
retrievalMode: QueryRetrievalModeSchema.optional().describe("Preferred retrieval strategy for the query when source-span retrieval is available")
|
|
9213
9674
|
});
|
|
9214
|
-
var EvidenceItemSchema =
|
|
9215
|
-
source:
|
|
9216
|
-
chunkId:
|
|
9217
|
-
sourceNodeId:
|
|
9218
|
-
sourceSpanId:
|
|
9219
|
-
documentId:
|
|
9220
|
-
turnId:
|
|
9221
|
-
attachmentId:
|
|
9222
|
-
text:
|
|
9223
|
-
relevance:
|
|
9675
|
+
var EvidenceItemSchema = z25.object({
|
|
9676
|
+
source: z25.enum(["chunk", "document", "conversation", "attachment", "source_span", "source_node"]),
|
|
9677
|
+
chunkId: z25.string().optional(),
|
|
9678
|
+
sourceNodeId: z25.string().optional(),
|
|
9679
|
+
sourceSpanId: z25.string().optional(),
|
|
9680
|
+
documentId: z25.string().optional(),
|
|
9681
|
+
turnId: z25.string().optional(),
|
|
9682
|
+
attachmentId: z25.string().optional(),
|
|
9683
|
+
text: z25.string().describe("Text excerpt from the source"),
|
|
9684
|
+
relevance: z25.number().min(0).max(1),
|
|
9224
9685
|
retrievalMode: QueryRetrievalModeSchema.optional(),
|
|
9225
9686
|
sourceLocation: SourceSpanLocationSchema.optional(),
|
|
9226
|
-
metadata:
|
|
9227
|
-
});
|
|
9228
|
-
var AttachmentInterpretationSchema =
|
|
9229
|
-
summary:
|
|
9230
|
-
extractedFacts:
|
|
9231
|
-
recommendedFocus:
|
|
9232
|
-
confidence:
|
|
9233
|
-
});
|
|
9234
|
-
var RetrievalResultSchema =
|
|
9235
|
-
subQuestion:
|
|
9236
|
-
evidence:
|
|
9237
|
-
});
|
|
9238
|
-
var CitationSchema =
|
|
9239
|
-
index:
|
|
9240
|
-
chunkId:
|
|
9241
|
-
sourceNodeId:
|
|
9242
|
-
sourceSpanId:
|
|
9243
|
-
documentId:
|
|
9244
|
-
documentType:
|
|
9245
|
-
field:
|
|
9246
|
-
quote:
|
|
9247
|
-
relevance:
|
|
9687
|
+
metadata: z25.array(z25.object({ key: z25.string(), value: z25.string() })).optional()
|
|
9688
|
+
});
|
|
9689
|
+
var AttachmentInterpretationSchema = z25.object({
|
|
9690
|
+
summary: z25.string().describe("Concise summary of what the attachment shows or contains"),
|
|
9691
|
+
extractedFacts: z25.array(z25.string()).describe("Specific observable or document facts grounded in the attachment"),
|
|
9692
|
+
recommendedFocus: z25.array(z25.string()).describe("Important details to incorporate when answering follow-up questions"),
|
|
9693
|
+
confidence: z25.number().min(0).max(1)
|
|
9694
|
+
});
|
|
9695
|
+
var RetrievalResultSchema = z25.object({
|
|
9696
|
+
subQuestion: z25.string(),
|
|
9697
|
+
evidence: z25.array(EvidenceItemSchema)
|
|
9698
|
+
});
|
|
9699
|
+
var CitationSchema = z25.object({
|
|
9700
|
+
index: z25.number().describe("Citation number [1], [2], etc."),
|
|
9701
|
+
chunkId: z25.string().optional().describe("Source chunk ID, e.g. doc-123:coverage:2"),
|
|
9702
|
+
sourceNodeId: z25.string().optional().describe("Source tree node ID when available"),
|
|
9703
|
+
sourceSpanId: z25.string().optional().describe("Precise source span ID when available"),
|
|
9704
|
+
documentId: z25.string(),
|
|
9705
|
+
documentType: z25.enum(["policy", "quote"]).optional(),
|
|
9706
|
+
field: z25.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
|
|
9707
|
+
quote: z25.string().describe("Exact text from source that supports the claim"),
|
|
9708
|
+
relevance: z25.number().min(0).max(1),
|
|
9248
9709
|
retrievalMode: QueryRetrievalModeSchema.optional(),
|
|
9249
9710
|
sourceLocation: SourceSpanLocationSchema.optional()
|
|
9250
9711
|
});
|
|
9251
|
-
var SubAnswerSchema =
|
|
9252
|
-
subQuestion:
|
|
9253
|
-
answer:
|
|
9254
|
-
citations:
|
|
9255
|
-
confidence:
|
|
9256
|
-
needsMoreContext:
|
|
9257
|
-
});
|
|
9258
|
-
var VerifyResultSchema =
|
|
9259
|
-
approved:
|
|
9260
|
-
issues:
|
|
9261
|
-
retrySubQuestions:
|
|
9262
|
-
});
|
|
9263
|
-
var QueryResultSchema =
|
|
9264
|
-
answer:
|
|
9265
|
-
citations:
|
|
9712
|
+
var SubAnswerSchema = z25.object({
|
|
9713
|
+
subQuestion: z25.string(),
|
|
9714
|
+
answer: z25.string(),
|
|
9715
|
+
citations: z25.array(CitationSchema),
|
|
9716
|
+
confidence: z25.number().min(0).max(1),
|
|
9717
|
+
needsMoreContext: z25.boolean().describe("True if evidence was insufficient to answer fully")
|
|
9718
|
+
});
|
|
9719
|
+
var VerifyResultSchema = z25.object({
|
|
9720
|
+
approved: z25.boolean().describe("Whether all sub-answers are adequately grounded"),
|
|
9721
|
+
issues: z25.array(z25.string()).describe("Specific grounding or consistency issues found"),
|
|
9722
|
+
retrySubQuestions: z25.array(z25.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
|
|
9723
|
+
});
|
|
9724
|
+
var QueryResultSchema = z25.object({
|
|
9725
|
+
answer: z25.string(),
|
|
9726
|
+
citations: z25.array(CitationSchema),
|
|
9266
9727
|
intent: QueryIntentSchema,
|
|
9267
|
-
confidence:
|
|
9268
|
-
followUp:
|
|
9728
|
+
confidence: z25.number().min(0).max(1),
|
|
9729
|
+
followUp: z25.string().optional().describe("Suggested follow-up question if applicable")
|
|
9269
9730
|
});
|
|
9270
9731
|
|
|
9271
9732
|
// src/query/retriever.ts
|
|
@@ -10332,7 +10793,7 @@ ${sa.answer}`).join("\n\n"),
|
|
|
10332
10793
|
}
|
|
10333
10794
|
|
|
10334
10795
|
// src/pce/index.ts
|
|
10335
|
-
import { z as
|
|
10796
|
+
import { z as z26 } from "zod";
|
|
10336
10797
|
|
|
10337
10798
|
// src/prompts/pce/index.ts
|
|
10338
10799
|
function buildPceNormalizePrompt(input) {
|
|
@@ -10366,11 +10827,11 @@ ${input.openQuestions.map((question) => `- ${question.id}${question.fieldPath ?
|
|
|
10366
10827
|
}
|
|
10367
10828
|
|
|
10368
10829
|
// src/pce/index.ts
|
|
10369
|
-
var ReplyAnswersSchema =
|
|
10370
|
-
answers:
|
|
10371
|
-
questionId:
|
|
10372
|
-
fieldPath:
|
|
10373
|
-
answer:
|
|
10830
|
+
var ReplyAnswersSchema = z26.object({
|
|
10831
|
+
answers: z26.array(z26.object({
|
|
10832
|
+
questionId: z26.string().optional(),
|
|
10833
|
+
fieldPath: z26.string().optional(),
|
|
10834
|
+
answer: z26.string()
|
|
10374
10835
|
}))
|
|
10375
10836
|
});
|
|
10376
10837
|
function createPceAgent(config = {}) {
|
|
@@ -11099,7 +11560,7 @@ var COI_GENERATION_TOOL = {
|
|
|
11099
11560
|
};
|
|
11100
11561
|
var COVERAGE_COMPARISON_TOOL = {
|
|
11101
11562
|
name: "coverage_comparison",
|
|
11102
|
-
description: "Compare coverages across two or more insurance documents (policies and/or quotes). Returns a side-by-side comparison of
|
|
11563
|
+
description: "Compare coverages across two or more insurance documents (policies and/or quotes). Returns a side-by-side comparison of lines of business, limits, and deductibles.",
|
|
11103
11564
|
input_schema: {
|
|
11104
11565
|
type: "object",
|
|
11105
11566
|
properties: {
|
|
@@ -11108,10 +11569,10 @@ var COVERAGE_COMPARISON_TOOL = {
|
|
|
11108
11569
|
items: { type: "string" },
|
|
11109
11570
|
description: "Array of document IDs (policies or quotes) to compare."
|
|
11110
11571
|
},
|
|
11111
|
-
|
|
11572
|
+
linesOfBusiness: {
|
|
11112
11573
|
type: "array",
|
|
11113
11574
|
items: { type: "string" },
|
|
11114
|
-
description: "Optional filter: only compare these
|
|
11575
|
+
description: "Optional filter: only compare these ACORD line of business codes or labels (e.g. 'CGL', 'WORK'). Omit to compare all."
|
|
11115
11576
|
}
|
|
11116
11577
|
},
|
|
11117
11578
|
required: ["documentIds"]
|
|
@@ -11124,23 +11585,23 @@ var AGENT_TOOLS = [
|
|
|
11124
11585
|
];
|
|
11125
11586
|
|
|
11126
11587
|
// src/prompts/extractors/carrier-info.ts
|
|
11127
|
-
import { z as
|
|
11128
|
-
var CarrierInfoSchema =
|
|
11129
|
-
carrierName:
|
|
11130
|
-
carrierLegalName:
|
|
11131
|
-
naicNumber:
|
|
11132
|
-
amBestRating:
|
|
11133
|
-
admittedStatus:
|
|
11134
|
-
mga:
|
|
11135
|
-
underwriter:
|
|
11136
|
-
brokerAgency:
|
|
11137
|
-
brokerContactName:
|
|
11138
|
-
brokerLicenseNumber:
|
|
11139
|
-
policyNumber:
|
|
11140
|
-
effectiveDate:
|
|
11141
|
-
expirationDate:
|
|
11142
|
-
quoteNumber:
|
|
11143
|
-
proposedEffectiveDate:
|
|
11588
|
+
import { z as z27 } from "zod";
|
|
11589
|
+
var CarrierInfoSchema = z27.object({
|
|
11590
|
+
carrierName: z27.string().describe("Primary insurance company name for display"),
|
|
11591
|
+
carrierLegalName: z27.string().optional().describe("Legal entity name of insurer"),
|
|
11592
|
+
naicNumber: z27.string().optional().describe("NAIC company code"),
|
|
11593
|
+
amBestRating: z27.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
|
|
11594
|
+
admittedStatus: z27.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
|
|
11595
|
+
mga: z27.string().optional().describe("Managing General Agent or Program Administrator name"),
|
|
11596
|
+
underwriter: z27.string().optional().describe("Named individual underwriter"),
|
|
11597
|
+
brokerAgency: z27.string().optional().describe("Broker or producer agency name"),
|
|
11598
|
+
brokerContactName: z27.string().optional().describe("Broker or producer contact person name"),
|
|
11599
|
+
brokerLicenseNumber: z27.string().optional().describe("Broker or producer license number"),
|
|
11600
|
+
policyNumber: z27.string().optional().describe("Policy or quote reference number"),
|
|
11601
|
+
effectiveDate: z27.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
|
|
11602
|
+
expirationDate: z27.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
|
|
11603
|
+
quoteNumber: z27.string().optional().describe("Quote or proposal reference number"),
|
|
11604
|
+
proposedEffectiveDate: z27.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
|
|
11144
11605
|
});
|
|
11145
11606
|
function buildCarrierInfoPrompt() {
|
|
11146
11607
|
return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
|
|
@@ -11163,21 +11624,21 @@ Return JSON only.`;
|
|
|
11163
11624
|
}
|
|
11164
11625
|
|
|
11165
11626
|
// src/prompts/extractors/named-insured.ts
|
|
11166
|
-
import { z as
|
|
11167
|
-
var AdditionalNamedInsuredSchema =
|
|
11168
|
-
name:
|
|
11169
|
-
relationship:
|
|
11627
|
+
import { z as z28 } from "zod";
|
|
11628
|
+
var AdditionalNamedInsuredSchema = z28.object({
|
|
11629
|
+
name: z28.string(),
|
|
11630
|
+
relationship: z28.string().optional().describe("e.g. subsidiary, affiliate"),
|
|
11170
11631
|
address: SourceBackedAddressSchema.optional()
|
|
11171
11632
|
}).merge(SourceProvenanceSchema);
|
|
11172
|
-
var ScheduledPartySchema =
|
|
11173
|
-
name:
|
|
11633
|
+
var ScheduledPartySchema = z28.object({
|
|
11634
|
+
name: z28.string(),
|
|
11174
11635
|
address: SourceBackedAddressSchema.optional()
|
|
11175
11636
|
}).merge(SourceProvenanceSchema);
|
|
11176
|
-
var NamedInsuredSchema2 =
|
|
11177
|
-
insuredName:
|
|
11178
|
-
insuredDba:
|
|
11637
|
+
var NamedInsuredSchema2 = z28.object({
|
|
11638
|
+
insuredName: z28.string().describe("Name of primary named insured"),
|
|
11639
|
+
insuredDba: z28.string().optional().describe("Doing-business-as name"),
|
|
11179
11640
|
insuredAddress: SourceBackedAddressSchema.optional().describe("Primary insured mailing address"),
|
|
11180
|
-
insuredEntityType:
|
|
11641
|
+
insuredEntityType: z28.enum([
|
|
11181
11642
|
"corporation",
|
|
11182
11643
|
"llc",
|
|
11183
11644
|
"partnership",
|
|
@@ -11190,12 +11651,12 @@ var NamedInsuredSchema2 = z27.object({
|
|
|
11190
11651
|
"married_couple",
|
|
11191
11652
|
"other"
|
|
11192
11653
|
]).optional().describe("Legal entity type of the insured"),
|
|
11193
|
-
insuredFein:
|
|
11194
|
-
insuredSicCode:
|
|
11195
|
-
insuredNaicsCode:
|
|
11196
|
-
additionalNamedInsureds:
|
|
11197
|
-
lossPayees:
|
|
11198
|
-
mortgageHolders:
|
|
11654
|
+
insuredFein: z28.string().optional().describe("Federal Employer Identification Number"),
|
|
11655
|
+
insuredSicCode: z28.string().optional().describe("SIC code"),
|
|
11656
|
+
insuredNaicsCode: z28.string().optional().describe("NAICS code"),
|
|
11657
|
+
additionalNamedInsureds: z28.array(AdditionalNamedInsuredSchema).optional().describe("Additional named insureds listed on the policy"),
|
|
11658
|
+
lossPayees: z28.array(ScheduledPartySchema).optional().describe("Loss payees listed on the policy"),
|
|
11659
|
+
mortgageHolders: z28.array(ScheduledPartySchema).optional().describe("Mortgage holders / lienholders listed on the policy")
|
|
11199
11660
|
});
|
|
11200
11661
|
function buildNamedInsuredPrompt() {
|
|
11201
11662
|
return `You are an expert insurance document analyst. Extract all named insured information from this document.
|
|
@@ -11222,14 +11683,14 @@ Return JSON only.`;
|
|
|
11222
11683
|
}
|
|
11223
11684
|
|
|
11224
11685
|
// src/prompts/extractors/coverage-limits.ts
|
|
11225
|
-
import { z as
|
|
11686
|
+
import { z as z29 } from "zod";
|
|
11226
11687
|
var ExtractorCoverageSchema = CoverageSchema.extend({
|
|
11227
|
-
coverageCode:
|
|
11688
|
+
coverageCode: z29.string().optional().describe("Coverage code or class code")
|
|
11228
11689
|
});
|
|
11229
|
-
var CoverageLimitsSchema =
|
|
11230
|
-
coverages:
|
|
11231
|
-
coverageForm:
|
|
11232
|
-
retroactiveDate:
|
|
11690
|
+
var CoverageLimitsSchema = z29.object({
|
|
11691
|
+
coverages: z29.array(ExtractorCoverageSchema).describe("All coverages with their limits"),
|
|
11692
|
+
coverageForm: z29.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
|
|
11693
|
+
retroactiveDate: z29.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
|
|
11233
11694
|
});
|
|
11234
11695
|
function buildCoverageLimitsPrompt() {
|
|
11235
11696
|
return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
|
|
@@ -11271,14 +11732,14 @@ Return JSON only.`;
|
|
|
11271
11732
|
}
|
|
11272
11733
|
|
|
11273
11734
|
// src/prompts/extractors/endorsements.ts
|
|
11274
|
-
import { z as
|
|
11275
|
-
var EndorsementsSchema =
|
|
11276
|
-
endorsements:
|
|
11277
|
-
|
|
11278
|
-
formNumber:
|
|
11279
|
-
editionDate:
|
|
11280
|
-
title:
|
|
11281
|
-
endorsementType:
|
|
11735
|
+
import { z as z30 } from "zod";
|
|
11736
|
+
var EndorsementsSchema = z30.object({
|
|
11737
|
+
endorsements: z30.array(
|
|
11738
|
+
z30.object({
|
|
11739
|
+
formNumber: z30.string().describe("Form number, e.g. 'CG 21 47'"),
|
|
11740
|
+
editionDate: z30.string().optional().describe("Edition date, e.g. '12 07'"),
|
|
11741
|
+
title: z30.string().describe("Endorsement title"),
|
|
11742
|
+
endorsementType: z30.enum([
|
|
11282
11743
|
"additional_insured",
|
|
11283
11744
|
"waiver_of_subrogation",
|
|
11284
11745
|
"primary_noncontributory",
|
|
@@ -11298,12 +11759,12 @@ var EndorsementsSchema = z29.object({
|
|
|
11298
11759
|
"territorial_extension",
|
|
11299
11760
|
"other"
|
|
11300
11761
|
]).describe("Endorsement type classification"),
|
|
11301
|
-
effectiveDate:
|
|
11302
|
-
affectedCoverageParts:
|
|
11303
|
-
namedParties:
|
|
11304
|
-
|
|
11305
|
-
name:
|
|
11306
|
-
role:
|
|
11762
|
+
effectiveDate: z30.string().optional().describe("Endorsement effective date"),
|
|
11763
|
+
affectedCoverageParts: z30.array(z30.string()).optional().describe("Coverage parts affected by this endorsement"),
|
|
11764
|
+
namedParties: z30.array(
|
|
11765
|
+
z30.object({
|
|
11766
|
+
name: z30.string().describe("Party name"),
|
|
11767
|
+
role: z30.enum([
|
|
11307
11768
|
"additional_insured",
|
|
11308
11769
|
"loss_payee",
|
|
11309
11770
|
"mortgage_holder",
|
|
@@ -11312,18 +11773,18 @@ var EndorsementsSchema = z29.object({
|
|
|
11312
11773
|
"designated_person",
|
|
11313
11774
|
"other"
|
|
11314
11775
|
]).describe("Party role"),
|
|
11315
|
-
relationship:
|
|
11316
|
-
scope:
|
|
11776
|
+
relationship: z30.string().optional().describe("Relationship to insured"),
|
|
11777
|
+
scope: z30.string().optional().describe("Scope of coverage for this party")
|
|
11317
11778
|
})
|
|
11318
11779
|
).optional().describe("Named parties (additional insureds, loss payees, etc.)"),
|
|
11319
|
-
keyTerms:
|
|
11320
|
-
premiumImpact:
|
|
11321
|
-
excerpt:
|
|
11322
|
-
content:
|
|
11323
|
-
pageStart:
|
|
11324
|
-
pageEnd:
|
|
11325
|
-
sourceSpanIds:
|
|
11326
|
-
sourceTextHash:
|
|
11780
|
+
keyTerms: z30.array(z30.string()).optional().describe("Key terms or notable provisions in the endorsement"),
|
|
11781
|
+
premiumImpact: z30.string().optional().describe("Additional premium or credit"),
|
|
11782
|
+
excerpt: z30.string().optional().describe("Short source excerpt, not full verbatim text"),
|
|
11783
|
+
content: z30.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
|
|
11784
|
+
pageStart: z30.number().describe("Starting page number of this endorsement"),
|
|
11785
|
+
pageEnd: z30.number().optional().describe("Ending page number of this endorsement"),
|
|
11786
|
+
sourceSpanIds: z30.array(z30.string()).optional().describe("Source span IDs grounding this endorsement"),
|
|
11787
|
+
sourceTextHash: z30.string().optional().describe("Hash of the source text when available")
|
|
11327
11788
|
})
|
|
11328
11789
|
).describe("All endorsements found in the document")
|
|
11329
11790
|
});
|
|
@@ -11361,20 +11822,20 @@ Return JSON only.`;
|
|
|
11361
11822
|
}
|
|
11362
11823
|
|
|
11363
11824
|
// src/prompts/extractors/exclusions.ts
|
|
11364
|
-
import { z as
|
|
11365
|
-
var ExclusionsSchema =
|
|
11366
|
-
exclusions:
|
|
11367
|
-
|
|
11368
|
-
name:
|
|
11369
|
-
formNumber:
|
|
11370
|
-
excludedPerils:
|
|
11371
|
-
isAbsolute:
|
|
11372
|
-
exceptions:
|
|
11373
|
-
buybackAvailable:
|
|
11374
|
-
buybackEndorsement:
|
|
11375
|
-
appliesTo:
|
|
11376
|
-
content:
|
|
11377
|
-
pageNumber:
|
|
11825
|
+
import { z as z31 } from "zod";
|
|
11826
|
+
var ExclusionsSchema = z31.object({
|
|
11827
|
+
exclusions: z31.array(
|
|
11828
|
+
z31.object({
|
|
11829
|
+
name: z31.string().describe("Exclusion title or short description"),
|
|
11830
|
+
formNumber: z31.string().optional().describe("Form number if part of a named endorsement"),
|
|
11831
|
+
excludedPerils: z31.array(z31.string()).optional().describe("Specific perils excluded"),
|
|
11832
|
+
isAbsolute: z31.boolean().optional().describe("Whether the exclusion is absolute (no exceptions)"),
|
|
11833
|
+
exceptions: z31.array(z31.string()).optional().describe("Exceptions to the exclusion, if any"),
|
|
11834
|
+
buybackAvailable: z31.boolean().optional().describe("Whether coverage can be bought back via endorsement"),
|
|
11835
|
+
buybackEndorsement: z31.string().optional().describe("Form number of the buyback endorsement if available"),
|
|
11836
|
+
appliesTo: z31.array(z31.string()).optional().describe("Policy types this exclusion applies to"),
|
|
11837
|
+
content: z31.string().describe("Full verbatim exclusion text"),
|
|
11838
|
+
pageNumber: z31.number().optional().describe("Page number where exclusion appears")
|
|
11378
11839
|
})
|
|
11379
11840
|
).describe("All exclusions found in the document")
|
|
11380
11841
|
});
|
|
@@ -11389,7 +11850,7 @@ For EACH exclusion, extract:
|
|
|
11389
11850
|
- exceptions: any exceptions to the exclusion (things still covered despite the exclusion)
|
|
11390
11851
|
- buybackAvailable: whether coverage can be purchased back via endorsement
|
|
11391
11852
|
- buybackEndorsement: the form number of the buyback endorsement if known
|
|
11392
|
-
- appliesTo: which
|
|
11853
|
+
- appliesTo: which lines of business or coverages this exclusion applies to (as an array)
|
|
11393
11854
|
- content: full verbatim exclusion text \u2014 REQUIRED
|
|
11394
11855
|
- pageNumber: page number where the exclusion appears
|
|
11395
11856
|
|
|
@@ -11410,12 +11871,12 @@ Return JSON only.`;
|
|
|
11410
11871
|
}
|
|
11411
11872
|
|
|
11412
11873
|
// src/prompts/extractors/conditions.ts
|
|
11413
|
-
import { z as
|
|
11414
|
-
var ConditionsSchema =
|
|
11415
|
-
conditions:
|
|
11416
|
-
|
|
11417
|
-
name:
|
|
11418
|
-
conditionType:
|
|
11874
|
+
import { z as z32 } from "zod";
|
|
11875
|
+
var ConditionsSchema = z32.object({
|
|
11876
|
+
conditions: z32.array(
|
|
11877
|
+
z32.object({
|
|
11878
|
+
name: z32.string().describe("Condition title"),
|
|
11879
|
+
conditionType: z32.enum([
|
|
11419
11880
|
"duties_after_loss",
|
|
11420
11881
|
"notice_requirements",
|
|
11421
11882
|
"other_insurance",
|
|
@@ -11434,14 +11895,14 @@ var ConditionsSchema = z31.object({
|
|
|
11434
11895
|
"separation_of_insureds",
|
|
11435
11896
|
"other"
|
|
11436
11897
|
]).describe("Condition category"),
|
|
11437
|
-
content:
|
|
11438
|
-
keyValues:
|
|
11439
|
-
|
|
11440
|
-
key:
|
|
11441
|
-
value:
|
|
11898
|
+
content: z32.string().describe("Full verbatim condition text"),
|
|
11899
|
+
keyValues: z32.array(
|
|
11900
|
+
z32.object({
|
|
11901
|
+
key: z32.string().describe("Key name (e.g. 'noticePeriod', 'suitDeadline')"),
|
|
11902
|
+
value: z32.string().describe("Value (e.g. '30 days', '2 years')")
|
|
11442
11903
|
})
|
|
11443
11904
|
).optional().describe("Key values extracted from the condition (notice periods, deadlines, etc.)"),
|
|
11444
|
-
pageNumber:
|
|
11905
|
+
pageNumber: z32.number().optional().describe("Page number where condition appears")
|
|
11445
11906
|
})
|
|
11446
11907
|
).describe("All policy conditions found in the document")
|
|
11447
11908
|
});
|
|
@@ -11479,34 +11940,34 @@ Return JSON only.`;
|
|
|
11479
11940
|
}
|
|
11480
11941
|
|
|
11481
11942
|
// src/prompts/extractors/premium-breakdown.ts
|
|
11482
|
-
import { z as
|
|
11483
|
-
var PremiumBreakdownSchema =
|
|
11484
|
-
premium:
|
|
11485
|
-
premiumAmount:
|
|
11486
|
-
totalCost:
|
|
11487
|
-
totalCostAmount:
|
|
11488
|
-
premiumBreakdown:
|
|
11489
|
-
|
|
11490
|
-
line:
|
|
11491
|
-
amount:
|
|
11492
|
-
amountValue:
|
|
11943
|
+
import { z as z33 } from "zod";
|
|
11944
|
+
var PremiumBreakdownSchema = z33.object({
|
|
11945
|
+
premium: z33.string().optional().describe("Total premium amount, e.g. '$5,000'"),
|
|
11946
|
+
premiumAmount: z33.number().optional().describe("Total premium as a plain number with no currency symbols or commas"),
|
|
11947
|
+
totalCost: z33.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
|
|
11948
|
+
totalCostAmount: z33.number().optional().describe("Total cost as a plain number with no currency symbols or commas"),
|
|
11949
|
+
premiumBreakdown: z33.array(
|
|
11950
|
+
z33.object({
|
|
11951
|
+
line: z33.string().describe("Coverage line name"),
|
|
11952
|
+
amount: z33.string().describe("Premium amount for this line"),
|
|
11953
|
+
amountValue: z33.number().optional().describe("Premium amount as a plain number with no currency symbols or commas")
|
|
11493
11954
|
})
|
|
11494
11955
|
).optional().describe("Per-coverage-line premium breakdown"),
|
|
11495
|
-
taxesAndFees:
|
|
11496
|
-
|
|
11497
|
-
name:
|
|
11498
|
-
amount:
|
|
11499
|
-
amountValue:
|
|
11500
|
-
type:
|
|
11956
|
+
taxesAndFees: z33.array(
|
|
11957
|
+
z33.object({
|
|
11958
|
+
name: z33.string().describe("Fee or tax name"),
|
|
11959
|
+
amount: z33.string().describe("Dollar amount"),
|
|
11960
|
+
amountValue: z33.number().optional().describe("Fee or tax amount as a plain number with no currency symbols or commas"),
|
|
11961
|
+
type: z33.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
|
|
11501
11962
|
})
|
|
11502
11963
|
).optional().describe("Taxes, fees, surcharges, and assessments"),
|
|
11503
|
-
minimumPremium:
|
|
11504
|
-
minimumPremiumAmount:
|
|
11505
|
-
depositPremium:
|
|
11506
|
-
depositPremiumAmount:
|
|
11507
|
-
paymentPlan:
|
|
11508
|
-
auditType:
|
|
11509
|
-
ratingBasis:
|
|
11964
|
+
minimumPremium: z33.string().optional().describe("Minimum premium if stated"),
|
|
11965
|
+
minimumPremiumAmount: z33.number().optional().describe("Minimum premium as a plain number when the source states a fixed amount"),
|
|
11966
|
+
depositPremium: z33.string().optional().describe("Deposit premium if stated"),
|
|
11967
|
+
depositPremiumAmount: z33.number().optional().describe("Deposit premium as a plain number when the source states a fixed amount"),
|
|
11968
|
+
paymentPlan: z33.string().optional().describe("Payment plan description"),
|
|
11969
|
+
auditType: z33.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
|
|
11970
|
+
ratingBasis: z33.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
|
|
11510
11971
|
});
|
|
11511
11972
|
function buildPremiumBreakdownPrompt() {
|
|
11512
11973
|
return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
|
|
@@ -11528,14 +11989,14 @@ Return JSON only.`;
|
|
|
11528
11989
|
}
|
|
11529
11990
|
|
|
11530
11991
|
// src/prompts/extractors/declarations.ts
|
|
11531
|
-
import { z as
|
|
11532
|
-
var DeclarationsFieldSchema =
|
|
11533
|
-
field:
|
|
11534
|
-
value:
|
|
11535
|
-
section:
|
|
11992
|
+
import { z as z34 } from "zod";
|
|
11993
|
+
var DeclarationsFieldSchema = z34.object({
|
|
11994
|
+
field: z34.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
|
|
11995
|
+
value: z34.string().describe("Extracted value exactly as it appears in the document"),
|
|
11996
|
+
section: z34.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
|
|
11536
11997
|
});
|
|
11537
|
-
var DeclarationsExtractSchema =
|
|
11538
|
-
fields:
|
|
11998
|
+
var DeclarationsExtractSchema = z34.object({
|
|
11999
|
+
fields: z34.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
|
|
11539
12000
|
});
|
|
11540
12001
|
function buildDeclarationsPrompt() {
|
|
11541
12002
|
return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
|
|
@@ -11575,21 +12036,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
|
|
|
11575
12036
|
}
|
|
11576
12037
|
|
|
11577
12038
|
// src/prompts/extractors/loss-history.ts
|
|
11578
|
-
import { z as
|
|
11579
|
-
var LossHistorySchema =
|
|
11580
|
-
lossSummary:
|
|
11581
|
-
individualClaims:
|
|
11582
|
-
|
|
11583
|
-
date:
|
|
11584
|
-
type:
|
|
11585
|
-
description:
|
|
11586
|
-
amountPaid:
|
|
11587
|
-
amountReserved:
|
|
11588
|
-
status:
|
|
11589
|
-
claimNumber:
|
|
12039
|
+
import { z as z35 } from "zod";
|
|
12040
|
+
var LossHistorySchema = z35.object({
|
|
12041
|
+
lossSummary: z35.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
|
|
12042
|
+
individualClaims: z35.array(
|
|
12043
|
+
z35.object({
|
|
12044
|
+
date: z35.string().optional().describe("Date of loss or claim"),
|
|
12045
|
+
type: z35.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
|
|
12046
|
+
description: z35.string().optional().describe("Brief description of the claim"),
|
|
12047
|
+
amountPaid: z35.string().optional().describe("Amount paid"),
|
|
12048
|
+
amountReserved: z35.string().optional().describe("Amount reserved"),
|
|
12049
|
+
status: z35.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
|
|
12050
|
+
claimNumber: z35.string().optional().describe("Claim reference number")
|
|
11590
12051
|
})
|
|
11591
12052
|
).optional().describe("Individual claim records"),
|
|
11592
|
-
experienceMod:
|
|
12053
|
+
experienceMod: z35.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
|
|
11593
12054
|
});
|
|
11594
12055
|
function buildLossHistoryPrompt() {
|
|
11595
12056
|
return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
|
|
@@ -11606,21 +12067,21 @@ Return JSON only.`;
|
|
|
11606
12067
|
}
|
|
11607
12068
|
|
|
11608
12069
|
// src/prompts/extractors/sections.ts
|
|
11609
|
-
import { z as
|
|
11610
|
-
var SubsectionSchema2 =
|
|
11611
|
-
title:
|
|
11612
|
-
sectionNumber:
|
|
11613
|
-
pageNumber:
|
|
11614
|
-
excerpt:
|
|
11615
|
-
content:
|
|
11616
|
-
sourceSpanIds:
|
|
11617
|
-
sourceTextHash:
|
|
11618
|
-
});
|
|
11619
|
-
var SectionsSchema =
|
|
11620
|
-
sections:
|
|
11621
|
-
|
|
11622
|
-
title:
|
|
11623
|
-
type:
|
|
12070
|
+
import { z as z36 } from "zod";
|
|
12071
|
+
var SubsectionSchema2 = z36.object({
|
|
12072
|
+
title: z36.string().describe("Subsection title"),
|
|
12073
|
+
sectionNumber: z36.string().optional().describe("Subsection number"),
|
|
12074
|
+
pageNumber: z36.number().optional().describe("Page number"),
|
|
12075
|
+
excerpt: z36.string().optional().describe("Short source excerpt, not full verbatim text"),
|
|
12076
|
+
content: z36.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
|
|
12077
|
+
sourceSpanIds: z36.array(z36.string()).optional().describe("Source span IDs grounding this subsection"),
|
|
12078
|
+
sourceTextHash: z36.string().optional().describe("Hash of the source text when available")
|
|
12079
|
+
});
|
|
12080
|
+
var SectionsSchema = z36.object({
|
|
12081
|
+
sections: z36.array(
|
|
12082
|
+
z36.object({
|
|
12083
|
+
title: z36.string().describe("Section title"),
|
|
12084
|
+
type: z36.enum([
|
|
11624
12085
|
"declarations",
|
|
11625
12086
|
"insuring_agreement",
|
|
11626
12087
|
"policy_form",
|
|
@@ -11635,13 +12096,13 @@ var SectionsSchema = z35.object({
|
|
|
11635
12096
|
"regulatory",
|
|
11636
12097
|
"other"
|
|
11637
12098
|
]).describe("Section type classification"),
|
|
11638
|
-
excerpt:
|
|
11639
|
-
content:
|
|
11640
|
-
pageStart:
|
|
11641
|
-
pageEnd:
|
|
11642
|
-
sourceSpanIds:
|
|
11643
|
-
sourceTextHash:
|
|
11644
|
-
subsections:
|
|
12099
|
+
excerpt: z36.string().optional().describe("Short source excerpt, not full verbatim text"),
|
|
12100
|
+
content: z36.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
|
|
12101
|
+
pageStart: z36.number().describe("Starting page number"),
|
|
12102
|
+
pageEnd: z36.number().optional().describe("Ending page number"),
|
|
12103
|
+
sourceSpanIds: z36.array(z36.string()).optional().describe("Source span IDs grounding this section"),
|
|
12104
|
+
sourceTextHash: z36.string().optional().describe("Hash of the source text when available"),
|
|
12105
|
+
subsections: z36.array(SubsectionSchema2).optional().describe("Subsections within this section")
|
|
11645
12106
|
})
|
|
11646
12107
|
).describe("All document sections")
|
|
11647
12108
|
});
|
|
@@ -11675,20 +12136,20 @@ Return JSON only.`;
|
|
|
11675
12136
|
}
|
|
11676
12137
|
|
|
11677
12138
|
// src/prompts/extractors/supplementary.ts
|
|
11678
|
-
import { z as
|
|
11679
|
-
var AuxiliaryFactSchema2 =
|
|
11680
|
-
key:
|
|
11681
|
-
value:
|
|
11682
|
-
subject:
|
|
11683
|
-
context:
|
|
11684
|
-
});
|
|
11685
|
-
var SupplementarySchema =
|
|
11686
|
-
regulatoryContacts:
|
|
11687
|
-
claimsContacts:
|
|
11688
|
-
thirdPartyAdministrators:
|
|
11689
|
-
cancellationNoticeDays:
|
|
11690
|
-
nonrenewalNoticeDays:
|
|
11691
|
-
auxiliaryFacts:
|
|
12139
|
+
import { z as z37 } from "zod";
|
|
12140
|
+
var AuxiliaryFactSchema2 = z37.object({
|
|
12141
|
+
key: z37.string().describe("Normalized machine-readable fact key, e.g. 'policyholder_age' or 'insured_name'"),
|
|
12142
|
+
value: z37.string().describe("Concrete extracted fact value"),
|
|
12143
|
+
subject: z37.string().optional().describe("Person, entity, vehicle, property, or schedule item this fact belongs to"),
|
|
12144
|
+
context: z37.string().optional().describe("Short disambiguating context, such as 'Driver Schedule' or 'Named Insured'")
|
|
12145
|
+
});
|
|
12146
|
+
var SupplementarySchema = z37.object({
|
|
12147
|
+
regulatoryContacts: z37.array(ContactSchema).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
|
|
12148
|
+
claimsContacts: z37.array(ContactSchema).optional().describe("Claims reporting contacts and instructions"),
|
|
12149
|
+
thirdPartyAdministrators: z37.array(ContactSchema).optional().describe("Third-party administrators for claims handling"),
|
|
12150
|
+
cancellationNoticeDays: z37.number().optional().describe("Required notice period for cancellation in days"),
|
|
12151
|
+
nonrenewalNoticeDays: z37.number().optional().describe("Required notice period for nonrenewal in days"),
|
|
12152
|
+
auxiliaryFacts: z37.array(AuxiliaryFactSchema2).optional().describe("Additional retrieval-only facts that do not fit the strict primary schema")
|
|
11692
12153
|
});
|
|
11693
12154
|
function buildSupplementaryPrompt(alreadyExtractedSummary) {
|
|
11694
12155
|
const exclusionBlock = alreadyExtractedSummary ? `
|
|
@@ -11728,17 +12189,17 @@ Return JSON only.`;
|
|
|
11728
12189
|
}
|
|
11729
12190
|
|
|
11730
12191
|
// src/prompts/extractors/definitions.ts
|
|
11731
|
-
import { z as
|
|
11732
|
-
var DefinitionsSchema =
|
|
11733
|
-
definitions:
|
|
11734
|
-
|
|
11735
|
-
term:
|
|
11736
|
-
definition:
|
|
11737
|
-
pageNumber:
|
|
11738
|
-
formNumber:
|
|
11739
|
-
formTitle:
|
|
11740
|
-
sectionRef:
|
|
11741
|
-
originalContent:
|
|
12192
|
+
import { z as z38 } from "zod";
|
|
12193
|
+
var DefinitionsSchema = z38.object({
|
|
12194
|
+
definitions: z38.array(
|
|
12195
|
+
z38.object({
|
|
12196
|
+
term: z38.string().describe("Defined term exactly as shown in the document"),
|
|
12197
|
+
definition: z38.string().describe("Full verbatim definition text, preserving original wording"),
|
|
12198
|
+
pageNumber: z38.number().optional().describe("Original document page number"),
|
|
12199
|
+
formNumber: z38.string().optional().describe("Form number where this definition appears"),
|
|
12200
|
+
formTitle: z38.string().optional().describe("Form title where this definition appears"),
|
|
12201
|
+
sectionRef: z38.string().optional().describe("Definition section heading or subsection reference"),
|
|
12202
|
+
originalContent: z38.string().optional().describe("Short verbatim source snippet containing the term and definition")
|
|
11742
12203
|
})
|
|
11743
12204
|
).describe("All substantive insurance definitions found in the document")
|
|
11744
12205
|
});
|
|
@@ -11772,22 +12233,22 @@ Return JSON only.`;
|
|
|
11772
12233
|
}
|
|
11773
12234
|
|
|
11774
12235
|
// src/prompts/extractors/covered-reasons.ts
|
|
11775
|
-
import { z as
|
|
11776
|
-
var CoveredReasonsSchema =
|
|
11777
|
-
coveredReasons:
|
|
11778
|
-
|
|
11779
|
-
coverageName:
|
|
11780
|
-
reasonNumber:
|
|
11781
|
-
title:
|
|
11782
|
-
content:
|
|
11783
|
-
conditions:
|
|
11784
|
-
exceptions:
|
|
11785
|
-
appliesTo:
|
|
11786
|
-
pageNumber:
|
|
11787
|
-
formNumber:
|
|
11788
|
-
formTitle:
|
|
11789
|
-
sectionRef:
|
|
11790
|
-
originalContent:
|
|
12236
|
+
import { z as z39 } from "zod";
|
|
12237
|
+
var CoveredReasonsSchema = z39.object({
|
|
12238
|
+
coveredReasons: z39.array(
|
|
12239
|
+
z39.object({
|
|
12240
|
+
coverageName: z39.string().describe("Coverage, coverage part, or form this covered reason belongs to"),
|
|
12241
|
+
reasonNumber: z39.string().optional().describe("Source number or letter for the covered reason, if shown"),
|
|
12242
|
+
title: z39.string().optional().describe("Covered reason title, peril, cause of loss, trigger, or short name"),
|
|
12243
|
+
content: z39.string().describe("Full verbatim covered-reason or insuring-agreement text"),
|
|
12244
|
+
conditions: z39.array(z39.string()).optional().describe("Conditions, timing rules, documentation requirements, or prerequisites attached to this covered reason"),
|
|
12245
|
+
exceptions: z39.array(z39.string()).optional().describe("Exceptions or limitations attached to this covered reason"),
|
|
12246
|
+
appliesTo: z39.array(z39.string()).optional().describe("Covered property, persons, autos, locations, operations, or coverage parts this reason applies to"),
|
|
12247
|
+
pageNumber: z39.number().optional().describe("Original document page number"),
|
|
12248
|
+
formNumber: z39.string().optional().describe("Form number where this covered reason appears"),
|
|
12249
|
+
formTitle: z39.string().optional().describe("Form title where this covered reason appears"),
|
|
12250
|
+
sectionRef: z39.string().optional().describe("Section heading where this covered reason appears"),
|
|
12251
|
+
originalContent: z39.string().optional().describe("Short verbatim source snippet used for this covered reason")
|
|
11791
12252
|
})
|
|
11792
12253
|
).describe("Covered causes, perils, triggers, or reasons that affirmatively grant coverage")
|
|
11793
12254
|
});
|
|
@@ -12630,10 +13091,13 @@ function getTemplate(policyType) {
|
|
|
12630
13091
|
return TEMPLATE_MAP[policyType] ?? DEFAULT_TEMPLATE;
|
|
12631
13092
|
}
|
|
12632
13093
|
export {
|
|
13094
|
+
ACORD_LOB_CODES,
|
|
13095
|
+
ACORD_LOB_LABELS,
|
|
12633
13096
|
ADMITTED_STATUSES,
|
|
12634
13097
|
AGENT_TOOLS,
|
|
12635
13098
|
APPLICATION_CLASSIFY_PROMPT,
|
|
12636
13099
|
AUDIT_TYPES,
|
|
13100
|
+
AcordLobCodeSchema,
|
|
12637
13101
|
AcroFormMappingSchema,
|
|
12638
13102
|
AddressSchema,
|
|
12639
13103
|
AdmittedStatusSchema,
|
|
@@ -12726,6 +13190,7 @@ export {
|
|
|
12726
13190
|
ENDORSEMENT_PARTY_ROLES,
|
|
12727
13191
|
ENDORSEMENT_TYPES,
|
|
12728
13192
|
ENTITY_TYPES,
|
|
13193
|
+
EXCLUDED_ACORD_LOB_CODES,
|
|
12729
13194
|
EarthquakeDeclarationsSchema,
|
|
12730
13195
|
EmployersLiabilityLimitsSchema,
|
|
12731
13196
|
EndorsementPartyRoleSchema,
|
|
@@ -12759,6 +13224,7 @@ export {
|
|
|
12759
13224
|
InsuredLocationSchema,
|
|
12760
13225
|
InsuredVehicleSchema,
|
|
12761
13226
|
InsurerInfoSchema,
|
|
13227
|
+
LEGACY_POLICY_TYPE_TO_LOB,
|
|
12762
13228
|
LIMIT_TYPES,
|
|
12763
13229
|
LOSS_SETTLEMENTS,
|
|
12764
13230
|
LimitScheduleSchema,
|
|
@@ -12772,16 +13238,18 @@ export {
|
|
|
12772
13238
|
MemorySourceStore,
|
|
12773
13239
|
MissingInfoQuestionSchema,
|
|
12774
13240
|
NamedInsuredSchema,
|
|
13241
|
+
OperationalAddressSchema,
|
|
12775
13242
|
OperationalCoverageLineSchema,
|
|
12776
13243
|
OperationalCoverageTermSchema,
|
|
13244
|
+
OperationalDeclarationFactSchema,
|
|
12777
13245
|
OperationalEndorsementSupportSchema,
|
|
12778
13246
|
OperationalPartySchema,
|
|
12779
13247
|
PERSONAL_AUTO_USAGES,
|
|
13248
|
+
PERSONAL_LOB_CODES,
|
|
12780
13249
|
PET_SPECIES,
|
|
12781
13250
|
PLATFORM_CONFIGS,
|
|
12782
13251
|
POLICY_SECTION_TYPES,
|
|
12783
13252
|
POLICY_TERM_TYPES,
|
|
12784
|
-
POLICY_TYPES,
|
|
12785
13253
|
ParsedAnswerSchema,
|
|
12786
13254
|
PaymentInstallmentSchema,
|
|
12787
13255
|
PaymentPlanSchema,
|
|
@@ -12808,7 +13276,6 @@ export {
|
|
|
12808
13276
|
PolicyOperationalProfileSchema,
|
|
12809
13277
|
PolicySectionTypeSchema,
|
|
12810
13278
|
PolicyTermTypeSchema,
|
|
12811
|
-
PolicyTypeSchema,
|
|
12812
13279
|
PremiumLineSchema,
|
|
12813
13280
|
ProducerInfoSchema,
|
|
12814
13281
|
ProfessionalLiabilityDeclarationsSchema,
|
|
@@ -12937,16 +13404,19 @@ export {
|
|
|
12937
13404
|
getNextApplicationQuestions,
|
|
12938
13405
|
getPdfPageCount,
|
|
12939
13406
|
getTemplate,
|
|
12940
|
-
|
|
13407
|
+
inferLinesOfBusinessFromOperationalCoverages,
|
|
12941
13408
|
isDoclingExtractionInput,
|
|
12942
13409
|
isFileReference,
|
|
13410
|
+
isLobCode,
|
|
13411
|
+
isPersonalLob,
|
|
13412
|
+
lobLabel,
|
|
12943
13413
|
mergeQuestionAnswers,
|
|
12944
13414
|
mergeSourceSpans,
|
|
12945
13415
|
normalizeApplicationQuestionGraph,
|
|
12946
13416
|
normalizeDoclingDocument,
|
|
12947
13417
|
normalizeDocumentSourceTreePaths,
|
|
12948
13418
|
normalizeForMatch,
|
|
12949
|
-
|
|
13419
|
+
normalizeOperationalLinesOfBusiness,
|
|
12950
13420
|
normalizeSourceSpans,
|
|
12951
13421
|
orderSourceEvidence,
|
|
12952
13422
|
overlayTextOnPdf,
|
|
@@ -12957,7 +13427,7 @@ export {
|
|
|
12957
13427
|
processReply,
|
|
12958
13428
|
proposeContextWrites,
|
|
12959
13429
|
resolveModelBudget,
|
|
12960
|
-
|
|
13430
|
+
resolveOperationalProfileLinesOfBusiness,
|
|
12961
13431
|
safeGenerateObject,
|
|
12962
13432
|
sanitizeNulls,
|
|
12963
13433
|
scoreCaseProposal,
|
|
@@ -12968,6 +13438,7 @@ export {
|
|
|
12968
13438
|
stablePolicyChangeItemId,
|
|
12969
13439
|
stableStringify,
|
|
12970
13440
|
stripFences,
|
|
13441
|
+
toLobCodes,
|
|
12971
13442
|
toStrictSchema,
|
|
12972
13443
|
validateApplicationPacket,
|
|
12973
13444
|
validateEvidence,
|