@eigenpal/cli 0.4.15 → 0.4.17

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/cli.js CHANGED
@@ -67845,7 +67845,7 @@ var init_evaluator_config = __esm(() => {
67845
67845
  returns: "a number in [0, 1] (the `: number` annotation is required)",
67846
67846
  throws: "caught and scored as 0"
67847
67847
  };
67848
- CUSTOM_SCRIPT_FUNCTION_DESCRIPTION = `Full TypeScript declaration of \`function scoreScript(expected, actual): number { ... }\`. ` + `Receives \`expected\` (${CUSTOM_SCRIPT_CONTRACT.expected}) ` + `and \`actual\` (${CUSTOM_SCRIPT_CONTRACT.actual}), returns ${CUSTOM_SCRIPT_CONTRACT.returns}. ` + `The \`: number\` return-type annotation is required and enforced at parse time. ` + `Throws are ${CUSTOM_SCRIPT_CONTRACT.throws}.`;
67848
+ CUSTOM_SCRIPT_FUNCTION_DESCRIPTION = `Full TypeScript source for optional \`type\` aliases plus \`function scoreScript(expected, actual): number { ... }\`. ` + `Receives \`expected\` (${CUSTOM_SCRIPT_CONTRACT.expected}) ` + `and \`actual\` (${CUSTOM_SCRIPT_CONTRACT.actual}), returns ${CUSTOM_SCRIPT_CONTRACT.returns}. ` + `The \`: number\` return-type annotation is required and enforced at parse time. ` + `Throws are ${CUSTOM_SCRIPT_CONTRACT.throws}.`;
67849
67849
  CustomScriptConfigSchema = exports_external.object({
67850
67850
  function: exports_external.string().min(1, { message: "required" }).max(CUSTOM_SCRIPT_MAX_BYTES, {
67851
67851
  message: `must be ≤ ${CUSTOM_SCRIPT_MAX_BYTES} bytes`
@@ -67999,14 +67999,18 @@ var init_judge = __esm(() => {
67999
67999
 
68000
68000
  // ../types/src/eval/score-function.ts
68001
68001
  function defaultScoreFunction() {
68002
- return `/**
68002
+ return `type WorkflowOutput = Record<string, unknown>;
68003
+ type Expected = WorkflowOutput;
68004
+ type Actual = WorkflowOutput;
68005
+
68006
+ /**
68003
68007
  * Score the workflow output against the example's expected output.
68004
68008
  * Return a number in [0, 1]; throws are caught and scored as 0.
68005
68009
  *
68006
68010
  * The \`: number\` return-type annotation is required and enforced at
68007
68011
  * push time. The body is compiled to JS via sucrase before sandbox.
68008
68012
  */
68009
- function scoreScript(expected: Expected, actual: Actual): number {
68013
+ function scoreScript(expected: WorkflowOutput, actual: WorkflowOutput): number {
68010
68014
  return JSON.stringify(actual) === JSON.stringify(expected) ? 1 : 0;
68011
68015
  }
68012
68016
  `;
@@ -181225,7 +181229,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
181225
181229
  // package.json
181226
181230
  var package_default = {
181227
181231
  name: "@eigenpal/cli",
181228
- version: "0.4.15",
181232
+ version: "0.4.17",
181229
181233
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
181230
181234
  keywords: [
181231
181235
  "eigenpal",
@@ -186396,7 +186400,8 @@ function registerWorkflowCoreCommands(parent) {
186396
186400
  withBaseUrl(pullCmd).action(action(async (workflow2, opts) => {
186397
186401
  const { client, workflowId } = await buildClientForWorkflow(workflow2, opts);
186398
186402
  const result = await client.get(`/api/v1/workflows/${workflowId}`);
186399
- await writeOrPrint(opts.out, result?.currentVersion?.yamlContent ?? "");
186403
+ const yaml = result?.currentVersion?.yamlContent ?? "";
186404
+ await writeOrPrint(opts.out, yaml);
186400
186405
  }));
186401
186406
  const pushCmd = parent.command("push").description(descriptionFor("workflow_set_definition")).option("--file <yaml>", "Path to YAML file").option("--workflow-id <id>", "Update existing workflow (default: create new)").option("--bump <level>", "Auto-bump from the server's current version: patch | minor | major. Mutually exclusive with `--version` and with a top-level `version:` in the YAML.").option("--set-version <semver>", "Push at this exact semver (e.g. 1.4.0). Mutually exclusive with `--bump` and with a top-level `version:` in the YAML. (Named `--set-version` to avoid the global `-v, --version` flag.)").addHelpText("after", `
186402
186407
  Examples:
@@ -186494,7 +186499,11 @@ flag would otherwise shadow it. Validation failures come back as
186494
186499
  throw new Error("--bump requires --workflow-id (need a current version to bump from). For a new workflow, use --set-version <X.Y.Z> or omit both.");
186495
186500
  }
186496
186501
  const yamlToSend = opts.setVersion && !extractWorkflowVersion(yamlOnDisk) ? spliceWorkflowVersion2(yamlOnDisk, opts.setVersion) : yamlOnDisk;
186497
- const result = await client.post("/api/v1/workflows", { yaml: yamlToSend });
186502
+ const createVersion = opts.setVersion ?? extractWorkflowVersion(yamlToSend) ?? undefined;
186503
+ const result = await client.post("/api/v1/workflows", {
186504
+ yaml: yamlToSend,
186505
+ ...createVersion ? { version: createVersion } : {}
186506
+ });
186498
186507
  if (opts.json) {
186499
186508
  printJson2(result);
186500
186509
  return;
@@ -186504,6 +186513,19 @@ flag would otherwise shadow it. Validation failures come back as
186504
186513
  success2(`Created ${ui.bold(id2)} (v${ver})`);
186505
186514
  }
186506
186515
  }));
186516
+ const moveCmd = parent.command("move <workflow-id>").description("Move a workflow to a folder path, creating folders as needed").requiredOption("--folder <path>", "Target folder path (`/` for root)");
186517
+ addJsonFlag(withBaseUrl(moveCmd)).action(action(async (workflow2, opts) => {
186518
+ const { client, workflowId } = await buildClientForWorkflow(workflow2, opts);
186519
+ const result = await client.patch(`/api/v1/workflows/${workflowId}`, {
186520
+ folderPath: opts.folder
186521
+ });
186522
+ if (opts.json) {
186523
+ printJson2(result);
186524
+ return;
186525
+ }
186526
+ const target = opts.folder.trim() === "/" ? "root" : opts.folder;
186527
+ success2(`Moved ${ui.bold(workflowId)} to ${ui.bold(target)}`);
186528
+ }));
186507
186529
  }
186508
186530
  var SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/;
186509
186531
  function isBumpLevel(value) {
@@ -110,6 +110,22 @@ The validator emits structured field-path errors with a hint pointing at
110
110
  Version bumping rules (`--bump` vs `--set-version` vs YAML `version:`)
111
111
  live in [`reference/workflow-yaml.md`](reference/workflow-yaml.md#validate-before-pushing).
112
112
 
113
+ ### Organize workflows into folders
114
+
115
+ Folders live on the server, not in `workflow.yaml`. `workflow push` and
116
+ `workflow pull` do not read or write folder placement. Use `workflow move`
117
+ to move workflows between dashboard folders:
118
+
119
+ ```bash
120
+ eigenpal workflow move <workflow-id> --folder billing/invoices
121
+ eigenpal workflow move <workflow-id> --folder /
122
+ ```
123
+
124
+ `--folder /` means root.
125
+ Missing folders in the path are created automatically.
126
+ Default to creating workflows at the top level. Do not move a workflow into
127
+ a folder unless the user specifically asks for that placement.
128
+
113
129
  ### Iterate fast on one step (no server, no DAG)
114
130
 
115
131
  Tightest possible loop — local sandbox, milliseconds per run. Today
@@ -478,6 +494,7 @@ eigenpal workflow list
478
494
  eigenpal workflow push --file workflow.yaml [--workflow-id <workflow-id>]
479
495
  eigenpal workflow pull <workflow-id>
480
496
  eigenpal workflow validate [path]
497
+ eigenpal workflow move <wf-id> --folder billing/invoices # use --folder / for root
481
498
 
482
499
  # Evaluators
483
500
  eigenpal workflow evaluators push <workflow-id> --file evaluators.yaml
@@ -19,6 +19,7 @@ Manage workflows: push, pull, run, evaluate.
19
19
  - [`eigenpal workflow list [options]`](#eigenpal-workflow-list-options)
20
20
  - [`eigenpal workflow pull [options] <workflow-id>`](#eigenpal-workflow-pull-options-workflow-id)
21
21
  - [`eigenpal workflow push [options]`](#eigenpal-workflow-push-options)
22
+ - [`eigenpal workflow move [options] <workflow-id>`](#eigenpal-workflow-move-options-workflow-id)
22
23
  - [`eigenpal workflow validate [options]`](#eigenpal-workflow-validate-options)
23
24
  - [`eigenpal workflow clear-local [options] [examples...]`](#eigenpal-workflow-clear-local-options-examples)
24
25
  - [`eigenpal workflow evaluators pull [options] <workflow-id>`](#eigenpal-workflow-evaluators-pull-options-workflow-id)
@@ -60,6 +61,7 @@ workflow
60
61
  ├── list
61
62
  ├── pull <workflow-id>
62
63
  ├── push
64
+ ├── move <workflow-id>
63
65
  ├── evaluators
64
66
  │ ├── pull <workflow-id>
65
67
  │ ├── push <workflow-id>
@@ -113,6 +115,7 @@ workflow
113
115
  | `eigenpal workflow list [options]` | List workflows the caller can read. |
114
116
  | `eigenpal workflow pull [options] <workflow-id>` | Download the YAML definition of the workflow at its current version. |
115
117
  | `eigenpal workflow push [options]` | Create or update a workflow from a YAML file. |
118
+ | `eigenpal workflow move [options] <workflow-id>` | Move a workflow to a folder path, creating folders as needed |
116
119
  | `eigenpal workflow validate [options]` | Local-only validation against the templated project layout: ./workflow.yaml + ./evaluators.yaml + ./dataset/. For targeted validation use `evaluators validate` or `dataset validate`. |
117
120
  | `eigenpal workflow clear-local [options] [examples...]` | Delete local execution artifacts under ./dataset/examples/. Keeps the latest run per example by default. |
118
121
 
@@ -235,6 +238,24 @@ Create or update a workflow from a YAML file.
235
238
  | `--base-url <url>` | no | | Server base URL |
236
239
  | `--json` | no | | Output the raw server response as JSON |
237
240
 
241
+ ### `eigenpal workflow move [options] <workflow-id>`
242
+
243
+ Move a workflow to a folder path, creating folders as needed
244
+
245
+ ### Arguments
246
+
247
+ | Name | Required | Variadic | Description |
248
+ | ------------- | -------- | -------- | ----------- |
249
+ | `workflow-id` | yes | no | |
250
+
251
+ ### Options
252
+
253
+ | Flag | Required | Default | Description |
254
+ | ------------------ | -------- | ------- | -------------------------------------- |
255
+ | `--folder <path>` | yes | | Target folder path (`/` for root) |
256
+ | `--base-url <url>` | no | | Server base URL |
257
+ | `--json` | no | | Output the raw server response as JSON |
258
+
238
259
  ### `eigenpal workflow validate [options]`
239
260
 
240
261
  Local-only validation against the templated project layout: ./workflow.yaml + ./evaluators.yaml + ./dataset/. For targeted validation use `evaluators validate` or `dataset validate`.
@@ -11,6 +11,10 @@ on the server, the canonical per-row surface is
11
11
  `dataset list` for a table view) — the local folder is a pre-push
12
12
  staging area, not a synced mirror.
13
13
 
14
+ Dataset folders are unrelated to workflow organization folders. To place
15
+ the workflow itself under dashboard folders, use `workflow move --folder`;
16
+ dataset push/pull never changes folder placement.
17
+
14
18
  ## Required layout
15
19
 
16
20
  ```
@@ -134,6 +134,20 @@ The error envelope tells you exactly where:
134
134
  Follow the hint — every field path is dotted into the YAML so you can
135
135
  jump straight to the broken line.
136
136
 
137
+ ### Workflow appears in the wrong folder
138
+
139
+ Folder placement is controlled by server folder state, not by
140
+ `workflow.yaml`. Move by explicit folder path:
141
+
142
+ ```bash
143
+ eigenpal workflow move <workflow-id> --folder billing/invoices
144
+ eigenpal workflow move <workflow-id> --folder /
145
+ ```
146
+
147
+ `--folder /` moves the workflow back to root. `workflow push` and
148
+ `workflow pull` do not change folder placement. Missing folders in the
149
+ path are created automatically.
150
+
137
151
  ## 4. Compare two executions
138
152
 
139
153
  ```bash
@@ -6,6 +6,10 @@ attach to a workflow via `workflow evaluators push` and run in batch via
6
6
  `EvalConfigYamlSchema` in `@eigenpal/types/src/eval/evaluator-config.ts`;
7
7
  this is the agent-facing summary.
8
8
 
9
+ Evaluator config does not control dashboard folder placement. Workflow
10
+ organization is managed with `workflow move --folder`;
11
+ `workflow evaluators push` leaves the workflow's folder unchanged.
12
+
9
13
  ## Top-level shape
10
14
 
11
15
  ```yaml
@@ -109,7 +113,13 @@ one of the keys in `labels`; the harness then looks up the score.
109
113
  config:
110
114
  passThreshold: 1.0
111
115
  function: |
112
- function scoreScript(expected: Expected, actual: Actual): number {
116
+ type WorkflowOutput = {
117
+ totalAmount: number;
118
+ };
119
+ type Expected = WorkflowOutput;
120
+ type Actual = WorkflowOutput;
121
+
122
+ function scoreScript(expected: WorkflowOutput, actual: WorkflowOutput): number {
113
123
  const a = actual.totalAmount ?? 0;
114
124
  const e = expected.totalAmount ?? 0;
115
125
  return Math.abs(a - e) <= 0.01 ? 1 : 0;
@@ -117,12 +127,13 @@ one of the keys in `labels`; the harness then looks up the score.
117
127
  ```
118
128
 
119
129
  Same WASM sandbox as `transform.script` (5s wall clock, 10 MB heap, no
120
- network). The YAML stores the **whole** `function scoreScript(expected,
121
- actual): number { ... }` declaration verbatim, same text the dashboard
122
- editor shows. The `: number` return-type annotation is required and
123
- enforced at parse time. `Expected` / `Actual` are in-scope type aliases
124
- in the dashboard editor (both are the workflow's output shape); plain
125
- `unknown` works too if you don't want them.
130
+ network). The YAML stores the **whole** typed score source (optional
131
+ `type` aliases plus `function scoreScript(expected, actual): number { ... }`)
132
+ verbatim, same text the dashboard editor shows. The `: number` return-type annotation is required and
133
+ enforced at parse time. The dashboard seeds new evaluators with a
134
+ `WorkflowOutput` type alias derived from the workflow's `output:`
135
+ declaration, plus `Expected` / `Actual` aliases for compatibility. Plain
136
+ `unknown` works too if you don't want a typed signature.
126
137
 
127
138
  The signature shape is **locked**:
128
139
 
@@ -267,7 +278,7 @@ _Generated from `EvalConfigYamlSchema` in `@eigenpal/types/src/eval/evaluator-co
267
278
 
268
279
  | Field | Type | Required | Default | Description |
269
280
  | --- | --- | --- | --- | --- |
270
- | `function` | string | yes | | Full TypeScript declaration of `function scoreScript(expected, actual): number { ... }`. Receives `expected` (the example's expected output) and `actual` (the workflow's actual output), returns a number in [0, 1] (the `: number` annotation is required). The `: number` return-type annotation is required and enforced at parse time. Throws are caught and scored as 0. |
281
+ | `function` | string | yes | | Full TypeScript source for optional `type` aliases plus `function scoreScript(expected, actual): number { ... }`. Receives `expected` (the example's expected output) and `actual` (the workflow's actual output), returns a number in [0, 1] (the `: number` annotation is required). The `: number` return-type annotation is required and enforced at parse time. Throws are caught and scored as 0. |
271
282
  | `timeoutMs` | integer | no | `5000` | Maximum wall-clock time the script can run before it's killed and the run is marked failed. |
272
283
  | `memoryLimitMb` | integer | no | `10` | Maximum memory the sandbox may allocate. Increase if the script processes large arrays or strings. |
273
284
  | `passThreshold` | number | no | `1` | Minimum script score this evaluator must reach for a run to pass. |
@@ -26,6 +26,14 @@ output: {...} # object — the workflow's return shape
26
26
  version with the same `name` and a different `version` appends to history;
27
27
  re-using the same `version` is rejected.
28
28
 
29
+ Folder placement is not part of `workflow.yaml`; it lives in the server
30
+ database. Use `workflow move <workflow-id> --folder <path>` to move a
31
+ workflow between dashboard folders. Missing folders in the path are
32
+ created automatically. Use `--folder /` for root. New workflows should stay
33
+ at the top level unless the user specifically asks to place them in a
34
+ folder.
35
+
36
+
29
37
  ### `triggerMethods`
30
38
 
31
39
  Required. Each entry adds an invocation surface:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/cli",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
5
5
  "keywords": [
6
6
  "eigenpal",