@claritylabs/cl-sdk 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -77,14 +77,70 @@ function sanitizeNulls(obj) {
77
77
  return obj;
78
78
  }
79
79
 
80
+ // src/core/strict-schema.ts
81
+ import { z } from "zod";
82
+ function toStrictSchema(schema) {
83
+ const def = schema._zod?.def;
84
+ const typeName = def?.type ?? schema.type;
85
+ if (typeName === "object") {
86
+ const shape = schema.shape;
87
+ if (!shape) return schema;
88
+ const newShape = {};
89
+ for (const [key, value] of Object.entries(shape)) {
90
+ const field = value;
91
+ const fieldDef = field._zod?.def;
92
+ const fieldType = fieldDef?.type ?? field.type;
93
+ if (fieldType === "optional") {
94
+ const innerType = fieldDef?.innerType;
95
+ const description = field.description ?? fieldDef?.description ?? field._zod?.def?.description;
96
+ if (innerType) {
97
+ const transformed = toStrictSchema(innerType);
98
+ let nullable = z.nullable(transformed);
99
+ if (description) nullable = nullable.describe(description);
100
+ newShape[key] = nullable;
101
+ } else {
102
+ let nullable = z.nullable(field);
103
+ if (description) nullable = nullable.describe(description);
104
+ newShape[key] = nullable;
105
+ }
106
+ } else {
107
+ newShape[key] = toStrictSchema(field);
108
+ }
109
+ }
110
+ const objDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
111
+ const result = z.object(newShape);
112
+ return objDesc ? result.describe(objDesc) : result;
113
+ }
114
+ if (typeName === "array") {
115
+ const element = def?.element ?? schema.element;
116
+ if (element) {
117
+ const arrDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
118
+ const result = z.array(toStrictSchema(element));
119
+ return arrDesc ? result.describe(arrDesc) : result;
120
+ }
121
+ return schema;
122
+ }
123
+ if (typeName === "nullable") {
124
+ const innerType = def?.innerType;
125
+ if (innerType) {
126
+ const nullDesc = schema.description ?? def?.description ?? schema._zod?.def?.description;
127
+ const result = z.nullable(toStrictSchema(innerType));
128
+ return nullDesc ? result.describe(nullDesc) : result;
129
+ }
130
+ return schema;
131
+ }
132
+ return schema;
133
+ }
134
+
80
135
  // src/core/safe-generate.ts
81
136
  async function safeGenerateObject(generateObject, params, options) {
82
137
  const maxRetries = options?.maxRetries ?? 1;
83
138
  let lastError;
139
+ const strictParams = { ...params, schema: toStrictSchema(params.schema) };
84
140
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
85
141
  try {
86
142
  const result = await withRetry(
87
- () => generateObject(params),
143
+ () => generateObject(strictParams),
88
144
  options?.log
89
145
  );
90
146
  return result;
@@ -141,8 +197,8 @@ function createPipelineContext(opts) {
141
197
  }
142
198
 
143
199
  // src/schemas/enums.ts
144
- import { z } from "zod";
145
- var PolicyTypeSchema = z.enum([
200
+ import { z as z2 } from "zod";
201
+ var PolicyTypeSchema = z2.enum([
146
202
  // Commercial lines
147
203
  "general_liability",
148
204
  "commercial_property",
@@ -189,7 +245,7 @@ var PolicyTypeSchema = z.enum([
189
245
  "other"
190
246
  ]);
191
247
  var POLICY_TYPES = PolicyTypeSchema.options;
192
- var EndorsementTypeSchema = z.enum([
248
+ var EndorsementTypeSchema = z2.enum([
193
249
  "additional_insured",
194
250
  "waiver_of_subrogation",
195
251
  "primary_noncontributory",
@@ -210,7 +266,7 @@ var EndorsementTypeSchema = z.enum([
210
266
  "other"
211
267
  ]);
212
268
  var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
213
- var ConditionTypeSchema = z.enum([
269
+ var ConditionTypeSchema = z2.enum([
214
270
  "duties_after_loss",
215
271
  "notice_requirements",
216
272
  "other_insurance",
@@ -230,7 +286,7 @@ var ConditionTypeSchema = z.enum([
230
286
  "other"
231
287
  ]);
232
288
  var CONDITION_TYPES = ConditionTypeSchema.options;
233
- var PolicySectionTypeSchema = z.enum([
289
+ var PolicySectionTypeSchema = z2.enum([
234
290
  "declarations",
235
291
  "insuring_agreement",
236
292
  "policy_form",
@@ -245,7 +301,7 @@ var PolicySectionTypeSchema = z.enum([
245
301
  "other"
246
302
  ]);
247
303
  var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
248
- var QuoteSectionTypeSchema = z.enum([
304
+ var QuoteSectionTypeSchema = z2.enum([
249
305
  "terms_summary",
250
306
  "premium_indication",
251
307
  "underwriting_condition",
@@ -255,13 +311,13 @@ var QuoteSectionTypeSchema = z.enum([
255
311
  "other"
256
312
  ]);
257
313
  var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
258
- var CoverageFormSchema = z.enum(["occurrence", "claims_made", "accident"]);
314
+ var CoverageFormSchema = z2.enum(["occurrence", "claims_made", "accident"]);
259
315
  var COVERAGE_FORMS = CoverageFormSchema.options;
260
- var PolicyTermTypeSchema = z.enum(["fixed", "continuous"]);
316
+ var PolicyTermTypeSchema = z2.enum(["fixed", "continuous"]);
261
317
  var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
262
- var CoverageTriggerSchema = z.enum(["occurrence", "claims_made", "accident"]);
318
+ var CoverageTriggerSchema = z2.enum(["occurrence", "claims_made", "accident"]);
263
319
  var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
264
- var LimitTypeSchema = z.enum([
320
+ var LimitTypeSchema = z2.enum([
265
321
  "per_occurrence",
266
322
  "per_claim",
267
323
  "aggregate",
@@ -272,7 +328,7 @@ var LimitTypeSchema = z.enum([
272
328
  "scheduled"
273
329
  ]);
274
330
  var LIMIT_TYPES = LimitTypeSchema.options;
275
- var DeductibleTypeSchema = z.enum([
331
+ var DeductibleTypeSchema = z2.enum([
276
332
  "per_occurrence",
277
333
  "per_claim",
278
334
  "aggregate",
@@ -280,16 +336,16 @@ var DeductibleTypeSchema = z.enum([
280
336
  "waiting_period"
281
337
  ]);
282
338
  var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
283
- var ValuationMethodSchema = z.enum([
339
+ var ValuationMethodSchema = z2.enum([
284
340
  "replacement_cost",
285
341
  "actual_cash_value",
286
342
  "agreed_value",
287
343
  "functional_replacement"
288
344
  ]);
289
345
  var VALUATION_METHODS = ValuationMethodSchema.options;
290
- var DefenseCostTreatmentSchema = z.enum(["inside_limits", "outside_limits", "supplementary"]);
346
+ var DefenseCostTreatmentSchema = z2.enum(["inside_limits", "outside_limits", "supplementary"]);
291
347
  var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
292
- var EntityTypeSchema = z.enum([
348
+ var EntityTypeSchema = z2.enum([
293
349
  "corporation",
294
350
  "llc",
295
351
  "partnership",
@@ -303,9 +359,9 @@ var EntityTypeSchema = z.enum([
303
359
  "other"
304
360
  ]);
305
361
  var ENTITY_TYPES = EntityTypeSchema.options;
306
- var AdmittedStatusSchema = z.enum(["admitted", "non_admitted", "surplus_lines"]);
362
+ var AdmittedStatusSchema = z2.enum(["admitted", "non_admitted", "surplus_lines"]);
307
363
  var ADMITTED_STATUSES = AdmittedStatusSchema.options;
308
- var AuditTypeSchema = z.enum([
364
+ var AuditTypeSchema = z2.enum([
309
365
  "annual",
310
366
  "semi_annual",
311
367
  "quarterly",
@@ -315,7 +371,7 @@ var AuditTypeSchema = z.enum([
315
371
  "none"
316
372
  ]);
317
373
  var AUDIT_TYPES = AuditTypeSchema.options;
318
- var EndorsementPartyRoleSchema = z.enum([
374
+ var EndorsementPartyRoleSchema = z2.enum([
319
375
  "additional_insured",
320
376
  "loss_payee",
321
377
  "mortgage_holder",
@@ -324,13 +380,13 @@ var EndorsementPartyRoleSchema = z.enum([
324
380
  "other"
325
381
  ]);
326
382
  var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
327
- var ClaimStatusSchema = z.enum(["open", "closed", "reopened"]);
383
+ var ClaimStatusSchema = z2.enum(["open", "closed", "reopened"]);
328
384
  var CLAIM_STATUSES = ClaimStatusSchema.options;
329
- var SubjectivityCategorySchema = z.enum(["pre_binding", "post_binding", "information"]);
385
+ var SubjectivityCategorySchema = z2.enum(["pre_binding", "post_binding", "information"]);
330
386
  var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
331
- var DocumentTypeSchema = z.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
387
+ var DocumentTypeSchema = z2.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
332
388
  var DOCUMENT_TYPES = DocumentTypeSchema.options;
333
- var ChunkTypeSchema = z.enum([
389
+ var ChunkTypeSchema = z2.enum([
334
390
  "declarations",
335
391
  "coverage_form",
336
392
  "endorsement",
@@ -339,7 +395,7 @@ var ChunkTypeSchema = z.enum([
339
395
  "mixed"
340
396
  ]);
341
397
  var CHUNK_TYPES = ChunkTypeSchema.options;
342
- var RatingBasisTypeSchema = z.enum([
398
+ var RatingBasisTypeSchema = z2.enum([
343
399
  "payroll",
344
400
  "revenue",
345
401
  "area",
@@ -353,7 +409,7 @@ var RatingBasisTypeSchema = z.enum([
353
409
  "other"
354
410
  ]);
355
411
  var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
356
- var VehicleCoverageTypeSchema = z.enum([
412
+ var VehicleCoverageTypeSchema = z2.enum([
357
413
  "liability",
358
414
  "collision",
359
415
  "comprehensive",
@@ -366,32 +422,32 @@ var VehicleCoverageTypeSchema = z.enum([
366
422
  "physical_damage"
367
423
  ]);
368
424
  var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
369
- var HomeownersFormTypeSchema = z.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
425
+ var HomeownersFormTypeSchema = z2.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
370
426
  var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
371
- var DwellingFireFormTypeSchema = z.enum(["DP-1", "DP-2", "DP-3"]);
427
+ var DwellingFireFormTypeSchema = z2.enum(["DP-1", "DP-2", "DP-3"]);
372
428
  var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
373
- var FloodZoneSchema = z.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
429
+ var FloodZoneSchema = z2.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
374
430
  var FLOOD_ZONES = FloodZoneSchema.options;
375
- var ConstructionTypeSchema = z.enum(["frame", "masonry", "superior", "mixed", "other"]);
431
+ var ConstructionTypeSchema = z2.enum(["frame", "masonry", "superior", "mixed", "other"]);
376
432
  var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
377
- var RoofTypeSchema = z.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
433
+ var RoofTypeSchema = z2.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
378
434
  var ROOF_TYPES = RoofTypeSchema.options;
379
- var FoundationTypeSchema = z.enum(["basement", "crawl_space", "slab", "pier", "other"]);
435
+ var FoundationTypeSchema = z2.enum(["basement", "crawl_space", "slab", "pier", "other"]);
380
436
  var FOUNDATION_TYPES = FoundationTypeSchema.options;
381
- var PersonalAutoUsageSchema = z.enum(["pleasure", "commute", "business", "farm"]);
437
+ var PersonalAutoUsageSchema = z2.enum(["pleasure", "commute", "business", "farm"]);
382
438
  var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
383
- var LossSettlementSchema = z.enum([
439
+ var LossSettlementSchema = z2.enum([
384
440
  "replacement_cost",
385
441
  "actual_cash_value",
386
442
  "extended_replacement_cost",
387
443
  "guaranteed_replacement_cost"
388
444
  ]);
389
445
  var LOSS_SETTLEMENTS = LossSettlementSchema.options;
390
- var BoatTypeSchema = z.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
446
+ var BoatTypeSchema = z2.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
391
447
  var BOAT_TYPES = BoatTypeSchema.options;
392
- var RVTypeSchema = z.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
448
+ var RVTypeSchema = z2.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
393
449
  var RV_TYPES = RVTypeSchema.options;
394
- var ScheduledItemCategorySchema = z.enum([
450
+ var ScheduledItemCategorySchema = z2.enum([
395
451
  "jewelry",
396
452
  "fine_art",
397
453
  "musical_instruments",
@@ -404,691 +460,691 @@ var ScheduledItemCategorySchema = z.enum([
404
460
  "other"
405
461
  ]);
406
462
  var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
407
- var TitlePolicyTypeSchema = z.enum(["owners", "lenders"]);
463
+ var TitlePolicyTypeSchema = z2.enum(["owners", "lenders"]);
408
464
  var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
409
- var PetSpeciesSchema = z.enum(["dog", "cat", "other"]);
465
+ var PetSpeciesSchema = z2.enum(["dog", "cat", "other"]);
410
466
  var PET_SPECIES = PetSpeciesSchema.options;
411
467
 
412
468
  // src/schemas/shared.ts
413
- import { z as z2 } from "zod";
414
- var AddressSchema = z2.object({
415
- street1: z2.string(),
416
- street2: z2.string().optional(),
417
- city: z2.string(),
418
- state: z2.string(),
419
- zip: z2.string(),
420
- country: z2.string().optional()
469
+ import { z as z3 } from "zod";
470
+ var AddressSchema = z3.object({
471
+ street1: z3.string(),
472
+ street2: z3.string().optional(),
473
+ city: z3.string(),
474
+ state: z3.string(),
475
+ zip: z3.string(),
476
+ country: z3.string().optional()
421
477
  });
422
- var ContactSchema = z2.object({
423
- name: z2.string().optional(),
424
- title: z2.string().optional(),
425
- type: z2.string().optional(),
426
- phone: z2.string().optional(),
427
- fax: z2.string().optional(),
428
- email: z2.string().optional(),
478
+ var ContactSchema = z3.object({
479
+ name: z3.string().optional(),
480
+ title: z3.string().optional(),
481
+ type: z3.string().optional(),
482
+ phone: z3.string().optional(),
483
+ fax: z3.string().optional(),
484
+ email: z3.string().optional(),
429
485
  address: AddressSchema.optional(),
430
- hours: z2.string().optional()
486
+ hours: z3.string().optional()
431
487
  });
432
- var FormReferenceSchema = z2.object({
433
- formNumber: z2.string(),
434
- editionDate: z2.string().optional(),
435
- title: z2.string().optional(),
436
- formType: z2.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
488
+ var FormReferenceSchema = z3.object({
489
+ formNumber: z3.string(),
490
+ editionDate: z3.string().optional(),
491
+ title: z3.string().optional(),
492
+ formType: z3.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
437
493
  });
438
- var TaxFeeItemSchema = z2.object({
439
- name: z2.string(),
440
- amount: z2.string(),
441
- type: z2.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
442
- description: z2.string().optional()
494
+ var TaxFeeItemSchema = z3.object({
495
+ name: z3.string(),
496
+ amount: z3.string(),
497
+ type: z3.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
498
+ description: z3.string().optional()
443
499
  });
444
- var RatingBasisSchema = z2.object({
500
+ var RatingBasisSchema = z3.object({
445
501
  type: RatingBasisTypeSchema,
446
- amount: z2.string().optional(),
447
- description: z2.string().optional()
502
+ amount: z3.string().optional(),
503
+ description: z3.string().optional()
448
504
  });
449
- var SublimitSchema = z2.object({
450
- name: z2.string(),
451
- limit: z2.string(),
452
- appliesTo: z2.string().optional(),
453
- deductible: z2.string().optional()
505
+ var SublimitSchema = z3.object({
506
+ name: z3.string(),
507
+ limit: z3.string(),
508
+ appliesTo: z3.string().optional(),
509
+ deductible: z3.string().optional()
454
510
  });
455
- var SharedLimitSchema = z2.object({
456
- description: z2.string(),
457
- limit: z2.string(),
458
- coverageParts: z2.array(z2.string())
511
+ var SharedLimitSchema = z3.object({
512
+ description: z3.string(),
513
+ limit: z3.string(),
514
+ coverageParts: z3.array(z3.string())
459
515
  });
460
- var ExtendedReportingPeriodSchema = z2.object({
461
- basicDays: z2.number().optional(),
462
- supplementalYears: z2.number().optional(),
463
- supplementalPremium: z2.string().optional()
516
+ var ExtendedReportingPeriodSchema = z3.object({
517
+ basicDays: z3.number().optional(),
518
+ supplementalYears: z3.number().optional(),
519
+ supplementalPremium: z3.string().optional()
464
520
  });
465
- var NamedInsuredSchema = z2.object({
466
- name: z2.string(),
467
- relationship: z2.string().optional(),
521
+ var NamedInsuredSchema = z3.object({
522
+ name: z3.string(),
523
+ relationship: z3.string().optional(),
468
524
  address: AddressSchema.optional()
469
525
  });
470
526
 
471
527
  // src/schemas/coverage.ts
472
- import { z as z3 } from "zod";
473
- var CoverageSchema = z3.object({
474
- name: z3.string(),
475
- limit: z3.string(),
476
- deductible: z3.string().optional(),
477
- pageNumber: z3.number().optional(),
478
- sectionRef: z3.string().optional()
528
+ import { z as z4 } from "zod";
529
+ var CoverageSchema = z4.object({
530
+ name: z4.string(),
531
+ limit: z4.string(),
532
+ deductible: z4.string().optional(),
533
+ pageNumber: z4.number().optional(),
534
+ sectionRef: z4.string().optional()
479
535
  });
480
- var EnrichedCoverageSchema = z3.object({
481
- name: z3.string(),
482
- coverageCode: z3.string().optional(),
483
- formNumber: z3.string().optional(),
484
- formEditionDate: z3.string().optional(),
485
- limit: z3.string(),
536
+ var EnrichedCoverageSchema = z4.object({
537
+ name: z4.string(),
538
+ coverageCode: z4.string().optional(),
539
+ formNumber: z4.string().optional(),
540
+ formEditionDate: z4.string().optional(),
541
+ limit: z4.string(),
486
542
  limitType: LimitTypeSchema.optional(),
487
- deductible: z3.string().optional(),
543
+ deductible: z4.string().optional(),
488
544
  deductibleType: DeductibleTypeSchema.optional(),
489
- sir: z3.string().optional(),
490
- sublimit: z3.string().optional(),
491
- coinsurance: z3.string().optional(),
545
+ sir: z4.string().optional(),
546
+ sublimit: z4.string().optional(),
547
+ coinsurance: z4.string().optional(),
492
548
  valuation: ValuationMethodSchema.optional(),
493
- territory: z3.string().optional(),
549
+ territory: z4.string().optional(),
494
550
  trigger: CoverageTriggerSchema.optional(),
495
- retroactiveDate: z3.string().optional(),
496
- included: z3.boolean(),
497
- premium: z3.string().optional(),
498
- pageNumber: z3.number().optional(),
499
- sectionRef: z3.string().optional()
551
+ retroactiveDate: z4.string().optional(),
552
+ included: z4.boolean(),
553
+ premium: z4.string().optional(),
554
+ pageNumber: z4.number().optional(),
555
+ sectionRef: z4.string().optional()
500
556
  });
501
557
 
502
558
  // src/schemas/endorsement.ts
503
- import { z as z4 } from "zod";
504
- var EndorsementPartySchema = z4.object({
505
- name: z4.string(),
559
+ import { z as z5 } from "zod";
560
+ var EndorsementPartySchema = z5.object({
561
+ name: z5.string(),
506
562
  role: EndorsementPartyRoleSchema,
507
563
  address: AddressSchema.optional(),
508
- relationship: z4.string().optional(),
509
- scope: z4.string().optional()
564
+ relationship: z5.string().optional(),
565
+ scope: z5.string().optional()
510
566
  });
511
- var EndorsementSchema = z4.object({
512
- formNumber: z4.string(),
513
- editionDate: z4.string().optional(),
514
- title: z4.string(),
567
+ var EndorsementSchema = z5.object({
568
+ formNumber: z5.string(),
569
+ editionDate: z5.string().optional(),
570
+ title: z5.string(),
515
571
  endorsementType: EndorsementTypeSchema,
516
- effectiveDate: z4.string().optional(),
517
- affectedCoverageParts: z4.array(z4.string()).optional(),
518
- namedParties: z4.array(EndorsementPartySchema).optional(),
519
- keyTerms: z4.array(z4.string()).optional(),
520
- premiumImpact: z4.string().optional(),
521
- content: z4.string(),
522
- pageStart: z4.number(),
523
- pageEnd: z4.number().optional()
572
+ effectiveDate: z5.string().optional(),
573
+ affectedCoverageParts: z5.array(z5.string()).optional(),
574
+ namedParties: z5.array(EndorsementPartySchema).optional(),
575
+ keyTerms: z5.array(z5.string()).optional(),
576
+ premiumImpact: z5.string().optional(),
577
+ content: z5.string(),
578
+ pageStart: z5.number(),
579
+ pageEnd: z5.number().optional()
524
580
  });
525
581
 
526
582
  // src/schemas/exclusion.ts
527
- import { z as z5 } from "zod";
528
- var ExclusionSchema = z5.object({
529
- name: z5.string(),
530
- formNumber: z5.string().optional(),
531
- excludedPerils: z5.array(z5.string()).optional(),
532
- isAbsolute: z5.boolean().optional(),
533
- exceptions: z5.array(z5.string()).optional(),
534
- buybackAvailable: z5.boolean().optional(),
535
- buybackEndorsement: z5.string().optional(),
536
- appliesTo: z5.array(z5.string()).optional(),
537
- content: z5.string(),
538
- pageNumber: z5.number().optional()
583
+ import { z as z6 } from "zod";
584
+ var ExclusionSchema = z6.object({
585
+ name: z6.string(),
586
+ formNumber: z6.string().optional(),
587
+ excludedPerils: z6.array(z6.string()).optional(),
588
+ isAbsolute: z6.boolean().optional(),
589
+ exceptions: z6.array(z6.string()).optional(),
590
+ buybackAvailable: z6.boolean().optional(),
591
+ buybackEndorsement: z6.string().optional(),
592
+ appliesTo: z6.array(z6.string()).optional(),
593
+ content: z6.string(),
594
+ pageNumber: z6.number().optional()
539
595
  });
540
596
 
541
597
  // src/schemas/condition.ts
542
- import { z as z6 } from "zod";
543
- var ConditionKeyValueSchema = z6.object({
544
- key: z6.string(),
545
- value: z6.string()
598
+ import { z as z7 } from "zod";
599
+ var ConditionKeyValueSchema = z7.object({
600
+ key: z7.string(),
601
+ value: z7.string()
546
602
  });
547
- var PolicyConditionSchema = z6.object({
548
- name: z6.string(),
603
+ var PolicyConditionSchema = z7.object({
604
+ name: z7.string(),
549
605
  conditionType: ConditionTypeSchema,
550
- content: z6.string(),
551
- keyValues: z6.array(ConditionKeyValueSchema).optional(),
552
- pageNumber: z6.number().optional()
606
+ content: z7.string(),
607
+ keyValues: z7.array(ConditionKeyValueSchema).optional(),
608
+ pageNumber: z7.number().optional()
553
609
  });
554
610
 
555
611
  // src/schemas/parties.ts
556
- import { z as z7 } from "zod";
557
- var InsurerInfoSchema = z7.object({
558
- legalName: z7.string(),
559
- naicNumber: z7.string().optional(),
560
- amBestRating: z7.string().optional(),
561
- amBestNumber: z7.string().optional(),
612
+ import { z as z8 } from "zod";
613
+ var InsurerInfoSchema = z8.object({
614
+ legalName: z8.string(),
615
+ naicNumber: z8.string().optional(),
616
+ amBestRating: z8.string().optional(),
617
+ amBestNumber: z8.string().optional(),
562
618
  admittedStatus: AdmittedStatusSchema.optional(),
563
- stateOfDomicile: z7.string().optional()
619
+ stateOfDomicile: z8.string().optional()
564
620
  });
565
- var ProducerInfoSchema = z7.object({
566
- agencyName: z7.string(),
567
- contactName: z7.string().optional(),
568
- licenseNumber: z7.string().optional(),
569
- phone: z7.string().optional(),
570
- email: z7.string().optional(),
621
+ var ProducerInfoSchema = z8.object({
622
+ agencyName: z8.string(),
623
+ contactName: z8.string().optional(),
624
+ licenseNumber: z8.string().optional(),
625
+ phone: z8.string().optional(),
626
+ email: z8.string().optional(),
571
627
  address: AddressSchema.optional()
572
628
  });
573
629
 
574
630
  // src/schemas/financial.ts
575
- import { z as z8 } from "zod";
576
- var PaymentInstallmentSchema = z8.object({
577
- dueDate: z8.string(),
578
- amount: z8.string(),
579
- description: z8.string().optional()
631
+ import { z as z9 } from "zod";
632
+ var PaymentInstallmentSchema = z9.object({
633
+ dueDate: z9.string(),
634
+ amount: z9.string(),
635
+ description: z9.string().optional()
580
636
  });
581
- var PaymentPlanSchema = z8.object({
582
- installments: z8.array(PaymentInstallmentSchema),
583
- financeCharge: z8.string().optional()
637
+ var PaymentPlanSchema = z9.object({
638
+ installments: z9.array(PaymentInstallmentSchema),
639
+ financeCharge: z9.string().optional()
584
640
  });
585
- var LocationPremiumSchema = z8.object({
586
- locationNumber: z8.number(),
587
- premium: z8.string(),
588
- description: z8.string().optional()
641
+ var LocationPremiumSchema = z9.object({
642
+ locationNumber: z9.number(),
643
+ premium: z9.string(),
644
+ description: z9.string().optional()
589
645
  });
590
646
 
591
647
  // src/schemas/loss-history.ts
592
- import { z as z9 } from "zod";
593
- var ClaimRecordSchema = z9.object({
594
- dateOfLoss: z9.string(),
595
- claimNumber: z9.string().optional(),
596
- description: z9.string(),
648
+ import { z as z10 } from "zod";
649
+ var ClaimRecordSchema = z10.object({
650
+ dateOfLoss: z10.string(),
651
+ claimNumber: z10.string().optional(),
652
+ description: z10.string(),
597
653
  status: ClaimStatusSchema,
598
- paid: z9.string().optional(),
599
- reserved: z9.string().optional(),
600
- incurred: z9.string().optional(),
601
- claimant: z9.string().optional(),
602
- coverageLine: z9.string().optional()
654
+ paid: z10.string().optional(),
655
+ reserved: z10.string().optional(),
656
+ incurred: z10.string().optional(),
657
+ claimant: z10.string().optional(),
658
+ coverageLine: z10.string().optional()
603
659
  });
604
- var LossSummarySchema = z9.object({
605
- period: z9.string().optional(),
606
- totalClaims: z9.number().optional(),
607
- totalIncurred: z9.string().optional(),
608
- totalPaid: z9.string().optional(),
609
- totalReserved: z9.string().optional(),
610
- lossRatio: z9.string().optional()
660
+ var LossSummarySchema = z10.object({
661
+ period: z10.string().optional(),
662
+ totalClaims: z10.number().optional(),
663
+ totalIncurred: z10.string().optional(),
664
+ totalPaid: z10.string().optional(),
665
+ totalReserved: z10.string().optional(),
666
+ lossRatio: z10.string().optional()
611
667
  });
612
- var ExperienceModSchema = z9.object({
613
- factor: z9.number(),
614
- effectiveDate: z9.string().optional(),
615
- state: z9.string().optional()
668
+ var ExperienceModSchema = z10.object({
669
+ factor: z10.number(),
670
+ effectiveDate: z10.string().optional(),
671
+ state: z10.string().optional()
616
672
  });
617
673
 
618
674
  // src/schemas/underwriting.ts
619
- import { z as z10 } from "zod";
620
- var EnrichedSubjectivitySchema = z10.object({
621
- description: z10.string(),
675
+ import { z as z11 } from "zod";
676
+ var EnrichedSubjectivitySchema = z11.object({
677
+ description: z11.string(),
622
678
  category: SubjectivityCategorySchema.optional(),
623
- dueDate: z10.string().optional(),
624
- status: z10.enum(["open", "satisfied", "waived"]).optional(),
625
- pageNumber: z10.number().optional()
679
+ dueDate: z11.string().optional(),
680
+ status: z11.enum(["open", "satisfied", "waived"]).optional(),
681
+ pageNumber: z11.number().optional()
626
682
  });
627
- var EnrichedUnderwritingConditionSchema = z10.object({
628
- description: z10.string(),
629
- category: z10.string().optional(),
630
- pageNumber: z10.number().optional()
683
+ var EnrichedUnderwritingConditionSchema = z11.object({
684
+ description: z11.string(),
685
+ category: z11.string().optional(),
686
+ pageNumber: z11.number().optional()
631
687
  });
632
- var BindingAuthoritySchema = z10.object({
633
- authorizedBy: z10.string().optional(),
634
- method: z10.string().optional(),
635
- expiration: z10.string().optional(),
636
- conditions: z10.array(z10.string()).optional()
688
+ var BindingAuthoritySchema = z11.object({
689
+ authorizedBy: z11.string().optional(),
690
+ method: z11.string().optional(),
691
+ expiration: z11.string().optional(),
692
+ conditions: z11.array(z11.string()).optional()
637
693
  });
638
694
 
639
695
  // src/schemas/declarations/index.ts
640
- import { z as z14 } from "zod";
696
+ import { z as z15 } from "zod";
641
697
 
642
698
  // src/schemas/declarations/personal.ts
643
- import { z as z12 } from "zod";
699
+ import { z as z13 } from "zod";
644
700
 
645
701
  // src/schemas/declarations/shared.ts
646
- import { z as z11 } from "zod";
647
- var EmployersLiabilityLimitsSchema = z11.object({
648
- eachAccident: z11.string(),
649
- diseasePolicyLimit: z11.string(),
650
- diseaseEachEmployee: z11.string()
702
+ import { z as z12 } from "zod";
703
+ var EmployersLiabilityLimitsSchema = z12.object({
704
+ eachAccident: z12.string(),
705
+ diseasePolicyLimit: z12.string(),
706
+ diseaseEachEmployee: z12.string()
651
707
  });
652
- var LimitScheduleSchema = z11.object({
653
- perOccurrence: z11.string().optional(),
654
- generalAggregate: z11.string().optional(),
655
- productsCompletedOpsAggregate: z11.string().optional(),
656
- personalAdvertisingInjury: z11.string().optional(),
657
- eachEmployee: z11.string().optional(),
658
- fireDamage: z11.string().optional(),
659
- medicalExpense: z11.string().optional(),
660
- combinedSingleLimit: z11.string().optional(),
661
- bodilyInjuryPerPerson: z11.string().optional(),
662
- bodilyInjuryPerAccident: z11.string().optional(),
663
- propertyDamage: z11.string().optional(),
664
- eachOccurrenceUmbrella: z11.string().optional(),
665
- umbrellaAggregate: z11.string().optional(),
666
- umbrellaRetention: z11.string().optional(),
667
- statutory: z11.boolean().optional(),
708
+ var LimitScheduleSchema = z12.object({
709
+ perOccurrence: z12.string().optional(),
710
+ generalAggregate: z12.string().optional(),
711
+ productsCompletedOpsAggregate: z12.string().optional(),
712
+ personalAdvertisingInjury: z12.string().optional(),
713
+ eachEmployee: z12.string().optional(),
714
+ fireDamage: z12.string().optional(),
715
+ medicalExpense: z12.string().optional(),
716
+ combinedSingleLimit: z12.string().optional(),
717
+ bodilyInjuryPerPerson: z12.string().optional(),
718
+ bodilyInjuryPerAccident: z12.string().optional(),
719
+ propertyDamage: z12.string().optional(),
720
+ eachOccurrenceUmbrella: z12.string().optional(),
721
+ umbrellaAggregate: z12.string().optional(),
722
+ umbrellaRetention: z12.string().optional(),
723
+ statutory: z12.boolean().optional(),
668
724
  employersLiability: EmployersLiabilityLimitsSchema.optional(),
669
- sublimits: z11.array(SublimitSchema).optional(),
670
- sharedLimits: z11.array(SharedLimitSchema).optional(),
725
+ sublimits: z12.array(SublimitSchema).optional(),
726
+ sharedLimits: z12.array(SharedLimitSchema).optional(),
671
727
  defenseCostTreatment: DefenseCostTreatmentSchema.optional()
672
728
  });
673
- var DeductibleScheduleSchema = z11.object({
674
- perClaim: z11.string().optional(),
675
- perOccurrence: z11.string().optional(),
676
- aggregateDeductible: z11.string().optional(),
677
- selfInsuredRetention: z11.string().optional(),
678
- corridorDeductible: z11.string().optional(),
679
- waitingPeriod: z11.string().optional(),
680
- appliesTo: z11.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
729
+ var DeductibleScheduleSchema = z12.object({
730
+ perClaim: z12.string().optional(),
731
+ perOccurrence: z12.string().optional(),
732
+ aggregateDeductible: z12.string().optional(),
733
+ selfInsuredRetention: z12.string().optional(),
734
+ corridorDeductible: z12.string().optional(),
735
+ waitingPeriod: z12.string().optional(),
736
+ appliesTo: z12.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
681
737
  });
682
- var InsuredLocationSchema = z11.object({
683
- number: z11.number(),
738
+ var InsuredLocationSchema = z12.object({
739
+ number: z12.number(),
684
740
  address: AddressSchema,
685
- description: z11.string().optional(),
686
- buildingValue: z11.string().optional(),
687
- contentsValue: z11.string().optional(),
688
- businessIncomeValue: z11.string().optional(),
689
- constructionType: z11.string().optional(),
690
- yearBuilt: z11.number().optional(),
691
- squareFootage: z11.number().optional(),
692
- protectionClass: z11.string().optional(),
693
- sprinklered: z11.boolean().optional(),
694
- alarmType: z11.string().optional(),
695
- occupancy: z11.string().optional()
741
+ description: z12.string().optional(),
742
+ buildingValue: z12.string().optional(),
743
+ contentsValue: z12.string().optional(),
744
+ businessIncomeValue: z12.string().optional(),
745
+ constructionType: z12.string().optional(),
746
+ yearBuilt: z12.number().optional(),
747
+ squareFootage: z12.number().optional(),
748
+ protectionClass: z12.string().optional(),
749
+ sprinklered: z12.boolean().optional(),
750
+ alarmType: z12.string().optional(),
751
+ occupancy: z12.string().optional()
696
752
  });
697
- var VehicleCoverageSchema = z11.object({
753
+ var VehicleCoverageSchema = z12.object({
698
754
  type: VehicleCoverageTypeSchema,
699
- limit: z11.string().optional(),
700
- deductible: z11.string().optional(),
701
- included: z11.boolean()
755
+ limit: z12.string().optional(),
756
+ deductible: z12.string().optional(),
757
+ included: z12.boolean()
702
758
  });
703
- var InsuredVehicleSchema = z11.object({
704
- number: z11.number(),
705
- year: z11.number(),
706
- make: z11.string(),
707
- model: z11.string(),
708
- vin: z11.string(),
709
- costNew: z11.string().optional(),
710
- statedValue: z11.string().optional(),
711
- garageLocation: z11.number().optional(),
712
- coverages: z11.array(VehicleCoverageSchema).optional(),
713
- radius: z11.string().optional(),
714
- vehicleType: z11.string().optional()
759
+ var InsuredVehicleSchema = z12.object({
760
+ number: z12.number(),
761
+ year: z12.number(),
762
+ make: z12.string(),
763
+ model: z12.string(),
764
+ vin: z12.string(),
765
+ costNew: z12.string().optional(),
766
+ statedValue: z12.string().optional(),
767
+ garageLocation: z12.number().optional(),
768
+ coverages: z12.array(VehicleCoverageSchema).optional(),
769
+ radius: z12.string().optional(),
770
+ vehicleType: z12.string().optional()
715
771
  });
716
- var ClassificationCodeSchema = z11.object({
717
- code: z11.string(),
718
- description: z11.string(),
719
- premiumBasis: z11.string(),
720
- basisAmount: z11.string().optional(),
721
- rate: z11.string().optional(),
722
- premium: z11.string().optional(),
723
- locationNumber: z11.number().optional()
772
+ var ClassificationCodeSchema = z12.object({
773
+ code: z12.string(),
774
+ description: z12.string(),
775
+ premiumBasis: z12.string(),
776
+ basisAmount: z12.string().optional(),
777
+ rate: z12.string().optional(),
778
+ premium: z12.string().optional(),
779
+ locationNumber: z12.number().optional()
724
780
  });
725
- var DwellingDetailsSchema = z11.object({
781
+ var DwellingDetailsSchema = z12.object({
726
782
  constructionType: ConstructionTypeSchema.optional(),
727
- yearBuilt: z11.number().optional(),
728
- squareFootage: z11.number().optional(),
729
- stories: z11.number().optional(),
783
+ yearBuilt: z12.number().optional(),
784
+ squareFootage: z12.number().optional(),
785
+ stories: z12.number().optional(),
730
786
  roofType: RoofTypeSchema.optional(),
731
- roofAge: z11.number().optional(),
732
- heatingType: z11.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
787
+ roofAge: z12.number().optional(),
788
+ heatingType: z12.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
733
789
  foundationType: FoundationTypeSchema.optional(),
734
- plumbingType: z11.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
735
- electricalType: z11.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
736
- electricalAmps: z11.number().optional(),
737
- hasSwimmingPool: z11.boolean().optional(),
738
- poolType: z11.enum(["in_ground", "above_ground"]).optional(),
739
- hasTrampoline: z11.boolean().optional(),
740
- hasDog: z11.boolean().optional(),
741
- dogBreed: z11.string().optional(),
742
- protectiveDevices: z11.array(z11.string()).optional(),
743
- distanceToFireStation: z11.string().optional(),
744
- distanceToHydrant: z11.string().optional(),
745
- fireProtectionClass: z11.string().optional()
790
+ plumbingType: z12.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
791
+ electricalType: z12.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
792
+ electricalAmps: z12.number().optional(),
793
+ hasSwimmingPool: z12.boolean().optional(),
794
+ poolType: z12.enum(["in_ground", "above_ground"]).optional(),
795
+ hasTrampoline: z12.boolean().optional(),
796
+ hasDog: z12.boolean().optional(),
797
+ dogBreed: z12.string().optional(),
798
+ protectiveDevices: z12.array(z12.string()).optional(),
799
+ distanceToFireStation: z12.string().optional(),
800
+ distanceToHydrant: z12.string().optional(),
801
+ fireProtectionClass: z12.string().optional()
746
802
  });
747
- var DriverRecordSchema = z11.object({
748
- name: z11.string(),
749
- dateOfBirth: z11.string().optional(),
750
- licenseNumber: z11.string().optional(),
751
- licenseState: z11.string().optional(),
752
- relationship: z11.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
753
- yearsLicensed: z11.number().optional(),
754
- gender: z11.string().optional(),
755
- maritalStatus: z11.string().optional(),
756
- goodStudentDiscount: z11.boolean().optional(),
757
- defensiveDriverDiscount: z11.boolean().optional(),
758
- violations: z11.array(z11.object({
759
- date: z11.string().optional(),
760
- type: z11.string().optional(),
761
- description: z11.string().optional()
803
+ var DriverRecordSchema = z12.object({
804
+ name: z12.string(),
805
+ dateOfBirth: z12.string().optional(),
806
+ licenseNumber: z12.string().optional(),
807
+ licenseState: z12.string().optional(),
808
+ relationship: z12.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
809
+ yearsLicensed: z12.number().optional(),
810
+ gender: z12.string().optional(),
811
+ maritalStatus: z12.string().optional(),
812
+ goodStudentDiscount: z12.boolean().optional(),
813
+ defensiveDriverDiscount: z12.boolean().optional(),
814
+ violations: z12.array(z12.object({
815
+ date: z12.string().optional(),
816
+ type: z12.string().optional(),
817
+ description: z12.string().optional()
762
818
  })).optional(),
763
- accidents: z11.array(z11.object({
764
- date: z11.string().optional(),
765
- atFault: z11.boolean().optional(),
766
- description: z11.string().optional(),
767
- amountPaid: z11.string().optional()
819
+ accidents: z12.array(z12.object({
820
+ date: z12.string().optional(),
821
+ atFault: z12.boolean().optional(),
822
+ description: z12.string().optional(),
823
+ amountPaid: z12.string().optional()
768
824
  })).optional(),
769
- sr22Required: z11.boolean().optional()
825
+ sr22Required: z12.boolean().optional()
770
826
  });
771
- var PersonalVehicleDetailsSchema = z11.object({
772
- number: z11.number().optional(),
773
- year: z11.number().optional(),
774
- make: z11.string().optional(),
775
- model: z11.string().optional(),
776
- vin: z11.string().optional(),
777
- bodyType: z11.string().optional(),
827
+ var PersonalVehicleDetailsSchema = z12.object({
828
+ number: z12.number().optional(),
829
+ year: z12.number().optional(),
830
+ make: z12.string().optional(),
831
+ model: z12.string().optional(),
832
+ vin: z12.string().optional(),
833
+ bodyType: z12.string().optional(),
778
834
  garagingAddress: AddressSchema.optional(),
779
835
  usage: PersonalAutoUsageSchema.optional(),
780
- annualMileage: z11.number().optional(),
781
- odometerReading: z11.number().optional(),
782
- driverAssignment: z11.string().optional(),
836
+ annualMileage: z12.number().optional(),
837
+ odometerReading: z12.number().optional(),
838
+ driverAssignment: z12.string().optional(),
783
839
  lienHolder: EndorsementPartySchema.optional(),
784
- collisionDeductible: z11.string().optional(),
785
- comprehensiveDeductible: z11.string().optional(),
786
- rentalReimbursement: z11.boolean().optional(),
787
- towing: z11.boolean().optional()
840
+ collisionDeductible: z12.string().optional(),
841
+ comprehensiveDeductible: z12.string().optional(),
842
+ rentalReimbursement: z12.boolean().optional(),
843
+ towing: z12.boolean().optional()
788
844
  });
789
845
 
790
846
  // src/schemas/declarations/personal.ts
791
- var HomeownersDeclarationsSchema = z12.object({
792
- line: z12.literal("homeowners"),
847
+ var HomeownersDeclarationsSchema = z13.object({
848
+ line: z13.literal("homeowners"),
793
849
  formType: HomeownersFormTypeSchema,
794
- coverageA: z12.string().optional(),
795
- coverageB: z12.string().optional(),
796
- coverageC: z12.string().optional(),
797
- coverageD: z12.string().optional(),
798
- coverageE: z12.string().optional(),
799
- coverageF: z12.string().optional(),
800
- allPerilDeductible: z12.string().optional(),
801
- windHailDeductible: z12.string().optional(),
802
- hurricaneDeductible: z12.string().optional(),
850
+ coverageA: z13.string().optional(),
851
+ coverageB: z13.string().optional(),
852
+ coverageC: z13.string().optional(),
853
+ coverageD: z13.string().optional(),
854
+ coverageE: z13.string().optional(),
855
+ coverageF: z13.string().optional(),
856
+ allPerilDeductible: z13.string().optional(),
857
+ windHailDeductible: z13.string().optional(),
858
+ hurricaneDeductible: z13.string().optional(),
803
859
  lossSettlement: LossSettlementSchema.optional(),
804
860
  dwelling: DwellingDetailsSchema,
805
861
  mortgagee: EndorsementPartySchema.optional(),
806
- additionalMortgagees: z12.array(EndorsementPartySchema).optional()
862
+ additionalMortgagees: z13.array(EndorsementPartySchema).optional()
807
863
  });
808
- var PersonalAutoDeclarationsSchema = z12.object({
809
- line: z12.literal("personal_auto"),
810
- vehicles: z12.array(PersonalVehicleDetailsSchema),
811
- drivers: z12.array(DriverRecordSchema),
812
- liabilityLimits: z12.object({
813
- bodilyInjuryPerPerson: z12.string().optional(),
814
- bodilyInjuryPerAccident: z12.string().optional(),
815
- propertyDamage: z12.string().optional(),
816
- combinedSingleLimit: z12.string().optional()
864
+ var PersonalAutoDeclarationsSchema = z13.object({
865
+ line: z13.literal("personal_auto"),
866
+ vehicles: z13.array(PersonalVehicleDetailsSchema),
867
+ drivers: z13.array(DriverRecordSchema),
868
+ liabilityLimits: z13.object({
869
+ bodilyInjuryPerPerson: z13.string().optional(),
870
+ bodilyInjuryPerAccident: z13.string().optional(),
871
+ propertyDamage: z13.string().optional(),
872
+ combinedSingleLimit: z13.string().optional()
817
873
  }).optional(),
818
- umLimits: z12.object({
819
- bodilyInjuryPerPerson: z12.string().optional(),
820
- bodilyInjuryPerAccident: z12.string().optional()
874
+ umLimits: z13.object({
875
+ bodilyInjuryPerPerson: z13.string().optional(),
876
+ bodilyInjuryPerAccident: z13.string().optional()
821
877
  }).optional(),
822
- uimLimits: z12.object({
823
- bodilyInjuryPerPerson: z12.string().optional(),
824
- bodilyInjuryPerAccident: z12.string().optional()
878
+ uimLimits: z13.object({
879
+ bodilyInjuryPerPerson: z13.string().optional(),
880
+ bodilyInjuryPerAccident: z13.string().optional()
825
881
  }).optional(),
826
- pipLimit: z12.string().optional(),
827
- medPayLimit: z12.string().optional()
882
+ pipLimit: z13.string().optional(),
883
+ medPayLimit: z13.string().optional()
828
884
  });
829
- var DwellingFireDeclarationsSchema = z12.object({
830
- line: z12.literal("dwelling_fire"),
885
+ var DwellingFireDeclarationsSchema = z13.object({
886
+ line: z13.literal("dwelling_fire"),
831
887
  formType: DwellingFireFormTypeSchema,
832
- dwellingLimit: z12.string().optional(),
833
- otherStructuresLimit: z12.string().optional(),
834
- personalPropertyLimit: z12.string().optional(),
835
- fairRentalValueLimit: z12.string().optional(),
836
- liabilityLimit: z12.string().optional(),
837
- medicalPaymentsLimit: z12.string().optional(),
838
- deductible: z12.string().optional(),
888
+ dwellingLimit: z13.string().optional(),
889
+ otherStructuresLimit: z13.string().optional(),
890
+ personalPropertyLimit: z13.string().optional(),
891
+ fairRentalValueLimit: z13.string().optional(),
892
+ liabilityLimit: z13.string().optional(),
893
+ medicalPaymentsLimit: z13.string().optional(),
894
+ deductible: z13.string().optional(),
839
895
  dwelling: DwellingDetailsSchema
840
896
  });
841
- var FloodDeclarationsSchema = z12.object({
842
- line: z12.literal("flood"),
843
- programType: z12.enum(["nfip", "private"]),
897
+ var FloodDeclarationsSchema = z13.object({
898
+ line: z13.literal("flood"),
899
+ programType: z13.enum(["nfip", "private"]),
844
900
  floodZone: FloodZoneSchema.optional(),
845
- communityNumber: z12.string().optional(),
846
- communityRating: z12.number().optional(),
847
- buildingCoverage: z12.string().optional(),
848
- contentsCoverage: z12.string().optional(),
849
- iccCoverage: z12.string().optional(),
850
- deductible: z12.string().optional(),
851
- waitingPeriodDays: z12.number().optional(),
852
- elevationCertificate: z12.boolean().optional(),
853
- elevationDifference: z12.string().optional(),
854
- buildingDiagramNumber: z12.number().optional(),
855
- basementOrEnclosure: z12.boolean().optional(),
856
- postFirmConstruction: z12.boolean().optional()
901
+ communityNumber: z13.string().optional(),
902
+ communityRating: z13.number().optional(),
903
+ buildingCoverage: z13.string().optional(),
904
+ contentsCoverage: z13.string().optional(),
905
+ iccCoverage: z13.string().optional(),
906
+ deductible: z13.string().optional(),
907
+ waitingPeriodDays: z13.number().optional(),
908
+ elevationCertificate: z13.boolean().optional(),
909
+ elevationDifference: z13.string().optional(),
910
+ buildingDiagramNumber: z13.number().optional(),
911
+ basementOrEnclosure: z13.boolean().optional(),
912
+ postFirmConstruction: z13.boolean().optional()
857
913
  });
858
- var EarthquakeDeclarationsSchema = z12.object({
859
- line: z12.literal("earthquake"),
860
- dwellingCoverage: z12.string().optional(),
861
- contentsCoverage: z12.string().optional(),
862
- lossOfUseCoverage: z12.string().optional(),
863
- deductiblePercent: z12.number().optional(),
864
- retrofitDiscount: z12.boolean().optional(),
865
- masonryVeneerCoverage: z12.boolean().optional()
914
+ var EarthquakeDeclarationsSchema = z13.object({
915
+ line: z13.literal("earthquake"),
916
+ dwellingCoverage: z13.string().optional(),
917
+ contentsCoverage: z13.string().optional(),
918
+ lossOfUseCoverage: z13.string().optional(),
919
+ deductiblePercent: z13.number().optional(),
920
+ retrofitDiscount: z13.boolean().optional(),
921
+ masonryVeneerCoverage: z13.boolean().optional()
866
922
  });
867
- var PersonalUmbrellaDeclarationsSchema = z12.object({
868
- line: z12.literal("personal_umbrella"),
869
- perOccurrenceLimit: z12.string().optional(),
870
- aggregateLimit: z12.string().optional(),
871
- retainedLimit: z12.string().optional(),
872
- underlyingPolicies: z12.array(z12.object({
873
- carrier: z12.string().optional(),
874
- policyNumber: z12.string().optional(),
875
- policyType: z12.string().optional(),
876
- limits: z12.string().optional()
923
+ var PersonalUmbrellaDeclarationsSchema = z13.object({
924
+ line: z13.literal("personal_umbrella"),
925
+ perOccurrenceLimit: z13.string().optional(),
926
+ aggregateLimit: z13.string().optional(),
927
+ retainedLimit: z13.string().optional(),
928
+ underlyingPolicies: z13.array(z13.object({
929
+ carrier: z13.string().optional(),
930
+ policyNumber: z13.string().optional(),
931
+ policyType: z13.string().optional(),
932
+ limits: z13.string().optional()
877
933
  }))
878
934
  });
879
- var PersonalArticlesDeclarationsSchema = z12.object({
880
- line: z12.literal("personal_articles"),
881
- scheduledItems: z12.array(z12.object({
882
- itemNumber: z12.number().optional(),
935
+ var PersonalArticlesDeclarationsSchema = z13.object({
936
+ line: z13.literal("personal_articles"),
937
+ scheduledItems: z13.array(z13.object({
938
+ itemNumber: z13.number().optional(),
883
939
  category: ScheduledItemCategorySchema.optional(),
884
- description: z12.string(),
885
- appraisedValue: z12.string(),
886
- appraisalDate: z12.string().optional()
940
+ description: z13.string(),
941
+ appraisedValue: z13.string(),
942
+ appraisalDate: z13.string().optional()
887
943
  })),
888
- blanketCoverage: z12.string().optional(),
889
- deductible: z12.string().optional(),
890
- worldwideCoverage: z12.boolean().optional(),
891
- breakageCoverage: z12.boolean().optional()
944
+ blanketCoverage: z13.string().optional(),
945
+ deductible: z13.string().optional(),
946
+ worldwideCoverage: z13.boolean().optional(),
947
+ breakageCoverage: z13.boolean().optional()
892
948
  });
893
- var WatercraftDeclarationsSchema = z12.object({
894
- line: z12.literal("watercraft"),
949
+ var WatercraftDeclarationsSchema = z13.object({
950
+ line: z13.literal("watercraft"),
895
951
  boatType: BoatTypeSchema.optional(),
896
- year: z12.number().optional(),
897
- make: z12.string().optional(),
898
- model: z12.string().optional(),
899
- length: z12.string().optional(),
900
- hullMaterial: z12.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
901
- hullValue: z12.string().optional(),
902
- motorHorsepower: z12.number().optional(),
903
- motorType: z12.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
904
- navigationLimits: z12.string().optional(),
905
- layupPeriod: z12.string().optional(),
906
- liabilityLimit: z12.string().optional(),
907
- medicalPaymentsLimit: z12.string().optional(),
908
- physicalDamageDeductible: z12.string().optional(),
909
- uninsuredBoaterLimit: z12.string().optional(),
910
- trailerCovered: z12.boolean().optional(),
911
- trailerValue: z12.string().optional()
952
+ year: z13.number().optional(),
953
+ make: z13.string().optional(),
954
+ model: z13.string().optional(),
955
+ length: z13.string().optional(),
956
+ hullMaterial: z13.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
957
+ hullValue: z13.string().optional(),
958
+ motorHorsepower: z13.number().optional(),
959
+ motorType: z13.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
960
+ navigationLimits: z13.string().optional(),
961
+ layupPeriod: z13.string().optional(),
962
+ liabilityLimit: z13.string().optional(),
963
+ medicalPaymentsLimit: z13.string().optional(),
964
+ physicalDamageDeductible: z13.string().optional(),
965
+ uninsuredBoaterLimit: z13.string().optional(),
966
+ trailerCovered: z13.boolean().optional(),
967
+ trailerValue: z13.string().optional()
912
968
  });
913
- var RecreationalVehicleDeclarationsSchema = z12.object({
914
- line: z12.literal("recreational_vehicle"),
969
+ var RecreationalVehicleDeclarationsSchema = z13.object({
970
+ line: z13.literal("recreational_vehicle"),
915
971
  vehicleType: RVTypeSchema,
916
- year: z12.number().optional(),
917
- make: z12.string().optional(),
918
- model: z12.string().optional(),
919
- vin: z12.string().optional(),
920
- value: z12.string().optional(),
921
- liabilityLimit: z12.string().optional(),
922
- collisionDeductible: z12.string().optional(),
923
- comprehensiveDeductible: z12.string().optional(),
924
- personalEffectsCoverage: z12.string().optional(),
925
- fullTimerCoverage: z12.boolean().optional()
972
+ year: z13.number().optional(),
973
+ make: z13.string().optional(),
974
+ model: z13.string().optional(),
975
+ vin: z13.string().optional(),
976
+ value: z13.string().optional(),
977
+ liabilityLimit: z13.string().optional(),
978
+ collisionDeductible: z13.string().optional(),
979
+ comprehensiveDeductible: z13.string().optional(),
980
+ personalEffectsCoverage: z13.string().optional(),
981
+ fullTimerCoverage: z13.boolean().optional()
926
982
  });
927
- var FarmRanchDeclarationsSchema = z12.object({
928
- line: z12.literal("farm_ranch"),
929
- dwellingCoverage: z12.string().optional(),
930
- farmPersonalPropertyCoverage: z12.string().optional(),
931
- farmLiabilityLimit: z12.string().optional(),
932
- farmAutoIncluded: z12.boolean().optional(),
933
- livestock: z12.array(z12.object({
934
- type: z12.string(),
935
- headCount: z12.number(),
936
- value: z12.string().optional()
983
+ var FarmRanchDeclarationsSchema = z13.object({
984
+ line: z13.literal("farm_ranch"),
985
+ dwellingCoverage: z13.string().optional(),
986
+ farmPersonalPropertyCoverage: z13.string().optional(),
987
+ farmLiabilityLimit: z13.string().optional(),
988
+ farmAutoIncluded: z13.boolean().optional(),
989
+ livestock: z13.array(z13.object({
990
+ type: z13.string(),
991
+ headCount: z13.number(),
992
+ value: z13.string().optional()
937
993
  })).optional(),
938
- equipmentSchedule: z12.array(z12.object({
939
- description: z12.string(),
940
- value: z12.string()
994
+ equipmentSchedule: z13.array(z13.object({
995
+ description: z13.string(),
996
+ value: z13.string()
941
997
  })).optional(),
942
- acreage: z12.number().optional(),
998
+ acreage: z13.number().optional(),
943
999
  dwelling: DwellingDetailsSchema.optional()
944
1000
  });
945
- var TitleDeclarationsSchema = z12.object({
946
- line: z12.literal("title"),
1001
+ var TitleDeclarationsSchema = z13.object({
1002
+ line: z13.literal("title"),
947
1003
  policyType: TitlePolicyTypeSchema,
948
- policyAmount: z12.string(),
949
- legalDescription: z12.string().optional(),
1004
+ policyAmount: z13.string(),
1005
+ legalDescription: z13.string().optional(),
950
1006
  propertyAddress: AddressSchema.optional(),
951
- effectiveDate: z12.string().optional(),
952
- exceptions: z12.array(z12.object({
953
- number: z12.number(),
954
- description: z12.string()
1007
+ effectiveDate: z13.string().optional(),
1008
+ exceptions: z13.array(z13.object({
1009
+ number: z13.number(),
1010
+ description: z13.string()
955
1011
  })).optional(),
956
- underwriter: z12.string().optional()
1012
+ underwriter: z13.string().optional()
957
1013
  });
958
- var PetDeclarationsSchema = z12.object({
959
- line: z12.literal("pet"),
1014
+ var PetDeclarationsSchema = z13.object({
1015
+ line: z13.literal("pet"),
960
1016
  species: PetSpeciesSchema,
961
- breed: z12.string().optional(),
962
- petName: z12.string().optional(),
963
- age: z12.number().optional(),
964
- annualLimit: z12.string().optional(),
965
- perIncidentLimit: z12.string().optional(),
966
- deductible: z12.string().optional(),
967
- reimbursementPercent: z12.number().optional(),
968
- waitingPeriodDays: z12.number().optional(),
969
- preExistingConditionsExcluded: z12.boolean().optional(),
970
- wellnessCoverage: z12.boolean().optional()
1017
+ breed: z13.string().optional(),
1018
+ petName: z13.string().optional(),
1019
+ age: z13.number().optional(),
1020
+ annualLimit: z13.string().optional(),
1021
+ perIncidentLimit: z13.string().optional(),
1022
+ deductible: z13.string().optional(),
1023
+ reimbursementPercent: z13.number().optional(),
1024
+ waitingPeriodDays: z13.number().optional(),
1025
+ preExistingConditionsExcluded: z13.boolean().optional(),
1026
+ wellnessCoverage: z13.boolean().optional()
971
1027
  });
972
- var TravelDeclarationsSchema = z12.object({
973
- line: z12.literal("travel"),
974
- tripDepartureDate: z12.string().optional(),
975
- tripReturnDate: z12.string().optional(),
976
- destinations: z12.array(z12.string()).optional(),
977
- travelers: z12.array(z12.object({
978
- name: z12.string(),
979
- age: z12.number().optional()
1028
+ var TravelDeclarationsSchema = z13.object({
1029
+ line: z13.literal("travel"),
1030
+ tripDepartureDate: z13.string().optional(),
1031
+ tripReturnDate: z13.string().optional(),
1032
+ destinations: z13.array(z13.string()).optional(),
1033
+ travelers: z13.array(z13.object({
1034
+ name: z13.string(),
1035
+ age: z13.number().optional()
980
1036
  })).optional(),
981
- tripCost: z12.string().optional(),
982
- tripCancellationLimit: z12.string().optional(),
983
- medicalLimit: z12.string().optional(),
984
- evacuationLimit: z12.string().optional(),
985
- baggageLimit: z12.string().optional()
1037
+ tripCost: z13.string().optional(),
1038
+ tripCancellationLimit: z13.string().optional(),
1039
+ medicalLimit: z13.string().optional(),
1040
+ evacuationLimit: z13.string().optional(),
1041
+ baggageLimit: z13.string().optional()
986
1042
  });
987
- var IdentityTheftDeclarationsSchema = z12.object({
988
- line: z12.literal("identity_theft"),
989
- coverageLimit: z12.string().optional(),
990
- expenseReimbursement: z12.string().optional(),
991
- creditMonitoring: z12.boolean().optional(),
992
- restorationServices: z12.boolean().optional(),
993
- lostWagesLimit: z12.string().optional()
1043
+ var IdentityTheftDeclarationsSchema = z13.object({
1044
+ line: z13.literal("identity_theft"),
1045
+ coverageLimit: z13.string().optional(),
1046
+ expenseReimbursement: z13.string().optional(),
1047
+ creditMonitoring: z13.boolean().optional(),
1048
+ restorationServices: z13.boolean().optional(),
1049
+ lostWagesLimit: z13.string().optional()
994
1050
  });
995
1051
 
996
1052
  // src/schemas/declarations/commercial.ts
997
- import { z as z13 } from "zod";
998
- var GLDeclarationsSchema = z13.object({
999
- line: z13.literal("gl"),
1053
+ import { z as z14 } from "zod";
1054
+ var GLDeclarationsSchema = z14.object({
1055
+ line: z14.literal("gl"),
1000
1056
  coverageForm: CoverageFormSchema.optional(),
1001
- perOccurrenceLimit: z13.string().optional(),
1002
- generalAggregate: z13.string().optional(),
1003
- productsCompletedOpsAggregate: z13.string().optional(),
1004
- personalAdvertisingInjury: z13.string().optional(),
1005
- fireDamage: z13.string().optional(),
1006
- medicalExpense: z13.string().optional(),
1057
+ perOccurrenceLimit: z14.string().optional(),
1058
+ generalAggregate: z14.string().optional(),
1059
+ productsCompletedOpsAggregate: z14.string().optional(),
1060
+ personalAdvertisingInjury: z14.string().optional(),
1061
+ fireDamage: z14.string().optional(),
1062
+ medicalExpense: z14.string().optional(),
1007
1063
  defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
1008
- deductible: z13.string().optional(),
1009
- classifications: z13.array(ClassificationCodeSchema).optional(),
1010
- retroactiveDate: z13.string().optional()
1064
+ deductible: z14.string().optional(),
1065
+ classifications: z14.array(ClassificationCodeSchema).optional(),
1066
+ retroactiveDate: z14.string().optional()
1011
1067
  });
1012
- var CommercialPropertyDeclarationsSchema = z13.object({
1013
- line: z13.literal("commercial_property"),
1014
- causesOfLossForm: z13.enum(["basic", "broad", "special"]).optional(),
1015
- coinsurancePercent: z13.number().optional(),
1068
+ var CommercialPropertyDeclarationsSchema = z14.object({
1069
+ line: z14.literal("commercial_property"),
1070
+ causesOfLossForm: z14.enum(["basic", "broad", "special"]).optional(),
1071
+ coinsurancePercent: z14.number().optional(),
1016
1072
  valuationMethod: ValuationMethodSchema.optional(),
1017
- locations: z13.array(InsuredLocationSchema),
1018
- blanketLimit: z13.string().optional(),
1019
- businessIncomeLimit: z13.string().optional(),
1020
- extraExpenseLimit: z13.string().optional()
1073
+ locations: z14.array(InsuredLocationSchema),
1074
+ blanketLimit: z14.string().optional(),
1075
+ businessIncomeLimit: z14.string().optional(),
1076
+ extraExpenseLimit: z14.string().optional()
1021
1077
  });
1022
- var CommercialAutoDeclarationsSchema = z13.object({
1023
- line: z13.literal("commercial_auto"),
1024
- vehicles: z13.array(InsuredVehicleSchema),
1025
- coveredAutoSymbols: z13.array(z13.number()).optional(),
1026
- liabilityLimit: z13.string().optional(),
1027
- umLimit: z13.string().optional(),
1028
- uimLimit: z13.string().optional(),
1029
- hiredAutoLiability: z13.boolean().optional(),
1030
- nonOwnedAutoLiability: z13.boolean().optional()
1078
+ var CommercialAutoDeclarationsSchema = z14.object({
1079
+ line: z14.literal("commercial_auto"),
1080
+ vehicles: z14.array(InsuredVehicleSchema),
1081
+ coveredAutoSymbols: z14.array(z14.number()).optional(),
1082
+ liabilityLimit: z14.string().optional(),
1083
+ umLimit: z14.string().optional(),
1084
+ uimLimit: z14.string().optional(),
1085
+ hiredAutoLiability: z14.boolean().optional(),
1086
+ nonOwnedAutoLiability: z14.boolean().optional()
1031
1087
  });
1032
- var WorkersCompDeclarationsSchema = z13.object({
1033
- line: z13.literal("workers_comp"),
1034
- coveredStates: z13.array(z13.string()).optional(),
1035
- classifications: z13.array(ClassificationCodeSchema),
1088
+ var WorkersCompDeclarationsSchema = z14.object({
1089
+ line: z14.literal("workers_comp"),
1090
+ coveredStates: z14.array(z14.string()).optional(),
1091
+ classifications: z14.array(ClassificationCodeSchema),
1036
1092
  experienceMod: ExperienceModSchema.optional(),
1037
1093
  employersLiability: EmployersLiabilityLimitsSchema.optional()
1038
1094
  });
1039
- var UmbrellaExcessDeclarationsSchema = z13.object({
1040
- line: z13.literal("umbrella_excess"),
1041
- perOccurrenceLimit: z13.string().optional(),
1042
- aggregateLimit: z13.string().optional(),
1043
- retention: z13.string().optional(),
1044
- underlyingPolicies: z13.array(z13.object({
1045
- carrier: z13.string().optional(),
1046
- policyNumber: z13.string().optional(),
1047
- policyType: z13.string().optional(),
1048
- limits: z13.string().optional()
1095
+ var UmbrellaExcessDeclarationsSchema = z14.object({
1096
+ line: z14.literal("umbrella_excess"),
1097
+ perOccurrenceLimit: z14.string().optional(),
1098
+ aggregateLimit: z14.string().optional(),
1099
+ retention: z14.string().optional(),
1100
+ underlyingPolicies: z14.array(z14.object({
1101
+ carrier: z14.string().optional(),
1102
+ policyNumber: z14.string().optional(),
1103
+ policyType: z14.string().optional(),
1104
+ limits: z14.string().optional()
1049
1105
  }))
1050
1106
  });
1051
- var ProfessionalLiabilityDeclarationsSchema = z13.object({
1052
- line: z13.literal("professional_liability"),
1053
- perClaimLimit: z13.string().optional(),
1054
- aggregateLimit: z13.string().optional(),
1055
- retroactiveDate: z13.string().optional(),
1107
+ var ProfessionalLiabilityDeclarationsSchema = z14.object({
1108
+ line: z14.literal("professional_liability"),
1109
+ perClaimLimit: z14.string().optional(),
1110
+ aggregateLimit: z14.string().optional(),
1111
+ retroactiveDate: z14.string().optional(),
1056
1112
  defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
1057
1113
  extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
1058
1114
  });
1059
- var CyberDeclarationsSchema = z13.object({
1060
- line: z13.literal("cyber"),
1061
- aggregateLimit: z13.string().optional(),
1062
- retroactiveDate: z13.string().optional(),
1063
- waitingPeriodHours: z13.number().optional(),
1064
- sublimits: z13.array(z13.object({
1065
- coverageName: z13.string(),
1066
- limit: z13.string()
1115
+ var CyberDeclarationsSchema = z14.object({
1116
+ line: z14.literal("cyber"),
1117
+ aggregateLimit: z14.string().optional(),
1118
+ retroactiveDate: z14.string().optional(),
1119
+ waitingPeriodHours: z14.number().optional(),
1120
+ sublimits: z14.array(z14.object({
1121
+ coverageName: z14.string(),
1122
+ limit: z14.string()
1067
1123
  })).optional()
1068
1124
  });
1069
- var DODeclarationsSchema = z13.object({
1070
- line: z13.literal("directors_officers"),
1071
- sideALimit: z13.string().optional(),
1072
- sideBLimit: z13.string().optional(),
1073
- sideCLimit: z13.string().optional(),
1074
- sideARetention: z13.string().optional(),
1075
- sideBRetention: z13.string().optional(),
1076
- sideCRetention: z13.string().optional(),
1077
- continuityDate: z13.string().optional()
1125
+ var DODeclarationsSchema = z14.object({
1126
+ line: z14.literal("directors_officers"),
1127
+ sideALimit: z14.string().optional(),
1128
+ sideBLimit: z14.string().optional(),
1129
+ sideCLimit: z14.string().optional(),
1130
+ sideARetention: z14.string().optional(),
1131
+ sideBRetention: z14.string().optional(),
1132
+ sideCRetention: z14.string().optional(),
1133
+ continuityDate: z14.string().optional()
1078
1134
  });
1079
- var CrimeDeclarationsSchema = z13.object({
1080
- line: z13.literal("crime"),
1081
- formType: z13.enum(["discovery", "loss_sustained"]).optional(),
1082
- agreements: z13.array(z13.object({
1083
- agreement: z13.string(),
1084
- coverageName: z13.string(),
1085
- limit: z13.string(),
1086
- deductible: z13.string()
1135
+ var CrimeDeclarationsSchema = z14.object({
1136
+ line: z14.literal("crime"),
1137
+ formType: z14.enum(["discovery", "loss_sustained"]).optional(),
1138
+ agreements: z14.array(z14.object({
1139
+ agreement: z14.string(),
1140
+ coverageName: z14.string(),
1141
+ limit: z14.string(),
1142
+ deductible: z14.string()
1087
1143
  }))
1088
1144
  });
1089
1145
 
1090
1146
  // src/schemas/declarations/index.ts
1091
- var DeclarationsSchema = z14.discriminatedUnion("line", [
1147
+ var DeclarationsSchema = z15.discriminatedUnion("line", [
1092
1148
  // Personal lines
1093
1149
  HomeownersDeclarationsSchema,
1094
1150
  PersonalAutoDeclarationsSchema,
@@ -1117,137 +1173,137 @@ var DeclarationsSchema = z14.discriminatedUnion("line", [
1117
1173
  ]);
1118
1174
 
1119
1175
  // src/schemas/document.ts
1120
- import { z as z15 } from "zod";
1121
- var SubsectionSchema = z15.object({
1122
- title: z15.string(),
1123
- sectionNumber: z15.string().optional(),
1124
- pageNumber: z15.number().optional(),
1125
- content: z15.string()
1176
+ import { z as z16 } from "zod";
1177
+ var SubsectionSchema = z16.object({
1178
+ title: z16.string(),
1179
+ sectionNumber: z16.string().optional(),
1180
+ pageNumber: z16.number().optional(),
1181
+ content: z16.string()
1126
1182
  });
1127
- var SectionSchema = z15.object({
1128
- title: z15.string(),
1129
- sectionNumber: z15.string().optional(),
1130
- pageStart: z15.number(),
1131
- pageEnd: z15.number().optional(),
1132
- type: z15.string(),
1133
- coverageType: z15.string().optional(),
1134
- content: z15.string(),
1135
- subsections: z15.array(SubsectionSchema).optional()
1183
+ var SectionSchema = z16.object({
1184
+ title: z16.string(),
1185
+ sectionNumber: z16.string().optional(),
1186
+ pageStart: z16.number(),
1187
+ pageEnd: z16.number().optional(),
1188
+ type: z16.string(),
1189
+ coverageType: z16.string().optional(),
1190
+ content: z16.string(),
1191
+ subsections: z16.array(SubsectionSchema).optional()
1136
1192
  });
1137
- var SubjectivitySchema = z15.object({
1138
- description: z15.string(),
1139
- category: z15.string().optional()
1193
+ var SubjectivitySchema = z16.object({
1194
+ description: z16.string(),
1195
+ category: z16.string().optional()
1140
1196
  });
1141
- var UnderwritingConditionSchema = z15.object({
1142
- description: z15.string()
1197
+ var UnderwritingConditionSchema = z16.object({
1198
+ description: z16.string()
1143
1199
  });
1144
- var PremiumLineSchema = z15.object({
1145
- line: z15.string(),
1146
- amount: z15.string()
1200
+ var PremiumLineSchema = z16.object({
1201
+ line: z16.string(),
1202
+ amount: z16.string()
1147
1203
  });
1148
1204
  var BaseDocumentFields = {
1149
- id: z15.string(),
1150
- carrier: z15.string(),
1151
- security: z15.string().optional(),
1152
- insuredName: z15.string(),
1153
- premium: z15.string().optional(),
1154
- summary: z15.string().optional(),
1155
- policyTypes: z15.array(z15.string()).optional(),
1156
- coverages: z15.array(CoverageSchema),
1157
- sections: z15.array(SectionSchema).optional(),
1205
+ id: z16.string(),
1206
+ carrier: z16.string(),
1207
+ security: z16.string().optional(),
1208
+ insuredName: z16.string(),
1209
+ premium: z16.string().optional(),
1210
+ summary: z16.string().optional(),
1211
+ policyTypes: z16.array(z16.string()).optional(),
1212
+ coverages: z16.array(CoverageSchema),
1213
+ sections: z16.array(SectionSchema).optional(),
1158
1214
  // Enriched fields (v1.2+)
1159
- carrierLegalName: z15.string().optional(),
1160
- carrierNaicNumber: z15.string().optional(),
1161
- carrierAmBestRating: z15.string().optional(),
1162
- carrierAdmittedStatus: z15.string().optional(),
1163
- mga: z15.string().optional(),
1164
- underwriter: z15.string().optional(),
1165
- brokerAgency: z15.string().optional(),
1166
- brokerContactName: z15.string().optional(),
1167
- brokerLicenseNumber: z15.string().optional(),
1168
- priorPolicyNumber: z15.string().optional(),
1169
- programName: z15.string().optional(),
1170
- isRenewal: z15.boolean().optional(),
1171
- isPackage: z15.boolean().optional(),
1172
- insuredDba: z15.string().optional(),
1215
+ carrierLegalName: z16.string().optional(),
1216
+ carrierNaicNumber: z16.string().optional(),
1217
+ carrierAmBestRating: z16.string().optional(),
1218
+ carrierAdmittedStatus: z16.string().optional(),
1219
+ mga: z16.string().optional(),
1220
+ underwriter: z16.string().optional(),
1221
+ brokerAgency: z16.string().optional(),
1222
+ brokerContactName: z16.string().optional(),
1223
+ brokerLicenseNumber: z16.string().optional(),
1224
+ priorPolicyNumber: z16.string().optional(),
1225
+ programName: z16.string().optional(),
1226
+ isRenewal: z16.boolean().optional(),
1227
+ isPackage: z16.boolean().optional(),
1228
+ insuredDba: z16.string().optional(),
1173
1229
  insuredAddress: AddressSchema.optional(),
1174
1230
  insuredEntityType: EntityTypeSchema.optional(),
1175
- additionalNamedInsureds: z15.array(NamedInsuredSchema).optional(),
1176
- insuredSicCode: z15.string().optional(),
1177
- insuredNaicsCode: z15.string().optional(),
1178
- insuredFein: z15.string().optional(),
1179
- enrichedCoverages: z15.array(EnrichedCoverageSchema).optional(),
1180
- endorsements: z15.array(EndorsementSchema).optional(),
1181
- exclusions: z15.array(ExclusionSchema).optional(),
1182
- conditions: z15.array(PolicyConditionSchema).optional(),
1231
+ additionalNamedInsureds: z16.array(NamedInsuredSchema).optional(),
1232
+ insuredSicCode: z16.string().optional(),
1233
+ insuredNaicsCode: z16.string().optional(),
1234
+ insuredFein: z16.string().optional(),
1235
+ enrichedCoverages: z16.array(EnrichedCoverageSchema).optional(),
1236
+ endorsements: z16.array(EndorsementSchema).optional(),
1237
+ exclusions: z16.array(ExclusionSchema).optional(),
1238
+ conditions: z16.array(PolicyConditionSchema).optional(),
1183
1239
  limits: LimitScheduleSchema.optional(),
1184
1240
  deductibles: DeductibleScheduleSchema.optional(),
1185
- locations: z15.array(InsuredLocationSchema).optional(),
1186
- vehicles: z15.array(InsuredVehicleSchema).optional(),
1187
- classifications: z15.array(ClassificationCodeSchema).optional(),
1188
- formInventory: z15.array(FormReferenceSchema).optional(),
1241
+ locations: z16.array(InsuredLocationSchema).optional(),
1242
+ vehicles: z16.array(InsuredVehicleSchema).optional(),
1243
+ classifications: z16.array(ClassificationCodeSchema).optional(),
1244
+ formInventory: z16.array(FormReferenceSchema).optional(),
1189
1245
  declarations: DeclarationsSchema.optional(),
1190
1246
  coverageForm: CoverageFormSchema.optional(),
1191
- retroactiveDate: z15.string().optional(),
1247
+ retroactiveDate: z16.string().optional(),
1192
1248
  extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
1193
1249
  insurer: InsurerInfoSchema.optional(),
1194
1250
  producer: ProducerInfoSchema.optional(),
1195
- claimsContacts: z15.array(ContactSchema).optional(),
1196
- regulatoryContacts: z15.array(ContactSchema).optional(),
1197
- thirdPartyAdministrators: z15.array(ContactSchema).optional(),
1198
- additionalInsureds: z15.array(EndorsementPartySchema).optional(),
1199
- lossPayees: z15.array(EndorsementPartySchema).optional(),
1200
- mortgageHolders: z15.array(EndorsementPartySchema).optional(),
1201
- taxesAndFees: z15.array(TaxFeeItemSchema).optional(),
1202
- totalCost: z15.string().optional(),
1203
- minimumPremium: z15.string().optional(),
1204
- depositPremium: z15.string().optional(),
1251
+ claimsContacts: z16.array(ContactSchema).optional(),
1252
+ regulatoryContacts: z16.array(ContactSchema).optional(),
1253
+ thirdPartyAdministrators: z16.array(ContactSchema).optional(),
1254
+ additionalInsureds: z16.array(EndorsementPartySchema).optional(),
1255
+ lossPayees: z16.array(EndorsementPartySchema).optional(),
1256
+ mortgageHolders: z16.array(EndorsementPartySchema).optional(),
1257
+ taxesAndFees: z16.array(TaxFeeItemSchema).optional(),
1258
+ totalCost: z16.string().optional(),
1259
+ minimumPremium: z16.string().optional(),
1260
+ depositPremium: z16.string().optional(),
1205
1261
  paymentPlan: PaymentPlanSchema.optional(),
1206
1262
  auditType: AuditTypeSchema.optional(),
1207
- ratingBasis: z15.array(RatingBasisSchema).optional(),
1208
- premiumByLocation: z15.array(LocationPremiumSchema).optional(),
1263
+ ratingBasis: z16.array(RatingBasisSchema).optional(),
1264
+ premiumByLocation: z16.array(LocationPremiumSchema).optional(),
1209
1265
  lossSummary: LossSummarySchema.optional(),
1210
- individualClaims: z15.array(ClaimRecordSchema).optional(),
1266
+ individualClaims: z16.array(ClaimRecordSchema).optional(),
1211
1267
  experienceMod: ExperienceModSchema.optional(),
1212
- cancellationNoticeDays: z15.number().optional(),
1213
- nonrenewalNoticeDays: z15.number().optional()
1268
+ cancellationNoticeDays: z16.number().optional(),
1269
+ nonrenewalNoticeDays: z16.number().optional()
1214
1270
  };
1215
- var PolicyDocumentSchema = z15.object({
1271
+ var PolicyDocumentSchema = z16.object({
1216
1272
  ...BaseDocumentFields,
1217
- type: z15.literal("policy"),
1218
- policyNumber: z15.string(),
1219
- effectiveDate: z15.string(),
1220
- expirationDate: z15.string().optional(),
1273
+ type: z16.literal("policy"),
1274
+ policyNumber: z16.string(),
1275
+ effectiveDate: z16.string(),
1276
+ expirationDate: z16.string().optional(),
1221
1277
  policyTermType: PolicyTermTypeSchema.optional(),
1222
- nextReviewDate: z15.string().optional(),
1223
- effectiveTime: z15.string().optional()
1278
+ nextReviewDate: z16.string().optional(),
1279
+ effectiveTime: z16.string().optional()
1224
1280
  });
1225
- var QuoteDocumentSchema = z15.object({
1281
+ var QuoteDocumentSchema = z16.object({
1226
1282
  ...BaseDocumentFields,
1227
- type: z15.literal("quote"),
1228
- quoteNumber: z15.string(),
1229
- proposedEffectiveDate: z15.string().optional(),
1230
- proposedExpirationDate: z15.string().optional(),
1231
- quoteExpirationDate: z15.string().optional(),
1232
- subjectivities: z15.array(SubjectivitySchema).optional(),
1233
- underwritingConditions: z15.array(UnderwritingConditionSchema).optional(),
1234
- premiumBreakdown: z15.array(PremiumLineSchema).optional(),
1283
+ type: z16.literal("quote"),
1284
+ quoteNumber: z16.string(),
1285
+ proposedEffectiveDate: z16.string().optional(),
1286
+ proposedExpirationDate: z16.string().optional(),
1287
+ quoteExpirationDate: z16.string().optional(),
1288
+ subjectivities: z16.array(SubjectivitySchema).optional(),
1289
+ underwritingConditions: z16.array(UnderwritingConditionSchema).optional(),
1290
+ premiumBreakdown: z16.array(PremiumLineSchema).optional(),
1235
1291
  // Enriched quote fields (v1.2+)
1236
- enrichedSubjectivities: z15.array(EnrichedSubjectivitySchema).optional(),
1237
- enrichedUnderwritingConditions: z15.array(EnrichedUnderwritingConditionSchema).optional(),
1238
- warrantyRequirements: z15.array(z15.string()).optional(),
1239
- lossControlRecommendations: z15.array(z15.string()).optional(),
1292
+ enrichedSubjectivities: z16.array(EnrichedSubjectivitySchema).optional(),
1293
+ enrichedUnderwritingConditions: z16.array(EnrichedUnderwritingConditionSchema).optional(),
1294
+ warrantyRequirements: z16.array(z16.string()).optional(),
1295
+ lossControlRecommendations: z16.array(z16.string()).optional(),
1240
1296
  bindingAuthority: BindingAuthoritySchema.optional()
1241
1297
  });
1242
- var InsuranceDocumentSchema = z15.discriminatedUnion("type", [
1298
+ var InsuranceDocumentSchema = z16.discriminatedUnion("type", [
1243
1299
  PolicyDocumentSchema,
1244
1300
  QuoteDocumentSchema
1245
1301
  ]);
1246
1302
 
1247
1303
  // src/schemas/platform.ts
1248
- import { z as z16 } from "zod";
1249
- var PlatformSchema = z16.enum(["email", "chat", "sms", "slack", "discord"]);
1250
- var CommunicationIntentSchema = z16.enum(["direct", "mediated", "observed"]);
1304
+ import { z as z17 } from "zod";
1305
+ var PlatformSchema = z17.enum(["email", "chat", "sms", "slack", "discord"]);
1306
+ var CommunicationIntentSchema = z17.enum(["direct", "mediated", "observed"]);
1251
1307
  var PLATFORM_CONFIGS = {
1252
1308
  email: {
1253
1309
  supportsMarkdown: false,
@@ -1475,10 +1531,11 @@ async function runExtractor(params) {
1475
1531
  [Document pages ${startPage}-${endPage} are provided as images above.]` : `${prompt}
1476
1532
 
1477
1533
  [Document pages ${startPage}-${endPage} are provided as a PDF file above.]`;
1534
+ const strictSchema = toStrictSchema(schema);
1478
1535
  const result = await withRetry(
1479
1536
  () => generateObject({
1480
1537
  prompt: fullPrompt,
1481
- schema,
1538
+ schema: strictSchema,
1482
1539
  maxTokens,
1483
1540
  providerOptions
1484
1541
  })
@@ -2557,11 +2614,11 @@ function getTemplate(policyType) {
2557
2614
  }
2558
2615
 
2559
2616
  // src/prompts/coordinator/classify.ts
2560
- import { z as z17 } from "zod";
2561
- var ClassifyResultSchema = z17.object({
2562
- documentType: z17.enum(["policy", "quote"]),
2563
- policyTypes: z17.array(PolicyTypeSchema),
2564
- confidence: z17.number()
2617
+ import { z as z18 } from "zod";
2618
+ var ClassifyResultSchema = z18.object({
2619
+ documentType: z18.enum(["policy", "quote"]),
2620
+ policyTypes: z18.array(PolicyTypeSchema),
2621
+ confidence: z18.number()
2565
2622
  });
2566
2623
  function buildClassifyPrompt() {
2567
2624
  return `You are classifying an insurance document. Examine the first few pages and determine:
@@ -2585,20 +2642,20 @@ Respond with JSON only.`;
2585
2642
  }
2586
2643
 
2587
2644
  // src/prompts/coordinator/plan.ts
2588
- import { z as z18 } from "zod";
2589
- var ExtractionTaskSchema = z18.object({
2590
- extractorName: z18.string(),
2591
- startPage: z18.number(),
2592
- endPage: z18.number(),
2593
- description: z18.string()
2645
+ import { z as z19 } from "zod";
2646
+ var ExtractionTaskSchema = z19.object({
2647
+ extractorName: z19.string(),
2648
+ startPage: z19.number(),
2649
+ endPage: z19.number(),
2650
+ description: z19.string()
2594
2651
  });
2595
- var PageMapEntrySchema = z18.object({
2596
- section: z18.string(),
2597
- pages: z18.string()
2652
+ var PageMapEntrySchema = z19.object({
2653
+ section: z19.string(),
2654
+ pages: z19.string()
2598
2655
  });
2599
- var ExtractionPlanSchema = z18.object({
2600
- tasks: z18.array(ExtractionTaskSchema),
2601
- pageMap: z18.array(PageMapEntrySchema).optional()
2656
+ var ExtractionPlanSchema = z19.object({
2657
+ tasks: z19.array(ExtractionTaskSchema),
2658
+ pageMap: z19.array(PageMapEntrySchema).optional()
2602
2659
  });
2603
2660
  function buildPlanPrompt(templateHints) {
2604
2661
  return `You are planning the extraction of an insurance document. You have already classified this document. Now scan the full document and create a page map + extraction plan.
@@ -2639,15 +2696,15 @@ Respond with JSON only.`;
2639
2696
  }
2640
2697
 
2641
2698
  // src/prompts/coordinator/review.ts
2642
- import { z as z19 } from "zod";
2643
- var ReviewResultSchema = z19.object({
2644
- complete: z19.boolean(),
2645
- missingFields: z19.array(z19.string()),
2646
- additionalTasks: z19.array(z19.object({
2647
- extractorName: z19.string(),
2648
- startPage: z19.number(),
2649
- endPage: z19.number(),
2650
- description: z19.string()
2699
+ import { z as z20 } from "zod";
2700
+ var ReviewResultSchema = z20.object({
2701
+ complete: z20.boolean(),
2702
+ missingFields: z20.array(z20.string()),
2703
+ additionalTasks: z20.array(z20.object({
2704
+ extractorName: z20.string(),
2705
+ startPage: z20.number(),
2706
+ endPage: z20.number(),
2707
+ description: z20.string()
2651
2708
  }))
2652
2709
  });
2653
2710
  function buildReviewPrompt(templateExpected, extractedKeys) {
@@ -2679,20 +2736,20 @@ Respond with JSON only.`;
2679
2736
  }
2680
2737
 
2681
2738
  // src/prompts/extractors/carrier-info.ts
2682
- import { z as z20 } from "zod";
2683
- var CarrierInfoSchema = z20.object({
2684
- carrierName: z20.string().describe("Primary insurance company name for display"),
2685
- carrierLegalName: z20.string().optional().describe("Legal entity name of insurer"),
2686
- naicNumber: z20.string().optional().describe("NAIC company code"),
2687
- amBestRating: z20.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
2688
- admittedStatus: z20.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
2689
- mga: z20.string().optional().describe("Managing General Agent or Program Administrator name"),
2690
- underwriter: z20.string().optional().describe("Named individual underwriter"),
2691
- policyNumber: z20.string().optional().describe("Policy or quote reference number"),
2692
- effectiveDate: z20.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
2693
- expirationDate: z20.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
2694
- quoteNumber: z20.string().optional().describe("Quote or proposal reference number"),
2695
- proposedEffectiveDate: z20.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
2739
+ import { z as z21 } from "zod";
2740
+ var CarrierInfoSchema = z21.object({
2741
+ carrierName: z21.string().describe("Primary insurance company name for display"),
2742
+ carrierLegalName: z21.string().optional().describe("Legal entity name of insurer"),
2743
+ naicNumber: z21.string().optional().describe("NAIC company code"),
2744
+ amBestRating: z21.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
2745
+ admittedStatus: z21.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
2746
+ mga: z21.string().optional().describe("Managing General Agent or Program Administrator name"),
2747
+ underwriter: z21.string().optional().describe("Named individual underwriter"),
2748
+ policyNumber: z21.string().optional().describe("Policy or quote reference number"),
2749
+ effectiveDate: z21.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
2750
+ expirationDate: z21.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
2751
+ quoteNumber: z21.string().optional().describe("Quote or proposal reference number"),
2752
+ proposedEffectiveDate: z21.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
2696
2753
  });
2697
2754
  function buildCarrierInfoPrompt() {
2698
2755
  return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
@@ -2712,18 +2769,18 @@ Return JSON only.`;
2712
2769
  }
2713
2770
 
2714
2771
  // src/prompts/extractors/named-insured.ts
2715
- import { z as z21 } from "zod";
2716
- var AddressSchema2 = z21.object({
2717
- street1: z21.string(),
2718
- city: z21.string(),
2719
- state: z21.string(),
2720
- zip: z21.string()
2772
+ import { z as z22 } from "zod";
2773
+ var AddressSchema2 = z22.object({
2774
+ street1: z22.string(),
2775
+ city: z22.string(),
2776
+ state: z22.string(),
2777
+ zip: z22.string()
2721
2778
  });
2722
- var NamedInsuredSchema2 = z21.object({
2723
- insuredName: z21.string().describe("Name of primary named insured"),
2724
- insuredDba: z21.string().optional().describe("Doing-business-as name"),
2779
+ var NamedInsuredSchema2 = z22.object({
2780
+ insuredName: z22.string().describe("Name of primary named insured"),
2781
+ insuredDba: z22.string().optional().describe("Doing-business-as name"),
2725
2782
  insuredAddress: AddressSchema2.optional().describe("Primary insured mailing address"),
2726
- insuredEntityType: z21.enum([
2783
+ insuredEntityType: z22.enum([
2727
2784
  "corporation",
2728
2785
  "llc",
2729
2786
  "partnership",
@@ -2736,13 +2793,13 @@ var NamedInsuredSchema2 = z21.object({
2736
2793
  "married_couple",
2737
2794
  "other"
2738
2795
  ]).optional().describe("Legal entity type of the insured"),
2739
- insuredFein: z21.string().optional().describe("Federal Employer Identification Number"),
2740
- insuredSicCode: z21.string().optional().describe("SIC code"),
2741
- insuredNaicsCode: z21.string().optional().describe("NAICS code"),
2742
- additionalNamedInsureds: z21.array(
2743
- z21.object({
2744
- name: z21.string(),
2745
- relationship: z21.string().optional().describe("e.g. subsidiary, affiliate"),
2796
+ insuredFein: z22.string().optional().describe("Federal Employer Identification Number"),
2797
+ insuredSicCode: z22.string().optional().describe("SIC code"),
2798
+ insuredNaicsCode: z22.string().optional().describe("NAICS code"),
2799
+ additionalNamedInsureds: z22.array(
2800
+ z22.object({
2801
+ name: z22.string(),
2802
+ relationship: z22.string().optional().describe("e.g. subsidiary, affiliate"),
2746
2803
  address: AddressSchema2.optional()
2747
2804
  })
2748
2805
  ).optional().describe("Additional named insureds listed on the policy")
@@ -2763,19 +2820,19 @@ Return JSON only.`;
2763
2820
  }
2764
2821
 
2765
2822
  // src/prompts/extractors/coverage-limits.ts
2766
- import { z as z22 } from "zod";
2767
- var CoverageLimitsSchema = z22.object({
2768
- coverages: z22.array(
2769
- z22.object({
2770
- name: z22.string().describe("Coverage name"),
2771
- limit: z22.string().describe("Coverage limit, e.g. '$1,000,000'"),
2772
- deductible: z22.string().optional().describe("Deductible amount"),
2773
- coverageCode: z22.string().optional().describe("Coverage code or class code"),
2774
- formNumber: z22.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
2823
+ import { z as z23 } from "zod";
2824
+ var CoverageLimitsSchema = z23.object({
2825
+ coverages: z23.array(
2826
+ z23.object({
2827
+ name: z23.string().describe("Coverage name"),
2828
+ limit: z23.string().describe("Coverage limit, e.g. '$1,000,000'"),
2829
+ deductible: z23.string().optional().describe("Deductible amount"),
2830
+ coverageCode: z23.string().optional().describe("Coverage code or class code"),
2831
+ formNumber: z23.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
2775
2832
  })
2776
2833
  ).describe("All coverages with their limits"),
2777
- coverageForm: z22.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
2778
- retroactiveDate: z22.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
2834
+ coverageForm: z23.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
2835
+ retroactiveDate: z23.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
2779
2836
  });
2780
2837
  function buildCoverageLimitsPrompt() {
2781
2838
  return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
@@ -2796,31 +2853,75 @@ Return JSON only.`;
2796
2853
  }
2797
2854
 
2798
2855
  // src/prompts/extractors/endorsements.ts
2799
- import { z as z23 } from "zod";
2800
- var EndorsementsSchema = z23.object({
2801
- endorsements: z23.array(
2802
- z23.object({
2803
- formNumber: z23.string().optional().describe("Form number, e.g. 'CG 21 47'"),
2804
- title: z23.string().optional().describe("Endorsement title"),
2805
- type: z23.enum(["broadening", "restrictive", "informational"]).optional().describe("Effect type: broadening adds coverage, restrictive limits it"),
2806
- content: z23.string().optional().describe("Full verbatim text of the endorsement"),
2807
- effectiveDate: z23.string().optional().describe("Endorsement effective date"),
2808
- premium: z23.string().optional().describe("Additional premium or credit"),
2809
- parties: z23.array(z23.string()).optional().describe("Named parties (additional insureds, loss payees, etc.)")
2856
+ import { z as z24 } from "zod";
2857
+ var EndorsementsSchema = z24.object({
2858
+ endorsements: z24.array(
2859
+ z24.object({
2860
+ formNumber: z24.string().describe("Form number, e.g. 'CG 21 47'"),
2861
+ editionDate: z24.string().optional().describe("Edition date, e.g. '12 07'"),
2862
+ title: z24.string().describe("Endorsement title"),
2863
+ endorsementType: z24.enum([
2864
+ "additional_insured",
2865
+ "waiver_of_subrogation",
2866
+ "primary_noncontributory",
2867
+ "blanket_additional_insured",
2868
+ "loss_payee",
2869
+ "mortgage_holder",
2870
+ "broadening",
2871
+ "restriction",
2872
+ "exclusion",
2873
+ "amendatory",
2874
+ "notice_of_cancellation",
2875
+ "designated_premises",
2876
+ "classification_change",
2877
+ "schedule_update",
2878
+ "deductible_change",
2879
+ "limit_change",
2880
+ "territorial_extension",
2881
+ "other"
2882
+ ]).describe("Endorsement type classification"),
2883
+ effectiveDate: z24.string().optional().describe("Endorsement effective date"),
2884
+ affectedCoverageParts: z24.array(z24.string()).optional().describe("Coverage parts affected by this endorsement"),
2885
+ namedParties: z24.array(
2886
+ z24.object({
2887
+ name: z24.string().describe("Party name"),
2888
+ role: z24.enum([
2889
+ "additional_insured",
2890
+ "loss_payee",
2891
+ "mortgage_holder",
2892
+ "certificate_holder",
2893
+ "waiver_beneficiary",
2894
+ "designated_person",
2895
+ "other"
2896
+ ]).describe("Party role"),
2897
+ relationship: z24.string().optional().describe("Relationship to insured"),
2898
+ scope: z24.string().optional().describe("Scope of coverage for this party")
2899
+ })
2900
+ ).optional().describe("Named parties (additional insureds, loss payees, etc.)"),
2901
+ keyTerms: z24.array(z24.string()).optional().describe("Key terms or notable provisions in the endorsement"),
2902
+ premiumImpact: z24.string().optional().describe("Additional premium or credit"),
2903
+ content: z24.string().describe("Full verbatim text of the endorsement"),
2904
+ pageStart: z24.number().describe("Starting page number of this endorsement"),
2905
+ pageEnd: z24.number().optional().describe("Ending page number of this endorsement")
2810
2906
  })
2811
2907
  ).describe("All endorsements found in the document")
2812
2908
  });
2813
2909
  function buildEndorsementsPrompt() {
2814
2910
  return `You are an expert insurance document analyst. Extract ALL endorsements from this document. Preserve original language verbatim.
2815
2911
 
2816
- Focus on:
2817
- - Every endorsement listed in the forms schedule or endorsement schedule
2818
- - Standalone endorsements modifying the base policy
2819
- - Form number and edition date (e.g. "CG 21 47 12 07")
2820
- - Endorsement title and full verbatim content
2821
- - Effect type: "broadening" if it adds or expands coverage, "restrictive" if it limits or excludes coverage, "informational" if it changes administrative terms only
2822
- - Additional premium or credit shown on the endorsement
2823
- - Named parties: additional insureds, loss payees, certificate holders, mortgagees
2912
+ For EACH endorsement, extract:
2913
+ - formNumber: the form identifier (e.g. "CG 21 47") \u2014 REQUIRED
2914
+ - editionDate: the edition date if present (e.g. "12 07")
2915
+ - title: endorsement title \u2014 REQUIRED
2916
+ - endorsementType: classify as one of: additional_insured, waiver_of_subrogation, primary_noncontributory, blanket_additional_insured, loss_payee, mortgage_holder, broadening, restriction, exclusion, amendatory, notice_of_cancellation, designated_premises, classification_change, schedule_update, deductible_change, limit_change, territorial_extension, other
2917
+ - effectiveDate: endorsement effective date if shown
2918
+ - affectedCoverageParts: which coverage parts are modified
2919
+ - namedParties: for each party, extract name, role (additional_insured, loss_payee, mortgage_holder, certificate_holder, waiver_beneficiary, designated_person, other), relationship, and scope
2920
+ - keyTerms: notable provisions or key terms
2921
+ - premiumImpact: additional premium or credit if shown
2922
+ - content: full verbatim text \u2014 REQUIRED
2923
+ - pageStart: page number where endorsement begins \u2014 REQUIRED
2924
+ - pageEnd: page number where endorsement ends
2824
2925
 
2825
2926
  PERSONAL LINES ENDORSEMENT RECOGNITION:
2826
2927
  - HO 04 XX series: homeowners endorsements
@@ -2832,27 +2933,43 @@ Return JSON only.`;
2832
2933
  }
2833
2934
 
2834
2935
  // src/prompts/extractors/exclusions.ts
2835
- import { z as z24 } from "zod";
2836
- var ExclusionsSchema = z24.object({
2837
- exclusions: z24.array(
2838
- z24.object({
2839
- title: z24.string().describe("Exclusion title or short description"),
2840
- content: z24.string().optional().describe("Full verbatim exclusion text"),
2841
- formNumber: z24.string().optional().describe("Form number if part of a named endorsement"),
2842
- appliesTo: z24.string().optional().describe("Coverage type this exclusion applies to")
2936
+ import { z as z25 } from "zod";
2937
+ var ExclusionsSchema = z25.object({
2938
+ exclusions: z25.array(
2939
+ z25.object({
2940
+ name: z25.string().describe("Exclusion title or short description"),
2941
+ formNumber: z25.string().optional().describe("Form number if part of a named endorsement"),
2942
+ excludedPerils: z25.array(z25.string()).optional().describe("Specific perils excluded"),
2943
+ isAbsolute: z25.boolean().optional().describe("Whether the exclusion is absolute (no exceptions)"),
2944
+ exceptions: z25.array(z25.string()).optional().describe("Exceptions to the exclusion, if any"),
2945
+ buybackAvailable: z25.boolean().optional().describe("Whether coverage can be bought back via endorsement"),
2946
+ buybackEndorsement: z25.string().optional().describe("Form number of the buyback endorsement if available"),
2947
+ appliesTo: z25.array(z25.string()).optional().describe("Coverage types this exclusion applies to"),
2948
+ content: z25.string().describe("Full verbatim exclusion text"),
2949
+ pageNumber: z25.number().optional().describe("Page number where exclusion appears")
2843
2950
  })
2844
2951
  ).describe("All exclusions found in the document")
2845
2952
  });
2846
2953
  function buildExclusionsPrompt() {
2847
2954
  return `You are an expert insurance document analyst. Extract ALL exclusions from this document. Preserve original language verbatim.
2848
2955
 
2956
+ For EACH exclusion, extract:
2957
+ - name: exclusion title or short description \u2014 REQUIRED
2958
+ - formNumber: form number if the exclusion is part of a named endorsement
2959
+ - excludedPerils: specific perils being excluded
2960
+ - isAbsolute: true if the exclusion has no exceptions, false if exceptions exist
2961
+ - exceptions: any exceptions to the exclusion (things still covered despite the exclusion)
2962
+ - buybackAvailable: whether coverage can be purchased back via endorsement
2963
+ - buybackEndorsement: the form number of the buyback endorsement if known
2964
+ - appliesTo: which coverage types or lines this exclusion applies to (as an array)
2965
+ - content: full verbatim exclusion text \u2014 REQUIRED
2966
+ - pageNumber: page number where the exclusion appears
2967
+
2849
2968
  Focus on:
2850
2969
  - Named exclusions from exclusion schedules
2851
2970
  - Exclusions embedded within endorsements
2852
2971
  - Exclusions within insuring agreements or conditions if clearly labeled
2853
2972
  - Full verbatim exclusion text \u2014 do not summarize
2854
- - Form number if the exclusion is part of a named endorsement
2855
- - Which coverage line the exclusion applies to, if specific
2856
2973
 
2857
2974
  Common personal lines exclusion patterns: animal liability, business pursuits, home daycare, watercraft, aircraft.
2858
2975
 
@@ -2860,73 +2977,92 @@ Return JSON only.`;
2860
2977
  }
2861
2978
 
2862
2979
  // src/prompts/extractors/conditions.ts
2863
- import { z as z25 } from "zod";
2864
- var ConditionsSchema = z25.object({
2865
- conditions: z25.array(
2866
- z25.object({
2867
- type: z25.enum([
2980
+ import { z as z26 } from "zod";
2981
+ var ConditionsSchema = z26.object({
2982
+ conditions: z26.array(
2983
+ z26.object({
2984
+ name: z26.string().describe("Condition title"),
2985
+ conditionType: z26.enum([
2868
2986
  "duties_after_loss",
2869
- "cooperation",
2987
+ "notice_requirements",
2988
+ "other_insurance",
2870
2989
  "cancellation",
2871
2990
  "nonrenewal",
2872
- "subrogation",
2873
- "other_insurance",
2874
2991
  "transfer_of_rights",
2875
- "examination_under_oath",
2876
- "arbitration",
2877
- "suit_against_us",
2878
2992
  "liberalization",
2993
+ "arbitration",
2994
+ "concealment_fraud",
2995
+ "examination_under_oath",
2996
+ "legal_action",
2997
+ "loss_payment",
2998
+ "appraisal",
2999
+ "mortgage_holders",
3000
+ "policy_territory",
3001
+ "separation_of_insureds",
2879
3002
  "other"
2880
- ]).optional().describe("Condition category"),
2881
- title: z25.string().describe("Condition title"),
2882
- content: z25.string().optional().describe("Full verbatim condition text"),
2883
- noticeDays: z25.number().optional().describe("Notice period in days if specified (e.g. cancellation notice)")
3003
+ ]).describe("Condition category"),
3004
+ content: z26.string().describe("Full verbatim condition text"),
3005
+ keyValues: z26.array(
3006
+ z26.object({
3007
+ key: z26.string().describe("Key name (e.g. 'noticePeriod', 'suitDeadline')"),
3008
+ value: z26.string().describe("Value (e.g. '30 days', '2 years')")
3009
+ })
3010
+ ).optional().describe("Key values extracted from the condition (notice periods, deadlines, etc.)"),
3011
+ pageNumber: z26.number().optional().describe("Page number where condition appears")
2884
3012
  })
2885
3013
  ).describe("All policy conditions found in the document")
2886
3014
  });
2887
3015
  function buildConditionsPrompt() {
2888
3016
  return `You are an expert insurance document analyst. Extract ALL policy conditions from this document. Preserve original language verbatim.
2889
3017
 
3018
+ For EACH condition, extract:
3019
+ - name: condition title \u2014 REQUIRED
3020
+ - conditionType: classify as one of: duties_after_loss, notice_requirements, other_insurance, cancellation, nonrenewal, transfer_of_rights, liberalization, arbitration, concealment_fraud, examination_under_oath, legal_action, loss_payment, appraisal, mortgage_holders, policy_territory, separation_of_insureds, other \u2014 REQUIRED
3021
+ - content: full verbatim condition text \u2014 REQUIRED
3022
+ - keyValues: extract specific values as key-value pairs (e.g. noticePeriod: "30 days", suitDeadline: "2 years")
3023
+ - pageNumber: page number where the condition appears
3024
+
2890
3025
  Focus on:
2891
3026
  - Duties after loss / notice of occurrence conditions
2892
- - Cooperation clause
2893
- - Cancellation and nonrenewal conditions (extract notice period in days)
2894
- - Subrogation / transfer of rights
3027
+ - Notice requirements (extract notice period as keyValue)
3028
+ - Cancellation and nonrenewal conditions (extract notice period in days as keyValue)
2895
3029
  - Other insurance clause
3030
+ - Subrogation / transfer of rights
2896
3031
  - Examination under oath
2897
3032
  - Arbitration or appraisal provisions
2898
3033
  - Suit against us / legal action conditions
2899
3034
  - Liberalization clause
3035
+ - Concealment or fraud clause
3036
+ - Loss payment conditions
3037
+ - Mortgage holders clause
2900
3038
  - Any other named conditions
2901
3039
 
2902
- For cancellation and nonrenewal conditions, extract the specific notice period in days if stated.
2903
-
2904
3040
  Return JSON only.`;
2905
3041
  }
2906
3042
 
2907
3043
  // src/prompts/extractors/premium-breakdown.ts
2908
- import { z as z26 } from "zod";
2909
- var PremiumBreakdownSchema = z26.object({
2910
- premium: z26.string().optional().describe("Total premium amount, e.g. '$5,000'"),
2911
- totalCost: z26.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
2912
- premiumBreakdown: z26.array(
2913
- z26.object({
2914
- line: z26.string().describe("Coverage line name"),
2915
- amount: z26.string().describe("Premium amount for this line")
3044
+ import { z as z27 } from "zod";
3045
+ var PremiumBreakdownSchema = z27.object({
3046
+ premium: z27.string().optional().describe("Total premium amount, e.g. '$5,000'"),
3047
+ totalCost: z27.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
3048
+ premiumBreakdown: z27.array(
3049
+ z27.object({
3050
+ line: z27.string().describe("Coverage line name"),
3051
+ amount: z27.string().describe("Premium amount for this line")
2916
3052
  })
2917
3053
  ).optional().describe("Per-coverage-line premium breakdown"),
2918
- taxesAndFees: z26.array(
2919
- z26.object({
2920
- name: z26.string().describe("Fee or tax name"),
2921
- amount: z26.string().describe("Dollar amount"),
2922
- type: z26.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
3054
+ taxesAndFees: z27.array(
3055
+ z27.object({
3056
+ name: z27.string().describe("Fee or tax name"),
3057
+ amount: z27.string().describe("Dollar amount"),
3058
+ type: z27.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
2923
3059
  })
2924
3060
  ).optional().describe("Taxes, fees, surcharges, and assessments"),
2925
- minimumPremium: z26.string().optional().describe("Minimum premium if stated"),
2926
- depositPremium: z26.string().optional().describe("Deposit premium if stated"),
2927
- paymentPlan: z26.string().optional().describe("Payment plan description"),
2928
- auditType: z26.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
2929
- ratingBasis: z26.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
3061
+ minimumPremium: z27.string().optional().describe("Minimum premium if stated"),
3062
+ depositPremium: z27.string().optional().describe("Deposit premium if stated"),
3063
+ paymentPlan: z27.string().optional().describe("Payment plan description"),
3064
+ auditType: z27.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
3065
+ ratingBasis: z27.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
2930
3066
  });
2931
3067
  function buildPremiumBreakdownPrompt() {
2932
3068
  return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
@@ -2946,14 +3082,14 @@ Return JSON only.`;
2946
3082
  }
2947
3083
 
2948
3084
  // src/prompts/extractors/declarations.ts
2949
- import { z as z27 } from "zod";
2950
- var DeclarationsFieldSchema = z27.object({
2951
- field: z27.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
2952
- value: z27.string().describe("Extracted value exactly as it appears in the document"),
2953
- section: z27.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
3085
+ import { z as z28 } from "zod";
3086
+ var DeclarationsFieldSchema = z28.object({
3087
+ field: z28.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
3088
+ value: z28.string().describe("Extracted value exactly as it appears in the document"),
3089
+ section: z28.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
2954
3090
  });
2955
- var DeclarationsExtractSchema = z27.object({
2956
- fields: z27.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
3091
+ var DeclarationsExtractSchema = z28.object({
3092
+ fields: z28.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
2957
3093
  });
2958
3094
  function buildDeclarationsPrompt() {
2959
3095
  return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
@@ -2993,21 +3129,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
2993
3129
  }
2994
3130
 
2995
3131
  // src/prompts/extractors/loss-history.ts
2996
- import { z as z28 } from "zod";
2997
- var LossHistorySchema = z28.object({
2998
- lossSummary: z28.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
2999
- individualClaims: z28.array(
3000
- z28.object({
3001
- date: z28.string().optional().describe("Date of loss or claim"),
3002
- type: z28.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
3003
- description: z28.string().optional().describe("Brief description of the claim"),
3004
- amountPaid: z28.string().optional().describe("Amount paid"),
3005
- amountReserved: z28.string().optional().describe("Amount reserved"),
3006
- status: z28.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
3007
- claimNumber: z28.string().optional().describe("Claim reference number")
3132
+ import { z as z29 } from "zod";
3133
+ var LossHistorySchema = z29.object({
3134
+ lossSummary: z29.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
3135
+ individualClaims: z29.array(
3136
+ z29.object({
3137
+ date: z29.string().optional().describe("Date of loss or claim"),
3138
+ type: z29.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
3139
+ description: z29.string().optional().describe("Brief description of the claim"),
3140
+ amountPaid: z29.string().optional().describe("Amount paid"),
3141
+ amountReserved: z29.string().optional().describe("Amount reserved"),
3142
+ status: z29.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
3143
+ claimNumber: z29.string().optional().describe("Claim reference number")
3008
3144
  })
3009
3145
  ).optional().describe("Individual claim records"),
3010
- experienceMod: z28.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
3146
+ experienceMod: z29.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
3011
3147
  });
3012
3148
  function buildLossHistoryPrompt() {
3013
3149
  return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
@@ -3024,18 +3160,18 @@ Return JSON only.`;
3024
3160
  }
3025
3161
 
3026
3162
  // src/prompts/extractors/sections.ts
3027
- import { z as z29 } from "zod";
3028
- var SubsectionSchema2 = z29.object({
3029
- title: z29.string().describe("Subsection title"),
3030
- sectionNumber: z29.string().optional().describe("Subsection number"),
3031
- pageNumber: z29.number().optional().describe("Page number"),
3032
- content: z29.string().describe("Full verbatim text")
3163
+ import { z as z30 } from "zod";
3164
+ var SubsectionSchema2 = z30.object({
3165
+ title: z30.string().describe("Subsection title"),
3166
+ sectionNumber: z30.string().optional().describe("Subsection number"),
3167
+ pageNumber: z30.number().optional().describe("Page number"),
3168
+ content: z30.string().describe("Full verbatim text")
3033
3169
  });
3034
- var SectionsSchema = z29.object({
3035
- sections: z29.array(
3036
- z29.object({
3037
- title: z29.string().describe("Section title"),
3038
- type: z29.enum([
3170
+ var SectionsSchema = z30.object({
3171
+ sections: z30.array(
3172
+ z30.object({
3173
+ title: z30.string().describe("Section title"),
3174
+ type: z30.enum([
3039
3175
  "declarations",
3040
3176
  "insuring_agreement",
3041
3177
  "policy_form",
@@ -3049,10 +3185,10 @@ var SectionsSchema = z29.object({
3049
3185
  "regulatory",
3050
3186
  "other"
3051
3187
  ]).describe("Section type classification"),
3052
- content: z29.string().describe("Full verbatim text of the section"),
3053
- pageStart: z29.number().describe("Starting page number"),
3054
- pageEnd: z29.number().optional().describe("Ending page number"),
3055
- subsections: z29.array(SubsectionSchema2).optional().describe("Subsections within this section")
3188
+ content: z30.string().describe("Full verbatim text of the section"),
3189
+ pageStart: z30.number().describe("Starting page number"),
3190
+ pageEnd: z30.number().optional().describe("Ending page number"),
3191
+ subsections: z30.array(SubsectionSchema2).optional().describe("Subsections within this section")
3056
3192
  })
3057
3193
  ).describe("All document sections")
3058
3194
  });
@@ -3076,20 +3212,20 @@ Return JSON only.`;
3076
3212
  }
3077
3213
 
3078
3214
  // src/prompts/extractors/supplementary.ts
3079
- import { z as z30 } from "zod";
3080
- var ContactSchema2 = z30.object({
3081
- name: z30.string().optional().describe("Organization or person name"),
3082
- phone: z30.string().optional().describe("Phone number"),
3083
- email: z30.string().optional().describe("Email address"),
3084
- address: z30.string().optional().describe("Mailing address"),
3085
- type: z30.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
3215
+ import { z as z31 } from "zod";
3216
+ var ContactSchema2 = z31.object({
3217
+ name: z31.string().optional().describe("Organization or person name"),
3218
+ phone: z31.string().optional().describe("Phone number"),
3219
+ email: z31.string().optional().describe("Email address"),
3220
+ address: z31.string().optional().describe("Mailing address"),
3221
+ type: z31.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
3086
3222
  });
3087
- var SupplementarySchema = z30.object({
3088
- regulatoryContacts: z30.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
3089
- claimsContacts: z30.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
3090
- thirdPartyAdministrators: z30.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
3091
- cancellationNoticeDays: z30.number().optional().describe("Required notice period for cancellation in days"),
3092
- nonrenewalNoticeDays: z30.number().optional().describe("Required notice period for nonrenewal in days")
3223
+ var SupplementarySchema = z31.object({
3224
+ regulatoryContacts: z31.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
3225
+ claimsContacts: z31.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
3226
+ thirdPartyAdministrators: z31.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
3227
+ cancellationNoticeDays: z31.number().optional().describe("Required notice period for cancellation in days"),
3228
+ nonrenewalNoticeDays: z31.number().optional().describe("Required notice period for nonrenewal in days")
3093
3229
  });
3094
3230
  function buildSupplementaryPrompt() {
3095
3231
  return `You are an expert insurance document analyst. Extract supplementary and regulatory information from this document.
@@ -3591,8 +3727,8 @@ Respond with JSON only:
3591
3727
  }`;
3592
3728
 
3593
3729
  // src/schemas/application.ts
3594
- import { z as z31 } from "zod";
3595
- var FieldTypeSchema = z31.enum([
3730
+ import { z as z32 } from "zod";
3731
+ var FieldTypeSchema = z32.enum([
3596
3732
  "text",
3597
3733
  "numeric",
3598
3734
  "currency",
@@ -3601,100 +3737,100 @@ var FieldTypeSchema = z31.enum([
3601
3737
  "table",
3602
3738
  "declaration"
3603
3739
  ]);
3604
- var ApplicationFieldSchema = z31.object({
3605
- id: z31.string(),
3606
- label: z31.string(),
3607
- section: z31.string(),
3740
+ var ApplicationFieldSchema = z32.object({
3741
+ id: z32.string(),
3742
+ label: z32.string(),
3743
+ section: z32.string(),
3608
3744
  fieldType: FieldTypeSchema,
3609
- required: z31.boolean(),
3610
- options: z31.array(z31.string()).optional(),
3611
- columns: z31.array(z31.string()).optional(),
3612
- requiresExplanationIfYes: z31.boolean().optional(),
3613
- condition: z31.object({
3614
- dependsOn: z31.string(),
3615
- whenValue: z31.string()
3745
+ required: z32.boolean(),
3746
+ options: z32.array(z32.string()).optional(),
3747
+ columns: z32.array(z32.string()).optional(),
3748
+ requiresExplanationIfYes: z32.boolean().optional(),
3749
+ condition: z32.object({
3750
+ dependsOn: z32.string(),
3751
+ whenValue: z32.string()
3616
3752
  }).optional(),
3617
- value: z31.string().optional(),
3618
- source: z31.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
3619
- confidence: z31.enum(["confirmed", "high", "medium", "low"]).optional()
3753
+ value: z32.string().optional(),
3754
+ source: z32.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
3755
+ confidence: z32.enum(["confirmed", "high", "medium", "low"]).optional()
3620
3756
  });
3621
- var ApplicationClassifyResultSchema = z31.object({
3622
- isApplication: z31.boolean(),
3623
- confidence: z31.number().min(0).max(1),
3624
- applicationType: z31.string().nullable()
3757
+ var ApplicationClassifyResultSchema = z32.object({
3758
+ isApplication: z32.boolean(),
3759
+ confidence: z32.number().min(0).max(1),
3760
+ applicationType: z32.string().nullable()
3625
3761
  });
3626
- var FieldExtractionResultSchema = z31.object({
3627
- fields: z31.array(ApplicationFieldSchema)
3762
+ var FieldExtractionResultSchema = z32.object({
3763
+ fields: z32.array(ApplicationFieldSchema)
3628
3764
  });
3629
- var AutoFillMatchSchema = z31.object({
3630
- fieldId: z31.string(),
3631
- value: z31.string(),
3632
- confidence: z31.enum(["confirmed"]),
3633
- contextKey: z31.string()
3765
+ var AutoFillMatchSchema = z32.object({
3766
+ fieldId: z32.string(),
3767
+ value: z32.string(),
3768
+ confidence: z32.enum(["confirmed"]),
3769
+ contextKey: z32.string()
3634
3770
  });
3635
- var AutoFillResultSchema = z31.object({
3636
- matches: z31.array(AutoFillMatchSchema)
3771
+ var AutoFillResultSchema = z32.object({
3772
+ matches: z32.array(AutoFillMatchSchema)
3637
3773
  });
3638
- var QuestionBatchResultSchema = z31.object({
3639
- batches: z31.array(z31.array(z31.string()).describe("Array of field IDs in this batch"))
3774
+ var QuestionBatchResultSchema = z32.object({
3775
+ batches: z32.array(z32.array(z32.string()).describe("Array of field IDs in this batch"))
3640
3776
  });
3641
- var LookupRequestSchema = z31.object({
3642
- type: z31.string().describe("Type of lookup: 'records', 'website', 'policy'"),
3643
- description: z31.string(),
3644
- url: z31.string().optional(),
3645
- targetFieldIds: z31.array(z31.string())
3777
+ var LookupRequestSchema = z32.object({
3778
+ type: z32.string().describe("Type of lookup: 'records', 'website', 'policy'"),
3779
+ description: z32.string(),
3780
+ url: z32.string().optional(),
3781
+ targetFieldIds: z32.array(z32.string())
3646
3782
  });
3647
- var ReplyIntentSchema = z31.object({
3648
- primaryIntent: z31.enum(["answers_only", "question", "lookup_request", "mixed"]),
3649
- hasAnswers: z31.boolean(),
3650
- questionText: z31.string().optional(),
3651
- questionFieldIds: z31.array(z31.string()).optional(),
3652
- lookupRequests: z31.array(LookupRequestSchema).optional()
3783
+ var ReplyIntentSchema = z32.object({
3784
+ primaryIntent: z32.enum(["answers_only", "question", "lookup_request", "mixed"]),
3785
+ hasAnswers: z32.boolean(),
3786
+ questionText: z32.string().optional(),
3787
+ questionFieldIds: z32.array(z32.string()).optional(),
3788
+ lookupRequests: z32.array(LookupRequestSchema).optional()
3653
3789
  });
3654
- var ParsedAnswerSchema = z31.object({
3655
- fieldId: z31.string(),
3656
- value: z31.string(),
3657
- explanation: z31.string().optional()
3790
+ var ParsedAnswerSchema = z32.object({
3791
+ fieldId: z32.string(),
3792
+ value: z32.string(),
3793
+ explanation: z32.string().optional()
3658
3794
  });
3659
- var AnswerParsingResultSchema = z31.object({
3660
- answers: z31.array(ParsedAnswerSchema),
3661
- unanswered: z31.array(z31.string()).describe("Field IDs that were not answered")
3795
+ var AnswerParsingResultSchema = z32.object({
3796
+ answers: z32.array(ParsedAnswerSchema),
3797
+ unanswered: z32.array(z32.string()).describe("Field IDs that were not answered")
3662
3798
  });
3663
- var LookupFillSchema = z31.object({
3664
- fieldId: z31.string(),
3665
- value: z31.string(),
3666
- source: z31.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
3799
+ var LookupFillSchema = z32.object({
3800
+ fieldId: z32.string(),
3801
+ value: z32.string(),
3802
+ source: z32.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
3667
3803
  });
3668
- var LookupFillResultSchema = z31.object({
3669
- fills: z31.array(LookupFillSchema),
3670
- unfillable: z31.array(z31.string()),
3671
- explanation: z31.string().optional()
3804
+ var LookupFillResultSchema = z32.object({
3805
+ fills: z32.array(LookupFillSchema),
3806
+ unfillable: z32.array(z32.string()),
3807
+ explanation: z32.string().optional()
3672
3808
  });
3673
- var FlatPdfPlacementSchema = z31.object({
3674
- fieldId: z31.string(),
3675
- page: z31.number(),
3676
- x: z31.number().describe("Percentage from left edge (0-100)"),
3677
- y: z31.number().describe("Percentage from top edge (0-100)"),
3678
- text: z31.string(),
3679
- fontSize: z31.number().optional(),
3680
- isCheckmark: z31.boolean().optional()
3809
+ var FlatPdfPlacementSchema = z32.object({
3810
+ fieldId: z32.string(),
3811
+ page: z32.number(),
3812
+ x: z32.number().describe("Percentage from left edge (0-100)"),
3813
+ y: z32.number().describe("Percentage from top edge (0-100)"),
3814
+ text: z32.string(),
3815
+ fontSize: z32.number().optional(),
3816
+ isCheckmark: z32.boolean().optional()
3681
3817
  });
3682
- var AcroFormMappingSchema = z31.object({
3683
- fieldId: z31.string(),
3684
- acroFormName: z31.string(),
3685
- value: z31.string()
3818
+ var AcroFormMappingSchema = z32.object({
3819
+ fieldId: z32.string(),
3820
+ acroFormName: z32.string(),
3821
+ value: z32.string()
3686
3822
  });
3687
- var ApplicationStateSchema = z31.object({
3688
- id: z31.string(),
3689
- pdfBase64: z31.string().optional().describe("Original PDF, omitted after extraction"),
3690
- title: z31.string().optional(),
3691
- applicationType: z31.string().nullable().optional(),
3692
- fields: z31.array(ApplicationFieldSchema),
3693
- batches: z31.array(z31.array(z31.string())).optional(),
3694
- currentBatchIndex: z31.number().default(0),
3695
- status: z31.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
3696
- createdAt: z31.number(),
3697
- updatedAt: z31.number()
3823
+ var ApplicationStateSchema = z32.object({
3824
+ id: z32.string(),
3825
+ pdfBase64: z32.string().optional().describe("Original PDF, omitted after extraction"),
3826
+ title: z32.string().optional(),
3827
+ applicationType: z32.string().nullable().optional(),
3828
+ fields: z32.array(ApplicationFieldSchema),
3829
+ batches: z32.array(z32.array(z32.string())).optional(),
3830
+ currentBatchIndex: z32.number().default(0),
3831
+ status: z32.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
3832
+ createdAt: z32.number(),
3833
+ updatedAt: z32.number()
3698
3834
  });
3699
3835
 
3700
3836
  // src/application/agents/classifier.ts
@@ -4722,73 +4858,73 @@ Respond with the final answer, deduplicated citations array, overall confidence
4722
4858
  }
4723
4859
 
4724
4860
  // src/schemas/query.ts
4725
- import { z as z32 } from "zod";
4726
- var QueryIntentSchema = z32.enum([
4861
+ import { z as z33 } from "zod";
4862
+ var QueryIntentSchema = z33.enum([
4727
4863
  "policy_question",
4728
4864
  "coverage_comparison",
4729
4865
  "document_search",
4730
4866
  "claims_inquiry",
4731
4867
  "general_knowledge"
4732
4868
  ]);
4733
- var SubQuestionSchema = z32.object({
4734
- question: z32.string().describe("Atomic sub-question to retrieve and answer independently"),
4869
+ var SubQuestionSchema = z33.object({
4870
+ question: z33.string().describe("Atomic sub-question to retrieve and answer independently"),
4735
4871
  intent: QueryIntentSchema,
4736
- chunkTypes: z32.array(z32.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
4737
- documentFilters: z32.object({
4738
- type: z32.enum(["policy", "quote"]).optional(),
4739
- carrier: z32.string().optional(),
4740
- insuredName: z32.string().optional(),
4741
- policyNumber: z32.string().optional(),
4742
- quoteNumber: z32.string().optional()
4872
+ chunkTypes: z33.array(z33.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
4873
+ documentFilters: z33.object({
4874
+ type: z33.enum(["policy", "quote"]).optional(),
4875
+ carrier: z33.string().optional(),
4876
+ insuredName: z33.string().optional(),
4877
+ policyNumber: z33.string().optional(),
4878
+ quoteNumber: z33.string().optional()
4743
4879
  }).optional().describe("Structured filters to narrow document lookup")
4744
4880
  });
4745
- var QueryClassifyResultSchema = z32.object({
4881
+ var QueryClassifyResultSchema = z33.object({
4746
4882
  intent: QueryIntentSchema,
4747
- subQuestions: z32.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
4748
- requiresDocumentLookup: z32.boolean().describe("Whether structured document lookup is needed"),
4749
- requiresChunkSearch: z32.boolean().describe("Whether semantic chunk search is needed"),
4750
- requiresConversationHistory: z32.boolean().describe("Whether conversation history is relevant")
4883
+ subQuestions: z33.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
4884
+ requiresDocumentLookup: z33.boolean().describe("Whether structured document lookup is needed"),
4885
+ requiresChunkSearch: z33.boolean().describe("Whether semantic chunk search is needed"),
4886
+ requiresConversationHistory: z33.boolean().describe("Whether conversation history is relevant")
4751
4887
  });
4752
- var EvidenceItemSchema = z32.object({
4753
- source: z32.enum(["chunk", "document", "conversation"]),
4754
- chunkId: z32.string().optional(),
4755
- documentId: z32.string().optional(),
4756
- turnId: z32.string().optional(),
4757
- text: z32.string().describe("Text excerpt from the source"),
4758
- relevance: z32.number().min(0).max(1),
4759
- metadata: z32.array(z32.object({ key: z32.string(), value: z32.string() })).optional()
4888
+ var EvidenceItemSchema = z33.object({
4889
+ source: z33.enum(["chunk", "document", "conversation"]),
4890
+ chunkId: z33.string().optional(),
4891
+ documentId: z33.string().optional(),
4892
+ turnId: z33.string().optional(),
4893
+ text: z33.string().describe("Text excerpt from the source"),
4894
+ relevance: z33.number().min(0).max(1),
4895
+ metadata: z33.array(z33.object({ key: z33.string(), value: z33.string() })).optional()
4760
4896
  });
4761
- var RetrievalResultSchema = z32.object({
4762
- subQuestion: z32.string(),
4763
- evidence: z32.array(EvidenceItemSchema)
4897
+ var RetrievalResultSchema = z33.object({
4898
+ subQuestion: z33.string(),
4899
+ evidence: z33.array(EvidenceItemSchema)
4764
4900
  });
4765
- var CitationSchema = z32.object({
4766
- index: z32.number().describe("Citation number [1], [2], etc."),
4767
- chunkId: z32.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
4768
- documentId: z32.string(),
4769
- documentType: z32.enum(["policy", "quote"]).optional(),
4770
- field: z32.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
4771
- quote: z32.string().describe("Exact text from source that supports the claim"),
4772
- relevance: z32.number().min(0).max(1)
4901
+ var CitationSchema = z33.object({
4902
+ index: z33.number().describe("Citation number [1], [2], etc."),
4903
+ chunkId: z33.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
4904
+ documentId: z33.string(),
4905
+ documentType: z33.enum(["policy", "quote"]).optional(),
4906
+ field: z33.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
4907
+ quote: z33.string().describe("Exact text from source that supports the claim"),
4908
+ relevance: z33.number().min(0).max(1)
4773
4909
  });
4774
- var SubAnswerSchema = z32.object({
4775
- subQuestion: z32.string(),
4776
- answer: z32.string(),
4777
- citations: z32.array(CitationSchema),
4778
- confidence: z32.number().min(0).max(1),
4779
- needsMoreContext: z32.boolean().describe("True if evidence was insufficient to answer fully")
4910
+ var SubAnswerSchema = z33.object({
4911
+ subQuestion: z33.string(),
4912
+ answer: z33.string(),
4913
+ citations: z33.array(CitationSchema),
4914
+ confidence: z33.number().min(0).max(1),
4915
+ needsMoreContext: z33.boolean().describe("True if evidence was insufficient to answer fully")
4780
4916
  });
4781
- var VerifyResultSchema = z32.object({
4782
- approved: z32.boolean().describe("Whether all sub-answers are adequately grounded"),
4783
- issues: z32.array(z32.string()).describe("Specific grounding or consistency issues found"),
4784
- retrySubQuestions: z32.array(z32.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
4917
+ var VerifyResultSchema = z33.object({
4918
+ approved: z33.boolean().describe("Whether all sub-answers are adequately grounded"),
4919
+ issues: z33.array(z33.string()).describe("Specific grounding or consistency issues found"),
4920
+ retrySubQuestions: z33.array(z33.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
4785
4921
  });
4786
- var QueryResultSchema = z32.object({
4787
- answer: z32.string(),
4788
- citations: z32.array(CitationSchema),
4922
+ var QueryResultSchema = z33.object({
4923
+ answer: z33.string(),
4924
+ citations: z33.array(CitationSchema),
4789
4925
  intent: QueryIntentSchema,
4790
- confidence: z32.number().min(0).max(1),
4791
- followUp: z32.string().optional().describe("Suggested follow-up question if applicable")
4926
+ confidence: z33.number().min(0).max(1),
4927
+ followUp: z33.string().optional().describe("Suggested follow-up question if applicable")
4792
4928
  });
4793
4929
 
4794
4930
  // src/query/retriever.ts
@@ -5669,6 +5805,7 @@ export {
5669
5805
  safeGenerateObject,
5670
5806
  sanitizeNulls,
5671
5807
  stripFences,
5808
+ toStrictSchema,
5672
5809
  withRetry
5673
5810
  };
5674
5811
  //# sourceMappingURL=index.mjs.map