npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@robota-sdk/agent-provider-bytedance

v3.0.0-beta.100

Published

Bytedance (ModelArk) video generation provider for Robota SDK

Readme

@robota-sdk/agent-provider-bytedance

ByteDance (ModelArk) video generation provider for the Robota SDK. BytedanceProvider implements the IVideoGenerationProvider contract from @robota-sdk/agent-core: it creates a video generation task, reads its status, and cancels it, over a small built-in HTTP client (fetch, no vendor SDK). It is a media provider, not a chat provider, so it is used directly rather than passed to a ConversationAgent agent's aiProviders.

Installation

npm install @robota-sdk/agent-provider-bytedance @robota-sdk/agent-core

Usage

import { BytedanceProvider } from '@robota-sdk/agent-provider-bytedance';

const provider = new BytedanceProvider({
  apiKey: process.env.SEEDANCE_API_KEY ?? '',
  baseUrl: process.env.SEEDANCE_BASE_URL ?? '', // your ModelArk API base URL
});

const created = await provider.createVideo({
  model: 'seedance-2.0',
  prompt: 'A paper boat drifting down a rainy street',
});
if (!created.ok) throw new Error(created.error.message);

const snapshot = await provider.getVideoJob(created.value.jobId);
if (snapshot.ok && snapshot.value.status === 'succeeded') {
  console.log(snapshot.value.output?.uri);
}

// Stop a job that is still running.
await provider.cancelVideoJob(created.value.jobId);

The provider has three methods: createVideo(request) starts a task, getVideoJob(jobId) reads its current state, and cancelVideoJob(jobId) cancels it. getVideoJob and cancelVideoJob both return a job snapshot whose status is normalized to queued, running, succeeded, failed or cancelled. A failed snapshot carries the vendor's error message in error when the API sends one.

durationSeconds and aspectRatio are forwarded as the task's duration and ratio. A request may include inputImages (inline base64 or URI); they are sent to the task as image content alongside the prompt. A request with seed is rejected as invalid.

Options

new BytedanceProvider(options: IBytedanceProviderOptions).

| Option | Type | Description | | ----------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------ | | apiKey | string | Sent as Authorization: Bearer <apiKey> (required). | | baseUrl | string | API base URL that task paths are appended to (required). | | createVideoPath | string | Task creation path (default /contents/generations/tasks). | | getVideoTaskPathTemplate | string | Task lookup path; {taskId} is replaced (default /contents/generations/tasks/{taskId}). | | cancelVideoTaskPathTemplate | string | Task cancellation path; {taskId} is replaced (default /contents/generations/tasks/{taskId}). | | cancelVideoTaskMethod | 'POST' \| 'DELETE' | HTTP method for cancellation (default 'DELETE'). | | timeoutMs | number | Per-request timeout in milliseconds (default 60000). | | defaultHeaders | Record<string, string> | Extra headers added to every request. |

Errors

Every method returns a result object ({ ok: true, value } or { ok: false, error }) instead of throwing. error.code is normalized, and error.status holds the HTTP status when the failure was an HTTP response:

| code | When | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | | PROVIDER_INVALID_REQUEST | The request fails a local check (empty prompt, model, job id or input image; seed set), or the API answers with another 4xx status. | | PROVIDER_AUTH_ERROR | HTTP 401 or 403. | | PROVIDER_JOB_NOT_FOUND | HTTP 404. | | PROVIDER_JOB_NOT_CANCELLABLE | HTTP 409: the job's current state does not allow cancellation. | | PROVIDER_RATE_LIMITED | HTTP 429. | | PROVIDER_TIMEOUT | No response within timeoutMs. | | PROVIDER_UPSTREAM_ERROR | HTTP 5xx, a network failure, or a response the provider cannot read (not JSON, no task id, an unknown status). |

Related packages

See docs/SPEC.md for the package contract.

License

This package is dual-licensed under the GNU AGPL-3.0 or a commercial license. See LICENSING.md.