Schemas
@taskbox/schemas
Zod schemas for everything that crosses a Taskbox boundary: the TaskSpec
input, the TaskResult output, the TaskEvent stream, errors, artifacts,
proxy / network configuration, and per-tool inputs (e.g. media.downloadSubtitles).
Every schema is paired with a type alias inferred from it, so the SDK and
the CLI consume the same source of truth as the in-container runner.
- Stability: beta
- Platforms: node, browser
Install
npm i @taskbox/schemasParse a TaskSpec
import { TaskSpecSchema, type TaskSpec } from "@taskbox/schemas";
const spec: TaskSpec = TaskSpecSchema.parse({
tool: "media.downloadSubtitles",
input: { url: "https://youtu.be/jNQXAC9IVRw", languages: ["en"] },
network: { mode: "direct" },
runtime: { backend: "podman" },
});Walk a TaskEvent stream
import { TaskEventSchema, type TaskEvent } from "@taskbox/schemas";
for (const line of jsonl.split("\n").filter(Boolean)) {
const ev: TaskEvent = TaskEventSchema.parse(JSON.parse(line));
if (ev.type === "task.completed") console.log("ok in", ev.durationMs, "ms");
}See API for the full export list.