@eigenpal/cli 0.10.25 → 0.10.27
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/CHANGELOG.md +6 -0
- package/dist/cli.js +4706 -346
- package/dist/skill/reference/step-types.md +32 -4
- package/package.json +1 -1
|
@@ -375,6 +375,8 @@ Extract text from documents (PDF, DOCX, images) using OCR or vision models
|
|
|
375
375
|
| `languages` | array<string> | no | | OCR language hints |
|
|
376
376
|
| `outputFormat` | `"plain"` \| `"markdown"` \| `"djot"` \| `"html"` | no | `"markdown"` | Format for extracted text. `markdown` (default) keeps structure and is best for LLM extraction; `plain` is unstyled text; `djot`/`html` preserve more layout. Only the native (Kreuzberg) parser respects this — OCR/VLM always emit markdown. |
|
|
377
377
|
| `nativeText` | boolean | no | `false` | Extract native/embedded text from PDFs without OCR/VLM. Faster and uses no credits. Falls back to OCR/VLM if the PDF has no embedded text. |
|
|
378
|
+
| `describeFigures` | boolean | no | | Opt-in (default off). After text extraction, detect which pages contain figures with an in-worker layout model, then caption those pages with a vision model and append `<figure>description</figure>` to their text — so image-only pages (property photos, signatures, charts) become findable by text-based steps like ai.split. Note: the layout scan runs over all pages, and the caption step and its vision calls are billed. Skipped for plaintext. |
|
|
379
|
+
| `figureInstructions` | string | no | | Custom instruction for the figure-description pass, e.g. "Describe each figure; label a handwritten signature as `<figure>signature</figure>` and a stamp as `<figure>stamp</figure>`; for property photos note the room or exterior shown." Applied only when describeFigures runs. |
|
|
378
380
|
|
|
379
381
|
**Output:** `object`
|
|
380
382
|
|
|
@@ -400,14 +402,14 @@ Extract structured data from text using AI with a JSON schema
|
|
|
400
402
|
| `provider` | string | no | | Provider ID (e.g., "openai-gpt4o") |
|
|
401
403
|
| `model` | string | no | | Model override |
|
|
402
404
|
| `maxInputTokens` | integer | no | | Max input tokens. Truncates input text and logs a warning when exceeded. Omit for no limit. |
|
|
403
|
-
| `grounded` | boolean | no | |
|
|
404
|
-
| `groundingModel` | string | no | | Provider/model for the grounding pass. Defaults to the workspace default LLM.
|
|
405
|
+
| `grounded` | boolean | no | | Grounding is ON by default: each schema field gets a source span + confidence (high=verbatim, medium=fuzzy, low=ungrounded) under a reserved `_grounding` output key, and fields whose value cannot be located in the source are flagged for human review. Values stay the reliable schema-typed ones. The pass runs through the workspace LLM (any provider) and chunks long documents automatically. Tri-state: unset (default) = on, degrading gracefully to deterministic text alignment (`_grounding._degraded: true`) if no grounding model is available; `true` = strict, the step fails when the grounding model cannot be resolved; `false` = off, no `_grounding` key at all. |
|
|
406
|
+
| `groundingModel` | string | no | | Provider/model for the grounding pass. Defaults to the workspace default LLM. Any configured provider works; the pass only fails the step when `grounded: true` is set explicitly and no model resolves. |
|
|
405
407
|
| `groundingExamples` | array<object> | no | | Optional few-shot examples pinning grounding to verbatim source text per field. |
|
|
406
|
-
| `reviewOn` | `"medium_or_low"` \| `"low_only"` | no | | Which grounding confidences
|
|
408
|
+
| `reviewOn` | `"medium_or_low"` \| `"low_only"` | no | | Which grounding confidences set needsReview on a field. Default: low_only (only fields whose value could not be located in the source). Use medium_or_low to also flag approximate and derived matches. |
|
|
407
409
|
|
|
408
410
|
**Output:** `record<string, unknown>`
|
|
409
411
|
|
|
410
|
-
> Extracted structured data matching the provided schema
|
|
412
|
+
> Extracted structured data matching the provided schema. Unless grounding is disabled (grounded: false), the output also carries a reserved `_grounding` map keyed by field name: `_grounding.<field> = { confidence: high|medium|low, needsReview, reason?, source_span: { start, end, text, alignment } | null }`, plus reserved `_degraded: true` / `_reason` markers when the grounding LLM pass could not run.
|
|
411
413
|
|
|
412
414
|
#### `ai.split` — Split Document
|
|
413
415
|
|
|
@@ -430,6 +432,7 @@ Split a parsed document into named sections using an LLM. Consumes ai.parse outp
|
|
|
430
432
|
| Field | Type | Required | Default | Description |
|
|
431
433
|
| --- | --- | --- | --- | --- |
|
|
432
434
|
| `splits` | array<object> | yes | | Sections found in the document, in page order. Absent sections are omitted. |
|
|
435
|
+
| `sections` | record<string, object> | yes | | The same sections keyed by config name, so a downstream step can reference one directly: `{{ steps.<split>.output.sections.<name>.page_range }}`. Prefer this over filtering `splits`. On a duplicate name the last wins. |
|
|
433
436
|
|
|
434
437
|
#### `ai.segment` — Separate Documents
|
|
435
438
|
|
|
@@ -479,6 +482,31 @@ Classify a document or text into one of a fixed label set using an LLM. Output e
|
|
|
479
482
|
| `confidence` | `"low"` \| `"medium"` \| `"high"` | yes | | LLM confidence in the classification. Coarse enum — numeric scores cluster meaninglessly at 0.85-0.95. |
|
|
480
483
|
| `reason` | string | yes | | Short justification for the chosen label — useful for debugging. |
|
|
481
484
|
|
|
485
|
+
#### `ai.vision` — Inspect Pages (Vision)
|
|
486
|
+
|
|
487
|
+
Inspect rendered page images with a vision model and return structured JSON matching a schema. The visual counterpart to Extract Data: use it for conclusions that live in the pixels rather than the text (is the document signed? are the photos usable?). Renders PDF, image, or Office/Word inputs; route to specific pages with an ai.split page range to keep it cheap.
|
|
488
|
+
|
|
489
|
+
**Durable retry:** Provider request retries are separate; the workflow engine does not durably retry this step.
|
|
490
|
+
|
|
491
|
+
**Config** (in `step.with`):
|
|
492
|
+
|
|
493
|
+
| Field | Type | Required | Default | Description |
|
|
494
|
+
| --- | --- | --- | --- | --- |
|
|
495
|
+
| `document` | string | yes | | Template expression resolving to the input file (PDF, image, or Office document). |
|
|
496
|
+
| `pageFrom` | integer \| string | no | | First page to inspect (0-based, inclusive). Optional. Accepts a template expression. When omitted, starts from the first page. |
|
|
497
|
+
| `pageTo` | integer \| string | no | | Last page to inspect (0-based, inclusive). Optional. Accepts a template expression. When omitted, runs to the last page. When BOTH pageFrom and pageTo are omitted, the whole document is inspected in chunks of maxPages (divide-and-conquer, results merged). |
|
|
498
|
+
| `schema` | object | yes | | JSON Schema defining the structure the vision model should return. |
|
|
499
|
+
| `prompt` | string | no | | Optional instruction refining the extraction. The schema drives it when omitted. |
|
|
500
|
+
| `provider` | string | no | | Provider ID (must support vision). |
|
|
501
|
+
| `model` | string | no | | Model override (must support vision). |
|
|
502
|
+
| `renderScale` | number | no | | PDF render scale (1.0 = 72 DPI). Raise for small text or weak VLM OCR. Capped at 6 to avoid oversized page rasters. |
|
|
503
|
+
| `imageQuality` | integer | no | | JPEG quality for rendered pages (default 85). |
|
|
504
|
+
| `maxPages` | integer | no | | Chunk size: the maximum pages sent to the vision model in a single call. When the inspected range (or the whole document) is larger, it is split into chunks of this size and the per-chunk results are merged by a reduce pass. The reduce follows each field's DESCRIPTION: a boolean described as "present on any page" is OR-ed, one described as "true for every page" is AND-ed, and list fields are concatenated. The merge is most reliable for boolean/scalar claims; for schemas that AGGREGATE long lists across chunks it can still drop or reorder items, so prefer a bounded page range for large list extraction. Default 20, capped at 100. |
|
|
505
|
+
|
|
506
|
+
**Output:** `record<string, unknown>`
|
|
507
|
+
|
|
508
|
+
> Structured data matching the provided schema. The output also carries a reserved `_vision` key recording the inspected source document ref and the page indices that were rendered, so the UI can re-rasterize exactly those pages client-side. `_vision` is excluded from user-schema validation.
|
|
509
|
+
|
|
482
510
|
### Transform steps — deterministic data transforms
|
|
483
511
|
|
|
484
512
|
#### `transform.set` — Set Value
|