@eigenpal/cli 0.20.86 → 0.20.87
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @eigenpal/cli
|
|
2
2
|
|
|
3
|
+
## 0.20.87
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6f24a32: `eigenpal workflow validate` and `push` now warn about step settings that are silently ignored (for example `strategy` on a parse step or `outputSchema` on a script) and suggest the closest supported setting. The "add an enum" hint no longer fires on open-ended fields such as VINs, names, years and ids.
|
|
8
|
+
|
|
3
9
|
## 0.20.86
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -17204,7 +17204,7 @@ var init_extract = __esm(() => {
|
|
|
17204
17204
|
});
|
|
17205
17205
|
ExtractOutputSchema = record(string2(), unknown()).describe('Extracted structured data matching the provided schema. Unless grounding is disabled (grounded: false), the output also carries a reserved `_grounding` map keyed by dotted field path: `_grounding["line_items.0.amount"] = { confidence: high|medium|low, score?, needsReview, reason?, quote?, citations?, source_span }`, plus reserved `_degraded: true` / `_reason` markers when grounding could not run the shared algorithm or the Eigenpal text pass. Lineage is never included in this JSON.');
|
|
17206
17206
|
ExtractConfigSchema = object({
|
|
17207
|
-
schema: record(string2(), unknown()).describe("JSON Schema defining the structure to extract"),
|
|
17207
|
+
schema: record(string2(), unknown()).describe("JSON Schema defining the structure to extract. Fields not listed in `required` come back null when the document does not contain them; a missing required field fails the step."),
|
|
17208
17208
|
prompt: string2().optional().describe("Custom prompt template for extraction"),
|
|
17209
17209
|
provider: string2().optional().describe('Provider ID to use (e.g., "openai/gpt-6-luna", "anthropic/claude-sonnet-5-5")'),
|
|
17210
17210
|
model: string2().optional().describe("Model to use (overrides provider default)"),
|
|
@@ -56333,7 +56333,7 @@ var init_step_configs = __esm(() => {
|
|
|
56333
56333
|
required: array(string2()).optional()
|
|
56334
56334
|
}).refine((schema) => Object.keys(schema.properties).length > 0, {
|
|
56335
56335
|
message: "Extraction schema must define at least one field"
|
|
56336
|
-
}).describe("JSON Schema defining the structure to extract"),
|
|
56336
|
+
}).describe("JSON Schema defining the structure to extract. Fields not listed in `required` come back null when the document does not contain them; a missing required field fails the step."),
|
|
56337
56337
|
prompt: string2().optional().describe("Custom prompt template for extraction"),
|
|
56338
56338
|
provider: string2().optional().describe('Provider ID (e.g., "openai/gpt-6-luna")'),
|
|
56339
56339
|
model: string2().optional().describe("Model override"),
|
|
@@ -56362,7 +56362,7 @@ var init_step_configs = __esm(() => {
|
|
|
56362
56362
|
required: array(string2()).optional()
|
|
56363
56363
|
}).refine((schema) => Object.keys(schema.properties).length > 0, {
|
|
56364
56364
|
message: "Vision schema must define at least one field"
|
|
56365
|
-
}).describe("JSON Schema defining the structure the vision model should return."),
|
|
56365
|
+
}).describe("JSON Schema defining the structure the vision model should return. Fields not listed in `required` come back null when not found; a missing required field fails the step."),
|
|
56366
56366
|
prompt: string2().optional().describe("Optional instruction refining the extraction. The schema drives it when omitted."),
|
|
56367
56367
|
provider: string2().optional().describe("Provider ID (must support vision)."),
|
|
56368
56368
|
model: string2().optional().describe("Model override (must support vision)."),
|
|
@@ -209780,7 +209780,7 @@ function toPutBody(body) {
|
|
|
209780
209780
|
// package.json
|
|
209781
209781
|
var package_default = {
|
|
209782
209782
|
name: "@eigenpal/cli",
|
|
209783
|
-
version: "0.20.
|
|
209783
|
+
version: "0.20.87",
|
|
209784
209784
|
description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
|
|
209785
209785
|
keywords: [
|
|
209786
209786
|
"eigenpal",
|
|
@@ -248806,7 +248806,7 @@ var CATEGORICAL_NAMES = new Set([
|
|
|
248806
248806
|
"phase"
|
|
248807
248807
|
]);
|
|
248808
248808
|
var SEPARATOR_LIST_RE = /(?:^|[\s(])((?:[A-Za-z0-9_-]{1,20})(?:\s*[|,/]\s*[A-Za-z0-9_-]{1,20}){1,7})(?:$|[\s).])/;
|
|
248809
|
-
var IDENTIFIER_NAME_RE = /(number|num|id|identifier|reference|ref|sku|key|uuid|guid|iban|email|phone|url|uri|path|filename|name|date|address)$/i;
|
|
248809
|
+
var IDENTIFIER_NAME_RE = /(number|num|id|identifier|identificator|reference|ref|sku|key|uuid|guid|iban|vin|email|phone|url|uri|path|filename|name|date|year|address|brand|model|contract|symbol)$/i;
|
|
248810
248810
|
var FREEFORM_NAMES = new Set([
|
|
248811
248811
|
"terms",
|
|
248812
248812
|
"notes",
|
|
@@ -248830,6 +248830,8 @@ function descriptionLooksCategorical(description) {
|
|
|
248830
248830
|
if (!match?.[1])
|
|
248831
248831
|
return false;
|
|
248832
248832
|
const tokens = match[1].split(/\s*[|,/]\s*/).map((t) => t.trim()).filter(Boolean);
|
|
248833
|
+
if (!/[|/]/.test(match[1]) && tokens.length < 3)
|
|
248834
|
+
return false;
|
|
248833
248835
|
const idLike = tokens.filter((t) => ID_LIKE_TOKEN_RE.test(t)).length;
|
|
248834
248836
|
return idLike * 2 < tokens.length;
|
|
248835
248837
|
}
|
|
@@ -248931,7 +248933,66 @@ function scanValue(value, path, inScope, out) {
|
|
|
248931
248933
|
}
|
|
248932
248934
|
}
|
|
248933
248935
|
}
|
|
248936
|
+
var IGNORED_KEY_HINTS = {
|
|
248937
|
+
"transform.script:outputSchema": "Remove it. The function's return type annotation is the step's output schema.",
|
|
248938
|
+
"ai.extract:temperature": "Remove it. Extraction always runs at temperature 0."
|
|
248939
|
+
};
|
|
248940
|
+
var RUNTIME_READ_KEYS = {
|
|
248941
|
+
"ai.extract": ["content", "text"],
|
|
248942
|
+
"transform.merge": ["input", "inputs"]
|
|
248943
|
+
};
|
|
248944
|
+
function warnIgnoredConfigKeys(step, basePath, out) {
|
|
248945
|
+
if (step.type === "control.block")
|
|
248946
|
+
return;
|
|
248947
|
+
const def = getStepSchema(step.type);
|
|
248948
|
+
const cfg = step.with;
|
|
248949
|
+
if (!def?.configInWith || !cfg || typeof cfg !== "object" || Array.isArray(cfg))
|
|
248950
|
+
return;
|
|
248951
|
+
const parsed = def.configSchema.safeParse(cfg);
|
|
248952
|
+
if (!parsed.success || !parsed.data || typeof parsed.data !== "object")
|
|
248953
|
+
return;
|
|
248954
|
+
const shape = def.configSchema.shape;
|
|
248955
|
+
const supported = Object.keys(shape ?? parsed.data);
|
|
248956
|
+
const known = new Set([
|
|
248957
|
+
...supported,
|
|
248958
|
+
...Object.keys(parsed.data),
|
|
248959
|
+
...RUNTIME_READ_KEYS[step.type] ?? []
|
|
248960
|
+
]);
|
|
248961
|
+
for (const key of Object.keys(cfg)) {
|
|
248962
|
+
if (known.has(key))
|
|
248963
|
+
continue;
|
|
248964
|
+
const suggestion = closestKey(key, supported);
|
|
248965
|
+
out.push({
|
|
248966
|
+
code: "ignored-config-key",
|
|
248967
|
+
field: `${basePath}.with.${key}`,
|
|
248968
|
+
message: `\`${key}\` is not a setting of ${step.type} and is ignored at runtime.${suggestion ? ` Did you mean \`${suggestion}\`?` : ""}`,
|
|
248969
|
+
hint: IGNORED_KEY_HINTS[`${step.type}:${key}`] ?? `Remove it or use a supported setting: ${[...supported].sort().join(", ")}.`
|
|
248970
|
+
});
|
|
248971
|
+
}
|
|
248972
|
+
}
|
|
248973
|
+
function closestKey(key, candidates) {
|
|
248974
|
+
const lower = key.toLowerCase();
|
|
248975
|
+
let best;
|
|
248976
|
+
for (const candidate of candidates) {
|
|
248977
|
+
const distance = editDistance(lower, candidate.toLowerCase());
|
|
248978
|
+
if (distance <= 2 && (!best || distance < best.distance))
|
|
248979
|
+
best = { key: candidate, distance };
|
|
248980
|
+
}
|
|
248981
|
+
return best?.key;
|
|
248982
|
+
}
|
|
248983
|
+
function editDistance(a, b) {
|
|
248984
|
+
let previous = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
248985
|
+
for (let i = 1;i <= a.length; i++) {
|
|
248986
|
+
const current = [i];
|
|
248987
|
+
for (let j = 1;j <= b.length; j++) {
|
|
248988
|
+
current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
248989
|
+
}
|
|
248990
|
+
previous = current;
|
|
248991
|
+
}
|
|
248992
|
+
return previous[b.length];
|
|
248993
|
+
}
|
|
248934
248994
|
function walkStep(step, basePath, out) {
|
|
248995
|
+
warnIgnoredConfigKeys(step, basePath, out);
|
|
248935
248996
|
if (step.type === "ai.extract") {
|
|
248936
248997
|
const schema = step.with?.schema;
|
|
248937
248998
|
if (schema && typeof schema === "object") {
|