@claritylabs/cl-sdk 0.7.2 → 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/README.md +33 -4
- package/dist/index.d.mts +179 -168
- package/dist/index.d.ts +179 -168
- package/dist/index.js +1006 -958
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1005 -958
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -77,14 +77,59 @@ function sanitizeNulls(obj) {
|
|
|
77
77
|
return obj;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// src/core/strict-schema.ts
|
|
81
|
+
import { z } from "zod";
|
|
82
|
+
function toStrictSchema(schema) {
|
|
83
|
+
const def = schema._zod?.def;
|
|
84
|
+
const typeName = def?.type ?? schema.type;
|
|
85
|
+
if (typeName === "object") {
|
|
86
|
+
const shape = schema.shape;
|
|
87
|
+
if (!shape) return schema;
|
|
88
|
+
const newShape = {};
|
|
89
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
90
|
+
const field = value;
|
|
91
|
+
const fieldDef = field._zod?.def;
|
|
92
|
+
const fieldType = fieldDef?.type ?? field.type;
|
|
93
|
+
if (fieldType === "optional") {
|
|
94
|
+
const innerType = fieldDef?.innerType;
|
|
95
|
+
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
|
+
|
|
80
124
|
// src/core/safe-generate.ts
|
|
81
125
|
async function safeGenerateObject(generateObject, params, options) {
|
|
82
126
|
const maxRetries = options?.maxRetries ?? 1;
|
|
83
127
|
let lastError;
|
|
128
|
+
const strictParams = { ...params, schema: toStrictSchema(params.schema) };
|
|
84
129
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
85
130
|
try {
|
|
86
131
|
const result = await withRetry(
|
|
87
|
-
() => generateObject(
|
|
132
|
+
() => generateObject(strictParams),
|
|
88
133
|
options?.log
|
|
89
134
|
);
|
|
90
135
|
return result;
|
|
@@ -141,8 +186,8 @@ function createPipelineContext(opts) {
|
|
|
141
186
|
}
|
|
142
187
|
|
|
143
188
|
// src/schemas/enums.ts
|
|
144
|
-
import { z } from "zod";
|
|
145
|
-
var PolicyTypeSchema =
|
|
189
|
+
import { z as z2 } from "zod";
|
|
190
|
+
var PolicyTypeSchema = z2.enum([
|
|
146
191
|
// Commercial lines
|
|
147
192
|
"general_liability",
|
|
148
193
|
"commercial_property",
|
|
@@ -189,7 +234,7 @@ var PolicyTypeSchema = z.enum([
|
|
|
189
234
|
"other"
|
|
190
235
|
]);
|
|
191
236
|
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
192
|
-
var EndorsementTypeSchema =
|
|
237
|
+
var EndorsementTypeSchema = z2.enum([
|
|
193
238
|
"additional_insured",
|
|
194
239
|
"waiver_of_subrogation",
|
|
195
240
|
"primary_noncontributory",
|
|
@@ -210,7 +255,7 @@ var EndorsementTypeSchema = z.enum([
|
|
|
210
255
|
"other"
|
|
211
256
|
]);
|
|
212
257
|
var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
|
|
213
|
-
var ConditionTypeSchema =
|
|
258
|
+
var ConditionTypeSchema = z2.enum([
|
|
214
259
|
"duties_after_loss",
|
|
215
260
|
"notice_requirements",
|
|
216
261
|
"other_insurance",
|
|
@@ -230,7 +275,7 @@ var ConditionTypeSchema = z.enum([
|
|
|
230
275
|
"other"
|
|
231
276
|
]);
|
|
232
277
|
var CONDITION_TYPES = ConditionTypeSchema.options;
|
|
233
|
-
var PolicySectionTypeSchema =
|
|
278
|
+
var PolicySectionTypeSchema = z2.enum([
|
|
234
279
|
"declarations",
|
|
235
280
|
"insuring_agreement",
|
|
236
281
|
"policy_form",
|
|
@@ -245,7 +290,7 @@ var PolicySectionTypeSchema = z.enum([
|
|
|
245
290
|
"other"
|
|
246
291
|
]);
|
|
247
292
|
var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
|
|
248
|
-
var QuoteSectionTypeSchema =
|
|
293
|
+
var QuoteSectionTypeSchema = z2.enum([
|
|
249
294
|
"terms_summary",
|
|
250
295
|
"premium_indication",
|
|
251
296
|
"underwriting_condition",
|
|
@@ -255,13 +300,13 @@ var QuoteSectionTypeSchema = z.enum([
|
|
|
255
300
|
"other"
|
|
256
301
|
]);
|
|
257
302
|
var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
|
|
258
|
-
var CoverageFormSchema =
|
|
303
|
+
var CoverageFormSchema = z2.enum(["occurrence", "claims_made", "accident"]);
|
|
259
304
|
var COVERAGE_FORMS = CoverageFormSchema.options;
|
|
260
|
-
var PolicyTermTypeSchema =
|
|
305
|
+
var PolicyTermTypeSchema = z2.enum(["fixed", "continuous"]);
|
|
261
306
|
var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
|
|
262
|
-
var CoverageTriggerSchema =
|
|
307
|
+
var CoverageTriggerSchema = z2.enum(["occurrence", "claims_made", "accident"]);
|
|
263
308
|
var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
|
|
264
|
-
var LimitTypeSchema =
|
|
309
|
+
var LimitTypeSchema = z2.enum([
|
|
265
310
|
"per_occurrence",
|
|
266
311
|
"per_claim",
|
|
267
312
|
"aggregate",
|
|
@@ -272,7 +317,7 @@ var LimitTypeSchema = z.enum([
|
|
|
272
317
|
"scheduled"
|
|
273
318
|
]);
|
|
274
319
|
var LIMIT_TYPES = LimitTypeSchema.options;
|
|
275
|
-
var DeductibleTypeSchema =
|
|
320
|
+
var DeductibleTypeSchema = z2.enum([
|
|
276
321
|
"per_occurrence",
|
|
277
322
|
"per_claim",
|
|
278
323
|
"aggregate",
|
|
@@ -280,16 +325,16 @@ var DeductibleTypeSchema = z.enum([
|
|
|
280
325
|
"waiting_period"
|
|
281
326
|
]);
|
|
282
327
|
var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
|
|
283
|
-
var ValuationMethodSchema =
|
|
328
|
+
var ValuationMethodSchema = z2.enum([
|
|
284
329
|
"replacement_cost",
|
|
285
330
|
"actual_cash_value",
|
|
286
331
|
"agreed_value",
|
|
287
332
|
"functional_replacement"
|
|
288
333
|
]);
|
|
289
334
|
var VALUATION_METHODS = ValuationMethodSchema.options;
|
|
290
|
-
var DefenseCostTreatmentSchema =
|
|
335
|
+
var DefenseCostTreatmentSchema = z2.enum(["inside_limits", "outside_limits", "supplementary"]);
|
|
291
336
|
var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
|
|
292
|
-
var EntityTypeSchema =
|
|
337
|
+
var EntityTypeSchema = z2.enum([
|
|
293
338
|
"corporation",
|
|
294
339
|
"llc",
|
|
295
340
|
"partnership",
|
|
@@ -303,9 +348,9 @@ var EntityTypeSchema = z.enum([
|
|
|
303
348
|
"other"
|
|
304
349
|
]);
|
|
305
350
|
var ENTITY_TYPES = EntityTypeSchema.options;
|
|
306
|
-
var AdmittedStatusSchema =
|
|
351
|
+
var AdmittedStatusSchema = z2.enum(["admitted", "non_admitted", "surplus_lines"]);
|
|
307
352
|
var ADMITTED_STATUSES = AdmittedStatusSchema.options;
|
|
308
|
-
var AuditTypeSchema =
|
|
353
|
+
var AuditTypeSchema = z2.enum([
|
|
309
354
|
"annual",
|
|
310
355
|
"semi_annual",
|
|
311
356
|
"quarterly",
|
|
@@ -315,7 +360,7 @@ var AuditTypeSchema = z.enum([
|
|
|
315
360
|
"none"
|
|
316
361
|
]);
|
|
317
362
|
var AUDIT_TYPES = AuditTypeSchema.options;
|
|
318
|
-
var EndorsementPartyRoleSchema =
|
|
363
|
+
var EndorsementPartyRoleSchema = z2.enum([
|
|
319
364
|
"additional_insured",
|
|
320
365
|
"loss_payee",
|
|
321
366
|
"mortgage_holder",
|
|
@@ -324,13 +369,13 @@ var EndorsementPartyRoleSchema = z.enum([
|
|
|
324
369
|
"other"
|
|
325
370
|
]);
|
|
326
371
|
var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
|
|
327
|
-
var ClaimStatusSchema =
|
|
372
|
+
var ClaimStatusSchema = z2.enum(["open", "closed", "reopened"]);
|
|
328
373
|
var CLAIM_STATUSES = ClaimStatusSchema.options;
|
|
329
|
-
var SubjectivityCategorySchema =
|
|
374
|
+
var SubjectivityCategorySchema = z2.enum(["pre_binding", "post_binding", "information"]);
|
|
330
375
|
var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
|
|
331
|
-
var DocumentTypeSchema =
|
|
376
|
+
var DocumentTypeSchema = z2.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
|
|
332
377
|
var DOCUMENT_TYPES = DocumentTypeSchema.options;
|
|
333
|
-
var ChunkTypeSchema =
|
|
378
|
+
var ChunkTypeSchema = z2.enum([
|
|
334
379
|
"declarations",
|
|
335
380
|
"coverage_form",
|
|
336
381
|
"endorsement",
|
|
@@ -339,7 +384,7 @@ var ChunkTypeSchema = z.enum([
|
|
|
339
384
|
"mixed"
|
|
340
385
|
]);
|
|
341
386
|
var CHUNK_TYPES = ChunkTypeSchema.options;
|
|
342
|
-
var RatingBasisTypeSchema =
|
|
387
|
+
var RatingBasisTypeSchema = z2.enum([
|
|
343
388
|
"payroll",
|
|
344
389
|
"revenue",
|
|
345
390
|
"area",
|
|
@@ -353,7 +398,7 @@ var RatingBasisTypeSchema = z.enum([
|
|
|
353
398
|
"other"
|
|
354
399
|
]);
|
|
355
400
|
var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
|
|
356
|
-
var VehicleCoverageTypeSchema =
|
|
401
|
+
var VehicleCoverageTypeSchema = z2.enum([
|
|
357
402
|
"liability",
|
|
358
403
|
"collision",
|
|
359
404
|
"comprehensive",
|
|
@@ -366,32 +411,32 @@ var VehicleCoverageTypeSchema = z.enum([
|
|
|
366
411
|
"physical_damage"
|
|
367
412
|
]);
|
|
368
413
|
var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
|
|
369
|
-
var HomeownersFormTypeSchema =
|
|
414
|
+
var HomeownersFormTypeSchema = z2.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
|
|
370
415
|
var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
|
|
371
|
-
var DwellingFireFormTypeSchema =
|
|
416
|
+
var DwellingFireFormTypeSchema = z2.enum(["DP-1", "DP-2", "DP-3"]);
|
|
372
417
|
var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
|
|
373
|
-
var FloodZoneSchema =
|
|
418
|
+
var FloodZoneSchema = z2.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
|
|
374
419
|
var FLOOD_ZONES = FloodZoneSchema.options;
|
|
375
|
-
var ConstructionTypeSchema =
|
|
420
|
+
var ConstructionTypeSchema = z2.enum(["frame", "masonry", "superior", "mixed", "other"]);
|
|
376
421
|
var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
|
|
377
|
-
var RoofTypeSchema =
|
|
422
|
+
var RoofTypeSchema = z2.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
|
|
378
423
|
var ROOF_TYPES = RoofTypeSchema.options;
|
|
379
|
-
var FoundationTypeSchema =
|
|
424
|
+
var FoundationTypeSchema = z2.enum(["basement", "crawl_space", "slab", "pier", "other"]);
|
|
380
425
|
var FOUNDATION_TYPES = FoundationTypeSchema.options;
|
|
381
|
-
var PersonalAutoUsageSchema =
|
|
426
|
+
var PersonalAutoUsageSchema = z2.enum(["pleasure", "commute", "business", "farm"]);
|
|
382
427
|
var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
|
|
383
|
-
var LossSettlementSchema =
|
|
428
|
+
var LossSettlementSchema = z2.enum([
|
|
384
429
|
"replacement_cost",
|
|
385
430
|
"actual_cash_value",
|
|
386
431
|
"extended_replacement_cost",
|
|
387
432
|
"guaranteed_replacement_cost"
|
|
388
433
|
]);
|
|
389
434
|
var LOSS_SETTLEMENTS = LossSettlementSchema.options;
|
|
390
|
-
var BoatTypeSchema =
|
|
435
|
+
var BoatTypeSchema = z2.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
|
|
391
436
|
var BOAT_TYPES = BoatTypeSchema.options;
|
|
392
|
-
var RVTypeSchema =
|
|
437
|
+
var RVTypeSchema = z2.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
|
|
393
438
|
var RV_TYPES = RVTypeSchema.options;
|
|
394
|
-
var ScheduledItemCategorySchema =
|
|
439
|
+
var ScheduledItemCategorySchema = z2.enum([
|
|
395
440
|
"jewelry",
|
|
396
441
|
"fine_art",
|
|
397
442
|
"musical_instruments",
|
|
@@ -404,691 +449,691 @@ var ScheduledItemCategorySchema = z.enum([
|
|
|
404
449
|
"other"
|
|
405
450
|
]);
|
|
406
451
|
var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
|
|
407
|
-
var TitlePolicyTypeSchema =
|
|
452
|
+
var TitlePolicyTypeSchema = z2.enum(["owners", "lenders"]);
|
|
408
453
|
var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
409
|
-
var PetSpeciesSchema =
|
|
454
|
+
var PetSpeciesSchema = z2.enum(["dog", "cat", "other"]);
|
|
410
455
|
var PET_SPECIES = PetSpeciesSchema.options;
|
|
411
456
|
|
|
412
457
|
// src/schemas/shared.ts
|
|
413
|
-
import { z as
|
|
414
|
-
var AddressSchema =
|
|
415
|
-
street1:
|
|
416
|
-
street2:
|
|
417
|
-
city:
|
|
418
|
-
state:
|
|
419
|
-
zip:
|
|
420
|
-
country:
|
|
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()
|
|
421
466
|
});
|
|
422
|
-
var ContactSchema =
|
|
423
|
-
name:
|
|
424
|
-
title:
|
|
425
|
-
type:
|
|
426
|
-
phone:
|
|
427
|
-
fax:
|
|
428
|
-
email:
|
|
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(),
|
|
429
474
|
address: AddressSchema.optional(),
|
|
430
|
-
hours:
|
|
475
|
+
hours: z3.string().optional()
|
|
431
476
|
});
|
|
432
|
-
var FormReferenceSchema =
|
|
433
|
-
formNumber:
|
|
434
|
-
editionDate:
|
|
435
|
-
title:
|
|
436
|
-
formType:
|
|
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"])
|
|
437
482
|
});
|
|
438
|
-
var TaxFeeItemSchema =
|
|
439
|
-
name:
|
|
440
|
-
amount:
|
|
441
|
-
type:
|
|
442
|
-
description:
|
|
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()
|
|
443
488
|
});
|
|
444
|
-
var RatingBasisSchema =
|
|
489
|
+
var RatingBasisSchema = z3.object({
|
|
445
490
|
type: RatingBasisTypeSchema,
|
|
446
|
-
amount:
|
|
447
|
-
description:
|
|
491
|
+
amount: z3.string().optional(),
|
|
492
|
+
description: z3.string().optional()
|
|
448
493
|
});
|
|
449
|
-
var SublimitSchema =
|
|
450
|
-
name:
|
|
451
|
-
limit:
|
|
452
|
-
appliesTo:
|
|
453
|
-
deductible:
|
|
494
|
+
var SublimitSchema = z3.object({
|
|
495
|
+
name: z3.string(),
|
|
496
|
+
limit: z3.string(),
|
|
497
|
+
appliesTo: z3.string().optional(),
|
|
498
|
+
deductible: z3.string().optional()
|
|
454
499
|
});
|
|
455
|
-
var SharedLimitSchema =
|
|
456
|
-
description:
|
|
457
|
-
limit:
|
|
458
|
-
coverageParts:
|
|
500
|
+
var SharedLimitSchema = z3.object({
|
|
501
|
+
description: z3.string(),
|
|
502
|
+
limit: z3.string(),
|
|
503
|
+
coverageParts: z3.array(z3.string())
|
|
459
504
|
});
|
|
460
|
-
var ExtendedReportingPeriodSchema =
|
|
461
|
-
basicDays:
|
|
462
|
-
supplementalYears:
|
|
463
|
-
supplementalPremium:
|
|
505
|
+
var ExtendedReportingPeriodSchema = z3.object({
|
|
506
|
+
basicDays: z3.number().optional(),
|
|
507
|
+
supplementalYears: z3.number().optional(),
|
|
508
|
+
supplementalPremium: z3.string().optional()
|
|
464
509
|
});
|
|
465
|
-
var NamedInsuredSchema =
|
|
466
|
-
name:
|
|
467
|
-
relationship:
|
|
510
|
+
var NamedInsuredSchema = z3.object({
|
|
511
|
+
name: z3.string(),
|
|
512
|
+
relationship: z3.string().optional(),
|
|
468
513
|
address: AddressSchema.optional()
|
|
469
514
|
});
|
|
470
515
|
|
|
471
516
|
// src/schemas/coverage.ts
|
|
472
|
-
import { z as
|
|
473
|
-
var CoverageSchema =
|
|
474
|
-
name:
|
|
475
|
-
limit:
|
|
476
|
-
deductible:
|
|
477
|
-
pageNumber:
|
|
478
|
-
sectionRef:
|
|
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()
|
|
479
524
|
});
|
|
480
|
-
var EnrichedCoverageSchema =
|
|
481
|
-
name:
|
|
482
|
-
coverageCode:
|
|
483
|
-
formNumber:
|
|
484
|
-
formEditionDate:
|
|
485
|
-
limit:
|
|
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(),
|
|
486
531
|
limitType: LimitTypeSchema.optional(),
|
|
487
|
-
deductible:
|
|
532
|
+
deductible: z4.string().optional(),
|
|
488
533
|
deductibleType: DeductibleTypeSchema.optional(),
|
|
489
|
-
sir:
|
|
490
|
-
sublimit:
|
|
491
|
-
coinsurance:
|
|
534
|
+
sir: z4.string().optional(),
|
|
535
|
+
sublimit: z4.string().optional(),
|
|
536
|
+
coinsurance: z4.string().optional(),
|
|
492
537
|
valuation: ValuationMethodSchema.optional(),
|
|
493
|
-
territory:
|
|
538
|
+
territory: z4.string().optional(),
|
|
494
539
|
trigger: CoverageTriggerSchema.optional(),
|
|
495
|
-
retroactiveDate:
|
|
496
|
-
included:
|
|
497
|
-
premium:
|
|
498
|
-
pageNumber:
|
|
499
|
-
sectionRef:
|
|
540
|
+
retroactiveDate: z4.string().optional(),
|
|
541
|
+
included: z4.boolean(),
|
|
542
|
+
premium: z4.string().optional(),
|
|
543
|
+
pageNumber: z4.number().optional(),
|
|
544
|
+
sectionRef: z4.string().optional()
|
|
500
545
|
});
|
|
501
546
|
|
|
502
547
|
// src/schemas/endorsement.ts
|
|
503
|
-
import { z as
|
|
504
|
-
var EndorsementPartySchema =
|
|
505
|
-
name:
|
|
548
|
+
import { z as z5 } from "zod";
|
|
549
|
+
var EndorsementPartySchema = z5.object({
|
|
550
|
+
name: z5.string(),
|
|
506
551
|
role: EndorsementPartyRoleSchema,
|
|
507
552
|
address: AddressSchema.optional(),
|
|
508
|
-
relationship:
|
|
509
|
-
scope:
|
|
553
|
+
relationship: z5.string().optional(),
|
|
554
|
+
scope: z5.string().optional()
|
|
510
555
|
});
|
|
511
|
-
var EndorsementSchema =
|
|
512
|
-
formNumber:
|
|
513
|
-
editionDate:
|
|
514
|
-
title:
|
|
556
|
+
var EndorsementSchema = z5.object({
|
|
557
|
+
formNumber: z5.string(),
|
|
558
|
+
editionDate: z5.string().optional(),
|
|
559
|
+
title: z5.string(),
|
|
515
560
|
endorsementType: EndorsementTypeSchema,
|
|
516
|
-
effectiveDate:
|
|
517
|
-
affectedCoverageParts:
|
|
518
|
-
namedParties:
|
|
519
|
-
keyTerms:
|
|
520
|
-
premiumImpact:
|
|
521
|
-
content:
|
|
522
|
-
pageStart:
|
|
523
|
-
pageEnd:
|
|
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()
|
|
524
569
|
});
|
|
525
570
|
|
|
526
571
|
// src/schemas/exclusion.ts
|
|
527
|
-
import { z as
|
|
528
|
-
var ExclusionSchema =
|
|
529
|
-
name:
|
|
530
|
-
formNumber:
|
|
531
|
-
excludedPerils:
|
|
532
|
-
isAbsolute:
|
|
533
|
-
exceptions:
|
|
534
|
-
buybackAvailable:
|
|
535
|
-
buybackEndorsement:
|
|
536
|
-
appliesTo:
|
|
537
|
-
content:
|
|
538
|
-
pageNumber:
|
|
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()
|
|
539
584
|
});
|
|
540
585
|
|
|
541
586
|
// src/schemas/condition.ts
|
|
542
|
-
import { z as
|
|
543
|
-
var ConditionKeyValueSchema =
|
|
544
|
-
key:
|
|
545
|
-
value:
|
|
587
|
+
import { z as z7 } from "zod";
|
|
588
|
+
var ConditionKeyValueSchema = z7.object({
|
|
589
|
+
key: z7.string(),
|
|
590
|
+
value: z7.string()
|
|
546
591
|
});
|
|
547
|
-
var PolicyConditionSchema =
|
|
548
|
-
name:
|
|
592
|
+
var PolicyConditionSchema = z7.object({
|
|
593
|
+
name: z7.string(),
|
|
549
594
|
conditionType: ConditionTypeSchema,
|
|
550
|
-
content:
|
|
551
|
-
keyValues:
|
|
552
|
-
pageNumber:
|
|
595
|
+
content: z7.string(),
|
|
596
|
+
keyValues: z7.array(ConditionKeyValueSchema).optional(),
|
|
597
|
+
pageNumber: z7.number().optional()
|
|
553
598
|
});
|
|
554
599
|
|
|
555
600
|
// src/schemas/parties.ts
|
|
556
|
-
import { z as
|
|
557
|
-
var InsurerInfoSchema =
|
|
558
|
-
legalName:
|
|
559
|
-
naicNumber:
|
|
560
|
-
amBestRating:
|
|
561
|
-
amBestNumber:
|
|
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(),
|
|
562
607
|
admittedStatus: AdmittedStatusSchema.optional(),
|
|
563
|
-
stateOfDomicile:
|
|
608
|
+
stateOfDomicile: z8.string().optional()
|
|
564
609
|
});
|
|
565
|
-
var ProducerInfoSchema =
|
|
566
|
-
agencyName:
|
|
567
|
-
contactName:
|
|
568
|
-
licenseNumber:
|
|
569
|
-
phone:
|
|
570
|
-
email:
|
|
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(),
|
|
571
616
|
address: AddressSchema.optional()
|
|
572
617
|
});
|
|
573
618
|
|
|
574
619
|
// src/schemas/financial.ts
|
|
575
|
-
import { z as
|
|
576
|
-
var PaymentInstallmentSchema =
|
|
577
|
-
dueDate:
|
|
578
|
-
amount:
|
|
579
|
-
description:
|
|
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()
|
|
580
625
|
});
|
|
581
|
-
var PaymentPlanSchema =
|
|
582
|
-
installments:
|
|
583
|
-
financeCharge:
|
|
626
|
+
var PaymentPlanSchema = z9.object({
|
|
627
|
+
installments: z9.array(PaymentInstallmentSchema),
|
|
628
|
+
financeCharge: z9.string().optional()
|
|
584
629
|
});
|
|
585
|
-
var LocationPremiumSchema =
|
|
586
|
-
locationNumber:
|
|
587
|
-
premium:
|
|
588
|
-
description:
|
|
630
|
+
var LocationPremiumSchema = z9.object({
|
|
631
|
+
locationNumber: z9.number(),
|
|
632
|
+
premium: z9.string(),
|
|
633
|
+
description: z9.string().optional()
|
|
589
634
|
});
|
|
590
635
|
|
|
591
636
|
// src/schemas/loss-history.ts
|
|
592
|
-
import { z as
|
|
593
|
-
var ClaimRecordSchema =
|
|
594
|
-
dateOfLoss:
|
|
595
|
-
claimNumber:
|
|
596
|
-
description:
|
|
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(),
|
|
597
642
|
status: ClaimStatusSchema,
|
|
598
|
-
paid:
|
|
599
|
-
reserved:
|
|
600
|
-
incurred:
|
|
601
|
-
claimant:
|
|
602
|
-
coverageLine:
|
|
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()
|
|
603
648
|
});
|
|
604
|
-
var LossSummarySchema =
|
|
605
|
-
period:
|
|
606
|
-
totalClaims:
|
|
607
|
-
totalIncurred:
|
|
608
|
-
totalPaid:
|
|
609
|
-
totalReserved:
|
|
610
|
-
lossRatio:
|
|
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()
|
|
611
656
|
});
|
|
612
|
-
var ExperienceModSchema =
|
|
613
|
-
factor:
|
|
614
|
-
effectiveDate:
|
|
615
|
-
state:
|
|
657
|
+
var ExperienceModSchema = z10.object({
|
|
658
|
+
factor: z10.number(),
|
|
659
|
+
effectiveDate: z10.string().optional(),
|
|
660
|
+
state: z10.string().optional()
|
|
616
661
|
});
|
|
617
662
|
|
|
618
663
|
// src/schemas/underwriting.ts
|
|
619
|
-
import { z as
|
|
620
|
-
var EnrichedSubjectivitySchema =
|
|
621
|
-
description:
|
|
664
|
+
import { z as z11 } from "zod";
|
|
665
|
+
var EnrichedSubjectivitySchema = z11.object({
|
|
666
|
+
description: z11.string(),
|
|
622
667
|
category: SubjectivityCategorySchema.optional(),
|
|
623
|
-
dueDate:
|
|
624
|
-
status:
|
|
625
|
-
pageNumber:
|
|
668
|
+
dueDate: z11.string().optional(),
|
|
669
|
+
status: z11.enum(["open", "satisfied", "waived"]).optional(),
|
|
670
|
+
pageNumber: z11.number().optional()
|
|
626
671
|
});
|
|
627
|
-
var EnrichedUnderwritingConditionSchema =
|
|
628
|
-
description:
|
|
629
|
-
category:
|
|
630
|
-
pageNumber:
|
|
672
|
+
var EnrichedUnderwritingConditionSchema = z11.object({
|
|
673
|
+
description: z11.string(),
|
|
674
|
+
category: z11.string().optional(),
|
|
675
|
+
pageNumber: z11.number().optional()
|
|
631
676
|
});
|
|
632
|
-
var BindingAuthoritySchema =
|
|
633
|
-
authorizedBy:
|
|
634
|
-
method:
|
|
635
|
-
expiration:
|
|
636
|
-
conditions:
|
|
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()
|
|
637
682
|
});
|
|
638
683
|
|
|
639
684
|
// src/schemas/declarations/index.ts
|
|
640
|
-
import { z as
|
|
685
|
+
import { z as z15 } from "zod";
|
|
641
686
|
|
|
642
687
|
// src/schemas/declarations/personal.ts
|
|
643
|
-
import { z as
|
|
688
|
+
import { z as z13 } from "zod";
|
|
644
689
|
|
|
645
690
|
// src/schemas/declarations/shared.ts
|
|
646
|
-
import { z as
|
|
647
|
-
var EmployersLiabilityLimitsSchema =
|
|
648
|
-
eachAccident:
|
|
649
|
-
diseasePolicyLimit:
|
|
650
|
-
diseaseEachEmployee:
|
|
691
|
+
import { z as z12 } from "zod";
|
|
692
|
+
var EmployersLiabilityLimitsSchema = z12.object({
|
|
693
|
+
eachAccident: z12.string(),
|
|
694
|
+
diseasePolicyLimit: z12.string(),
|
|
695
|
+
diseaseEachEmployee: z12.string()
|
|
651
696
|
});
|
|
652
|
-
var LimitScheduleSchema =
|
|
653
|
-
perOccurrence:
|
|
654
|
-
generalAggregate:
|
|
655
|
-
productsCompletedOpsAggregate:
|
|
656
|
-
personalAdvertisingInjury:
|
|
657
|
-
eachEmployee:
|
|
658
|
-
fireDamage:
|
|
659
|
-
medicalExpense:
|
|
660
|
-
combinedSingleLimit:
|
|
661
|
-
bodilyInjuryPerPerson:
|
|
662
|
-
bodilyInjuryPerAccident:
|
|
663
|
-
propertyDamage:
|
|
664
|
-
eachOccurrenceUmbrella:
|
|
665
|
-
umbrellaAggregate:
|
|
666
|
-
umbrellaRetention:
|
|
667
|
-
statutory:
|
|
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(),
|
|
668
713
|
employersLiability: EmployersLiabilityLimitsSchema.optional(),
|
|
669
|
-
sublimits:
|
|
670
|
-
sharedLimits:
|
|
714
|
+
sublimits: z12.array(SublimitSchema).optional(),
|
|
715
|
+
sharedLimits: z12.array(SharedLimitSchema).optional(),
|
|
671
716
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional()
|
|
672
717
|
});
|
|
673
|
-
var DeductibleScheduleSchema =
|
|
674
|
-
perClaim:
|
|
675
|
-
perOccurrence:
|
|
676
|
-
aggregateDeductible:
|
|
677
|
-
selfInsuredRetention:
|
|
678
|
-
corridorDeductible:
|
|
679
|
-
waitingPeriod:
|
|
680
|
-
appliesTo:
|
|
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()
|
|
681
726
|
});
|
|
682
|
-
var InsuredLocationSchema =
|
|
683
|
-
number:
|
|
727
|
+
var InsuredLocationSchema = z12.object({
|
|
728
|
+
number: z12.number(),
|
|
684
729
|
address: AddressSchema,
|
|
685
|
-
description:
|
|
686
|
-
buildingValue:
|
|
687
|
-
contentsValue:
|
|
688
|
-
businessIncomeValue:
|
|
689
|
-
constructionType:
|
|
690
|
-
yearBuilt:
|
|
691
|
-
squareFootage:
|
|
692
|
-
protectionClass:
|
|
693
|
-
sprinklered:
|
|
694
|
-
alarmType:
|
|
695
|
-
occupancy:
|
|
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()
|
|
696
741
|
});
|
|
697
|
-
var VehicleCoverageSchema =
|
|
742
|
+
var VehicleCoverageSchema = z12.object({
|
|
698
743
|
type: VehicleCoverageTypeSchema,
|
|
699
|
-
limit:
|
|
700
|
-
deductible:
|
|
701
|
-
included:
|
|
744
|
+
limit: z12.string().optional(),
|
|
745
|
+
deductible: z12.string().optional(),
|
|
746
|
+
included: z12.boolean()
|
|
702
747
|
});
|
|
703
|
-
var InsuredVehicleSchema =
|
|
704
|
-
number:
|
|
705
|
-
year:
|
|
706
|
-
make:
|
|
707
|
-
model:
|
|
708
|
-
vin:
|
|
709
|
-
costNew:
|
|
710
|
-
statedValue:
|
|
711
|
-
garageLocation:
|
|
712
|
-
coverages:
|
|
713
|
-
radius:
|
|
714
|
-
vehicleType:
|
|
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()
|
|
715
760
|
});
|
|
716
|
-
var ClassificationCodeSchema =
|
|
717
|
-
code:
|
|
718
|
-
description:
|
|
719
|
-
premiumBasis:
|
|
720
|
-
basisAmount:
|
|
721
|
-
rate:
|
|
722
|
-
premium:
|
|
723
|
-
locationNumber:
|
|
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()
|
|
724
769
|
});
|
|
725
|
-
var DwellingDetailsSchema =
|
|
770
|
+
var DwellingDetailsSchema = z12.object({
|
|
726
771
|
constructionType: ConstructionTypeSchema.optional(),
|
|
727
|
-
yearBuilt:
|
|
728
|
-
squareFootage:
|
|
729
|
-
stories:
|
|
772
|
+
yearBuilt: z12.number().optional(),
|
|
773
|
+
squareFootage: z12.number().optional(),
|
|
774
|
+
stories: z12.number().optional(),
|
|
730
775
|
roofType: RoofTypeSchema.optional(),
|
|
731
|
-
roofAge:
|
|
732
|
-
heatingType:
|
|
776
|
+
roofAge: z12.number().optional(),
|
|
777
|
+
heatingType: z12.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
|
|
733
778
|
foundationType: FoundationTypeSchema.optional(),
|
|
734
|
-
plumbingType:
|
|
735
|
-
electricalType:
|
|
736
|
-
electricalAmps:
|
|
737
|
-
hasSwimmingPool:
|
|
738
|
-
poolType:
|
|
739
|
-
hasTrampoline:
|
|
740
|
-
hasDog:
|
|
741
|
-
dogBreed:
|
|
742
|
-
protectiveDevices:
|
|
743
|
-
distanceToFireStation:
|
|
744
|
-
distanceToHydrant:
|
|
745
|
-
fireProtectionClass:
|
|
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()
|
|
746
791
|
});
|
|
747
|
-
var DriverRecordSchema =
|
|
748
|
-
name:
|
|
749
|
-
dateOfBirth:
|
|
750
|
-
licenseNumber:
|
|
751
|
-
licenseState:
|
|
752
|
-
relationship:
|
|
753
|
-
yearsLicensed:
|
|
754
|
-
gender:
|
|
755
|
-
maritalStatus:
|
|
756
|
-
goodStudentDiscount:
|
|
757
|
-
defensiveDriverDiscount:
|
|
758
|
-
violations:
|
|
759
|
-
date:
|
|
760
|
-
type:
|
|
761
|
-
description:
|
|
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()
|
|
762
807
|
})).optional(),
|
|
763
|
-
accidents:
|
|
764
|
-
date:
|
|
765
|
-
atFault:
|
|
766
|
-
description:
|
|
767
|
-
amountPaid:
|
|
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()
|
|
768
813
|
})).optional(),
|
|
769
|
-
sr22Required:
|
|
814
|
+
sr22Required: z12.boolean().optional()
|
|
770
815
|
});
|
|
771
|
-
var PersonalVehicleDetailsSchema =
|
|
772
|
-
number:
|
|
773
|
-
year:
|
|
774
|
-
make:
|
|
775
|
-
model:
|
|
776
|
-
vin:
|
|
777
|
-
bodyType:
|
|
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(),
|
|
778
823
|
garagingAddress: AddressSchema.optional(),
|
|
779
824
|
usage: PersonalAutoUsageSchema.optional(),
|
|
780
|
-
annualMileage:
|
|
781
|
-
odometerReading:
|
|
782
|
-
driverAssignment:
|
|
825
|
+
annualMileage: z12.number().optional(),
|
|
826
|
+
odometerReading: z12.number().optional(),
|
|
827
|
+
driverAssignment: z12.string().optional(),
|
|
783
828
|
lienHolder: EndorsementPartySchema.optional(),
|
|
784
|
-
collisionDeductible:
|
|
785
|
-
comprehensiveDeductible:
|
|
786
|
-
rentalReimbursement:
|
|
787
|
-
towing:
|
|
829
|
+
collisionDeductible: z12.string().optional(),
|
|
830
|
+
comprehensiveDeductible: z12.string().optional(),
|
|
831
|
+
rentalReimbursement: z12.boolean().optional(),
|
|
832
|
+
towing: z12.boolean().optional()
|
|
788
833
|
});
|
|
789
834
|
|
|
790
835
|
// src/schemas/declarations/personal.ts
|
|
791
|
-
var HomeownersDeclarationsSchema =
|
|
792
|
-
line:
|
|
836
|
+
var HomeownersDeclarationsSchema = z13.object({
|
|
837
|
+
line: z13.literal("homeowners"),
|
|
793
838
|
formType: HomeownersFormTypeSchema,
|
|
794
|
-
coverageA:
|
|
795
|
-
coverageB:
|
|
796
|
-
coverageC:
|
|
797
|
-
coverageD:
|
|
798
|
-
coverageE:
|
|
799
|
-
coverageF:
|
|
800
|
-
allPerilDeductible:
|
|
801
|
-
windHailDeductible:
|
|
802
|
-
hurricaneDeductible:
|
|
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(),
|
|
803
848
|
lossSettlement: LossSettlementSchema.optional(),
|
|
804
849
|
dwelling: DwellingDetailsSchema,
|
|
805
850
|
mortgagee: EndorsementPartySchema.optional(),
|
|
806
|
-
additionalMortgagees:
|
|
851
|
+
additionalMortgagees: z13.array(EndorsementPartySchema).optional()
|
|
807
852
|
});
|
|
808
|
-
var PersonalAutoDeclarationsSchema =
|
|
809
|
-
line:
|
|
810
|
-
vehicles:
|
|
811
|
-
drivers:
|
|
812
|
-
liabilityLimits:
|
|
813
|
-
bodilyInjuryPerPerson:
|
|
814
|
-
bodilyInjuryPerAccident:
|
|
815
|
-
propertyDamage:
|
|
816
|
-
combinedSingleLimit:
|
|
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()
|
|
817
862
|
}).optional(),
|
|
818
|
-
umLimits:
|
|
819
|
-
bodilyInjuryPerPerson:
|
|
820
|
-
bodilyInjuryPerAccident:
|
|
863
|
+
umLimits: z13.object({
|
|
864
|
+
bodilyInjuryPerPerson: z13.string().optional(),
|
|
865
|
+
bodilyInjuryPerAccident: z13.string().optional()
|
|
821
866
|
}).optional(),
|
|
822
|
-
uimLimits:
|
|
823
|
-
bodilyInjuryPerPerson:
|
|
824
|
-
bodilyInjuryPerAccident:
|
|
867
|
+
uimLimits: z13.object({
|
|
868
|
+
bodilyInjuryPerPerson: z13.string().optional(),
|
|
869
|
+
bodilyInjuryPerAccident: z13.string().optional()
|
|
825
870
|
}).optional(),
|
|
826
|
-
pipLimit:
|
|
827
|
-
medPayLimit:
|
|
871
|
+
pipLimit: z13.string().optional(),
|
|
872
|
+
medPayLimit: z13.string().optional()
|
|
828
873
|
});
|
|
829
|
-
var DwellingFireDeclarationsSchema =
|
|
830
|
-
line:
|
|
874
|
+
var DwellingFireDeclarationsSchema = z13.object({
|
|
875
|
+
line: z13.literal("dwelling_fire"),
|
|
831
876
|
formType: DwellingFireFormTypeSchema,
|
|
832
|
-
dwellingLimit:
|
|
833
|
-
otherStructuresLimit:
|
|
834
|
-
personalPropertyLimit:
|
|
835
|
-
fairRentalValueLimit:
|
|
836
|
-
liabilityLimit:
|
|
837
|
-
medicalPaymentsLimit:
|
|
838
|
-
deductible:
|
|
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(),
|
|
839
884
|
dwelling: DwellingDetailsSchema
|
|
840
885
|
});
|
|
841
|
-
var FloodDeclarationsSchema =
|
|
842
|
-
line:
|
|
843
|
-
programType:
|
|
886
|
+
var FloodDeclarationsSchema = z13.object({
|
|
887
|
+
line: z13.literal("flood"),
|
|
888
|
+
programType: z13.enum(["nfip", "private"]),
|
|
844
889
|
floodZone: FloodZoneSchema.optional(),
|
|
845
|
-
communityNumber:
|
|
846
|
-
communityRating:
|
|
847
|
-
buildingCoverage:
|
|
848
|
-
contentsCoverage:
|
|
849
|
-
iccCoverage:
|
|
850
|
-
deductible:
|
|
851
|
-
waitingPeriodDays:
|
|
852
|
-
elevationCertificate:
|
|
853
|
-
elevationDifference:
|
|
854
|
-
buildingDiagramNumber:
|
|
855
|
-
basementOrEnclosure:
|
|
856
|
-
postFirmConstruction:
|
|
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()
|
|
857
902
|
});
|
|
858
|
-
var EarthquakeDeclarationsSchema =
|
|
859
|
-
line:
|
|
860
|
-
dwellingCoverage:
|
|
861
|
-
contentsCoverage:
|
|
862
|
-
lossOfUseCoverage:
|
|
863
|
-
deductiblePercent:
|
|
864
|
-
retrofitDiscount:
|
|
865
|
-
masonryVeneerCoverage:
|
|
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()
|
|
866
911
|
});
|
|
867
|
-
var PersonalUmbrellaDeclarationsSchema =
|
|
868
|
-
line:
|
|
869
|
-
perOccurrenceLimit:
|
|
870
|
-
aggregateLimit:
|
|
871
|
-
retainedLimit:
|
|
872
|
-
underlyingPolicies:
|
|
873
|
-
carrier:
|
|
874
|
-
policyNumber:
|
|
875
|
-
policyType:
|
|
876
|
-
limits:
|
|
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()
|
|
877
922
|
}))
|
|
878
923
|
});
|
|
879
|
-
var PersonalArticlesDeclarationsSchema =
|
|
880
|
-
line:
|
|
881
|
-
scheduledItems:
|
|
882
|
-
itemNumber:
|
|
924
|
+
var PersonalArticlesDeclarationsSchema = z13.object({
|
|
925
|
+
line: z13.literal("personal_articles"),
|
|
926
|
+
scheduledItems: z13.array(z13.object({
|
|
927
|
+
itemNumber: z13.number().optional(),
|
|
883
928
|
category: ScheduledItemCategorySchema.optional(),
|
|
884
|
-
description:
|
|
885
|
-
appraisedValue:
|
|
886
|
-
appraisalDate:
|
|
929
|
+
description: z13.string(),
|
|
930
|
+
appraisedValue: z13.string(),
|
|
931
|
+
appraisalDate: z13.string().optional()
|
|
887
932
|
})),
|
|
888
|
-
blanketCoverage:
|
|
889
|
-
deductible:
|
|
890
|
-
worldwideCoverage:
|
|
891
|
-
breakageCoverage:
|
|
933
|
+
blanketCoverage: z13.string().optional(),
|
|
934
|
+
deductible: z13.string().optional(),
|
|
935
|
+
worldwideCoverage: z13.boolean().optional(),
|
|
936
|
+
breakageCoverage: z13.boolean().optional()
|
|
892
937
|
});
|
|
893
|
-
var WatercraftDeclarationsSchema =
|
|
894
|
-
line:
|
|
938
|
+
var WatercraftDeclarationsSchema = z13.object({
|
|
939
|
+
line: z13.literal("watercraft"),
|
|
895
940
|
boatType: BoatTypeSchema.optional(),
|
|
896
|
-
year:
|
|
897
|
-
make:
|
|
898
|
-
model:
|
|
899
|
-
length:
|
|
900
|
-
hullMaterial:
|
|
901
|
-
hullValue:
|
|
902
|
-
motorHorsepower:
|
|
903
|
-
motorType:
|
|
904
|
-
navigationLimits:
|
|
905
|
-
layupPeriod:
|
|
906
|
-
liabilityLimit:
|
|
907
|
-
medicalPaymentsLimit:
|
|
908
|
-
physicalDamageDeductible:
|
|
909
|
-
uninsuredBoaterLimit:
|
|
910
|
-
trailerCovered:
|
|
911
|
-
trailerValue:
|
|
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()
|
|
912
957
|
});
|
|
913
|
-
var RecreationalVehicleDeclarationsSchema =
|
|
914
|
-
line:
|
|
958
|
+
var RecreationalVehicleDeclarationsSchema = z13.object({
|
|
959
|
+
line: z13.literal("recreational_vehicle"),
|
|
915
960
|
vehicleType: RVTypeSchema,
|
|
916
|
-
year:
|
|
917
|
-
make:
|
|
918
|
-
model:
|
|
919
|
-
vin:
|
|
920
|
-
value:
|
|
921
|
-
liabilityLimit:
|
|
922
|
-
collisionDeductible:
|
|
923
|
-
comprehensiveDeductible:
|
|
924
|
-
personalEffectsCoverage:
|
|
925
|
-
fullTimerCoverage:
|
|
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()
|
|
926
971
|
});
|
|
927
|
-
var FarmRanchDeclarationsSchema =
|
|
928
|
-
line:
|
|
929
|
-
dwellingCoverage:
|
|
930
|
-
farmPersonalPropertyCoverage:
|
|
931
|
-
farmLiabilityLimit:
|
|
932
|
-
farmAutoIncluded:
|
|
933
|
-
livestock:
|
|
934
|
-
type:
|
|
935
|
-
headCount:
|
|
936
|
-
value:
|
|
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()
|
|
937
982
|
})).optional(),
|
|
938
|
-
equipmentSchedule:
|
|
939
|
-
description:
|
|
940
|
-
value:
|
|
983
|
+
equipmentSchedule: z13.array(z13.object({
|
|
984
|
+
description: z13.string(),
|
|
985
|
+
value: z13.string()
|
|
941
986
|
})).optional(),
|
|
942
|
-
acreage:
|
|
987
|
+
acreage: z13.number().optional(),
|
|
943
988
|
dwelling: DwellingDetailsSchema.optional()
|
|
944
989
|
});
|
|
945
|
-
var TitleDeclarationsSchema =
|
|
946
|
-
line:
|
|
990
|
+
var TitleDeclarationsSchema = z13.object({
|
|
991
|
+
line: z13.literal("title"),
|
|
947
992
|
policyType: TitlePolicyTypeSchema,
|
|
948
|
-
policyAmount:
|
|
949
|
-
legalDescription:
|
|
993
|
+
policyAmount: z13.string(),
|
|
994
|
+
legalDescription: z13.string().optional(),
|
|
950
995
|
propertyAddress: AddressSchema.optional(),
|
|
951
|
-
effectiveDate:
|
|
952
|
-
exceptions:
|
|
953
|
-
number:
|
|
954
|
-
description:
|
|
996
|
+
effectiveDate: z13.string().optional(),
|
|
997
|
+
exceptions: z13.array(z13.object({
|
|
998
|
+
number: z13.number(),
|
|
999
|
+
description: z13.string()
|
|
955
1000
|
})).optional(),
|
|
956
|
-
underwriter:
|
|
1001
|
+
underwriter: z13.string().optional()
|
|
957
1002
|
});
|
|
958
|
-
var PetDeclarationsSchema =
|
|
959
|
-
line:
|
|
1003
|
+
var PetDeclarationsSchema = z13.object({
|
|
1004
|
+
line: z13.literal("pet"),
|
|
960
1005
|
species: PetSpeciesSchema,
|
|
961
|
-
breed:
|
|
962
|
-
petName:
|
|
963
|
-
age:
|
|
964
|
-
annualLimit:
|
|
965
|
-
perIncidentLimit:
|
|
966
|
-
deductible:
|
|
967
|
-
reimbursementPercent:
|
|
968
|
-
waitingPeriodDays:
|
|
969
|
-
preExistingConditionsExcluded:
|
|
970
|
-
wellnessCoverage:
|
|
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()
|
|
971
1016
|
});
|
|
972
|
-
var TravelDeclarationsSchema =
|
|
973
|
-
line:
|
|
974
|
-
tripDepartureDate:
|
|
975
|
-
tripReturnDate:
|
|
976
|
-
destinations:
|
|
977
|
-
travelers:
|
|
978
|
-
name:
|
|
979
|
-
age:
|
|
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()
|
|
980
1025
|
})).optional(),
|
|
981
|
-
tripCost:
|
|
982
|
-
tripCancellationLimit:
|
|
983
|
-
medicalLimit:
|
|
984
|
-
evacuationLimit:
|
|
985
|
-
baggageLimit:
|
|
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()
|
|
986
1031
|
});
|
|
987
|
-
var IdentityTheftDeclarationsSchema =
|
|
988
|
-
line:
|
|
989
|
-
coverageLimit:
|
|
990
|
-
expenseReimbursement:
|
|
991
|
-
creditMonitoring:
|
|
992
|
-
restorationServices:
|
|
993
|
-
lostWagesLimit:
|
|
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()
|
|
994
1039
|
});
|
|
995
1040
|
|
|
996
1041
|
// src/schemas/declarations/commercial.ts
|
|
997
|
-
import { z as
|
|
998
|
-
var GLDeclarationsSchema =
|
|
999
|
-
line:
|
|
1042
|
+
import { z as z14 } from "zod";
|
|
1043
|
+
var GLDeclarationsSchema = z14.object({
|
|
1044
|
+
line: z14.literal("gl"),
|
|
1000
1045
|
coverageForm: CoverageFormSchema.optional(),
|
|
1001
|
-
perOccurrenceLimit:
|
|
1002
|
-
generalAggregate:
|
|
1003
|
-
productsCompletedOpsAggregate:
|
|
1004
|
-
personalAdvertisingInjury:
|
|
1005
|
-
fireDamage:
|
|
1006
|
-
medicalExpense:
|
|
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(),
|
|
1007
1052
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1008
|
-
deductible:
|
|
1009
|
-
classifications:
|
|
1010
|
-
retroactiveDate:
|
|
1053
|
+
deductible: z14.string().optional(),
|
|
1054
|
+
classifications: z14.array(ClassificationCodeSchema).optional(),
|
|
1055
|
+
retroactiveDate: z14.string().optional()
|
|
1011
1056
|
});
|
|
1012
|
-
var CommercialPropertyDeclarationsSchema =
|
|
1013
|
-
line:
|
|
1014
|
-
causesOfLossForm:
|
|
1015
|
-
coinsurancePercent:
|
|
1057
|
+
var CommercialPropertyDeclarationsSchema = z14.object({
|
|
1058
|
+
line: z14.literal("commercial_property"),
|
|
1059
|
+
causesOfLossForm: z14.enum(["basic", "broad", "special"]).optional(),
|
|
1060
|
+
coinsurancePercent: z14.number().optional(),
|
|
1016
1061
|
valuationMethod: ValuationMethodSchema.optional(),
|
|
1017
|
-
locations:
|
|
1018
|
-
blanketLimit:
|
|
1019
|
-
businessIncomeLimit:
|
|
1020
|
-
extraExpenseLimit:
|
|
1062
|
+
locations: z14.array(InsuredLocationSchema),
|
|
1063
|
+
blanketLimit: z14.string().optional(),
|
|
1064
|
+
businessIncomeLimit: z14.string().optional(),
|
|
1065
|
+
extraExpenseLimit: z14.string().optional()
|
|
1021
1066
|
});
|
|
1022
|
-
var CommercialAutoDeclarationsSchema =
|
|
1023
|
-
line:
|
|
1024
|
-
vehicles:
|
|
1025
|
-
coveredAutoSymbols:
|
|
1026
|
-
liabilityLimit:
|
|
1027
|
-
umLimit:
|
|
1028
|
-
uimLimit:
|
|
1029
|
-
hiredAutoLiability:
|
|
1030
|
-
nonOwnedAutoLiability:
|
|
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()
|
|
1031
1076
|
});
|
|
1032
|
-
var WorkersCompDeclarationsSchema =
|
|
1033
|
-
line:
|
|
1034
|
-
coveredStates:
|
|
1035
|
-
classifications:
|
|
1077
|
+
var WorkersCompDeclarationsSchema = z14.object({
|
|
1078
|
+
line: z14.literal("workers_comp"),
|
|
1079
|
+
coveredStates: z14.array(z14.string()).optional(),
|
|
1080
|
+
classifications: z14.array(ClassificationCodeSchema),
|
|
1036
1081
|
experienceMod: ExperienceModSchema.optional(),
|
|
1037
1082
|
employersLiability: EmployersLiabilityLimitsSchema.optional()
|
|
1038
1083
|
});
|
|
1039
|
-
var UmbrellaExcessDeclarationsSchema =
|
|
1040
|
-
line:
|
|
1041
|
-
perOccurrenceLimit:
|
|
1042
|
-
aggregateLimit:
|
|
1043
|
-
retention:
|
|
1044
|
-
underlyingPolicies:
|
|
1045
|
-
carrier:
|
|
1046
|
-
policyNumber:
|
|
1047
|
-
policyType:
|
|
1048
|
-
limits:
|
|
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()
|
|
1049
1094
|
}))
|
|
1050
1095
|
});
|
|
1051
|
-
var ProfessionalLiabilityDeclarationsSchema =
|
|
1052
|
-
line:
|
|
1053
|
-
perClaimLimit:
|
|
1054
|
-
aggregateLimit:
|
|
1055
|
-
retroactiveDate:
|
|
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(),
|
|
1056
1101
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1057
1102
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
|
|
1058
1103
|
});
|
|
1059
|
-
var CyberDeclarationsSchema =
|
|
1060
|
-
line:
|
|
1061
|
-
aggregateLimit:
|
|
1062
|
-
retroactiveDate:
|
|
1063
|
-
waitingPeriodHours:
|
|
1064
|
-
sublimits:
|
|
1065
|
-
coverageName:
|
|
1066
|
-
limit:
|
|
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()
|
|
1067
1112
|
})).optional()
|
|
1068
1113
|
});
|
|
1069
|
-
var DODeclarationsSchema =
|
|
1070
|
-
line:
|
|
1071
|
-
sideALimit:
|
|
1072
|
-
sideBLimit:
|
|
1073
|
-
sideCLimit:
|
|
1074
|
-
sideARetention:
|
|
1075
|
-
sideBRetention:
|
|
1076
|
-
sideCRetention:
|
|
1077
|
-
continuityDate:
|
|
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()
|
|
1078
1123
|
});
|
|
1079
|
-
var CrimeDeclarationsSchema =
|
|
1080
|
-
line:
|
|
1081
|
-
formType:
|
|
1082
|
-
agreements:
|
|
1083
|
-
agreement:
|
|
1084
|
-
coverageName:
|
|
1085
|
-
limit:
|
|
1086
|
-
deductible:
|
|
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()
|
|
1087
1132
|
}))
|
|
1088
1133
|
});
|
|
1089
1134
|
|
|
1090
1135
|
// src/schemas/declarations/index.ts
|
|
1091
|
-
var DeclarationsSchema =
|
|
1136
|
+
var DeclarationsSchema = z15.discriminatedUnion("line", [
|
|
1092
1137
|
// Personal lines
|
|
1093
1138
|
HomeownersDeclarationsSchema,
|
|
1094
1139
|
PersonalAutoDeclarationsSchema,
|
|
@@ -1117,137 +1162,137 @@ var DeclarationsSchema = z14.discriminatedUnion("line", [
|
|
|
1117
1162
|
]);
|
|
1118
1163
|
|
|
1119
1164
|
// src/schemas/document.ts
|
|
1120
|
-
import { z as
|
|
1121
|
-
var SubsectionSchema =
|
|
1122
|
-
title:
|
|
1123
|
-
sectionNumber:
|
|
1124
|
-
pageNumber:
|
|
1125
|
-
content:
|
|
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()
|
|
1126
1171
|
});
|
|
1127
|
-
var SectionSchema =
|
|
1128
|
-
title:
|
|
1129
|
-
sectionNumber:
|
|
1130
|
-
pageStart:
|
|
1131
|
-
pageEnd:
|
|
1132
|
-
type:
|
|
1133
|
-
coverageType:
|
|
1134
|
-
content:
|
|
1135
|
-
subsections:
|
|
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()
|
|
1136
1181
|
});
|
|
1137
|
-
var SubjectivitySchema =
|
|
1138
|
-
description:
|
|
1139
|
-
category:
|
|
1182
|
+
var SubjectivitySchema = z16.object({
|
|
1183
|
+
description: z16.string(),
|
|
1184
|
+
category: z16.string().optional()
|
|
1140
1185
|
});
|
|
1141
|
-
var UnderwritingConditionSchema =
|
|
1142
|
-
description:
|
|
1186
|
+
var UnderwritingConditionSchema = z16.object({
|
|
1187
|
+
description: z16.string()
|
|
1143
1188
|
});
|
|
1144
|
-
var PremiumLineSchema =
|
|
1145
|
-
line:
|
|
1146
|
-
amount:
|
|
1189
|
+
var PremiumLineSchema = z16.object({
|
|
1190
|
+
line: z16.string(),
|
|
1191
|
+
amount: z16.string()
|
|
1147
1192
|
});
|
|
1148
1193
|
var BaseDocumentFields = {
|
|
1149
|
-
id:
|
|
1150
|
-
carrier:
|
|
1151
|
-
security:
|
|
1152
|
-
insuredName:
|
|
1153
|
-
premium:
|
|
1154
|
-
summary:
|
|
1155
|
-
policyTypes:
|
|
1156
|
-
coverages:
|
|
1157
|
-
sections:
|
|
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(),
|
|
1158
1203
|
// Enriched fields (v1.2+)
|
|
1159
|
-
carrierLegalName:
|
|
1160
|
-
carrierNaicNumber:
|
|
1161
|
-
carrierAmBestRating:
|
|
1162
|
-
carrierAdmittedStatus:
|
|
1163
|
-
mga:
|
|
1164
|
-
underwriter:
|
|
1165
|
-
brokerAgency:
|
|
1166
|
-
brokerContactName:
|
|
1167
|
-
brokerLicenseNumber:
|
|
1168
|
-
priorPolicyNumber:
|
|
1169
|
-
programName:
|
|
1170
|
-
isRenewal:
|
|
1171
|
-
isPackage:
|
|
1172
|
-
insuredDba:
|
|
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(),
|
|
1173
1218
|
insuredAddress: AddressSchema.optional(),
|
|
1174
1219
|
insuredEntityType: EntityTypeSchema.optional(),
|
|
1175
|
-
additionalNamedInsureds:
|
|
1176
|
-
insuredSicCode:
|
|
1177
|
-
insuredNaicsCode:
|
|
1178
|
-
insuredFein:
|
|
1179
|
-
enrichedCoverages:
|
|
1180
|
-
endorsements:
|
|
1181
|
-
exclusions:
|
|
1182
|
-
conditions:
|
|
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(),
|
|
1183
1228
|
limits: LimitScheduleSchema.optional(),
|
|
1184
1229
|
deductibles: DeductibleScheduleSchema.optional(),
|
|
1185
|
-
locations:
|
|
1186
|
-
vehicles:
|
|
1187
|
-
classifications:
|
|
1188
|
-
formInventory:
|
|
1230
|
+
locations: z16.array(InsuredLocationSchema).optional(),
|
|
1231
|
+
vehicles: z16.array(InsuredVehicleSchema).optional(),
|
|
1232
|
+
classifications: z16.array(ClassificationCodeSchema).optional(),
|
|
1233
|
+
formInventory: z16.array(FormReferenceSchema).optional(),
|
|
1189
1234
|
declarations: DeclarationsSchema.optional(),
|
|
1190
1235
|
coverageForm: CoverageFormSchema.optional(),
|
|
1191
|
-
retroactiveDate:
|
|
1236
|
+
retroactiveDate: z16.string().optional(),
|
|
1192
1237
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
|
|
1193
1238
|
insurer: InsurerInfoSchema.optional(),
|
|
1194
1239
|
producer: ProducerInfoSchema.optional(),
|
|
1195
|
-
claimsContacts:
|
|
1196
|
-
regulatoryContacts:
|
|
1197
|
-
thirdPartyAdministrators:
|
|
1198
|
-
additionalInsureds:
|
|
1199
|
-
lossPayees:
|
|
1200
|
-
mortgageHolders:
|
|
1201
|
-
taxesAndFees:
|
|
1202
|
-
totalCost:
|
|
1203
|
-
minimumPremium:
|
|
1204
|
-
depositPremium:
|
|
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(),
|
|
1205
1250
|
paymentPlan: PaymentPlanSchema.optional(),
|
|
1206
1251
|
auditType: AuditTypeSchema.optional(),
|
|
1207
|
-
ratingBasis:
|
|
1208
|
-
premiumByLocation:
|
|
1252
|
+
ratingBasis: z16.array(RatingBasisSchema).optional(),
|
|
1253
|
+
premiumByLocation: z16.array(LocationPremiumSchema).optional(),
|
|
1209
1254
|
lossSummary: LossSummarySchema.optional(),
|
|
1210
|
-
individualClaims:
|
|
1255
|
+
individualClaims: z16.array(ClaimRecordSchema).optional(),
|
|
1211
1256
|
experienceMod: ExperienceModSchema.optional(),
|
|
1212
|
-
cancellationNoticeDays:
|
|
1213
|
-
nonrenewalNoticeDays:
|
|
1257
|
+
cancellationNoticeDays: z16.number().optional(),
|
|
1258
|
+
nonrenewalNoticeDays: z16.number().optional()
|
|
1214
1259
|
};
|
|
1215
|
-
var PolicyDocumentSchema =
|
|
1260
|
+
var PolicyDocumentSchema = z16.object({
|
|
1216
1261
|
...BaseDocumentFields,
|
|
1217
|
-
type:
|
|
1218
|
-
policyNumber:
|
|
1219
|
-
effectiveDate:
|
|
1220
|
-
expirationDate:
|
|
1262
|
+
type: z16.literal("policy"),
|
|
1263
|
+
policyNumber: z16.string(),
|
|
1264
|
+
effectiveDate: z16.string(),
|
|
1265
|
+
expirationDate: z16.string().optional(),
|
|
1221
1266
|
policyTermType: PolicyTermTypeSchema.optional(),
|
|
1222
|
-
nextReviewDate:
|
|
1223
|
-
effectiveTime:
|
|
1267
|
+
nextReviewDate: z16.string().optional(),
|
|
1268
|
+
effectiveTime: z16.string().optional()
|
|
1224
1269
|
});
|
|
1225
|
-
var QuoteDocumentSchema =
|
|
1270
|
+
var QuoteDocumentSchema = z16.object({
|
|
1226
1271
|
...BaseDocumentFields,
|
|
1227
|
-
type:
|
|
1228
|
-
quoteNumber:
|
|
1229
|
-
proposedEffectiveDate:
|
|
1230
|
-
proposedExpirationDate:
|
|
1231
|
-
quoteExpirationDate:
|
|
1232
|
-
subjectivities:
|
|
1233
|
-
underwritingConditions:
|
|
1234
|
-
premiumBreakdown:
|
|
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(),
|
|
1235
1280
|
// Enriched quote fields (v1.2+)
|
|
1236
|
-
enrichedSubjectivities:
|
|
1237
|
-
enrichedUnderwritingConditions:
|
|
1238
|
-
warrantyRequirements:
|
|
1239
|
-
lossControlRecommendations:
|
|
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(),
|
|
1240
1285
|
bindingAuthority: BindingAuthoritySchema.optional()
|
|
1241
1286
|
});
|
|
1242
|
-
var InsuranceDocumentSchema =
|
|
1287
|
+
var InsuranceDocumentSchema = z16.discriminatedUnion("type", [
|
|
1243
1288
|
PolicyDocumentSchema,
|
|
1244
1289
|
QuoteDocumentSchema
|
|
1245
1290
|
]);
|
|
1246
1291
|
|
|
1247
1292
|
// src/schemas/platform.ts
|
|
1248
|
-
import { z as
|
|
1249
|
-
var PlatformSchema =
|
|
1250
|
-
var CommunicationIntentSchema =
|
|
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"]);
|
|
1251
1296
|
var PLATFORM_CONFIGS = {
|
|
1252
1297
|
email: {
|
|
1253
1298
|
supportsMarkdown: false,
|
|
@@ -1475,10 +1520,11 @@ async function runExtractor(params) {
|
|
|
1475
1520
|
[Document pages ${startPage}-${endPage} are provided as images above.]` : `${prompt}
|
|
1476
1521
|
|
|
1477
1522
|
[Document pages ${startPage}-${endPage} are provided as a PDF file above.]`;
|
|
1523
|
+
const strictSchema = toStrictSchema(schema);
|
|
1478
1524
|
const result = await withRetry(
|
|
1479
1525
|
() => generateObject({
|
|
1480
1526
|
prompt: fullPrompt,
|
|
1481
|
-
schema,
|
|
1527
|
+
schema: strictSchema,
|
|
1482
1528
|
maxTokens,
|
|
1483
1529
|
providerOptions
|
|
1484
1530
|
})
|
|
@@ -2557,11 +2603,11 @@ function getTemplate(policyType) {
|
|
|
2557
2603
|
}
|
|
2558
2604
|
|
|
2559
2605
|
// src/prompts/coordinator/classify.ts
|
|
2560
|
-
import { z as
|
|
2561
|
-
var ClassifyResultSchema =
|
|
2562
|
-
documentType:
|
|
2563
|
-
policyTypes:
|
|
2564
|
-
confidence:
|
|
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()
|
|
2565
2611
|
});
|
|
2566
2612
|
function buildClassifyPrompt() {
|
|
2567
2613
|
return `You are classifying an insurance document. Examine the first few pages and determine:
|
|
@@ -2585,20 +2631,20 @@ Respond with JSON only.`;
|
|
|
2585
2631
|
}
|
|
2586
2632
|
|
|
2587
2633
|
// src/prompts/coordinator/plan.ts
|
|
2588
|
-
import { z as
|
|
2589
|
-
var ExtractionTaskSchema =
|
|
2590
|
-
extractorName:
|
|
2591
|
-
startPage:
|
|
2592
|
-
endPage:
|
|
2593
|
-
description:
|
|
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()
|
|
2594
2640
|
});
|
|
2595
|
-
var PageMapEntrySchema =
|
|
2596
|
-
section:
|
|
2597
|
-
pages:
|
|
2641
|
+
var PageMapEntrySchema = z19.object({
|
|
2642
|
+
section: z19.string(),
|
|
2643
|
+
pages: z19.string()
|
|
2598
2644
|
});
|
|
2599
|
-
var ExtractionPlanSchema =
|
|
2600
|
-
tasks:
|
|
2601
|
-
pageMap:
|
|
2645
|
+
var ExtractionPlanSchema = z19.object({
|
|
2646
|
+
tasks: z19.array(ExtractionTaskSchema),
|
|
2647
|
+
pageMap: z19.array(PageMapEntrySchema).optional()
|
|
2602
2648
|
});
|
|
2603
2649
|
function buildPlanPrompt(templateHints) {
|
|
2604
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.
|
|
@@ -2639,15 +2685,15 @@ Respond with JSON only.`;
|
|
|
2639
2685
|
}
|
|
2640
2686
|
|
|
2641
2687
|
// src/prompts/coordinator/review.ts
|
|
2642
|
-
import { z as
|
|
2643
|
-
var ReviewResultSchema =
|
|
2644
|
-
complete:
|
|
2645
|
-
missingFields:
|
|
2646
|
-
additionalTasks:
|
|
2647
|
-
extractorName:
|
|
2648
|
-
startPage:
|
|
2649
|
-
endPage:
|
|
2650
|
-
description:
|
|
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()
|
|
2651
2697
|
}))
|
|
2652
2698
|
});
|
|
2653
2699
|
function buildReviewPrompt(templateExpected, extractedKeys) {
|
|
@@ -2679,20 +2725,20 @@ Respond with JSON only.`;
|
|
|
2679
2725
|
}
|
|
2680
2726
|
|
|
2681
2727
|
// src/prompts/extractors/carrier-info.ts
|
|
2682
|
-
import { z as
|
|
2683
|
-
var CarrierInfoSchema =
|
|
2684
|
-
carrierName:
|
|
2685
|
-
carrierLegalName:
|
|
2686
|
-
naicNumber:
|
|
2687
|
-
amBestRating:
|
|
2688
|
-
admittedStatus:
|
|
2689
|
-
mga:
|
|
2690
|
-
underwriter:
|
|
2691
|
-
policyNumber:
|
|
2692
|
-
effectiveDate:
|
|
2693
|
-
expirationDate:
|
|
2694
|
-
quoteNumber:
|
|
2695
|
-
proposedEffectiveDate:
|
|
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)")
|
|
2696
2742
|
});
|
|
2697
2743
|
function buildCarrierInfoPrompt() {
|
|
2698
2744
|
return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
|
|
@@ -2712,18 +2758,18 @@ Return JSON only.`;
|
|
|
2712
2758
|
}
|
|
2713
2759
|
|
|
2714
2760
|
// src/prompts/extractors/named-insured.ts
|
|
2715
|
-
import { z as
|
|
2716
|
-
var AddressSchema2 =
|
|
2717
|
-
street1:
|
|
2718
|
-
city:
|
|
2719
|
-
state:
|
|
2720
|
-
zip:
|
|
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()
|
|
2721
2767
|
});
|
|
2722
|
-
var NamedInsuredSchema2 =
|
|
2723
|
-
insuredName:
|
|
2724
|
-
insuredDba:
|
|
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"),
|
|
2725
2771
|
insuredAddress: AddressSchema2.optional().describe("Primary insured mailing address"),
|
|
2726
|
-
insuredEntityType:
|
|
2772
|
+
insuredEntityType: z22.enum([
|
|
2727
2773
|
"corporation",
|
|
2728
2774
|
"llc",
|
|
2729
2775
|
"partnership",
|
|
@@ -2736,13 +2782,13 @@ var NamedInsuredSchema2 = z21.object({
|
|
|
2736
2782
|
"married_couple",
|
|
2737
2783
|
"other"
|
|
2738
2784
|
]).optional().describe("Legal entity type of the insured"),
|
|
2739
|
-
insuredFein:
|
|
2740
|
-
insuredSicCode:
|
|
2741
|
-
insuredNaicsCode:
|
|
2742
|
-
additionalNamedInsureds:
|
|
2743
|
-
|
|
2744
|
-
name:
|
|
2745
|
-
relationship:
|
|
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"),
|
|
2746
2792
|
address: AddressSchema2.optional()
|
|
2747
2793
|
})
|
|
2748
2794
|
).optional().describe("Additional named insureds listed on the policy")
|
|
@@ -2763,19 +2809,19 @@ Return JSON only.`;
|
|
|
2763
2809
|
}
|
|
2764
2810
|
|
|
2765
2811
|
// src/prompts/extractors/coverage-limits.ts
|
|
2766
|
-
import { z as
|
|
2767
|
-
var CoverageLimitsSchema =
|
|
2768
|
-
coverages:
|
|
2769
|
-
|
|
2770
|
-
name:
|
|
2771
|
-
limit:
|
|
2772
|
-
deductible:
|
|
2773
|
-
coverageCode:
|
|
2774
|
-
formNumber:
|
|
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'")
|
|
2775
2821
|
})
|
|
2776
2822
|
).describe("All coverages with their limits"),
|
|
2777
|
-
coverageForm:
|
|
2778
|
-
retroactiveDate:
|
|
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)")
|
|
2779
2825
|
});
|
|
2780
2826
|
function buildCoverageLimitsPrompt() {
|
|
2781
2827
|
return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
|
|
@@ -2796,17 +2842,17 @@ Return JSON only.`;
|
|
|
2796
2842
|
}
|
|
2797
2843
|
|
|
2798
2844
|
// src/prompts/extractors/endorsements.ts
|
|
2799
|
-
import { z as
|
|
2800
|
-
var EndorsementsSchema =
|
|
2801
|
-
endorsements:
|
|
2802
|
-
|
|
2803
|
-
formNumber:
|
|
2804
|
-
title:
|
|
2805
|
-
type:
|
|
2806
|
-
content:
|
|
2807
|
-
effectiveDate:
|
|
2808
|
-
premium:
|
|
2809
|
-
parties:
|
|
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.)")
|
|
2810
2856
|
})
|
|
2811
2857
|
).describe("All endorsements found in the document")
|
|
2812
2858
|
});
|
|
@@ -2832,14 +2878,14 @@ Return JSON only.`;
|
|
|
2832
2878
|
}
|
|
2833
2879
|
|
|
2834
2880
|
// src/prompts/extractors/exclusions.ts
|
|
2835
|
-
import { z as
|
|
2836
|
-
var ExclusionsSchema =
|
|
2837
|
-
exclusions:
|
|
2838
|
-
|
|
2839
|
-
title:
|
|
2840
|
-
content:
|
|
2841
|
-
formNumber:
|
|
2842
|
-
appliesTo:
|
|
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")
|
|
2843
2889
|
})
|
|
2844
2890
|
).describe("All exclusions found in the document")
|
|
2845
2891
|
});
|
|
@@ -2860,11 +2906,11 @@ Return JSON only.`;
|
|
|
2860
2906
|
}
|
|
2861
2907
|
|
|
2862
2908
|
// src/prompts/extractors/conditions.ts
|
|
2863
|
-
import { z as
|
|
2864
|
-
var ConditionsSchema =
|
|
2865
|
-
conditions:
|
|
2866
|
-
|
|
2867
|
-
type:
|
|
2909
|
+
import { z as z26 } from "zod";
|
|
2910
|
+
var ConditionsSchema = z26.object({
|
|
2911
|
+
conditions: z26.array(
|
|
2912
|
+
z26.object({
|
|
2913
|
+
type: z26.enum([
|
|
2868
2914
|
"duties_after_loss",
|
|
2869
2915
|
"cooperation",
|
|
2870
2916
|
"cancellation",
|
|
@@ -2878,9 +2924,9 @@ var ConditionsSchema = z25.object({
|
|
|
2878
2924
|
"liberalization",
|
|
2879
2925
|
"other"
|
|
2880
2926
|
]).optional().describe("Condition category"),
|
|
2881
|
-
title:
|
|
2882
|
-
content:
|
|
2883
|
-
noticeDays:
|
|
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)")
|
|
2884
2930
|
})
|
|
2885
2931
|
).describe("All policy conditions found in the document")
|
|
2886
2932
|
});
|
|
@@ -2905,28 +2951,28 @@ Return JSON only.`;
|
|
|
2905
2951
|
}
|
|
2906
2952
|
|
|
2907
2953
|
// src/prompts/extractors/premium-breakdown.ts
|
|
2908
|
-
import { z as
|
|
2909
|
-
var PremiumBreakdownSchema =
|
|
2910
|
-
premium:
|
|
2911
|
-
totalCost:
|
|
2912
|
-
premiumBreakdown:
|
|
2913
|
-
|
|
2914
|
-
line:
|
|
2915
|
-
amount:
|
|
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")
|
|
2916
2962
|
})
|
|
2917
2963
|
).optional().describe("Per-coverage-line premium breakdown"),
|
|
2918
|
-
taxesAndFees:
|
|
2919
|
-
|
|
2920
|
-
name:
|
|
2921
|
-
amount:
|
|
2922
|
-
type:
|
|
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")
|
|
2923
2969
|
})
|
|
2924
2970
|
).optional().describe("Taxes, fees, surcharges, and assessments"),
|
|
2925
|
-
minimumPremium:
|
|
2926
|
-
depositPremium:
|
|
2927
|
-
paymentPlan:
|
|
2928
|
-
auditType:
|
|
2929
|
-
ratingBasis:
|
|
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")
|
|
2930
2976
|
});
|
|
2931
2977
|
function buildPremiumBreakdownPrompt() {
|
|
2932
2978
|
return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
|
|
@@ -2946,14 +2992,14 @@ Return JSON only.`;
|
|
|
2946
2992
|
}
|
|
2947
2993
|
|
|
2948
2994
|
// src/prompts/extractors/declarations.ts
|
|
2949
|
-
import { z as
|
|
2950
|
-
var DeclarationsFieldSchema =
|
|
2951
|
-
field:
|
|
2952
|
-
value:
|
|
2953
|
-
section:
|
|
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')")
|
|
2954
3000
|
});
|
|
2955
|
-
var DeclarationsExtractSchema =
|
|
2956
|
-
fields:
|
|
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.")
|
|
2957
3003
|
});
|
|
2958
3004
|
function buildDeclarationsPrompt() {
|
|
2959
3005
|
return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
|
|
@@ -2993,21 +3039,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
|
|
|
2993
3039
|
}
|
|
2994
3040
|
|
|
2995
3041
|
// src/prompts/extractors/loss-history.ts
|
|
2996
|
-
import { z as
|
|
2997
|
-
var LossHistorySchema =
|
|
2998
|
-
lossSummary:
|
|
2999
|
-
individualClaims:
|
|
3000
|
-
|
|
3001
|
-
date:
|
|
3002
|
-
type:
|
|
3003
|
-
description:
|
|
3004
|
-
amountPaid:
|
|
3005
|
-
amountReserved:
|
|
3006
|
-
status:
|
|
3007
|
-
claimNumber:
|
|
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")
|
|
3008
3054
|
})
|
|
3009
3055
|
).optional().describe("Individual claim records"),
|
|
3010
|
-
experienceMod:
|
|
3056
|
+
experienceMod: z29.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
|
|
3011
3057
|
});
|
|
3012
3058
|
function buildLossHistoryPrompt() {
|
|
3013
3059
|
return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
|
|
@@ -3024,18 +3070,18 @@ Return JSON only.`;
|
|
|
3024
3070
|
}
|
|
3025
3071
|
|
|
3026
3072
|
// src/prompts/extractors/sections.ts
|
|
3027
|
-
import { z as
|
|
3028
|
-
var SubsectionSchema2 =
|
|
3029
|
-
title:
|
|
3030
|
-
sectionNumber:
|
|
3031
|
-
pageNumber:
|
|
3032
|
-
content:
|
|
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")
|
|
3033
3079
|
});
|
|
3034
|
-
var SectionsSchema =
|
|
3035
|
-
sections:
|
|
3036
|
-
|
|
3037
|
-
title:
|
|
3038
|
-
type:
|
|
3080
|
+
var SectionsSchema = z30.object({
|
|
3081
|
+
sections: z30.array(
|
|
3082
|
+
z30.object({
|
|
3083
|
+
title: z30.string().describe("Section title"),
|
|
3084
|
+
type: z30.enum([
|
|
3039
3085
|
"declarations",
|
|
3040
3086
|
"insuring_agreement",
|
|
3041
3087
|
"policy_form",
|
|
@@ -3049,10 +3095,10 @@ var SectionsSchema = z29.object({
|
|
|
3049
3095
|
"regulatory",
|
|
3050
3096
|
"other"
|
|
3051
3097
|
]).describe("Section type classification"),
|
|
3052
|
-
content:
|
|
3053
|
-
pageStart:
|
|
3054
|
-
pageEnd:
|
|
3055
|
-
subsections:
|
|
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")
|
|
3056
3102
|
})
|
|
3057
3103
|
).describe("All document sections")
|
|
3058
3104
|
});
|
|
@@ -3076,20 +3122,20 @@ Return JSON only.`;
|
|
|
3076
3122
|
}
|
|
3077
3123
|
|
|
3078
3124
|
// src/prompts/extractors/supplementary.ts
|
|
3079
|
-
import { z as
|
|
3080
|
-
var ContactSchema2 =
|
|
3081
|
-
name:
|
|
3082
|
-
phone:
|
|
3083
|
-
email:
|
|
3084
|
-
address:
|
|
3085
|
-
type:
|
|
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'")
|
|
3086
3132
|
});
|
|
3087
|
-
var SupplementarySchema =
|
|
3088
|
-
regulatoryContacts:
|
|
3089
|
-
claimsContacts:
|
|
3090
|
-
thirdPartyAdministrators:
|
|
3091
|
-
cancellationNoticeDays:
|
|
3092
|
-
nonrenewalNoticeDays:
|
|
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")
|
|
3093
3139
|
});
|
|
3094
3140
|
function buildSupplementaryPrompt() {
|
|
3095
3141
|
return `You are an expert insurance document analyst. Extract supplementary and regulatory information from this document.
|
|
@@ -3591,8 +3637,8 @@ Respond with JSON only:
|
|
|
3591
3637
|
}`;
|
|
3592
3638
|
|
|
3593
3639
|
// src/schemas/application.ts
|
|
3594
|
-
import { z as
|
|
3595
|
-
var FieldTypeSchema =
|
|
3640
|
+
import { z as z32 } from "zod";
|
|
3641
|
+
var FieldTypeSchema = z32.enum([
|
|
3596
3642
|
"text",
|
|
3597
3643
|
"numeric",
|
|
3598
3644
|
"currency",
|
|
@@ -3601,100 +3647,100 @@ var FieldTypeSchema = z31.enum([
|
|
|
3601
3647
|
"table",
|
|
3602
3648
|
"declaration"
|
|
3603
3649
|
]);
|
|
3604
|
-
var ApplicationFieldSchema =
|
|
3605
|
-
id:
|
|
3606
|
-
label:
|
|
3607
|
-
section:
|
|
3650
|
+
var ApplicationFieldSchema = z32.object({
|
|
3651
|
+
id: z32.string(),
|
|
3652
|
+
label: z32.string(),
|
|
3653
|
+
section: z32.string(),
|
|
3608
3654
|
fieldType: FieldTypeSchema,
|
|
3609
|
-
required:
|
|
3610
|
-
options:
|
|
3611
|
-
columns:
|
|
3612
|
-
requiresExplanationIfYes:
|
|
3613
|
-
condition:
|
|
3614
|
-
dependsOn:
|
|
3615
|
-
whenValue:
|
|
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()
|
|
3616
3662
|
}).optional(),
|
|
3617
|
-
value:
|
|
3618
|
-
source:
|
|
3619
|
-
confidence:
|
|
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()
|
|
3620
3666
|
});
|
|
3621
|
-
var ApplicationClassifyResultSchema =
|
|
3622
|
-
isApplication:
|
|
3623
|
-
confidence:
|
|
3624
|
-
applicationType:
|
|
3667
|
+
var ApplicationClassifyResultSchema = z32.object({
|
|
3668
|
+
isApplication: z32.boolean(),
|
|
3669
|
+
confidence: z32.number().min(0).max(1),
|
|
3670
|
+
applicationType: z32.string().nullable()
|
|
3625
3671
|
});
|
|
3626
|
-
var FieldExtractionResultSchema =
|
|
3627
|
-
fields:
|
|
3672
|
+
var FieldExtractionResultSchema = z32.object({
|
|
3673
|
+
fields: z32.array(ApplicationFieldSchema)
|
|
3628
3674
|
});
|
|
3629
|
-
var AutoFillMatchSchema =
|
|
3630
|
-
fieldId:
|
|
3631
|
-
value:
|
|
3632
|
-
confidence:
|
|
3633
|
-
contextKey:
|
|
3675
|
+
var AutoFillMatchSchema = z32.object({
|
|
3676
|
+
fieldId: z32.string(),
|
|
3677
|
+
value: z32.string(),
|
|
3678
|
+
confidence: z32.enum(["confirmed"]),
|
|
3679
|
+
contextKey: z32.string()
|
|
3634
3680
|
});
|
|
3635
|
-
var AutoFillResultSchema =
|
|
3636
|
-
matches:
|
|
3681
|
+
var AutoFillResultSchema = z32.object({
|
|
3682
|
+
matches: z32.array(AutoFillMatchSchema)
|
|
3637
3683
|
});
|
|
3638
|
-
var QuestionBatchResultSchema =
|
|
3639
|
-
batches:
|
|
3684
|
+
var QuestionBatchResultSchema = z32.object({
|
|
3685
|
+
batches: z32.array(z32.array(z32.string()).describe("Array of field IDs in this batch"))
|
|
3640
3686
|
});
|
|
3641
|
-
var LookupRequestSchema =
|
|
3642
|
-
type:
|
|
3643
|
-
description:
|
|
3644
|
-
url:
|
|
3645
|
-
targetFieldIds:
|
|
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())
|
|
3646
3692
|
});
|
|
3647
|
-
var ReplyIntentSchema =
|
|
3648
|
-
primaryIntent:
|
|
3649
|
-
hasAnswers:
|
|
3650
|
-
questionText:
|
|
3651
|
-
questionFieldIds:
|
|
3652
|
-
lookupRequests:
|
|
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()
|
|
3653
3699
|
});
|
|
3654
|
-
var ParsedAnswerSchema =
|
|
3655
|
-
fieldId:
|
|
3656
|
-
value:
|
|
3657
|
-
explanation:
|
|
3700
|
+
var ParsedAnswerSchema = z32.object({
|
|
3701
|
+
fieldId: z32.string(),
|
|
3702
|
+
value: z32.string(),
|
|
3703
|
+
explanation: z32.string().optional()
|
|
3658
3704
|
});
|
|
3659
|
-
var AnswerParsingResultSchema =
|
|
3660
|
-
answers:
|
|
3661
|
-
unanswered:
|
|
3705
|
+
var AnswerParsingResultSchema = z32.object({
|
|
3706
|
+
answers: z32.array(ParsedAnswerSchema),
|
|
3707
|
+
unanswered: z32.array(z32.string()).describe("Field IDs that were not answered")
|
|
3662
3708
|
});
|
|
3663
|
-
var LookupFillSchema =
|
|
3664
|
-
fieldId:
|
|
3665
|
-
value:
|
|
3666
|
-
source:
|
|
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)'")
|
|
3667
3713
|
});
|
|
3668
|
-
var LookupFillResultSchema =
|
|
3669
|
-
fills:
|
|
3670
|
-
unfillable:
|
|
3671
|
-
explanation:
|
|
3714
|
+
var LookupFillResultSchema = z32.object({
|
|
3715
|
+
fills: z32.array(LookupFillSchema),
|
|
3716
|
+
unfillable: z32.array(z32.string()),
|
|
3717
|
+
explanation: z32.string().optional()
|
|
3672
3718
|
});
|
|
3673
|
-
var FlatPdfPlacementSchema =
|
|
3674
|
-
fieldId:
|
|
3675
|
-
page:
|
|
3676
|
-
x:
|
|
3677
|
-
y:
|
|
3678
|
-
text:
|
|
3679
|
-
fontSize:
|
|
3680
|
-
isCheckmark:
|
|
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()
|
|
3681
3727
|
});
|
|
3682
|
-
var AcroFormMappingSchema =
|
|
3683
|
-
fieldId:
|
|
3684
|
-
acroFormName:
|
|
3685
|
-
value:
|
|
3728
|
+
var AcroFormMappingSchema = z32.object({
|
|
3729
|
+
fieldId: z32.string(),
|
|
3730
|
+
acroFormName: z32.string(),
|
|
3731
|
+
value: z32.string()
|
|
3686
3732
|
});
|
|
3687
|
-
var ApplicationStateSchema =
|
|
3688
|
-
id:
|
|
3689
|
-
pdfBase64:
|
|
3690
|
-
title:
|
|
3691
|
-
applicationType:
|
|
3692
|
-
fields:
|
|
3693
|
-
batches:
|
|
3694
|
-
currentBatchIndex:
|
|
3695
|
-
status:
|
|
3696
|
-
createdAt:
|
|
3697
|
-
updatedAt:
|
|
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()
|
|
3698
3744
|
});
|
|
3699
3745
|
|
|
3700
3746
|
// src/application/agents/classifier.ts
|
|
@@ -4722,73 +4768,73 @@ Respond with the final answer, deduplicated citations array, overall confidence
|
|
|
4722
4768
|
}
|
|
4723
4769
|
|
|
4724
4770
|
// src/schemas/query.ts
|
|
4725
|
-
import { z as
|
|
4726
|
-
var QueryIntentSchema =
|
|
4771
|
+
import { z as z33 } from "zod";
|
|
4772
|
+
var QueryIntentSchema = z33.enum([
|
|
4727
4773
|
"policy_question",
|
|
4728
4774
|
"coverage_comparison",
|
|
4729
4775
|
"document_search",
|
|
4730
4776
|
"claims_inquiry",
|
|
4731
4777
|
"general_knowledge"
|
|
4732
4778
|
]);
|
|
4733
|
-
var SubQuestionSchema =
|
|
4734
|
-
question:
|
|
4779
|
+
var SubQuestionSchema = z33.object({
|
|
4780
|
+
question: z33.string().describe("Atomic sub-question to retrieve and answer independently"),
|
|
4735
4781
|
intent: QueryIntentSchema,
|
|
4736
|
-
chunkTypes:
|
|
4737
|
-
documentFilters:
|
|
4738
|
-
type:
|
|
4739
|
-
carrier:
|
|
4740
|
-
insuredName:
|
|
4741
|
-
policyNumber:
|
|
4742
|
-
quoteNumber:
|
|
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()
|
|
4743
4789
|
}).optional().describe("Structured filters to narrow document lookup")
|
|
4744
4790
|
});
|
|
4745
|
-
var QueryClassifyResultSchema =
|
|
4791
|
+
var QueryClassifyResultSchema = z33.object({
|
|
4746
4792
|
intent: QueryIntentSchema,
|
|
4747
|
-
subQuestions:
|
|
4748
|
-
requiresDocumentLookup:
|
|
4749
|
-
requiresChunkSearch:
|
|
4750
|
-
requiresConversationHistory:
|
|
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")
|
|
4751
4797
|
});
|
|
4752
|
-
var EvidenceItemSchema =
|
|
4753
|
-
source:
|
|
4754
|
-
chunkId:
|
|
4755
|
-
documentId:
|
|
4756
|
-
turnId:
|
|
4757
|
-
text:
|
|
4758
|
-
relevance:
|
|
4759
|
-
metadata:
|
|
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()
|
|
4760
4806
|
});
|
|
4761
|
-
var RetrievalResultSchema =
|
|
4762
|
-
subQuestion:
|
|
4763
|
-
evidence:
|
|
4807
|
+
var RetrievalResultSchema = z33.object({
|
|
4808
|
+
subQuestion: z33.string(),
|
|
4809
|
+
evidence: z33.array(EvidenceItemSchema)
|
|
4764
4810
|
});
|
|
4765
|
-
var CitationSchema =
|
|
4766
|
-
index:
|
|
4767
|
-
chunkId:
|
|
4768
|
-
documentId:
|
|
4769
|
-
documentType:
|
|
4770
|
-
field:
|
|
4771
|
-
quote:
|
|
4772
|
-
relevance:
|
|
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)
|
|
4773
4819
|
});
|
|
4774
|
-
var SubAnswerSchema =
|
|
4775
|
-
subQuestion:
|
|
4776
|
-
answer:
|
|
4777
|
-
citations:
|
|
4778
|
-
confidence:
|
|
4779
|
-
needsMoreContext:
|
|
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")
|
|
4780
4826
|
});
|
|
4781
|
-
var VerifyResultSchema =
|
|
4782
|
-
approved:
|
|
4783
|
-
issues:
|
|
4784
|
-
retrySubQuestions:
|
|
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")
|
|
4785
4831
|
});
|
|
4786
|
-
var QueryResultSchema =
|
|
4787
|
-
answer:
|
|
4788
|
-
citations:
|
|
4832
|
+
var QueryResultSchema = z33.object({
|
|
4833
|
+
answer: z33.string(),
|
|
4834
|
+
citations: z33.array(CitationSchema),
|
|
4789
4835
|
intent: QueryIntentSchema,
|
|
4790
|
-
confidence:
|
|
4791
|
-
followUp:
|
|
4836
|
+
confidence: z33.number().min(0).max(1),
|
|
4837
|
+
followUp: z33.string().optional().describe("Suggested follow-up question if applicable")
|
|
4792
4838
|
});
|
|
4793
4839
|
|
|
4794
4840
|
// src/query/retriever.ts
|
|
@@ -5669,6 +5715,7 @@ export {
|
|
|
5669
5715
|
safeGenerateObject,
|
|
5670
5716
|
sanitizeNulls,
|
|
5671
5717
|
stripFences,
|
|
5718
|
+
toStrictSchema,
|
|
5672
5719
|
withRetry
|
|
5673
5720
|
};
|
|
5674
5721
|
//# sourceMappingURL=index.mjs.map
|