keystone-cli 2.1.9 → 2.1.10

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": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "A local-first, declarative, agentic workflow orchestrator built on Bun",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,13 +16,7 @@
16
16
  "format": "biome format --write .",
17
17
  "schema:generate": "bun run src/scripts/generate-schemas.ts"
18
18
  },
19
- "keywords": [
20
- "workflow",
21
- "orchestrator",
22
- "agentic",
23
- "automation",
24
- "bun"
25
- ],
19
+ "keywords": ["workflow", "orchestrator", "agentic", "automation", "bun"],
26
20
  "author": "Mark Hingston",
27
21
  "license": "MIT",
28
22
  "repository": {
@@ -30,12 +24,7 @@
30
24
  "url": "https://github.com/mhingston/keystone-cli.git"
31
25
  },
32
26
  "homepage": "https://github.com/mhingston/keystone-cli#readme",
33
- "files": [
34
- "src",
35
- "README.md",
36
- "LICENSE",
37
- "logo.png"
38
- ],
27
+ "files": ["src", "README.md", "LICENSE", "logo.png"],
39
28
  "dependencies": {
40
29
  "@ast-grep/cli": "^0.40.3",
41
30
  "@ast-grep/napi": "^0.40.3",
@@ -269,6 +269,12 @@ export async function executeDynamicStep(
269
269
 
270
270
  return buildFinalResult(state);
271
271
  } catch (error) {
272
+ // Re-throw suspension/waiting errors so the workflow can properly suspend
273
+ if (error instanceof Error) {
274
+ if (error.name === 'WorkflowSuspendedError' || error.name === 'WorkflowWaitingError') {
275
+ throw error;
276
+ }
277
+ }
272
278
  return await handleExecutionError(step, state, dbState, stateManager, options.saveState, error);
273
279
  }
274
280
  }
@@ -324,8 +324,17 @@ export class WorkflowState {
324
324
  try {
325
325
  output = JSON.parse(exec.output);
326
326
  } catch (e) {
327
- /* ignore */
327
+ this.logger.warn(
328
+ `Failed to parse output for step "${stepId}": ${e instanceof Error ? e.message : String(e)}`
329
+ );
330
+ // If parsing fails, try using the raw output
331
+ output = exec.output;
328
332
  }
333
+ } else if (exec.status === 'success') {
334
+ // If step succeeded but has no output, log a warning
335
+ this.logger.warn(
336
+ `Step "${stepId}" completed with status "${exec.status}" but has no output. This may cause issues for dependent steps.`
337
+ );
329
338
  }
330
339
 
331
340
  this.stepContexts.set(stepId, {
@@ -42,14 +42,14 @@ steps:
42
42
  needs: [generate]
43
43
  foreach: ${{ steps.generate.outputs.files.filter(f => f.path.endsWith('.yaml') && f.path.includes('workflows')) }}
44
44
  run: |
45
- echo "${{ item.content }}" | npx tsx src/cli.ts validate --stdin --type workflow
45
+ echo "${{ item.content }}" | bun run src/cli.ts validate --stdin --type workflow
46
46
  allowFailure: true
47
47
  transform: |
48
48
  {
49
49
  path: item.path,
50
50
  content: item.content,
51
- valid: result.exitCode === 0,
52
- error: result.exitCode !== 0 ? result.stderr : null
51
+ valid: exitCode === 0,
52
+ error: exitCode !== 0 ? stderr : null
53
53
  }
54
54
 
55
55
  - id: repair_workflows
@@ -88,10 +88,15 @@ steps:
88
88
  - id: merge_files
89
89
  type: shell
90
90
  needs: [validate_workflows, repair_workflows]
91
+ env:
92
+ GENERATED: ${{ JSON.stringify(steps.generate.outputs.files) }}
93
+ VALIDATED: ${{ JSON.stringify(steps.validate_workflows.output) }}
94
+ REPAIRED: ${{ JSON.stringify(steps.repair_workflows.output) }}
91
95
  run: |
92
- const generated = ${{ JSON.stringify(steps.generate.outputs.files) }};
93
- const validated = ${{ JSON.stringify(steps.validate_workflows.output) }};
94
- const repaired = ${{ JSON.stringify(steps.repair_workflows.output) }};
96
+ bun -e '
97
+ const generated = JSON.parse(process.env.GENERATED || "[]");
98
+ const validated = JSON.parse(process.env.VALIDATED || "[]");
99
+ const repaired = JSON.parse(process.env.REPAIRED || "[]");
95
100
 
96
101
  const repairedMap = new Map();
97
102
  if (Array.isArray(repaired)) {
@@ -110,7 +115,10 @@ steps:
110
115
  return file;
111
116
  });
112
117
 
113
- return { files: final };
118
+ console.log(JSON.stringify({ files: final }));
119
+ '
120
+ transform: |
121
+ JSON.parse(stdout)
114
122
 
115
123
  - id: write_files
116
124
  type: file