@netnodeag/kraftwerk 0.4.1 → 0.6.0

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.
@@ -15,8 +15,8 @@
15
15
  } catch (e) {}
16
16
  })();
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-D6WuziFQ.js"></script>
19
- <link rel="stylesheet" crossorigin href="/assets/index-BCSWkslF.css">
18
+ <script type="module" crossorigin src="/assets/index-CImcmBVs.js"></script>
19
+ <link rel="stylesheet" crossorigin href="/assets/index-BtcPa8nx.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netnodeag/kraftwerk",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Deterministic workflow-as-code framework: agents (persona + model + tools + harness) run in bounded phases on headless CLI harnesses (claude -p, codex exec, pi); code owns the control flow, envelopes + gates judge the results",
5
5
  "keywords": [
6
6
  "agents",
@@ -4,7 +4,11 @@
4
4
  "title": "kraftwerk workflow",
5
5
  "description": "A linear workflow of gated agent steps. Folder form: <name>/workflow.yml, where single-line prompt/persona/workspace values may reference files inside the folder (e.g. prompts/step.md).",
6
6
  "type": "object",
7
- "required": ["name", "description", "steps"],
7
+ "required": [
8
+ "name",
9
+ "description",
10
+ "steps"
11
+ ],
8
12
  "additionalProperties": false,
9
13
  "properties": {
10
14
  "name": {
@@ -22,21 +26,33 @@
22
26
  },
23
27
  "requires": {
24
28
  "type": "array",
25
- "items": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
29
+ "items": {
30
+ "type": "string",
31
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
32
+ },
26
33
  "description": "Environment variables the workflow needs (API tokens etc.). Checked before the run starts; missing variables abort with a clear error instead of failing mid-run."
27
34
  },
28
35
  "mcp": {
29
36
  "type": "object",
30
37
  "description": "MCP servers stored alongside the workflow, keyed by server name. Agents opt in via their mcp: [names] list.",
31
- "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
32
- "additionalProperties": { "$ref": "#/definitions/mcpServer" }
38
+ "propertyNames": {
39
+ "pattern": "^[A-Za-z0-9_-]+$"
40
+ },
41
+ "additionalProperties": {
42
+ "$ref": "#/definitions/mcpServer"
43
+ }
33
44
  },
34
45
  "clis": {
35
46
  "type": "object",
36
47
  "description": "CLIs agents may call via Bash, keyed by command prefix (e.g. git, ddev, npm run) with a one-line usage hint (may be empty). Agents opt in via their clis: [names] list; the hint is injected into the agent's persona once — never repeat it in step prompts. claude scopes its Bash allowlist to Bash(<name>:*); codex runs commands in its sandbox anyway; pi gets the plain bash tool (no scoping).",
37
- "propertyNames": { "pattern": "^[A-Za-z0-9@_.][A-Za-z0-9@_. /-]*$" },
48
+ "propertyNames": {
49
+ "pattern": "^[A-Za-z0-9@_.][A-Za-z0-9@_. /-]*$"
50
+ },
38
51
  "additionalProperties": {
39
- "type": ["string", "null"],
52
+ "type": [
53
+ "string",
54
+ "null"
55
+ ],
40
56
  "description": "One-line usage hint injected into the granting agent's persona; empty/null = name only"
41
57
  }
42
58
  },
@@ -44,19 +60,27 @@
44
60
  "type": "object",
45
61
  "minProperties": 1,
46
62
  "description": "Agent roster: id -> definition",
47
- "additionalProperties": { "$ref": "#/definitions/agent" }
63
+ "additionalProperties": {
64
+ "$ref": "#/definitions/agent"
65
+ }
48
66
  },
49
67
  "steps": {
50
68
  "type": "array",
51
69
  "minItems": 1,
52
70
  "description": "Linear sequence of gated steps: agent steps (agent + prompt) or deterministic script steps (run)",
53
- "items": { "$ref": "#/definitions/step" }
71
+ "items": {
72
+ "$ref": "#/definitions/step"
73
+ }
54
74
  }
55
75
  },
56
76
  "definitions": {
57
77
  "agent": {
58
78
  "type": "object",
59
- "required": ["model", "tools", "persona"],
79
+ "required": [
80
+ "model",
81
+ "tools",
82
+ "persona"
83
+ ],
60
84
  "additionalProperties": false,
61
85
  "properties": {
62
86
  "name": {
@@ -73,16 +97,28 @@
73
97
  "description": "Model id in the harness's naming, e.g. haiku, claude-opus-5, gpt-5.6-sol, deepseek/deepseek-chat"
74
98
  },
75
99
  "effort": {
76
- "enum": ["low", "medium", "high", "xhigh", "max"],
100
+ "enum": [
101
+ "low",
102
+ "medium",
103
+ "high",
104
+ "xhigh",
105
+ "max"
106
+ ],
77
107
  "description": "Reasoning effort; omit for the model default"
78
108
  },
79
109
  "runs-on": {
80
- "enum": ["claude", "codex", "pi"],
110
+ "enum": [
111
+ "claude",
112
+ "codex",
113
+ "pi"
114
+ ],
81
115
  "description": "Harness that executes this agent (default: claude)"
82
116
  },
83
117
  "tools": {
84
118
  "type": "array",
85
- "items": { "type": "string" },
119
+ "items": {
120
+ "type": "string"
121
+ },
86
122
  "description": "Governance: the only tools the agent may use, e.g. [Read, Write, Edit, WebFetch]"
87
123
  },
88
124
  "persona": {
@@ -92,12 +128,18 @@
92
128
  },
93
129
  "mcp": {
94
130
  "type": "array",
95
- "items": { "type": "string", "minLength": 1 },
131
+ "items": {
132
+ "type": "string",
133
+ "minLength": 1
134
+ },
96
135
  "description": "MCP servers this agent may use (names from the top-level mcp map). Governance like tools. Not supported on runs-on: pi."
97
136
  },
98
137
  "clis": {
99
138
  "type": "array",
100
- "items": { "type": "string", "minLength": 1 },
139
+ "items": {
140
+ "type": "string",
141
+ "minLength": 1
142
+ },
101
143
  "description": "CLIs this agent may use (names from the top-level clis map). Their usage hints are injected into the persona; claude additionally scopes the Bash allowlist to these commands."
102
144
  }
103
145
  }
@@ -106,7 +148,9 @@
106
148
  "oneOf": [
107
149
  {
108
150
  "type": "object",
109
- "required": ["command"],
151
+ "required": [
152
+ "command"
153
+ ],
110
154
  "additionalProperties": false,
111
155
  "properties": {
112
156
  "command": {
@@ -116,19 +160,25 @@
116
160
  },
117
161
  "args": {
118
162
  "type": "array",
119
- "items": { "type": "string" },
163
+ "items": {
164
+ "type": "string"
165
+ },
120
166
  "description": "Arguments; an arg that resolves to a file inside the workflow folder is made absolute (e.g. mcp/multiply-server.ts)"
121
167
  },
122
168
  "env": {
123
169
  "type": "object",
124
- "additionalProperties": { "type": "string" },
170
+ "additionalProperties": {
171
+ "type": "string"
172
+ },
125
173
  "description": "Extra environment variables for the server process"
126
174
  }
127
175
  }
128
176
  },
129
177
  {
130
178
  "type": "object",
131
- "required": ["url"],
179
+ "required": [
180
+ "url"
181
+ ],
132
182
  "additionalProperties": false,
133
183
  "properties": {
134
184
  "url": {
@@ -142,13 +192,21 @@
142
192
  },
143
193
  "step": {
144
194
  "oneOf": [
145
- { "$ref": "#/definitions/agentStep" },
146
- { "$ref": "#/definitions/scriptStep" }
195
+ {
196
+ "$ref": "#/definitions/agentStep"
197
+ },
198
+ {
199
+ "$ref": "#/definitions/scriptStep"
200
+ }
147
201
  ]
148
202
  },
149
203
  "agentStep": {
150
204
  "type": "object",
151
- "required": ["name", "agent", "prompt"],
205
+ "required": [
206
+ "name",
207
+ "agent",
208
+ "prompt"
209
+ ],
152
210
  "additionalProperties": false,
153
211
  "properties": {
154
212
  "name": {
@@ -169,13 +227,26 @@
169
227
  "gates": {
170
228
  "type": "array",
171
229
  "description": "Post-execution file checks; failures trigger an in-session correction",
172
- "items": { "$ref": "#/definitions/gate" }
230
+ "items": {
231
+ "$ref": "#/definitions/gate"
232
+ }
233
+ },
234
+ "if": {
235
+ "type": "array",
236
+ "minItems": 1,
237
+ "description": "Deterministic preconditions (same forms as gates) evaluated against the run directory just before the step. If any fails, the step is SKIPPED — not failed — and the run continues with the next step.",
238
+ "items": {
239
+ "$ref": "#/definitions/gate"
240
+ }
173
241
  }
174
242
  }
175
243
  },
176
244
  "scriptStep": {
177
245
  "type": "object",
178
- "required": ["name", "run"],
246
+ "required": [
247
+ "name",
248
+ "run"
249
+ ],
179
250
  "additionalProperties": false,
180
251
  "properties": {
181
252
  "name": {
@@ -191,7 +262,17 @@
191
262
  "gates": {
192
263
  "type": "array",
193
264
  "description": "Post-execution file checks; script steps have no correction loop — a failing gate fails the run (fix the script)",
194
- "items": { "$ref": "#/definitions/gate" }
265
+ "items": {
266
+ "$ref": "#/definitions/gate"
267
+ }
268
+ },
269
+ "if": {
270
+ "type": "array",
271
+ "minItems": 1,
272
+ "description": "Deterministic preconditions (same forms as gates) evaluated against the run directory just before the step. If any fails, the step is SKIPPED — not failed — and the run continues with the next step.",
273
+ "items": {
274
+ "$ref": "#/definitions/gate"
275
+ }
195
276
  }
196
277
  }
197
278
  },
@@ -199,7 +280,9 @@
199
280
  "oneOf": [
200
281
  {
201
282
  "type": "object",
202
- "required": ["file_non_empty"],
283
+ "required": [
284
+ "file_non_empty"
285
+ ],
203
286
  "additionalProperties": false,
204
287
  "properties": {
205
288
  "file_non_empty": {
@@ -211,7 +294,9 @@
211
294
  },
212
295
  {
213
296
  "type": "object",
214
- "required": ["slots_filled"],
297
+ "required": [
298
+ "slots_filled"
299
+ ],
215
300
  "additionalProperties": false,
216
301
  "properties": {
217
302
  "slots_filled": {
@@ -223,20 +308,70 @@
223
308
  },
224
309
  {
225
310
  "type": "object",
226
- "required": ["contains"],
311
+ "required": [
312
+ "contains"
313
+ ],
227
314
  "additionalProperties": false,
228
315
  "properties": {
229
316
  "contains": {
230
317
  "type": "object",
231
- "required": ["file", "text"],
318
+ "required": [
319
+ "file",
320
+ "text"
321
+ ],
232
322
  "additionalProperties": false,
233
323
  "properties": {
234
- "file": { "type": "string", "minLength": 1 },
235
- "text": { "type": "string", "minLength": 1 },
236
- "label": { "type": "string", "description": "Short label used in the gate name; defaults to text" }
324
+ "file": {
325
+ "type": "string",
326
+ "minLength": 1
327
+ },
328
+ "text": {
329
+ "type": "string",
330
+ "minLength": 1
331
+ },
332
+ "label": {
333
+ "type": "string",
334
+ "description": "Short label used in the gate name; defaults to text"
335
+ }
237
336
  }
238
337
  }
239
338
  }
339
+ },
340
+ {
341
+ "type": "object",
342
+ "required": [
343
+ "check"
344
+ ],
345
+ "additionalProperties": false,
346
+ "properties": {
347
+ "check": {
348
+ "oneOf": [
349
+ {
350
+ "type": "string",
351
+ "minLength": 1,
352
+ "description": "Bash validation script executed in the run directory (single-line value = script file inside the workflow folder). Exit 0 = gate passed; non-zero = failed, and everything the script printed becomes the failure message fed into the correction prompt."
353
+ },
354
+ {
355
+ "type": "object",
356
+ "required": [
357
+ "run"
358
+ ],
359
+ "additionalProperties": false,
360
+ "properties": {
361
+ "run": {
362
+ "type": "string",
363
+ "minLength": 1,
364
+ "description": "Bash validation script (single-line value = script file inside the workflow folder)"
365
+ },
366
+ "label": {
367
+ "type": "string",
368
+ "description": "Short label used in the gate name; defaults to the script reference"
369
+ }
370
+ }
371
+ }
372
+ ]
373
+ }
374
+ }
240
375
  }
241
376
  ]
242
377
  }