Taskbox
Tools

@taskbox/tools

The high-level SDK. createTaskbox({ runtime }) returns a small façade with named methods per tool. Each method validates its tool-specific input via @taskbox/schemas, fills in network/runtime/resource defaults, then hands off to @taskbox/core's runTask. Today the catalog is small — media.downloadSubtitles — but the same pattern applies to anything wired into the kitchen-sink image.

  • Stability: beta
  • Platforms: node

Install

npm i @taskbox/tools @taskbox/podman

Create a taskbox

import { createTaskbox } from "@taskbox/tools";
import { podman } from "@taskbox/podman";

const tbx = createTaskbox({
  runtime: podman({ pullPolicy: "if-missing" }),
  defaults: { timeoutMs: 60_000, networkMode: "direct" },
});

const health = await tbx.prepare();
console.log(health.runtime, health.image.ref);

Download subtitles

const result = await tbx.media.downloadSubtitles(
  {
    url: "https://youtu.be/jNQXAC9IVRw",
    languages: ["en"],
    format: "vtt",
    auto: true,
    outputDir: "/tmp/subs",
  },
  { onEvent: (e) => console.log(e.type) },
);

if (result.ok) {
  for (const a of result.artifacts) console.log(a.kind, a.path);
}

See API for the full export list.

On this page