@claritylabs/cl-sdk 3.1.24 → 3.1.26
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 +1 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10905,6 +10905,7 @@ Rules:
|
|
|
10905
10905
|
- Every returned value must include sourceNodeIds or sourceSpanIds from the provided nodes.
|
|
10906
10906
|
- If a value is not directly supported, omit it.
|
|
10907
10907
|
- Prefer declarations, schedules, premium tables, and endorsement schedules over generic policy wording.
|
|
10908
|
+
- 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.
|
|
10908
10909
|
- 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.
|
|
10909
10910
|
- A coverage schedule row's coverage name should come from the "Coverage Part" or equivalent row label. Limit, deductible, aggregate, sublimit, retention, and retroactive-date values belong as nested terms under that coverage, not in the coverage title.
|
|
10910
10911
|
- If a coverage schedule continues onto the next page before the next item marker, include the continuation rows in the same coverage or declaration item.
|
|
@@ -10924,63 +10925,6 @@ ${JSON.stringify(nodes, null, 2)}
|
|
|
10924
10925
|
|
|
10925
10926
|
Return JSON for the operational profile.`;
|
|
10926
10927
|
}
|
|
10927
|
-
function tableCellValueText(cell) {
|
|
10928
|
-
return cleanText(cell.textExcerpt ?? cell.description ?? "", "");
|
|
10929
|
-
}
|
|
10930
|
-
function tableRowTextFromCells(cells) {
|
|
10931
|
-
const text = cells.map((cell) => {
|
|
10932
|
-
const label = cleanText(cell.title, "");
|
|
10933
|
-
const value = tableCellValueText(cell);
|
|
10934
|
-
if (!value) return label;
|
|
10935
|
-
if (!label || value.toLowerCase() === label.toLowerCase()) return value;
|
|
10936
|
-
return `${label}: ${value}`;
|
|
10937
|
-
}).filter(Boolean).join(" | ");
|
|
10938
|
-
return text ? cleanText(text, text) : void 0;
|
|
10939
|
-
}
|
|
10940
|
-
function normalizeTableBoundaryDelimiters(value) {
|
|
10941
|
-
const text = cleanText(value, "");
|
|
10942
|
-
if (!text) return void 0;
|
|
10943
|
-
const normalized = text.replace(/\s+\|\s+\|/g, " | ").replace(/\s+\/\s+\|/g, " |").replace(/\s+[|/]\s*$/g, "").replace(/\s{2,}/g, " ").trim();
|
|
10944
|
-
return normalized || void 0;
|
|
10945
|
-
}
|
|
10946
|
-
function normalizeSourceTreeTableDisplayText(sourceTree) {
|
|
10947
|
-
const byParent = nodesByParent(sourceTree);
|
|
10948
|
-
const updates = /* @__PURE__ */ new Map();
|
|
10949
|
-
const currentNode = (node) => updates.get(node.id) ?? node;
|
|
10950
|
-
for (const node of sourceTree) {
|
|
10951
|
-
if (node.kind !== "table_cell") continue;
|
|
10952
|
-
const textExcerpt = normalizeTableBoundaryDelimiters(node.textExcerpt);
|
|
10953
|
-
const textChanged = textExcerpt !== void 0 && textExcerpt !== node.textExcerpt;
|
|
10954
|
-
const description = textChanged && textExcerpt ? normalizeTableBoundaryDelimiters([node.title, textExcerpt].filter(Boolean).join(" | ")) : normalizeTableBoundaryDelimiters(node.description);
|
|
10955
|
-
if (textExcerpt === node.textExcerpt && description === node.description) continue;
|
|
10956
|
-
updates.set(node.id, {
|
|
10957
|
-
...node,
|
|
10958
|
-
...textExcerpt !== void 0 ? { textExcerpt } : {},
|
|
10959
|
-
...description !== void 0 ? { description } : {}
|
|
10960
|
-
});
|
|
10961
|
-
}
|
|
10962
|
-
for (const node of sourceTree) {
|
|
10963
|
-
if (node.kind !== "table_row") continue;
|
|
10964
|
-
const cells = (byParent.get(node.id) ?? []).filter((child) => child.kind === "table_cell").map(currentNode).sort(
|
|
10965
|
-
(left, right) => tableCellColumnIndex(left, 0) - tableCellColumnIndex(right, 0) || left.order - right.order || left.id.localeCompare(right.id)
|
|
10966
|
-
);
|
|
10967
|
-
const textExcerpt = cells.length ? tableRowTextFromCells(cells) : normalizeTableBoundaryDelimiters(node.textExcerpt);
|
|
10968
|
-
const textChanged = textExcerpt !== void 0 && textExcerpt !== node.textExcerpt;
|
|
10969
|
-
const description = textChanged && textExcerpt ? normalizeTableBoundaryDelimiters([node.title, textExcerpt].filter(Boolean).join(" | ")) : normalizeTableBoundaryDelimiters(node.description);
|
|
10970
|
-
if (textExcerpt === node.textExcerpt && description === node.description) continue;
|
|
10971
|
-
updates.set(node.id, {
|
|
10972
|
-
...node,
|
|
10973
|
-
...textExcerpt !== void 0 ? { textExcerpt } : {},
|
|
10974
|
-
...description !== void 0 ? { description } : {}
|
|
10975
|
-
});
|
|
10976
|
-
}
|
|
10977
|
-
if (updates.size === 0) return sourceTree;
|
|
10978
|
-
return sourceTree.map((node) => updates.get(node.id) ?? node);
|
|
10979
|
-
}
|
|
10980
|
-
function tableCellColumnIndex(cell, fallbackIndex) {
|
|
10981
|
-
const metadataIndex = cell.metadata?.columnIndex;
|
|
10982
|
-
return typeof metadataIndex === "number" && Number.isInteger(metadataIndex) ? metadataIndex : fallbackIndex;
|
|
10983
|
-
}
|
|
10984
10928
|
function sourceTreeToOutline(sourceTree) {
|
|
10985
10929
|
const byParent = /* @__PURE__ */ new Map();
|
|
10986
10930
|
for (const node of sourceTree.filter((item) => item.kind !== "document")) {
|
|
@@ -11227,7 +11171,6 @@ async function runSourceTreeExtraction(params) {
|
|
|
11227
11171
|
}
|
|
11228
11172
|
params.trackUsage(usage, report);
|
|
11229
11173
|
};
|
|
11230
|
-
sourceTree = normalizeSourceTreeTableDisplayText(sourceTree);
|
|
11231
11174
|
const emptyProfile = emptyOperationalProfile();
|
|
11232
11175
|
let operationalProfile = emptyProfile;
|
|
11233
11176
|
try {
|