@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 CHANGED
@@ -9255,20 +9255,20 @@ var SourceTreeOrganizationSchema = import_zod41.z.object({
9255
9255
  ]).optional(),
9256
9256
  title: import_zod41.z.string().optional(),
9257
9257
  description: import_zod41.z.string().optional()
9258
- })).default([]),
9258
+ })),
9259
9259
  groups: import_zod41.z.array(import_zod41.z.object({
9260
9260
  kind: import_zod41.z.enum(ORGANIZABLE_KINDS),
9261
9261
  title: import_zod41.z.string(),
9262
9262
  description: import_zod41.z.string().optional(),
9263
9263
  childNodeIds: import_zod41.z.array(import_zod41.z.string()).min(1)
9264
- })).default([])
9264
+ }))
9265
9265
  });
9266
9266
  var SourceBackedValueForPromptSchema = import_zod41.z.object({
9267
9267
  value: import_zod41.z.string(),
9268
9268
  normalizedValue: import_zod41.z.string().optional(),
9269
9269
  confidence: import_zod41.z.enum(["low", "medium", "high"]).optional(),
9270
- sourceNodeIds: import_zod41.z.array(import_zod41.z.string()).default([]),
9271
- sourceSpanIds: import_zod41.z.array(import_zod41.z.string()).default([])
9270
+ sourceNodeIds: import_zod41.z.array(import_zod41.z.string()),
9271
+ sourceSpanIds: import_zod41.z.array(import_zod41.z.string())
9272
9272
  });
9273
9273
  var OperationalProfilePromptSchema = import_zod41.z.object({
9274
9274
  documentType: import_zod41.z.enum(["policy", "quote"]).optional(),
@@ -9290,8 +9290,8 @@ var OperationalProfilePromptSchema = import_zod41.z.object({
9290
9290
  premium: import_zod41.z.string().optional(),
9291
9291
  formNumber: import_zod41.z.string().optional(),
9292
9292
  sectionRef: import_zod41.z.string().optional(),
9293
- sourceNodeIds: import_zod41.z.array(import_zod41.z.string()).default([]),
9294
- sourceSpanIds: import_zod41.z.array(import_zod41.z.string()).default([])
9293
+ sourceNodeIds: import_zod41.z.array(import_zod41.z.string()),
9294
+ sourceSpanIds: import_zod41.z.array(import_zod41.z.string())
9295
9295
  })).optional(),
9296
9296
  sourceNodeIds: import_zod41.z.array(import_zod41.z.string()).optional(),
9297
9297
  sourceSpanIds: import_zod41.z.array(import_zod41.z.string()).optional()
@@ -9313,13 +9313,14 @@ function compactNode(node) {
9313
9313
  };
9314
9314
  }
9315
9315
  function buildOrganizationPrompt(sourceTree) {
9316
- const nodes = sourceTree.filter((node) => node.kind !== "table_cell").slice(0, 180).map(compactNode);
9316
+ const nodes = sourceTree.filter((node) => node.kind !== "document").slice(0, 240).map(compactNode);
9317
9317
  return `You organize an insurance document source tree.
9318
9318
 
9319
9319
  Rules:
9320
9320
  - Use only node IDs from the provided list.
9321
9321
  - Do not invent text, page numbers, source spans, limits, or policy facts.
9322
9322
  - 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.
9323
+ - Add concise, human-readable titles to generic text, table, row, and cell nodes when the text makes their role clear.
9323
9324
  - Groups must list existing childNodeIds only.
9324
9325
  - Keep descriptions short and useful for search.
9325
9326
 
@@ -9429,6 +9430,7 @@ function sourceTreeToOutline(sourceTree) {
9429
9430
  sourceSpanIds: node.sourceSpanIds,
9430
9431
  sourceTextHash: node.sourceSpanIds.join(":") || void 0,
9431
9432
  interpretationLabels: [node.kind],
9433
+ metadata: node.metadata,
9432
9434
  children: (byParent.get(node.id) ?? []).map(visit)
9433
9435
  });
9434
9436
  return (byParent.get(root?.id) ?? []).map(visit);