@claritylabs/cl-sdk 4.0.1 → 4.1.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.
- package/README.md +1 -1
- package/dist/application.d.mts +1 -1
- package/dist/application.d.ts +1 -1
- package/dist/application.js +35 -0
- package/dist/application.js.map +1 -1
- package/dist/application.mjs +35 -0
- package/dist/application.mjs.map +1 -1
- package/dist/{index-Cte-BzHF.d.mts → index-BzrY6OMD.d.mts} +228 -2
- package/dist/{index-Cte-BzHF.d.ts → index-BzrY6OMD.d.ts} +228 -2
- package/dist/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +231 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -1
- package/dist/index.mjs.map +1 -1
- package/dist/storage-sqlite.js +35 -0
- package/dist/storage-sqlite.js.map +1 -1
- package/dist/storage-sqlite.mjs +35 -0
- package/dist/storage-sqlite.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LogFn, M as ModelTaskKind, a as ModelBudgetResolution, b as ModelCallTrace, G as GenerateObject, T as TokenUsage, O as OperationalCoverageLine, S as SourceSpanLocation, c as SourceSpan, D as DocumentSourceNode, d as SourceKind, e as SourceSpanUnit, f as SourceSpanTableLocation, g as SourceChunk, h as SourceSpanBBox, U as UnifiedQualityReport, B as BaseQualityIssue, Q as QualityGateStatus, P as PdfInput, I as InsuranceDocument, i as DocumentChunk, j as PolicyOperationalProfile, k as PerformanceReport, l as QualityGateMode, m as ModelCapabilities, n as ModelBudgetConstraint, A as AgentContext, o as GenerateText, p as DocumentStore, q as MemoryStore, r as Platform } from './index-
|
|
2
|
-
export { s as AcroFormMapping, t as AcroFormMappingSchema, u as AnswerParsingResult, v as AnswerParsingResultSchema, w as ApplicationClassifyResult, x as ApplicationClassifyResultSchema, y as ApplicationContextProposal, z as ApplicationContextProposalSchema, C as ApplicationEmailReviewSchema, E as ApplicationField, F as ApplicationFieldSchema, H as ApplicationListFilters, J as ApplicationNextQuestions, K as ApplicationPacket, N as ApplicationPacketAnswer, R as ApplicationPacketAnswerSchema, V as ApplicationPacketSchema, W as ApplicationPipelineConfig, X as ApplicationQualityArtifactSchema, Y as ApplicationQualityIssueSchema, Z as ApplicationQualityReportSchema, _ as ApplicationQualityRoundSchema, $ as ApplicationQuestionCondition, a0 as ApplicationQuestionConditionSchema, a1 as ApplicationQuestionGraph, a2 as ApplicationQuestionGraphSchema, a3 as ApplicationQuestionNode, a4 as ApplicationQuestionNodeSchema, a5 as ApplicationRepeat, a6 as ApplicationRepeatSchema, a7 as ApplicationState, a8 as ApplicationStateSchema, a9 as ApplicationStore, aa as ApplicationTemplate, ab as ApplicationTemplateListFilters, ac as ApplicationTemplateSchema, ad as ApplicationTemplateStore, ae as AutoFillMatch, af as AutoFillMatchSchema, ag as AutoFillResult, ah as AutoFillResultSchema, ai as AuxiliaryFact, aj as AuxiliaryFactSchema, ak as BackfillProvider, al as BuildApplicationPacketInput, am as BuildApplicationPacketResult, an as ChunkFilter, ao as CommunicationIntent, ap as CommunicationIntentSchema, aq as ContextProposalResult, ar as ConversationTurn, as as ConvertPdfToImagesFn, at as CoveredReason, au as CoveredReasonSchema, av as CreateApplicationRunInput, aw as Definition, ax as DefinitionSchema, ay as DocumentAgentGuidance, az as DocumentAgentGuidanceSchema, aA as DocumentFilters, aB as DocumentMetadata, aC as DocumentMetadataSchema, aD as DocumentNode, aE as DocumentNodeSchema, aF as DocumentPageMapEntry, aG as DocumentPageMapEntrySchema, aH as DocumentSourceNodeKind, aI as DocumentSourceNodeKindSchema, aJ as DocumentSourceNodeSchema, aK as DocumentTableOfContentsEntry, aL as DocumentTableOfContentsEntrySchema, aM as EmbedText, aN as FieldExtractionResult, aO as FieldExtractionResultSchema, aP as FieldType, aQ as FieldTypeSchema, aR as FlatPdfPlacement, aS as FlatPdfPlacementSchema, aT as InsuranceDocumentSchema, aU as LookupFill, aV as LookupFillResult, aW as LookupFillResultSchema, aX as LookupFillSchema, aY as LookupRequest, aZ as LookupRequestSchema, a_ as ModelCallReport, a$ as
|
|
1
|
+
import { L as LogFn, M as ModelTaskKind, a as ModelBudgetResolution, b as ModelCallTrace, G as GenerateObject, T as TokenUsage, O as OperationalCoverageLine, S as SourceSpanLocation, c as SourceSpan, D as DocumentSourceNode, d as SourceKind, e as SourceSpanUnit, f as SourceSpanTableLocation, g as SourceChunk, h as SourceSpanBBox, U as UnifiedQualityReport, B as BaseQualityIssue, Q as QualityGateStatus, P as PdfInput, I as InsuranceDocument, i as DocumentChunk, j as PolicyOperationalProfile, k as PerformanceReport, l as QualityGateMode, m as ModelCapabilities, n as ModelBudgetConstraint, A as AgentContext, o as GenerateText, p as DocumentStore, q as MemoryStore, r as Platform } from './index-BzrY6OMD.mjs';
|
|
2
|
+
export { s as AcroFormMapping, t as AcroFormMappingSchema, u as AnswerParsingResult, v as AnswerParsingResultSchema, w as ApplicationClassifyResult, x as ApplicationClassifyResultSchema, y as ApplicationContextProposal, z as ApplicationContextProposalSchema, C as ApplicationEmailReviewSchema, E as ApplicationField, F as ApplicationFieldSchema, H as ApplicationListFilters, J as ApplicationNextQuestions, K as ApplicationPacket, N as ApplicationPacketAnswer, R as ApplicationPacketAnswerSchema, V as ApplicationPacketSchema, W as ApplicationPipelineConfig, X as ApplicationQualityArtifactSchema, Y as ApplicationQualityIssueSchema, Z as ApplicationQualityReportSchema, _ as ApplicationQualityRoundSchema, $ as ApplicationQuestionCondition, a0 as ApplicationQuestionConditionSchema, a1 as ApplicationQuestionGraph, a2 as ApplicationQuestionGraphSchema, a3 as ApplicationQuestionNode, a4 as ApplicationQuestionNodeSchema, a5 as ApplicationRepeat, a6 as ApplicationRepeatSchema, a7 as ApplicationState, a8 as ApplicationStateSchema, a9 as ApplicationStore, aa as ApplicationTemplate, ab as ApplicationTemplateListFilters, ac as ApplicationTemplateSchema, ad as ApplicationTemplateStore, ae as AutoFillMatch, af as AutoFillMatchSchema, ag as AutoFillResult, ah as AutoFillResultSchema, ai as AuxiliaryFact, aj as AuxiliaryFactSchema, ak as BackfillProvider, al as BuildApplicationPacketInput, am as BuildApplicationPacketResult, an as ChunkFilter, ao as CommunicationIntent, ap as CommunicationIntentSchema, aq as ContextProposalResult, ar as ConversationTurn, as as ConvertPdfToImagesFn, at as CoveredReason, au as CoveredReasonSchema, av as CreateApplicationRunInput, aw as Definition, ax as DefinitionSchema, ay as DocumentAgentGuidance, az as DocumentAgentGuidanceSchema, aA as DocumentFilters, aB as DocumentMetadata, aC as DocumentMetadataSchema, aD as DocumentNode, aE as DocumentNodeSchema, aF as DocumentPageMapEntry, aG as DocumentPageMapEntrySchema, aH as DocumentSourceNodeKind, aI as DocumentSourceNodeKindSchema, aJ as DocumentSourceNodeSchema, aK as DocumentTableOfContentsEntry, aL as DocumentTableOfContentsEntrySchema, aM as EmbedText, aN as FieldExtractionResult, aO as FieldExtractionResultSchema, aP as FieldType, aQ as FieldTypeSchema, aR as FlatPdfPlacement, aS as FlatPdfPlacementSchema, aT as InsuranceDocumentSchema, aU as LookupFill, aV as LookupFillResult, aW as LookupFillResultSchema, aX as LookupFillSchema, aY as LookupRequest, aZ as LookupRequestSchema, a_ as ModelCallReport, a$ as OperationalAddress, b0 as OperationalAddressSchema, b1 as OperationalCoverageLineSchema, b2 as OperationalCoverageTerm, b3 as OperationalCoverageTermSchema, b4 as OperationalDeclarationFact, b5 as OperationalDeclarationFactSchema, b6 as OperationalEndorsementSupport, b7 as OperationalEndorsementSupportSchema, b8 as OperationalParty, b9 as OperationalPartySchema, ba as PLATFORM_CONFIGS, bb as ParsedAnswer, bc as ParsedAnswerSchema, bd as PlatformConfig, be as PlatformSchema, bf as PolicyDocument, bg as PolicyDocumentSchema, bh as PolicyOperationalProfileSchema, bi as PremiumLine, bj as PremiumLineSchema, bk as PriorAnswer, bl as ProcessApplicationInput, bm as ProcessApplicationResult, bn as ProcessReplyInput, bo as ProcessReplyResult, bp as QuestionBatchResult, bq as QuestionBatchResultSchema, br as QuoteDocument, bs as QuoteDocumentSchema, bt as ReplyIntent, bu as ReplyIntentSchema, bv as ResolveModelBudgetParams, bw as Section, bx as SectionSchema, by as SourceBackedValue, bz as SourceBackedValueSchema, bA as SourceChunkSchema, bB as SourceKindSchema, bC as SourceSpanBBoxSchema, bD as SourceSpanKind, bE as SourceSpanKindSchema, bF as SourceSpanLocationSchema, bG as SourceSpanRef, bH as SourceSpanRefSchema, bI as SourceSpanSchema, bJ as SourceSpanTableLocationSchema, bK as SourceSpanUnitSchema, bL as Subjectivity, bM as SubjectivitySchema, bN as Subsection, bO as SubsectionSchema, bP as UnderwritingCondition, bQ as UnderwritingConditionSchema, bR as applyApplicationAnswers, bS as buildApplicationPacket, bT as buildQuestionGraphFromFields, bU as createApplicationPipeline, bV as createApplicationRun, bW as extractQuestionGraphFromFields, bX as flattenQuestionGraph, bY as getActiveApplicationFields, bZ as getNextApplicationQuestions, b_ as normalizeApplicationQuestionGraph, b$ as planNextApplicationQuestions, c0 as proposeContextWrites, c1 as resolveModelBudget, c2 as validateApplicationPacket } from './index-BzrY6OMD.mjs';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import { ZodTypeAny, z, ZodSchema } from 'zod';
|
|
5
5
|
import { PDFDocument } from 'pdf-lib';
|
|
@@ -9342,8 +9342,8 @@ declare const CitationSchema: z.ZodObject<{
|
|
|
9342
9342
|
relevance: number;
|
|
9343
9343
|
chunkId?: string | undefined;
|
|
9344
9344
|
sourceSpanId?: string | undefined;
|
|
9345
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9346
9345
|
field?: string | undefined;
|
|
9346
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9347
9347
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9348
9348
|
sourceNodeId?: string | undefined;
|
|
9349
9349
|
sourceLocation?: {
|
|
@@ -9363,8 +9363,8 @@ declare const CitationSchema: z.ZodObject<{
|
|
|
9363
9363
|
relevance: number;
|
|
9364
9364
|
chunkId?: string | undefined;
|
|
9365
9365
|
sourceSpanId?: string | undefined;
|
|
9366
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9367
9366
|
field?: string | undefined;
|
|
9367
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9368
9368
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9369
9369
|
sourceNodeId?: string | undefined;
|
|
9370
9370
|
sourceLocation?: {
|
|
@@ -9428,8 +9428,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9428
9428
|
relevance: number;
|
|
9429
9429
|
chunkId?: string | undefined;
|
|
9430
9430
|
sourceSpanId?: string | undefined;
|
|
9431
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9432
9431
|
field?: string | undefined;
|
|
9432
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9433
9433
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9434
9434
|
sourceNodeId?: string | undefined;
|
|
9435
9435
|
sourceLocation?: {
|
|
@@ -9449,8 +9449,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9449
9449
|
relevance: number;
|
|
9450
9450
|
chunkId?: string | undefined;
|
|
9451
9451
|
sourceSpanId?: string | undefined;
|
|
9452
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9453
9452
|
field?: string | undefined;
|
|
9453
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9454
9454
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9455
9455
|
sourceNodeId?: string | undefined;
|
|
9456
9456
|
sourceLocation?: {
|
|
@@ -9475,8 +9475,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9475
9475
|
relevance: number;
|
|
9476
9476
|
chunkId?: string | undefined;
|
|
9477
9477
|
sourceSpanId?: string | undefined;
|
|
9478
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9479
9478
|
field?: string | undefined;
|
|
9479
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9480
9480
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9481
9481
|
sourceNodeId?: string | undefined;
|
|
9482
9482
|
sourceLocation?: {
|
|
@@ -9502,8 +9502,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9502
9502
|
relevance: number;
|
|
9503
9503
|
chunkId?: string | undefined;
|
|
9504
9504
|
sourceSpanId?: string | undefined;
|
|
9505
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9506
9505
|
field?: string | undefined;
|
|
9506
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9507
9507
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9508
9508
|
sourceNodeId?: string | undefined;
|
|
9509
9509
|
sourceLocation?: {
|
|
@@ -9584,8 +9584,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9584
9584
|
relevance: number;
|
|
9585
9585
|
chunkId?: string | undefined;
|
|
9586
9586
|
sourceSpanId?: string | undefined;
|
|
9587
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9588
9587
|
field?: string | undefined;
|
|
9588
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9589
9589
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9590
9590
|
sourceNodeId?: string | undefined;
|
|
9591
9591
|
sourceLocation?: {
|
|
@@ -9605,8 +9605,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9605
9605
|
relevance: number;
|
|
9606
9606
|
chunkId?: string | undefined;
|
|
9607
9607
|
sourceSpanId?: string | undefined;
|
|
9608
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9609
9608
|
field?: string | undefined;
|
|
9609
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9610
9610
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9611
9611
|
sourceNodeId?: string | undefined;
|
|
9612
9612
|
sourceLocation?: {
|
|
@@ -9632,8 +9632,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9632
9632
|
relevance: number;
|
|
9633
9633
|
chunkId?: string | undefined;
|
|
9634
9634
|
sourceSpanId?: string | undefined;
|
|
9635
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9636
9635
|
field?: string | undefined;
|
|
9636
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9637
9637
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9638
9638
|
sourceNodeId?: string | undefined;
|
|
9639
9639
|
sourceLocation?: {
|
|
@@ -9659,8 +9659,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9659
9659
|
relevance: number;
|
|
9660
9660
|
chunkId?: string | undefined;
|
|
9661
9661
|
sourceSpanId?: string | undefined;
|
|
9662
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9663
9662
|
field?: string | undefined;
|
|
9663
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9664
9664
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9665
9665
|
sourceNodeId?: string | undefined;
|
|
9666
9666
|
sourceLocation?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LogFn, M as ModelTaskKind, a as ModelBudgetResolution, b as ModelCallTrace, G as GenerateObject, T as TokenUsage, O as OperationalCoverageLine, S as SourceSpanLocation, c as SourceSpan, D as DocumentSourceNode, d as SourceKind, e as SourceSpanUnit, f as SourceSpanTableLocation, g as SourceChunk, h as SourceSpanBBox, U as UnifiedQualityReport, B as BaseQualityIssue, Q as QualityGateStatus, P as PdfInput, I as InsuranceDocument, i as DocumentChunk, j as PolicyOperationalProfile, k as PerformanceReport, l as QualityGateMode, m as ModelCapabilities, n as ModelBudgetConstraint, A as AgentContext, o as GenerateText, p as DocumentStore, q as MemoryStore, r as Platform } from './index-
|
|
2
|
-
export { s as AcroFormMapping, t as AcroFormMappingSchema, u as AnswerParsingResult, v as AnswerParsingResultSchema, w as ApplicationClassifyResult, x as ApplicationClassifyResultSchema, y as ApplicationContextProposal, z as ApplicationContextProposalSchema, C as ApplicationEmailReviewSchema, E as ApplicationField, F as ApplicationFieldSchema, H as ApplicationListFilters, J as ApplicationNextQuestions, K as ApplicationPacket, N as ApplicationPacketAnswer, R as ApplicationPacketAnswerSchema, V as ApplicationPacketSchema, W as ApplicationPipelineConfig, X as ApplicationQualityArtifactSchema, Y as ApplicationQualityIssueSchema, Z as ApplicationQualityReportSchema, _ as ApplicationQualityRoundSchema, $ as ApplicationQuestionCondition, a0 as ApplicationQuestionConditionSchema, a1 as ApplicationQuestionGraph, a2 as ApplicationQuestionGraphSchema, a3 as ApplicationQuestionNode, a4 as ApplicationQuestionNodeSchema, a5 as ApplicationRepeat, a6 as ApplicationRepeatSchema, a7 as ApplicationState, a8 as ApplicationStateSchema, a9 as ApplicationStore, aa as ApplicationTemplate, ab as ApplicationTemplateListFilters, ac as ApplicationTemplateSchema, ad as ApplicationTemplateStore, ae as AutoFillMatch, af as AutoFillMatchSchema, ag as AutoFillResult, ah as AutoFillResultSchema, ai as AuxiliaryFact, aj as AuxiliaryFactSchema, ak as BackfillProvider, al as BuildApplicationPacketInput, am as BuildApplicationPacketResult, an as ChunkFilter, ao as CommunicationIntent, ap as CommunicationIntentSchema, aq as ContextProposalResult, ar as ConversationTurn, as as ConvertPdfToImagesFn, at as CoveredReason, au as CoveredReasonSchema, av as CreateApplicationRunInput, aw as Definition, ax as DefinitionSchema, ay as DocumentAgentGuidance, az as DocumentAgentGuidanceSchema, aA as DocumentFilters, aB as DocumentMetadata, aC as DocumentMetadataSchema, aD as DocumentNode, aE as DocumentNodeSchema, aF as DocumentPageMapEntry, aG as DocumentPageMapEntrySchema, aH as DocumentSourceNodeKind, aI as DocumentSourceNodeKindSchema, aJ as DocumentSourceNodeSchema, aK as DocumentTableOfContentsEntry, aL as DocumentTableOfContentsEntrySchema, aM as EmbedText, aN as FieldExtractionResult, aO as FieldExtractionResultSchema, aP as FieldType, aQ as FieldTypeSchema, aR as FlatPdfPlacement, aS as FlatPdfPlacementSchema, aT as InsuranceDocumentSchema, aU as LookupFill, aV as LookupFillResult, aW as LookupFillResultSchema, aX as LookupFillSchema, aY as LookupRequest, aZ as LookupRequestSchema, a_ as ModelCallReport, a$ as
|
|
1
|
+
import { L as LogFn, M as ModelTaskKind, a as ModelBudgetResolution, b as ModelCallTrace, G as GenerateObject, T as TokenUsage, O as OperationalCoverageLine, S as SourceSpanLocation, c as SourceSpan, D as DocumentSourceNode, d as SourceKind, e as SourceSpanUnit, f as SourceSpanTableLocation, g as SourceChunk, h as SourceSpanBBox, U as UnifiedQualityReport, B as BaseQualityIssue, Q as QualityGateStatus, P as PdfInput, I as InsuranceDocument, i as DocumentChunk, j as PolicyOperationalProfile, k as PerformanceReport, l as QualityGateMode, m as ModelCapabilities, n as ModelBudgetConstraint, A as AgentContext, o as GenerateText, p as DocumentStore, q as MemoryStore, r as Platform } from './index-BzrY6OMD.js';
|
|
2
|
+
export { s as AcroFormMapping, t as AcroFormMappingSchema, u as AnswerParsingResult, v as AnswerParsingResultSchema, w as ApplicationClassifyResult, x as ApplicationClassifyResultSchema, y as ApplicationContextProposal, z as ApplicationContextProposalSchema, C as ApplicationEmailReviewSchema, E as ApplicationField, F as ApplicationFieldSchema, H as ApplicationListFilters, J as ApplicationNextQuestions, K as ApplicationPacket, N as ApplicationPacketAnswer, R as ApplicationPacketAnswerSchema, V as ApplicationPacketSchema, W as ApplicationPipelineConfig, X as ApplicationQualityArtifactSchema, Y as ApplicationQualityIssueSchema, Z as ApplicationQualityReportSchema, _ as ApplicationQualityRoundSchema, $ as ApplicationQuestionCondition, a0 as ApplicationQuestionConditionSchema, a1 as ApplicationQuestionGraph, a2 as ApplicationQuestionGraphSchema, a3 as ApplicationQuestionNode, a4 as ApplicationQuestionNodeSchema, a5 as ApplicationRepeat, a6 as ApplicationRepeatSchema, a7 as ApplicationState, a8 as ApplicationStateSchema, a9 as ApplicationStore, aa as ApplicationTemplate, ab as ApplicationTemplateListFilters, ac as ApplicationTemplateSchema, ad as ApplicationTemplateStore, ae as AutoFillMatch, af as AutoFillMatchSchema, ag as AutoFillResult, ah as AutoFillResultSchema, ai as AuxiliaryFact, aj as AuxiliaryFactSchema, ak as BackfillProvider, al as BuildApplicationPacketInput, am as BuildApplicationPacketResult, an as ChunkFilter, ao as CommunicationIntent, ap as CommunicationIntentSchema, aq as ContextProposalResult, ar as ConversationTurn, as as ConvertPdfToImagesFn, at as CoveredReason, au as CoveredReasonSchema, av as CreateApplicationRunInput, aw as Definition, ax as DefinitionSchema, ay as DocumentAgentGuidance, az as DocumentAgentGuidanceSchema, aA as DocumentFilters, aB as DocumentMetadata, aC as DocumentMetadataSchema, aD as DocumentNode, aE as DocumentNodeSchema, aF as DocumentPageMapEntry, aG as DocumentPageMapEntrySchema, aH as DocumentSourceNodeKind, aI as DocumentSourceNodeKindSchema, aJ as DocumentSourceNodeSchema, aK as DocumentTableOfContentsEntry, aL as DocumentTableOfContentsEntrySchema, aM as EmbedText, aN as FieldExtractionResult, aO as FieldExtractionResultSchema, aP as FieldType, aQ as FieldTypeSchema, aR as FlatPdfPlacement, aS as FlatPdfPlacementSchema, aT as InsuranceDocumentSchema, aU as LookupFill, aV as LookupFillResult, aW as LookupFillResultSchema, aX as LookupFillSchema, aY as LookupRequest, aZ as LookupRequestSchema, a_ as ModelCallReport, a$ as OperationalAddress, b0 as OperationalAddressSchema, b1 as OperationalCoverageLineSchema, b2 as OperationalCoverageTerm, b3 as OperationalCoverageTermSchema, b4 as OperationalDeclarationFact, b5 as OperationalDeclarationFactSchema, b6 as OperationalEndorsementSupport, b7 as OperationalEndorsementSupportSchema, b8 as OperationalParty, b9 as OperationalPartySchema, ba as PLATFORM_CONFIGS, bb as ParsedAnswer, bc as ParsedAnswerSchema, bd as PlatformConfig, be as PlatformSchema, bf as PolicyDocument, bg as PolicyDocumentSchema, bh as PolicyOperationalProfileSchema, bi as PremiumLine, bj as PremiumLineSchema, bk as PriorAnswer, bl as ProcessApplicationInput, bm as ProcessApplicationResult, bn as ProcessReplyInput, bo as ProcessReplyResult, bp as QuestionBatchResult, bq as QuestionBatchResultSchema, br as QuoteDocument, bs as QuoteDocumentSchema, bt as ReplyIntent, bu as ReplyIntentSchema, bv as ResolveModelBudgetParams, bw as Section, bx as SectionSchema, by as SourceBackedValue, bz as SourceBackedValueSchema, bA as SourceChunkSchema, bB as SourceKindSchema, bC as SourceSpanBBoxSchema, bD as SourceSpanKind, bE as SourceSpanKindSchema, bF as SourceSpanLocationSchema, bG as SourceSpanRef, bH as SourceSpanRefSchema, bI as SourceSpanSchema, bJ as SourceSpanTableLocationSchema, bK as SourceSpanUnitSchema, bL as Subjectivity, bM as SubjectivitySchema, bN as Subsection, bO as SubsectionSchema, bP as UnderwritingCondition, bQ as UnderwritingConditionSchema, bR as applyApplicationAnswers, bS as buildApplicationPacket, bT as buildQuestionGraphFromFields, bU as createApplicationPipeline, bV as createApplicationRun, bW as extractQuestionGraphFromFields, bX as flattenQuestionGraph, bY as getActiveApplicationFields, bZ as getNextApplicationQuestions, b_ as normalizeApplicationQuestionGraph, b$ as planNextApplicationQuestions, c0 as proposeContextWrites, c1 as resolveModelBudget, c2 as validateApplicationPacket } from './index-BzrY6OMD.js';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import { ZodTypeAny, z, ZodSchema } from 'zod';
|
|
5
5
|
import { PDFDocument } from 'pdf-lib';
|
|
@@ -9342,8 +9342,8 @@ declare const CitationSchema: z.ZodObject<{
|
|
|
9342
9342
|
relevance: number;
|
|
9343
9343
|
chunkId?: string | undefined;
|
|
9344
9344
|
sourceSpanId?: string | undefined;
|
|
9345
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9346
9345
|
field?: string | undefined;
|
|
9346
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9347
9347
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9348
9348
|
sourceNodeId?: string | undefined;
|
|
9349
9349
|
sourceLocation?: {
|
|
@@ -9363,8 +9363,8 @@ declare const CitationSchema: z.ZodObject<{
|
|
|
9363
9363
|
relevance: number;
|
|
9364
9364
|
chunkId?: string | undefined;
|
|
9365
9365
|
sourceSpanId?: string | undefined;
|
|
9366
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9367
9366
|
field?: string | undefined;
|
|
9367
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9368
9368
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9369
9369
|
sourceNodeId?: string | undefined;
|
|
9370
9370
|
sourceLocation?: {
|
|
@@ -9428,8 +9428,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9428
9428
|
relevance: number;
|
|
9429
9429
|
chunkId?: string | undefined;
|
|
9430
9430
|
sourceSpanId?: string | undefined;
|
|
9431
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9432
9431
|
field?: string | undefined;
|
|
9432
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9433
9433
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9434
9434
|
sourceNodeId?: string | undefined;
|
|
9435
9435
|
sourceLocation?: {
|
|
@@ -9449,8 +9449,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9449
9449
|
relevance: number;
|
|
9450
9450
|
chunkId?: string | undefined;
|
|
9451
9451
|
sourceSpanId?: string | undefined;
|
|
9452
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9453
9452
|
field?: string | undefined;
|
|
9453
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9454
9454
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9455
9455
|
sourceNodeId?: string | undefined;
|
|
9456
9456
|
sourceLocation?: {
|
|
@@ -9475,8 +9475,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9475
9475
|
relevance: number;
|
|
9476
9476
|
chunkId?: string | undefined;
|
|
9477
9477
|
sourceSpanId?: string | undefined;
|
|
9478
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9479
9478
|
field?: string | undefined;
|
|
9479
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9480
9480
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9481
9481
|
sourceNodeId?: string | undefined;
|
|
9482
9482
|
sourceLocation?: {
|
|
@@ -9502,8 +9502,8 @@ declare const SubAnswerSchema: z.ZodObject<{
|
|
|
9502
9502
|
relevance: number;
|
|
9503
9503
|
chunkId?: string | undefined;
|
|
9504
9504
|
sourceSpanId?: string | undefined;
|
|
9505
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9506
9505
|
field?: string | undefined;
|
|
9506
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9507
9507
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9508
9508
|
sourceNodeId?: string | undefined;
|
|
9509
9509
|
sourceLocation?: {
|
|
@@ -9584,8 +9584,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9584
9584
|
relevance: number;
|
|
9585
9585
|
chunkId?: string | undefined;
|
|
9586
9586
|
sourceSpanId?: string | undefined;
|
|
9587
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9588
9587
|
field?: string | undefined;
|
|
9588
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9589
9589
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9590
9590
|
sourceNodeId?: string | undefined;
|
|
9591
9591
|
sourceLocation?: {
|
|
@@ -9605,8 +9605,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9605
9605
|
relevance: number;
|
|
9606
9606
|
chunkId?: string | undefined;
|
|
9607
9607
|
sourceSpanId?: string | undefined;
|
|
9608
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9609
9608
|
field?: string | undefined;
|
|
9609
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9610
9610
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9611
9611
|
sourceNodeId?: string | undefined;
|
|
9612
9612
|
sourceLocation?: {
|
|
@@ -9632,8 +9632,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9632
9632
|
relevance: number;
|
|
9633
9633
|
chunkId?: string | undefined;
|
|
9634
9634
|
sourceSpanId?: string | undefined;
|
|
9635
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9636
9635
|
field?: string | undefined;
|
|
9636
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9637
9637
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9638
9638
|
sourceNodeId?: string | undefined;
|
|
9639
9639
|
sourceLocation?: {
|
|
@@ -9659,8 +9659,8 @@ declare const QueryResultSchema: z.ZodObject<{
|
|
|
9659
9659
|
relevance: number;
|
|
9660
9660
|
chunkId?: string | undefined;
|
|
9661
9661
|
sourceSpanId?: string | undefined;
|
|
9662
|
-
documentType?: "policy" | "quote" | undefined;
|
|
9663
9662
|
field?: string | undefined;
|
|
9663
|
+
documentType?: "policy" | "quote" | undefined;
|
|
9664
9664
|
retrievalMode?: "hybrid" | "graph_only" | "source_rag" | "long_context" | undefined;
|
|
9665
9665
|
sourceNodeId?: string | undefined;
|
|
9666
9666
|
sourceLocation?: {
|
package/dist/index.js
CHANGED
|
@@ -177,8 +177,10 @@ __export(src_exports, {
|
|
|
177
177
|
MemorySourceStore: () => MemorySourceStore,
|
|
178
178
|
MissingInfoQuestionSchema: () => MissingInfoQuestionSchema,
|
|
179
179
|
NamedInsuredSchema: () => NamedInsuredSchema,
|
|
180
|
+
OperationalAddressSchema: () => OperationalAddressSchema,
|
|
180
181
|
OperationalCoverageLineSchema: () => OperationalCoverageLineSchema,
|
|
181
182
|
OperationalCoverageTermSchema: () => OperationalCoverageTermSchema,
|
|
183
|
+
OperationalDeclarationFactSchema: () => OperationalDeclarationFactSchema,
|
|
182
184
|
OperationalEndorsementSupportSchema: () => OperationalEndorsementSupportSchema,
|
|
183
185
|
OperationalPartySchema: () => OperationalPartySchema,
|
|
184
186
|
PERSONAL_AUTO_USAGES: () => PERSONAL_AUTO_USAGES,
|
|
@@ -2747,6 +2749,40 @@ var SourceBackedValueSchema = import_zod21.z.object({
|
|
|
2747
2749
|
sourceNodeIds: import_zod21.z.array(import_zod21.z.string().min(1)).default([]),
|
|
2748
2750
|
sourceSpanIds: import_zod21.z.array(import_zod21.z.string().min(1)).default([])
|
|
2749
2751
|
});
|
|
2752
|
+
var OperationalAddressSchema = import_zod21.z.object({
|
|
2753
|
+
street1: import_zod21.z.string().optional(),
|
|
2754
|
+
street2: import_zod21.z.string().optional(),
|
|
2755
|
+
city: import_zod21.z.string().optional(),
|
|
2756
|
+
state: import_zod21.z.string().optional(),
|
|
2757
|
+
zip: import_zod21.z.string().optional(),
|
|
2758
|
+
country: import_zod21.z.string().optional(),
|
|
2759
|
+
formatted: import_zod21.z.string().optional()
|
|
2760
|
+
});
|
|
2761
|
+
var OperationalDeclarationFactSchema = import_zod21.z.object({
|
|
2762
|
+
field: import_zod21.z.enum([
|
|
2763
|
+
"namedInsured",
|
|
2764
|
+
"mailingAddress",
|
|
2765
|
+
"dba",
|
|
2766
|
+
"entityType",
|
|
2767
|
+
"taxId",
|
|
2768
|
+
"additionalNamedInsured",
|
|
2769
|
+
"policyNumber",
|
|
2770
|
+
"insurer",
|
|
2771
|
+
"broker",
|
|
2772
|
+
"effectiveDate",
|
|
2773
|
+
"expirationDate",
|
|
2774
|
+
"premium",
|
|
2775
|
+
"other"
|
|
2776
|
+
]),
|
|
2777
|
+
label: import_zod21.z.string().optional(),
|
|
2778
|
+
value: import_zod21.z.string(),
|
|
2779
|
+
normalizedValue: import_zod21.z.string().optional(),
|
|
2780
|
+
valueKind: import_zod21.z.enum(["string", "number", "date", "money", "address", "list", "unknown"]).default("string"),
|
|
2781
|
+
address: OperationalAddressSchema.optional(),
|
|
2782
|
+
confidence: import_zod21.z.enum(["low", "medium", "high"]).default("medium"),
|
|
2783
|
+
sourceNodeIds: import_zod21.z.array(import_zod21.z.string().min(1)).default([]),
|
|
2784
|
+
sourceSpanIds: import_zod21.z.array(import_zod21.z.string().min(1)).default([])
|
|
2785
|
+
});
|
|
2750
2786
|
var OperationalCoverageTermSchema = import_zod21.z.object({
|
|
2751
2787
|
kind: import_zod21.z.enum([
|
|
2752
2788
|
"each_claim_limit",
|
|
@@ -2821,6 +2857,7 @@ var PolicyOperationalProfileSchema = import_zod21.z.preprocess(
|
|
|
2821
2857
|
expirationDate: SourceBackedValueSchema.optional(),
|
|
2822
2858
|
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
2823
2859
|
premium: SourceBackedValueSchema.optional(),
|
|
2860
|
+
declarationFacts: import_zod21.z.array(OperationalDeclarationFactSchema).default([]),
|
|
2824
2861
|
coverages: import_zod21.z.array(OperationalCoverageLineSchema).default([]),
|
|
2825
2862
|
parties: import_zod21.z.array(OperationalPartySchema).default([]),
|
|
2826
2863
|
endorsementSupport: import_zod21.z.array(OperationalEndorsementSupportSchema).default([]),
|
|
@@ -4154,6 +4191,9 @@ function cleanValue(value) {
|
|
|
4154
4191
|
if (!value) return void 0;
|
|
4155
4192
|
return normalizeWhitespace4(value.replace(/^[\s:;#-]+|[\s;,.]+$/g, ""));
|
|
4156
4193
|
}
|
|
4194
|
+
function normalizedFactValue(value) {
|
|
4195
|
+
return value.toLowerCase().replace(/&/g, " and ").replace(/[.,#]/g, " ").replace(/\s+/g, " ").trim();
|
|
4196
|
+
}
|
|
4157
4197
|
var OPERATIONAL_COVERAGE_TERM_KINDS = /* @__PURE__ */ new Set([
|
|
4158
4198
|
"each_claim_limit",
|
|
4159
4199
|
"each_occurrence_limit",
|
|
@@ -4187,6 +4227,63 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
4187
4227
|
sourceSpanIds: sourceSpanIds2
|
|
4188
4228
|
};
|
|
4189
4229
|
};
|
|
4230
|
+
const mergeDeclarationFact = (fact) => {
|
|
4231
|
+
if (!fact || typeof fact !== "object" || Array.isArray(fact)) return void 0;
|
|
4232
|
+
const record = fact;
|
|
4233
|
+
const field = typeof record.field === "string" ? cleanValue(record.field) : void 0;
|
|
4234
|
+
const value = typeof record.value === "string" ? cleanValue(record.value) : void 0;
|
|
4235
|
+
const sourceNodeIds2 = keepIds(record.sourceNodeIds, validNodeIds);
|
|
4236
|
+
const sourceSpanIds2 = keepIds(record.sourceSpanIds, validSpanIds);
|
|
4237
|
+
if (!field || !value || sourceNodeIds2.length === 0 && sourceSpanIds2.length === 0) return void 0;
|
|
4238
|
+
const address = record.address && typeof record.address === "object" && !Array.isArray(record.address) ? Object.fromEntries(
|
|
4239
|
+
Object.entries(record.address).flatMap(([key, item]) => {
|
|
4240
|
+
const text = typeof item === "string" ? cleanValue(item) : void 0;
|
|
4241
|
+
return text ? [[key, text]] : [];
|
|
4242
|
+
})
|
|
4243
|
+
) : void 0;
|
|
4244
|
+
return {
|
|
4245
|
+
field: [
|
|
4246
|
+
"namedInsured",
|
|
4247
|
+
"mailingAddress",
|
|
4248
|
+
"dba",
|
|
4249
|
+
"entityType",
|
|
4250
|
+
"taxId",
|
|
4251
|
+
"additionalNamedInsured",
|
|
4252
|
+
"policyNumber",
|
|
4253
|
+
"insurer",
|
|
4254
|
+
"broker",
|
|
4255
|
+
"effectiveDate",
|
|
4256
|
+
"expirationDate",
|
|
4257
|
+
"premium",
|
|
4258
|
+
"other"
|
|
4259
|
+
].includes(field) ? field : "other",
|
|
4260
|
+
label: typeof record.label === "string" ? cleanValue(record.label) : void 0,
|
|
4261
|
+
value,
|
|
4262
|
+
normalizedValue: typeof record.normalizedValue === "string" ? cleanValue(record.normalizedValue) : normalizedFactValue(value),
|
|
4263
|
+
valueKind: [
|
|
4264
|
+
"string",
|
|
4265
|
+
"number",
|
|
4266
|
+
"date",
|
|
4267
|
+
"money",
|
|
4268
|
+
"address",
|
|
4269
|
+
"list",
|
|
4270
|
+
"unknown"
|
|
4271
|
+
].includes(String(record.valueKind)) ? record.valueKind : "string",
|
|
4272
|
+
address,
|
|
4273
|
+
confidence: record.confidence === "high" || record.confidence === "low" || record.confidence === "medium" ? record.confidence : "medium",
|
|
4274
|
+
sourceNodeIds: sourceNodeIds2,
|
|
4275
|
+
sourceSpanIds: sourceSpanIds2
|
|
4276
|
+
};
|
|
4277
|
+
};
|
|
4278
|
+
const sourceBackedDeclarationFact = (field, value, valueKind = "string") => value ? {
|
|
4279
|
+
field,
|
|
4280
|
+
value: value.value,
|
|
4281
|
+
normalizedValue: value.normalizedValue ?? normalizedFactValue(value.value),
|
|
4282
|
+
valueKind,
|
|
4283
|
+
confidence: value.confidence,
|
|
4284
|
+
sourceNodeIds: value.sourceNodeIds,
|
|
4285
|
+
sourceSpanIds: value.sourceSpanIds
|
|
4286
|
+
} : void 0;
|
|
4190
4287
|
const policyNumber = mergeValue(base.policyNumber, candidate.policyNumber);
|
|
4191
4288
|
const namedInsured = mergeValue(base.namedInsured, candidate.namedInsured);
|
|
4192
4289
|
const insurer = mergeValue(base.insurer, candidate.insurer);
|
|
@@ -4195,6 +4292,22 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
4195
4292
|
const expirationDate = mergeValue(base.expirationDate, candidate.expirationDate);
|
|
4196
4293
|
const retroactiveDate = mergeValue(base.retroactiveDate, candidate.retroactiveDate);
|
|
4197
4294
|
const premium = mergeValue(base.premium, candidate.premium);
|
|
4295
|
+
const candidateDeclarationFacts = Array.isArray(candidate.declarationFacts) ? candidate.declarationFacts.map(mergeDeclarationFact).filter((fact) => Boolean(fact)) : [];
|
|
4296
|
+
const declarationFacts = [
|
|
4297
|
+
...base.declarationFacts,
|
|
4298
|
+
sourceBackedDeclarationFact("policyNumber", policyNumber),
|
|
4299
|
+
sourceBackedDeclarationFact("namedInsured", namedInsured),
|
|
4300
|
+
sourceBackedDeclarationFact("insurer", insurer),
|
|
4301
|
+
sourceBackedDeclarationFact("broker", broker),
|
|
4302
|
+
sourceBackedDeclarationFact("effectiveDate", effectiveDate, "date"),
|
|
4303
|
+
sourceBackedDeclarationFact("expirationDate", expirationDate, "date"),
|
|
4304
|
+
sourceBackedDeclarationFact("premium", premium, "money"),
|
|
4305
|
+
...candidateDeclarationFacts
|
|
4306
|
+
].filter((fact) => Boolean(fact)).filter(
|
|
4307
|
+
(fact, index, rows) => rows.findIndex(
|
|
4308
|
+
(other) => other.field === fact.field && other.normalizedValue === fact.normalizedValue && other.sourceNodeIds.join(",") === fact.sourceNodeIds.join(",") && other.sourceSpanIds.join(",") === fact.sourceSpanIds.join(",")
|
|
4309
|
+
) === index
|
|
4310
|
+
);
|
|
4198
4311
|
const sourceValues = [
|
|
4199
4312
|
policyNumber,
|
|
4200
4313
|
namedInsured,
|
|
@@ -4299,6 +4412,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
4299
4412
|
...base.sourceNodeIds,
|
|
4300
4413
|
...keepIds(candidate.sourceNodeIds, validNodeIds),
|
|
4301
4414
|
...sourceValues.flatMap((value) => value.sourceNodeIds),
|
|
4415
|
+
...declarationFacts.flatMap((fact) => fact.sourceNodeIds),
|
|
4302
4416
|
...coverages.flatMap((coverage) => coverage.sourceNodeIds),
|
|
4303
4417
|
...coverages.flatMap((coverage) => coverage.limits.flatMap((term) => term.sourceNodeIds)),
|
|
4304
4418
|
...parties.flatMap((party) => party.sourceNodeIds),
|
|
@@ -4308,6 +4422,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
4308
4422
|
...base.sourceSpanIds,
|
|
4309
4423
|
...keepIds(candidate.sourceSpanIds, validSpanIds),
|
|
4310
4424
|
...sourceValues.flatMap((value) => value.sourceSpanIds),
|
|
4425
|
+
...declarationFacts.flatMap((fact) => fact.sourceSpanIds),
|
|
4311
4426
|
...coverages.flatMap((coverage) => coverage.sourceSpanIds),
|
|
4312
4427
|
...coverages.flatMap((coverage) => coverage.limits.flatMap((term) => term.sourceSpanIds)),
|
|
4313
4428
|
...parties.flatMap((party) => party.sourceSpanIds),
|
|
@@ -4336,6 +4451,7 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
4336
4451
|
expirationDate,
|
|
4337
4452
|
retroactiveDate,
|
|
4338
4453
|
premium,
|
|
4454
|
+
declarationFacts,
|
|
4339
4455
|
coverages,
|
|
4340
4456
|
parties,
|
|
4341
4457
|
endorsementSupport,
|
|
@@ -4846,6 +4962,40 @@ var SourceBackedValueForPromptSchema = import_zod23.z.object({
|
|
|
4846
4962
|
sourceNodeIds: import_zod23.z.array(import_zod23.z.string()),
|
|
4847
4963
|
sourceSpanIds: import_zod23.z.array(import_zod23.z.string())
|
|
4848
4964
|
});
|
|
4965
|
+
var OperationalAddressForPromptSchema = import_zod23.z.object({
|
|
4966
|
+
street1: import_zod23.z.string().optional(),
|
|
4967
|
+
street2: import_zod23.z.string().optional(),
|
|
4968
|
+
city: import_zod23.z.string().optional(),
|
|
4969
|
+
state: import_zod23.z.string().optional(),
|
|
4970
|
+
zip: import_zod23.z.string().optional(),
|
|
4971
|
+
country: import_zod23.z.string().optional(),
|
|
4972
|
+
formatted: import_zod23.z.string().optional()
|
|
4973
|
+
});
|
|
4974
|
+
var OperationalDeclarationFactForPromptSchema = import_zod23.z.object({
|
|
4975
|
+
field: import_zod23.z.enum([
|
|
4976
|
+
"namedInsured",
|
|
4977
|
+
"mailingAddress",
|
|
4978
|
+
"dba",
|
|
4979
|
+
"entityType",
|
|
4980
|
+
"taxId",
|
|
4981
|
+
"additionalNamedInsured",
|
|
4982
|
+
"policyNumber",
|
|
4983
|
+
"insurer",
|
|
4984
|
+
"broker",
|
|
4985
|
+
"effectiveDate",
|
|
4986
|
+
"expirationDate",
|
|
4987
|
+
"premium",
|
|
4988
|
+
"other"
|
|
4989
|
+
]),
|
|
4990
|
+
label: import_zod23.z.string().optional(),
|
|
4991
|
+
value: import_zod23.z.string(),
|
|
4992
|
+
normalizedValue: import_zod23.z.string().optional(),
|
|
4993
|
+
valueKind: import_zod23.z.enum(["string", "number", "date", "money", "address", "list", "unknown"]).optional(),
|
|
4994
|
+
address: OperationalAddressForPromptSchema.optional(),
|
|
4995
|
+
confidence: import_zod23.z.enum(["low", "medium", "high"]).optional(),
|
|
4996
|
+
sourceNodeIds: import_zod23.z.array(import_zod23.z.string()),
|
|
4997
|
+
sourceSpanIds: import_zod23.z.array(import_zod23.z.string())
|
|
4998
|
+
});
|
|
4849
4999
|
var OperationalProfilePromptSchema = import_zod23.z.object({
|
|
4850
5000
|
documentType: import_zod23.z.enum(["policy", "quote"]).optional(),
|
|
4851
5001
|
linesOfBusiness: import_zod23.z.array(import_zod23.z.string()).optional(),
|
|
@@ -4857,6 +5007,7 @@ var OperationalProfilePromptSchema = import_zod23.z.object({
|
|
|
4857
5007
|
expirationDate: SourceBackedValueForPromptSchema.optional(),
|
|
4858
5008
|
retroactiveDate: SourceBackedValueForPromptSchema.optional(),
|
|
4859
5009
|
premium: SourceBackedValueForPromptSchema.optional(),
|
|
5010
|
+
declarationFacts: import_zod23.z.array(OperationalDeclarationFactForPromptSchema).optional(),
|
|
4860
5011
|
coverages: import_zod23.z.array(import_zod23.z.object({
|
|
4861
5012
|
name: import_zod23.z.string(),
|
|
4862
5013
|
coverageCode: import_zod23.z.string().optional(),
|
|
@@ -5888,6 +6039,7 @@ function emptyOperationalProfile() {
|
|
|
5888
6039
|
return {
|
|
5889
6040
|
documentType: "policy",
|
|
5890
6041
|
linesOfBusiness: ["UN"],
|
|
6042
|
+
declarationFacts: [],
|
|
5891
6043
|
coverages: [],
|
|
5892
6044
|
parties: [],
|
|
5893
6045
|
endorsementSupport: [],
|
|
@@ -5905,6 +6057,7 @@ function buildOperationalProfilePrompt(sourceTree, sourceSpans) {
|
|
|
5905
6057
|
|
|
5906
6058
|
Return only high-value operational facts needed for policy lists, Q&A, compliance, and certificate generation:
|
|
5907
6059
|
- policy number, named insured, insurer/carrier/security, broker/producer, policy period, retroactive date, premium
|
|
6060
|
+
- source-backed declarationFacts for named-insured identity details: named insured, mailing address, DBA, entity type, tax ID/FEIN, additional named insureds, and other durable declaration-page identity facts
|
|
5908
6061
|
- coverage units with their own nested limit terms, deductibles/retentions, retroactive dates, premiums, and form references
|
|
5909
6062
|
- coverage type labels
|
|
5910
6063
|
|
|
@@ -5913,6 +6066,8 @@ Rules:
|
|
|
5913
6066
|
- When citing an evidence entry, copy its sourceSpanId into the returned sourceSpanIds array.
|
|
5914
6067
|
- If a value is not directly supported, omit it.
|
|
5915
6068
|
- Prefer declarations, schedules, premium tables, and endorsement schedules over generic policy wording.
|
|
6069
|
+
- Put named-insured mailing address in declarationFacts[] with field "mailingAddress", valueKind "address", a user-facing value string, and structured address fields when present. Do not put producer, broker, insurer, mortgagee, loss-payee, or certificate-holder addresses in mailingAddress.
|
|
6070
|
+
- Put DBA or trade name in declarationFacts[] with field "dba"; entity/legal form in field "entityType"; FEIN/tax ID in field "taxId"; each additional named insured in field "additionalNamedInsured".
|
|
5916
6071
|
- For effective, expiration, retroactive, and other date fields, return a normalized YYYY-MM-DD value when the source date is unambiguous, including month-name dates such as "20 Feb 2026". Do not emit fragmented date text such as "20 2 2026".
|
|
5917
6072
|
- For broker/producer, extract the agency or company legal name, not the license role, credential, or type. In a block like "Bayshore Insurance Brokers, LLC" followed by "Surplus Lines Broker - CA License No. ...", broker.value must be "Bayshore Insurance Brokers, LLC"; the surplus-lines role and license number are not the broker name.
|
|
5918
6073
|
- On declarations pages, treat "Item N" labels as section boundaries. Use Item 6 or equivalent coverage-schedule rows for coverage limits, deductibles, aggregate terms, and retroactive dates; do not merge Item 7 premium, Item 8 ERP, Item 9 producer, or Item 10 forms into Item 6 coverage facts.
|
|
@@ -5986,6 +6141,60 @@ function provenanceOf(value) {
|
|
|
5986
6141
|
...value.sourceNodeIds[0] ? { documentNodeId: value.sourceNodeIds[0] } : {}
|
|
5987
6142
|
};
|
|
5988
6143
|
}
|
|
6144
|
+
function provenanceFromIds(sourceSpanIds, sourceNodeIds) {
|
|
6145
|
+
if (sourceSpanIds.length === 0) return void 0;
|
|
6146
|
+
return {
|
|
6147
|
+
sourceSpanIds,
|
|
6148
|
+
...sourceNodeIds[0] ? { documentNodeId: sourceNodeIds[0] } : {}
|
|
6149
|
+
};
|
|
6150
|
+
}
|
|
6151
|
+
function declarationFactsByField(profile, field) {
|
|
6152
|
+
return profile.declarationFacts.filter((fact) => fact.field === field && fact.value.trim());
|
|
6153
|
+
}
|
|
6154
|
+
function firstDeclarationFact(profile, field) {
|
|
6155
|
+
return declarationFactsByField(profile, field)[0];
|
|
6156
|
+
}
|
|
6157
|
+
function sourceBackedAddressFromFact(fact) {
|
|
6158
|
+
if (!fact?.address || fact.sourceSpanIds.length === 0) return void 0;
|
|
6159
|
+
const address = fact.address;
|
|
6160
|
+
if (!address.street1 || !address.city || !address.state || !address.zip) return void 0;
|
|
6161
|
+
return {
|
|
6162
|
+
street1: address.street1,
|
|
6163
|
+
street2: address.street2,
|
|
6164
|
+
city: address.city,
|
|
6165
|
+
state: address.state,
|
|
6166
|
+
zip: address.zip,
|
|
6167
|
+
country: address.country,
|
|
6168
|
+
...provenanceFromIds(fact.sourceSpanIds, fact.sourceNodeIds)
|
|
6169
|
+
};
|
|
6170
|
+
}
|
|
6171
|
+
function normalizedEntityType(value) {
|
|
6172
|
+
const normalized = cleanText(value, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
6173
|
+
if (normalized === "inc" || normalized === "incorporated" || normalized === "c_corporation" || normalized === "s_corporation") {
|
|
6174
|
+
return "corporation";
|
|
6175
|
+
}
|
|
6176
|
+
if (normalized === "limited_liability_company") return "llc";
|
|
6177
|
+
if (normalized === "non_profit") return "nonprofit";
|
|
6178
|
+
return [
|
|
6179
|
+
"corporation",
|
|
6180
|
+
"llc",
|
|
6181
|
+
"partnership",
|
|
6182
|
+
"sole_proprietor",
|
|
6183
|
+
"joint_venture",
|
|
6184
|
+
"trust",
|
|
6185
|
+
"nonprofit",
|
|
6186
|
+
"municipality",
|
|
6187
|
+
"individual",
|
|
6188
|
+
"married_couple",
|
|
6189
|
+
"other"
|
|
6190
|
+
].includes(normalized) ? normalized : void 0;
|
|
6191
|
+
}
|
|
6192
|
+
function declarationFieldName(fact) {
|
|
6193
|
+
if (fact.field === "mailingAddress") return "mailingAddress";
|
|
6194
|
+
if (fact.field === "taxId") return "fein";
|
|
6195
|
+
if (fact.field === "additionalNamedInsured") return "additionalNamedInsured";
|
|
6196
|
+
return fact.field;
|
|
6197
|
+
}
|
|
5989
6198
|
function materializeDocument(params) {
|
|
5990
6199
|
const profile = params.operationalProfile;
|
|
5991
6200
|
const policyNumber = valueOf(profile, "policyNumber") ?? "Unknown";
|
|
@@ -5997,6 +6206,15 @@ function materializeDocument(params) {
|
|
|
5997
6206
|
const insurerProvenance = provenanceOf(profile.insurer);
|
|
5998
6207
|
const broker = valueOf(profile, "broker");
|
|
5999
6208
|
const brokerProvenance = provenanceOf(profile.broker);
|
|
6209
|
+
const mailingAddressFact = firstDeclarationFact(profile, "mailingAddress");
|
|
6210
|
+
const insuredAddress = sourceBackedAddressFromFact(mailingAddressFact);
|
|
6211
|
+
const insuredDba = firstDeclarationFact(profile, "dba")?.value;
|
|
6212
|
+
const insuredEntityType = normalizedEntityType(firstDeclarationFact(profile, "entityType")?.value);
|
|
6213
|
+
const insuredFein = firstDeclarationFact(profile, "taxId")?.value;
|
|
6214
|
+
const additionalNamedInsureds = declarationFactsByField(profile, "additionalNamedInsured").flatMap((fact) => {
|
|
6215
|
+
const provenance = provenanceFromIds(fact.sourceSpanIds, fact.sourceNodeIds);
|
|
6216
|
+
return provenance ? [{ name: fact.value, ...provenance }] : [];
|
|
6217
|
+
});
|
|
6000
6218
|
const coverages = profile.coverages.map((coverage) => ({
|
|
6001
6219
|
name: coverage.name,
|
|
6002
6220
|
coverageCode: coverage.coverageCode,
|
|
@@ -6047,6 +6265,11 @@ function materializeDocument(params) {
|
|
|
6047
6265
|
security: carrier,
|
|
6048
6266
|
insuredName,
|
|
6049
6267
|
premium,
|
|
6268
|
+
insuredDba,
|
|
6269
|
+
insuredAddress,
|
|
6270
|
+
insuredEntityType,
|
|
6271
|
+
insuredFein,
|
|
6272
|
+
...additionalNamedInsureds.length > 0 ? { additionalNamedInsureds } : {},
|
|
6050
6273
|
...insurerProvenance ? { insurer: { legalName: carrier, ...insurerProvenance } } : {},
|
|
6051
6274
|
...broker && brokerProvenance ? {
|
|
6052
6275
|
brokerAgency: broker,
|
|
@@ -6070,7 +6293,12 @@ function materializeDocument(params) {
|
|
|
6070
6293
|
profile.namedInsured ? { field: "namedInsured", value: profile.namedInsured.value, sourceSpanIds: profile.namedInsured.sourceSpanIds } : void 0,
|
|
6071
6294
|
profile.insurer ? { field: "insurer", value: profile.insurer.value, sourceSpanIds: profile.insurer.sourceSpanIds } : void 0,
|
|
6072
6295
|
profile.effectiveDate ? { field: "policyPeriodStart", value: profile.effectiveDate.value, sourceSpanIds: profile.effectiveDate.sourceSpanIds } : void 0,
|
|
6073
|
-
profile.expirationDate ? { field: "policyPeriodEnd", value: profile.expirationDate.value, sourceSpanIds: profile.expirationDate.sourceSpanIds } : void 0
|
|
6296
|
+
profile.expirationDate ? { field: "policyPeriodEnd", value: profile.expirationDate.value, sourceSpanIds: profile.expirationDate.sourceSpanIds } : void 0,
|
|
6297
|
+
...profile.declarationFacts.map((fact) => ({
|
|
6298
|
+
field: declarationFieldName(fact),
|
|
6299
|
+
value: fact.value,
|
|
6300
|
+
sourceSpanIds: fact.sourceSpanIds
|
|
6301
|
+
}))
|
|
6074
6302
|
].filter(Boolean)
|
|
6075
6303
|
},
|
|
6076
6304
|
supplementaryFacts: profile.endorsementSupport.map((item) => ({
|
|
@@ -13392,8 +13620,10 @@ function getTemplate(policyType) {
|
|
|
13392
13620
|
MemorySourceStore,
|
|
13393
13621
|
MissingInfoQuestionSchema,
|
|
13394
13622
|
NamedInsuredSchema,
|
|
13623
|
+
OperationalAddressSchema,
|
|
13395
13624
|
OperationalCoverageLineSchema,
|
|
13396
13625
|
OperationalCoverageTermSchema,
|
|
13626
|
+
OperationalDeclarationFactSchema,
|
|
13397
13627
|
OperationalEndorsementSupportSchema,
|
|
13398
13628
|
OperationalPartySchema,
|
|
13399
13629
|
PERSONAL_AUTO_USAGES,
|