@eigenpal/cli 0.10.8 → 0.10.10

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.
@@ -390,6 +390,10 @@ Extract structured data from text using AI with a JSON schema
390
390
  | `provider` | string | no | | Provider ID (e.g., "openai-gpt4o") |
391
391
  | `model` | string | no | | Model override |
392
392
  | `maxInputTokens` | integer | no | | Max input tokens. Truncates input text and logs a warning when exceeded. Omit for no limit. |
393
+ | `grounded` | boolean | no | | Optional. When true, adds a grounding pass: each schema field gets a source span + confidence (high=verbatim, medium=fuzzy, low=ungrounded) under a `_grounding` key, and ungrounded/fuzzy fields are flagged for human review. Grounding always calls OpenAI directly (independent of the extract provider) and requires OPENAI_API_KEY. Values stay the reliable schema-typed ones. |
394
+ | `groundingModel` | string | no | | Provider/model for the grounding pass. Defaults to the workspace default LLM; grounding runs against OpenAI, so pick an OpenAI-compatible model. |
395
+ | `groundingExamples` | array<object> | no | | Optional few-shot examples pinning grounding to verbatim source text per field. |
396
+ | `reviewOn` | `"medium_or_low"` \| `"low_only"` | no | | Which grounding confidences flag a field for review. Default: medium_or_low. |
393
397
 
394
398
  **Output:** `record<string, unknown>`
395
399
 
@@ -415,6 +419,27 @@ Split a parsed document into named sections using an LLM. Consumes ai.parse outp
415
419
  | --- | --- | --- | --- | --- |
416
420
  | `splits` | array<object> | yes | | Sections found in the document, in page order. Absent sections are omitted. |
417
421
 
422
+ #### `ai.segment` — Separate Documents
423
+
424
+ Separate a concatenated batch (one big scan) into typed document instances using an LLM. Consumes ai.parse output and a type taxonomy; discovers an unknown number of documents in any order and emits per-document page ranges + text + type, ready for type-specific ai.extract via control.parallel_map. The inverse of ai.split.
425
+
426
+ **Config** (in `step.with`):
427
+
428
+ | Field | Type | Required | Default | Description |
429
+ | --- | --- | --- | --- | --- |
430
+ | `input` | string | yes | | Template expression resolving to ai.parse output, e.g. "{{ steps.parse.output }}" |
431
+ | `documentTypes` | array<object> | yes | | The document-type taxonomy. The LLM tags each detected document with one of these names, or the reserved "unknown" type when none fit. |
432
+ | `rules` | string | no | | Optional natural-language rules appended to the system prompt. |
433
+ | `provider` | string | no | | Provider ID from eigenpal.config.yaml. Falls back to the tenant default LLM provider when omitted. |
434
+ | `windowTokenBudget` | integer | no | | Override the per-window token ceiling. Defaults to env SPLIT_WINDOW_TOKEN_BUDGET or 20000. |
435
+
436
+ **Output:** `object`
437
+
438
+ | Field | Type | Required | Default | Description |
439
+ | --- | --- | --- | --- | --- |
440
+ | `summary` | object | yes | | Batch-level escalation summary: labelled vs unlabelled counts + docs needing review. |
441
+ | `documents` | array<object> | yes | | Documents discovered in the batch, in page order. The full batch is covered. |
442
+
418
443
  #### `ai.classify` — Classify
419
444
 
420
445
  Classify a document or text into one of a fixed label set using an LLM. Output exposes the picked label (constrained to the configured names), a coarse confidence, and a short justification. Pair with control.fail to reject documents that match an undesired label.
@@ -732,6 +757,25 @@ Branch execution based on a condition expression
732
757
  | `branch` | `"then"` \| `"else"` | yes | | Which branch was executed |
733
758
  | `result` | unknown | yes | | Output from executed branch |
734
759
 
760
+ #### `control.switch` — Switch
761
+
762
+ Multi-way routing: resolve an expression and run the first case whose value matches (else default). Cleaner than a nested control.if chain for routing an item to one of N pipelines by a discriminator field like a document type.
763
+
764
+ **Config** (at step level):
765
+
766
+ | Field | Type | Required | Default | Description |
767
+ | --- | --- | --- | --- | --- |
768
+ | `on` | string | yes | | Template expression whose resolved value selects the case, e.g. "{{ doc.type }}". |
769
+ | `cases` | array<object> | yes | | Ordered cases; the first whose `when` matches runs. Each case has its own `steps`. |
770
+
771
+ **Output:** `object`
772
+
773
+ | Field | Type | Required | Default | Description |
774
+ | --- | --- | --- | --- | --- |
775
+ | `matched` | string \| number \| boolean \| null | yes | | The `when` value that matched, or null when the default (or no) branch ran. |
776
+ | `branch` | `"case"` \| `"default"` \| `"none"` | yes | | Which branch executed. |
777
+ | `result` | unknown | yes | | Output from the executed branch (its last step). |
778
+
735
779
  #### `control.foreach` — For Each
736
780
 
737
781
  Loop over an array and execute steps for each item
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/cli",
3
- "version": "0.10.8",
3
+ "version": "0.10.10",
4
4
  "description": "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
5
5
  "keywords": [
6
6
  "eigenpal",