@claritylabs/cl-sdk 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import Database from 'better-sqlite3';
2
3
 
3
4
  /** Callback to generate embeddings for text. */
4
5
  type EmbedText = (text: string) => Promise<number[]>;
@@ -29,6 +30,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
29
30
  pageNumber: z.ZodOptional<z.ZodNumber>;
30
31
  sectionRef: z.ZodOptional<z.ZodString>;
31
32
  originalContent: z.ZodOptional<z.ZodString>;
33
+ recordId: z.ZodOptional<z.ZodString>;
34
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ sourceTextHash: z.ZodOptional<z.ZodString>;
32
36
  }, "strip", z.ZodTypeAny, {
33
37
  name: string;
34
38
  limit: string;
@@ -40,6 +44,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
40
44
  pageNumber?: number | undefined;
41
45
  sectionRef?: string | undefined;
42
46
  originalContent?: string | undefined;
47
+ recordId?: string | undefined;
48
+ sourceSpanIds?: string[] | undefined;
49
+ sourceTextHash?: string | undefined;
43
50
  }, {
44
51
  name: string;
45
52
  limit: string;
@@ -51,6 +58,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
51
58
  pageNumber?: number | undefined;
52
59
  sectionRef?: string | undefined;
53
60
  originalContent?: string | undefined;
61
+ recordId?: string | undefined;
62
+ sourceSpanIds?: string[] | undefined;
63
+ sourceTextHash?: string | undefined;
54
64
  }>, "many">;
55
65
  sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
66
  title: z.ZodString;
@@ -76,12 +86,18 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
76
86
  pageNumber?: number | undefined;
77
87
  sectionNumber?: string | undefined;
78
88
  }>, "many">>;
89
+ recordId: z.ZodOptional<z.ZodString>;
90
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
91
+ sourceTextHash: z.ZodOptional<z.ZodString>;
79
92
  }, "strip", z.ZodTypeAny, {
80
93
  title: string;
81
94
  type: string;
82
95
  pageStart: number;
83
96
  content: string;
84
97
  pageEnd?: number | undefined;
98
+ recordId?: string | undefined;
99
+ sourceSpanIds?: string[] | undefined;
100
+ sourceTextHash?: string | undefined;
85
101
  sectionNumber?: string | undefined;
86
102
  coverageType?: string | undefined;
87
103
  subsections?: {
@@ -96,6 +112,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
96
112
  pageStart: number;
97
113
  content: string;
98
114
  pageEnd?: number | undefined;
115
+ recordId?: string | undefined;
116
+ sourceSpanIds?: string[] | undefined;
117
+ sourceTextHash?: string | undefined;
99
118
  sectionNumber?: string | undefined;
100
119
  coverageType?: string | undefined;
101
120
  subsections?: {
@@ -113,6 +132,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
113
132
  formTitle: z.ZodOptional<z.ZodString>;
114
133
  sectionRef: z.ZodOptional<z.ZodString>;
115
134
  originalContent: z.ZodOptional<z.ZodString>;
135
+ recordId: z.ZodOptional<z.ZodString>;
136
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
137
+ sourceTextHash: z.ZodOptional<z.ZodString>;
116
138
  }, "strip", z.ZodTypeAny, {
117
139
  definition: string;
118
140
  term: string;
@@ -120,6 +142,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
120
142
  pageNumber?: number | undefined;
121
143
  sectionRef?: string | undefined;
122
144
  originalContent?: string | undefined;
145
+ recordId?: string | undefined;
146
+ sourceSpanIds?: string[] | undefined;
147
+ sourceTextHash?: string | undefined;
123
148
  formTitle?: string | undefined;
124
149
  }, {
125
150
  definition: string;
@@ -128,6 +153,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
128
153
  pageNumber?: number | undefined;
129
154
  sectionRef?: string | undefined;
130
155
  originalContent?: string | undefined;
156
+ recordId?: string | undefined;
157
+ sourceSpanIds?: string[] | undefined;
158
+ sourceTextHash?: string | undefined;
131
159
  formTitle?: string | undefined;
132
160
  }>, "many">>;
133
161
  coveredReasons: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -143,6 +171,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
143
171
  formTitle: z.ZodOptional<z.ZodString>;
144
172
  sectionRef: z.ZodOptional<z.ZodString>;
145
173
  originalContent: z.ZodOptional<z.ZodString>;
174
+ recordId: z.ZodOptional<z.ZodString>;
175
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
176
+ sourceTextHash: z.ZodOptional<z.ZodString>;
146
177
  }, "strip", z.ZodTypeAny, {
147
178
  content: string;
148
179
  coverageName: string;
@@ -153,6 +184,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
153
184
  pageNumber?: number | undefined;
154
185
  sectionRef?: string | undefined;
155
186
  originalContent?: string | undefined;
187
+ recordId?: string | undefined;
188
+ sourceSpanIds?: string[] | undefined;
189
+ sourceTextHash?: string | undefined;
156
190
  exceptions?: string[] | undefined;
157
191
  formTitle?: string | undefined;
158
192
  reasonNumber?: string | undefined;
@@ -166,6 +200,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
166
200
  pageNumber?: number | undefined;
167
201
  sectionRef?: string | undefined;
168
202
  originalContent?: string | undefined;
203
+ recordId?: string | undefined;
204
+ sourceSpanIds?: string[] | undefined;
205
+ sourceTextHash?: string | undefined;
169
206
  exceptions?: string[] | undefined;
170
207
  formTitle?: string | undefined;
171
208
  reasonNumber?: string | undefined;
@@ -281,6 +318,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
281
318
  pageNumber: z.ZodOptional<z.ZodNumber>;
282
319
  sectionRef: z.ZodOptional<z.ZodString>;
283
320
  originalContent: z.ZodOptional<z.ZodString>;
321
+ recordId: z.ZodOptional<z.ZodString>;
322
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
323
+ sourceTextHash: z.ZodOptional<z.ZodString>;
284
324
  }, "strip", z.ZodTypeAny, {
285
325
  name: string;
286
326
  limit: string;
@@ -293,6 +333,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
293
333
  pageNumber?: number | undefined;
294
334
  sectionRef?: string | undefined;
295
335
  originalContent?: string | undefined;
336
+ recordId?: string | undefined;
337
+ sourceSpanIds?: string[] | undefined;
338
+ sourceTextHash?: string | undefined;
296
339
  coverageCode?: string | undefined;
297
340
  formEditionDate?: string | undefined;
298
341
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -316,6 +359,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
316
359
  pageNumber?: number | undefined;
317
360
  sectionRef?: string | undefined;
318
361
  originalContent?: string | undefined;
362
+ recordId?: string | undefined;
363
+ sourceSpanIds?: string[] | undefined;
364
+ sourceTextHash?: string | undefined;
319
365
  coverageCode?: string | undefined;
320
366
  formEditionDate?: string | undefined;
321
367
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -394,6 +440,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
394
440
  content: z.ZodString;
395
441
  pageStart: z.ZodNumber;
396
442
  pageEnd: z.ZodOptional<z.ZodNumber>;
443
+ recordId: z.ZodOptional<z.ZodString>;
444
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
445
+ sourceTextHash: z.ZodOptional<z.ZodString>;
397
446
  }, "strip", z.ZodTypeAny, {
398
447
  title: string;
399
448
  formNumber: string;
@@ -402,6 +451,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
402
451
  content: string;
403
452
  editionDate?: string | undefined;
404
453
  pageEnd?: number | undefined;
454
+ recordId?: string | undefined;
455
+ sourceSpanIds?: string[] | undefined;
456
+ sourceTextHash?: string | undefined;
405
457
  effectiveDate?: string | undefined;
406
458
  affectedCoverageParts?: string[] | undefined;
407
459
  namedParties?: {
@@ -428,6 +480,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
428
480
  content: string;
429
481
  editionDate?: string | undefined;
430
482
  pageEnd?: number | undefined;
483
+ recordId?: string | undefined;
484
+ sourceSpanIds?: string[] | undefined;
485
+ sourceTextHash?: string | undefined;
431
486
  effectiveDate?: string | undefined;
432
487
  affectedCoverageParts?: string[] | undefined;
433
488
  namedParties?: {
@@ -458,12 +513,18 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
458
513
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
459
514
  content: z.ZodString;
460
515
  pageNumber: z.ZodOptional<z.ZodNumber>;
516
+ recordId: z.ZodOptional<z.ZodString>;
517
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
518
+ sourceTextHash: z.ZodOptional<z.ZodString>;
461
519
  }, "strip", z.ZodTypeAny, {
462
520
  name: string;
463
521
  content: string;
464
522
  formNumber?: string | undefined;
465
523
  appliesTo?: string[] | undefined;
466
524
  pageNumber?: number | undefined;
525
+ recordId?: string | undefined;
526
+ sourceSpanIds?: string[] | undefined;
527
+ sourceTextHash?: string | undefined;
467
528
  excludedPerils?: string[] | undefined;
468
529
  isAbsolute?: boolean | undefined;
469
530
  exceptions?: string[] | undefined;
@@ -475,6 +536,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
475
536
  formNumber?: string | undefined;
476
537
  appliesTo?: string[] | undefined;
477
538
  pageNumber?: number | undefined;
539
+ recordId?: string | undefined;
540
+ sourceSpanIds?: string[] | undefined;
541
+ sourceTextHash?: string | undefined;
478
542
  excludedPerils?: string[] | undefined;
479
543
  isAbsolute?: boolean | undefined;
480
544
  exceptions?: string[] | undefined;
@@ -496,11 +560,17 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
496
560
  key: string;
497
561
  }>, "many">>;
498
562
  pageNumber: z.ZodOptional<z.ZodNumber>;
563
+ recordId: z.ZodOptional<z.ZodString>;
564
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
565
+ sourceTextHash: z.ZodOptional<z.ZodString>;
499
566
  }, "strip", z.ZodTypeAny, {
500
567
  name: string;
501
568
  content: string;
502
569
  conditionType: "other" | "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";
503
570
  pageNumber?: number | undefined;
571
+ recordId?: string | undefined;
572
+ sourceSpanIds?: string[] | undefined;
573
+ sourceTextHash?: string | undefined;
504
574
  keyValues?: {
505
575
  value: string;
506
576
  key: string;
@@ -510,6 +580,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
510
580
  content: string;
511
581
  conditionType: "other" | "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";
512
582
  pageNumber?: number | undefined;
583
+ recordId?: string | undefined;
584
+ sourceSpanIds?: string[] | undefined;
585
+ sourceTextHash?: string | undefined;
513
586
  keyValues?: {
514
587
  value: string;
515
588
  key: string;
@@ -3619,6 +3692,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
3619
3692
  pageNumber?: number | undefined;
3620
3693
  sectionRef?: string | undefined;
3621
3694
  originalContent?: string | undefined;
3695
+ recordId?: string | undefined;
3696
+ sourceSpanIds?: string[] | undefined;
3697
+ sourceTextHash?: string | undefined;
3622
3698
  }[];
3623
3699
  carrier: string;
3624
3700
  policyNumber: string;
@@ -4124,6 +4200,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4124
4200
  content: string;
4125
4201
  conditionType: "other" | "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";
4126
4202
  pageNumber?: number | undefined;
4203
+ recordId?: string | undefined;
4204
+ sourceSpanIds?: string[] | undefined;
4205
+ sourceTextHash?: string | undefined;
4127
4206
  keyValues?: {
4128
4207
  value: string;
4129
4208
  key: string;
@@ -4239,6 +4318,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4239
4318
  pageStart: number;
4240
4319
  content: string;
4241
4320
  pageEnd?: number | undefined;
4321
+ recordId?: string | undefined;
4322
+ sourceSpanIds?: string[] | undefined;
4323
+ sourceTextHash?: string | undefined;
4242
4324
  sectionNumber?: string | undefined;
4243
4325
  coverageType?: string | undefined;
4244
4326
  subsections?: {
@@ -4255,6 +4337,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4255
4337
  pageNumber?: number | undefined;
4256
4338
  sectionRef?: string | undefined;
4257
4339
  originalContent?: string | undefined;
4340
+ recordId?: string | undefined;
4341
+ sourceSpanIds?: string[] | undefined;
4342
+ sourceTextHash?: string | undefined;
4258
4343
  formTitle?: string | undefined;
4259
4344
  }[] | undefined;
4260
4345
  coveredReasons?: {
@@ -4267,6 +4352,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4267
4352
  pageNumber?: number | undefined;
4268
4353
  sectionRef?: string | undefined;
4269
4354
  originalContent?: string | undefined;
4355
+ recordId?: string | undefined;
4356
+ sourceSpanIds?: string[] | undefined;
4357
+ sourceTextHash?: string | undefined;
4270
4358
  exceptions?: string[] | undefined;
4271
4359
  formTitle?: string | undefined;
4272
4360
  reasonNumber?: string | undefined;
@@ -4320,6 +4408,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4320
4408
  pageNumber?: number | undefined;
4321
4409
  sectionRef?: string | undefined;
4322
4410
  originalContent?: string | undefined;
4411
+ recordId?: string | undefined;
4412
+ sourceSpanIds?: string[] | undefined;
4413
+ sourceTextHash?: string | undefined;
4323
4414
  coverageCode?: string | undefined;
4324
4415
  formEditionDate?: string | undefined;
4325
4416
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -4340,6 +4431,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4340
4431
  content: string;
4341
4432
  editionDate?: string | undefined;
4342
4433
  pageEnd?: number | undefined;
4434
+ recordId?: string | undefined;
4435
+ sourceSpanIds?: string[] | undefined;
4436
+ sourceTextHash?: string | undefined;
4343
4437
  effectiveDate?: string | undefined;
4344
4438
  affectedCoverageParts?: string[] | undefined;
4345
4439
  namedParties?: {
@@ -4365,6 +4459,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4365
4459
  formNumber?: string | undefined;
4366
4460
  appliesTo?: string[] | undefined;
4367
4461
  pageNumber?: number | undefined;
4462
+ recordId?: string | undefined;
4463
+ sourceSpanIds?: string[] | undefined;
4464
+ sourceTextHash?: string | undefined;
4368
4465
  excludedPerils?: string[] | undefined;
4369
4466
  isAbsolute?: boolean | undefined;
4370
4467
  exceptions?: string[] | undefined;
@@ -4573,6 +4670,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
4573
4670
  pageNumber?: number | undefined;
4574
4671
  sectionRef?: string | undefined;
4575
4672
  originalContent?: string | undefined;
4673
+ recordId?: string | undefined;
4674
+ sourceSpanIds?: string[] | undefined;
4675
+ sourceTextHash?: string | undefined;
4576
4676
  }[];
4577
4677
  carrier: string;
4578
4678
  policyNumber: string;
@@ -5078,6 +5178,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5078
5178
  content: string;
5079
5179
  conditionType: "other" | "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";
5080
5180
  pageNumber?: number | undefined;
5181
+ recordId?: string | undefined;
5182
+ sourceSpanIds?: string[] | undefined;
5183
+ sourceTextHash?: string | undefined;
5081
5184
  keyValues?: {
5082
5185
  value: string;
5083
5186
  key: string;
@@ -5193,6 +5296,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5193
5296
  pageStart: number;
5194
5297
  content: string;
5195
5298
  pageEnd?: number | undefined;
5299
+ recordId?: string | undefined;
5300
+ sourceSpanIds?: string[] | undefined;
5301
+ sourceTextHash?: string | undefined;
5196
5302
  sectionNumber?: string | undefined;
5197
5303
  coverageType?: string | undefined;
5198
5304
  subsections?: {
@@ -5209,6 +5315,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5209
5315
  pageNumber?: number | undefined;
5210
5316
  sectionRef?: string | undefined;
5211
5317
  originalContent?: string | undefined;
5318
+ recordId?: string | undefined;
5319
+ sourceSpanIds?: string[] | undefined;
5320
+ sourceTextHash?: string | undefined;
5212
5321
  formTitle?: string | undefined;
5213
5322
  }[] | undefined;
5214
5323
  coveredReasons?: {
@@ -5221,6 +5330,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5221
5330
  pageNumber?: number | undefined;
5222
5331
  sectionRef?: string | undefined;
5223
5332
  originalContent?: string | undefined;
5333
+ recordId?: string | undefined;
5334
+ sourceSpanIds?: string[] | undefined;
5335
+ sourceTextHash?: string | undefined;
5224
5336
  exceptions?: string[] | undefined;
5225
5337
  formTitle?: string | undefined;
5226
5338
  reasonNumber?: string | undefined;
@@ -5274,6 +5386,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5274
5386
  pageNumber?: number | undefined;
5275
5387
  sectionRef?: string | undefined;
5276
5388
  originalContent?: string | undefined;
5389
+ recordId?: string | undefined;
5390
+ sourceSpanIds?: string[] | undefined;
5391
+ sourceTextHash?: string | undefined;
5277
5392
  coverageCode?: string | undefined;
5278
5393
  formEditionDate?: string | undefined;
5279
5394
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -5294,6 +5409,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5294
5409
  content: string;
5295
5410
  editionDate?: string | undefined;
5296
5411
  pageEnd?: number | undefined;
5412
+ recordId?: string | undefined;
5413
+ sourceSpanIds?: string[] | undefined;
5414
+ sourceTextHash?: string | undefined;
5297
5415
  effectiveDate?: string | undefined;
5298
5416
  affectedCoverageParts?: string[] | undefined;
5299
5417
  namedParties?: {
@@ -5319,6 +5437,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5319
5437
  formNumber?: string | undefined;
5320
5438
  appliesTo?: string[] | undefined;
5321
5439
  pageNumber?: number | undefined;
5440
+ recordId?: string | undefined;
5441
+ sourceSpanIds?: string[] | undefined;
5442
+ sourceTextHash?: string | undefined;
5322
5443
  excludedPerils?: string[] | undefined;
5323
5444
  isAbsolute?: boolean | undefined;
5324
5445
  exceptions?: string[] | undefined;
@@ -5614,6 +5735,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5614
5735
  pageNumber: z.ZodOptional<z.ZodNumber>;
5615
5736
  sectionRef: z.ZodOptional<z.ZodString>;
5616
5737
  originalContent: z.ZodOptional<z.ZodString>;
5738
+ recordId: z.ZodOptional<z.ZodString>;
5739
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5740
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5617
5741
  }, "strip", z.ZodTypeAny, {
5618
5742
  name: string;
5619
5743
  limit: string;
@@ -5625,6 +5749,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5625
5749
  pageNumber?: number | undefined;
5626
5750
  sectionRef?: string | undefined;
5627
5751
  originalContent?: string | undefined;
5752
+ recordId?: string | undefined;
5753
+ sourceSpanIds?: string[] | undefined;
5754
+ sourceTextHash?: string | undefined;
5628
5755
  }, {
5629
5756
  name: string;
5630
5757
  limit: string;
@@ -5636,6 +5763,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5636
5763
  pageNumber?: number | undefined;
5637
5764
  sectionRef?: string | undefined;
5638
5765
  originalContent?: string | undefined;
5766
+ recordId?: string | undefined;
5767
+ sourceSpanIds?: string[] | undefined;
5768
+ sourceTextHash?: string | undefined;
5639
5769
  }>, "many">;
5640
5770
  sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
5641
5771
  title: z.ZodString;
@@ -5661,12 +5791,18 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5661
5791
  pageNumber?: number | undefined;
5662
5792
  sectionNumber?: string | undefined;
5663
5793
  }>, "many">>;
5794
+ recordId: z.ZodOptional<z.ZodString>;
5795
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5796
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5664
5797
  }, "strip", z.ZodTypeAny, {
5665
5798
  title: string;
5666
5799
  type: string;
5667
5800
  pageStart: number;
5668
5801
  content: string;
5669
5802
  pageEnd?: number | undefined;
5803
+ recordId?: string | undefined;
5804
+ sourceSpanIds?: string[] | undefined;
5805
+ sourceTextHash?: string | undefined;
5670
5806
  sectionNumber?: string | undefined;
5671
5807
  coverageType?: string | undefined;
5672
5808
  subsections?: {
@@ -5681,6 +5817,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5681
5817
  pageStart: number;
5682
5818
  content: string;
5683
5819
  pageEnd?: number | undefined;
5820
+ recordId?: string | undefined;
5821
+ sourceSpanIds?: string[] | undefined;
5822
+ sourceTextHash?: string | undefined;
5684
5823
  sectionNumber?: string | undefined;
5685
5824
  coverageType?: string | undefined;
5686
5825
  subsections?: {
@@ -5698,6 +5837,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5698
5837
  formTitle: z.ZodOptional<z.ZodString>;
5699
5838
  sectionRef: z.ZodOptional<z.ZodString>;
5700
5839
  originalContent: z.ZodOptional<z.ZodString>;
5840
+ recordId: z.ZodOptional<z.ZodString>;
5841
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5842
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5701
5843
  }, "strip", z.ZodTypeAny, {
5702
5844
  definition: string;
5703
5845
  term: string;
@@ -5705,6 +5847,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5705
5847
  pageNumber?: number | undefined;
5706
5848
  sectionRef?: string | undefined;
5707
5849
  originalContent?: string | undefined;
5850
+ recordId?: string | undefined;
5851
+ sourceSpanIds?: string[] | undefined;
5852
+ sourceTextHash?: string | undefined;
5708
5853
  formTitle?: string | undefined;
5709
5854
  }, {
5710
5855
  definition: string;
@@ -5713,6 +5858,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5713
5858
  pageNumber?: number | undefined;
5714
5859
  sectionRef?: string | undefined;
5715
5860
  originalContent?: string | undefined;
5861
+ recordId?: string | undefined;
5862
+ sourceSpanIds?: string[] | undefined;
5863
+ sourceTextHash?: string | undefined;
5716
5864
  formTitle?: string | undefined;
5717
5865
  }>, "many">>;
5718
5866
  coveredReasons: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -5728,6 +5876,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5728
5876
  formTitle: z.ZodOptional<z.ZodString>;
5729
5877
  sectionRef: z.ZodOptional<z.ZodString>;
5730
5878
  originalContent: z.ZodOptional<z.ZodString>;
5879
+ recordId: z.ZodOptional<z.ZodString>;
5880
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5881
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5731
5882
  }, "strip", z.ZodTypeAny, {
5732
5883
  content: string;
5733
5884
  coverageName: string;
@@ -5738,6 +5889,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5738
5889
  pageNumber?: number | undefined;
5739
5890
  sectionRef?: string | undefined;
5740
5891
  originalContent?: string | undefined;
5892
+ recordId?: string | undefined;
5893
+ sourceSpanIds?: string[] | undefined;
5894
+ sourceTextHash?: string | undefined;
5741
5895
  exceptions?: string[] | undefined;
5742
5896
  formTitle?: string | undefined;
5743
5897
  reasonNumber?: string | undefined;
@@ -5751,6 +5905,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5751
5905
  pageNumber?: number | undefined;
5752
5906
  sectionRef?: string | undefined;
5753
5907
  originalContent?: string | undefined;
5908
+ recordId?: string | undefined;
5909
+ sourceSpanIds?: string[] | undefined;
5910
+ sourceTextHash?: string | undefined;
5754
5911
  exceptions?: string[] | undefined;
5755
5912
  formTitle?: string | undefined;
5756
5913
  reasonNumber?: string | undefined;
@@ -5866,6 +6023,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5866
6023
  pageNumber: z.ZodOptional<z.ZodNumber>;
5867
6024
  sectionRef: z.ZodOptional<z.ZodString>;
5868
6025
  originalContent: z.ZodOptional<z.ZodString>;
6026
+ recordId: z.ZodOptional<z.ZodString>;
6027
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6028
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5869
6029
  }, "strip", z.ZodTypeAny, {
5870
6030
  name: string;
5871
6031
  limit: string;
@@ -5878,6 +6038,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5878
6038
  pageNumber?: number | undefined;
5879
6039
  sectionRef?: string | undefined;
5880
6040
  originalContent?: string | undefined;
6041
+ recordId?: string | undefined;
6042
+ sourceSpanIds?: string[] | undefined;
6043
+ sourceTextHash?: string | undefined;
5881
6044
  coverageCode?: string | undefined;
5882
6045
  formEditionDate?: string | undefined;
5883
6046
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -5901,6 +6064,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5901
6064
  pageNumber?: number | undefined;
5902
6065
  sectionRef?: string | undefined;
5903
6066
  originalContent?: string | undefined;
6067
+ recordId?: string | undefined;
6068
+ sourceSpanIds?: string[] | undefined;
6069
+ sourceTextHash?: string | undefined;
5904
6070
  coverageCode?: string | undefined;
5905
6071
  formEditionDate?: string | undefined;
5906
6072
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -5979,6 +6145,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5979
6145
  content: z.ZodString;
5980
6146
  pageStart: z.ZodNumber;
5981
6147
  pageEnd: z.ZodOptional<z.ZodNumber>;
6148
+ recordId: z.ZodOptional<z.ZodString>;
6149
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6150
+ sourceTextHash: z.ZodOptional<z.ZodString>;
5982
6151
  }, "strip", z.ZodTypeAny, {
5983
6152
  title: string;
5984
6153
  formNumber: string;
@@ -5987,6 +6156,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
5987
6156
  content: string;
5988
6157
  editionDate?: string | undefined;
5989
6158
  pageEnd?: number | undefined;
6159
+ recordId?: string | undefined;
6160
+ sourceSpanIds?: string[] | undefined;
6161
+ sourceTextHash?: string | undefined;
5990
6162
  effectiveDate?: string | undefined;
5991
6163
  affectedCoverageParts?: string[] | undefined;
5992
6164
  namedParties?: {
@@ -6013,6 +6185,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
6013
6185
  content: string;
6014
6186
  editionDate?: string | undefined;
6015
6187
  pageEnd?: number | undefined;
6188
+ recordId?: string | undefined;
6189
+ sourceSpanIds?: string[] | undefined;
6190
+ sourceTextHash?: string | undefined;
6016
6191
  effectiveDate?: string | undefined;
6017
6192
  affectedCoverageParts?: string[] | undefined;
6018
6193
  namedParties?: {
@@ -6043,12 +6218,18 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
6043
6218
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6044
6219
  content: z.ZodString;
6045
6220
  pageNumber: z.ZodOptional<z.ZodNumber>;
6221
+ recordId: z.ZodOptional<z.ZodString>;
6222
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6223
+ sourceTextHash: z.ZodOptional<z.ZodString>;
6046
6224
  }, "strip", z.ZodTypeAny, {
6047
6225
  name: string;
6048
6226
  content: string;
6049
6227
  formNumber?: string | undefined;
6050
6228
  appliesTo?: string[] | undefined;
6051
6229
  pageNumber?: number | undefined;
6230
+ recordId?: string | undefined;
6231
+ sourceSpanIds?: string[] | undefined;
6232
+ sourceTextHash?: string | undefined;
6052
6233
  excludedPerils?: string[] | undefined;
6053
6234
  isAbsolute?: boolean | undefined;
6054
6235
  exceptions?: string[] | undefined;
@@ -6060,6 +6241,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
6060
6241
  formNumber?: string | undefined;
6061
6242
  appliesTo?: string[] | undefined;
6062
6243
  pageNumber?: number | undefined;
6244
+ recordId?: string | undefined;
6245
+ sourceSpanIds?: string[] | undefined;
6246
+ sourceTextHash?: string | undefined;
6063
6247
  excludedPerils?: string[] | undefined;
6064
6248
  isAbsolute?: boolean | undefined;
6065
6249
  exceptions?: string[] | undefined;
@@ -6081,11 +6265,17 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
6081
6265
  key: string;
6082
6266
  }>, "many">>;
6083
6267
  pageNumber: z.ZodOptional<z.ZodNumber>;
6268
+ recordId: z.ZodOptional<z.ZodString>;
6269
+ sourceSpanIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6270
+ sourceTextHash: z.ZodOptional<z.ZodString>;
6084
6271
  }, "strip", z.ZodTypeAny, {
6085
6272
  name: string;
6086
6273
  content: string;
6087
6274
  conditionType: "other" | "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";
6088
6275
  pageNumber?: number | undefined;
6276
+ recordId?: string | undefined;
6277
+ sourceSpanIds?: string[] | undefined;
6278
+ sourceTextHash?: string | undefined;
6089
6279
  keyValues?: {
6090
6280
  value: string;
6091
6281
  key: string;
@@ -6095,6 +6285,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
6095
6285
  content: string;
6096
6286
  conditionType: "other" | "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";
6097
6287
  pageNumber?: number | undefined;
6288
+ recordId?: string | undefined;
6289
+ sourceSpanIds?: string[] | undefined;
6290
+ sourceTextHash?: string | undefined;
6098
6291
  keyValues?: {
6099
6292
  value: string;
6100
6293
  key: string;
@@ -9203,6 +9396,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9203
9396
  pageNumber?: number | undefined;
9204
9397
  sectionRef?: string | undefined;
9205
9398
  originalContent?: string | undefined;
9399
+ recordId?: string | undefined;
9400
+ sourceSpanIds?: string[] | undefined;
9401
+ sourceTextHash?: string | undefined;
9206
9402
  }[];
9207
9403
  carrier: string;
9208
9404
  id: string;
@@ -9708,6 +9904,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9708
9904
  content: string;
9709
9905
  conditionType: "other" | "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";
9710
9906
  pageNumber?: number | undefined;
9907
+ recordId?: string | undefined;
9908
+ sourceSpanIds?: string[] | undefined;
9909
+ sourceTextHash?: string | undefined;
9711
9910
  keyValues?: {
9712
9911
  value: string;
9713
9912
  key: string;
@@ -9819,6 +10018,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9819
10018
  pageStart: number;
9820
10019
  content: string;
9821
10020
  pageEnd?: number | undefined;
10021
+ recordId?: string | undefined;
10022
+ sourceSpanIds?: string[] | undefined;
10023
+ sourceTextHash?: string | undefined;
9822
10024
  sectionNumber?: string | undefined;
9823
10025
  coverageType?: string | undefined;
9824
10026
  subsections?: {
@@ -9835,6 +10037,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9835
10037
  pageNumber?: number | undefined;
9836
10038
  sectionRef?: string | undefined;
9837
10039
  originalContent?: string | undefined;
10040
+ recordId?: string | undefined;
10041
+ sourceSpanIds?: string[] | undefined;
10042
+ sourceTextHash?: string | undefined;
9838
10043
  formTitle?: string | undefined;
9839
10044
  }[] | undefined;
9840
10045
  coveredReasons?: {
@@ -9847,6 +10052,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9847
10052
  pageNumber?: number | undefined;
9848
10053
  sectionRef?: string | undefined;
9849
10054
  originalContent?: string | undefined;
10055
+ recordId?: string | undefined;
10056
+ sourceSpanIds?: string[] | undefined;
10057
+ sourceTextHash?: string | undefined;
9850
10058
  exceptions?: string[] | undefined;
9851
10059
  formTitle?: string | undefined;
9852
10060
  reasonNumber?: string | undefined;
@@ -9900,6 +10108,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9900
10108
  pageNumber?: number | undefined;
9901
10109
  sectionRef?: string | undefined;
9902
10110
  originalContent?: string | undefined;
10111
+ recordId?: string | undefined;
10112
+ sourceSpanIds?: string[] | undefined;
10113
+ sourceTextHash?: string | undefined;
9903
10114
  coverageCode?: string | undefined;
9904
10115
  formEditionDate?: string | undefined;
9905
10116
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -9920,6 +10131,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9920
10131
  content: string;
9921
10132
  editionDate?: string | undefined;
9922
10133
  pageEnd?: number | undefined;
10134
+ recordId?: string | undefined;
10135
+ sourceSpanIds?: string[] | undefined;
10136
+ sourceTextHash?: string | undefined;
9923
10137
  effectiveDate?: string | undefined;
9924
10138
  affectedCoverageParts?: string[] | undefined;
9925
10139
  namedParties?: {
@@ -9945,6 +10159,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
9945
10159
  formNumber?: string | undefined;
9946
10160
  appliesTo?: string[] | undefined;
9947
10161
  pageNumber?: number | undefined;
10162
+ recordId?: string | undefined;
10163
+ sourceSpanIds?: string[] | undefined;
10164
+ sourceTextHash?: string | undefined;
9948
10165
  excludedPerils?: string[] | undefined;
9949
10166
  isAbsolute?: boolean | undefined;
9950
10167
  exceptions?: string[] | undefined;
@@ -10186,6 +10403,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10186
10403
  pageNumber?: number | undefined;
10187
10404
  sectionRef?: string | undefined;
10188
10405
  originalContent?: string | undefined;
10406
+ recordId?: string | undefined;
10407
+ sourceSpanIds?: string[] | undefined;
10408
+ sourceTextHash?: string | undefined;
10189
10409
  }[];
10190
10410
  carrier: string;
10191
10411
  id: string;
@@ -10691,6 +10911,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10691
10911
  content: string;
10692
10912
  conditionType: "other" | "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";
10693
10913
  pageNumber?: number | undefined;
10914
+ recordId?: string | undefined;
10915
+ sourceSpanIds?: string[] | undefined;
10916
+ sourceTextHash?: string | undefined;
10694
10917
  keyValues?: {
10695
10918
  value: string;
10696
10919
  key: string;
@@ -10802,6 +11025,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10802
11025
  pageStart: number;
10803
11026
  content: string;
10804
11027
  pageEnd?: number | undefined;
11028
+ recordId?: string | undefined;
11029
+ sourceSpanIds?: string[] | undefined;
11030
+ sourceTextHash?: string | undefined;
10805
11031
  sectionNumber?: string | undefined;
10806
11032
  coverageType?: string | undefined;
10807
11033
  subsections?: {
@@ -10818,6 +11044,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10818
11044
  pageNumber?: number | undefined;
10819
11045
  sectionRef?: string | undefined;
10820
11046
  originalContent?: string | undefined;
11047
+ recordId?: string | undefined;
11048
+ sourceSpanIds?: string[] | undefined;
11049
+ sourceTextHash?: string | undefined;
10821
11050
  formTitle?: string | undefined;
10822
11051
  }[] | undefined;
10823
11052
  coveredReasons?: {
@@ -10830,6 +11059,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10830
11059
  pageNumber?: number | undefined;
10831
11060
  sectionRef?: string | undefined;
10832
11061
  originalContent?: string | undefined;
11062
+ recordId?: string | undefined;
11063
+ sourceSpanIds?: string[] | undefined;
11064
+ sourceTextHash?: string | undefined;
10833
11065
  exceptions?: string[] | undefined;
10834
11066
  formTitle?: string | undefined;
10835
11067
  reasonNumber?: string | undefined;
@@ -10883,6 +11115,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10883
11115
  pageNumber?: number | undefined;
10884
11116
  sectionRef?: string | undefined;
10885
11117
  originalContent?: string | undefined;
11118
+ recordId?: string | undefined;
11119
+ sourceSpanIds?: string[] | undefined;
11120
+ sourceTextHash?: string | undefined;
10886
11121
  coverageCode?: string | undefined;
10887
11122
  formEditionDate?: string | undefined;
10888
11123
  deductibleType?: "per_occurrence" | "per_claim" | "aggregate" | "percentage" | "waiting_period" | undefined;
@@ -10903,6 +11138,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10903
11138
  content: string;
10904
11139
  editionDate?: string | undefined;
10905
11140
  pageEnd?: number | undefined;
11141
+ recordId?: string | undefined;
11142
+ sourceSpanIds?: string[] | undefined;
11143
+ sourceTextHash?: string | undefined;
10906
11144
  effectiveDate?: string | undefined;
10907
11145
  affectedCoverageParts?: string[] | undefined;
10908
11146
  namedParties?: {
@@ -10928,6 +11166,9 @@ declare const InsuranceDocumentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
10928
11166
  formNumber?: string | undefined;
10929
11167
  appliesTo?: string[] | undefined;
10930
11168
  pageNumber?: number | undefined;
11169
+ recordId?: string | undefined;
11170
+ sourceSpanIds?: string[] | undefined;
11171
+ sourceTextHash?: string | undefined;
10931
11172
  excludedPerils?: string[] | undefined;
10932
11173
  isAbsolute?: boolean | undefined;
10933
11174
  exceptions?: string[] | undefined;
@@ -11212,6 +11453,193 @@ interface MemoryStore {
11212
11453
  searchHistory(query: string, conversationId?: string): Promise<ConversationTurn[]>;
11213
11454
  }
11214
11455
 
11456
+ declare const SourceSpanSchema: z.ZodObject<{
11457
+ id: z.ZodString;
11458
+ documentId: z.ZodString;
11459
+ sourceKind: z.ZodOptional<z.ZodEnum<["policy_pdf", "application_pdf", "email", "attachment", "manual_note"]>>;
11460
+ chunkId: z.ZodOptional<z.ZodString>;
11461
+ kind: z.ZodEnum<["pdf_text", "pdf_image", "html", "markdown", "plain_text", "structured_field"]>;
11462
+ text: z.ZodString;
11463
+ hash: z.ZodString;
11464
+ textHash: z.ZodOptional<z.ZodString>;
11465
+ pageStart: z.ZodOptional<z.ZodNumber>;
11466
+ pageEnd: z.ZodOptional<z.ZodNumber>;
11467
+ sectionId: z.ZodOptional<z.ZodString>;
11468
+ formNumber: z.ZodOptional<z.ZodString>;
11469
+ bbox: z.ZodOptional<z.ZodArray<z.ZodObject<{
11470
+ page: z.ZodNumber;
11471
+ x: z.ZodNumber;
11472
+ y: z.ZodNumber;
11473
+ width: z.ZodNumber;
11474
+ height: z.ZodNumber;
11475
+ }, "strip", z.ZodTypeAny, {
11476
+ page: number;
11477
+ x: number;
11478
+ y: number;
11479
+ width: number;
11480
+ height: number;
11481
+ }, {
11482
+ page: number;
11483
+ x: number;
11484
+ y: number;
11485
+ width: number;
11486
+ height: number;
11487
+ }>, "many">>;
11488
+ location: z.ZodOptional<z.ZodObject<{
11489
+ page: z.ZodOptional<z.ZodNumber>;
11490
+ startPage: z.ZodOptional<z.ZodNumber>;
11491
+ endPage: z.ZodOptional<z.ZodNumber>;
11492
+ charStart: z.ZodOptional<z.ZodNumber>;
11493
+ charEnd: z.ZodOptional<z.ZodNumber>;
11494
+ lineStart: z.ZodOptional<z.ZodNumber>;
11495
+ lineEnd: z.ZodOptional<z.ZodNumber>;
11496
+ fieldPath: z.ZodOptional<z.ZodString>;
11497
+ }, "strip", z.ZodTypeAny, {
11498
+ page?: number | undefined;
11499
+ startPage?: number | undefined;
11500
+ endPage?: number | undefined;
11501
+ charStart?: number | undefined;
11502
+ charEnd?: number | undefined;
11503
+ lineStart?: number | undefined;
11504
+ lineEnd?: number | undefined;
11505
+ fieldPath?: string | undefined;
11506
+ }, {
11507
+ page?: number | undefined;
11508
+ startPage?: number | undefined;
11509
+ endPage?: number | undefined;
11510
+ charStart?: number | undefined;
11511
+ charEnd?: number | undefined;
11512
+ lineStart?: number | undefined;
11513
+ lineEnd?: number | undefined;
11514
+ fieldPath?: string | undefined;
11515
+ }>>;
11516
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11517
+ }, "strip", z.ZodTypeAny, {
11518
+ id: string;
11519
+ documentId: string;
11520
+ kind: "pdf_text" | "pdf_image" | "html" | "markdown" | "plain_text" | "structured_field";
11521
+ text: string;
11522
+ hash: string;
11523
+ formNumber?: string | undefined;
11524
+ pageStart?: number | undefined;
11525
+ pageEnd?: number | undefined;
11526
+ location?: {
11527
+ page?: number | undefined;
11528
+ startPage?: number | undefined;
11529
+ endPage?: number | undefined;
11530
+ charStart?: number | undefined;
11531
+ charEnd?: number | undefined;
11532
+ lineStart?: number | undefined;
11533
+ lineEnd?: number | undefined;
11534
+ fieldPath?: string | undefined;
11535
+ } | undefined;
11536
+ sourceKind?: "email" | "policy_pdf" | "application_pdf" | "attachment" | "manual_note" | undefined;
11537
+ chunkId?: string | undefined;
11538
+ textHash?: string | undefined;
11539
+ sectionId?: string | undefined;
11540
+ bbox?: {
11541
+ page: number;
11542
+ x: number;
11543
+ y: number;
11544
+ width: number;
11545
+ height: number;
11546
+ }[] | undefined;
11547
+ metadata?: Record<string, string> | undefined;
11548
+ }, {
11549
+ id: string;
11550
+ documentId: string;
11551
+ kind: "pdf_text" | "pdf_image" | "html" | "markdown" | "plain_text" | "structured_field";
11552
+ text: string;
11553
+ hash: string;
11554
+ formNumber?: string | undefined;
11555
+ pageStart?: number | undefined;
11556
+ pageEnd?: number | undefined;
11557
+ location?: {
11558
+ page?: number | undefined;
11559
+ startPage?: number | undefined;
11560
+ endPage?: number | undefined;
11561
+ charStart?: number | undefined;
11562
+ charEnd?: number | undefined;
11563
+ lineStart?: number | undefined;
11564
+ lineEnd?: number | undefined;
11565
+ fieldPath?: string | undefined;
11566
+ } | undefined;
11567
+ sourceKind?: "email" | "policy_pdf" | "application_pdf" | "attachment" | "manual_note" | undefined;
11568
+ chunkId?: string | undefined;
11569
+ textHash?: string | undefined;
11570
+ sectionId?: string | undefined;
11571
+ bbox?: {
11572
+ page: number;
11573
+ x: number;
11574
+ y: number;
11575
+ width: number;
11576
+ height: number;
11577
+ }[] | undefined;
11578
+ metadata?: Record<string, string> | undefined;
11579
+ }>;
11580
+ type SourceSpan = z.infer<typeof SourceSpanSchema>;
11581
+ declare const SourceChunkSchema: z.ZodObject<{
11582
+ id: z.ZodString;
11583
+ documentId: z.ZodString;
11584
+ sourceSpanIds: z.ZodArray<z.ZodString, "many">;
11585
+ text: z.ZodString;
11586
+ textHash: z.ZodString;
11587
+ pageStart: z.ZodOptional<z.ZodNumber>;
11588
+ pageEnd: z.ZodOptional<z.ZodNumber>;
11589
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
11590
+ }, "strip", z.ZodTypeAny, {
11591
+ sourceSpanIds: string[];
11592
+ id: string;
11593
+ documentId: string;
11594
+ text: string;
11595
+ textHash: string;
11596
+ metadata: Record<string, string>;
11597
+ pageStart?: number | undefined;
11598
+ pageEnd?: number | undefined;
11599
+ }, {
11600
+ sourceSpanIds: string[];
11601
+ id: string;
11602
+ documentId: string;
11603
+ text: string;
11604
+ textHash: string;
11605
+ pageStart?: number | undefined;
11606
+ pageEnd?: number | undefined;
11607
+ metadata?: Record<string, string> | undefined;
11608
+ }>;
11609
+ type SourceChunk = z.infer<typeof SourceChunkSchema>;
11610
+
11611
+ type SourceRetrievalMode = "graph_only" | "source_rag" | "long_context" | "hybrid";
11612
+ interface SourceRetrievalQuery {
11613
+ question: string;
11614
+ documentIds?: string[];
11615
+ chunkIds?: string[];
11616
+ limit?: number;
11617
+ mode?: SourceRetrievalMode;
11618
+ filters?: Record<string, string>;
11619
+ }
11620
+ interface SourceRetrievalResult {
11621
+ span: SourceSpan;
11622
+ relevance: number;
11623
+ }
11624
+ interface SourceRetriever {
11625
+ searchSourceSpans(query: SourceRetrievalQuery): Promise<SourceRetrievalResult[]>;
11626
+ }
11627
+
11628
+ interface SourceStore extends SourceRetriever {
11629
+ addSourceSpans(spans: SourceSpan[]): Promise<void>;
11630
+ addSourceChunks(chunks: SourceChunk[]): Promise<void>;
11631
+ getSourceSpan(id: string): Promise<SourceSpan | null>;
11632
+ getSourceSpansByDocument(documentId: string): Promise<SourceSpan[]>;
11633
+ getSourceChunksByDocument(documentId: string): Promise<SourceChunk[]>;
11634
+ deleteDocumentSource(documentId: string): Promise<void>;
11635
+ }
11636
+
11637
+ declare function createSqliteDocumentStore(db: Database.Database): DocumentStore;
11638
+
11639
+ declare function createSqliteMemoryStore(db: Database.Database, embed: EmbedText): MemoryStore;
11640
+
11641
+ declare function createSqliteSourceStore(db: Database.Database, embed: EmbedText): SourceStore;
11642
+
11215
11643
  interface SqliteStoreOptions {
11216
11644
  path: string;
11217
11645
  embed: EmbedText;
@@ -11219,7 +11647,8 @@ interface SqliteStoreOptions {
11219
11647
  declare function createSqliteStore(options: SqliteStoreOptions): {
11220
11648
  documents: DocumentStore;
11221
11649
  memory: MemoryStore;
11650
+ source: SourceStore;
11222
11651
  close: () => void;
11223
11652
  };
11224
11653
 
11225
- export { type DocumentStore, type MemoryStore, type SqliteStoreOptions, createSqliteStore };
11654
+ export { type DocumentStore, type MemoryStore, type SourceStore, type SqliteStoreOptions, createSqliteDocumentStore, createSqliteMemoryStore, createSqliteSourceStore, createSqliteStore };