@eigenpal/cli 0.20.97 → 0.20.99

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,14 @@
1
1
  # @eigenpal/cli
2
2
 
3
+ ## 0.20.99
4
+
5
+ ### Patch Changes
6
+
7
+ - 996d1ef: Run responses expose structured errors with a machine-readable code, message,
8
+ retryability, and the configured business status code and step for workflow
9
+ rejections. Update consumers of the previous string error to read error.message.
10
+ HTTP success remains independent of the processing outcome.
11
+
3
12
  ## 0.20.94
4
13
 
5
14
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -54529,6 +54529,7 @@ var init_step_configs = __esm(() => {
54529
54529
  })
54530
54530
  ]).describe("Split result - array or extracted/remaining object");
54531
54531
  TransformMergeConfigSchema = object({
54532
+ input: record(string2(), unknown()).optional().describe("Named inputs to merge; each key becomes a key in the merged output"),
54532
54533
  preservePortNames: boolean2().default(true).optional(),
54533
54534
  outputKey: string2().optional()
54534
54535
  });
@@ -54997,7 +54998,7 @@ var init_step_configs = __esm(() => {
54997
54998
  ControlHumanReviewOutputSchema = unknown().describe("The complete reviewed data in the same object or array shape as the input.");
54998
54999
  ControlFailConfigSchema = object({
54999
55000
  condition: string2().optional().describe("Optional LiquidJS expression. When set, the step only fails if this evaluates truthy; when omitted, it always fails when reached (compose with control.if for legacy gating)."),
55000
- statusCode: number2().int().min(400).max(599).default(422).describe("HTTP-style status code returned to the caller (sync runs) and persisted on the execution. Default 422 (Unprocessable Entity)."),
55001
+ statusCode: number2().int().min(400).max(599).default(422).describe("Business rejection code exposed as error.statusCode on the run. Does not change the API HTTP response status. Default 422 (Unprocessable Entity)."),
55001
55002
  message: string2().min(1).describe('Human-readable failure message. Supports template expressions, e.g. "Document classified as {{ steps.classify.output.label }}".')
55002
55003
  });
55003
55004
  ControlFailOutputSchema = never().describe("control.fail never produces output — it terminates the workflow when triggered.");
@@ -57107,6 +57108,29 @@ var init_execution_tags = __esm(() => {
57107
57108
  ExecutionTagsSchema = union([ExecutionTagSchema, array(ExecutionTagSchema).max(MAX_EXECUTION_TAGS)]).transform((tags) => [...new Set(typeof tags === "string" ? [tags] : tags)]);
57108
57109
  });
57109
57110
 
57111
+ // ../types/src/run-error.ts
57112
+ function runErrorMessage(error) {
57113
+ if (typeof error === "string")
57114
+ return error;
57115
+ if (error && typeof error === "object" && "message" in error && typeof error.message === "string")
57116
+ return error.message;
57117
+ return null;
57118
+ }
57119
+ var RunErrorSchema;
57120
+ var init_run_error = __esm(() => {
57121
+ init_zod();
57122
+ RunErrorSchema = object({
57123
+ code: string2().describe("Machine-readable failure code. Do not branch on message text."),
57124
+ message: string2().describe("Human-readable failure explanation."),
57125
+ statusCode: number2().int().min(400).max(599).optional().describe("HTTP-style business code configured by control.fail, not the API response status. Absent for untyped failures."),
57126
+ step: string2().optional().describe("Name of the control.fail step that rejected the run, when known."),
57127
+ retryable: boolean2().describe("Whether another attempt might succeed. Does not schedule a retry.")
57128
+ }).meta({ id: "RunError" });
57129
+ });
57130
+
57131
+ // ../types/src/workflow/failure-contract.ts
57132
+ var init_failure_contract = () => {};
57133
+
57110
57134
  // ../types/src/index.ts
57111
57135
  var init_src = __esm(() => {
57112
57136
  init_core3();
@@ -57118,6 +57142,7 @@ var init_src = __esm(() => {
57118
57142
  init_execution_row();
57119
57143
  init_run_expand();
57120
57144
  init_execution_tags();
57145
+ init_run_error();
57121
57146
  init_document_parser_v2();
57122
57147
  init_parse_v2_migration();
57123
57148
  init_validation();
@@ -57131,6 +57156,7 @@ var init_src = __esm(() => {
57131
57156
  init_webhooks();
57132
57157
  init_typed_script();
57133
57158
  init_spreadsheet_evidence();
57159
+ init_failure_contract();
57134
57160
  });
57135
57161
 
57136
57162
  // node_modules/yaml/dist/nodes/identity.js
@@ -215599,7 +215625,7 @@ function toPutBody(body) {
215599
215625
  // package.json
215600
215626
  var package_default = {
215601
215627
  name: "@eigenpal/cli",
215602
- version: "0.20.97",
215628
+ version: "0.20.99",
215603
215629
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
215604
215630
  keywords: [
215605
215631
  "eigenpal",
@@ -249177,6 +249203,9 @@ function extractXlsxComparableText(filePath) {
249177
249203
  }
249178
249204
  }
249179
249205
 
249206
+ // src/commands/workflow/eval-example.ts
249207
+ init_src();
249208
+
249180
249209
  // src/lib/execution-artifacts.ts
249181
249210
  import { existsSync as existsSync11, mkdirSync as mkdirSync4, readdirSync as readdirSync3, readFileSync as readFileSync11, writeFileSync as writeFileSync6 } from "fs";
249182
249211
  import { join as join5 } from "path";
@@ -249477,7 +249506,7 @@ function toArtifactPayload(run, runId) {
249477
249506
  status: run.execution?.status ?? run.status ?? "unknown",
249478
249507
  createdAt: run.timing?.createdAt ?? new Date().toISOString(),
249479
249508
  completedAt: run.timing?.completedAt ?? null,
249480
- error: run.error !== undefined ? run.error : run.result?.error ?? null,
249509
+ error: runErrorMessage(run.error !== undefined ? run.error : run.result?.error),
249481
249510
  output: runOutput(run),
249482
249511
  stepExecutions: []
249483
249512
  };
@@ -249515,7 +249544,7 @@ async function runWorkflowExamplesWithEval(client, dir, workflowIdOrSlug, workfl
249515
249544
  exampleId: example.id,
249516
249545
  executionId: runId,
249517
249546
  run: runOk ? "ok" : "error",
249518
- runError: runOk ? undefined : run.error ?? status ?? "unknown",
249547
+ runError: runOk ? undefined : runErrorMessage(run.error) ?? status ?? "unknown",
249519
249548
  mode: "none"
249520
249549
  };
249521
249550
  const commit = run.source?.git?.commitSha;
@@ -249979,7 +250008,7 @@ function toLegacyRunView(run) {
249979
250008
  return run;
249980
250009
  const terminalOutput = run.output !== undefined ? run.output : result?.output;
249981
250010
  const terminalFiles = run.files !== undefined ? run.files : result?.files ?? executionFiles?.output;
249982
- const terminalError = run.error !== undefined ? run.error : result?.error;
250011
+ const terminalError = runErrorMessage(run.error !== undefined ? run.error : result?.error);
249983
250012
  const terminalSchemaValid = execution?.schemaValid !== undefined ? execution.schemaValid : result?.schemaValid;
249984
250013
  return {
249985
250014
  ...run,
@@ -250104,7 +250133,7 @@ function toExecutionSnapshot(run, fallbackId) {
250104
250133
  error: typeof step.error === "string" ? step.error : null,
250105
250134
  outputPreview: previewOutput(step.outputData)
250106
250135
  })),
250107
- error: typeof run.error === "string" ? run.error : null
250136
+ error: runErrorMessage(run.error)
250108
250137
  };
250109
250138
  }
250110
250139
  var PREVIEW_MAX = 120;