@barnum/barnum 0.0.0-main-0b45c5f4
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/README.md +19 -0
- package/artifacts/linux-arm64/barnum +0 -0
- package/artifacts/linux-x64/barnum +0 -0
- package/artifacts/macos-arm64/barnum +0 -0
- package/artifacts/macos-x64/barnum +0 -0
- package/artifacts/win-x64/barnum.exe +0 -0
- package/barnum-config-schema.json +328 -0
- package/cli.js +20 -0
- package/index.js +23 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @barnum/barnum
|
|
2
|
+
|
|
3
|
+
Barnum CLI - workflow engine for agents.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @barnum/barnum
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
barnum --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## About
|
|
18
|
+
|
|
19
|
+
Barnum is a task automation tool that orchestrates AI agents to execute multi-step workflows defined in configuration files.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "ConfigFile",
|
|
4
|
+
"description": "Top-level Barnum configuration file format.\n\nThis is the raw parsed format. Call `resolve()` to get the runtime `Config`.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"steps"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": {
|
|
11
|
+
"description": "JSON Schema reference for editor validation (ignored at runtime).",
|
|
12
|
+
"writeOnly": true,
|
|
13
|
+
"type": [
|
|
14
|
+
"string",
|
|
15
|
+
"null"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"entrypoint": {
|
|
19
|
+
"description": "Entry point step name. If specified, the workflow starts with this step and `--entrypoint-value` can be used to provide the initial value (defaults to `{}`). If not specified, `--initial-state` must be provided on the command line.",
|
|
20
|
+
"default": null,
|
|
21
|
+
"type": [
|
|
22
|
+
"string",
|
|
23
|
+
"null"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"options": {
|
|
27
|
+
"description": "Runtime options.",
|
|
28
|
+
"default": {
|
|
29
|
+
"max_concurrency": null,
|
|
30
|
+
"max_retries": 0,
|
|
31
|
+
"retry_on_invalid_response": true,
|
|
32
|
+
"retry_on_timeout": true,
|
|
33
|
+
"timeout": null
|
|
34
|
+
},
|
|
35
|
+
"allOf": [
|
|
36
|
+
{
|
|
37
|
+
"$ref": "#/definitions/Options"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"steps": {
|
|
42
|
+
"description": "Step definitions forming the task queue.",
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"$ref": "#/definitions/StepFile"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"definitions": {
|
|
51
|
+
"ActionFile": {
|
|
52
|
+
"description": "How a step processes tasks (config file format).",
|
|
53
|
+
"oneOf": [
|
|
54
|
+
{
|
|
55
|
+
"description": "Send to the agent pool for processing.",
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": [
|
|
58
|
+
"kind"
|
|
59
|
+
],
|
|
60
|
+
"properties": {
|
|
61
|
+
"instructions": {
|
|
62
|
+
"description": "Markdown instructions shown to agents.",
|
|
63
|
+
"default": {
|
|
64
|
+
"inline": ""
|
|
65
|
+
},
|
|
66
|
+
"allOf": [
|
|
67
|
+
{
|
|
68
|
+
"$ref": "#/definitions/MaybeLinked_for_String"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"kind": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": [
|
|
75
|
+
"Pool"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"description": "Run a local command.",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"required": [
|
|
84
|
+
"kind",
|
|
85
|
+
"script"
|
|
86
|
+
],
|
|
87
|
+
"properties": {
|
|
88
|
+
"kind": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": [
|
|
91
|
+
"Command"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"script": {
|
|
95
|
+
"description": "Shell script to execute.\n\n**Input (stdin):** JSON object with the structure `{\"kind\": \"<step name>\", \"value\": <parameters>}`. Use `jq '.value'` to extract parameters or `jq -r '.value.fieldName'` for specific fields.\n\n**Output (stdout):** JSON array of next tasks, e.g. `[{\"kind\": \"NextStep\", \"value\": {...}}]`. Return `[]` to spawn no follow-up tasks.",
|
|
96
|
+
"type": "string"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"MaybeLinked_for_String": {
|
|
103
|
+
"description": "Content that can be inline or linked to a file.\n\nIn config files: - `{\"inline\": <value>}` → inline content - `{\"link\": \"path\"}` → link to file",
|
|
104
|
+
"anyOf": [
|
|
105
|
+
{
|
|
106
|
+
"description": "Inline content.",
|
|
107
|
+
"type": "object",
|
|
108
|
+
"required": [
|
|
109
|
+
"inline"
|
|
110
|
+
],
|
|
111
|
+
"properties": {
|
|
112
|
+
"inline": {
|
|
113
|
+
"description": "The inline content.",
|
|
114
|
+
"type": "string"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"description": "Link to a file.",
|
|
120
|
+
"type": "object",
|
|
121
|
+
"required": [
|
|
122
|
+
"link"
|
|
123
|
+
],
|
|
124
|
+
"properties": {
|
|
125
|
+
"link": {
|
|
126
|
+
"description": "Path to the file.",
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"Options": {
|
|
134
|
+
"description": "Runtime options for task execution.",
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {
|
|
137
|
+
"max_concurrency": {
|
|
138
|
+
"description": "Maximum concurrent tasks (None = unlimited).",
|
|
139
|
+
"default": null,
|
|
140
|
+
"type": [
|
|
141
|
+
"integer",
|
|
142
|
+
"null"
|
|
143
|
+
],
|
|
144
|
+
"format": "uint",
|
|
145
|
+
"minimum": 0.0
|
|
146
|
+
},
|
|
147
|
+
"max_retries": {
|
|
148
|
+
"description": "Maximum retries per task (default: 0).",
|
|
149
|
+
"default": 0,
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"format": "uint32",
|
|
152
|
+
"minimum": 0.0
|
|
153
|
+
},
|
|
154
|
+
"retry_on_invalid_response": {
|
|
155
|
+
"description": "Whether to retry when agent returns invalid response (default: true).",
|
|
156
|
+
"default": true,
|
|
157
|
+
"type": "boolean"
|
|
158
|
+
},
|
|
159
|
+
"retry_on_timeout": {
|
|
160
|
+
"description": "Whether to retry when agent times out (default: true).",
|
|
161
|
+
"default": true,
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
},
|
|
164
|
+
"timeout": {
|
|
165
|
+
"description": "Timeout in seconds for each task (None = no timeout).",
|
|
166
|
+
"default": null,
|
|
167
|
+
"type": [
|
|
168
|
+
"integer",
|
|
169
|
+
"null"
|
|
170
|
+
],
|
|
171
|
+
"format": "uint64",
|
|
172
|
+
"minimum": 0.0
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": false
|
|
176
|
+
},
|
|
177
|
+
"SchemaRef": {
|
|
178
|
+
"description": "Reference to a JSON Schema (inline or external file).\n\nIn config files: - `{\"link\": \"path\"}` → link to schema file - Object → inline JSON Schema",
|
|
179
|
+
"anyOf": [
|
|
180
|
+
{
|
|
181
|
+
"description": "Link to a JSON Schema file.",
|
|
182
|
+
"type": "object",
|
|
183
|
+
"required": [
|
|
184
|
+
"link"
|
|
185
|
+
],
|
|
186
|
+
"properties": {
|
|
187
|
+
"link": {
|
|
188
|
+
"description": "Path to the schema file.",
|
|
189
|
+
"type": "string"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"description": "Inline JSON Schema."
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"StepFile": {
|
|
199
|
+
"description": "A step in the config file (may have unresolved references).",
|
|
200
|
+
"type": "object",
|
|
201
|
+
"required": [
|
|
202
|
+
"name"
|
|
203
|
+
],
|
|
204
|
+
"properties": {
|
|
205
|
+
"action": {
|
|
206
|
+
"description": "How to execute the step.",
|
|
207
|
+
"default": {
|
|
208
|
+
"instructions": {
|
|
209
|
+
"inline": ""
|
|
210
|
+
},
|
|
211
|
+
"kind": "Pool"
|
|
212
|
+
},
|
|
213
|
+
"allOf": [
|
|
214
|
+
{
|
|
215
|
+
"$ref": "#/definitions/ActionFile"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"finally": {
|
|
220
|
+
"description": "Finally hook (runs after all children complete).",
|
|
221
|
+
"default": null,
|
|
222
|
+
"type": [
|
|
223
|
+
"string",
|
|
224
|
+
"null"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"name": {
|
|
228
|
+
"description": "Step name (e.g., `Analyze`, `Implement`).",
|
|
229
|
+
"type": "string"
|
|
230
|
+
},
|
|
231
|
+
"next": {
|
|
232
|
+
"description": "Valid next steps.",
|
|
233
|
+
"default": [],
|
|
234
|
+
"type": "array",
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "string"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"options": {
|
|
240
|
+
"description": "Per-step options that override global options.",
|
|
241
|
+
"default": {
|
|
242
|
+
"max_retries": null,
|
|
243
|
+
"retry_on_invalid_response": null,
|
|
244
|
+
"retry_on_timeout": null,
|
|
245
|
+
"timeout": null
|
|
246
|
+
},
|
|
247
|
+
"allOf": [
|
|
248
|
+
{
|
|
249
|
+
"$ref": "#/definitions/StepOptions"
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
"post": {
|
|
254
|
+
"description": "Post-execution hook script.",
|
|
255
|
+
"default": null,
|
|
256
|
+
"type": [
|
|
257
|
+
"string",
|
|
258
|
+
"null"
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"pre": {
|
|
262
|
+
"description": "Pre-execution hook script.",
|
|
263
|
+
"default": null,
|
|
264
|
+
"type": [
|
|
265
|
+
"string",
|
|
266
|
+
"null"
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
"value_schema": {
|
|
270
|
+
"description": "JSON Schema for validating the step's value payload. None means any JSON value is accepted.",
|
|
271
|
+
"default": null,
|
|
272
|
+
"anyOf": [
|
|
273
|
+
{
|
|
274
|
+
"$ref": "#/definitions/SchemaRef"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"type": "null"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"additionalProperties": false
|
|
283
|
+
},
|
|
284
|
+
"StepOptions": {
|
|
285
|
+
"description": "Per-step options that override global defaults.",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"properties": {
|
|
288
|
+
"max_retries": {
|
|
289
|
+
"description": "Maximum retries for this step (overrides global).",
|
|
290
|
+
"default": null,
|
|
291
|
+
"type": [
|
|
292
|
+
"integer",
|
|
293
|
+
"null"
|
|
294
|
+
],
|
|
295
|
+
"format": "uint32",
|
|
296
|
+
"minimum": 0.0
|
|
297
|
+
},
|
|
298
|
+
"retry_on_invalid_response": {
|
|
299
|
+
"description": "Whether to retry on invalid response for this step (overrides global).",
|
|
300
|
+
"default": null,
|
|
301
|
+
"type": [
|
|
302
|
+
"boolean",
|
|
303
|
+
"null"
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
"retry_on_timeout": {
|
|
307
|
+
"description": "Whether to retry on timeout for this step (overrides global).",
|
|
308
|
+
"default": null,
|
|
309
|
+
"type": [
|
|
310
|
+
"boolean",
|
|
311
|
+
"null"
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"timeout": {
|
|
315
|
+
"description": "Timeout in seconds for this step (overrides global).",
|
|
316
|
+
"default": null,
|
|
317
|
+
"type": [
|
|
318
|
+
"integer",
|
|
319
|
+
"null"
|
|
320
|
+
],
|
|
321
|
+
"format": "uint64",
|
|
322
|
+
"minimum": 0.0
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"additionalProperties": false
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
package/cli.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var bin = require('.');
|
|
5
|
+
var spawn = require('child_process').spawn;
|
|
6
|
+
var chmodSync = require('fs').chmodSync;
|
|
7
|
+
|
|
8
|
+
var input = process.argv.slice(2);
|
|
9
|
+
|
|
10
|
+
if (bin != null) {
|
|
11
|
+
try {
|
|
12
|
+
chmodSync(bin, 0o755);
|
|
13
|
+
} catch {}
|
|
14
|
+
|
|
15
|
+
spawn(bin, input, { stdio: 'inherit' }).on('exit', process.exit);
|
|
16
|
+
} else {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`Platform "${process.platform} (${process.arch})" not supported.`
|
|
19
|
+
);
|
|
20
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
let binary;
|
|
6
|
+
|
|
7
|
+
if (process.platform === 'darwin' && process.arch === 'x64') {
|
|
8
|
+
binary = path.join(__dirname, 'artifacts', 'macos-x64', 'barnum');
|
|
9
|
+
} else if (process.platform === 'darwin' && process.arch === 'arm64') {
|
|
10
|
+
binary = path.join(__dirname, 'artifacts', 'macos-arm64', 'barnum');
|
|
11
|
+
} else if (process.platform === 'linux' && process.arch === 'x64') {
|
|
12
|
+
binary = path.join(__dirname, 'artifacts', 'linux-x64', 'barnum');
|
|
13
|
+
} else if (process.platform === 'linux' && process.arch === 'arm64') {
|
|
14
|
+
binary = path.join(__dirname, 'artifacts', 'linux-arm64', 'barnum');
|
|
15
|
+
} else if (process.platform === 'win32' && process.arch === 'x64') {
|
|
16
|
+
binary = path.join(__dirname, 'artifacts', 'win-x64', 'barnum.exe');
|
|
17
|
+
} else {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`Platform "${process.platform} (${process.arch})" not supported.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = binary;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@barnum/barnum",
|
|
3
|
+
"version": "0.0.0-main-0b45c5f4",
|
|
4
|
+
"description": "Barnum CLI - workflow engine for agents.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"barnum": "cli.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "Robert Balicki",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/barnum-circus/barnum.git"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public",
|
|
17
|
+
"registry": "https://registry.npmjs.org"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"barnum",
|
|
21
|
+
"ai",
|
|
22
|
+
"agents",
|
|
23
|
+
"automation",
|
|
24
|
+
"cli"
|
|
25
|
+
],
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"cli.js",
|
|
29
|
+
"artifacts/**/*",
|
|
30
|
+
"barnum-config-schema.json"
|
|
31
|
+
],
|
|
32
|
+
"sideEffects": false
|
|
33
|
+
}
|