@barnum/barnum 0.2.3 → 0.3.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.
- 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/cli.cjs +33 -0
- package/dist/all.d.ts +12 -0
- package/dist/all.js +8 -0
- package/dist/ast.d.ts +375 -0
- package/dist/ast.js +381 -0
- package/dist/bind.d.ts +62 -0
- package/dist/bind.js +106 -0
- package/dist/builtins.d.ts +257 -0
- package/dist/builtins.js +600 -0
- package/dist/chain.d.ts +2 -0
- package/dist/chain.js +8 -0
- package/dist/effect-id.d.ts +14 -0
- package/dist/effect-id.js +16 -0
- package/dist/handler.d.ts +50 -0
- package/dist/handler.js +146 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/pipe.d.ts +11 -0
- package/dist/pipe.js +11 -0
- package/dist/race.d.ts +53 -0
- package/dist/race.js +141 -0
- package/dist/recursive.d.ts +34 -0
- package/dist/recursive.js +53 -0
- package/dist/run.d.ts +7 -0
- package/dist/run.js +143 -0
- package/dist/schema.d.ts +8 -0
- package/dist/schema.js +95 -0
- package/dist/try-catch.d.ts +23 -0
- package/dist/try-catch.js +36 -0
- package/dist/worker.d.ts +11 -0
- package/dist/worker.js +46 -0
- package/package.json +40 -16
- package/src/all.ts +89 -0
- package/src/ast.ts +878 -0
- package/src/bind.ts +192 -0
- package/src/builtins.ts +804 -0
- package/src/chain.ts +17 -0
- package/src/effect-id.ts +30 -0
- package/src/handler.ts +279 -0
- package/src/index.ts +30 -0
- package/src/pipe.ts +93 -0
- package/src/race.ts +183 -0
- package/src/recursive.ts +112 -0
- package/src/run.ts +181 -0
- package/src/schema.ts +118 -0
- package/src/try-catch.ts +53 -0
- package/src/worker.ts +56 -0
- package/README.md +0 -19
- package/barnum-config-schema.json +0 -408
- package/cli.js +0 -20
- package/index.js +0 -23
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "ConfigFile",
|
|
4
|
-
"description": "Top-level Barnum configuration file format.\n\nDefines a workflow as a directed graph of steps. Each step processes tasks and can spawn follow-up tasks on other steps.",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": [
|
|
7
|
-
"steps"
|
|
8
|
-
],
|
|
9
|
-
"properties": {
|
|
10
|
-
"$schema": {
|
|
11
|
-
"description": "Optional JSON Schema URL for editor validation (e.g., `\"./node_modules/@barnum/barnum/barnum-config-schema.json\"`). Ignored at runtime.",
|
|
12
|
-
"writeOnly": true,
|
|
13
|
-
"type": [
|
|
14
|
-
"string",
|
|
15
|
-
"null"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"entrypoint": {
|
|
19
|
-
"description": "Name of the step that starts the workflow. When set, the CLI accepts `--entrypoint-value` to provide the initial task value (defaults to `{}`). When omitted, `--initial-state` must provide explicit `[{\"kind\": \"StepName\", \"value\": ...}]` tasks.",
|
|
20
|
-
"default": null,
|
|
21
|
-
"type": [
|
|
22
|
-
"string",
|
|
23
|
-
"null"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"options": {
|
|
27
|
-
"description": "Global runtime options (timeout, retries, concurrency). Individual steps can override these via their own `options` field.",
|
|
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": "The steps that make up this workflow. Each step defines how to process a task and which steps it can spawn follow-up tasks on.",
|
|
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. Set `\"kind\": \"Pool\"` to send tasks to AI agents, or `\"kind\": \"Command\"` to run a local shell script.",
|
|
53
|
-
"oneOf": [
|
|
54
|
-
{
|
|
55
|
-
"description": "Send the task to the agent pool. An AI agent receives the task's `value` along with the `instructions` (markdown prompt) and produces a JSON array of follow-up tasks.",
|
|
56
|
-
"type": "object",
|
|
57
|
-
"required": [
|
|
58
|
-
"instructions",
|
|
59
|
-
"kind"
|
|
60
|
-
],
|
|
61
|
-
"properties": {
|
|
62
|
-
"instructions": {
|
|
63
|
-
"description": "Markdown prompt shown to the agent processing this task. This is the core of what tells the agent what to do. Use `{\"inline\": \"...\"}` to write the markdown directly, or `{\"link\": \"path/to/file.md\"}` to reference an external file.",
|
|
64
|
-
"allOf": [
|
|
65
|
-
{
|
|
66
|
-
"$ref": "#/definitions/MaybeLinked_for_String"
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
"kind": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"enum": [
|
|
73
|
-
"Pool"
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"description": "Run a local shell command instead of sending to an agent. Use this for deterministic transformations, fan-out, or glue logic.",
|
|
80
|
-
"type": "object",
|
|
81
|
-
"required": [
|
|
82
|
-
"kind",
|
|
83
|
-
"script"
|
|
84
|
-
],
|
|
85
|
-
"properties": {
|
|
86
|
-
"kind": {
|
|
87
|
-
"type": "string",
|
|
88
|
-
"enum": [
|
|
89
|
-
"Command"
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
"script": {
|
|
93
|
-
"description": "Shell script to execute.\n\n**Input (stdin):** JSON object: `{\"kind\": \"<step name>\", \"value\": <payload>}`. Use `jq '.value'` to extract the payload, or `jq -r '.value.fieldName'` for a specific field.\n\n**Output (stdout):** JSON array of follow-up tasks to spawn: `[{\"kind\": \"NextStep\", \"value\": {...}}, ...]`. Each `kind` must be a step name listed in this step's `next` array. Return `[]` to spawn no follow-ups.",
|
|
94
|
-
"type": "string"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
"FinallyHook": {
|
|
101
|
-
"description": "Finally hook. Runs after a task and all its descendants complete.\n\nIn JSON: `{\"kind\": \"Command\", \"script\": \"./finally-hook.sh\"}`\n\n**stdin:** The task's original value payload as JSON. **stdout:** JSON array of follow-up tasks: `[{\"kind\": \"StepName\", \"value\": {...}}, ...]`. Return `[]` for no follow-ups.",
|
|
102
|
-
"oneOf": [
|
|
103
|
-
{
|
|
104
|
-
"description": "Run a shell command as the finally hook.",
|
|
105
|
-
"type": "object",
|
|
106
|
-
"required": [
|
|
107
|
-
"kind",
|
|
108
|
-
"script"
|
|
109
|
-
],
|
|
110
|
-
"properties": {
|
|
111
|
-
"kind": {
|
|
112
|
-
"type": "string",
|
|
113
|
-
"enum": [
|
|
114
|
-
"Command"
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
"script": {
|
|
118
|
-
"description": "Shell script to execute. Receives the task's original value as JSON on stdin, must write a JSON array of follow-up tasks on stdout.",
|
|
119
|
-
"type": "string"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
"MaybeLinked_for_String": {
|
|
126
|
-
"description": "Content that can be inline or linked to a file.\n\nIn config files: - `{\"inline\": <value>}` → content provided directly in the config - `{\"link\": \"path\"}` → content loaded from a file (path relative to the config file)",
|
|
127
|
-
"anyOf": [
|
|
128
|
-
{
|
|
129
|
-
"description": "Inline content.",
|
|
130
|
-
"type": "object",
|
|
131
|
-
"required": [
|
|
132
|
-
"inline"
|
|
133
|
-
],
|
|
134
|
-
"properties": {
|
|
135
|
-
"inline": {
|
|
136
|
-
"description": "The content value, provided directly in the config file.",
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"description": "Link to a file whose contents will be loaded at runtime.",
|
|
143
|
-
"type": "object",
|
|
144
|
-
"required": [
|
|
145
|
-
"link"
|
|
146
|
-
],
|
|
147
|
-
"properties": {
|
|
148
|
-
"link": {
|
|
149
|
-
"description": "Relative path to the file (resolved relative to the config file's directory).",
|
|
150
|
-
"type": "string"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
|
-
"Options": {
|
|
157
|
-
"description": "Global runtime options for task execution. All fields have sensible defaults.",
|
|
158
|
-
"type": "object",
|
|
159
|
-
"properties": {
|
|
160
|
-
"max_concurrency": {
|
|
161
|
-
"description": "Maximum concurrent tasks (None = unlimited).",
|
|
162
|
-
"default": null,
|
|
163
|
-
"type": [
|
|
164
|
-
"integer",
|
|
165
|
-
"null"
|
|
166
|
-
],
|
|
167
|
-
"format": "uint",
|
|
168
|
-
"minimum": 0.0
|
|
169
|
-
},
|
|
170
|
-
"max_retries": {
|
|
171
|
-
"description": "Maximum retries per task (default: 0).",
|
|
172
|
-
"default": 0,
|
|
173
|
-
"type": "integer",
|
|
174
|
-
"format": "uint32",
|
|
175
|
-
"minimum": 0.0
|
|
176
|
-
},
|
|
177
|
-
"retry_on_invalid_response": {
|
|
178
|
-
"description": "Whether to retry when agent returns invalid response (default: true).",
|
|
179
|
-
"default": true,
|
|
180
|
-
"type": "boolean"
|
|
181
|
-
},
|
|
182
|
-
"retry_on_timeout": {
|
|
183
|
-
"description": "Whether to retry when agent times out (default: true).",
|
|
184
|
-
"default": true,
|
|
185
|
-
"type": "boolean"
|
|
186
|
-
},
|
|
187
|
-
"timeout": {
|
|
188
|
-
"description": "Timeout in seconds for each task (None = no timeout).",
|
|
189
|
-
"default": null,
|
|
190
|
-
"type": [
|
|
191
|
-
"integer",
|
|
192
|
-
"null"
|
|
193
|
-
],
|
|
194
|
-
"format": "uint64",
|
|
195
|
-
"minimum": 0.0
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
"additionalProperties": false
|
|
199
|
-
},
|
|
200
|
-
"PostHook": {
|
|
201
|
-
"description": "Post-action hook. Inspects or modifies the action's outcome.\n\nIn JSON: `{\"kind\": \"Command\", \"script\": \"./post-hook.sh\"}`\n\n**stdin:** Tagged JSON describing the outcome (`\"kind\": \"Success\"`, `\"Timeout\"`, `\"Error\"`, or `\"PreHookError\"`). On success, includes an `input`, `output`, and `next` (follow-up tasks) field. **stdout:** Same tagged JSON, possibly modified (e.g., filtering `next`).",
|
|
202
|
-
"oneOf": [
|
|
203
|
-
{
|
|
204
|
-
"description": "Run a shell command as the post hook.",
|
|
205
|
-
"type": "object",
|
|
206
|
-
"required": [
|
|
207
|
-
"kind",
|
|
208
|
-
"script"
|
|
209
|
-
],
|
|
210
|
-
"properties": {
|
|
211
|
-
"kind": {
|
|
212
|
-
"type": "string",
|
|
213
|
-
"enum": [
|
|
214
|
-
"Command"
|
|
215
|
-
]
|
|
216
|
-
},
|
|
217
|
-
"script": {
|
|
218
|
-
"description": "Shell script to execute. Receives the action outcome as JSON on stdin, must write the (possibly modified) outcome as JSON on stdout.",
|
|
219
|
-
"type": "string"
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
"PreHook": {
|
|
226
|
-
"description": "Pre-action hook. Transforms the task value before the action runs.\n\nIn JSON: `{\"kind\": \"Command\", \"script\": \"./pre-hook.sh\"}`\n\n**stdin:** Task value payload (e.g., `{\"path\": \"/src\"}`). **stdout:** Modified value payload (same shape).",
|
|
227
|
-
"oneOf": [
|
|
228
|
-
{
|
|
229
|
-
"description": "Run a shell command as the pre hook.",
|
|
230
|
-
"type": "object",
|
|
231
|
-
"required": [
|
|
232
|
-
"kind",
|
|
233
|
-
"script"
|
|
234
|
-
],
|
|
235
|
-
"properties": {
|
|
236
|
-
"kind": {
|
|
237
|
-
"type": "string",
|
|
238
|
-
"enum": [
|
|
239
|
-
"Command"
|
|
240
|
-
]
|
|
241
|
-
},
|
|
242
|
-
"script": {
|
|
243
|
-
"description": "Shell script to execute. Receives the task's value as JSON on stdin, must write the (possibly modified) value as JSON on stdout.",
|
|
244
|
-
"type": "string"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
},
|
|
250
|
-
"SchemaRef": {
|
|
251
|
-
"description": "A JSON Schema for validating task payloads. Can be provided inline or loaded from a file.\n\n- Inline: write the JSON Schema object directly, e.g. `{\"type\": \"object\", \"properties\": {...}}` - Linked: `{\"link\": \"path/to/schema.json\"}` to reference an external file (path relative to config file)",
|
|
252
|
-
"anyOf": [
|
|
253
|
-
{
|
|
254
|
-
"description": "Reference to an external JSON Schema file. The path is relative to the config file's directory.",
|
|
255
|
-
"type": "object",
|
|
256
|
-
"required": [
|
|
257
|
-
"link"
|
|
258
|
-
],
|
|
259
|
-
"properties": {
|
|
260
|
-
"link": {
|
|
261
|
-
"description": "Relative path to the JSON Schema file (e.g., `\"schemas/task.json\"`).",
|
|
262
|
-
"type": "string"
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"description": "Inline JSON Schema object (any valid JSON Schema)."
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
},
|
|
271
|
-
"StepFile": {
|
|
272
|
-
"description": "A named step in the workflow. Steps are the nodes of the task graph.\n\nExecution order for each task: `pre` hook → `action` → `post` hook. The `finally` hook runs after the task **and all of its descendant tasks** complete.",
|
|
273
|
-
"type": "object",
|
|
274
|
-
"required": [
|
|
275
|
-
"action",
|
|
276
|
-
"name"
|
|
277
|
-
],
|
|
278
|
-
"properties": {
|
|
279
|
-
"action": {
|
|
280
|
-
"description": "How this step processes tasks — either send to the agent pool (`Pool`) or run a local shell command (`Command`).",
|
|
281
|
-
"allOf": [
|
|
282
|
-
{
|
|
283
|
-
"$ref": "#/definitions/ActionFile"
|
|
284
|
-
}
|
|
285
|
-
]
|
|
286
|
-
},
|
|
287
|
-
"finally": {
|
|
288
|
-
"description": "Shell script that runs after this task **and all tasks it spawned (recursively)** have completed.\n\n**stdin:** The task's original `value` payload as JSON (same as what the pre hook received — just the value, not the full task wrapper).\n\n**stdout:** A JSON array of follow-up tasks to spawn: `[{\"kind\": \"StepName\", \"value\": {...}}, ...]`. Each `kind` must be a valid step name. Return `[]` to spawn no follow-ups.\n\nUse this for cleanup, aggregation, or spawning a final summarization step after an entire subtree of work completes.",
|
|
289
|
-
"default": null,
|
|
290
|
-
"anyOf": [
|
|
291
|
-
{
|
|
292
|
-
"$ref": "#/definitions/FinallyHook"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"type": "null"
|
|
296
|
-
}
|
|
297
|
-
]
|
|
298
|
-
},
|
|
299
|
-
"name": {
|
|
300
|
-
"description": "Unique name for this step (e.g., `\"Analyze\"`, `\"Implement\"`, `\"Review\"`). This is the string used as `kind` when creating tasks: `{\"kind\": \"ThisStepName\", \"value\": {...}}`.",
|
|
301
|
-
"type": "string"
|
|
302
|
-
},
|
|
303
|
-
"next": {
|
|
304
|
-
"description": "Step names this step is allowed to spawn follow-up tasks on. Each string must match the `name` of another step in this config. An empty array means this is a terminal step (no follow-ups).",
|
|
305
|
-
"default": [],
|
|
306
|
-
"type": "array",
|
|
307
|
-
"items": {
|
|
308
|
-
"type": "string"
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
"options": {
|
|
312
|
-
"description": "Per-step options that override the global `options`. Only the fields you set here take effect; everything else falls through to the global defaults.",
|
|
313
|
-
"default": {
|
|
314
|
-
"max_retries": null,
|
|
315
|
-
"retry_on_invalid_response": null,
|
|
316
|
-
"retry_on_timeout": null,
|
|
317
|
-
"timeout": null
|
|
318
|
-
},
|
|
319
|
-
"allOf": [
|
|
320
|
-
{
|
|
321
|
-
"$ref": "#/definitions/StepOptions"
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
|
-
},
|
|
325
|
-
"post": {
|
|
326
|
-
"description": "Shell script that runs **after** the action completes (or fails).\n\n**stdin:** A tagged JSON object describing the outcome. The `kind` field indicates what happened:\n\n- `{\"kind\": \"Success\", \"input\": <value>, \"output\": <agent_output>, \"next\": [<tasks>]}` — Action succeeded. `next` contains the follow-up tasks to spawn. - `{\"kind\": \"Timeout\", \"input\": <value>}` — Action timed out. - `{\"kind\": \"Error\", \"input\": <value>, \"error\": \"<message>\"}` — Action failed. - `{\"kind\": \"PreHookError\", \"input\": <value>, \"error\": \"<message>\"}` — Pre hook failed.\n\n**stdout:** The same tagged JSON object, possibly modified. Typically you modify the `next` array in `Success` to filter, rewrite, or add follow-up tasks.",
|
|
327
|
-
"default": null,
|
|
328
|
-
"anyOf": [
|
|
329
|
-
{
|
|
330
|
-
"$ref": "#/definitions/PostHook"
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"type": "null"
|
|
334
|
-
}
|
|
335
|
-
]
|
|
336
|
-
},
|
|
337
|
-
"pre": {
|
|
338
|
-
"description": "Shell script that runs **before** the action.\n\n**stdin:** The task's `value` payload as JSON (e.g., `{\"path\": \"/src\"}`). This is just the value — not the full `{\"kind\": ..., \"value\": ...}` wrapper.\n\n**stdout:** The (possibly modified) value payload as JSON. Must be the same shape. The modified value is what the action receives.\n\nUse this to enrich or transform the task before the action sees it (e.g., adding timestamps, resolving paths, fetching metadata).",
|
|
339
|
-
"default": null,
|
|
340
|
-
"anyOf": [
|
|
341
|
-
{
|
|
342
|
-
"$ref": "#/definitions/PreHook"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"type": "null"
|
|
346
|
-
}
|
|
347
|
-
]
|
|
348
|
-
},
|
|
349
|
-
"value_schema": {
|
|
350
|
-
"description": "JSON Schema that validates the `value` payload for tasks on this step. When set, tasks whose `value` doesn't conform are rejected. When omitted, any JSON value is accepted.",
|
|
351
|
-
"default": null,
|
|
352
|
-
"anyOf": [
|
|
353
|
-
{
|
|
354
|
-
"$ref": "#/definitions/SchemaRef"
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
"type": "null"
|
|
358
|
-
}
|
|
359
|
-
]
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
"additionalProperties": false
|
|
363
|
-
},
|
|
364
|
-
"StepOptions": {
|
|
365
|
-
"description": "Per-step option overrides. Only set the fields you want to override; omitted fields inherit from the global `options`.",
|
|
366
|
-
"type": "object",
|
|
367
|
-
"properties": {
|
|
368
|
-
"max_retries": {
|
|
369
|
-
"description": "Maximum retries for tasks on this step (overrides global `max_retries`).",
|
|
370
|
-
"default": null,
|
|
371
|
-
"type": [
|
|
372
|
-
"integer",
|
|
373
|
-
"null"
|
|
374
|
-
],
|
|
375
|
-
"format": "uint32",
|
|
376
|
-
"minimum": 0.0
|
|
377
|
-
},
|
|
378
|
-
"retry_on_invalid_response": {
|
|
379
|
-
"description": "Whether to retry when an agent returns an invalid response on this step (overrides global `retry_on_invalid_response`).",
|
|
380
|
-
"default": null,
|
|
381
|
-
"type": [
|
|
382
|
-
"boolean",
|
|
383
|
-
"null"
|
|
384
|
-
]
|
|
385
|
-
},
|
|
386
|
-
"retry_on_timeout": {
|
|
387
|
-
"description": "Whether to retry when an agent times out on this step (overrides global `retry_on_timeout`).",
|
|
388
|
-
"default": null,
|
|
389
|
-
"type": [
|
|
390
|
-
"boolean",
|
|
391
|
-
"null"
|
|
392
|
-
]
|
|
393
|
-
},
|
|
394
|
-
"timeout": {
|
|
395
|
-
"description": "Timeout in seconds for tasks on this step (overrides global `timeout`).",
|
|
396
|
-
"default": null,
|
|
397
|
-
"type": [
|
|
398
|
-
"integer",
|
|
399
|
-
"null"
|
|
400
|
-
],
|
|
401
|
-
"format": "uint64",
|
|
402
|
-
"minimum": 0.0
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
"additionalProperties": false
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
package/cli.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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;
|