@barnum/barnum 0.0.0-main-2c283b26 → 0.0.0-main-bca0b910
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/barnum-cli-schema.zod.ts +68 -0
- package/index.ts +1 -0
- package/package.json +10 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const SchemaType = z.union([
|
|
4
|
+
z.literal("zod").describe("Zod TypeScript schema."),
|
|
5
|
+
z.literal("json").describe("JSON Schema."),
|
|
6
|
+
]).describe("Output format for `barnum config schema`.");
|
|
7
|
+
|
|
8
|
+
const ConfigCommand = z.discriminatedUnion("kind", [
|
|
9
|
+
z.object({
|
|
10
|
+
config: z.string().describe("Config (JSON string or path to file)"),
|
|
11
|
+
kind: z.literal("Docs"),
|
|
12
|
+
}).describe("Generate markdown documentation from config"),
|
|
13
|
+
z.object({
|
|
14
|
+
config: z.string().describe("Config (JSON string or path to file)"),
|
|
15
|
+
kind: z.literal("Validate"),
|
|
16
|
+
}).describe("Validate a config file"),
|
|
17
|
+
z.object({
|
|
18
|
+
config: z.string().describe("Config (JSON string or path to file)"),
|
|
19
|
+
kind: z.literal("Graph"),
|
|
20
|
+
}).describe("Generate DOT visualization of config (for `GraphViz`)"),
|
|
21
|
+
z.object({
|
|
22
|
+
kind: z.literal("Schema"),
|
|
23
|
+
schemaType: SchemaType.describe("Output format: zod (default) or json"),
|
|
24
|
+
}).describe("Print the config schema (Zod by default, JSON with --type json)"),
|
|
25
|
+
]).describe("Subcommands for `barnum config`.");
|
|
26
|
+
|
|
27
|
+
const Command = z.discriminatedUnion("kind", [
|
|
28
|
+
z.object({
|
|
29
|
+
config: z.string().nullable().optional().describe("Config (JSON string or path to file). Required unless `--resume-from` is used."),
|
|
30
|
+
entrypointValue: z.string().nullable().optional().describe("Initial value for the entrypoint step (JSON string or path to file). Only valid when config has an `entrypoint`. Defaults to `{}` if not provided."),
|
|
31
|
+
initialState: z.string().nullable().optional().describe("Initial tasks (JSON string or path to file). Required if config has no `entrypoint`. Cannot be used with `--entrypoint-value`."),
|
|
32
|
+
kind: z.literal("Run"),
|
|
33
|
+
logFile: z.string().nullable().optional().describe("Log file path (logs emitted in addition to stderr)"),
|
|
34
|
+
pool: z.string().nullable().optional().describe("Agent pool ID (e.g., `abc123` resolves to `<root>/pools/abc123/`). Defaults to `default`."),
|
|
35
|
+
resumeFrom: z.string().nullable().optional().describe("Resume from a previous state log file. Incompatible with `--config`, `--initial-state`, and `--entrypoint-value`."),
|
|
36
|
+
stateLog: z.string().nullable().optional().describe("State log file path (NDJSON file for persistence/resume)"),
|
|
37
|
+
wake: z.string().nullable().optional().describe("Wake script to call before starting"),
|
|
38
|
+
}).describe("Run the task queue"),
|
|
39
|
+
z.object({
|
|
40
|
+
command: ConfigCommand.describe("Config subcommand to run."),
|
|
41
|
+
kind: z.literal("Config"),
|
|
42
|
+
}).describe("Config file operations (docs, validate, graph, schema)"),
|
|
43
|
+
z.object({
|
|
44
|
+
json: z.boolean().describe("Output as JSON (for programmatic access)"),
|
|
45
|
+
kind: z.literal("Version"),
|
|
46
|
+
}).describe("Print version information"),
|
|
47
|
+
]).describe("Barnum subcommands.");
|
|
48
|
+
|
|
49
|
+
const LogLevel = z.union([
|
|
50
|
+
z.literal("off").describe("No logging"),
|
|
51
|
+
z.literal("error").describe("Error messages only"),
|
|
52
|
+
z.literal("warn").describe("Warnings and errors"),
|
|
53
|
+
z.literal("info").describe("Informational messages (default)"),
|
|
54
|
+
z.literal("debug").describe("Debug messages (includes task return values)"),
|
|
55
|
+
z.literal("trace").describe("Trace messages (very verbose)"),
|
|
56
|
+
]).describe("Log level for barnum output.");
|
|
57
|
+
|
|
58
|
+
export const cliSchema = z.object({
|
|
59
|
+
command: Command.describe("Subcommand to run."),
|
|
60
|
+
logLevel: LogLevel.describe("Log level (debug shows task return values)"),
|
|
61
|
+
root: z.string().nullable().optional().describe("Root directory. Pools live in `<root>/pools/<id>/`. Defaults to `/tmp/troupe` on Unix."),
|
|
62
|
+
}).describe("Top-level CLI arguments for barnum.");
|
|
63
|
+
|
|
64
|
+
export type Cli = z.infer<typeof cliSchema>;
|
|
65
|
+
export type SchemaType = z.infer<typeof SchemaType>;
|
|
66
|
+
export type ConfigCommand = z.infer<typeof ConfigCommand>;
|
|
67
|
+
export type Command = z.infer<typeof Command>;
|
|
68
|
+
export type LogLevel = z.infer<typeof LogLevel>;
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barnum/barnum",
|
|
3
|
-
"version": "0.0.0-main-
|
|
3
|
+
"version": "0.0.0-main-bca0b910",
|
|
4
4
|
"description": "Barnum CLI - workflow engine for agents.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.ts",
|
|
9
9
|
"./schema": "./barnum-config-schema.zod.ts",
|
|
10
|
+
"./cli-schema": "./barnum-cli-schema.zod.ts",
|
|
10
11
|
"./binary": "./index.js"
|
|
11
12
|
},
|
|
12
13
|
"bin": {
|
|
@@ -35,10 +36,17 @@
|
|
|
35
36
|
"cli.js",
|
|
36
37
|
"artifacts/**/*",
|
|
37
38
|
"barnum-config-schema.json",
|
|
38
|
-
"barnum-config-schema.zod.ts"
|
|
39
|
+
"barnum-config-schema.zod.ts",
|
|
40
|
+
"barnum-cli-schema.zod.ts"
|
|
39
41
|
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
44
|
+
},
|
|
40
45
|
"dependencies": {
|
|
41
46
|
"zod": "^3.0.0"
|
|
42
47
|
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"typescript": "^5.9.3"
|
|
50
|
+
},
|
|
43
51
|
"sideEffects": false
|
|
44
52
|
}
|