Taskbox

← Back to module

JSDoc

Functions

redactProxyUrl

function
redactProxyUrl(url: string): string

proxyConfigToSafeJson

function
proxyConfigToSafeJson(p: ProxyConfig): Record<string, unknown>

Types

ProxyConfig

type
type ProxyConfig = { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }

ArtifactKind

type
type ArtifactKind = "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"

Artifact

type
type Artifact = { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }

TaskboxErrorCategory

type
type TaskboxErrorCategory = "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"

TaskboxErrorCode

type
type TaskboxErrorCode = "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"

TaskboxError

type
type TaskboxError = { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }

NetworkConfig

type
type NetworkConfig = { mode?: "none"; } | { mode?: "direct"; } | { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }

RuntimeConfig

type
type RuntimeConfig = { image?: string; backend?: string; }

ResourceConfig

type
type ResourceConfig = { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }

OutputConfig

type
type OutputConfig = { dir?: string; materialize?: boolean; }

TaskSpec

type
type TaskSpec = { id?: string; runtime?: { image?: string; backend?: string; }; network?: { mode?: "none"; } | { mode?: "direct"; } | { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }; tool?: string; input?: unknown; resources?: { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }; output?: { dir?: string; materialize?: boolean; }; }

TaskEvent

type
type TaskEvent = { type?: "task.started"; tool?: string; taskId?: string; ts?: string; } | { type?: "image.prepare.started"; ts?: string; ref?: string; } | { type?: "image.prepare.completed"; ts?: string; ref?: string; digest?: string; } | { type?: "process.started"; ts?: string; argv?: string[]; } | { type?: "process.stdout"; ts?: string; data?: string; } | { type?: "process.stderr"; ts?: string; data?: string; } | { type?: "tool.progress"; message?: string; ts?: string; quality?: "none" | "structured" | "parsed" | "raw"; percent?: number; } | { type?: "artifact.created"; artifact?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }; ts?: string; } | { type?: "task.completed"; ts?: string; durationMs?: number; } | { type?: "task.failed"; ts?: string; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; }

TaskResult

type
type TaskResult = { image?: { ref?: string; digest?: string; }; tool?: string; taskId?: string; durationMs?: number; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; ok?: boolean; engine?: string; engineVersion?: string; startedAt?: string; finishedAt?: string; artifacts?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }[]; metadata?: unknown; warnings?: string[]; diagnostics?: Record<string, unknown>; reproduce?: { command?: string; taskSpecPath?: string; }; }

MediaDownloadSubtitlesInput

type
type MediaDownloadSubtitlesInput = { url?: string; proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; timeoutMs?: number; languages?: string[]; auto?: boolean; format?: "vtt" | "srt" | "ass" | "json3"; outputDir?: string; }

Constants

ProxyConfigSchema

const
const ProxyConfigSchema: z.ZodObject<{ type: z.ZodEnum<["http", "https", "socks5", "socks5h"]>; url: z.ZodString; username: z.ZodOptional<z.ZodString>; password: z.ZodOptional<z.ZodString>; noProxy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }>

ArtifactKindSchema

const
const ArtifactKindSchema: z.ZodEnum<["video", "audio", "subtitle", "thumbnail", "markdown", "text", "html", "image", "pdf", "ebook", "json", "archive", "unknown"]>

ArtifactSchema

const
const ArtifactSchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<["video", "audio", "subtitle", "thumbnail", "markdown", "text", "html", "image", "pdf", "ebook", "json", "archive", "unknown"]>; path: z.ZodString; sandboxPath: z.ZodOptional<z.ZodString>; name: z.ZodString; mediaType: z.ZodOptional<z.ZodString>; sizeBytes: z.ZodOptional<z.ZodNumber>; sha256: z.ZodOptional<z.ZodString>; previewText: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }>

TaskboxErrorCategorySchema

const
const TaskboxErrorCategorySchema: z.ZodEnum<["validation", "runtime", "image", "network", "proxy", "timeout", "resource", "tool", "artifact", "unknown"]>

TaskboxErrorCodeSchema

const
const TaskboxErrorCodeSchema: z.ZodEnum<["E_SCHEMA_INVALID", "E_RUNTIME_UNAVAILABLE", "E_IMAGE_PULL_FAILED", "E_PROXY_INVALID", "E_PROXY_CONNECT_FAILED", "E_NETWORK_FAILED", "E_TIMEOUT", "E_OUTPUT_TOO_LARGE", "E_TOOL_EXIT_NONZERO", "E_ARTIFACT_MISSING", "E_UNSUPPORTED_FORMAT"]>

TaskboxErrorSchema

const
const TaskboxErrorSchema: z.ZodObject<{ code: z.ZodEnum<["E_SCHEMA_INVALID", "E_RUNTIME_UNAVAILABLE", "E_IMAGE_PULL_FAILED", "E_PROXY_INVALID", "E_PROXY_CONNECT_FAILED", "E_NETWORK_FAILED", "E_TIMEOUT", "E_OUTPUT_TOO_LARGE", "E_TOOL_EXIT_NONZERO", "E_ARTIFACT_MISSING", "E_UNSUPPORTED_FORMAT"]>; message: z.ZodString; retryable: z.ZodDefault<z.ZodBoolean>; category: z.ZodEnum<["validation", "runtime", "image", "network", "proxy", "timeout", "resource", "tool", "artifact", "unknown"]>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; stderrTail: z.ZodOptional<z.ZodString>; suggestions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }>

NetworkConfigSchema

const
const NetworkConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{ mode: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { mode?: "none"; }, { mode?: "none"; }>, z.ZodObject<{ mode: z.ZodLiteral<"direct">; }, "strip", z.ZodTypeAny, { mode?: "direct"; }, { mode?: "direct"; }>, z.ZodObject<{ mode: z.ZodLiteral<"proxy">; proxy: z.ZodObject<{ type: z.ZodEnum<["http", "https", "socks5", "socks5h"]>; url: z.ZodString; username: z.ZodOptional<z.ZodString>; password: z.ZodOptional<z.ZodString>; noProxy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }>; }, "strip", z.ZodTypeAny, { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }, { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }>]>

RuntimeConfigSchema

const
const RuntimeConfigSchema: z.ZodObject<{ backend: z.ZodString; image: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { image?: string; backend?: string; }, { image?: string; backend?: string; }>

ResourceConfigSchema

const
const ResourceConfigSchema: z.ZodObject<{ timeoutMs: z.ZodOptional<z.ZodNumber>; memoryMb: z.ZodOptional<z.ZodNumber>; cpus: z.ZodOptional<z.ZodNumber>; maxOutputBytes: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }, { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }>

OutputConfigSchema

const
const OutputConfigSchema: z.ZodObject<{ dir: z.ZodOptional<z.ZodString>; materialize: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { dir?: string; materialize?: boolean; }, { dir?: string; materialize?: boolean; }>

TaskSpecSchema

const
const TaskSpecSchema: z.ZodObject<{ id: z.ZodOptional<z.ZodString>; tool: z.ZodString; input: z.ZodUnknown; runtime: z.ZodOptional<z.ZodObject<{ backend: z.ZodString; image: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { image?: string; backend?: string; }, { image?: string; backend?: string; }>>; network: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{ mode: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { mode?: "none"; }, { mode?: "none"; }>, z.ZodObject<{ mode: z.ZodLiteral<"direct">; }, "strip", z.ZodTypeAny, { mode?: "direct"; }, { mode?: "direct"; }>, z.ZodObject<{ mode: z.ZodLiteral<"proxy">; proxy: z.ZodObject<{ type: z.ZodEnum<["http", "https", "socks5", "socks5h"]>; url: z.ZodString; username: z.ZodOptional<z.ZodString>; password: z.ZodOptional<z.ZodString>; noProxy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }>; }, "strip", z.ZodTypeAny, { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }, { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }>]>; resources: z.ZodOptional<z.ZodObject<{ timeoutMs: z.ZodOptional<z.ZodNumber>; memoryMb: z.ZodOptional<z.ZodNumber>; cpus: z.ZodOptional<z.ZodNumber>; maxOutputBytes: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }, { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }>>; output: z.ZodOptional<z.ZodObject<{ dir: z.ZodOptional<z.ZodString>; materialize: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { dir?: string; materialize?: boolean; }, { dir?: string; materialize?: boolean; }>>; }, "strip", z.ZodTypeAny, { id?: string; runtime?: { image?: string; backend?: string; }; network?: { mode?: "none"; } | { mode?: "direct"; } | { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }; tool?: string; input?: unknown; resources?: { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }; output?: { dir?: string; materialize?: boolean; }; }, { id?: string; runtime?: { image?: string; backend?: string; }; network?: { mode?: "none"; } | { mode?: "direct"; } | { proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; mode?: "proxy"; }; tool?: string; input?: unknown; resources?: { timeoutMs?: number; memoryMb?: number; cpus?: number; maxOutputBytes?: number; }; output?: { dir?: string; materialize?: boolean; }; }>

TaskEventSchema

const
const TaskEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"task.started">; taskId: z.ZodString; tool: z.ZodString; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "task.started"; tool?: string; taskId?: string; ts?: string; }, { type?: "task.started"; tool?: string; taskId?: string; ts?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"image.prepare.started">; ref: z.ZodString; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "image.prepare.started"; ts?: string; ref?: string; }, { type?: "image.prepare.started"; ts?: string; ref?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"image.prepare.completed">; ref: z.ZodString; digest: z.ZodOptional<z.ZodString>; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "image.prepare.completed"; ts?: string; ref?: string; digest?: string; }, { type?: "image.prepare.completed"; ts?: string; ref?: string; digest?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"process.started">; argv: z.ZodArray<z.ZodString, "many">; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "process.started"; ts?: string; argv?: string[]; }, { type?: "process.started"; ts?: string; argv?: string[]; }>, z.ZodObject<{ type: z.ZodLiteral<"process.stdout">; data: z.ZodString; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "process.stdout"; ts?: string; data?: string; }, { type?: "process.stdout"; ts?: string; data?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"process.stderr">; data: z.ZodString; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "process.stderr"; ts?: string; data?: string; }, { type?: "process.stderr"; ts?: string; data?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"tool.progress">; quality: z.ZodEnum<["structured", "parsed", "raw", "none"]>; percent: z.ZodOptional<z.ZodNumber>; message: z.ZodOptional<z.ZodString>; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "tool.progress"; message?: string; ts?: string; quality?: "none" | "structured" | "parsed" | "raw"; percent?: number; }, { type?: "tool.progress"; message?: string; ts?: string; quality?: "none" | "structured" | "parsed" | "raw"; percent?: number; }>, z.ZodObject<{ type: z.ZodLiteral<"artifact.created">; artifact: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<["video", "audio", "subtitle", "thumbnail", "markdown", "text", "html", "image", "pdf", "ebook", "json", "archive", "unknown"]>; path: z.ZodString; sandboxPath: z.ZodOptional<z.ZodString>; name: z.ZodString; mediaType: z.ZodOptional<z.ZodString>; sizeBytes: z.ZodOptional<z.ZodNumber>; sha256: z.ZodOptional<z.ZodString>; previewText: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }>; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "artifact.created"; artifact?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }; ts?: string; }, { type?: "artifact.created"; artifact?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }; ts?: string; }>, z.ZodObject<{ type: z.ZodLiteral<"task.completed">; durationMs: z.ZodNumber; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "task.completed"; ts?: string; durationMs?: number; }, { type?: "task.completed"; ts?: string; durationMs?: number; }>, z.ZodObject<{ type: z.ZodLiteral<"task.failed">; error: z.ZodObject<{ code: z.ZodEnum<["E_SCHEMA_INVALID", "E_RUNTIME_UNAVAILABLE", "E_IMAGE_PULL_FAILED", "E_PROXY_INVALID", "E_PROXY_CONNECT_FAILED", "E_NETWORK_FAILED", "E_TIMEOUT", "E_OUTPUT_TOO_LARGE", "E_TOOL_EXIT_NONZERO", "E_ARTIFACT_MISSING", "E_UNSUPPORTED_FORMAT"]>; message: z.ZodString; retryable: z.ZodDefault<z.ZodBoolean>; category: z.ZodEnum<["validation", "runtime", "image", "network", "proxy", "timeout", "resource", "tool", "artifact", "unknown"]>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; stderrTail: z.ZodOptional<z.ZodString>; suggestions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }>; ts: z.ZodString; }, "strip", z.ZodTypeAny, { type?: "task.failed"; ts?: string; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; }, { type?: "task.failed"; ts?: string; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; }>]>

TaskResultSchema

const
const TaskResultSchema: z.ZodObject<{ ok: z.ZodBoolean; taskId: z.ZodString; tool: z.ZodString; engine: z.ZodOptional<z.ZodString>; engineVersion: z.ZodOptional<z.ZodString>; image: z.ZodObject<{ ref: z.ZodString; digest: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { ref?: string; digest?: string; }, { ref?: string; digest?: string; }>; startedAt: z.ZodString; finishedAt: z.ZodString; durationMs: z.ZodNumber; artifacts: z.ZodArray<z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<["video", "audio", "subtitle", "thumbnail", "markdown", "text", "html", "image", "pdf", "ebook", "json", "archive", "unknown"]>; path: z.ZodString; sandboxPath: z.ZodOptional<z.ZodString>; name: z.ZodString; mediaType: z.ZodOptional<z.ZodString>; sizeBytes: z.ZodOptional<z.ZodNumber>; sha256: z.ZodOptional<z.ZodString>; previewText: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }, { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }>, "many">; metadata: z.ZodOptional<z.ZodUnknown>; warnings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; diagnostics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; reproduce: z.ZodOptional<z.ZodObject<{ command: z.ZodOptional<z.ZodString>; taskSpecPath: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { command?: string; taskSpecPath?: string; }, { command?: string; taskSpecPath?: string; }>>; error: z.ZodOptional<z.ZodObject<{ code: z.ZodEnum<["E_SCHEMA_INVALID", "E_RUNTIME_UNAVAILABLE", "E_IMAGE_PULL_FAILED", "E_PROXY_INVALID", "E_PROXY_CONNECT_FAILED", "E_NETWORK_FAILED", "E_TIMEOUT", "E_OUTPUT_TOO_LARGE", "E_TOOL_EXIT_NONZERO", "E_ARTIFACT_MISSING", "E_UNSUPPORTED_FORMAT"]>; message: z.ZodString; retryable: z.ZodDefault<z.ZodBoolean>; category: z.ZodEnum<["validation", "runtime", "image", "network", "proxy", "timeout", "resource", "tool", "artifact", "unknown"]>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; stderrTail: z.ZodOptional<z.ZodString>; suggestions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }, { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }>>; }, "strip", z.ZodTypeAny, { image?: { ref?: string; digest?: string; }; tool?: string; taskId?: string; durationMs?: number; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; ok?: boolean; engine?: string; engineVersion?: string; startedAt?: string; finishedAt?: string; artifacts?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }[]; metadata?: unknown; warnings?: string[]; diagnostics?: Record<string, unknown>; reproduce?: { command?: string; taskSpecPath?: string; }; }, { image?: { ref?: string; digest?: string; }; tool?: string; taskId?: string; durationMs?: number; error?: { code?: "E_SCHEMA_INVALID" | "E_RUNTIME_UNAVAILABLE" | "E_IMAGE_PULL_FAILED" | "E_PROXY_INVALID" | "E_PROXY_CONNECT_FAILED" | "E_NETWORK_FAILED" | "E_TIMEOUT" | "E_OUTPUT_TOO_LARGE" | "E_TOOL_EXIT_NONZERO" | "E_ARTIFACT_MISSING" | "E_UNSUPPORTED_FORMAT"; message?: string; retryable?: boolean; category?: "validation" | "unknown" | "image" | "runtime" | "network" | "proxy" | "timeout" | "resource" | "tool" | "artifact"; details?: Record<string, unknown>; stderrTail?: string; suggestions?: string[]; }; ok?: boolean; engine?: string; engineVersion?: string; startedAt?: string; finishedAt?: string; artifacts?: { path?: string; id?: string; kind?: "unknown" | "video" | "audio" | "subtitle" | "thumbnail" | "markdown" | "text" | "html" | "image" | "pdf" | "ebook" | "json" | "archive"; sandboxPath?: string; name?: string; mediaType?: string; sizeBytes?: number; sha256?: string; previewText?: string; }[]; metadata?: unknown; warnings?: string[]; diagnostics?: Record<string, unknown>; reproduce?: { command?: string; taskSpecPath?: string; }; }>

MediaDownloadSubtitlesInputSchema

const
const MediaDownloadSubtitlesInputSchema: z.ZodObject<{ url: z.ZodString; languages: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; auto: z.ZodDefault<z.ZodBoolean>; format: z.ZodDefault<z.ZodEnum<["vtt", "srt", "ass", "json3"]>>; proxy: z.ZodOptional<z.ZodObject<{ type: z.ZodEnum<["http", "https", "socks5", "socks5h"]>; url: z.ZodString; username: z.ZodOptional<z.ZodString>; password: z.ZodOptional<z.ZodString>; noProxy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }, { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }>>; outputDir: z.ZodOptional<z.ZodString>; timeoutMs: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { url?: string; proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; timeoutMs?: number; languages?: string[]; auto?: boolean; format?: "vtt" | "srt" | "ass" | "json3"; outputDir?: string; }, { url?: string; proxy?: { type?: "http" | "https" | "socks5" | "socks5h"; url?: string; username?: string; password?: string; noProxy?: string[]; }; timeoutMs?: number; languages?: string[]; auto?: boolean; format?: "vtt" | "srt" | "ass" | "json3"; outputDir?: string; }>