@claritylabs/cl-sdk 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8909,20 +8909,20 @@ var SourceTreeOrganizationSchema = z41.object({
|
|
|
8909
8909
|
]).optional(),
|
|
8910
8910
|
title: z41.string().optional(),
|
|
8911
8911
|
description: z41.string().optional()
|
|
8912
|
-
}))
|
|
8912
|
+
})),
|
|
8913
8913
|
groups: z41.array(z41.object({
|
|
8914
8914
|
kind: z41.enum(ORGANIZABLE_KINDS),
|
|
8915
8915
|
title: z41.string(),
|
|
8916
8916
|
description: z41.string().optional(),
|
|
8917
8917
|
childNodeIds: z41.array(z41.string()).min(1)
|
|
8918
|
-
}))
|
|
8918
|
+
}))
|
|
8919
8919
|
});
|
|
8920
8920
|
var SourceBackedValueForPromptSchema = z41.object({
|
|
8921
8921
|
value: z41.string(),
|
|
8922
8922
|
normalizedValue: z41.string().optional(),
|
|
8923
8923
|
confidence: z41.enum(["low", "medium", "high"]).optional(),
|
|
8924
|
-
sourceNodeIds: z41.array(z41.string())
|
|
8925
|
-
sourceSpanIds: z41.array(z41.string())
|
|
8924
|
+
sourceNodeIds: z41.array(z41.string()),
|
|
8925
|
+
sourceSpanIds: z41.array(z41.string())
|
|
8926
8926
|
});
|
|
8927
8927
|
var OperationalProfilePromptSchema = z41.object({
|
|
8928
8928
|
documentType: z41.enum(["policy", "quote"]).optional(),
|
|
@@ -8944,8 +8944,8 @@ var OperationalProfilePromptSchema = z41.object({
|
|
|
8944
8944
|
premium: z41.string().optional(),
|
|
8945
8945
|
formNumber: z41.string().optional(),
|
|
8946
8946
|
sectionRef: z41.string().optional(),
|
|
8947
|
-
sourceNodeIds: z41.array(z41.string())
|
|
8948
|
-
sourceSpanIds: z41.array(z41.string())
|
|
8947
|
+
sourceNodeIds: z41.array(z41.string()),
|
|
8948
|
+
sourceSpanIds: z41.array(z41.string())
|
|
8949
8949
|
})).optional(),
|
|
8950
8950
|
sourceNodeIds: z41.array(z41.string()).optional(),
|
|
8951
8951
|
sourceSpanIds: z41.array(z41.string()).optional()
|
|
@@ -8967,13 +8967,14 @@ function compactNode(node) {
|
|
|
8967
8967
|
};
|
|
8968
8968
|
}
|
|
8969
8969
|
function buildOrganizationPrompt(sourceTree) {
|
|
8970
|
-
const nodes = sourceTree.filter((node) => node.kind !== "
|
|
8970
|
+
const nodes = sourceTree.filter((node) => node.kind !== "document").slice(0, 240).map(compactNode);
|
|
8971
8971
|
return `You organize an insurance document source tree.
|
|
8972
8972
|
|
|
8973
8973
|
Rules:
|
|
8974
8974
|
- Use only node IDs from the provided list.
|
|
8975
8975
|
- Do not invent text, page numbers, source spans, limits, or policy facts.
|
|
8976
8976
|
- You may relabel existing nodes and group adjacent top-level/page nodes when they are clearly one form, endorsement, declarations set, schedule, or clause family.
|
|
8977
|
+
- Add concise, human-readable titles to generic text, table, row, and cell nodes when the text makes their role clear.
|
|
8977
8978
|
- Groups must list existing childNodeIds only.
|
|
8978
8979
|
- Keep descriptions short and useful for search.
|
|
8979
8980
|
|
|
@@ -9083,6 +9084,7 @@ function sourceTreeToOutline(sourceTree) {
|
|
|
9083
9084
|
sourceSpanIds: node.sourceSpanIds,
|
|
9084
9085
|
sourceTextHash: node.sourceSpanIds.join(":") || void 0,
|
|
9085
9086
|
interpretationLabels: [node.kind],
|
|
9087
|
+
metadata: node.metadata,
|
|
9086
9088
|
children: (byParent.get(node.id) ?? []).map(visit)
|
|
9087
9089
|
});
|
|
9088
9090
|
return (byParent.get(root?.id) ?? []).map(visit);
|