@eigenpal/cli 0.4.10 → 0.4.12
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 +32 -0
- package/dist/cli.js +28789 -27650
- package/dist/skill/SKILL.md +1 -1
- package/dist/skill/examples/hello-world/workflow.yaml +4 -2
- package/dist/skill/reference/cli/agent.md +803 -1
- package/dist/skill/reference/cli/init.md +2 -2
- package/dist/skill/reference/step-types.md +7 -18
- package/dist/skill/reference/workflow-yaml.md +6 -4
- package/dist/templates/blank/workflow.yaml +4 -2
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ init
|
|
|
26
26
|
| Command | Description |
|
|
27
27
|
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
28
|
| `eigenpal init workflow [options] <name>` | Alias of `eigenpal init <name>`. Kept so the `init {workflow,agent}` namespace stays visible — once the agent surface lights up, both kinds will live as siblings here. |
|
|
29
|
-
| `eigenpal init agent [options] <name>` | Scaffold a new agent
|
|
29
|
+
| `eigenpal init agent [options] <name>` | Scaffold a new agent project — coming soon. Use `eigenpal agent push` with an existing agent project for now. |
|
|
30
30
|
|
|
31
31
|
## Details
|
|
32
32
|
|
|
@@ -50,7 +50,7 @@ Alias of `eigenpal init <name>`. Kept so the `init {workflow,agent}` namespace s
|
|
|
50
50
|
|
|
51
51
|
### `eigenpal init agent [options] <name>`
|
|
52
52
|
|
|
53
|
-
Scaffold a new agent
|
|
53
|
+
Scaffold a new agent project — coming soon. Use `eigenpal agent push` with an existing agent project for now.
|
|
54
54
|
|
|
55
55
|
### Arguments
|
|
56
56
|
|
|
@@ -70,21 +70,10 @@ the catalog tells you what fields it takes.
|
|
|
70
70
|
- Real JS — `Array.prototype.reduce`, `JSON.parse`, etc.
|
|
71
71
|
- Sandbox limits prevent infinite loops from blowing up an execution
|
|
72
72
|
|
|
73
|
-
>
|
|
74
|
-
>
|
|
75
|
-
>
|
|
76
|
-
>
|
|
77
|
-
>
|
|
78
|
-
> ```js
|
|
79
|
-
> // ✗ TDZ — `located` is the input AND the inner const
|
|
80
|
-
> const located = located || [];
|
|
81
|
-
>
|
|
82
|
-
> // ✓ Rename the inner variable
|
|
83
|
-
> const safeLocated = located ?? [];
|
|
84
|
-
> ```
|
|
85
|
-
>
|
|
86
|
-
> If you need a default, use `??` / `||` against the binding directly without
|
|
87
|
-
> redeclaring, or rename the local. The same applies to `let` redeclarations.
|
|
73
|
+
> Each entry in `inputs:` becomes a parameter of `function script(...)`
|
|
74
|
+
> in declaration order. `inputs: { items, taxRate }` ⇒
|
|
75
|
+
> `function script(items, taxRate) { … }`. The function must `return`
|
|
76
|
+
> (or `throw`) a value.
|
|
88
77
|
|
|
89
78
|
## Reference / output paths
|
|
90
79
|
|
|
@@ -329,14 +318,14 @@ Convert XLSX spreadsheet to JSON array of row objects for use in scripts or down
|
|
|
329
318
|
|
|
330
319
|
#### `transform.script` — Script
|
|
331
320
|
|
|
332
|
-
Execute JavaScript
|
|
321
|
+
Execute a JavaScript function in a QuickJS sandbox. Input keys become the function's parameter list, in declaration order: `inputs: { items, taxRate }` ⇒ `function script(items, taxRate) { … }`. Must `return` (or `throw`) a value.
|
|
333
322
|
|
|
334
323
|
**Config** (in `step.with`):
|
|
335
324
|
|
|
336
325
|
| Field | Type | Required | Default | Description |
|
|
337
326
|
| --- | --- | --- | --- | --- |
|
|
338
|
-
| `inputs` | record<string, string> | no | | Named inputs mapped from template expressions.
|
|
339
|
-
| `
|
|
327
|
+
| `inputs` | record<string, string> | no | | Named inputs mapped from template expressions. Keys become the function parameter list in declaration order: `inputs: { items, taxRate }` ⇒ `function script(items, taxRate) { … }`. |
|
|
328
|
+
| `function` | string | no | | JavaScript function declaration. Must be `function script(arg1, arg2, …) { … }` where the parameter list equals `Object.keys(inputs)` in declaration order. Must `return` (or `throw`) a value. |
|
|
340
329
|
| `outputSchema` | record<string, unknown> | no | | JSON Schema describing the expected return value. Used for validation and type hints. |
|
|
341
330
|
| `timeout` | number | no | `5000` | Max execution time in milliseconds (default: 5000) |
|
|
342
331
|
| `memoryLimit` | number | no | `10485760` | Max memory in bytes (default: 10MB) |
|
|
@@ -158,10 +158,12 @@ arithmetic, regex) goes in `transform.script`:
|
|
|
158
158
|
inputs: # explicit data deps — visible to the validator
|
|
159
159
|
lineItems: '{{ steps.extract.output.lineItems }}'
|
|
160
160
|
taxRate: '{{ input.taxRate }}'
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
function: |
|
|
162
|
+
function script(lineItems, taxRate) {
|
|
163
|
+
const subtotal = lineItems.reduce((s, i) => s + i.price * i.qty, 0);
|
|
164
|
+
const tax = subtotal * taxRate;
|
|
165
|
+
return { subtotal, tax, total: subtotal + tax };
|
|
166
|
+
}
|
|
165
167
|
outputSchema: # optional but recommended — runtime-validated
|
|
166
168
|
type: object
|
|
167
169
|
properties:
|
|
@@ -25,8 +25,10 @@ steps:
|
|
|
25
25
|
with:
|
|
26
26
|
inputs:
|
|
27
27
|
text: '{{ input.text }}'
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
function: |
|
|
29
|
+
function script(text) {
|
|
30
|
+
return { length: text.length, original: text };
|
|
31
|
+
}
|
|
30
32
|
outputSchema:
|
|
31
33
|
type: object
|
|
32
34
|
properties:
|