@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/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/shared.ts
517
+ // src/schemas/lines-of-business.ts
569
518
  import { z as z3 } from "zod";
570
- var SourceProvenanceSchema = z3.object({
571
- sourceSpanIds: z3.array(z3.string().min(1)).min(1),
572
- documentNodeId: z3.string().optional(),
573
- sourceTextHash: z3.string().optional(),
574
- pageStart: z3.number().int().positive().optional(),
575
- pageEnd: z3.number().int().positive().optional()
576
- });
577
- var AddressSchema = z3.object({
578
- street1: z3.string(),
579
- street2: z3.string().optional(),
580
- city: z3.string(),
581
- state: z3.string(),
582
- zip: z3.string(),
583
- country: z3.string().optional()
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 = z3.object({
587
- name: z3.string().optional(),
588
- title: z3.string().optional(),
589
- type: z3.string().optional(),
590
- phone: z3.string().optional(),
591
- fax: z3.string().optional(),
592
- email: z3.string().optional(),
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: z3.string().optional()
877
+ hours: z4.string().optional()
595
878
  }).merge(SourceProvenanceSchema);
596
- var FormReferenceSchema = z3.object({
597
- formNumber: z3.string(),
598
- editionDate: z3.string().optional(),
599
- title: z3.string().optional(),
600
- formType: z3.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"]),
601
- pageStart: z3.number().optional(),
602
- pageEnd: z3.number().optional(),
603
- documentNodeId: z3.string().optional(),
604
- sourceSpanIds: z3.array(z3.string()).optional(),
605
- sourceTextHash: z3.string().optional()
606
- });
607
- var TaxFeeItemSchema = z3.object({
608
- name: z3.string(),
609
- amount: z3.string(),
610
- amountValue: z3.number().optional(),
611
- type: z3.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
612
- description: z3.string().optional(),
613
- documentNodeId: z3.string().optional(),
614
- sourceSpanIds: z3.array(z3.string()).optional(),
615
- sourceTextHash: z3.string().optional()
616
- });
617
- var RatingBasisSchema = z3.object({
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: z3.string().optional(),
620
- description: z3.string().optional()
621
- });
622
- var SublimitSchema = z3.object({
623
- name: z3.string(),
624
- limit: z3.string(),
625
- appliesTo: z3.string().optional(),
626
- deductible: z3.string().optional()
627
- });
628
- var SharedLimitSchema = z3.object({
629
- description: z3.string(),
630
- limit: z3.string(),
631
- coverageParts: z3.array(z3.string())
632
- });
633
- var ExtendedReportingPeriodSchema = z3.object({
634
- basicDays: z3.number().optional(),
635
- supplementalYears: z3.number().optional(),
636
- supplementalPremium: z3.string().optional()
637
- });
638
- var NamedInsuredSchema = z3.object({
639
- name: z3.string(),
640
- relationship: z3.string().optional(),
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 z4 } from "zod";
646
- var CoverageValueTypeSchema = z4.enum([
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 = z4.object({
656
- name: z4.string(),
657
- limit: z4.string(),
658
- limitAmount: z4.number().optional(),
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: z4.string().optional(),
662
- deductibleAmount: z4.number().optional(),
944
+ deductible: z5.string().optional(),
945
+ deductibleAmount: z5.number().optional(),
663
946
  deductibleValueType: CoverageValueTypeSchema.optional(),
664
947
  trigger: CoverageTriggerSchema.optional(),
665
- retroactiveDate: z4.string().optional(),
666
- formNumber: z4.string().optional(),
667
- pageNumber: z4.number().optional(),
668
- sectionRef: z4.string().optional(),
669
- originalContent: z4.string().optional(),
670
- recordId: z4.string().optional(),
671
- documentNodeId: z4.string().optional(),
672
- sourceSpanIds: z4.array(z4.string()).optional(),
673
- sourceTextHash: z4.string().optional()
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 = z4.object({
676
- name: z4.string(),
677
- coverageCode: z4.string().optional(),
678
- formNumber: z4.string().optional(),
679
- formEditionDate: z4.string().optional(),
680
- limit: z4.string(),
681
- limitAmount: z4.number().optional(),
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: z4.string().optional(),
685
- deductibleAmount: z4.number().optional(),
967
+ deductible: z5.string().optional(),
968
+ deductibleAmount: z5.number().optional(),
686
969
  deductibleType: DeductibleTypeSchema.optional(),
687
970
  deductibleValueType: CoverageValueTypeSchema.optional(),
688
- sir: z4.string().optional(),
689
- sublimit: z4.string().optional(),
690
- coinsurance: z4.string().optional(),
971
+ sir: z5.string().optional(),
972
+ sublimit: z5.string().optional(),
973
+ coinsurance: z5.string().optional(),
691
974
  valuation: ValuationMethodSchema.optional(),
692
- territory: z4.string().optional(),
975
+ territory: z5.string().optional(),
693
976
  trigger: CoverageTriggerSchema.optional(),
694
- retroactiveDate: z4.string().optional(),
695
- included: z4.boolean(),
696
- premium: z4.string().optional(),
697
- pageNumber: z4.number().optional(),
698
- sectionRef: z4.string().optional(),
699
- originalContent: z4.string().optional(),
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/exclusion.ts
989
+ // src/schemas/endorsement.ts
736
990
  import { z as z6 } from "zod";
737
- var ExclusionSchema = z6.object({
991
+ var EndorsementPartySchema = z6.object({
738
992
  name: z6.string(),
739
- formNumber: z6.string().optional(),
740
- excludedPerils: z6.array(z6.string()).optional(),
741
- isAbsolute: z6.boolean().optional(),
742
- exceptions: z6.array(z6.string()).optional(),
743
- buybackAvailable: z6.boolean().optional(),
744
- buybackEndorsement: z6.string().optional(),
745
- appliesTo: z6.array(z6.string()).optional(),
746
- content: z6.string(),
747
- pageNumber: z6.number().optional(),
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/condition.ts
1018
+ // src/schemas/exclusion.ts
755
1019
  import { z as z7 } from "zod";
756
- var ConditionKeyValueSchema = z7.object({
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
- conditionType: ConditionTypeSchema,
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/parties.ts
1037
+ // src/schemas/condition.ts
773
1038
  import { z as z8 } from "zod";
774
- var InsurerInfoSchema = z8.object({
775
- legalName: z8.string(),
776
- naicNumber: z8.string().optional(),
777
- amBestRating: z8.string().optional(),
778
- amBestNumber: z8.string().optional(),
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: z8.string().optional()
1063
+ stateOfDomicile: z9.string().optional()
781
1064
  }).merge(SourceProvenanceSchema);
782
- var ProducerInfoSchema = z8.object({
783
- agencyName: z8.string(),
784
- contactName: z8.string().optional(),
785
- licenseNumber: z8.string().optional(),
786
- phone: z8.string().optional(),
787
- email: z8.string().optional(),
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 z9 } from "zod";
793
- var PaymentInstallmentSchema = z9.object({
794
- dueDate: z9.string(),
795
- amount: z9.string(),
796
- description: z9.string().optional()
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 = z9.object({
799
- installments: z9.array(PaymentInstallmentSchema),
800
- financeCharge: z9.string().optional()
1081
+ var PaymentPlanSchema = z10.object({
1082
+ installments: z10.array(PaymentInstallmentSchema),
1083
+ financeCharge: z10.string().optional()
801
1084
  });
802
- var LocationPremiumSchema = z9.object({
803
- locationNumber: z9.number(),
804
- premium: z9.string(),
805
- description: z9.string().optional()
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 z10 } from "zod";
810
- var ClaimRecordSchema = z10.object({
811
- dateOfLoss: z10.string(),
812
- claimNumber: z10.string().optional(),
813
- description: z10.string(),
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: z10.string().optional(),
816
- reserved: z10.string().optional(),
817
- incurred: z10.string().optional(),
818
- claimant: z10.string().optional(),
819
- coverageLine: z10.string().optional()
820
- });
821
- var LossSummarySchema = z10.object({
822
- period: z10.string().optional(),
823
- totalClaims: z10.number().optional(),
824
- totalIncurred: z10.string().optional(),
825
- totalPaid: z10.string().optional(),
826
- totalReserved: z10.string().optional(),
827
- lossRatio: z10.string().optional()
828
- });
829
- var ExperienceModSchema = z10.object({
830
- factor: z10.number(),
831
- effectiveDate: z10.string().optional(),
832
- state: z10.string().optional()
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 z11 } from "zod";
837
- var EnrichedSubjectivitySchema = z11.object({
838
- description: z11.string(),
1119
+ import { z as z12 } from "zod";
1120
+ var EnrichedSubjectivitySchema = z12.object({
1121
+ description: z12.string(),
839
1122
  category: SubjectivityCategorySchema.optional(),
840
- dueDate: z11.string().optional(),
841
- status: z11.enum(["open", "satisfied", "waived"]).optional(),
842
- pageNumber: z11.number().optional()
1123
+ dueDate: z12.string().optional(),
1124
+ status: z12.enum(["open", "satisfied", "waived"]).optional(),
1125
+ pageNumber: z12.number().optional()
843
1126
  });
844
- var EnrichedUnderwritingConditionSchema = z11.object({
845
- description: z11.string(),
846
- category: z11.string().optional(),
847
- pageNumber: z11.number().optional()
1127
+ var EnrichedUnderwritingConditionSchema = z12.object({
1128
+ description: z12.string(),
1129
+ category: z12.string().optional(),
1130
+ pageNumber: z12.number().optional()
848
1131
  });
849
- var BindingAuthoritySchema = z11.object({
850
- authorizedBy: z11.string().optional(),
851
- method: z11.string().optional(),
852
- expiration: z11.string().optional(),
853
- conditions: z11.array(z11.string()).optional()
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 z15 } from "zod";
1140
+ import { z as z16 } from "zod";
858
1141
 
859
1142
  // src/schemas/declarations/personal.ts
860
- import { z as z13 } from "zod";
1143
+ import { z as z14 } from "zod";
861
1144
 
862
1145
  // src/schemas/declarations/shared.ts
863
- import { z as z12 } from "zod";
864
- var EmployersLiabilityLimitsSchema = z12.object({
865
- eachAccident: z12.string(),
866
- diseasePolicyLimit: z12.string(),
867
- diseaseEachEmployee: z12.string()
868
- });
869
- var LimitScheduleSchema = z12.object({
870
- perOccurrence: z12.string().optional(),
871
- generalAggregate: z12.string().optional(),
872
- productsCompletedOpsAggregate: z12.string().optional(),
873
- personalAdvertisingInjury: z12.string().optional(),
874
- eachEmployee: z12.string().optional(),
875
- fireDamage: z12.string().optional(),
876
- medicalExpense: z12.string().optional(),
877
- combinedSingleLimit: z12.string().optional(),
878
- bodilyInjuryPerPerson: z12.string().optional(),
879
- bodilyInjuryPerAccident: z12.string().optional(),
880
- propertyDamage: z12.string().optional(),
881
- eachOccurrenceUmbrella: z12.string().optional(),
882
- umbrellaAggregate: z12.string().optional(),
883
- umbrellaRetention: z12.string().optional(),
884
- statutory: z12.boolean().optional(),
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: z12.array(SublimitSchema).optional(),
887
- sharedLimits: z12.array(SharedLimitSchema).optional(),
1169
+ sublimits: z13.array(SublimitSchema).optional(),
1170
+ sharedLimits: z13.array(SharedLimitSchema).optional(),
888
1171
  defenseCostTreatment: DefenseCostTreatmentSchema.optional()
889
1172
  });
890
- var DeductibleScheduleSchema = z12.object({
891
- perClaim: z12.string().optional(),
892
- perOccurrence: z12.string().optional(),
893
- aggregateDeductible: z12.string().optional(),
894
- selfInsuredRetention: z12.string().optional(),
895
- corridorDeductible: z12.string().optional(),
896
- waitingPeriod: z12.string().optional(),
897
- appliesTo: z12.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
898
- });
899
- var InsuredLocationSchema = z12.object({
900
- number: z12.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: z12.string().optional(),
903
- buildingValue: z12.string().optional(),
904
- contentsValue: z12.string().optional(),
905
- businessIncomeValue: z12.string().optional(),
906
- constructionType: z12.string().optional(),
907
- yearBuilt: z12.number().optional(),
908
- squareFootage: z12.number().optional(),
909
- protectionClass: z12.string().optional(),
910
- sprinklered: z12.boolean().optional(),
911
- alarmType: z12.string().optional(),
912
- occupancy: z12.string().optional()
913
- });
914
- var VehicleCoverageSchema = z12.object({
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: z12.string().optional(),
917
- deductible: z12.string().optional(),
918
- included: z12.boolean()
919
- });
920
- var InsuredVehicleSchema = z12.object({
921
- number: z12.number(),
922
- year: z12.number(),
923
- make: z12.string(),
924
- model: z12.string(),
925
- vin: z12.string(),
926
- costNew: z12.string().optional(),
927
- statedValue: z12.string().optional(),
928
- garageLocation: z12.number().optional(),
929
- coverages: z12.array(VehicleCoverageSchema).optional(),
930
- radius: z12.string().optional(),
931
- vehicleType: z12.string().optional()
932
- });
933
- var ClassificationCodeSchema = z12.object({
934
- code: z12.string(),
935
- description: z12.string(),
936
- premiumBasis: z12.string(),
937
- basisAmount: z12.string().optional(),
938
- rate: z12.string().optional(),
939
- premium: z12.string().optional(),
940
- locationNumber: z12.number().optional()
941
- });
942
- var DwellingDetailsSchema = z12.object({
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: z12.number().optional(),
945
- squareFootage: z12.number().optional(),
946
- stories: z12.number().optional(),
1227
+ yearBuilt: z13.number().optional(),
1228
+ squareFootage: z13.number().optional(),
1229
+ stories: z13.number().optional(),
947
1230
  roofType: RoofTypeSchema.optional(),
948
- roofAge: z12.number().optional(),
949
- heatingType: z12.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
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: z12.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
952
- electricalType: z12.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
953
- electricalAmps: z12.number().optional(),
954
- hasSwimmingPool: z12.boolean().optional(),
955
- poolType: z12.enum(["in_ground", "above_ground"]).optional(),
956
- hasTrampoline: z12.boolean().optional(),
957
- hasDog: z12.boolean().optional(),
958
- dogBreed: z12.string().optional(),
959
- protectiveDevices: z12.array(z12.string()).optional(),
960
- distanceToFireStation: z12.string().optional(),
961
- distanceToHydrant: z12.string().optional(),
962
- fireProtectionClass: z12.string().optional()
963
- });
964
- var DriverRecordSchema = z12.object({
965
- name: z12.string(),
966
- dateOfBirth: z12.string().optional(),
967
- licenseNumber: z12.string().optional(),
968
- licenseState: z12.string().optional(),
969
- relationship: z12.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
970
- yearsLicensed: z12.number().optional(),
971
- gender: z12.string().optional(),
972
- maritalStatus: z12.string().optional(),
973
- goodStudentDiscount: z12.boolean().optional(),
974
- defensiveDriverDiscount: z12.boolean().optional(),
975
- violations: z12.array(z12.object({
976
- date: z12.string().optional(),
977
- type: z12.string().optional(),
978
- description: z12.string().optional()
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: z12.array(z12.object({
981
- date: z12.string().optional(),
982
- atFault: z12.boolean().optional(),
983
- description: z12.string().optional(),
984
- amountPaid: z12.string().optional()
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: z12.boolean().optional()
987
- });
988
- var PersonalVehicleDetailsSchema = z12.object({
989
- number: z12.number().optional(),
990
- year: z12.number().optional(),
991
- make: z12.string().optional(),
992
- model: z12.string().optional(),
993
- vin: z12.string().optional(),
994
- bodyType: z12.string().optional(),
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: z12.number().optional(),
998
- odometerReading: z12.number().optional(),
999
- driverAssignment: z12.string().optional(),
1280
+ annualMileage: z13.number().optional(),
1281
+ odometerReading: z13.number().optional(),
1282
+ driverAssignment: z13.string().optional(),
1000
1283
  lienHolder: EndorsementPartySchema.optional(),
1001
- collisionDeductible: z12.string().optional(),
1002
- comprehensiveDeductible: z12.string().optional(),
1003
- rentalReimbursement: z12.boolean().optional(),
1004
- towing: z12.boolean().optional()
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 = z13.object({
1009
- line: z13.literal("homeowners"),
1291
+ var HomeownersDeclarationsSchema = z14.object({
1292
+ line: z14.literal("homeowners"),
1010
1293
  formType: HomeownersFormTypeSchema,
1011
- coverageA: z13.string().optional(),
1012
- coverageB: z13.string().optional(),
1013
- coverageC: z13.string().optional(),
1014
- coverageD: z13.string().optional(),
1015
- coverageE: z13.string().optional(),
1016
- coverageF: z13.string().optional(),
1017
- allPerilDeductible: z13.string().optional(),
1018
- windHailDeductible: z13.string().optional(),
1019
- hurricaneDeductible: z13.string().optional(),
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: z13.array(EndorsementPartySchema).optional()
1024
- });
1025
- var PersonalAutoDeclarationsSchema = z13.object({
1026
- line: z13.literal("personal_auto"),
1027
- vehicles: z13.array(PersonalVehicleDetailsSchema),
1028
- drivers: z13.array(DriverRecordSchema),
1029
- liabilityLimits: z13.object({
1030
- bodilyInjuryPerPerson: z13.string().optional(),
1031
- bodilyInjuryPerAccident: z13.string().optional(),
1032
- propertyDamage: z13.string().optional(),
1033
- combinedSingleLimit: z13.string().optional()
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: z13.object({
1036
- bodilyInjuryPerPerson: z13.string().optional(),
1037
- bodilyInjuryPerAccident: z13.string().optional()
1318
+ umLimits: z14.object({
1319
+ bodilyInjuryPerPerson: z14.string().optional(),
1320
+ bodilyInjuryPerAccident: z14.string().optional()
1038
1321
  }).optional(),
1039
- uimLimits: z13.object({
1040
- bodilyInjuryPerPerson: z13.string().optional(),
1041
- bodilyInjuryPerAccident: z13.string().optional()
1322
+ uimLimits: z14.object({
1323
+ bodilyInjuryPerPerson: z14.string().optional(),
1324
+ bodilyInjuryPerAccident: z14.string().optional()
1042
1325
  }).optional(),
1043
- pipLimit: z13.string().optional(),
1044
- medPayLimit: z13.string().optional()
1326
+ pipLimit: z14.string().optional(),
1327
+ medPayLimit: z14.string().optional()
1045
1328
  });
1046
- var DwellingFireDeclarationsSchema = z13.object({
1047
- line: z13.literal("dwelling_fire"),
1329
+ var DwellingFireDeclarationsSchema = z14.object({
1330
+ line: z14.literal("dwelling_fire"),
1048
1331
  formType: DwellingFireFormTypeSchema,
1049
- dwellingLimit: z13.string().optional(),
1050
- otherStructuresLimit: z13.string().optional(),
1051
- personalPropertyLimit: z13.string().optional(),
1052
- fairRentalValueLimit: z13.string().optional(),
1053
- liabilityLimit: z13.string().optional(),
1054
- medicalPaymentsLimit: z13.string().optional(),
1055
- deductible: z13.string().optional(),
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 = z13.object({
1059
- line: z13.literal("flood"),
1060
- programType: z13.enum(["nfip", "private"]),
1341
+ var FloodDeclarationsSchema = z14.object({
1342
+ line: z14.literal("flood"),
1343
+ programType: z14.enum(["nfip", "private"]),
1061
1344
  floodZone: FloodZoneSchema.optional(),
1062
- communityNumber: z13.string().optional(),
1063
- communityRating: z13.number().optional(),
1064
- buildingCoverage: z13.string().optional(),
1065
- contentsCoverage: z13.string().optional(),
1066
- iccCoverage: z13.string().optional(),
1067
- deductible: z13.string().optional(),
1068
- waitingPeriodDays: z13.number().optional(),
1069
- elevationCertificate: z13.boolean().optional(),
1070
- elevationDifference: z13.string().optional(),
1071
- buildingDiagramNumber: z13.number().optional(),
1072
- basementOrEnclosure: z13.boolean().optional(),
1073
- postFirmConstruction: z13.boolean().optional()
1074
- });
1075
- var EarthquakeDeclarationsSchema = z13.object({
1076
- line: z13.literal("earthquake"),
1077
- dwellingCoverage: z13.string().optional(),
1078
- contentsCoverage: z13.string().optional(),
1079
- lossOfUseCoverage: z13.string().optional(),
1080
- deductiblePercent: z13.number().optional(),
1081
- retrofitDiscount: z13.boolean().optional(),
1082
- masonryVeneerCoverage: z13.boolean().optional()
1083
- });
1084
- var PersonalUmbrellaDeclarationsSchema = z13.object({
1085
- line: z13.literal("personal_umbrella"),
1086
- perOccurrenceLimit: z13.string().optional(),
1087
- aggregateLimit: z13.string().optional(),
1088
- retainedLimit: z13.string().optional(),
1089
- underlyingPolicies: z13.array(z13.object({
1090
- carrier: z13.string().optional(),
1091
- policyNumber: z13.string().optional(),
1092
- policyType: z13.string().optional(),
1093
- limits: z13.string().optional()
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 = z13.object({
1097
- line: z13.literal("personal_articles"),
1098
- scheduledItems: z13.array(z13.object({
1099
- itemNumber: z13.number().optional(),
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: z13.string(),
1102
- appraisedValue: z13.string(),
1103
- appraisalDate: z13.string().optional()
1384
+ description: z14.string(),
1385
+ appraisedValue: z14.string(),
1386
+ appraisalDate: z14.string().optional()
1104
1387
  })),
1105
- blanketCoverage: z13.string().optional(),
1106
- deductible: z13.string().optional(),
1107
- worldwideCoverage: z13.boolean().optional(),
1108
- breakageCoverage: z13.boolean().optional()
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 = z13.object({
1111
- line: z13.literal("watercraft"),
1393
+ var WatercraftDeclarationsSchema = z14.object({
1394
+ line: z14.literal("watercraft"),
1112
1395
  boatType: BoatTypeSchema.optional(),
1113
- year: z13.number().optional(),
1114
- make: z13.string().optional(),
1115
- model: z13.string().optional(),
1116
- length: z13.string().optional(),
1117
- hullMaterial: z13.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
1118
- hullValue: z13.string().optional(),
1119
- motorHorsepower: z13.number().optional(),
1120
- motorType: z13.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
1121
- navigationLimits: z13.string().optional(),
1122
- layupPeriod: z13.string().optional(),
1123
- liabilityLimit: z13.string().optional(),
1124
- medicalPaymentsLimit: z13.string().optional(),
1125
- physicalDamageDeductible: z13.string().optional(),
1126
- uninsuredBoaterLimit: z13.string().optional(),
1127
- trailerCovered: z13.boolean().optional(),
1128
- trailerValue: z13.string().optional()
1129
- });
1130
- var RecreationalVehicleDeclarationsSchema = z13.object({
1131
- line: z13.literal("recreational_vehicle"),
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: z13.number().optional(),
1134
- make: z13.string().optional(),
1135
- model: z13.string().optional(),
1136
- vin: z13.string().optional(),
1137
- value: z13.string().optional(),
1138
- liabilityLimit: z13.string().optional(),
1139
- collisionDeductible: z13.string().optional(),
1140
- comprehensiveDeductible: z13.string().optional(),
1141
- personalEffectsCoverage: z13.string().optional(),
1142
- fullTimerCoverage: z13.boolean().optional()
1143
- });
1144
- var FarmRanchDeclarationsSchema = z13.object({
1145
- line: z13.literal("farm_ranch"),
1146
- dwellingCoverage: z13.string().optional(),
1147
- farmPersonalPropertyCoverage: z13.string().optional(),
1148
- farmLiabilityLimit: z13.string().optional(),
1149
- farmAutoIncluded: z13.boolean().optional(),
1150
- livestock: z13.array(z13.object({
1151
- type: z13.string(),
1152
- headCount: z13.number(),
1153
- value: z13.string().optional()
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: z13.array(z13.object({
1156
- description: z13.string(),
1157
- value: z13.string()
1438
+ equipmentSchedule: z14.array(z14.object({
1439
+ description: z14.string(),
1440
+ value: z14.string()
1158
1441
  })).optional(),
1159
- acreage: z13.number().optional(),
1442
+ acreage: z14.number().optional(),
1160
1443
  dwelling: DwellingDetailsSchema.optional()
1161
1444
  });
1162
- var TitleDeclarationsSchema = z13.object({
1163
- line: z13.literal("title"),
1445
+ var TitleDeclarationsSchema = z14.object({
1446
+ line: z14.literal("title"),
1164
1447
  policyType: TitlePolicyTypeSchema,
1165
- policyAmount: z13.string(),
1166
- legalDescription: z13.string().optional(),
1448
+ policyAmount: z14.string(),
1449
+ legalDescription: z14.string().optional(),
1167
1450
  propertyAddress: AddressSchema.optional(),
1168
- effectiveDate: z13.string().optional(),
1169
- exceptions: z13.array(z13.object({
1170
- number: z13.number(),
1171
- description: z13.string()
1451
+ effectiveDate: z14.string().optional(),
1452
+ exceptions: z14.array(z14.object({
1453
+ number: z14.number(),
1454
+ description: z14.string()
1172
1455
  })).optional(),
1173
- underwriter: z13.string().optional()
1456
+ underwriter: z14.string().optional()
1174
1457
  });
1175
- var PetDeclarationsSchema = z13.object({
1176
- line: z13.literal("pet"),
1458
+ var PetDeclarationsSchema = z14.object({
1459
+ line: z14.literal("pet"),
1177
1460
  species: PetSpeciesSchema,
1178
- breed: z13.string().optional(),
1179
- petName: z13.string().optional(),
1180
- age: z13.number().optional(),
1181
- annualLimit: z13.string().optional(),
1182
- perIncidentLimit: z13.string().optional(),
1183
- deductible: z13.string().optional(),
1184
- reimbursementPercent: z13.number().optional(),
1185
- waitingPeriodDays: z13.number().optional(),
1186
- preExistingConditionsExcluded: z13.boolean().optional(),
1187
- wellnessCoverage: z13.boolean().optional()
1188
- });
1189
- var TravelDeclarationsSchema = z13.object({
1190
- line: z13.literal("travel"),
1191
- tripDepartureDate: z13.string().optional(),
1192
- tripReturnDate: z13.string().optional(),
1193
- destinations: z13.array(z13.string()).optional(),
1194
- travelers: z13.array(z13.object({
1195
- name: z13.string(),
1196
- age: z13.number().optional()
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: z13.string().optional(),
1199
- tripCancellationLimit: z13.string().optional(),
1200
- medicalLimit: z13.string().optional(),
1201
- evacuationLimit: z13.string().optional(),
1202
- baggageLimit: z13.string().optional()
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 = z13.object({
1205
- line: z13.literal("identity_theft"),
1206
- coverageLimit: z13.string().optional(),
1207
- expenseReimbursement: z13.string().optional(),
1208
- creditMonitoring: z13.boolean().optional(),
1209
- restorationServices: z13.boolean().optional(),
1210
- lostWagesLimit: z13.string().optional()
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 z14 } from "zod";
1215
- var GLDeclarationsSchema = z14.object({
1216
- line: z14.literal("gl"),
1497
+ import { z as z15 } from "zod";
1498
+ var GLDeclarationsSchema = z15.object({
1499
+ line: z15.literal("gl"),
1217
1500
  coverageForm: CoverageFormSchema.optional(),
1218
- perOccurrenceLimit: z14.string().optional(),
1219
- generalAggregate: z14.string().optional(),
1220
- productsCompletedOpsAggregate: z14.string().optional(),
1221
- personalAdvertisingInjury: z14.string().optional(),
1222
- fireDamage: z14.string().optional(),
1223
- medicalExpense: z14.string().optional(),
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: z14.string().optional(),
1226
- classifications: z14.array(ClassificationCodeSchema).optional(),
1227
- retroactiveDate: z14.string().optional()
1228
- });
1229
- var CommercialPropertyDeclarationsSchema = z14.object({
1230
- line: z14.literal("commercial_property"),
1231
- causesOfLossForm: z14.enum(["basic", "broad", "special"]).optional(),
1232
- coinsurancePercent: z14.number().optional(),
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: z14.array(InsuredLocationSchema),
1235
- blanketLimit: z14.string().optional(),
1236
- businessIncomeLimit: z14.string().optional(),
1237
- extraExpenseLimit: z14.string().optional()
1238
- });
1239
- var CommercialAutoDeclarationsSchema = z14.object({
1240
- line: z14.literal("commercial_auto"),
1241
- vehicles: z14.array(InsuredVehicleSchema),
1242
- coveredAutoSymbols: z14.array(z14.number()).optional(),
1243
- liabilityLimit: z14.string().optional(),
1244
- umLimit: z14.string().optional(),
1245
- uimLimit: z14.string().optional(),
1246
- hiredAutoLiability: z14.boolean().optional(),
1247
- nonOwnedAutoLiability: z14.boolean().optional()
1248
- });
1249
- var WorkersCompDeclarationsSchema = z14.object({
1250
- line: z14.literal("workers_comp"),
1251
- coveredStates: z14.array(z14.string()).optional(),
1252
- classifications: z14.array(ClassificationCodeSchema),
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 = z14.object({
1257
- line: z14.literal("umbrella_excess"),
1258
- perOccurrenceLimit: z14.string().optional(),
1259
- aggregateLimit: z14.string().optional(),
1260
- retention: z14.string().optional(),
1261
- underlyingPolicies: z14.array(z14.object({
1262
- carrier: z14.string().optional(),
1263
- policyNumber: z14.string().optional(),
1264
- policyType: z14.string().optional(),
1265
- limits: z14.string().optional()
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 = z14.object({
1269
- line: z14.literal("professional_liability"),
1270
- perClaimLimit: z14.string().optional(),
1271
- aggregateLimit: z14.string().optional(),
1272
- retroactiveDate: z14.string().optional(),
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 = z14.object({
1277
- line: z14.literal("cyber"),
1278
- aggregateLimit: z14.string().optional(),
1279
- retroactiveDate: z14.string().optional(),
1280
- waitingPeriodHours: z14.number().optional(),
1281
- sublimits: z14.array(z14.object({
1282
- coverageName: z14.string(),
1283
- limit: z14.string()
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 = z14.object({
1287
- line: z14.literal("directors_officers"),
1288
- sideALimit: z14.string().optional(),
1289
- sideBLimit: z14.string().optional(),
1290
- sideCLimit: z14.string().optional(),
1291
- sideARetention: z14.string().optional(),
1292
- sideBRetention: z14.string().optional(),
1293
- sideCRetention: z14.string().optional(),
1294
- continuityDate: z14.string().optional()
1295
- });
1296
- var CrimeDeclarationsSchema = z14.object({
1297
- line: z14.literal("crime"),
1298
- formType: z14.enum(["discovery", "loss_sustained"]).optional(),
1299
- agreements: z14.array(z14.object({
1300
- agreement: z14.string(),
1301
- coverageName: z14.string(),
1302
- limit: z14.string(),
1303
- deductible: z14.string()
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 = z15.discriminatedUnion("line", [
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 z16 } from "zod";
1338
- var SubsectionSchema = z16.object({
1339
- title: z16.string(),
1340
- sectionNumber: z16.string().optional(),
1341
- pageNumber: z16.number().optional(),
1342
- excerpt: z16.string().optional(),
1343
- content: z16.string().optional(),
1344
- documentNodeId: z16.string().optional(),
1345
- sourceSpanIds: z16.array(z16.string()).optional(),
1346
- sourceTextHash: z16.string().optional()
1347
- });
1348
- var SectionSchema = z16.object({
1349
- title: z16.string(),
1350
- sectionNumber: z16.string().optional(),
1351
- pageStart: z16.number(),
1352
- pageEnd: z16.number().optional(),
1353
- type: z16.string(),
1354
- coverageType: z16.string().optional(),
1355
- excerpt: z16.string().optional(),
1356
- content: z16.string().optional(),
1357
- subsections: z16.array(SubsectionSchema).optional(),
1358
- recordId: z16.string().optional(),
1359
- documentNodeId: z16.string().optional(),
1360
- sourceSpanIds: z16.array(z16.string()).optional(),
1361
- sourceTextHash: z16.string().optional()
1362
- });
1363
- var SubjectivitySchema = z16.object({
1364
- description: z16.string(),
1365
- category: z16.string().optional()
1366
- });
1367
- var UnderwritingConditionSchema = z16.object({
1368
- description: z16.string()
1369
- });
1370
- var PremiumLineSchema = z16.object({
1371
- line: z16.string(),
1372
- amount: z16.string(),
1373
- amountValue: z16.number().optional(),
1374
- documentNodeId: z16.string().optional(),
1375
- sourceSpanIds: z16.array(z16.string()).optional(),
1376
- sourceTextHash: z16.string().optional()
1377
- });
1378
- var AuxiliaryFactSchema = z16.object({
1379
- key: z16.string(),
1380
- value: z16.string(),
1381
- subject: z16.string().optional(),
1382
- context: z16.string().optional(),
1383
- documentNodeId: z16.string().optional(),
1384
- sourceSpanIds: z16.array(z16.string()).optional(),
1385
- sourceTextHash: z16.string().optional()
1386
- });
1387
- var DefinitionSchema = z16.object({
1388
- term: z16.string(),
1389
- definition: z16.string(),
1390
- pageNumber: z16.number().optional(),
1391
- formNumber: z16.string().optional(),
1392
- formTitle: z16.string().optional(),
1393
- sectionRef: z16.string().optional(),
1394
- originalContent: z16.string().optional(),
1395
- recordId: z16.string().optional(),
1396
- documentNodeId: z16.string().optional(),
1397
- sourceSpanIds: z16.array(z16.string()).optional(),
1398
- sourceTextHash: z16.string().optional()
1399
- });
1400
- var CoveredReasonSchema = z16.object({
1401
- coverageName: z16.string(),
1402
- reasonNumber: z16.string().optional(),
1403
- title: z16.string().optional(),
1404
- content: z16.string(),
1405
- conditions: z16.array(z16.string()).optional(),
1406
- exceptions: z16.array(z16.string()).optional(),
1407
- appliesTo: z16.array(z16.string()).optional(),
1408
- pageNumber: z16.number().optional(),
1409
- formNumber: z16.string().optional(),
1410
- formTitle: z16.string().optional(),
1411
- sectionRef: z16.string().optional(),
1412
- originalContent: z16.string().optional(),
1413
- recordId: z16.string().optional(),
1414
- documentNodeId: z16.string().optional(),
1415
- sourceSpanIds: z16.array(z16.string()).optional(),
1416
- sourceTextHash: z16.string().optional()
1417
- });
1418
- var DocumentTableOfContentsEntrySchema = z16.object({
1419
- title: z16.string(),
1420
- level: z16.number().int().positive().optional(),
1421
- pageStart: z16.number().optional(),
1422
- pageEnd: z16.number().optional(),
1423
- documentNodeId: z16.string().optional(),
1424
- sourceSpanIds: z16.array(z16.string()).optional()
1425
- });
1426
- var DocumentPageMapEntrySchema = z16.object({
1427
- page: z16.number().int().positive(),
1428
- label: z16.string().optional(),
1429
- formNumber: z16.string().optional(),
1430
- formTitle: z16.string().optional(),
1431
- sectionTitle: z16.string().optional(),
1432
- extractorNames: z16.array(z16.string()).optional(),
1433
- sourceSpanIds: z16.array(z16.string()).optional()
1434
- });
1435
- var DocumentAgentGuidanceSchema = z16.object({
1436
- kind: z16.string(),
1437
- title: z16.string(),
1438
- detail: z16.string(),
1439
- sourceSpanIds: z16.array(z16.string()).optional()
1440
- });
1441
- var DocumentMetadataSchema = z16.object({
1442
- sourceTreeVersion: z16.string().optional(),
1443
- sourceTreeCanonical: z16.boolean().optional(),
1444
- formInventory: z16.array(FormReferenceSchema).optional(),
1445
- tableOfContents: z16.array(DocumentTableOfContentsEntrySchema).optional(),
1446
- pageMap: z16.array(DocumentPageMapEntrySchema).optional(),
1447
- agentGuidance: z16.array(DocumentAgentGuidanceSchema).optional()
1448
- });
1449
- var DocumentNodeSchema = z16.lazy(
1450
- () => z16.object({
1451
- id: z16.string(),
1452
- title: z16.string(),
1453
- originalTitle: z16.string().optional(),
1454
- type: z16.string().optional(),
1455
- label: z16.string().optional(),
1456
- level: z16.number().int().positive().optional(),
1457
- sectionNumber: z16.string().optional(),
1458
- pageStart: z16.number().optional(),
1459
- pageEnd: z16.number().optional(),
1460
- formNumber: z16.string().optional(),
1461
- formTitle: z16.string().optional(),
1462
- excerpt: z16.string().optional(),
1463
- content: z16.string().optional(),
1464
- interpretationLabels: z16.array(z16.string()).optional(),
1465
- sourceSpanIds: z16.array(z16.string()).optional(),
1466
- sourceTextHash: z16.string().optional(),
1467
- children: z16.array(DocumentNodeSchema).optional()
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: z16.string(),
1472
- carrier: z16.string(),
1473
- security: z16.string().optional(),
1474
- insuredName: z16.string(),
1475
- premium: z16.string().optional(),
1476
- premiumAmount: z16.number().optional(),
1477
- summary: z16.string().optional(),
1478
- policyTypes: z16.array(z16.string()).optional(),
1479
- coverages: z16.array(CoverageSchema),
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: z16.array(DocumentNodeSchema),
1482
- sections: z16.array(SectionSchema).optional(),
1483
- definitions: z16.array(DefinitionSchema).optional(),
1484
- coveredReasons: z16.array(CoveredReasonSchema).optional(),
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: z16.string().optional(),
1487
- carrierNaicNumber: z16.string().optional(),
1488
- carrierAmBestRating: z16.string().optional(),
1489
- carrierAdmittedStatus: z16.string().optional(),
1490
- mga: z16.string().optional(),
1491
- underwriter: z16.string().optional(),
1492
- brokerAgency: z16.string().optional(),
1493
- brokerContactName: z16.string().optional(),
1494
- brokerLicenseNumber: z16.string().optional(),
1495
- priorPolicyNumber: z16.string().optional(),
1496
- programName: z16.string().optional(),
1497
- isRenewal: z16.boolean().optional(),
1498
- isPackage: z16.boolean().optional(),
1499
- insuredDba: z16.string().optional(),
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: z16.array(NamedInsuredSchema).optional(),
1503
- insuredSicCode: z16.string().optional(),
1504
- insuredNaicsCode: z16.string().optional(),
1505
- insuredFein: z16.string().optional(),
1506
- enrichedCoverages: z16.array(EnrichedCoverageSchema).optional(),
1507
- endorsements: z16.array(EndorsementSchema).optional(),
1508
- exclusions: z16.array(ExclusionSchema).optional(),
1509
- conditions: z16.array(PolicyConditionSchema).optional(),
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: z16.array(InsuredLocationSchema).optional(),
1513
- vehicles: z16.array(InsuredVehicleSchema).optional(),
1514
- classifications: z16.array(ClassificationCodeSchema).optional(),
1515
- formInventory: z16.array(FormReferenceSchema).optional(),
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: z16.string().optional(),
1801
+ retroactiveDate: z17.string().optional(),
1519
1802
  extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
1520
1803
  insurer: InsurerInfoSchema.optional(),
1521
1804
  producer: ProducerInfoSchema.optional(),
1522
- claimsContacts: z16.array(ContactSchema).optional(),
1523
- regulatoryContacts: z16.array(ContactSchema).optional(),
1524
- thirdPartyAdministrators: z16.array(ContactSchema).optional(),
1525
- additionalInsureds: z16.array(EndorsementPartySchema).optional(),
1526
- lossPayees: z16.array(EndorsementPartySchema).optional(),
1527
- mortgageHolders: z16.array(EndorsementPartySchema).optional(),
1528
- taxesAndFees: z16.array(TaxFeeItemSchema).optional(),
1529
- totalCost: z16.string().optional(),
1530
- totalCostAmount: z16.number().optional(),
1531
- minimumPremium: z16.string().optional(),
1532
- minimumPremiumAmount: z16.number().optional(),
1533
- depositPremium: z16.string().optional(),
1534
- depositPremiumAmount: z16.number().optional(),
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: z16.array(RatingBasisSchema).optional(),
1538
- premiumByLocation: z16.array(LocationPremiumSchema).optional(),
1820
+ ratingBasis: z17.array(RatingBasisSchema).optional(),
1821
+ premiumByLocation: z17.array(LocationPremiumSchema).optional(),
1539
1822
  lossSummary: LossSummarySchema.optional(),
1540
- individualClaims: z16.array(ClaimRecordSchema).optional(),
1823
+ individualClaims: z17.array(ClaimRecordSchema).optional(),
1541
1824
  experienceMod: ExperienceModSchema.optional(),
1542
- cancellationNoticeDays: z16.number().optional(),
1543
- nonrenewalNoticeDays: z16.number().optional(),
1544
- supplementaryFacts: z16.array(AuxiliaryFactSchema).optional()
1825
+ cancellationNoticeDays: z17.number().optional(),
1826
+ nonrenewalNoticeDays: z17.number().optional(),
1827
+ supplementaryFacts: z17.array(AuxiliaryFactSchema).optional()
1545
1828
  };
1546
- var PolicyDocumentSchema = z16.object({
1829
+ var PolicyDocumentSchema = z17.object({
1547
1830
  ...BaseDocumentFields,
1548
- type: z16.literal("policy"),
1549
- policyNumber: z16.string(),
1550
- effectiveDate: z16.string(),
1551
- expirationDate: z16.string().optional(),
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: z16.string().optional(),
1554
- effectiveTime: z16.string().optional()
1836
+ nextReviewDate: z17.string().optional(),
1837
+ effectiveTime: z17.string().optional()
1555
1838
  });
1556
- var QuoteDocumentSchema = z16.object({
1839
+ var QuoteDocumentSchema = z17.object({
1557
1840
  ...BaseDocumentFields,
1558
- type: z16.literal("quote"),
1559
- quoteNumber: z16.string(),
1560
- proposedEffectiveDate: z16.string().optional(),
1561
- proposedExpirationDate: z16.string().optional(),
1562
- quoteExpirationDate: z16.string().optional(),
1563
- subjectivities: z16.array(SubjectivitySchema).optional(),
1564
- underwritingConditions: z16.array(UnderwritingConditionSchema).optional(),
1565
- premiumBreakdown: z16.array(PremiumLineSchema).optional(),
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: z16.array(EnrichedSubjectivitySchema).optional(),
1568
- enrichedUnderwritingConditions: z16.array(EnrichedUnderwritingConditionSchema).optional(),
1569
- warrantyRequirements: z16.array(z16.string()).optional(),
1570
- lossControlRecommendations: z16.array(z16.string()).optional(),
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 = z16.discriminatedUnion("type", [
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 z17 } from "zod";
1580
- var PlatformSchema = z17.enum(["email", "chat", "sms", "slack", "discord"]);
1581
- var CommunicationIntentSchema = z17.enum(["direct", "mediated", "observed"]);
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 z19 } from "zod";
1897
+ import { z as z20 } from "zod";
1615
1898
 
1616
1899
  // src/case/index.ts
1617
- import { z as z18 } from "zod";
1618
- var CaseEvidenceSourceSchema = z18.object({
1619
- id: z18.string(),
1620
- label: z18.string().optional(),
1621
- documentId: z18.string().optional(),
1622
- page: z18.number().optional(),
1623
- fieldPath: z18.string().optional(),
1624
- text: z18.string().describe("Source text available for span validation and citation"),
1625
- metadata: z18.record(z18.string(), z18.string()).optional()
1626
- });
1627
- var CaseCitationSchema = z18.object({
1628
- sourceId: z18.string(),
1629
- quote: z18.string(),
1630
- page: z18.number().optional(),
1631
- fieldPath: z18.string().optional()
1632
- });
1633
- var ValidationIssueSeveritySchema = z18.enum(["info", "warning", "blocking"]);
1634
- var CaseValidationIssueSchema = z18.object({
1635
- code: z18.string(),
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: z18.string(),
1638
- itemId: z18.string().optional(),
1639
- fieldPath: z18.string().optional(),
1640
- sourceId: z18.string().optional()
1641
- });
1642
- var MissingInfoQuestionSchema = z18.object({
1643
- id: z18.string(),
1644
- itemId: z18.string().optional(),
1645
- fieldPath: z18.string().optional(),
1646
- question: z18.string(),
1647
- reason: z18.string(),
1648
- answer: z18.string().optional()
1649
- });
1650
- var CasePacketArtifactKindSchema = z18.enum([
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 = z18.object({
1658
- id: z18.string(),
1940
+ var CasePacketArtifactSchema = z19.object({
1941
+ id: z19.string(),
1659
1942
  kind: CasePacketArtifactKindSchema,
1660
- title: z18.string(),
1661
- content: z18.string(),
1662
- citations: z18.array(CaseCitationSchema).default([])
1663
- });
1664
- var CaseSubmissionPacketSchema = z18.object({
1665
- id: z18.string(),
1666
- caseId: z18.string(),
1667
- artifacts: z18.array(CasePacketArtifactSchema),
1668
- validationIssues: z18.array(CaseValidationIssueSchema),
1669
- missingInfoQuestions: z18.array(MissingInfoQuestionSchema),
1670
- createdAt: z18.number()
1671
- });
1672
- var CaseActionSchema = z18.enum([
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 = z18.enum(["deterministic_tree", "market_eval", "hybrid"]);
1686
- var CaseProposalScoreSchema = z18.object({
1687
- grounding: z18.number().min(0).max(1),
1688
- completeness: z18.number().min(0).max(1),
1689
- consistency: z18.number().min(0).max(1),
1690
- determinism: z18.number().min(0).max(1),
1691
- risk: z18.number().min(0).max(1),
1692
- cost: z18.number().min(0).max(1)
1693
- });
1694
- var CaseProposalSchema = z18.object({
1695
- id: z18.string(),
1696
- sourceSpanIds: z18.array(z18.string()).default([]),
1697
- confidence: z18.number().min(0).max(1),
1698
- missingInfo: z18.array(z18.string()).default([]),
1699
- validationIssues: z18.array(CaseValidationIssueSchema).default([]),
1700
- estimatedRisk: z18.number().min(0).max(1).default(0.5),
1701
- estimatedCost: z18.number().min(0).max(1).default(0.5),
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 = z19.enum(["add", "remove", "update", "replace", "clarify"]);
1821
- var PolicyChangeKindSchema = z19.enum([
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 = z19.enum(["high", "medium", "low"]);
1836
- var PolicyChangeStatusSchema = z19.enum(["draft", "needs_info", "ready", "blocked"]);
1837
- var PolicyChangeItemSchema = z19.object({
1838
- id: z19.string(),
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: z19.string().default("unknown"),
1842
- fieldPath: z19.string().describe("Stable policy field path or business field name"),
1843
- label: z19.string(),
1844
- beforeValue: z19.string().optional().describe("Existing policy value, when cited from policy evidence"),
1845
- afterValue: z19.string().optional().describe("Requested new value"),
1846
- requestedValue: z19.string().optional().describe("Alias for afterValue used by policy-change workflows"),
1847
- effectiveDate: z19.string().optional(),
1848
- reason: z19.string().optional(),
1849
- sourceIds: z19.array(z19.string()).default([]),
1850
- sourceSpanIds: z19.array(z19.string()).default([]),
1851
- userSourceSpanIds: z19.array(z19.string()).optional(),
1852
- citations: z19.array(CaseCitationSchema).default([]),
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: z19.number().min(0).max(1).optional(),
2137
+ confidenceScore: z20.number().min(0).max(1).optional(),
1855
2138
  status: PolicyChangeStatusSchema.default("ready")
1856
2139
  });
1857
- var PceNormalizationResultSchema = z19.object({
1858
- summary: z19.string(),
1859
- items: z19.array(PolicyChangeItemSchema.omit({ id: true, status: true }).extend({
1860
- id: z19.string().optional(),
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: z19.array(MissingInfoQuestionSchema.omit({ id: true }).extend({
1864
- id: z19.string().optional()
2146
+ missingInfoQuestions: z20.array(MissingInfoQuestionSchema.omit({ id: true }).extend({
2147
+ id: z20.string().optional()
1865
2148
  })).default([])
1866
2149
  });
1867
- var PolicyChangeImpactSchema = z19.object({
1868
- itemId: z19.string(),
1869
- beforeValue: z19.string().optional(),
1870
- requestedValue: z19.string().optional(),
1871
- likelyEndorsementRequired: z19.boolean().default(true),
1872
- carrierApprovalLikelyRequired: z19.boolean().default(true),
1873
- affectedCoverageForms: z19.array(z19.string()).default([]),
1874
- sourceSpanIds: z19.array(z19.string()).default([])
1875
- });
1876
- var PceCaseStateSchema = z19.object({
1877
- id: z19.string(),
1878
- requestText: z19.string(),
1879
- summary: z19.string(),
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: z19.array(PolicyChangeItemSchema),
1882
- impacts: z19.array(PolicyChangeImpactSchema),
1883
- evidenceSources: z19.array(CaseEvidenceSourceSchema),
1884
- validationIssues: z19.array(CaseValidationIssueSchema),
1885
- missingInfoQuestions: z19.array(MissingInfoQuestionSchema),
1886
- createdAt: z19.number(),
1887
- updatedAt: z19.number()
1888
- });
1889
- var PolicyChangeRequestSchema = z19.object({
1890
- id: z19.string(),
1891
- text: z19.string(),
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: z19.array(z19.string()).optional(),
1894
- createdAt: z19.number().optional()
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: z19.array(CasePacketArtifactSchema)
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: "policyTypes", category: "coverage", contextKey: "coverage_types", description: "Lines of business covered" },
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 z20 } from "zod";
1955
- var SourceSpanKindSchema = z20.enum([
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 = z20.enum([
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 = z20.enum([
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 = z20.object({
1980
- page: z20.number().int().positive(),
1981
- x: z20.number(),
1982
- y: z20.number(),
1983
- width: z20.number(),
1984
- height: z20.number()
1985
- });
1986
- var SourceSpanLocationSchema = z20.object({
1987
- page: z20.number().int().positive().optional(),
1988
- startPage: z20.number().int().positive().optional(),
1989
- endPage: z20.number().int().positive().optional(),
1990
- charStart: z20.number().int().nonnegative().optional(),
1991
- charEnd: z20.number().int().nonnegative().optional(),
1992
- lineStart: z20.number().int().positive().optional(),
1993
- lineEnd: z20.number().int().positive().optional(),
1994
- fieldPath: z20.string().optional()
1995
- });
1996
- var SourceSpanTableLocationSchema = z20.object({
1997
- tableId: z20.string().optional(),
1998
- rowIndex: z20.number().int().nonnegative().optional(),
1999
- columnIndex: z20.number().int().nonnegative().optional(),
2000
- columnName: z20.string().optional(),
2001
- rowSpanId: z20.string().optional(),
2002
- tableSpanId: z20.string().optional(),
2003
- isHeader: z20.boolean().optional()
2004
- });
2005
- var SourceSpanSchema = z20.object({
2006
- id: z20.string().min(1),
2007
- documentId: z20.string().min(1),
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: z20.string().optional(),
2292
+ chunkId: z21.string().optional(),
2010
2293
  kind: SourceSpanKindSchema,
2011
- text: z20.string(),
2012
- hash: z20.string().min(1),
2013
- textHash: z20.string().optional(),
2014
- pageStart: z20.number().int().positive().optional(),
2015
- pageEnd: z20.number().int().positive().optional(),
2016
- sectionId: z20.string().optional(),
2017
- formNumber: z20.string().optional(),
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: z20.string().optional(),
2302
+ parentSpanId: z21.string().optional(),
2020
2303
  table: SourceSpanTableLocationSchema.optional(),
2021
- bbox: z20.array(SourceSpanBBoxSchema).optional(),
2304
+ bbox: z21.array(SourceSpanBBoxSchema).optional(),
2022
2305
  location: SourceSpanLocationSchema.optional(),
2023
- metadata: z20.record(z20.string(), z20.string()).optional()
2024
- });
2025
- var SourceSpanRefSchema = z20.object({
2026
- sourceSpanId: z20.string().min(1),
2027
- documentId: z20.string().min(1).optional(),
2028
- chunkId: z20.string().optional(),
2029
- quote: z20.string().optional(),
2030
- hash: z20.string().optional(),
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 = z20.object({
2034
- id: z20.string().min(1),
2035
- documentId: z20.string().min(1),
2036
- sourceSpanIds: z20.array(z20.string().min(1)),
2037
- text: z20.string(),
2038
- textHash: z20.string().min(1),
2039
- pageStart: z20.number().int().positive().optional(),
2040
- pageEnd: z20.number().int().positive().optional(),
2041
- metadata: z20.record(z20.string(), z20.string()).default({})
2042
- });
2043
- var DocumentSourceNodeKindSchema = z20.enum([
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 = z20.object({
2058
- id: z20.string().min(1),
2059
- documentId: z20.string().min(1),
2060
- parentId: z20.string().optional(),
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: z20.string(),
2063
- description: z20.string(),
2064
- textExcerpt: z20.string().optional(),
2065
- sourceSpanIds: z20.array(z20.string().min(1)),
2066
- pageStart: z20.number().int().positive().optional(),
2067
- pageEnd: z20.number().int().positive().optional(),
2068
- bbox: z20.array(SourceSpanBBoxSchema).optional(),
2069
- order: z20.number().int().nonnegative(),
2070
- path: z20.string(),
2071
- metadata: z20.record(z20.string(), z20.unknown()).optional()
2072
- });
2073
- var SourceBackedValueSchema = z20.object({
2074
- value: z20.string(),
2075
- normalizedValue: z20.string().optional(),
2076
- confidence: z20.enum(["low", "medium", "high"]).default("medium"),
2077
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2078
- sourceSpanIds: z20.array(z20.string().min(1)).default([])
2079
- });
2080
- var OperationalCoverageTermSchema = z20.object({
2081
- kind: z20.enum([
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: z20.string(),
2094
- value: z20.string(),
2095
- amount: z20.number().optional(),
2096
- appliesTo: z20.string().optional(),
2097
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2098
- sourceSpanIds: z20.array(z20.string().min(1)).default([])
2099
- });
2100
- var OperationalCoverageLineSchema = z20.object({
2101
- name: z20.string(),
2102
- coverageCode: z20.string().optional(),
2103
- limit: z20.string().optional(),
2104
- deductible: z20.string().optional(),
2105
- premium: z20.string().optional(),
2106
- retroactiveDate: z20.string().optional(),
2107
- formNumber: z20.string().optional(),
2108
- sectionRef: z20.string().optional(),
2109
- endorsementNumber: z20.string().optional(),
2110
- limits: z20.array(OperationalCoverageTermSchema).default([]),
2111
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2112
- sourceSpanIds: z20.array(z20.string().min(1)).default([])
2113
- });
2114
- var OperationalPartySchema = z20.object({
2115
- role: z20.string(),
2116
- name: z20.string(),
2117
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2118
- sourceSpanIds: z20.array(z20.string().min(1)).default([])
2119
- });
2120
- var OperationalEndorsementSupportSchema = z20.object({
2121
- kind: z20.string(),
2122
- status: z20.enum(["supported", "excluded", "requires_review"]),
2123
- summary: z20.string(),
2124
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2125
- sourceSpanIds: z20.array(z20.string().min(1)).default([])
2126
- });
2127
- var PolicyOperationalProfileSchema = z20.object({
2128
- documentType: z20.enum(["policy", "quote"]).default("policy"),
2129
- policyTypes: z20.array(z20.string()).default(["other"]),
2130
- policyNumber: SourceBackedValueSchema.optional(),
2131
- namedInsured: SourceBackedValueSchema.optional(),
2132
- insurer: SourceBackedValueSchema.optional(),
2133
- broker: SourceBackedValueSchema.optional(),
2134
- effectiveDate: SourceBackedValueSchema.optional(),
2135
- expirationDate: SourceBackedValueSchema.optional(),
2136
- retroactiveDate: SourceBackedValueSchema.optional(),
2137
- premium: SourceBackedValueSchema.optional(),
2138
- coverages: z20.array(OperationalCoverageLineSchema).default([]),
2139
- parties: z20.array(OperationalPartySchema).default([]),
2140
- endorsementSupport: z20.array(OperationalEndorsementSupportSchema).default([]),
2141
- sourceNodeIds: z20.array(z20.string().min(1)).default([]),
2142
- sourceSpanIds: z20.array(z20.string().min(1)).default([]),
2143
- warnings: z20.array(z20.string()).default([])
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 POLICY_TYPE_KEYS = new Set(POLICY_TYPES);
2148
- var POLICY_TYPE_ALIASES = {
2149
- "general liability": "general_liability",
2150
- "commercial general liability": "general_liability",
2151
- cgl: "general_liability",
2152
- "commercial property": "commercial_property",
2153
- property: "property",
2154
- "property insurance": "commercial_property",
2155
- "commercial auto": "commercial_auto",
2156
- "commercial automobile": "commercial_auto",
2157
- "business auto": "commercial_auto",
2158
- "business automobile": "commercial_auto",
2159
- "auto physical damage": "commercial_auto",
2160
- "automobile physical damage": "commercial_auto",
2161
- "hired non owned auto": "non_owned_auto",
2162
- "hired non-owned auto": "non_owned_auto",
2163
- "non owned auto": "non_owned_auto",
2164
- "non-owned auto": "non_owned_auto",
2165
- "workers comp": "workers_comp",
2166
- "workers compensation": "workers_comp",
2167
- "workers' compensation": "workers_comp",
2168
- umbrella: "umbrella",
2169
- "excess liability": "excess_liability",
2170
- "professional liability": "professional_liability",
2171
- "errors and omissions": "professional_liability",
2172
- "e&o": "professional_liability",
2173
- cyber: "cyber",
2174
- "cyber liability": "cyber",
2175
- "network security": "cyber",
2176
- "privacy liability": "cyber",
2177
- epli: "epli",
2178
- "employment practices liability": "epli",
2179
- "directors and officers": "directors_officers",
2180
- "directors & officers": "directors_officers",
2181
- "d&o": "directors_officers",
2182
- "fiduciary liability insurance": "fiduciary_liability",
2183
- "crime insurance": "crime_fidelity",
2184
- "fidelity bond": "crime_fidelity",
2185
- "inland marine insurance": "inland_marine",
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 normalizeOperationalPolicyTypes(values) {
2253
- const types = Array.isArray(values) ? values.filter((value) => typeof value === "string") : [];
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 hasSpecificPolicyType(types) {
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 aliasType = POLICY_TYPE_ALIASES[text.toLowerCase()];
2265
- if (aliasType && POLICY_TYPE_KEYS.has(aliasType)) return [aliasType];
2266
- return POLICY_TYPE_TEXT_PATTERNS.filter(({ pattern }) => pattern.test(text)).map(({ type }) => type).filter((type) => POLICY_TYPE_KEYS.has(type));
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 inferPolicyTypesFromOperationalCoverages(coverages) {
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 type of policyTypesFromText(value)) {
2280
- if (!inferred.includes(type)) inferred.push(type);
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 resolveOperationalProfilePolicyTypes(params) {
2287
- const inferred = inferPolicyTypesFromOperationalCoverages(params.coverages ?? []);
2288
- if (inferred.length > 0) {
2289
- return { policyTypes: inferred, source: "coverage" };
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 = normalizeOperationalPolicyTypes(params.profileTypes);
2292
- if (hasSpecificPolicyType(controlled)) return { policyTypes: controlled, source: "profile_hint" };
2293
- const existingControlled = normalizeOperationalPolicyTypes(params.existingTypes);
2294
- if (hasSpecificPolicyType(existingControlled)) return { policyTypes: existingControlled, source: "existing_hint" };
2295
- return { policyTypes: controlled, source: "default" };
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 z22 } from "zod";
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 resolvedPolicyTypes = resolveOperationalProfilePolicyTypes({
3701
- profileTypes: candidate.policyTypes,
3702
- existingTypes: base.policyTypes,
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
- policyTypes: resolvedPolicyTypes.policyTypes,
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 z21 } from "zod";
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 = z21.enum(OPERATIONAL_COVERAGE_TERM_KINDS2);
3741
- var OperationalProfileCleanupSchema = z21.object({
3742
- coverageDecisions: z21.array(z21.object({
3743
- coverageIndex: z21.number().int().nonnegative(),
3744
- action: z21.enum(["keep", "drop", "update"]),
3745
- reason: z21.string().optional(),
3746
- name: z21.string().optional(),
3747
- limit: z21.string().nullable().optional(),
3748
- deductible: z21.string().nullable().optional(),
3749
- premium: z21.string().nullable().optional(),
3750
- retroactiveDate: z21.string().nullable().optional(),
3751
- sourceNodeIds: z21.array(z21.string()).optional(),
3752
- sourceSpanIds: z21.array(z21.string()).optional(),
3753
- termDecisions: z21.array(z21.object({
3754
- termIndex: z21.number().int().nonnegative(),
3755
- action: z21.enum(["keep", "drop", "update"]),
3756
- reason: z21.string().optional(),
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: z21.string().optional(),
3759
- value: z21.string().optional(),
3760
- amount: z21.number().nullable().optional(),
3761
- appliesTo: z21.string().nullable().optional(),
3762
- sourceNodeIds: z21.array(z21.string()).optional(),
3763
- sourceSpanIds: z21.array(z21.string()).optional()
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: z21.array(z21.string()).default([])
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
- policyTypes: profile.policyTypes,
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 = z22.object({
4221
- value: z22.string(),
4222
- normalizedValue: z22.string().optional(),
4223
- confidence: z22.enum(["low", "medium", "high"]).optional(),
4224
- sourceNodeIds: z22.array(z22.string()),
4225
- sourceSpanIds: z22.array(z22.string())
4226
- });
4227
- var OperationalProfilePromptSchema = z22.object({
4228
- documentType: z22.enum(["policy", "quote"]).optional(),
4229
- policyTypes: z22.array(z22.string()).optional(),
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
- coverages: z22.array(z22.object({
4239
- name: z22.string(),
4240
- coverageCode: z22.string().optional(),
4241
- limit: z22.string().optional(),
4242
- deductible: z22.string().optional(),
4243
- premium: z22.string().optional(),
4244
- retroactiveDate: z22.string().optional(),
4245
- formNumber: z22.string().optional(),
4246
- sectionRef: z22.string().optional(),
4247
- endorsementNumber: z22.string().optional(),
4248
- limits: z22.array(z22.object({
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: z22.string(),
4251
- value: z22.string(),
4252
- amount: z22.number().optional(),
4253
- appliesTo: z22.string().optional(),
4254
- sourceNodeIds: z22.array(z22.string()),
4255
- sourceSpanIds: z22.array(z22.string())
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: z22.array(z22.string()),
4258
- sourceSpanIds: z22.array(z22.string())
4641
+ sourceNodeIds: z23.array(z23.string()),
4642
+ sourceSpanIds: z23.array(z23.string())
4259
4643
  })).optional(),
4260
- sourceNodeIds: z22.array(z22.string()).optional(),
4261
- sourceSpanIds: z22.array(z22.string()).optional()
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
- policyTypes: ["other"],
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.policyTypes.length ? `covering ${profile.policyTypes.slice(0, 5).join(", ")}` : void 0
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
- policyTypes: profile.policyTypes,
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 policyTypesStr = doc.policyTypes?.length ? doc.policyTypes.join(",") : void 0;
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 (policyTypesStr) base.policyTypes = policyTypesStr;
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.policyTypes?.length ? `Policy Types: ${doc.policyTypes.join(", ")}` : null
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 z23 } from "zod";
7195
- var FieldTypeSchema = z23.enum([
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 = z23.object({
7205
- id: z23.string(),
7206
- label: z23.string(),
7207
- section: z23.string(),
7665
+ var ApplicationFieldSchema = z24.object({
7666
+ id: z24.string(),
7667
+ label: z24.string(),
7668
+ section: z24.string(),
7208
7669
  fieldType: FieldTypeSchema,
7209
- required: z23.boolean(),
7210
- options: z23.array(z23.string()).optional(),
7211
- columns: z23.array(z23.string()).optional(),
7212
- requiresExplanationIfYes: z23.boolean().optional(),
7213
- condition: z23.object({
7214
- dependsOn: z23.string(),
7215
- whenValue: z23.string()
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: z23.string().optional(),
7218
- source: z23.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
7219
- confidence: z23.enum(["confirmed", "high", "medium", "low"]).optional(),
7220
- sourceSpanIds: z23.array(z23.string()).optional().describe("Stable source spans that support the field value or field anchor"),
7221
- userSourceSpanIds: z23.array(z23.string()).optional().describe("Message or attachment spans that support user-provided values"),
7222
- pageNumber: z23.number().int().positive().optional().describe("Application page where the field label or anchor appears"),
7223
- fieldAnchorId: z23.string().optional().describe("Stable field anchor ID derived from page, section, label, and form metadata"),
7224
- acroFormName: z23.string().optional().describe("Native PDF AcroForm field name when available"),
7225
- validationStatus: z23.enum(["valid", "needs_review", "unsupported", "missing"]).optional()
7226
- });
7227
- var ApplicationQuestionConditionSchema = z23.object({
7228
- dependsOn: z23.string(),
7229
- operator: z23.enum(["equals", "not_equals", "in", "not_in", "exists"]).optional(),
7230
- value: z23.string().optional(),
7231
- whenValue: z23.string().optional(),
7232
- values: z23.array(z23.string()).optional()
7233
- });
7234
- var ApplicationRepeatSchema = z23.object({
7235
- min: z23.number().int().nonnegative().optional(),
7236
- max: z23.number().int().positive().optional(),
7237
- label: z23.string().optional()
7238
- });
7239
- var ApplicationQuestionNodeSchema = z23.lazy(
7240
- () => z23.object({
7241
- id: z23.string(),
7242
- nodeType: z23.enum(["group", "question", "repeat_group", "table"]),
7243
- fieldId: z23.string().optional(),
7244
- fieldPath: z23.string().optional(),
7245
- parentId: z23.string().optional(),
7246
- order: z23.number().int().nonnegative().optional(),
7247
- label: z23.string(),
7248
- section: z23.string().optional(),
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: z23.boolean().optional(),
7251
- prompt: z23.string().optional(),
7252
- options: z23.array(z23.string()).optional(),
7253
- columns: z23.array(z23.string()).optional(),
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: z23.array(ApplicationQuestionNodeSchema).optional()
7717
+ children: z24.array(ApplicationQuestionNodeSchema).optional()
7257
7718
  })
7258
7719
  );
7259
- var ApplicationQuestionGraphSchema = z23.object({
7260
- id: z23.string(),
7261
- version: z23.string(),
7262
- title: z23.string().optional(),
7263
- applicationType: z23.string().nullable().optional(),
7264
- source: z23.enum(["pdf", "manual", "imported", "generated"]).default("generated"),
7265
- rootNodeIds: z23.array(z23.string()).optional(),
7266
- nodes: z23.array(ApplicationQuestionNodeSchema)
7267
- });
7268
- var ApplicationTemplateSchema = z23.object({
7269
- id: z23.string(),
7270
- version: z23.string(),
7271
- title: z23.string(),
7272
- applicationType: z23.string().nullable().optional(),
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: z23.array(ApplicationFieldSchema).optional()
7735
+ fields: z24.array(ApplicationFieldSchema).optional()
7275
7736
  });
7276
- var ApplicationClassifyResultSchema = z23.object({
7277
- isApplication: z23.boolean(),
7278
- confidence: z23.number().min(0).max(1),
7279
- applicationType: z23.string().nullable()
7280
- });
7281
- var FieldExtractionResultSchema = z23.object({
7282
- fields: z23.array(ApplicationFieldSchema)
7283
- });
7284
- var AutoFillMatchSchema = z23.object({
7285
- fieldId: z23.string(),
7286
- value: z23.string(),
7287
- confidence: z23.enum(["confirmed"]),
7288
- contextKey: z23.string()
7289
- });
7290
- var AutoFillResultSchema = z23.object({
7291
- matches: z23.array(AutoFillMatchSchema)
7292
- });
7293
- var QuestionBatchResultSchema = z23.object({
7294
- batches: z23.array(z23.array(z23.string()).describe("Array of field IDs in this batch"))
7295
- });
7296
- var LookupRequestSchema = z23.object({
7297
- type: z23.string().describe("Type of lookup: 'records', 'website', 'policy'"),
7298
- description: z23.string(),
7299
- url: z23.string().optional(),
7300
- targetFieldIds: z23.array(z23.string())
7301
- });
7302
- var ReplyIntentSchema = z23.object({
7303
- primaryIntent: z23.enum(["answers_only", "question", "lookup_request", "mixed"]),
7304
- hasAnswers: z23.boolean(),
7305
- questionText: z23.string().optional(),
7306
- questionFieldIds: z23.array(z23.string()).optional(),
7307
- lookupRequests: z23.array(LookupRequestSchema).optional()
7308
- });
7309
- var ParsedAnswerSchema = z23.object({
7310
- fieldId: z23.string(),
7311
- value: z23.string(),
7312
- explanation: z23.string().optional()
7313
- });
7314
- var AnswerParsingResultSchema = z23.object({
7315
- answers: z23.array(ParsedAnswerSchema),
7316
- unanswered: z23.array(z23.string()).describe("Field IDs that were not answered")
7317
- });
7318
- var LookupFillSchema = z23.object({
7319
- fieldId: z23.string(),
7320
- value: z23.string(),
7321
- source: z23.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'"),
7322
- sourceSpanIds: z23.array(z23.string()).optional()
7323
- });
7324
- var LookupFillResultSchema = z23.object({
7325
- fills: z23.array(LookupFillSchema),
7326
- unfillable: z23.array(z23.string()),
7327
- explanation: z23.string().optional()
7328
- });
7329
- var FlatPdfPlacementSchema = z23.object({
7330
- fieldId: z23.string(),
7331
- page: z23.number(),
7332
- x: z23.number().describe("Percentage from left edge (0-100)"),
7333
- y: z23.number().describe("Percentage from top edge (0-100)"),
7334
- text: z23.string(),
7335
- fontSize: z23.number().optional(),
7336
- isCheckmark: z23.boolean().optional()
7337
- });
7338
- var AcroFormMappingSchema = z23.object({
7339
- fieldId: z23.string(),
7340
- acroFormName: z23.string(),
7341
- value: z23.string()
7342
- });
7343
- var QualityGateStatusSchema = z23.enum(["passed", "warning", "failed"]);
7344
- var QualitySeveritySchema = z23.enum(["info", "warning", "blocking"]);
7345
- var ApplicationQualityIssueSchema = z23.object({
7346
- code: z23.string(),
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: z23.string(),
7349
- fieldId: z23.string().optional()
7809
+ message: z24.string(),
7810
+ fieldId: z24.string().optional()
7350
7811
  });
7351
- var ApplicationQualityRoundSchema = z23.object({
7352
- round: z23.number(),
7353
- kind: z23.string(),
7812
+ var ApplicationQualityRoundSchema = z24.object({
7813
+ round: z24.number(),
7814
+ kind: z24.string(),
7354
7815
  status: QualityGateStatusSchema,
7355
- summary: z23.string().optional()
7816
+ summary: z24.string().optional()
7356
7817
  });
7357
- var ApplicationQualityArtifactSchema = z23.object({
7358
- kind: z23.string(),
7359
- label: z23.string().optional(),
7360
- itemCount: z23.number().optional()
7818
+ var ApplicationQualityArtifactSchema = z24.object({
7819
+ kind: z24.string(),
7820
+ label: z24.string().optional(),
7821
+ itemCount: z24.number().optional()
7361
7822
  });
7362
- var ApplicationEmailReviewSchema = z23.object({
7363
- issues: z23.array(ApplicationQualityIssueSchema),
7823
+ var ApplicationEmailReviewSchema = z24.object({
7824
+ issues: z24.array(ApplicationQualityIssueSchema),
7364
7825
  qualityGateStatus: QualityGateStatusSchema
7365
7826
  });
7366
- var ApplicationQualityReportSchema = z23.object({
7367
- issues: z23.array(ApplicationQualityIssueSchema),
7368
- rounds: z23.array(ApplicationQualityRoundSchema).optional(),
7369
- artifacts: z23.array(ApplicationQualityArtifactSchema).optional(),
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 = z23.object({
7374
- id: z23.string(),
7375
- fieldId: z23.string().optional(),
7376
- key: z23.string(),
7377
- value: z23.string(),
7378
- category: z23.string(),
7379
- source: z23.enum(["application", "user", "lookup", "policy", "email", "chat", "imessage", "mcp"]),
7380
- confidence: z23.enum(["confirmed", "high", "medium", "low"]),
7381
- sourceSpanIds: z23.array(z23.string()).optional(),
7382
- userSourceSpanIds: z23.array(z23.string()).optional()
7383
- });
7384
- var ApplicationPacketAnswerSchema = z23.object({
7385
- fieldId: z23.string(),
7386
- label: z23.string(),
7387
- section: z23.string(),
7388
- value: z23.string(),
7389
- source: z23.string(),
7390
- confidence: z23.enum(["confirmed", "high", "medium", "low"]).optional(),
7391
- sourceSpanIds: z23.array(z23.string()).optional(),
7392
- userSourceSpanIds: z23.array(z23.string()).optional()
7393
- });
7394
- var ApplicationPacketSchema = z23.object({
7395
- id: z23.string(),
7396
- applicationId: z23.string(),
7397
- title: z23.string(),
7398
- status: z23.enum(["draft", "broker_ready", "submitted"]),
7399
- answers: z23.array(ApplicationPacketAnswerSchema),
7400
- missingFieldIds: z23.array(z23.string()),
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: z23.string().optional(),
7403
- createdAt: z23.number()
7404
- });
7405
- var ApplicationStateSchema = z23.object({
7406
- id: z23.string(),
7407
- pdfBase64: z23.string().optional().describe("Original PDF, omitted after extraction"),
7408
- templateId: z23.string().optional(),
7409
- templateVersion: z23.string().optional(),
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: z23.string().optional(),
7412
- applicationType: z23.string().nullable().optional(),
7872
+ title: z24.string().optional(),
7873
+ applicationType: z24.string().nullable().optional(),
7413
7874
  questionGraph: ApplicationQuestionGraphSchema.optional(),
7414
- fields: z23.array(ApplicationFieldSchema),
7415
- batches: z23.array(z23.array(z23.string())).optional(),
7416
- currentBatchIndex: z23.number().default(0),
7417
- contextProposals: z23.array(ApplicationContextProposalSchema).optional(),
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: z23.enum([
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: z23.number(),
7435
- updatedAt: z23.number()
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 z24 } from "zod";
9170
- var QueryIntentSchema = z24.enum([
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 = z24.enum(["image", "pdf", "text"]);
9178
- var QueryAttachmentSchema = z24.object({
9179
- id: z24.string().optional().describe("Optional stable attachment ID from the caller"),
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: z24.string().optional().describe("Original filename or user-facing label"),
9182
- mimeType: z24.string().optional().describe("MIME type such as image/jpeg or application/pdf"),
9183
- base64: z24.string().optional().describe("Base64-encoded file content for image/pdf attachments"),
9184
- text: z24.string().optional().describe("Plain-text attachment content when available"),
9185
- description: z24.string().optional().describe("Caller-provided description of the attachment")
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 = z24.enum([
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 = z24.object({
9194
- question: z24.string().describe("Atomic sub-question to retrieve and answer independently"),
9654
+ var SubQuestionSchema = z25.object({
9655
+ question: z25.string().describe("Atomic sub-question to retrieve and answer independently"),
9195
9656
  intent: QueryIntentSchema,
9196
- chunkTypes: z24.array(z24.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
9197
- documentFilters: z24.object({
9198
- type: z24.enum(["policy", "quote"]).optional(),
9199
- carrier: z24.string().optional(),
9200
- insuredName: z24.string().optional(),
9201
- policyNumber: z24.string().optional(),
9202
- quoteNumber: z24.string().optional(),
9203
- policyTypes: z24.array(PolicyTypeSchema).optional().describe("Filter by policy type (e.g. homeowners_ho3, renters_ho4, pet) to avoid mixing up similar policies")
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 = z24.object({
9667
+ var QueryClassifyResultSchema = z25.object({
9207
9668
  intent: QueryIntentSchema,
9208
- subQuestions: z24.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
9209
- requiresDocumentLookup: z24.boolean().describe("Whether structured document lookup is needed"),
9210
- requiresChunkSearch: z24.boolean().describe("Whether semantic chunk search is needed"),
9211
- requiresConversationHistory: z24.boolean().describe("Whether conversation history is relevant"),
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 = z24.object({
9215
- source: z24.enum(["chunk", "document", "conversation", "attachment", "source_span", "source_node"]),
9216
- chunkId: z24.string().optional(),
9217
- sourceNodeId: z24.string().optional(),
9218
- sourceSpanId: z24.string().optional(),
9219
- documentId: z24.string().optional(),
9220
- turnId: z24.string().optional(),
9221
- attachmentId: z24.string().optional(),
9222
- text: z24.string().describe("Text excerpt from the source"),
9223
- relevance: z24.number().min(0).max(1),
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: z24.array(z24.object({ key: z24.string(), value: z24.string() })).optional()
9227
- });
9228
- var AttachmentInterpretationSchema = z24.object({
9229
- summary: z24.string().describe("Concise summary of what the attachment shows or contains"),
9230
- extractedFacts: z24.array(z24.string()).describe("Specific observable or document facts grounded in the attachment"),
9231
- recommendedFocus: z24.array(z24.string()).describe("Important details to incorporate when answering follow-up questions"),
9232
- confidence: z24.number().min(0).max(1)
9233
- });
9234
- var RetrievalResultSchema = z24.object({
9235
- subQuestion: z24.string(),
9236
- evidence: z24.array(EvidenceItemSchema)
9237
- });
9238
- var CitationSchema = z24.object({
9239
- index: z24.number().describe("Citation number [1], [2], etc."),
9240
- chunkId: z24.string().optional().describe("Source chunk ID, e.g. doc-123:coverage:2"),
9241
- sourceNodeId: z24.string().optional().describe("Source tree node ID when available"),
9242
- sourceSpanId: z24.string().optional().describe("Precise source span ID when available"),
9243
- documentId: z24.string(),
9244
- documentType: z24.enum(["policy", "quote"]).optional(),
9245
- field: z24.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
9246
- quote: z24.string().describe("Exact text from source that supports the claim"),
9247
- relevance: z24.number().min(0).max(1),
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 = z24.object({
9252
- subQuestion: z24.string(),
9253
- answer: z24.string(),
9254
- citations: z24.array(CitationSchema),
9255
- confidence: z24.number().min(0).max(1),
9256
- needsMoreContext: z24.boolean().describe("True if evidence was insufficient to answer fully")
9257
- });
9258
- var VerifyResultSchema = z24.object({
9259
- approved: z24.boolean().describe("Whether all sub-answers are adequately grounded"),
9260
- issues: z24.array(z24.string()).describe("Specific grounding or consistency issues found"),
9261
- retrySubQuestions: z24.array(z24.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
9262
- });
9263
- var QueryResultSchema = z24.object({
9264
- answer: z24.string(),
9265
- citations: z24.array(CitationSchema),
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: z24.number().min(0).max(1),
9268
- followUp: z24.string().optional().describe("Suggested follow-up question if applicable")
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 z25 } from "zod";
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 = z25.object({
10370
- answers: z25.array(z25.object({
10371
- questionId: z25.string().optional(),
10372
- fieldPath: z25.string().optional(),
10373
- answer: z25.string()
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 policy types, limits, and deductibles.",
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
- policyTypes: {
11572
+ linesOfBusiness: {
11112
11573
  type: "array",
11113
11574
  items: { type: "string" },
11114
- description: "Optional filter: only compare these policy types (e.g. 'General Liability', 'Workers Compensation'). Omit to compare all."
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 z26 } from "zod";
11128
- var CarrierInfoSchema = z26.object({
11129
- carrierName: z26.string().describe("Primary insurance company name for display"),
11130
- carrierLegalName: z26.string().optional().describe("Legal entity name of insurer"),
11131
- naicNumber: z26.string().optional().describe("NAIC company code"),
11132
- amBestRating: z26.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
11133
- admittedStatus: z26.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
11134
- mga: z26.string().optional().describe("Managing General Agent or Program Administrator name"),
11135
- underwriter: z26.string().optional().describe("Named individual underwriter"),
11136
- brokerAgency: z26.string().optional().describe("Broker or producer agency name"),
11137
- brokerContactName: z26.string().optional().describe("Broker or producer contact person name"),
11138
- brokerLicenseNumber: z26.string().optional().describe("Broker or producer license number"),
11139
- policyNumber: z26.string().optional().describe("Policy or quote reference number"),
11140
- effectiveDate: z26.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
11141
- expirationDate: z26.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
11142
- quoteNumber: z26.string().optional().describe("Quote or proposal reference number"),
11143
- proposedEffectiveDate: z26.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
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 z27 } from "zod";
11167
- var AdditionalNamedInsuredSchema = z27.object({
11168
- name: z27.string(),
11169
- relationship: z27.string().optional().describe("e.g. subsidiary, affiliate"),
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 = z27.object({
11173
- name: z27.string(),
11633
+ var ScheduledPartySchema = z28.object({
11634
+ name: z28.string(),
11174
11635
  address: SourceBackedAddressSchema.optional()
11175
11636
  }).merge(SourceProvenanceSchema);
11176
- var NamedInsuredSchema2 = z27.object({
11177
- insuredName: z27.string().describe("Name of primary named insured"),
11178
- insuredDba: z27.string().optional().describe("Doing-business-as name"),
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: z27.enum([
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: z27.string().optional().describe("Federal Employer Identification Number"),
11194
- insuredSicCode: z27.string().optional().describe("SIC code"),
11195
- insuredNaicsCode: z27.string().optional().describe("NAICS code"),
11196
- additionalNamedInsureds: z27.array(AdditionalNamedInsuredSchema).optional().describe("Additional named insureds listed on the policy"),
11197
- lossPayees: z27.array(ScheduledPartySchema).optional().describe("Loss payees listed on the policy"),
11198
- mortgageHolders: z27.array(ScheduledPartySchema).optional().describe("Mortgage holders / lienholders listed on the policy")
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 z28 } from "zod";
11686
+ import { z as z29 } from "zod";
11226
11687
  var ExtractorCoverageSchema = CoverageSchema.extend({
11227
- coverageCode: z28.string().optional().describe("Coverage code or class code")
11688
+ coverageCode: z29.string().optional().describe("Coverage code or class code")
11228
11689
  });
11229
- var CoverageLimitsSchema = z28.object({
11230
- coverages: z28.array(ExtractorCoverageSchema).describe("All coverages with their limits"),
11231
- coverageForm: z28.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
11232
- retroactiveDate: z28.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
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 z29 } from "zod";
11275
- var EndorsementsSchema = z29.object({
11276
- endorsements: z29.array(
11277
- z29.object({
11278
- formNumber: z29.string().describe("Form number, e.g. 'CG 21 47'"),
11279
- editionDate: z29.string().optional().describe("Edition date, e.g. '12 07'"),
11280
- title: z29.string().describe("Endorsement title"),
11281
- endorsementType: z29.enum([
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: z29.string().optional().describe("Endorsement effective date"),
11302
- affectedCoverageParts: z29.array(z29.string()).optional().describe("Coverage parts affected by this endorsement"),
11303
- namedParties: z29.array(
11304
- z29.object({
11305
- name: z29.string().describe("Party name"),
11306
- role: z29.enum([
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: z29.string().optional().describe("Relationship to insured"),
11316
- scope: z29.string().optional().describe("Scope of coverage for this party")
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: z29.array(z29.string()).optional().describe("Key terms or notable provisions in the endorsement"),
11320
- premiumImpact: z29.string().optional().describe("Additional premium or credit"),
11321
- excerpt: z29.string().optional().describe("Short source excerpt, not full verbatim text"),
11322
- content: z29.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
11323
- pageStart: z29.number().describe("Starting page number of this endorsement"),
11324
- pageEnd: z29.number().optional().describe("Ending page number of this endorsement"),
11325
- sourceSpanIds: z29.array(z29.string()).optional().describe("Source span IDs grounding this endorsement"),
11326
- sourceTextHash: z29.string().optional().describe("Hash of the source text when available")
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 z30 } from "zod";
11365
- var ExclusionsSchema = z30.object({
11366
- exclusions: z30.array(
11367
- z30.object({
11368
- name: z30.string().describe("Exclusion title or short description"),
11369
- formNumber: z30.string().optional().describe("Form number if part of a named endorsement"),
11370
- excludedPerils: z30.array(z30.string()).optional().describe("Specific perils excluded"),
11371
- isAbsolute: z30.boolean().optional().describe("Whether the exclusion is absolute (no exceptions)"),
11372
- exceptions: z30.array(z30.string()).optional().describe("Exceptions to the exclusion, if any"),
11373
- buybackAvailable: z30.boolean().optional().describe("Whether coverage can be bought back via endorsement"),
11374
- buybackEndorsement: z30.string().optional().describe("Form number of the buyback endorsement if available"),
11375
- appliesTo: z30.array(z30.string()).optional().describe("Policy types this exclusion applies to"),
11376
- content: z30.string().describe("Full verbatim exclusion text"),
11377
- pageNumber: z30.number().optional().describe("Page number where exclusion appears")
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 policy types or lines this exclusion applies to (as an array)
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 z31 } from "zod";
11414
- var ConditionsSchema = z31.object({
11415
- conditions: z31.array(
11416
- z31.object({
11417
- name: z31.string().describe("Condition title"),
11418
- conditionType: z31.enum([
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: z31.string().describe("Full verbatim condition text"),
11438
- keyValues: z31.array(
11439
- z31.object({
11440
- key: z31.string().describe("Key name (e.g. 'noticePeriod', 'suitDeadline')"),
11441
- value: z31.string().describe("Value (e.g. '30 days', '2 years')")
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: z31.number().optional().describe("Page number where condition appears")
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 z32 } from "zod";
11483
- var PremiumBreakdownSchema = z32.object({
11484
- premium: z32.string().optional().describe("Total premium amount, e.g. '$5,000'"),
11485
- premiumAmount: z32.number().optional().describe("Total premium as a plain number with no currency symbols or commas"),
11486
- totalCost: z32.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
11487
- totalCostAmount: z32.number().optional().describe("Total cost as a plain number with no currency symbols or commas"),
11488
- premiumBreakdown: z32.array(
11489
- z32.object({
11490
- line: z32.string().describe("Coverage line name"),
11491
- amount: z32.string().describe("Premium amount for this line"),
11492
- amountValue: z32.number().optional().describe("Premium amount as a plain number with no currency symbols or commas")
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: z32.array(
11496
- z32.object({
11497
- name: z32.string().describe("Fee or tax name"),
11498
- amount: z32.string().describe("Dollar amount"),
11499
- amountValue: z32.number().optional().describe("Fee or tax amount as a plain number with no currency symbols or commas"),
11500
- type: z32.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
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: z32.string().optional().describe("Minimum premium if stated"),
11504
- minimumPremiumAmount: z32.number().optional().describe("Minimum premium as a plain number when the source states a fixed amount"),
11505
- depositPremium: z32.string().optional().describe("Deposit premium if stated"),
11506
- depositPremiumAmount: z32.number().optional().describe("Deposit premium as a plain number when the source states a fixed amount"),
11507
- paymentPlan: z32.string().optional().describe("Payment plan description"),
11508
- auditType: z32.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
11509
- ratingBasis: z32.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
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 z33 } from "zod";
11532
- var DeclarationsFieldSchema = z33.object({
11533
- field: z33.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
11534
- value: z33.string().describe("Extracted value exactly as it appears in the document"),
11535
- section: z33.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
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 = z33.object({
11538
- fields: z33.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
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 z34 } from "zod";
11579
- var LossHistorySchema = z34.object({
11580
- lossSummary: z34.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
11581
- individualClaims: z34.array(
11582
- z34.object({
11583
- date: z34.string().optional().describe("Date of loss or claim"),
11584
- type: z34.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
11585
- description: z34.string().optional().describe("Brief description of the claim"),
11586
- amountPaid: z34.string().optional().describe("Amount paid"),
11587
- amountReserved: z34.string().optional().describe("Amount reserved"),
11588
- status: z34.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
11589
- claimNumber: z34.string().optional().describe("Claim reference number")
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: z34.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
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 z35 } from "zod";
11610
- var SubsectionSchema2 = z35.object({
11611
- title: z35.string().describe("Subsection title"),
11612
- sectionNumber: z35.string().optional().describe("Subsection number"),
11613
- pageNumber: z35.number().optional().describe("Page number"),
11614
- excerpt: z35.string().optional().describe("Short source excerpt, not full verbatim text"),
11615
- content: z35.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
11616
- sourceSpanIds: z35.array(z35.string()).optional().describe("Source span IDs grounding this subsection"),
11617
- sourceTextHash: z35.string().optional().describe("Hash of the source text when available")
11618
- });
11619
- var SectionsSchema = z35.object({
11620
- sections: z35.array(
11621
- z35.object({
11622
- title: z35.string().describe("Section title"),
11623
- type: z35.enum([
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: z35.string().optional().describe("Short source excerpt, not full verbatim text"),
11639
- content: z35.string().optional().describe("Legacy fallback only; do not return full text when sourceSpanIds are available"),
11640
- pageStart: z35.number().describe("Starting page number"),
11641
- pageEnd: z35.number().optional().describe("Ending page number"),
11642
- sourceSpanIds: z35.array(z35.string()).optional().describe("Source span IDs grounding this section"),
11643
- sourceTextHash: z35.string().optional().describe("Hash of the source text when available"),
11644
- subsections: z35.array(SubsectionSchema2).optional().describe("Subsections within this section")
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 z36 } from "zod";
11679
- var AuxiliaryFactSchema2 = z36.object({
11680
- key: z36.string().describe("Normalized machine-readable fact key, e.g. 'policyholder_age' or 'insured_name'"),
11681
- value: z36.string().describe("Concrete extracted fact value"),
11682
- subject: z36.string().optional().describe("Person, entity, vehicle, property, or schedule item this fact belongs to"),
11683
- context: z36.string().optional().describe("Short disambiguating context, such as 'Driver Schedule' or 'Named Insured'")
11684
- });
11685
- var SupplementarySchema = z36.object({
11686
- regulatoryContacts: z36.array(ContactSchema).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
11687
- claimsContacts: z36.array(ContactSchema).optional().describe("Claims reporting contacts and instructions"),
11688
- thirdPartyAdministrators: z36.array(ContactSchema).optional().describe("Third-party administrators for claims handling"),
11689
- cancellationNoticeDays: z36.number().optional().describe("Required notice period for cancellation in days"),
11690
- nonrenewalNoticeDays: z36.number().optional().describe("Required notice period for nonrenewal in days"),
11691
- auxiliaryFacts: z36.array(AuxiliaryFactSchema2).optional().describe("Additional retrieval-only facts that do not fit the strict primary schema")
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 z37 } from "zod";
11732
- var DefinitionsSchema = z37.object({
11733
- definitions: z37.array(
11734
- z37.object({
11735
- term: z37.string().describe("Defined term exactly as shown in the document"),
11736
- definition: z37.string().describe("Full verbatim definition text, preserving original wording"),
11737
- pageNumber: z37.number().optional().describe("Original document page number"),
11738
- formNumber: z37.string().optional().describe("Form number where this definition appears"),
11739
- formTitle: z37.string().optional().describe("Form title where this definition appears"),
11740
- sectionRef: z37.string().optional().describe("Definition section heading or subsection reference"),
11741
- originalContent: z37.string().optional().describe("Short verbatim source snippet containing the term and definition")
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 z38 } from "zod";
11776
- var CoveredReasonsSchema = z38.object({
11777
- coveredReasons: z38.array(
11778
- z38.object({
11779
- coverageName: z38.string().describe("Coverage, coverage part, or form this covered reason belongs to"),
11780
- reasonNumber: z38.string().optional().describe("Source number or letter for the covered reason, if shown"),
11781
- title: z38.string().optional().describe("Covered reason title, peril, cause of loss, trigger, or short name"),
11782
- content: z38.string().describe("Full verbatim covered-reason or insuring-agreement text"),
11783
- conditions: z38.array(z38.string()).optional().describe("Conditions, timing rules, documentation requirements, or prerequisites attached to this covered reason"),
11784
- exceptions: z38.array(z38.string()).optional().describe("Exceptions or limitations attached to this covered reason"),
11785
- appliesTo: z38.array(z38.string()).optional().describe("Covered property, persons, autos, locations, operations, or coverage parts this reason applies to"),
11786
- pageNumber: z38.number().optional().describe("Original document page number"),
11787
- formNumber: z38.string().optional().describe("Form number where this covered reason appears"),
11788
- formTitle: z38.string().optional().describe("Form title where this covered reason appears"),
11789
- sectionRef: z38.string().optional().describe("Section heading where this covered reason appears"),
11790
- originalContent: z38.string().optional().describe("Short verbatim source snippet used for this covered reason")
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
- inferPolicyTypesFromOperationalCoverages,
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
- normalizeOperationalPolicyTypes,
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
- resolveOperationalProfilePolicyTypes,
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,