@eigenpal/cli 0.4.15 → 0.4.16
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 +8 -4
- package/dist/skill/reference/evaluators.md +15 -8
- package/package.json +1 -1
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
|
|
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:
|
|
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.
|
|
181232
|
+
version: "0.4.16",
|
|
181229
181233
|
description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
|
|
181230
181234
|
keywords: [
|
|
181231
181235
|
"eigenpal",
|
|
@@ -109,7 +109,13 @@ one of the keys in `labels`; the harness then looks up the score.
|
|
|
109
109
|
config:
|
|
110
110
|
passThreshold: 1.0
|
|
111
111
|
function: |
|
|
112
|
-
|
|
112
|
+
type WorkflowOutput = {
|
|
113
|
+
totalAmount: number;
|
|
114
|
+
};
|
|
115
|
+
type Expected = WorkflowOutput;
|
|
116
|
+
type Actual = WorkflowOutput;
|
|
117
|
+
|
|
118
|
+
function scoreScript(expected: WorkflowOutput, actual: WorkflowOutput): number {
|
|
113
119
|
const a = actual.totalAmount ?? 0;
|
|
114
120
|
const e = expected.totalAmount ?? 0;
|
|
115
121
|
return Math.abs(a - e) <= 0.01 ? 1 : 0;
|
|
@@ -117,12 +123,13 @@ one of the keys in `labels`; the harness then looks up the score.
|
|
|
117
123
|
```
|
|
118
124
|
|
|
119
125
|
Same WASM sandbox as `transform.script` (5s wall clock, 10 MB heap, no
|
|
120
|
-
network). The YAML stores the **whole**
|
|
121
|
-
actual): number { ... }`
|
|
122
|
-
editor shows. The `: number` return-type annotation is required and
|
|
123
|
-
enforced at parse time.
|
|
124
|
-
|
|
125
|
-
`
|
|
126
|
+
network). The YAML stores the **whole** typed score source (optional
|
|
127
|
+
`type` aliases plus `function scoreScript(expected, actual): number { ... }`)
|
|
128
|
+
verbatim, same text the dashboard editor shows. The `: number` return-type annotation is required and
|
|
129
|
+
enforced at parse time. The dashboard seeds new evaluators with a
|
|
130
|
+
`WorkflowOutput` type alias derived from the workflow's `output:`
|
|
131
|
+
declaration, plus `Expected` / `Actual` aliases for compatibility. Plain
|
|
132
|
+
`unknown` works too if you don't want a typed signature.
|
|
126
133
|
|
|
127
134
|
The signature shape is **locked**:
|
|
128
135
|
|
|
@@ -267,7 +274,7 @@ _Generated from `EvalConfigYamlSchema` in `@eigenpal/types/src/eval/evaluator-co
|
|
|
267
274
|
|
|
268
275
|
| Field | Type | Required | Default | Description |
|
|
269
276
|
| --- | --- | --- | --- | --- |
|
|
270
|
-
| `function` | string | yes | | Full TypeScript
|
|
277
|
+
| `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
278
|
| `timeoutMs` | integer | no | `5000` | Maximum wall-clock time the script can run before it's killed and the run is marked failed. |
|
|
272
279
|
| `memoryLimitMb` | integer | no | `10` | Maximum memory the sandbox may allocate. Increase if the script processes large arrays or strings. |
|
|
273
280
|
| `passThreshold` | number | no | `1` | Minimum script score this evaluator must reach for a run to pass. |
|