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