@claritylabs/cl-sdk 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,16 +1,22 @@
1
1
  // src/core/retry.ts
2
2
  var MAX_RETRIES = 5;
3
3
  var BASE_DELAY_MS = 2e3;
4
- function isRateLimitError(error) {
4
+ function isRetryableError(error) {
5
5
  if (error instanceof Error) {
6
6
  const msg = error.message.toLowerCase();
7
7
  if (msg.includes("rate limit") || msg.includes("rate_limit") || msg.includes("too many requests")) {
8
8
  return true;
9
9
  }
10
+ if (msg.includes("grammar compilation timed out")) return true;
11
+ if (msg.includes("no output generated")) return true;
12
+ if (msg.includes("overloaded")) return true;
13
+ if (msg.includes("internal server error")) return true;
14
+ if (msg.includes("service unavailable")) return true;
15
+ if (msg.includes("gateway timeout")) return true;
10
16
  }
11
17
  if (typeof error === "object" && error !== null) {
12
18
  const status = error.status ?? error.statusCode;
13
- if (status === 429) return true;
19
+ if (status === 429 || status === 500 || status === 502 || status === 503 || status === 504) return true;
14
20
  }
15
21
  return false;
16
22
  }
@@ -19,12 +25,12 @@ async function withRetry(fn, log) {
19
25
  try {
20
26
  return await fn();
21
27
  } catch (error) {
22
- if (!isRateLimitError(error) || attempt >= MAX_RETRIES) {
28
+ if (!isRetryableError(error) || attempt >= MAX_RETRIES) {
23
29
  throw error;
24
30
  }
25
31
  const jitter = Math.random() * 1e3;
26
32
  const delay = BASE_DELAY_MS * Math.pow(2, attempt) + jitter;
27
- await log?.(`Rate limited, retrying in ${(delay / 1e3).toFixed(1)}s (attempt ${attempt + 1}/${MAX_RETRIES})...`);
33
+ await log?.(`Retryable error, retrying in ${(delay / 1e3).toFixed(1)}s (attempt ${attempt + 1}/${MAX_RETRIES})...`);
28
34
  await new Promise((resolve) => setTimeout(resolve, delay));
29
35
  }
30
36
  }
@@ -71,14 +77,59 @@ function sanitizeNulls(obj) {
71
77
  return obj;
72
78
  }
73
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
+ if (innerType) {
96
+ const transformed = toStrictSchema(innerType);
97
+ newShape[key] = z.nullable(transformed);
98
+ } else {
99
+ newShape[key] = z.nullable(field);
100
+ }
101
+ } else {
102
+ newShape[key] = toStrictSchema(field);
103
+ }
104
+ }
105
+ return z.object(newShape);
106
+ }
107
+ if (typeName === "array") {
108
+ const element = def?.element ?? schema.element;
109
+ if (element) {
110
+ return z.array(toStrictSchema(element));
111
+ }
112
+ return schema;
113
+ }
114
+ if (typeName === "nullable") {
115
+ const innerType = def?.innerType;
116
+ if (innerType) {
117
+ return z.nullable(toStrictSchema(innerType));
118
+ }
119
+ return schema;
120
+ }
121
+ return schema;
122
+ }
123
+
74
124
  // src/core/safe-generate.ts
75
125
  async function safeGenerateObject(generateObject, params, options) {
76
126
  const maxRetries = options?.maxRetries ?? 1;
77
127
  let lastError;
128
+ const strictParams = { ...params, schema: toStrictSchema(params.schema) };
78
129
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
79
130
  try {
80
131
  const result = await withRetry(
81
- () => generateObject(params),
132
+ () => generateObject(strictParams),
82
133
  options?.log
83
134
  );
84
135
  return result;
@@ -135,8 +186,8 @@ function createPipelineContext(opts) {
135
186
  }
136
187
 
137
188
  // src/schemas/enums.ts
138
- import { z } from "zod";
139
- var PolicyTypeSchema = z.enum([
189
+ import { z as z2 } from "zod";
190
+ var PolicyTypeSchema = z2.enum([
140
191
  // Commercial lines
141
192
  "general_liability",
142
193
  "commercial_property",
@@ -183,7 +234,7 @@ var PolicyTypeSchema = z.enum([
183
234
  "other"
184
235
  ]);
185
236
  var POLICY_TYPES = PolicyTypeSchema.options;
186
- var EndorsementTypeSchema = z.enum([
237
+ var EndorsementTypeSchema = z2.enum([
187
238
  "additional_insured",
188
239
  "waiver_of_subrogation",
189
240
  "primary_noncontributory",
@@ -204,7 +255,7 @@ var EndorsementTypeSchema = z.enum([
204
255
  "other"
205
256
  ]);
206
257
  var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
207
- var ConditionTypeSchema = z.enum([
258
+ var ConditionTypeSchema = z2.enum([
208
259
  "duties_after_loss",
209
260
  "notice_requirements",
210
261
  "other_insurance",
@@ -224,7 +275,7 @@ var ConditionTypeSchema = z.enum([
224
275
  "other"
225
276
  ]);
226
277
  var CONDITION_TYPES = ConditionTypeSchema.options;
227
- var PolicySectionTypeSchema = z.enum([
278
+ var PolicySectionTypeSchema = z2.enum([
228
279
  "declarations",
229
280
  "insuring_agreement",
230
281
  "policy_form",
@@ -239,7 +290,7 @@ var PolicySectionTypeSchema = z.enum([
239
290
  "other"
240
291
  ]);
241
292
  var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
242
- var QuoteSectionTypeSchema = z.enum([
293
+ var QuoteSectionTypeSchema = z2.enum([
243
294
  "terms_summary",
244
295
  "premium_indication",
245
296
  "underwriting_condition",
@@ -249,13 +300,13 @@ var QuoteSectionTypeSchema = z.enum([
249
300
  "other"
250
301
  ]);
251
302
  var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
252
- var CoverageFormSchema = z.enum(["occurrence", "claims_made", "accident"]);
303
+ var CoverageFormSchema = z2.enum(["occurrence", "claims_made", "accident"]);
253
304
  var COVERAGE_FORMS = CoverageFormSchema.options;
254
- var PolicyTermTypeSchema = z.enum(["fixed", "continuous"]);
305
+ var PolicyTermTypeSchema = z2.enum(["fixed", "continuous"]);
255
306
  var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
256
- var CoverageTriggerSchema = z.enum(["occurrence", "claims_made", "accident"]);
307
+ var CoverageTriggerSchema = z2.enum(["occurrence", "claims_made", "accident"]);
257
308
  var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
258
- var LimitTypeSchema = z.enum([
309
+ var LimitTypeSchema = z2.enum([
259
310
  "per_occurrence",
260
311
  "per_claim",
261
312
  "aggregate",
@@ -266,7 +317,7 @@ var LimitTypeSchema = z.enum([
266
317
  "scheduled"
267
318
  ]);
268
319
  var LIMIT_TYPES = LimitTypeSchema.options;
269
- var DeductibleTypeSchema = z.enum([
320
+ var DeductibleTypeSchema = z2.enum([
270
321
  "per_occurrence",
271
322
  "per_claim",
272
323
  "aggregate",
@@ -274,16 +325,16 @@ var DeductibleTypeSchema = z.enum([
274
325
  "waiting_period"
275
326
  ]);
276
327
  var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
277
- var ValuationMethodSchema = z.enum([
328
+ var ValuationMethodSchema = z2.enum([
278
329
  "replacement_cost",
279
330
  "actual_cash_value",
280
331
  "agreed_value",
281
332
  "functional_replacement"
282
333
  ]);
283
334
  var VALUATION_METHODS = ValuationMethodSchema.options;
284
- var DefenseCostTreatmentSchema = z.enum(["inside_limits", "outside_limits", "supplementary"]);
335
+ var DefenseCostTreatmentSchema = z2.enum(["inside_limits", "outside_limits", "supplementary"]);
285
336
  var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
286
- var EntityTypeSchema = z.enum([
337
+ var EntityTypeSchema = z2.enum([
287
338
  "corporation",
288
339
  "llc",
289
340
  "partnership",
@@ -297,9 +348,9 @@ var EntityTypeSchema = z.enum([
297
348
  "other"
298
349
  ]);
299
350
  var ENTITY_TYPES = EntityTypeSchema.options;
300
- var AdmittedStatusSchema = z.enum(["admitted", "non_admitted", "surplus_lines"]);
351
+ var AdmittedStatusSchema = z2.enum(["admitted", "non_admitted", "surplus_lines"]);
301
352
  var ADMITTED_STATUSES = AdmittedStatusSchema.options;
302
- var AuditTypeSchema = z.enum([
353
+ var AuditTypeSchema = z2.enum([
303
354
  "annual",
304
355
  "semi_annual",
305
356
  "quarterly",
@@ -309,7 +360,7 @@ var AuditTypeSchema = z.enum([
309
360
  "none"
310
361
  ]);
311
362
  var AUDIT_TYPES = AuditTypeSchema.options;
312
- var EndorsementPartyRoleSchema = z.enum([
363
+ var EndorsementPartyRoleSchema = z2.enum([
313
364
  "additional_insured",
314
365
  "loss_payee",
315
366
  "mortgage_holder",
@@ -318,13 +369,13 @@ var EndorsementPartyRoleSchema = z.enum([
318
369
  "other"
319
370
  ]);
320
371
  var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
321
- var ClaimStatusSchema = z.enum(["open", "closed", "reopened"]);
372
+ var ClaimStatusSchema = z2.enum(["open", "closed", "reopened"]);
322
373
  var CLAIM_STATUSES = ClaimStatusSchema.options;
323
- var SubjectivityCategorySchema = z.enum(["pre_binding", "post_binding", "information"]);
374
+ var SubjectivityCategorySchema = z2.enum(["pre_binding", "post_binding", "information"]);
324
375
  var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
325
- var DocumentTypeSchema = z.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
376
+ var DocumentTypeSchema = z2.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
326
377
  var DOCUMENT_TYPES = DocumentTypeSchema.options;
327
- var ChunkTypeSchema = z.enum([
378
+ var ChunkTypeSchema = z2.enum([
328
379
  "declarations",
329
380
  "coverage_form",
330
381
  "endorsement",
@@ -333,7 +384,7 @@ var ChunkTypeSchema = z.enum([
333
384
  "mixed"
334
385
  ]);
335
386
  var CHUNK_TYPES = ChunkTypeSchema.options;
336
- var RatingBasisTypeSchema = z.enum([
387
+ var RatingBasisTypeSchema = z2.enum([
337
388
  "payroll",
338
389
  "revenue",
339
390
  "area",
@@ -347,7 +398,7 @@ var RatingBasisTypeSchema = z.enum([
347
398
  "other"
348
399
  ]);
349
400
  var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
350
- var VehicleCoverageTypeSchema = z.enum([
401
+ var VehicleCoverageTypeSchema = z2.enum([
351
402
  "liability",
352
403
  "collision",
353
404
  "comprehensive",
@@ -360,32 +411,32 @@ var VehicleCoverageTypeSchema = z.enum([
360
411
  "physical_damage"
361
412
  ]);
362
413
  var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
363
- var HomeownersFormTypeSchema = z.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
414
+ var HomeownersFormTypeSchema = z2.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
364
415
  var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
365
- var DwellingFireFormTypeSchema = z.enum(["DP-1", "DP-2", "DP-3"]);
416
+ var DwellingFireFormTypeSchema = z2.enum(["DP-1", "DP-2", "DP-3"]);
366
417
  var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
367
- var FloodZoneSchema = z.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
418
+ var FloodZoneSchema = z2.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
368
419
  var FLOOD_ZONES = FloodZoneSchema.options;
369
- var ConstructionTypeSchema = z.enum(["frame", "masonry", "superior", "mixed", "other"]);
420
+ var ConstructionTypeSchema = z2.enum(["frame", "masonry", "superior", "mixed", "other"]);
370
421
  var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
371
- var RoofTypeSchema = z.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
422
+ var RoofTypeSchema = z2.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
372
423
  var ROOF_TYPES = RoofTypeSchema.options;
373
- var FoundationTypeSchema = z.enum(["basement", "crawl_space", "slab", "pier", "other"]);
424
+ var FoundationTypeSchema = z2.enum(["basement", "crawl_space", "slab", "pier", "other"]);
374
425
  var FOUNDATION_TYPES = FoundationTypeSchema.options;
375
- var PersonalAutoUsageSchema = z.enum(["pleasure", "commute", "business", "farm"]);
426
+ var PersonalAutoUsageSchema = z2.enum(["pleasure", "commute", "business", "farm"]);
376
427
  var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
377
- var LossSettlementSchema = z.enum([
428
+ var LossSettlementSchema = z2.enum([
378
429
  "replacement_cost",
379
430
  "actual_cash_value",
380
431
  "extended_replacement_cost",
381
432
  "guaranteed_replacement_cost"
382
433
  ]);
383
434
  var LOSS_SETTLEMENTS = LossSettlementSchema.options;
384
- var BoatTypeSchema = z.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
435
+ var BoatTypeSchema = z2.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
385
436
  var BOAT_TYPES = BoatTypeSchema.options;
386
- var RVTypeSchema = z.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
437
+ var RVTypeSchema = z2.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
387
438
  var RV_TYPES = RVTypeSchema.options;
388
- var ScheduledItemCategorySchema = z.enum([
439
+ var ScheduledItemCategorySchema = z2.enum([
389
440
  "jewelry",
390
441
  "fine_art",
391
442
  "musical_instruments",
@@ -398,691 +449,691 @@ var ScheduledItemCategorySchema = z.enum([
398
449
  "other"
399
450
  ]);
400
451
  var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
401
- var TitlePolicyTypeSchema = z.enum(["owners", "lenders"]);
452
+ var TitlePolicyTypeSchema = z2.enum(["owners", "lenders"]);
402
453
  var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
403
- var PetSpeciesSchema = z.enum(["dog", "cat", "other"]);
454
+ var PetSpeciesSchema = z2.enum(["dog", "cat", "other"]);
404
455
  var PET_SPECIES = PetSpeciesSchema.options;
405
456
 
406
457
  // src/schemas/shared.ts
407
- import { z as z2 } from "zod";
408
- var AddressSchema = z2.object({
409
- street1: z2.string(),
410
- street2: z2.string().optional(),
411
- city: z2.string(),
412
- state: z2.string(),
413
- zip: z2.string(),
414
- country: z2.string().optional()
458
+ import { z as z3 } from "zod";
459
+ var AddressSchema = z3.object({
460
+ street1: z3.string(),
461
+ street2: z3.string().optional(),
462
+ city: z3.string(),
463
+ state: z3.string(),
464
+ zip: z3.string(),
465
+ country: z3.string().optional()
415
466
  });
416
- var ContactSchema = z2.object({
417
- name: z2.string().optional(),
418
- title: z2.string().optional(),
419
- type: z2.string().optional(),
420
- phone: z2.string().optional(),
421
- fax: z2.string().optional(),
422
- email: z2.string().optional(),
467
+ var ContactSchema = z3.object({
468
+ name: z3.string().optional(),
469
+ title: z3.string().optional(),
470
+ type: z3.string().optional(),
471
+ phone: z3.string().optional(),
472
+ fax: z3.string().optional(),
473
+ email: z3.string().optional(),
423
474
  address: AddressSchema.optional(),
424
- hours: z2.string().optional()
475
+ hours: z3.string().optional()
425
476
  });
426
- var FormReferenceSchema = z2.object({
427
- formNumber: z2.string(),
428
- editionDate: z2.string().optional(),
429
- title: z2.string().optional(),
430
- formType: z2.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
477
+ var FormReferenceSchema = z3.object({
478
+ formNumber: z3.string(),
479
+ editionDate: z3.string().optional(),
480
+ title: z3.string().optional(),
481
+ formType: z3.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
431
482
  });
432
- var TaxFeeItemSchema = z2.object({
433
- name: z2.string(),
434
- amount: z2.string(),
435
- type: z2.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
436
- description: z2.string().optional()
483
+ var TaxFeeItemSchema = z3.object({
484
+ name: z3.string(),
485
+ amount: z3.string(),
486
+ type: z3.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
487
+ description: z3.string().optional()
437
488
  });
438
- var RatingBasisSchema = z2.object({
489
+ var RatingBasisSchema = z3.object({
439
490
  type: RatingBasisTypeSchema,
440
- amount: z2.string().optional(),
441
- description: z2.string().optional()
491
+ amount: z3.string().optional(),
492
+ description: z3.string().optional()
442
493
  });
443
- var SublimitSchema = z2.object({
444
- name: z2.string(),
445
- limit: z2.string(),
446
- appliesTo: z2.string().optional(),
447
- deductible: z2.string().optional()
494
+ var SublimitSchema = z3.object({
495
+ name: z3.string(),
496
+ limit: z3.string(),
497
+ appliesTo: z3.string().optional(),
498
+ deductible: z3.string().optional()
448
499
  });
449
- var SharedLimitSchema = z2.object({
450
- description: z2.string(),
451
- limit: z2.string(),
452
- coverageParts: z2.array(z2.string())
500
+ var SharedLimitSchema = z3.object({
501
+ description: z3.string(),
502
+ limit: z3.string(),
503
+ coverageParts: z3.array(z3.string())
453
504
  });
454
- var ExtendedReportingPeriodSchema = z2.object({
455
- basicDays: z2.number().optional(),
456
- supplementalYears: z2.number().optional(),
457
- supplementalPremium: z2.string().optional()
505
+ var ExtendedReportingPeriodSchema = z3.object({
506
+ basicDays: z3.number().optional(),
507
+ supplementalYears: z3.number().optional(),
508
+ supplementalPremium: z3.string().optional()
458
509
  });
459
- var NamedInsuredSchema = z2.object({
460
- name: z2.string(),
461
- relationship: z2.string().optional(),
510
+ var NamedInsuredSchema = z3.object({
511
+ name: z3.string(),
512
+ relationship: z3.string().optional(),
462
513
  address: AddressSchema.optional()
463
514
  });
464
515
 
465
516
  // src/schemas/coverage.ts
466
- import { z as z3 } from "zod";
467
- var CoverageSchema = z3.object({
468
- name: z3.string(),
469
- limit: z3.string(),
470
- deductible: z3.string().optional(),
471
- pageNumber: z3.number().optional(),
472
- sectionRef: z3.string().optional()
517
+ import { z as z4 } from "zod";
518
+ var CoverageSchema = z4.object({
519
+ name: z4.string(),
520
+ limit: z4.string(),
521
+ deductible: z4.string().optional(),
522
+ pageNumber: z4.number().optional(),
523
+ sectionRef: z4.string().optional()
473
524
  });
474
- var EnrichedCoverageSchema = z3.object({
475
- name: z3.string(),
476
- coverageCode: z3.string().optional(),
477
- formNumber: z3.string().optional(),
478
- formEditionDate: z3.string().optional(),
479
- limit: z3.string(),
525
+ var EnrichedCoverageSchema = z4.object({
526
+ name: z4.string(),
527
+ coverageCode: z4.string().optional(),
528
+ formNumber: z4.string().optional(),
529
+ formEditionDate: z4.string().optional(),
530
+ limit: z4.string(),
480
531
  limitType: LimitTypeSchema.optional(),
481
- deductible: z3.string().optional(),
532
+ deductible: z4.string().optional(),
482
533
  deductibleType: DeductibleTypeSchema.optional(),
483
- sir: z3.string().optional(),
484
- sublimit: z3.string().optional(),
485
- coinsurance: z3.string().optional(),
534
+ sir: z4.string().optional(),
535
+ sublimit: z4.string().optional(),
536
+ coinsurance: z4.string().optional(),
486
537
  valuation: ValuationMethodSchema.optional(),
487
- territory: z3.string().optional(),
538
+ territory: z4.string().optional(),
488
539
  trigger: CoverageTriggerSchema.optional(),
489
- retroactiveDate: z3.string().optional(),
490
- included: z3.boolean(),
491
- premium: z3.string().optional(),
492
- pageNumber: z3.number().optional(),
493
- sectionRef: z3.string().optional()
540
+ retroactiveDate: z4.string().optional(),
541
+ included: z4.boolean(),
542
+ premium: z4.string().optional(),
543
+ pageNumber: z4.number().optional(),
544
+ sectionRef: z4.string().optional()
494
545
  });
495
546
 
496
547
  // src/schemas/endorsement.ts
497
- import { z as z4 } from "zod";
498
- var EndorsementPartySchema = z4.object({
499
- name: z4.string(),
548
+ import { z as z5 } from "zod";
549
+ var EndorsementPartySchema = z5.object({
550
+ name: z5.string(),
500
551
  role: EndorsementPartyRoleSchema,
501
552
  address: AddressSchema.optional(),
502
- relationship: z4.string().optional(),
503
- scope: z4.string().optional()
553
+ relationship: z5.string().optional(),
554
+ scope: z5.string().optional()
504
555
  });
505
- var EndorsementSchema = z4.object({
506
- formNumber: z4.string(),
507
- editionDate: z4.string().optional(),
508
- title: z4.string(),
556
+ var EndorsementSchema = z5.object({
557
+ formNumber: z5.string(),
558
+ editionDate: z5.string().optional(),
559
+ title: z5.string(),
509
560
  endorsementType: EndorsementTypeSchema,
510
- effectiveDate: z4.string().optional(),
511
- affectedCoverageParts: z4.array(z4.string()).optional(),
512
- namedParties: z4.array(EndorsementPartySchema).optional(),
513
- keyTerms: z4.array(z4.string()).optional(),
514
- premiumImpact: z4.string().optional(),
515
- content: z4.string(),
516
- pageStart: z4.number(),
517
- pageEnd: z4.number().optional()
561
+ effectiveDate: z5.string().optional(),
562
+ affectedCoverageParts: z5.array(z5.string()).optional(),
563
+ namedParties: z5.array(EndorsementPartySchema).optional(),
564
+ keyTerms: z5.array(z5.string()).optional(),
565
+ premiumImpact: z5.string().optional(),
566
+ content: z5.string(),
567
+ pageStart: z5.number(),
568
+ pageEnd: z5.number().optional()
518
569
  });
519
570
 
520
571
  // src/schemas/exclusion.ts
521
- import { z as z5 } from "zod";
522
- var ExclusionSchema = z5.object({
523
- name: z5.string(),
524
- formNumber: z5.string().optional(),
525
- excludedPerils: z5.array(z5.string()).optional(),
526
- isAbsolute: z5.boolean().optional(),
527
- exceptions: z5.array(z5.string()).optional(),
528
- buybackAvailable: z5.boolean().optional(),
529
- buybackEndorsement: z5.string().optional(),
530
- appliesTo: z5.array(z5.string()).optional(),
531
- content: z5.string(),
532
- pageNumber: z5.number().optional()
572
+ import { z as z6 } from "zod";
573
+ var ExclusionSchema = z6.object({
574
+ name: z6.string(),
575
+ formNumber: z6.string().optional(),
576
+ excludedPerils: z6.array(z6.string()).optional(),
577
+ isAbsolute: z6.boolean().optional(),
578
+ exceptions: z6.array(z6.string()).optional(),
579
+ buybackAvailable: z6.boolean().optional(),
580
+ buybackEndorsement: z6.string().optional(),
581
+ appliesTo: z6.array(z6.string()).optional(),
582
+ content: z6.string(),
583
+ pageNumber: z6.number().optional()
533
584
  });
534
585
 
535
586
  // src/schemas/condition.ts
536
- import { z as z6 } from "zod";
537
- var ConditionKeyValueSchema = z6.object({
538
- key: z6.string(),
539
- value: z6.string()
587
+ import { z as z7 } from "zod";
588
+ var ConditionKeyValueSchema = z7.object({
589
+ key: z7.string(),
590
+ value: z7.string()
540
591
  });
541
- var PolicyConditionSchema = z6.object({
542
- name: z6.string(),
592
+ var PolicyConditionSchema = z7.object({
593
+ name: z7.string(),
543
594
  conditionType: ConditionTypeSchema,
544
- content: z6.string(),
545
- keyValues: z6.array(ConditionKeyValueSchema).optional(),
546
- pageNumber: z6.number().optional()
595
+ content: z7.string(),
596
+ keyValues: z7.array(ConditionKeyValueSchema).optional(),
597
+ pageNumber: z7.number().optional()
547
598
  });
548
599
 
549
600
  // src/schemas/parties.ts
550
- import { z as z7 } from "zod";
551
- var InsurerInfoSchema = z7.object({
552
- legalName: z7.string(),
553
- naicNumber: z7.string().optional(),
554
- amBestRating: z7.string().optional(),
555
- amBestNumber: z7.string().optional(),
601
+ import { z as z8 } from "zod";
602
+ var InsurerInfoSchema = z8.object({
603
+ legalName: z8.string(),
604
+ naicNumber: z8.string().optional(),
605
+ amBestRating: z8.string().optional(),
606
+ amBestNumber: z8.string().optional(),
556
607
  admittedStatus: AdmittedStatusSchema.optional(),
557
- stateOfDomicile: z7.string().optional()
608
+ stateOfDomicile: z8.string().optional()
558
609
  });
559
- var ProducerInfoSchema = z7.object({
560
- agencyName: z7.string(),
561
- contactName: z7.string().optional(),
562
- licenseNumber: z7.string().optional(),
563
- phone: z7.string().optional(),
564
- email: z7.string().optional(),
610
+ var ProducerInfoSchema = z8.object({
611
+ agencyName: z8.string(),
612
+ contactName: z8.string().optional(),
613
+ licenseNumber: z8.string().optional(),
614
+ phone: z8.string().optional(),
615
+ email: z8.string().optional(),
565
616
  address: AddressSchema.optional()
566
617
  });
567
618
 
568
619
  // src/schemas/financial.ts
569
- import { z as z8 } from "zod";
570
- var PaymentInstallmentSchema = z8.object({
571
- dueDate: z8.string(),
572
- amount: z8.string(),
573
- description: z8.string().optional()
620
+ import { z as z9 } from "zod";
621
+ var PaymentInstallmentSchema = z9.object({
622
+ dueDate: z9.string(),
623
+ amount: z9.string(),
624
+ description: z9.string().optional()
574
625
  });
575
- var PaymentPlanSchema = z8.object({
576
- installments: z8.array(PaymentInstallmentSchema),
577
- financeCharge: z8.string().optional()
626
+ var PaymentPlanSchema = z9.object({
627
+ installments: z9.array(PaymentInstallmentSchema),
628
+ financeCharge: z9.string().optional()
578
629
  });
579
- var LocationPremiumSchema = z8.object({
580
- locationNumber: z8.number(),
581
- premium: z8.string(),
582
- description: z8.string().optional()
630
+ var LocationPremiumSchema = z9.object({
631
+ locationNumber: z9.number(),
632
+ premium: z9.string(),
633
+ description: z9.string().optional()
583
634
  });
584
635
 
585
636
  // src/schemas/loss-history.ts
586
- import { z as z9 } from "zod";
587
- var ClaimRecordSchema = z9.object({
588
- dateOfLoss: z9.string(),
589
- claimNumber: z9.string().optional(),
590
- description: z9.string(),
637
+ import { z as z10 } from "zod";
638
+ var ClaimRecordSchema = z10.object({
639
+ dateOfLoss: z10.string(),
640
+ claimNumber: z10.string().optional(),
641
+ description: z10.string(),
591
642
  status: ClaimStatusSchema,
592
- paid: z9.string().optional(),
593
- reserved: z9.string().optional(),
594
- incurred: z9.string().optional(),
595
- claimant: z9.string().optional(),
596
- coverageLine: z9.string().optional()
643
+ paid: z10.string().optional(),
644
+ reserved: z10.string().optional(),
645
+ incurred: z10.string().optional(),
646
+ claimant: z10.string().optional(),
647
+ coverageLine: z10.string().optional()
597
648
  });
598
- var LossSummarySchema = z9.object({
599
- period: z9.string().optional(),
600
- totalClaims: z9.number().optional(),
601
- totalIncurred: z9.string().optional(),
602
- totalPaid: z9.string().optional(),
603
- totalReserved: z9.string().optional(),
604
- lossRatio: z9.string().optional()
649
+ var LossSummarySchema = z10.object({
650
+ period: z10.string().optional(),
651
+ totalClaims: z10.number().optional(),
652
+ totalIncurred: z10.string().optional(),
653
+ totalPaid: z10.string().optional(),
654
+ totalReserved: z10.string().optional(),
655
+ lossRatio: z10.string().optional()
605
656
  });
606
- var ExperienceModSchema = z9.object({
607
- factor: z9.number(),
608
- effectiveDate: z9.string().optional(),
609
- state: z9.string().optional()
657
+ var ExperienceModSchema = z10.object({
658
+ factor: z10.number(),
659
+ effectiveDate: z10.string().optional(),
660
+ state: z10.string().optional()
610
661
  });
611
662
 
612
663
  // src/schemas/underwriting.ts
613
- import { z as z10 } from "zod";
614
- var EnrichedSubjectivitySchema = z10.object({
615
- description: z10.string(),
664
+ import { z as z11 } from "zod";
665
+ var EnrichedSubjectivitySchema = z11.object({
666
+ description: z11.string(),
616
667
  category: SubjectivityCategorySchema.optional(),
617
- dueDate: z10.string().optional(),
618
- status: z10.enum(["open", "satisfied", "waived"]).optional(),
619
- pageNumber: z10.number().optional()
668
+ dueDate: z11.string().optional(),
669
+ status: z11.enum(["open", "satisfied", "waived"]).optional(),
670
+ pageNumber: z11.number().optional()
620
671
  });
621
- var EnrichedUnderwritingConditionSchema = z10.object({
622
- description: z10.string(),
623
- category: z10.string().optional(),
624
- pageNumber: z10.number().optional()
672
+ var EnrichedUnderwritingConditionSchema = z11.object({
673
+ description: z11.string(),
674
+ category: z11.string().optional(),
675
+ pageNumber: z11.number().optional()
625
676
  });
626
- var BindingAuthoritySchema = z10.object({
627
- authorizedBy: z10.string().optional(),
628
- method: z10.string().optional(),
629
- expiration: z10.string().optional(),
630
- conditions: z10.array(z10.string()).optional()
677
+ var BindingAuthoritySchema = z11.object({
678
+ authorizedBy: z11.string().optional(),
679
+ method: z11.string().optional(),
680
+ expiration: z11.string().optional(),
681
+ conditions: z11.array(z11.string()).optional()
631
682
  });
632
683
 
633
684
  // src/schemas/declarations/index.ts
634
- import { z as z14 } from "zod";
685
+ import { z as z15 } from "zod";
635
686
 
636
687
  // src/schemas/declarations/personal.ts
637
- import { z as z12 } from "zod";
688
+ import { z as z13 } from "zod";
638
689
 
639
690
  // src/schemas/declarations/shared.ts
640
- import { z as z11 } from "zod";
641
- var EmployersLiabilityLimitsSchema = z11.object({
642
- eachAccident: z11.string(),
643
- diseasePolicyLimit: z11.string(),
644
- diseaseEachEmployee: z11.string()
691
+ import { z as z12 } from "zod";
692
+ var EmployersLiabilityLimitsSchema = z12.object({
693
+ eachAccident: z12.string(),
694
+ diseasePolicyLimit: z12.string(),
695
+ diseaseEachEmployee: z12.string()
645
696
  });
646
- var LimitScheduleSchema = z11.object({
647
- perOccurrence: z11.string().optional(),
648
- generalAggregate: z11.string().optional(),
649
- productsCompletedOpsAggregate: z11.string().optional(),
650
- personalAdvertisingInjury: z11.string().optional(),
651
- eachEmployee: z11.string().optional(),
652
- fireDamage: z11.string().optional(),
653
- medicalExpense: z11.string().optional(),
654
- combinedSingleLimit: z11.string().optional(),
655
- bodilyInjuryPerPerson: z11.string().optional(),
656
- bodilyInjuryPerAccident: z11.string().optional(),
657
- propertyDamage: z11.string().optional(),
658
- eachOccurrenceUmbrella: z11.string().optional(),
659
- umbrellaAggregate: z11.string().optional(),
660
- umbrellaRetention: z11.string().optional(),
661
- statutory: z11.boolean().optional(),
697
+ var LimitScheduleSchema = z12.object({
698
+ perOccurrence: z12.string().optional(),
699
+ generalAggregate: z12.string().optional(),
700
+ productsCompletedOpsAggregate: z12.string().optional(),
701
+ personalAdvertisingInjury: z12.string().optional(),
702
+ eachEmployee: z12.string().optional(),
703
+ fireDamage: z12.string().optional(),
704
+ medicalExpense: z12.string().optional(),
705
+ combinedSingleLimit: z12.string().optional(),
706
+ bodilyInjuryPerPerson: z12.string().optional(),
707
+ bodilyInjuryPerAccident: z12.string().optional(),
708
+ propertyDamage: z12.string().optional(),
709
+ eachOccurrenceUmbrella: z12.string().optional(),
710
+ umbrellaAggregate: z12.string().optional(),
711
+ umbrellaRetention: z12.string().optional(),
712
+ statutory: z12.boolean().optional(),
662
713
  employersLiability: EmployersLiabilityLimitsSchema.optional(),
663
- sublimits: z11.array(SublimitSchema).optional(),
664
- sharedLimits: z11.array(SharedLimitSchema).optional(),
714
+ sublimits: z12.array(SublimitSchema).optional(),
715
+ sharedLimits: z12.array(SharedLimitSchema).optional(),
665
716
  defenseCostTreatment: DefenseCostTreatmentSchema.optional()
666
717
  });
667
- var DeductibleScheduleSchema = z11.object({
668
- perClaim: z11.string().optional(),
669
- perOccurrence: z11.string().optional(),
670
- aggregateDeductible: z11.string().optional(),
671
- selfInsuredRetention: z11.string().optional(),
672
- corridorDeductible: z11.string().optional(),
673
- waitingPeriod: z11.string().optional(),
674
- appliesTo: z11.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
718
+ var DeductibleScheduleSchema = z12.object({
719
+ perClaim: z12.string().optional(),
720
+ perOccurrence: z12.string().optional(),
721
+ aggregateDeductible: z12.string().optional(),
722
+ selfInsuredRetention: z12.string().optional(),
723
+ corridorDeductible: z12.string().optional(),
724
+ waitingPeriod: z12.string().optional(),
725
+ appliesTo: z12.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
675
726
  });
676
- var InsuredLocationSchema = z11.object({
677
- number: z11.number(),
727
+ var InsuredLocationSchema = z12.object({
728
+ number: z12.number(),
678
729
  address: AddressSchema,
679
- description: z11.string().optional(),
680
- buildingValue: z11.string().optional(),
681
- contentsValue: z11.string().optional(),
682
- businessIncomeValue: z11.string().optional(),
683
- constructionType: z11.string().optional(),
684
- yearBuilt: z11.number().optional(),
685
- squareFootage: z11.number().optional(),
686
- protectionClass: z11.string().optional(),
687
- sprinklered: z11.boolean().optional(),
688
- alarmType: z11.string().optional(),
689
- occupancy: z11.string().optional()
730
+ description: z12.string().optional(),
731
+ buildingValue: z12.string().optional(),
732
+ contentsValue: z12.string().optional(),
733
+ businessIncomeValue: z12.string().optional(),
734
+ constructionType: z12.string().optional(),
735
+ yearBuilt: z12.number().optional(),
736
+ squareFootage: z12.number().optional(),
737
+ protectionClass: z12.string().optional(),
738
+ sprinklered: z12.boolean().optional(),
739
+ alarmType: z12.string().optional(),
740
+ occupancy: z12.string().optional()
690
741
  });
691
- var VehicleCoverageSchema = z11.object({
742
+ var VehicleCoverageSchema = z12.object({
692
743
  type: VehicleCoverageTypeSchema,
693
- limit: z11.string().optional(),
694
- deductible: z11.string().optional(),
695
- included: z11.boolean()
744
+ limit: z12.string().optional(),
745
+ deductible: z12.string().optional(),
746
+ included: z12.boolean()
696
747
  });
697
- var InsuredVehicleSchema = z11.object({
698
- number: z11.number(),
699
- year: z11.number(),
700
- make: z11.string(),
701
- model: z11.string(),
702
- vin: z11.string(),
703
- costNew: z11.string().optional(),
704
- statedValue: z11.string().optional(),
705
- garageLocation: z11.number().optional(),
706
- coverages: z11.array(VehicleCoverageSchema).optional(),
707
- radius: z11.string().optional(),
708
- vehicleType: z11.string().optional()
748
+ var InsuredVehicleSchema = z12.object({
749
+ number: z12.number(),
750
+ year: z12.number(),
751
+ make: z12.string(),
752
+ model: z12.string(),
753
+ vin: z12.string(),
754
+ costNew: z12.string().optional(),
755
+ statedValue: z12.string().optional(),
756
+ garageLocation: z12.number().optional(),
757
+ coverages: z12.array(VehicleCoverageSchema).optional(),
758
+ radius: z12.string().optional(),
759
+ vehicleType: z12.string().optional()
709
760
  });
710
- var ClassificationCodeSchema = z11.object({
711
- code: z11.string(),
712
- description: z11.string(),
713
- premiumBasis: z11.string(),
714
- basisAmount: z11.string().optional(),
715
- rate: z11.string().optional(),
716
- premium: z11.string().optional(),
717
- locationNumber: z11.number().optional()
761
+ var ClassificationCodeSchema = z12.object({
762
+ code: z12.string(),
763
+ description: z12.string(),
764
+ premiumBasis: z12.string(),
765
+ basisAmount: z12.string().optional(),
766
+ rate: z12.string().optional(),
767
+ premium: z12.string().optional(),
768
+ locationNumber: z12.number().optional()
718
769
  });
719
- var DwellingDetailsSchema = z11.object({
770
+ var DwellingDetailsSchema = z12.object({
720
771
  constructionType: ConstructionTypeSchema.optional(),
721
- yearBuilt: z11.number().optional(),
722
- squareFootage: z11.number().optional(),
723
- stories: z11.number().optional(),
772
+ yearBuilt: z12.number().optional(),
773
+ squareFootage: z12.number().optional(),
774
+ stories: z12.number().optional(),
724
775
  roofType: RoofTypeSchema.optional(),
725
- roofAge: z11.number().optional(),
726
- heatingType: z11.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
776
+ roofAge: z12.number().optional(),
777
+ heatingType: z12.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
727
778
  foundationType: FoundationTypeSchema.optional(),
728
- plumbingType: z11.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
729
- electricalType: z11.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
730
- electricalAmps: z11.number().optional(),
731
- hasSwimmingPool: z11.boolean().optional(),
732
- poolType: z11.enum(["in_ground", "above_ground"]).optional(),
733
- hasTrampoline: z11.boolean().optional(),
734
- hasDog: z11.boolean().optional(),
735
- dogBreed: z11.string().optional(),
736
- protectiveDevices: z11.array(z11.string()).optional(),
737
- distanceToFireStation: z11.string().optional(),
738
- distanceToHydrant: z11.string().optional(),
739
- fireProtectionClass: z11.string().optional()
779
+ plumbingType: z12.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
780
+ electricalType: z12.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
781
+ electricalAmps: z12.number().optional(),
782
+ hasSwimmingPool: z12.boolean().optional(),
783
+ poolType: z12.enum(["in_ground", "above_ground"]).optional(),
784
+ hasTrampoline: z12.boolean().optional(),
785
+ hasDog: z12.boolean().optional(),
786
+ dogBreed: z12.string().optional(),
787
+ protectiveDevices: z12.array(z12.string()).optional(),
788
+ distanceToFireStation: z12.string().optional(),
789
+ distanceToHydrant: z12.string().optional(),
790
+ fireProtectionClass: z12.string().optional()
740
791
  });
741
- var DriverRecordSchema = z11.object({
742
- name: z11.string(),
743
- dateOfBirth: z11.string().optional(),
744
- licenseNumber: z11.string().optional(),
745
- licenseState: z11.string().optional(),
746
- relationship: z11.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
747
- yearsLicensed: z11.number().optional(),
748
- gender: z11.string().optional(),
749
- maritalStatus: z11.string().optional(),
750
- goodStudentDiscount: z11.boolean().optional(),
751
- defensiveDriverDiscount: z11.boolean().optional(),
752
- violations: z11.array(z11.object({
753
- date: z11.string().optional(),
754
- type: z11.string().optional(),
755
- description: z11.string().optional()
792
+ var DriverRecordSchema = z12.object({
793
+ name: z12.string(),
794
+ dateOfBirth: z12.string().optional(),
795
+ licenseNumber: z12.string().optional(),
796
+ licenseState: z12.string().optional(),
797
+ relationship: z12.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
798
+ yearsLicensed: z12.number().optional(),
799
+ gender: z12.string().optional(),
800
+ maritalStatus: z12.string().optional(),
801
+ goodStudentDiscount: z12.boolean().optional(),
802
+ defensiveDriverDiscount: z12.boolean().optional(),
803
+ violations: z12.array(z12.object({
804
+ date: z12.string().optional(),
805
+ type: z12.string().optional(),
806
+ description: z12.string().optional()
756
807
  })).optional(),
757
- accidents: z11.array(z11.object({
758
- date: z11.string().optional(),
759
- atFault: z11.boolean().optional(),
760
- description: z11.string().optional(),
761
- amountPaid: z11.string().optional()
808
+ accidents: z12.array(z12.object({
809
+ date: z12.string().optional(),
810
+ atFault: z12.boolean().optional(),
811
+ description: z12.string().optional(),
812
+ amountPaid: z12.string().optional()
762
813
  })).optional(),
763
- sr22Required: z11.boolean().optional()
814
+ sr22Required: z12.boolean().optional()
764
815
  });
765
- var PersonalVehicleDetailsSchema = z11.object({
766
- number: z11.number().optional(),
767
- year: z11.number().optional(),
768
- make: z11.string().optional(),
769
- model: z11.string().optional(),
770
- vin: z11.string().optional(),
771
- bodyType: z11.string().optional(),
816
+ var PersonalVehicleDetailsSchema = z12.object({
817
+ number: z12.number().optional(),
818
+ year: z12.number().optional(),
819
+ make: z12.string().optional(),
820
+ model: z12.string().optional(),
821
+ vin: z12.string().optional(),
822
+ bodyType: z12.string().optional(),
772
823
  garagingAddress: AddressSchema.optional(),
773
824
  usage: PersonalAutoUsageSchema.optional(),
774
- annualMileage: z11.number().optional(),
775
- odometerReading: z11.number().optional(),
776
- driverAssignment: z11.string().optional(),
825
+ annualMileage: z12.number().optional(),
826
+ odometerReading: z12.number().optional(),
827
+ driverAssignment: z12.string().optional(),
777
828
  lienHolder: EndorsementPartySchema.optional(),
778
- collisionDeductible: z11.string().optional(),
779
- comprehensiveDeductible: z11.string().optional(),
780
- rentalReimbursement: z11.boolean().optional(),
781
- towing: z11.boolean().optional()
829
+ collisionDeductible: z12.string().optional(),
830
+ comprehensiveDeductible: z12.string().optional(),
831
+ rentalReimbursement: z12.boolean().optional(),
832
+ towing: z12.boolean().optional()
782
833
  });
783
834
 
784
835
  // src/schemas/declarations/personal.ts
785
- var HomeownersDeclarationsSchema = z12.object({
786
- line: z12.literal("homeowners"),
836
+ var HomeownersDeclarationsSchema = z13.object({
837
+ line: z13.literal("homeowners"),
787
838
  formType: HomeownersFormTypeSchema,
788
- coverageA: z12.string().optional(),
789
- coverageB: z12.string().optional(),
790
- coverageC: z12.string().optional(),
791
- coverageD: z12.string().optional(),
792
- coverageE: z12.string().optional(),
793
- coverageF: z12.string().optional(),
794
- allPerilDeductible: z12.string().optional(),
795
- windHailDeductible: z12.string().optional(),
796
- hurricaneDeductible: z12.string().optional(),
839
+ coverageA: z13.string().optional(),
840
+ coverageB: z13.string().optional(),
841
+ coverageC: z13.string().optional(),
842
+ coverageD: z13.string().optional(),
843
+ coverageE: z13.string().optional(),
844
+ coverageF: z13.string().optional(),
845
+ allPerilDeductible: z13.string().optional(),
846
+ windHailDeductible: z13.string().optional(),
847
+ hurricaneDeductible: z13.string().optional(),
797
848
  lossSettlement: LossSettlementSchema.optional(),
798
849
  dwelling: DwellingDetailsSchema,
799
850
  mortgagee: EndorsementPartySchema.optional(),
800
- additionalMortgagees: z12.array(EndorsementPartySchema).optional()
851
+ additionalMortgagees: z13.array(EndorsementPartySchema).optional()
801
852
  });
802
- var PersonalAutoDeclarationsSchema = z12.object({
803
- line: z12.literal("personal_auto"),
804
- vehicles: z12.array(PersonalVehicleDetailsSchema),
805
- drivers: z12.array(DriverRecordSchema),
806
- liabilityLimits: z12.object({
807
- bodilyInjuryPerPerson: z12.string().optional(),
808
- bodilyInjuryPerAccident: z12.string().optional(),
809
- propertyDamage: z12.string().optional(),
810
- combinedSingleLimit: z12.string().optional()
853
+ var PersonalAutoDeclarationsSchema = z13.object({
854
+ line: z13.literal("personal_auto"),
855
+ vehicles: z13.array(PersonalVehicleDetailsSchema),
856
+ drivers: z13.array(DriverRecordSchema),
857
+ liabilityLimits: z13.object({
858
+ bodilyInjuryPerPerson: z13.string().optional(),
859
+ bodilyInjuryPerAccident: z13.string().optional(),
860
+ propertyDamage: z13.string().optional(),
861
+ combinedSingleLimit: z13.string().optional()
811
862
  }).optional(),
812
- umLimits: z12.object({
813
- bodilyInjuryPerPerson: z12.string().optional(),
814
- bodilyInjuryPerAccident: z12.string().optional()
863
+ umLimits: z13.object({
864
+ bodilyInjuryPerPerson: z13.string().optional(),
865
+ bodilyInjuryPerAccident: z13.string().optional()
815
866
  }).optional(),
816
- uimLimits: z12.object({
817
- bodilyInjuryPerPerson: z12.string().optional(),
818
- bodilyInjuryPerAccident: z12.string().optional()
867
+ uimLimits: z13.object({
868
+ bodilyInjuryPerPerson: z13.string().optional(),
869
+ bodilyInjuryPerAccident: z13.string().optional()
819
870
  }).optional(),
820
- pipLimit: z12.string().optional(),
821
- medPayLimit: z12.string().optional()
871
+ pipLimit: z13.string().optional(),
872
+ medPayLimit: z13.string().optional()
822
873
  });
823
- var DwellingFireDeclarationsSchema = z12.object({
824
- line: z12.literal("dwelling_fire"),
874
+ var DwellingFireDeclarationsSchema = z13.object({
875
+ line: z13.literal("dwelling_fire"),
825
876
  formType: DwellingFireFormTypeSchema,
826
- dwellingLimit: z12.string().optional(),
827
- otherStructuresLimit: z12.string().optional(),
828
- personalPropertyLimit: z12.string().optional(),
829
- fairRentalValueLimit: z12.string().optional(),
830
- liabilityLimit: z12.string().optional(),
831
- medicalPaymentsLimit: z12.string().optional(),
832
- deductible: z12.string().optional(),
877
+ dwellingLimit: z13.string().optional(),
878
+ otherStructuresLimit: z13.string().optional(),
879
+ personalPropertyLimit: z13.string().optional(),
880
+ fairRentalValueLimit: z13.string().optional(),
881
+ liabilityLimit: z13.string().optional(),
882
+ medicalPaymentsLimit: z13.string().optional(),
883
+ deductible: z13.string().optional(),
833
884
  dwelling: DwellingDetailsSchema
834
885
  });
835
- var FloodDeclarationsSchema = z12.object({
836
- line: z12.literal("flood"),
837
- programType: z12.enum(["nfip", "private"]),
886
+ var FloodDeclarationsSchema = z13.object({
887
+ line: z13.literal("flood"),
888
+ programType: z13.enum(["nfip", "private"]),
838
889
  floodZone: FloodZoneSchema.optional(),
839
- communityNumber: z12.string().optional(),
840
- communityRating: z12.number().optional(),
841
- buildingCoverage: z12.string().optional(),
842
- contentsCoverage: z12.string().optional(),
843
- iccCoverage: z12.string().optional(),
844
- deductible: z12.string().optional(),
845
- waitingPeriodDays: z12.number().optional(),
846
- elevationCertificate: z12.boolean().optional(),
847
- elevationDifference: z12.string().optional(),
848
- buildingDiagramNumber: z12.number().optional(),
849
- basementOrEnclosure: z12.boolean().optional(),
850
- postFirmConstruction: z12.boolean().optional()
890
+ communityNumber: z13.string().optional(),
891
+ communityRating: z13.number().optional(),
892
+ buildingCoverage: z13.string().optional(),
893
+ contentsCoverage: z13.string().optional(),
894
+ iccCoverage: z13.string().optional(),
895
+ deductible: z13.string().optional(),
896
+ waitingPeriodDays: z13.number().optional(),
897
+ elevationCertificate: z13.boolean().optional(),
898
+ elevationDifference: z13.string().optional(),
899
+ buildingDiagramNumber: z13.number().optional(),
900
+ basementOrEnclosure: z13.boolean().optional(),
901
+ postFirmConstruction: z13.boolean().optional()
851
902
  });
852
- var EarthquakeDeclarationsSchema = z12.object({
853
- line: z12.literal("earthquake"),
854
- dwellingCoverage: z12.string().optional(),
855
- contentsCoverage: z12.string().optional(),
856
- lossOfUseCoverage: z12.string().optional(),
857
- deductiblePercent: z12.number().optional(),
858
- retrofitDiscount: z12.boolean().optional(),
859
- masonryVeneerCoverage: z12.boolean().optional()
903
+ var EarthquakeDeclarationsSchema = z13.object({
904
+ line: z13.literal("earthquake"),
905
+ dwellingCoverage: z13.string().optional(),
906
+ contentsCoverage: z13.string().optional(),
907
+ lossOfUseCoverage: z13.string().optional(),
908
+ deductiblePercent: z13.number().optional(),
909
+ retrofitDiscount: z13.boolean().optional(),
910
+ masonryVeneerCoverage: z13.boolean().optional()
860
911
  });
861
- var PersonalUmbrellaDeclarationsSchema = z12.object({
862
- line: z12.literal("personal_umbrella"),
863
- perOccurrenceLimit: z12.string().optional(),
864
- aggregateLimit: z12.string().optional(),
865
- retainedLimit: z12.string().optional(),
866
- underlyingPolicies: z12.array(z12.object({
867
- carrier: z12.string().optional(),
868
- policyNumber: z12.string().optional(),
869
- policyType: z12.string().optional(),
870
- limits: z12.string().optional()
912
+ var PersonalUmbrellaDeclarationsSchema = z13.object({
913
+ line: z13.literal("personal_umbrella"),
914
+ perOccurrenceLimit: z13.string().optional(),
915
+ aggregateLimit: z13.string().optional(),
916
+ retainedLimit: z13.string().optional(),
917
+ underlyingPolicies: z13.array(z13.object({
918
+ carrier: z13.string().optional(),
919
+ policyNumber: z13.string().optional(),
920
+ policyType: z13.string().optional(),
921
+ limits: z13.string().optional()
871
922
  }))
872
923
  });
873
- var PersonalArticlesDeclarationsSchema = z12.object({
874
- line: z12.literal("personal_articles"),
875
- scheduledItems: z12.array(z12.object({
876
- itemNumber: z12.number().optional(),
924
+ var PersonalArticlesDeclarationsSchema = z13.object({
925
+ line: z13.literal("personal_articles"),
926
+ scheduledItems: z13.array(z13.object({
927
+ itemNumber: z13.number().optional(),
877
928
  category: ScheduledItemCategorySchema.optional(),
878
- description: z12.string(),
879
- appraisedValue: z12.string(),
880
- appraisalDate: z12.string().optional()
929
+ description: z13.string(),
930
+ appraisedValue: z13.string(),
931
+ appraisalDate: z13.string().optional()
881
932
  })),
882
- blanketCoverage: z12.string().optional(),
883
- deductible: z12.string().optional(),
884
- worldwideCoverage: z12.boolean().optional(),
885
- breakageCoverage: z12.boolean().optional()
933
+ blanketCoverage: z13.string().optional(),
934
+ deductible: z13.string().optional(),
935
+ worldwideCoverage: z13.boolean().optional(),
936
+ breakageCoverage: z13.boolean().optional()
886
937
  });
887
- var WatercraftDeclarationsSchema = z12.object({
888
- line: z12.literal("watercraft"),
938
+ var WatercraftDeclarationsSchema = z13.object({
939
+ line: z13.literal("watercraft"),
889
940
  boatType: BoatTypeSchema.optional(),
890
- year: z12.number().optional(),
891
- make: z12.string().optional(),
892
- model: z12.string().optional(),
893
- length: z12.string().optional(),
894
- hullMaterial: z12.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
895
- hullValue: z12.string().optional(),
896
- motorHorsepower: z12.number().optional(),
897
- motorType: z12.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
898
- navigationLimits: z12.string().optional(),
899
- layupPeriod: z12.string().optional(),
900
- liabilityLimit: z12.string().optional(),
901
- medicalPaymentsLimit: z12.string().optional(),
902
- physicalDamageDeductible: z12.string().optional(),
903
- uninsuredBoaterLimit: z12.string().optional(),
904
- trailerCovered: z12.boolean().optional(),
905
- trailerValue: z12.string().optional()
941
+ year: z13.number().optional(),
942
+ make: z13.string().optional(),
943
+ model: z13.string().optional(),
944
+ length: z13.string().optional(),
945
+ hullMaterial: z13.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
946
+ hullValue: z13.string().optional(),
947
+ motorHorsepower: z13.number().optional(),
948
+ motorType: z13.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
949
+ navigationLimits: z13.string().optional(),
950
+ layupPeriod: z13.string().optional(),
951
+ liabilityLimit: z13.string().optional(),
952
+ medicalPaymentsLimit: z13.string().optional(),
953
+ physicalDamageDeductible: z13.string().optional(),
954
+ uninsuredBoaterLimit: z13.string().optional(),
955
+ trailerCovered: z13.boolean().optional(),
956
+ trailerValue: z13.string().optional()
906
957
  });
907
- var RecreationalVehicleDeclarationsSchema = z12.object({
908
- line: z12.literal("recreational_vehicle"),
958
+ var RecreationalVehicleDeclarationsSchema = z13.object({
959
+ line: z13.literal("recreational_vehicle"),
909
960
  vehicleType: RVTypeSchema,
910
- year: z12.number().optional(),
911
- make: z12.string().optional(),
912
- model: z12.string().optional(),
913
- vin: z12.string().optional(),
914
- value: z12.string().optional(),
915
- liabilityLimit: z12.string().optional(),
916
- collisionDeductible: z12.string().optional(),
917
- comprehensiveDeductible: z12.string().optional(),
918
- personalEffectsCoverage: z12.string().optional(),
919
- fullTimerCoverage: z12.boolean().optional()
961
+ year: z13.number().optional(),
962
+ make: z13.string().optional(),
963
+ model: z13.string().optional(),
964
+ vin: z13.string().optional(),
965
+ value: z13.string().optional(),
966
+ liabilityLimit: z13.string().optional(),
967
+ collisionDeductible: z13.string().optional(),
968
+ comprehensiveDeductible: z13.string().optional(),
969
+ personalEffectsCoverage: z13.string().optional(),
970
+ fullTimerCoverage: z13.boolean().optional()
920
971
  });
921
- var FarmRanchDeclarationsSchema = z12.object({
922
- line: z12.literal("farm_ranch"),
923
- dwellingCoverage: z12.string().optional(),
924
- farmPersonalPropertyCoverage: z12.string().optional(),
925
- farmLiabilityLimit: z12.string().optional(),
926
- farmAutoIncluded: z12.boolean().optional(),
927
- livestock: z12.array(z12.object({
928
- type: z12.string(),
929
- headCount: z12.number(),
930
- value: z12.string().optional()
972
+ var FarmRanchDeclarationsSchema = z13.object({
973
+ line: z13.literal("farm_ranch"),
974
+ dwellingCoverage: z13.string().optional(),
975
+ farmPersonalPropertyCoverage: z13.string().optional(),
976
+ farmLiabilityLimit: z13.string().optional(),
977
+ farmAutoIncluded: z13.boolean().optional(),
978
+ livestock: z13.array(z13.object({
979
+ type: z13.string(),
980
+ headCount: z13.number(),
981
+ value: z13.string().optional()
931
982
  })).optional(),
932
- equipmentSchedule: z12.array(z12.object({
933
- description: z12.string(),
934
- value: z12.string()
983
+ equipmentSchedule: z13.array(z13.object({
984
+ description: z13.string(),
985
+ value: z13.string()
935
986
  })).optional(),
936
- acreage: z12.number().optional(),
987
+ acreage: z13.number().optional(),
937
988
  dwelling: DwellingDetailsSchema.optional()
938
989
  });
939
- var TitleDeclarationsSchema = z12.object({
940
- line: z12.literal("title"),
990
+ var TitleDeclarationsSchema = z13.object({
991
+ line: z13.literal("title"),
941
992
  policyType: TitlePolicyTypeSchema,
942
- policyAmount: z12.string(),
943
- legalDescription: z12.string().optional(),
993
+ policyAmount: z13.string(),
994
+ legalDescription: z13.string().optional(),
944
995
  propertyAddress: AddressSchema.optional(),
945
- effectiveDate: z12.string().optional(),
946
- exceptions: z12.array(z12.object({
947
- number: z12.number(),
948
- description: z12.string()
996
+ effectiveDate: z13.string().optional(),
997
+ exceptions: z13.array(z13.object({
998
+ number: z13.number(),
999
+ description: z13.string()
949
1000
  })).optional(),
950
- underwriter: z12.string().optional()
1001
+ underwriter: z13.string().optional()
951
1002
  });
952
- var PetDeclarationsSchema = z12.object({
953
- line: z12.literal("pet"),
1003
+ var PetDeclarationsSchema = z13.object({
1004
+ line: z13.literal("pet"),
954
1005
  species: PetSpeciesSchema,
955
- breed: z12.string().optional(),
956
- petName: z12.string().optional(),
957
- age: z12.number().optional(),
958
- annualLimit: z12.string().optional(),
959
- perIncidentLimit: z12.string().optional(),
960
- deductible: z12.string().optional(),
961
- reimbursementPercent: z12.number().optional(),
962
- waitingPeriodDays: z12.number().optional(),
963
- preExistingConditionsExcluded: z12.boolean().optional(),
964
- wellnessCoverage: z12.boolean().optional()
1006
+ breed: z13.string().optional(),
1007
+ petName: z13.string().optional(),
1008
+ age: z13.number().optional(),
1009
+ annualLimit: z13.string().optional(),
1010
+ perIncidentLimit: z13.string().optional(),
1011
+ deductible: z13.string().optional(),
1012
+ reimbursementPercent: z13.number().optional(),
1013
+ waitingPeriodDays: z13.number().optional(),
1014
+ preExistingConditionsExcluded: z13.boolean().optional(),
1015
+ wellnessCoverage: z13.boolean().optional()
965
1016
  });
966
- var TravelDeclarationsSchema = z12.object({
967
- line: z12.literal("travel"),
968
- tripDepartureDate: z12.string().optional(),
969
- tripReturnDate: z12.string().optional(),
970
- destinations: z12.array(z12.string()).optional(),
971
- travelers: z12.array(z12.object({
972
- name: z12.string(),
973
- age: z12.number().optional()
1017
+ var TravelDeclarationsSchema = z13.object({
1018
+ line: z13.literal("travel"),
1019
+ tripDepartureDate: z13.string().optional(),
1020
+ tripReturnDate: z13.string().optional(),
1021
+ destinations: z13.array(z13.string()).optional(),
1022
+ travelers: z13.array(z13.object({
1023
+ name: z13.string(),
1024
+ age: z13.number().optional()
974
1025
  })).optional(),
975
- tripCost: z12.string().optional(),
976
- tripCancellationLimit: z12.string().optional(),
977
- medicalLimit: z12.string().optional(),
978
- evacuationLimit: z12.string().optional(),
979
- baggageLimit: z12.string().optional()
1026
+ tripCost: z13.string().optional(),
1027
+ tripCancellationLimit: z13.string().optional(),
1028
+ medicalLimit: z13.string().optional(),
1029
+ evacuationLimit: z13.string().optional(),
1030
+ baggageLimit: z13.string().optional()
980
1031
  });
981
- var IdentityTheftDeclarationsSchema = z12.object({
982
- line: z12.literal("identity_theft"),
983
- coverageLimit: z12.string().optional(),
984
- expenseReimbursement: z12.string().optional(),
985
- creditMonitoring: z12.boolean().optional(),
986
- restorationServices: z12.boolean().optional(),
987
- lostWagesLimit: z12.string().optional()
1032
+ var IdentityTheftDeclarationsSchema = z13.object({
1033
+ line: z13.literal("identity_theft"),
1034
+ coverageLimit: z13.string().optional(),
1035
+ expenseReimbursement: z13.string().optional(),
1036
+ creditMonitoring: z13.boolean().optional(),
1037
+ restorationServices: z13.boolean().optional(),
1038
+ lostWagesLimit: z13.string().optional()
988
1039
  });
989
1040
 
990
1041
  // src/schemas/declarations/commercial.ts
991
- import { z as z13 } from "zod";
992
- var GLDeclarationsSchema = z13.object({
993
- line: z13.literal("gl"),
1042
+ import { z as z14 } from "zod";
1043
+ var GLDeclarationsSchema = z14.object({
1044
+ line: z14.literal("gl"),
994
1045
  coverageForm: CoverageFormSchema.optional(),
995
- perOccurrenceLimit: z13.string().optional(),
996
- generalAggregate: z13.string().optional(),
997
- productsCompletedOpsAggregate: z13.string().optional(),
998
- personalAdvertisingInjury: z13.string().optional(),
999
- fireDamage: z13.string().optional(),
1000
- medicalExpense: z13.string().optional(),
1046
+ perOccurrenceLimit: z14.string().optional(),
1047
+ generalAggregate: z14.string().optional(),
1048
+ productsCompletedOpsAggregate: z14.string().optional(),
1049
+ personalAdvertisingInjury: z14.string().optional(),
1050
+ fireDamage: z14.string().optional(),
1051
+ medicalExpense: z14.string().optional(),
1001
1052
  defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
1002
- deductible: z13.string().optional(),
1003
- classifications: z13.array(ClassificationCodeSchema).optional(),
1004
- retroactiveDate: z13.string().optional()
1053
+ deductible: z14.string().optional(),
1054
+ classifications: z14.array(ClassificationCodeSchema).optional(),
1055
+ retroactiveDate: z14.string().optional()
1005
1056
  });
1006
- var CommercialPropertyDeclarationsSchema = z13.object({
1007
- line: z13.literal("commercial_property"),
1008
- causesOfLossForm: z13.enum(["basic", "broad", "special"]).optional(),
1009
- coinsurancePercent: z13.number().optional(),
1057
+ var CommercialPropertyDeclarationsSchema = z14.object({
1058
+ line: z14.literal("commercial_property"),
1059
+ causesOfLossForm: z14.enum(["basic", "broad", "special"]).optional(),
1060
+ coinsurancePercent: z14.number().optional(),
1010
1061
  valuationMethod: ValuationMethodSchema.optional(),
1011
- locations: z13.array(InsuredLocationSchema),
1012
- blanketLimit: z13.string().optional(),
1013
- businessIncomeLimit: z13.string().optional(),
1014
- extraExpenseLimit: z13.string().optional()
1062
+ locations: z14.array(InsuredLocationSchema),
1063
+ blanketLimit: z14.string().optional(),
1064
+ businessIncomeLimit: z14.string().optional(),
1065
+ extraExpenseLimit: z14.string().optional()
1015
1066
  });
1016
- var CommercialAutoDeclarationsSchema = z13.object({
1017
- line: z13.literal("commercial_auto"),
1018
- vehicles: z13.array(InsuredVehicleSchema),
1019
- coveredAutoSymbols: z13.array(z13.number()).optional(),
1020
- liabilityLimit: z13.string().optional(),
1021
- umLimit: z13.string().optional(),
1022
- uimLimit: z13.string().optional(),
1023
- hiredAutoLiability: z13.boolean().optional(),
1024
- nonOwnedAutoLiability: z13.boolean().optional()
1067
+ var CommercialAutoDeclarationsSchema = z14.object({
1068
+ line: z14.literal("commercial_auto"),
1069
+ vehicles: z14.array(InsuredVehicleSchema),
1070
+ coveredAutoSymbols: z14.array(z14.number()).optional(),
1071
+ liabilityLimit: z14.string().optional(),
1072
+ umLimit: z14.string().optional(),
1073
+ uimLimit: z14.string().optional(),
1074
+ hiredAutoLiability: z14.boolean().optional(),
1075
+ nonOwnedAutoLiability: z14.boolean().optional()
1025
1076
  });
1026
- var WorkersCompDeclarationsSchema = z13.object({
1027
- line: z13.literal("workers_comp"),
1028
- coveredStates: z13.array(z13.string()).optional(),
1029
- classifications: z13.array(ClassificationCodeSchema),
1077
+ var WorkersCompDeclarationsSchema = z14.object({
1078
+ line: z14.literal("workers_comp"),
1079
+ coveredStates: z14.array(z14.string()).optional(),
1080
+ classifications: z14.array(ClassificationCodeSchema),
1030
1081
  experienceMod: ExperienceModSchema.optional(),
1031
1082
  employersLiability: EmployersLiabilityLimitsSchema.optional()
1032
1083
  });
1033
- var UmbrellaExcessDeclarationsSchema = z13.object({
1034
- line: z13.literal("umbrella_excess"),
1035
- perOccurrenceLimit: z13.string().optional(),
1036
- aggregateLimit: z13.string().optional(),
1037
- retention: z13.string().optional(),
1038
- underlyingPolicies: z13.array(z13.object({
1039
- carrier: z13.string().optional(),
1040
- policyNumber: z13.string().optional(),
1041
- policyType: z13.string().optional(),
1042
- limits: z13.string().optional()
1084
+ var UmbrellaExcessDeclarationsSchema = z14.object({
1085
+ line: z14.literal("umbrella_excess"),
1086
+ perOccurrenceLimit: z14.string().optional(),
1087
+ aggregateLimit: z14.string().optional(),
1088
+ retention: z14.string().optional(),
1089
+ underlyingPolicies: z14.array(z14.object({
1090
+ carrier: z14.string().optional(),
1091
+ policyNumber: z14.string().optional(),
1092
+ policyType: z14.string().optional(),
1093
+ limits: z14.string().optional()
1043
1094
  }))
1044
1095
  });
1045
- var ProfessionalLiabilityDeclarationsSchema = z13.object({
1046
- line: z13.literal("professional_liability"),
1047
- perClaimLimit: z13.string().optional(),
1048
- aggregateLimit: z13.string().optional(),
1049
- retroactiveDate: z13.string().optional(),
1096
+ var ProfessionalLiabilityDeclarationsSchema = z14.object({
1097
+ line: z14.literal("professional_liability"),
1098
+ perClaimLimit: z14.string().optional(),
1099
+ aggregateLimit: z14.string().optional(),
1100
+ retroactiveDate: z14.string().optional(),
1050
1101
  defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
1051
1102
  extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
1052
1103
  });
1053
- var CyberDeclarationsSchema = z13.object({
1054
- line: z13.literal("cyber"),
1055
- aggregateLimit: z13.string().optional(),
1056
- retroactiveDate: z13.string().optional(),
1057
- waitingPeriodHours: z13.number().optional(),
1058
- sublimits: z13.array(z13.object({
1059
- coverageName: z13.string(),
1060
- limit: z13.string()
1104
+ var CyberDeclarationsSchema = z14.object({
1105
+ line: z14.literal("cyber"),
1106
+ aggregateLimit: z14.string().optional(),
1107
+ retroactiveDate: z14.string().optional(),
1108
+ waitingPeriodHours: z14.number().optional(),
1109
+ sublimits: z14.array(z14.object({
1110
+ coverageName: z14.string(),
1111
+ limit: z14.string()
1061
1112
  })).optional()
1062
1113
  });
1063
- var DODeclarationsSchema = z13.object({
1064
- line: z13.literal("directors_officers"),
1065
- sideALimit: z13.string().optional(),
1066
- sideBLimit: z13.string().optional(),
1067
- sideCLimit: z13.string().optional(),
1068
- sideARetention: z13.string().optional(),
1069
- sideBRetention: z13.string().optional(),
1070
- sideCRetention: z13.string().optional(),
1071
- continuityDate: z13.string().optional()
1114
+ var DODeclarationsSchema = z14.object({
1115
+ line: z14.literal("directors_officers"),
1116
+ sideALimit: z14.string().optional(),
1117
+ sideBLimit: z14.string().optional(),
1118
+ sideCLimit: z14.string().optional(),
1119
+ sideARetention: z14.string().optional(),
1120
+ sideBRetention: z14.string().optional(),
1121
+ sideCRetention: z14.string().optional(),
1122
+ continuityDate: z14.string().optional()
1072
1123
  });
1073
- var CrimeDeclarationsSchema = z13.object({
1074
- line: z13.literal("crime"),
1075
- formType: z13.enum(["discovery", "loss_sustained"]).optional(),
1076
- agreements: z13.array(z13.object({
1077
- agreement: z13.string(),
1078
- coverageName: z13.string(),
1079
- limit: z13.string(),
1080
- deductible: z13.string()
1124
+ var CrimeDeclarationsSchema = z14.object({
1125
+ line: z14.literal("crime"),
1126
+ formType: z14.enum(["discovery", "loss_sustained"]).optional(),
1127
+ agreements: z14.array(z14.object({
1128
+ agreement: z14.string(),
1129
+ coverageName: z14.string(),
1130
+ limit: z14.string(),
1131
+ deductible: z14.string()
1081
1132
  }))
1082
1133
  });
1083
1134
 
1084
1135
  // src/schemas/declarations/index.ts
1085
- var DeclarationsSchema = z14.discriminatedUnion("line", [
1136
+ var DeclarationsSchema = z15.discriminatedUnion("line", [
1086
1137
  // Personal lines
1087
1138
  HomeownersDeclarationsSchema,
1088
1139
  PersonalAutoDeclarationsSchema,
@@ -1111,137 +1162,137 @@ var DeclarationsSchema = z14.discriminatedUnion("line", [
1111
1162
  ]);
1112
1163
 
1113
1164
  // src/schemas/document.ts
1114
- import { z as z15 } from "zod";
1115
- var SubsectionSchema = z15.object({
1116
- title: z15.string(),
1117
- sectionNumber: z15.string().optional(),
1118
- pageNumber: z15.number().optional(),
1119
- content: z15.string()
1165
+ import { z as z16 } from "zod";
1166
+ var SubsectionSchema = z16.object({
1167
+ title: z16.string(),
1168
+ sectionNumber: z16.string().optional(),
1169
+ pageNumber: z16.number().optional(),
1170
+ content: z16.string()
1120
1171
  });
1121
- var SectionSchema = z15.object({
1122
- title: z15.string(),
1123
- sectionNumber: z15.string().optional(),
1124
- pageStart: z15.number(),
1125
- pageEnd: z15.number().optional(),
1126
- type: z15.string(),
1127
- coverageType: z15.string().optional(),
1128
- content: z15.string(),
1129
- subsections: z15.array(SubsectionSchema).optional()
1172
+ var SectionSchema = z16.object({
1173
+ title: z16.string(),
1174
+ sectionNumber: z16.string().optional(),
1175
+ pageStart: z16.number(),
1176
+ pageEnd: z16.number().optional(),
1177
+ type: z16.string(),
1178
+ coverageType: z16.string().optional(),
1179
+ content: z16.string(),
1180
+ subsections: z16.array(SubsectionSchema).optional()
1130
1181
  });
1131
- var SubjectivitySchema = z15.object({
1132
- description: z15.string(),
1133
- category: z15.string().optional()
1182
+ var SubjectivitySchema = z16.object({
1183
+ description: z16.string(),
1184
+ category: z16.string().optional()
1134
1185
  });
1135
- var UnderwritingConditionSchema = z15.object({
1136
- description: z15.string()
1186
+ var UnderwritingConditionSchema = z16.object({
1187
+ description: z16.string()
1137
1188
  });
1138
- var PremiumLineSchema = z15.object({
1139
- line: z15.string(),
1140
- amount: z15.string()
1189
+ var PremiumLineSchema = z16.object({
1190
+ line: z16.string(),
1191
+ amount: z16.string()
1141
1192
  });
1142
1193
  var BaseDocumentFields = {
1143
- id: z15.string(),
1144
- carrier: z15.string(),
1145
- security: z15.string().optional(),
1146
- insuredName: z15.string(),
1147
- premium: z15.string().optional(),
1148
- summary: z15.string().optional(),
1149
- policyTypes: z15.array(z15.string()).optional(),
1150
- coverages: z15.array(CoverageSchema),
1151
- sections: z15.array(SectionSchema).optional(),
1194
+ id: z16.string(),
1195
+ carrier: z16.string(),
1196
+ security: z16.string().optional(),
1197
+ insuredName: z16.string(),
1198
+ premium: z16.string().optional(),
1199
+ summary: z16.string().optional(),
1200
+ policyTypes: z16.array(z16.string()).optional(),
1201
+ coverages: z16.array(CoverageSchema),
1202
+ sections: z16.array(SectionSchema).optional(),
1152
1203
  // Enriched fields (v1.2+)
1153
- carrierLegalName: z15.string().optional(),
1154
- carrierNaicNumber: z15.string().optional(),
1155
- carrierAmBestRating: z15.string().optional(),
1156
- carrierAdmittedStatus: z15.string().optional(),
1157
- mga: z15.string().optional(),
1158
- underwriter: z15.string().optional(),
1159
- brokerAgency: z15.string().optional(),
1160
- brokerContactName: z15.string().optional(),
1161
- brokerLicenseNumber: z15.string().optional(),
1162
- priorPolicyNumber: z15.string().optional(),
1163
- programName: z15.string().optional(),
1164
- isRenewal: z15.boolean().optional(),
1165
- isPackage: z15.boolean().optional(),
1166
- insuredDba: z15.string().optional(),
1204
+ carrierLegalName: z16.string().optional(),
1205
+ carrierNaicNumber: z16.string().optional(),
1206
+ carrierAmBestRating: z16.string().optional(),
1207
+ carrierAdmittedStatus: z16.string().optional(),
1208
+ mga: z16.string().optional(),
1209
+ underwriter: z16.string().optional(),
1210
+ brokerAgency: z16.string().optional(),
1211
+ brokerContactName: z16.string().optional(),
1212
+ brokerLicenseNumber: z16.string().optional(),
1213
+ priorPolicyNumber: z16.string().optional(),
1214
+ programName: z16.string().optional(),
1215
+ isRenewal: z16.boolean().optional(),
1216
+ isPackage: z16.boolean().optional(),
1217
+ insuredDba: z16.string().optional(),
1167
1218
  insuredAddress: AddressSchema.optional(),
1168
1219
  insuredEntityType: EntityTypeSchema.optional(),
1169
- additionalNamedInsureds: z15.array(NamedInsuredSchema).optional(),
1170
- insuredSicCode: z15.string().optional(),
1171
- insuredNaicsCode: z15.string().optional(),
1172
- insuredFein: z15.string().optional(),
1173
- enrichedCoverages: z15.array(EnrichedCoverageSchema).optional(),
1174
- endorsements: z15.array(EndorsementSchema).optional(),
1175
- exclusions: z15.array(ExclusionSchema).optional(),
1176
- conditions: z15.array(PolicyConditionSchema).optional(),
1220
+ additionalNamedInsureds: z16.array(NamedInsuredSchema).optional(),
1221
+ insuredSicCode: z16.string().optional(),
1222
+ insuredNaicsCode: z16.string().optional(),
1223
+ insuredFein: z16.string().optional(),
1224
+ enrichedCoverages: z16.array(EnrichedCoverageSchema).optional(),
1225
+ endorsements: z16.array(EndorsementSchema).optional(),
1226
+ exclusions: z16.array(ExclusionSchema).optional(),
1227
+ conditions: z16.array(PolicyConditionSchema).optional(),
1177
1228
  limits: LimitScheduleSchema.optional(),
1178
1229
  deductibles: DeductibleScheduleSchema.optional(),
1179
- locations: z15.array(InsuredLocationSchema).optional(),
1180
- vehicles: z15.array(InsuredVehicleSchema).optional(),
1181
- classifications: z15.array(ClassificationCodeSchema).optional(),
1182
- formInventory: z15.array(FormReferenceSchema).optional(),
1230
+ locations: z16.array(InsuredLocationSchema).optional(),
1231
+ vehicles: z16.array(InsuredVehicleSchema).optional(),
1232
+ classifications: z16.array(ClassificationCodeSchema).optional(),
1233
+ formInventory: z16.array(FormReferenceSchema).optional(),
1183
1234
  declarations: DeclarationsSchema.optional(),
1184
1235
  coverageForm: CoverageFormSchema.optional(),
1185
- retroactiveDate: z15.string().optional(),
1236
+ retroactiveDate: z16.string().optional(),
1186
1237
  extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
1187
1238
  insurer: InsurerInfoSchema.optional(),
1188
1239
  producer: ProducerInfoSchema.optional(),
1189
- claimsContacts: z15.array(ContactSchema).optional(),
1190
- regulatoryContacts: z15.array(ContactSchema).optional(),
1191
- thirdPartyAdministrators: z15.array(ContactSchema).optional(),
1192
- additionalInsureds: z15.array(EndorsementPartySchema).optional(),
1193
- lossPayees: z15.array(EndorsementPartySchema).optional(),
1194
- mortgageHolders: z15.array(EndorsementPartySchema).optional(),
1195
- taxesAndFees: z15.array(TaxFeeItemSchema).optional(),
1196
- totalCost: z15.string().optional(),
1197
- minimumPremium: z15.string().optional(),
1198
- depositPremium: z15.string().optional(),
1240
+ claimsContacts: z16.array(ContactSchema).optional(),
1241
+ regulatoryContacts: z16.array(ContactSchema).optional(),
1242
+ thirdPartyAdministrators: z16.array(ContactSchema).optional(),
1243
+ additionalInsureds: z16.array(EndorsementPartySchema).optional(),
1244
+ lossPayees: z16.array(EndorsementPartySchema).optional(),
1245
+ mortgageHolders: z16.array(EndorsementPartySchema).optional(),
1246
+ taxesAndFees: z16.array(TaxFeeItemSchema).optional(),
1247
+ totalCost: z16.string().optional(),
1248
+ minimumPremium: z16.string().optional(),
1249
+ depositPremium: z16.string().optional(),
1199
1250
  paymentPlan: PaymentPlanSchema.optional(),
1200
1251
  auditType: AuditTypeSchema.optional(),
1201
- ratingBasis: z15.array(RatingBasisSchema).optional(),
1202
- premiumByLocation: z15.array(LocationPremiumSchema).optional(),
1252
+ ratingBasis: z16.array(RatingBasisSchema).optional(),
1253
+ premiumByLocation: z16.array(LocationPremiumSchema).optional(),
1203
1254
  lossSummary: LossSummarySchema.optional(),
1204
- individualClaims: z15.array(ClaimRecordSchema).optional(),
1255
+ individualClaims: z16.array(ClaimRecordSchema).optional(),
1205
1256
  experienceMod: ExperienceModSchema.optional(),
1206
- cancellationNoticeDays: z15.number().optional(),
1207
- nonrenewalNoticeDays: z15.number().optional()
1257
+ cancellationNoticeDays: z16.number().optional(),
1258
+ nonrenewalNoticeDays: z16.number().optional()
1208
1259
  };
1209
- var PolicyDocumentSchema = z15.object({
1260
+ var PolicyDocumentSchema = z16.object({
1210
1261
  ...BaseDocumentFields,
1211
- type: z15.literal("policy"),
1212
- policyNumber: z15.string(),
1213
- effectiveDate: z15.string(),
1214
- expirationDate: z15.string().optional(),
1262
+ type: z16.literal("policy"),
1263
+ policyNumber: z16.string(),
1264
+ effectiveDate: z16.string(),
1265
+ expirationDate: z16.string().optional(),
1215
1266
  policyTermType: PolicyTermTypeSchema.optional(),
1216
- nextReviewDate: z15.string().optional(),
1217
- effectiveTime: z15.string().optional()
1267
+ nextReviewDate: z16.string().optional(),
1268
+ effectiveTime: z16.string().optional()
1218
1269
  });
1219
- var QuoteDocumentSchema = z15.object({
1270
+ var QuoteDocumentSchema = z16.object({
1220
1271
  ...BaseDocumentFields,
1221
- type: z15.literal("quote"),
1222
- quoteNumber: z15.string(),
1223
- proposedEffectiveDate: z15.string().optional(),
1224
- proposedExpirationDate: z15.string().optional(),
1225
- quoteExpirationDate: z15.string().optional(),
1226
- subjectivities: z15.array(SubjectivitySchema).optional(),
1227
- underwritingConditions: z15.array(UnderwritingConditionSchema).optional(),
1228
- premiumBreakdown: z15.array(PremiumLineSchema).optional(),
1272
+ type: z16.literal("quote"),
1273
+ quoteNumber: z16.string(),
1274
+ proposedEffectiveDate: z16.string().optional(),
1275
+ proposedExpirationDate: z16.string().optional(),
1276
+ quoteExpirationDate: z16.string().optional(),
1277
+ subjectivities: z16.array(SubjectivitySchema).optional(),
1278
+ underwritingConditions: z16.array(UnderwritingConditionSchema).optional(),
1279
+ premiumBreakdown: z16.array(PremiumLineSchema).optional(),
1229
1280
  // Enriched quote fields (v1.2+)
1230
- enrichedSubjectivities: z15.array(EnrichedSubjectivitySchema).optional(),
1231
- enrichedUnderwritingConditions: z15.array(EnrichedUnderwritingConditionSchema).optional(),
1232
- warrantyRequirements: z15.array(z15.string()).optional(),
1233
- lossControlRecommendations: z15.array(z15.string()).optional(),
1281
+ enrichedSubjectivities: z16.array(EnrichedSubjectivitySchema).optional(),
1282
+ enrichedUnderwritingConditions: z16.array(EnrichedUnderwritingConditionSchema).optional(),
1283
+ warrantyRequirements: z16.array(z16.string()).optional(),
1284
+ lossControlRecommendations: z16.array(z16.string()).optional(),
1234
1285
  bindingAuthority: BindingAuthoritySchema.optional()
1235
1286
  });
1236
- var InsuranceDocumentSchema = z15.discriminatedUnion("type", [
1287
+ var InsuranceDocumentSchema = z16.discriminatedUnion("type", [
1237
1288
  PolicyDocumentSchema,
1238
1289
  QuoteDocumentSchema
1239
1290
  ]);
1240
1291
 
1241
1292
  // src/schemas/platform.ts
1242
- import { z as z16 } from "zod";
1243
- var PlatformSchema = z16.enum(["email", "chat", "sms", "slack", "discord"]);
1244
- var CommunicationIntentSchema = z16.enum(["direct", "mediated", "observed"]);
1293
+ import { z as z17 } from "zod";
1294
+ var PlatformSchema = z17.enum(["email", "chat", "sms", "slack", "discord"]);
1295
+ var CommunicationIntentSchema = z17.enum(["direct", "mediated", "observed"]);
1245
1296
  var PLATFORM_CONFIGS = {
1246
1297
  email: {
1247
1298
  supportsMarkdown: false,
@@ -1469,10 +1520,11 @@ async function runExtractor(params) {
1469
1520
  [Document pages ${startPage}-${endPage} are provided as images above.]` : `${prompt}
1470
1521
 
1471
1522
  [Document pages ${startPage}-${endPage} are provided as a PDF file above.]`;
1523
+ const strictSchema = toStrictSchema(schema);
1472
1524
  const result = await withRetry(
1473
1525
  () => generateObject({
1474
1526
  prompt: fullPrompt,
1475
- schema,
1527
+ schema: strictSchema,
1476
1528
  maxTokens,
1477
1529
  providerOptions
1478
1530
  })
@@ -2551,11 +2603,11 @@ function getTemplate(policyType) {
2551
2603
  }
2552
2604
 
2553
2605
  // src/prompts/coordinator/classify.ts
2554
- import { z as z17 } from "zod";
2555
- var ClassifyResultSchema = z17.object({
2556
- documentType: z17.enum(["policy", "quote"]),
2557
- policyTypes: z17.array(PolicyTypeSchema),
2558
- confidence: z17.number()
2606
+ import { z as z18 } from "zod";
2607
+ var ClassifyResultSchema = z18.object({
2608
+ documentType: z18.enum(["policy", "quote"]),
2609
+ policyTypes: z18.array(PolicyTypeSchema),
2610
+ confidence: z18.number()
2559
2611
  });
2560
2612
  function buildClassifyPrompt() {
2561
2613
  return `You are classifying an insurance document. Examine the first few pages and determine:
@@ -2579,20 +2631,20 @@ Respond with JSON only.`;
2579
2631
  }
2580
2632
 
2581
2633
  // src/prompts/coordinator/plan.ts
2582
- import { z as z18 } from "zod";
2583
- var ExtractionTaskSchema = z18.object({
2584
- extractorName: z18.string(),
2585
- startPage: z18.number(),
2586
- endPage: z18.number(),
2587
- description: z18.string()
2634
+ import { z as z19 } from "zod";
2635
+ var ExtractionTaskSchema = z19.object({
2636
+ extractorName: z19.string(),
2637
+ startPage: z19.number(),
2638
+ endPage: z19.number(),
2639
+ description: z19.string()
2588
2640
  });
2589
- var PageMapEntrySchema = z18.object({
2590
- section: z18.string(),
2591
- pages: z18.string()
2641
+ var PageMapEntrySchema = z19.object({
2642
+ section: z19.string(),
2643
+ pages: z19.string()
2592
2644
  });
2593
- var ExtractionPlanSchema = z18.object({
2594
- tasks: z18.array(ExtractionTaskSchema),
2595
- pageMap: z18.array(PageMapEntrySchema).optional()
2645
+ var ExtractionPlanSchema = z19.object({
2646
+ tasks: z19.array(ExtractionTaskSchema),
2647
+ pageMap: z19.array(PageMapEntrySchema).optional()
2596
2648
  });
2597
2649
  function buildPlanPrompt(templateHints) {
2598
2650
  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.
@@ -2633,15 +2685,15 @@ Respond with JSON only.`;
2633
2685
  }
2634
2686
 
2635
2687
  // src/prompts/coordinator/review.ts
2636
- import { z as z19 } from "zod";
2637
- var ReviewResultSchema = z19.object({
2638
- complete: z19.boolean(),
2639
- missingFields: z19.array(z19.string()),
2640
- additionalTasks: z19.array(z19.object({
2641
- extractorName: z19.string(),
2642
- startPage: z19.number(),
2643
- endPage: z19.number(),
2644
- description: z19.string()
2688
+ import { z as z20 } from "zod";
2689
+ var ReviewResultSchema = z20.object({
2690
+ complete: z20.boolean(),
2691
+ missingFields: z20.array(z20.string()),
2692
+ additionalTasks: z20.array(z20.object({
2693
+ extractorName: z20.string(),
2694
+ startPage: z20.number(),
2695
+ endPage: z20.number(),
2696
+ description: z20.string()
2645
2697
  }))
2646
2698
  });
2647
2699
  function buildReviewPrompt(templateExpected, extractedKeys) {
@@ -2673,20 +2725,20 @@ Respond with JSON only.`;
2673
2725
  }
2674
2726
 
2675
2727
  // src/prompts/extractors/carrier-info.ts
2676
- import { z as z20 } from "zod";
2677
- var CarrierInfoSchema = z20.object({
2678
- carrierName: z20.string().describe("Primary insurance company name for display"),
2679
- carrierLegalName: z20.string().optional().describe("Legal entity name of insurer"),
2680
- naicNumber: z20.string().optional().describe("NAIC company code"),
2681
- amBestRating: z20.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
2682
- admittedStatus: z20.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
2683
- mga: z20.string().optional().describe("Managing General Agent or Program Administrator name"),
2684
- underwriter: z20.string().optional().describe("Named individual underwriter"),
2685
- policyNumber: z20.string().optional().describe("Policy or quote reference number"),
2686
- effectiveDate: z20.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
2687
- expirationDate: z20.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
2688
- quoteNumber: z20.string().optional().describe("Quote or proposal reference number"),
2689
- proposedEffectiveDate: z20.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
2728
+ import { z as z21 } from "zod";
2729
+ var CarrierInfoSchema = z21.object({
2730
+ carrierName: z21.string().describe("Primary insurance company name for display"),
2731
+ carrierLegalName: z21.string().optional().describe("Legal entity name of insurer"),
2732
+ naicNumber: z21.string().optional().describe("NAIC company code"),
2733
+ amBestRating: z21.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
2734
+ admittedStatus: z21.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
2735
+ mga: z21.string().optional().describe("Managing General Agent or Program Administrator name"),
2736
+ underwriter: z21.string().optional().describe("Named individual underwriter"),
2737
+ policyNumber: z21.string().optional().describe("Policy or quote reference number"),
2738
+ effectiveDate: z21.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
2739
+ expirationDate: z21.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
2740
+ quoteNumber: z21.string().optional().describe("Quote or proposal reference number"),
2741
+ proposedEffectiveDate: z21.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
2690
2742
  });
2691
2743
  function buildCarrierInfoPrompt() {
2692
2744
  return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
@@ -2706,18 +2758,18 @@ Return JSON only.`;
2706
2758
  }
2707
2759
 
2708
2760
  // src/prompts/extractors/named-insured.ts
2709
- import { z as z21 } from "zod";
2710
- var AddressSchema2 = z21.object({
2711
- street1: z21.string(),
2712
- city: z21.string(),
2713
- state: z21.string(),
2714
- zip: z21.string()
2761
+ import { z as z22 } from "zod";
2762
+ var AddressSchema2 = z22.object({
2763
+ street1: z22.string(),
2764
+ city: z22.string(),
2765
+ state: z22.string(),
2766
+ zip: z22.string()
2715
2767
  });
2716
- var NamedInsuredSchema2 = z21.object({
2717
- insuredName: z21.string().describe("Name of primary named insured"),
2718
- insuredDba: z21.string().optional().describe("Doing-business-as name"),
2768
+ var NamedInsuredSchema2 = z22.object({
2769
+ insuredName: z22.string().describe("Name of primary named insured"),
2770
+ insuredDba: z22.string().optional().describe("Doing-business-as name"),
2719
2771
  insuredAddress: AddressSchema2.optional().describe("Primary insured mailing address"),
2720
- insuredEntityType: z21.enum([
2772
+ insuredEntityType: z22.enum([
2721
2773
  "corporation",
2722
2774
  "llc",
2723
2775
  "partnership",
@@ -2730,13 +2782,13 @@ var NamedInsuredSchema2 = z21.object({
2730
2782
  "married_couple",
2731
2783
  "other"
2732
2784
  ]).optional().describe("Legal entity type of the insured"),
2733
- insuredFein: z21.string().optional().describe("Federal Employer Identification Number"),
2734
- insuredSicCode: z21.string().optional().describe("SIC code"),
2735
- insuredNaicsCode: z21.string().optional().describe("NAICS code"),
2736
- additionalNamedInsureds: z21.array(
2737
- z21.object({
2738
- name: z21.string(),
2739
- relationship: z21.string().optional().describe("e.g. subsidiary, affiliate"),
2785
+ insuredFein: z22.string().optional().describe("Federal Employer Identification Number"),
2786
+ insuredSicCode: z22.string().optional().describe("SIC code"),
2787
+ insuredNaicsCode: z22.string().optional().describe("NAICS code"),
2788
+ additionalNamedInsureds: z22.array(
2789
+ z22.object({
2790
+ name: z22.string(),
2791
+ relationship: z22.string().optional().describe("e.g. subsidiary, affiliate"),
2740
2792
  address: AddressSchema2.optional()
2741
2793
  })
2742
2794
  ).optional().describe("Additional named insureds listed on the policy")
@@ -2757,19 +2809,19 @@ Return JSON only.`;
2757
2809
  }
2758
2810
 
2759
2811
  // src/prompts/extractors/coverage-limits.ts
2760
- import { z as z22 } from "zod";
2761
- var CoverageLimitsSchema = z22.object({
2762
- coverages: z22.array(
2763
- z22.object({
2764
- name: z22.string().describe("Coverage name"),
2765
- limit: z22.string().describe("Coverage limit, e.g. '$1,000,000'"),
2766
- deductible: z22.string().optional().describe("Deductible amount"),
2767
- coverageCode: z22.string().optional().describe("Coverage code or class code"),
2768
- formNumber: z22.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
2812
+ import { z as z23 } from "zod";
2813
+ var CoverageLimitsSchema = z23.object({
2814
+ coverages: z23.array(
2815
+ z23.object({
2816
+ name: z23.string().describe("Coverage name"),
2817
+ limit: z23.string().describe("Coverage limit, e.g. '$1,000,000'"),
2818
+ deductible: z23.string().optional().describe("Deductible amount"),
2819
+ coverageCode: z23.string().optional().describe("Coverage code or class code"),
2820
+ formNumber: z23.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
2769
2821
  })
2770
2822
  ).describe("All coverages with their limits"),
2771
- coverageForm: z22.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
2772
- retroactiveDate: z22.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
2823
+ coverageForm: z23.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
2824
+ retroactiveDate: z23.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
2773
2825
  });
2774
2826
  function buildCoverageLimitsPrompt() {
2775
2827
  return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
@@ -2790,17 +2842,17 @@ Return JSON only.`;
2790
2842
  }
2791
2843
 
2792
2844
  // src/prompts/extractors/endorsements.ts
2793
- import { z as z23 } from "zod";
2794
- var EndorsementsSchema = z23.object({
2795
- endorsements: z23.array(
2796
- z23.object({
2797
- formNumber: z23.string().optional().describe("Form number, e.g. 'CG 21 47'"),
2798
- title: z23.string().optional().describe("Endorsement title"),
2799
- type: z23.enum(["broadening", "restrictive", "informational"]).optional().describe("Effect type: broadening adds coverage, restrictive limits it"),
2800
- content: z23.string().optional().describe("Full verbatim text of the endorsement"),
2801
- effectiveDate: z23.string().optional().describe("Endorsement effective date"),
2802
- premium: z23.string().optional().describe("Additional premium or credit"),
2803
- parties: z23.array(z23.string()).optional().describe("Named parties (additional insureds, loss payees, etc.)")
2845
+ import { z as z24 } from "zod";
2846
+ var EndorsementsSchema = z24.object({
2847
+ endorsements: z24.array(
2848
+ z24.object({
2849
+ formNumber: z24.string().optional().describe("Form number, e.g. 'CG 21 47'"),
2850
+ title: z24.string().optional().describe("Endorsement title"),
2851
+ type: z24.enum(["broadening", "restrictive", "informational"]).optional().describe("Effect type: broadening adds coverage, restrictive limits it"),
2852
+ content: z24.string().optional().describe("Full verbatim text of the endorsement"),
2853
+ effectiveDate: z24.string().optional().describe("Endorsement effective date"),
2854
+ premium: z24.string().optional().describe("Additional premium or credit"),
2855
+ parties: z24.array(z24.string()).optional().describe("Named parties (additional insureds, loss payees, etc.)")
2804
2856
  })
2805
2857
  ).describe("All endorsements found in the document")
2806
2858
  });
@@ -2826,14 +2878,14 @@ Return JSON only.`;
2826
2878
  }
2827
2879
 
2828
2880
  // src/prompts/extractors/exclusions.ts
2829
- import { z as z24 } from "zod";
2830
- var ExclusionsSchema = z24.object({
2831
- exclusions: z24.array(
2832
- z24.object({
2833
- title: z24.string().describe("Exclusion title or short description"),
2834
- content: z24.string().optional().describe("Full verbatim exclusion text"),
2835
- formNumber: z24.string().optional().describe("Form number if part of a named endorsement"),
2836
- appliesTo: z24.string().optional().describe("Coverage type this exclusion applies to")
2881
+ import { z as z25 } from "zod";
2882
+ var ExclusionsSchema = z25.object({
2883
+ exclusions: z25.array(
2884
+ z25.object({
2885
+ title: z25.string().describe("Exclusion title or short description"),
2886
+ content: z25.string().optional().describe("Full verbatim exclusion text"),
2887
+ formNumber: z25.string().optional().describe("Form number if part of a named endorsement"),
2888
+ appliesTo: z25.string().optional().describe("Coverage type this exclusion applies to")
2837
2889
  })
2838
2890
  ).describe("All exclusions found in the document")
2839
2891
  });
@@ -2854,11 +2906,11 @@ Return JSON only.`;
2854
2906
  }
2855
2907
 
2856
2908
  // src/prompts/extractors/conditions.ts
2857
- import { z as z25 } from "zod";
2858
- var ConditionsSchema = z25.object({
2859
- conditions: z25.array(
2860
- z25.object({
2861
- type: z25.enum([
2909
+ import { z as z26 } from "zod";
2910
+ var ConditionsSchema = z26.object({
2911
+ conditions: z26.array(
2912
+ z26.object({
2913
+ type: z26.enum([
2862
2914
  "duties_after_loss",
2863
2915
  "cooperation",
2864
2916
  "cancellation",
@@ -2872,9 +2924,9 @@ var ConditionsSchema = z25.object({
2872
2924
  "liberalization",
2873
2925
  "other"
2874
2926
  ]).optional().describe("Condition category"),
2875
- title: z25.string().describe("Condition title"),
2876
- content: z25.string().optional().describe("Full verbatim condition text"),
2877
- noticeDays: z25.number().optional().describe("Notice period in days if specified (e.g. cancellation notice)")
2927
+ title: z26.string().describe("Condition title"),
2928
+ content: z26.string().optional().describe("Full verbatim condition text"),
2929
+ noticeDays: z26.number().optional().describe("Notice period in days if specified (e.g. cancellation notice)")
2878
2930
  })
2879
2931
  ).describe("All policy conditions found in the document")
2880
2932
  });
@@ -2899,28 +2951,28 @@ Return JSON only.`;
2899
2951
  }
2900
2952
 
2901
2953
  // src/prompts/extractors/premium-breakdown.ts
2902
- import { z as z26 } from "zod";
2903
- var PremiumBreakdownSchema = z26.object({
2904
- premium: z26.string().optional().describe("Total premium amount, e.g. '$5,000'"),
2905
- totalCost: z26.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
2906
- premiumBreakdown: z26.array(
2907
- z26.object({
2908
- line: z26.string().describe("Coverage line name"),
2909
- amount: z26.string().describe("Premium amount for this line")
2954
+ import { z as z27 } from "zod";
2955
+ var PremiumBreakdownSchema = z27.object({
2956
+ premium: z27.string().optional().describe("Total premium amount, e.g. '$5,000'"),
2957
+ totalCost: z27.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
2958
+ premiumBreakdown: z27.array(
2959
+ z27.object({
2960
+ line: z27.string().describe("Coverage line name"),
2961
+ amount: z27.string().describe("Premium amount for this line")
2910
2962
  })
2911
2963
  ).optional().describe("Per-coverage-line premium breakdown"),
2912
- taxesAndFees: z26.array(
2913
- z26.object({
2914
- name: z26.string().describe("Fee or tax name"),
2915
- amount: z26.string().describe("Dollar amount"),
2916
- type: z26.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
2964
+ taxesAndFees: z27.array(
2965
+ z27.object({
2966
+ name: z27.string().describe("Fee or tax name"),
2967
+ amount: z27.string().describe("Dollar amount"),
2968
+ type: z27.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
2917
2969
  })
2918
2970
  ).optional().describe("Taxes, fees, surcharges, and assessments"),
2919
- minimumPremium: z26.string().optional().describe("Minimum premium if stated"),
2920
- depositPremium: z26.string().optional().describe("Deposit premium if stated"),
2921
- paymentPlan: z26.string().optional().describe("Payment plan description"),
2922
- auditType: z26.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
2923
- ratingBasis: z26.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
2971
+ minimumPremium: z27.string().optional().describe("Minimum premium if stated"),
2972
+ depositPremium: z27.string().optional().describe("Deposit premium if stated"),
2973
+ paymentPlan: z27.string().optional().describe("Payment plan description"),
2974
+ auditType: z27.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
2975
+ ratingBasis: z27.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
2924
2976
  });
2925
2977
  function buildPremiumBreakdownPrompt() {
2926
2978
  return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
@@ -2940,14 +2992,14 @@ Return JSON only.`;
2940
2992
  }
2941
2993
 
2942
2994
  // src/prompts/extractors/declarations.ts
2943
- import { z as z27 } from "zod";
2944
- var DeclarationsFieldSchema = z27.object({
2945
- field: z27.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
2946
- value: z27.string().describe("Extracted value exactly as it appears in the document"),
2947
- section: z27.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
2995
+ import { z as z28 } from "zod";
2996
+ var DeclarationsFieldSchema = z28.object({
2997
+ field: z28.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
2998
+ value: z28.string().describe("Extracted value exactly as it appears in the document"),
2999
+ section: z28.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
2948
3000
  });
2949
- var DeclarationsExtractSchema = z27.object({
2950
- fields: z27.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
3001
+ var DeclarationsExtractSchema = z28.object({
3002
+ fields: z28.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
2951
3003
  });
2952
3004
  function buildDeclarationsPrompt() {
2953
3005
  return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
@@ -2987,21 +3039,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
2987
3039
  }
2988
3040
 
2989
3041
  // src/prompts/extractors/loss-history.ts
2990
- import { z as z28 } from "zod";
2991
- var LossHistorySchema = z28.object({
2992
- lossSummary: z28.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
2993
- individualClaims: z28.array(
2994
- z28.object({
2995
- date: z28.string().optional().describe("Date of loss or claim"),
2996
- type: z28.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
2997
- description: z28.string().optional().describe("Brief description of the claim"),
2998
- amountPaid: z28.string().optional().describe("Amount paid"),
2999
- amountReserved: z28.string().optional().describe("Amount reserved"),
3000
- status: z28.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
3001
- claimNumber: z28.string().optional().describe("Claim reference number")
3042
+ import { z as z29 } from "zod";
3043
+ var LossHistorySchema = z29.object({
3044
+ lossSummary: z29.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
3045
+ individualClaims: z29.array(
3046
+ z29.object({
3047
+ date: z29.string().optional().describe("Date of loss or claim"),
3048
+ type: z29.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
3049
+ description: z29.string().optional().describe("Brief description of the claim"),
3050
+ amountPaid: z29.string().optional().describe("Amount paid"),
3051
+ amountReserved: z29.string().optional().describe("Amount reserved"),
3052
+ status: z29.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
3053
+ claimNumber: z29.string().optional().describe("Claim reference number")
3002
3054
  })
3003
3055
  ).optional().describe("Individual claim records"),
3004
- experienceMod: z28.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
3056
+ experienceMod: z29.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
3005
3057
  });
3006
3058
  function buildLossHistoryPrompt() {
3007
3059
  return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
@@ -3018,18 +3070,18 @@ Return JSON only.`;
3018
3070
  }
3019
3071
 
3020
3072
  // src/prompts/extractors/sections.ts
3021
- import { z as z29 } from "zod";
3022
- var SubsectionSchema2 = z29.object({
3023
- title: z29.string().describe("Subsection title"),
3024
- sectionNumber: z29.string().optional().describe("Subsection number"),
3025
- pageNumber: z29.number().optional().describe("Page number"),
3026
- content: z29.string().describe("Full verbatim text")
3073
+ import { z as z30 } from "zod";
3074
+ var SubsectionSchema2 = z30.object({
3075
+ title: z30.string().describe("Subsection title"),
3076
+ sectionNumber: z30.string().optional().describe("Subsection number"),
3077
+ pageNumber: z30.number().optional().describe("Page number"),
3078
+ content: z30.string().describe("Full verbatim text")
3027
3079
  });
3028
- var SectionsSchema = z29.object({
3029
- sections: z29.array(
3030
- z29.object({
3031
- title: z29.string().describe("Section title"),
3032
- type: z29.enum([
3080
+ var SectionsSchema = z30.object({
3081
+ sections: z30.array(
3082
+ z30.object({
3083
+ title: z30.string().describe("Section title"),
3084
+ type: z30.enum([
3033
3085
  "declarations",
3034
3086
  "insuring_agreement",
3035
3087
  "policy_form",
@@ -3043,10 +3095,10 @@ var SectionsSchema = z29.object({
3043
3095
  "regulatory",
3044
3096
  "other"
3045
3097
  ]).describe("Section type classification"),
3046
- content: z29.string().describe("Full verbatim text of the section"),
3047
- pageStart: z29.number().describe("Starting page number"),
3048
- pageEnd: z29.number().optional().describe("Ending page number"),
3049
- subsections: z29.array(SubsectionSchema2).optional().describe("Subsections within this section")
3098
+ content: z30.string().describe("Full verbatim text of the section"),
3099
+ pageStart: z30.number().describe("Starting page number"),
3100
+ pageEnd: z30.number().optional().describe("Ending page number"),
3101
+ subsections: z30.array(SubsectionSchema2).optional().describe("Subsections within this section")
3050
3102
  })
3051
3103
  ).describe("All document sections")
3052
3104
  });
@@ -3070,20 +3122,20 @@ Return JSON only.`;
3070
3122
  }
3071
3123
 
3072
3124
  // src/prompts/extractors/supplementary.ts
3073
- import { z as z30 } from "zod";
3074
- var ContactSchema2 = z30.object({
3075
- name: z30.string().optional().describe("Organization or person name"),
3076
- phone: z30.string().optional().describe("Phone number"),
3077
- email: z30.string().optional().describe("Email address"),
3078
- address: z30.string().optional().describe("Mailing address"),
3079
- type: z30.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
3125
+ import { z as z31 } from "zod";
3126
+ var ContactSchema2 = z31.object({
3127
+ name: z31.string().optional().describe("Organization or person name"),
3128
+ phone: z31.string().optional().describe("Phone number"),
3129
+ email: z31.string().optional().describe("Email address"),
3130
+ address: z31.string().optional().describe("Mailing address"),
3131
+ type: z31.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
3080
3132
  });
3081
- var SupplementarySchema = z30.object({
3082
- regulatoryContacts: z30.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
3083
- claimsContacts: z30.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
3084
- thirdPartyAdministrators: z30.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
3085
- cancellationNoticeDays: z30.number().optional().describe("Required notice period for cancellation in days"),
3086
- nonrenewalNoticeDays: z30.number().optional().describe("Required notice period for nonrenewal in days")
3133
+ var SupplementarySchema = z31.object({
3134
+ regulatoryContacts: z31.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
3135
+ claimsContacts: z31.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
3136
+ thirdPartyAdministrators: z31.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
3137
+ cancellationNoticeDays: z31.number().optional().describe("Required notice period for cancellation in days"),
3138
+ nonrenewalNoticeDays: z31.number().optional().describe("Required notice period for nonrenewal in days")
3087
3139
  });
3088
3140
  function buildSupplementaryPrompt() {
3089
3141
  return `You are an expert insurance document analyst. Extract supplementary and regulatory information from this document.
@@ -3585,8 +3637,8 @@ Respond with JSON only:
3585
3637
  }`;
3586
3638
 
3587
3639
  // src/schemas/application.ts
3588
- import { z as z31 } from "zod";
3589
- var FieldTypeSchema = z31.enum([
3640
+ import { z as z32 } from "zod";
3641
+ var FieldTypeSchema = z32.enum([
3590
3642
  "text",
3591
3643
  "numeric",
3592
3644
  "currency",
@@ -3595,100 +3647,100 @@ var FieldTypeSchema = z31.enum([
3595
3647
  "table",
3596
3648
  "declaration"
3597
3649
  ]);
3598
- var ApplicationFieldSchema = z31.object({
3599
- id: z31.string(),
3600
- label: z31.string(),
3601
- section: z31.string(),
3650
+ var ApplicationFieldSchema = z32.object({
3651
+ id: z32.string(),
3652
+ label: z32.string(),
3653
+ section: z32.string(),
3602
3654
  fieldType: FieldTypeSchema,
3603
- required: z31.boolean(),
3604
- options: z31.array(z31.string()).optional(),
3605
- columns: z31.array(z31.string()).optional(),
3606
- requiresExplanationIfYes: z31.boolean().optional(),
3607
- condition: z31.object({
3608
- dependsOn: z31.string(),
3609
- whenValue: z31.string()
3655
+ required: z32.boolean(),
3656
+ options: z32.array(z32.string()).optional(),
3657
+ columns: z32.array(z32.string()).optional(),
3658
+ requiresExplanationIfYes: z32.boolean().optional(),
3659
+ condition: z32.object({
3660
+ dependsOn: z32.string(),
3661
+ whenValue: z32.string()
3610
3662
  }).optional(),
3611
- value: z31.string().optional(),
3612
- source: z31.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
3613
- confidence: z31.enum(["confirmed", "high", "medium", "low"]).optional()
3663
+ value: z32.string().optional(),
3664
+ source: z32.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
3665
+ confidence: z32.enum(["confirmed", "high", "medium", "low"]).optional()
3614
3666
  });
3615
- var ApplicationClassifyResultSchema = z31.object({
3616
- isApplication: z31.boolean(),
3617
- confidence: z31.number().min(0).max(1),
3618
- applicationType: z31.string().nullable()
3667
+ var ApplicationClassifyResultSchema = z32.object({
3668
+ isApplication: z32.boolean(),
3669
+ confidence: z32.number().min(0).max(1),
3670
+ applicationType: z32.string().nullable()
3619
3671
  });
3620
- var FieldExtractionResultSchema = z31.object({
3621
- fields: z31.array(ApplicationFieldSchema)
3672
+ var FieldExtractionResultSchema = z32.object({
3673
+ fields: z32.array(ApplicationFieldSchema)
3622
3674
  });
3623
- var AutoFillMatchSchema = z31.object({
3624
- fieldId: z31.string(),
3625
- value: z31.string(),
3626
- confidence: z31.enum(["confirmed"]),
3627
- contextKey: z31.string()
3675
+ var AutoFillMatchSchema = z32.object({
3676
+ fieldId: z32.string(),
3677
+ value: z32.string(),
3678
+ confidence: z32.enum(["confirmed"]),
3679
+ contextKey: z32.string()
3628
3680
  });
3629
- var AutoFillResultSchema = z31.object({
3630
- matches: z31.array(AutoFillMatchSchema)
3681
+ var AutoFillResultSchema = z32.object({
3682
+ matches: z32.array(AutoFillMatchSchema)
3631
3683
  });
3632
- var QuestionBatchResultSchema = z31.object({
3633
- batches: z31.array(z31.array(z31.string()).describe("Array of field IDs in this batch"))
3684
+ var QuestionBatchResultSchema = z32.object({
3685
+ batches: z32.array(z32.array(z32.string()).describe("Array of field IDs in this batch"))
3634
3686
  });
3635
- var LookupRequestSchema = z31.object({
3636
- type: z31.string().describe("Type of lookup: 'records', 'website', 'policy'"),
3637
- description: z31.string(),
3638
- url: z31.string().optional(),
3639
- targetFieldIds: z31.array(z31.string())
3687
+ var LookupRequestSchema = z32.object({
3688
+ type: z32.string().describe("Type of lookup: 'records', 'website', 'policy'"),
3689
+ description: z32.string(),
3690
+ url: z32.string().optional(),
3691
+ targetFieldIds: z32.array(z32.string())
3640
3692
  });
3641
- var ReplyIntentSchema = z31.object({
3642
- primaryIntent: z31.enum(["answers_only", "question", "lookup_request", "mixed"]),
3643
- hasAnswers: z31.boolean(),
3644
- questionText: z31.string().optional(),
3645
- questionFieldIds: z31.array(z31.string()).optional(),
3646
- lookupRequests: z31.array(LookupRequestSchema).optional()
3693
+ var ReplyIntentSchema = z32.object({
3694
+ primaryIntent: z32.enum(["answers_only", "question", "lookup_request", "mixed"]),
3695
+ hasAnswers: z32.boolean(),
3696
+ questionText: z32.string().optional(),
3697
+ questionFieldIds: z32.array(z32.string()).optional(),
3698
+ lookupRequests: z32.array(LookupRequestSchema).optional()
3647
3699
  });
3648
- var ParsedAnswerSchema = z31.object({
3649
- fieldId: z31.string(),
3650
- value: z31.string(),
3651
- explanation: z31.string().optional()
3700
+ var ParsedAnswerSchema = z32.object({
3701
+ fieldId: z32.string(),
3702
+ value: z32.string(),
3703
+ explanation: z32.string().optional()
3652
3704
  });
3653
- var AnswerParsingResultSchema = z31.object({
3654
- answers: z31.array(ParsedAnswerSchema),
3655
- unanswered: z31.array(z31.string()).describe("Field IDs that were not answered")
3705
+ var AnswerParsingResultSchema = z32.object({
3706
+ answers: z32.array(ParsedAnswerSchema),
3707
+ unanswered: z32.array(z32.string()).describe("Field IDs that were not answered")
3656
3708
  });
3657
- var LookupFillSchema = z31.object({
3658
- fieldId: z31.string(),
3659
- value: z31.string(),
3660
- source: z31.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
3709
+ var LookupFillSchema = z32.object({
3710
+ fieldId: z32.string(),
3711
+ value: z32.string(),
3712
+ source: z32.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
3661
3713
  });
3662
- var LookupFillResultSchema = z31.object({
3663
- fills: z31.array(LookupFillSchema),
3664
- unfillable: z31.array(z31.string()),
3665
- explanation: z31.string().optional()
3714
+ var LookupFillResultSchema = z32.object({
3715
+ fills: z32.array(LookupFillSchema),
3716
+ unfillable: z32.array(z32.string()),
3717
+ explanation: z32.string().optional()
3666
3718
  });
3667
- var FlatPdfPlacementSchema = z31.object({
3668
- fieldId: z31.string(),
3669
- page: z31.number(),
3670
- x: z31.number().describe("Percentage from left edge (0-100)"),
3671
- y: z31.number().describe("Percentage from top edge (0-100)"),
3672
- text: z31.string(),
3673
- fontSize: z31.number().optional(),
3674
- isCheckmark: z31.boolean().optional()
3719
+ var FlatPdfPlacementSchema = z32.object({
3720
+ fieldId: z32.string(),
3721
+ page: z32.number(),
3722
+ x: z32.number().describe("Percentage from left edge (0-100)"),
3723
+ y: z32.number().describe("Percentage from top edge (0-100)"),
3724
+ text: z32.string(),
3725
+ fontSize: z32.number().optional(),
3726
+ isCheckmark: z32.boolean().optional()
3675
3727
  });
3676
- var AcroFormMappingSchema = z31.object({
3677
- fieldId: z31.string(),
3678
- acroFormName: z31.string(),
3679
- value: z31.string()
3728
+ var AcroFormMappingSchema = z32.object({
3729
+ fieldId: z32.string(),
3730
+ acroFormName: z32.string(),
3731
+ value: z32.string()
3680
3732
  });
3681
- var ApplicationStateSchema = z31.object({
3682
- id: z31.string(),
3683
- pdfBase64: z31.string().optional().describe("Original PDF, omitted after extraction"),
3684
- title: z31.string().optional(),
3685
- applicationType: z31.string().nullable().optional(),
3686
- fields: z31.array(ApplicationFieldSchema),
3687
- batches: z31.array(z31.array(z31.string())).optional(),
3688
- currentBatchIndex: z31.number().default(0),
3689
- status: z31.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
3690
- createdAt: z31.number(),
3691
- updatedAt: z31.number()
3733
+ var ApplicationStateSchema = z32.object({
3734
+ id: z32.string(),
3735
+ pdfBase64: z32.string().optional().describe("Original PDF, omitted after extraction"),
3736
+ title: z32.string().optional(),
3737
+ applicationType: z32.string().nullable().optional(),
3738
+ fields: z32.array(ApplicationFieldSchema),
3739
+ batches: z32.array(z32.array(z32.string())).optional(),
3740
+ currentBatchIndex: z32.number().default(0),
3741
+ status: z32.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
3742
+ createdAt: z32.number(),
3743
+ updatedAt: z32.number()
3692
3744
  });
3693
3745
 
3694
3746
  // src/application/agents/classifier.ts
@@ -4716,73 +4768,73 @@ Respond with the final answer, deduplicated citations array, overall confidence
4716
4768
  }
4717
4769
 
4718
4770
  // src/schemas/query.ts
4719
- import { z as z32 } from "zod";
4720
- var QueryIntentSchema = z32.enum([
4771
+ import { z as z33 } from "zod";
4772
+ var QueryIntentSchema = z33.enum([
4721
4773
  "policy_question",
4722
4774
  "coverage_comparison",
4723
4775
  "document_search",
4724
4776
  "claims_inquiry",
4725
4777
  "general_knowledge"
4726
4778
  ]);
4727
- var SubQuestionSchema = z32.object({
4728
- question: z32.string().describe("Atomic sub-question to retrieve and answer independently"),
4779
+ var SubQuestionSchema = z33.object({
4780
+ question: z33.string().describe("Atomic sub-question to retrieve and answer independently"),
4729
4781
  intent: QueryIntentSchema,
4730
- chunkTypes: z32.array(z32.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
4731
- documentFilters: z32.object({
4732
- type: z32.enum(["policy", "quote"]).optional(),
4733
- carrier: z32.string().optional(),
4734
- insuredName: z32.string().optional(),
4735
- policyNumber: z32.string().optional(),
4736
- quoteNumber: z32.string().optional()
4782
+ chunkTypes: z33.array(z33.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
4783
+ documentFilters: z33.object({
4784
+ type: z33.enum(["policy", "quote"]).optional(),
4785
+ carrier: z33.string().optional(),
4786
+ insuredName: z33.string().optional(),
4787
+ policyNumber: z33.string().optional(),
4788
+ quoteNumber: z33.string().optional()
4737
4789
  }).optional().describe("Structured filters to narrow document lookup")
4738
4790
  });
4739
- var QueryClassifyResultSchema = z32.object({
4791
+ var QueryClassifyResultSchema = z33.object({
4740
4792
  intent: QueryIntentSchema,
4741
- subQuestions: z32.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
4742
- requiresDocumentLookup: z32.boolean().describe("Whether structured document lookup is needed"),
4743
- requiresChunkSearch: z32.boolean().describe("Whether semantic chunk search is needed"),
4744
- requiresConversationHistory: z32.boolean().describe("Whether conversation history is relevant")
4793
+ subQuestions: z33.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
4794
+ requiresDocumentLookup: z33.boolean().describe("Whether structured document lookup is needed"),
4795
+ requiresChunkSearch: z33.boolean().describe("Whether semantic chunk search is needed"),
4796
+ requiresConversationHistory: z33.boolean().describe("Whether conversation history is relevant")
4745
4797
  });
4746
- var EvidenceItemSchema = z32.object({
4747
- source: z32.enum(["chunk", "document", "conversation"]),
4748
- chunkId: z32.string().optional(),
4749
- documentId: z32.string().optional(),
4750
- turnId: z32.string().optional(),
4751
- text: z32.string().describe("Text excerpt from the source"),
4752
- relevance: z32.number().min(0).max(1),
4753
- metadata: z32.array(z32.object({ key: z32.string(), value: z32.string() })).optional()
4798
+ var EvidenceItemSchema = z33.object({
4799
+ source: z33.enum(["chunk", "document", "conversation"]),
4800
+ chunkId: z33.string().optional(),
4801
+ documentId: z33.string().optional(),
4802
+ turnId: z33.string().optional(),
4803
+ text: z33.string().describe("Text excerpt from the source"),
4804
+ relevance: z33.number().min(0).max(1),
4805
+ metadata: z33.array(z33.object({ key: z33.string(), value: z33.string() })).optional()
4754
4806
  });
4755
- var RetrievalResultSchema = z32.object({
4756
- subQuestion: z32.string(),
4757
- evidence: z32.array(EvidenceItemSchema)
4807
+ var RetrievalResultSchema = z33.object({
4808
+ subQuestion: z33.string(),
4809
+ evidence: z33.array(EvidenceItemSchema)
4758
4810
  });
4759
- var CitationSchema = z32.object({
4760
- index: z32.number().describe("Citation number [1], [2], etc."),
4761
- chunkId: z32.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
4762
- documentId: z32.string(),
4763
- documentType: z32.enum(["policy", "quote"]).optional(),
4764
- field: z32.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
4765
- quote: z32.string().describe("Exact text from source that supports the claim"),
4766
- relevance: z32.number().min(0).max(1)
4811
+ var CitationSchema = z33.object({
4812
+ index: z33.number().describe("Citation number [1], [2], etc."),
4813
+ chunkId: z33.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
4814
+ documentId: z33.string(),
4815
+ documentType: z33.enum(["policy", "quote"]).optional(),
4816
+ field: z33.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
4817
+ quote: z33.string().describe("Exact text from source that supports the claim"),
4818
+ relevance: z33.number().min(0).max(1)
4767
4819
  });
4768
- var SubAnswerSchema = z32.object({
4769
- subQuestion: z32.string(),
4770
- answer: z32.string(),
4771
- citations: z32.array(CitationSchema),
4772
- confidence: z32.number().min(0).max(1),
4773
- needsMoreContext: z32.boolean().describe("True if evidence was insufficient to answer fully")
4820
+ var SubAnswerSchema = z33.object({
4821
+ subQuestion: z33.string(),
4822
+ answer: z33.string(),
4823
+ citations: z33.array(CitationSchema),
4824
+ confidence: z33.number().min(0).max(1),
4825
+ needsMoreContext: z33.boolean().describe("True if evidence was insufficient to answer fully")
4774
4826
  });
4775
- var VerifyResultSchema = z32.object({
4776
- approved: z32.boolean().describe("Whether all sub-answers are adequately grounded"),
4777
- issues: z32.array(z32.string()).describe("Specific grounding or consistency issues found"),
4778
- retrySubQuestions: z32.array(z32.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
4827
+ var VerifyResultSchema = z33.object({
4828
+ approved: z33.boolean().describe("Whether all sub-answers are adequately grounded"),
4829
+ issues: z33.array(z33.string()).describe("Specific grounding or consistency issues found"),
4830
+ retrySubQuestions: z33.array(z33.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
4779
4831
  });
4780
- var QueryResultSchema = z32.object({
4781
- answer: z32.string(),
4782
- citations: z32.array(CitationSchema),
4832
+ var QueryResultSchema = z33.object({
4833
+ answer: z33.string(),
4834
+ citations: z33.array(CitationSchema),
4783
4835
  intent: QueryIntentSchema,
4784
- confidence: z32.number().min(0).max(1),
4785
- followUp: z32.string().optional().describe("Suggested follow-up question if applicable")
4836
+ confidence: z33.number().min(0).max(1),
4837
+ followUp: z33.string().optional().describe("Suggested follow-up question if applicable")
4786
4838
  });
4787
4839
 
4788
4840
  // src/query/retriever.ts
@@ -5663,6 +5715,7 @@ export {
5663
5715
  safeGenerateObject,
5664
5716
  sanitizeNulls,
5665
5717
  stripFences,
5718
+ toStrictSchema,
5666
5719
  withRetry
5667
5720
  };
5668
5721
  //# sourceMappingURL=index.mjs.map