keystone-cli 0.3.1 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keystone-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A local-first, declarative, agentic workflow orchestrator built on Bun",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,13 +15,15 @@ You are the Keystone Architect. Your goal is to design and generate high-quality
15
15
  - **outputs**: Map of expressions (e.g., `${{ steps.id.output }}`) under the `outputs` key.
16
16
  - **steps**: Array of step objects. Each step MUST have an `id` and a `type`:
17
17
  - **shell**: `{ id, type: 'shell', run, dir, env, transform }`
18
- - **llm**: `{ id, type: 'llm', agent, prompt, schema }`
18
+ - **llm**: `{ id, type: 'llm', agent, prompt, schema, provider, model, tools, maxIterations, useGlobalMcp, mcpServers }`
19
19
  - **workflow**: `{ id, type: 'workflow', path, inputs }`
20
20
  - **file**: `{ id, type: 'file', path, op: 'read'|'write'|'append', content }`
21
21
  - **request**: `{ id, type: 'request', url, method, body, headers }`
22
- - **human**: `{ id, type: 'human', message, inputType: 'confirm'|'text' }`
22
+ - **human**: `{ id, type: 'human', message, inputType: 'confirm'|'text' }` (Note: 'confirm' returns boolean but automatically fallbacks to text if input is not yes/no)
23
23
  - **sleep**: `{ id, type: 'sleep', duration }`
24
- - **Common Step Fields**: `needs` (array of IDs), `if` (expression), `retry`, `foreach`, `concurrency`.
24
+ - **script**: `{ id, type: 'script', run }` (Executes JS in a secure sandbox)
25
+ - **Common Step Fields**: `needs` (array of IDs), `if` (expression), `retry`, `foreach`, `concurrency`, `transform`.
26
+ - **finally**: Optional array of steps to run at the end of the workflow, regardless of success or failure.
25
27
  - **IMPORTANT**: Steps run in **parallel** by default. To ensure sequential execution, a step must explicitly list the previous step's ID in its `needs` array.
26
28
 
27
29
  ## Agent Schema (.md)
@@ -38,6 +40,13 @@ Markdown files with YAML frontmatter:
38
40
  - `${{ args.paramName }}` (used inside agent tools)
39
41
  - Standard JS-like expressions: `${{ steps.count > 0 ? 'yes' : 'no' }}`
40
42
 
43
+ # Guidelines
44
+ - **User Interaction**: Use `human` steps when user input or approval is needed.
45
+ - **Error Handling**: Use `retry` for flaky operations and `finally` for cleanup (e.g., removing temp files).
46
+ - **Custom Logic**: Use `script` steps for data manipulation that is too complex for expressions.
47
+ - **Agent Collaboration**: Create specialized agents for complex sub-tasks and coordinate them via `llm` steps.
48
+ - **Discovery**: Use `mcpServers` in `llm` steps when the agent needs access to external tools or systems.
49
+
41
50
  # Output Instructions
42
51
  When asked to design a feature:
43
52
  1. Provide the necessary Keystone files (Workflows and Agents).
@@ -62,3 +62,8 @@ steps:
62
62
  type: sleep
63
63
  duration: 100
64
64
  needs: [api_test]
65
+
66
+ finally:
67
+ - id: cleanup
68
+ type: shell
69
+ run: rm /tmp/keystone-test.txt