@acedatacloud/sdk 2026.809.0 → 2026.811.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/sdk",
3
- "version": "2026.809.0",
3
+ "version": "2026.811.0",
4
4
  "description": "Official TypeScript SDK for AceDataCloud — AI-powered data services",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -6,37 +6,45 @@
6
6
  */
7
7
 
8
8
  import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
9
10
 
10
11
 
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
11
19
  export interface MaestroGenerateOptions {
12
20
  /** Natural-language brief describing the video to produce (the topic, what to show, tone, audience). The agent decides the script, visuals, voiceover and edit. */
13
21
  prompt: string;
14
- /** Output languages, e.g. ["zh-cn", "en"]. The first is the primary language; each additional one reuses the visuals with a localized voiceover + render and is billed +6 credits. */
22
+ /** Production action. Lite supports generate/edit; Standard adds remix; Pro adds extend. remix/edit/extend require `ref_task_id`. */
23
+ action?: "generate" | "remix" | "edit" | "extend";
24
+ /** Required when `action` is remix / edit / extend: the task_id of the previous video to start from. */
25
+ refTaskId?: string;
26
+ /** Optional reference media (image / video / audio URLs) the agent can use — e.g. a product shot or logo to feature, footage to caption. */
27
+ fileUrls?: string[];
28
+ /** Output languages. Lite supports 1, Standard up to 2, and Pro up to 4. The first is primary; each additional delivered language is billed +6 credits. */
15
29
  langs?: string[];
30
+ /** Required output aspect ratio. Lite renders 720p/24fps; Standard and Pro render 1080p/30fps. */
31
+ aspect?: "9:16" | "16:9" | "1:1";
32
+ /** Target video length in seconds. Lite: 5–30; Standard: 5–120; Pro: 5–300. Successful jobs are billed by actual delivered duration, never above the requested duration. */
33
+ duration?: number;
34
+ /** Production SKU. `lite` = fast 720p short video at 0.20 credits/s (up to 30s); `standard` = balanced 1080p at 0.60 credits/s (up to 120s); `pro` = advanced production at 1.20 credits/s (up to 300s). Default: standard. */
35
+ quality?: "lite" | "standard" | "pro";
36
+ /** Production route. Lite supports auto/narrated/captions; Standard adds avatar; Pro adds drama. `captions` requires source video in `file_urls`; `avatar` requires a portrait. avatar bills at 1.15× and drama at 1.35×. */
37
+ scenario?: "auto" | "narrated" | "captions" | "avatar" | "drama";
16
38
  /** Optional visual-style preset — expressed through typography, palette, motion, image treatment and pacing. Orthogonal to `scenario` (it does NOT change routing). `auto` (default) lets the director pick; every other value adopts a real named look: `cinematic` = dark film-noir (black + blood-red, Oswald); `glass` = Apple / iOS-26 frosted liquid glass; `luxury` = timeless near-black + indigo, huge whitespace; `swiss` = precise grid + electric blue + oversized numerals; `modern` = clean light SaaS; `editorial` = cream magazine + serif; `warm` = intimate cream + amber; `vibrant` = festive folk colour; `neon` = electric neon glow; `mono` = grayscale, type-led; `pastel` = soft candy pastels; `bold` = huge poster type; `industrial` = raw glitch + rust; `futuristic` = particle glow. A freeform string is also accepted as a soft hint. */
17
39
  style?: "auto" | "cinematic" | "glass" | "luxury" | "swiss" | "modern" | "editorial" | "warm" | "vibrant" | "neon" | "mono" | "pastel" | "bold" | "industrial" | "futuristic" | "retro";
18
40
  /** Optional narration voice — the **timbre** of the voiceover, independent of language. `auto` (default) lets the director pick a fitting voice. Every preset is cross-lingual: the same voice speaks whatever language(s) you set in `langs`, so choose purely by character — `warm-female`, `bright-female`, `anchor-female`, `clean-female`, `calm-male`, `deep-male`, `documentary-male`, `energetic-male`, `storyteller-male`. Advanced: a raw 32-character Fish `reference_id` is also accepted. For `drama` / `avatar` this sets the primary / narrator timbre; distinct characters may still get their own. */
19
41
  voice?: "auto" | "warm-female" | "bright-female" | "anchor-female" | "clean-female" | "calm-male" | "deep-male" | "documentary-male" | "energetic-male" | "storyteller-male";
20
- /** generate = a new video. remix / edit / extend = iterate on a previous video (require `ref_task_id`). */
21
- action?: "generate" | "remix" | "edit" | "extend";
22
- /** Output aspect ratio (hint — the agent may follow the prompt). */
23
- aspect?: "9:16" | "16:9" | "1:1";
24
- /** Production tier, a multiplier on the duration-based price. `draft` = a fast rough cut for previewing the idea (~0.5× the standard credits); `standard` = balanced (default, 1×); `premium` = richer, more detailed and polished (~2× the standard credits). Affects turnaround, detail and price. */
25
- quality?: "draft" | "standard" | "premium";
26
- /** Target video length in seconds (1–600, i.e. up to 10 minutes). Billed by duration: credits ≈ 0.85 × duration × quality multiplier × scenario multiplier, so a longer or video-native workflow costs proportionally more. */
27
- duration?: number;
28
- /** How to route the video — a hint; the AI director still decides the final structure. `auto` (default) = the director chooses from your brief. `narrated` = multi-scene narrated video with real photos + voiceover + data cards (people / brands / explainers / history / products). `drama` = acted short drama with characters + dialogue (短剧) and bills at 1.35×. `avatar` = talking-head / digital human (needs a portrait image via `file_urls`, or a chosen digital human) and bills at 1.15×. `motion` = abstract kinetic-typography / data / logo motion graphic. `slideshow` = presentation deck / pitch. Legacy values `general` / `explainer` / `product` / `website` / `changelog` / `captions` are still accepted (mapped to `auto`), and `slides` maps to `slideshow`. */
29
- scenario?: "auto" | "narrated" | "drama" | "avatar" | "motion" | "slideshow";
30
- /** Optional reference media (image / video / audio URLs) the agent can use — e.g. a product shot or logo to feature, footage to caption. */
31
- fileUrls?: string[];
32
- /** Required when `action` is remix / edit / extend: the task_id of the previous video to start from. */
33
- refTaskId?: string;
34
- callbackUrl?: string;
35
- /** Any parameter added upstream before the SDK is regenerated. */
36
- [key: string]: unknown;
37
- }
38
-
39
- export interface MaestroEstimatesOptions {
42
+ /** Submit asynchronously and poll. Defaults to true. */
43
+ async?: boolean;
44
+ /** Wait for completion before returning the handle. */
45
+ wait?: boolean;
46
+ pollInterval?: number;
47
+ maxWait?: number;
40
48
  callbackUrl?: string;
41
49
  /** Any parameter added upstream before the SDK is regenerated. */
42
50
  [key: string]: unknown;
@@ -46,39 +54,33 @@ export interface MaestroEstimatesOptions {
46
54
  export class Maestro {
47
55
  constructor(private transport: Transport) {}
48
56
 
49
- /** Maestro Video Generation API */
50
- async generate(options: MaestroGenerateOptions): Promise<Record<string, unknown>> {
57
+ /** Call /maestro/videos. */
58
+ async generate(options: MaestroGenerateOptions): Promise<TaskHandle> {
51
59
  const body: Record<string, unknown> = {};
52
60
  body["prompt"] = options.prompt;
53
- body["langs"] = options.langs ?? ["zh-cn"];
54
- body["style"] = options.style ?? "auto";
55
- body["voice"] = options.voice ?? "auto";
56
61
  body["action"] = options.action ?? "generate";
62
+ if (options.refTaskId !== undefined) body["ref_task_id"] = options.refTaskId;
63
+ if (options.fileUrls !== undefined) body["file_urls"] = options.fileUrls;
64
+ body["langs"] = options.langs ?? ["zh-cn"];
57
65
  body["aspect"] = options.aspect ?? "9:16";
58
- body["quality"] = options.quality ?? "standard";
59
66
  body["duration"] = options.duration ?? 30;
67
+ body["quality"] = options.quality ?? "standard";
60
68
  body["scenario"] = options.scenario ?? "auto";
61
- if (options.fileUrls !== undefined) body["file_urls"] = options.fileUrls;
62
- if (options.refTaskId !== undefined) body["ref_task_id"] = options.refTaskId;
69
+ body["style"] = options.style ?? "auto";
70
+ body["voice"] = options.voice ?? "auto";
63
71
  for (const [key, value] of Object.entries(options)) {
64
72
  if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "quality", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== undefined) {
65
73
  body[key] = value;
66
74
  }
67
75
  }
68
76
  if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
69
- return (await this.transport.request('POST', "/maestro/videos", { json: body })) as Record<string, unknown>;
70
- }
71
-
72
- /** Call /maestro/estimates. */
73
- async estimates(options: MaestroEstimatesOptions = {}): Promise<Record<string, unknown>> {
74
- const body: Record<string, unknown> = {};
75
- for (const [key, value] of Object.entries(options)) {
76
- if (!["async", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== undefined) {
77
- body[key] = value;
78
- }
77
+ body.async = options.async ?? true;
78
+ const result = (await this.transport.request('POST', "/maestro/videos", { json: body })) as Record<string, unknown>;
79
+ const handle = new TaskHandle(taskId(result), "/maestro/tasks", this.transport, result);
80
+ if (options.wait) {
81
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
79
82
  }
80
- if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
81
- return (await this.transport.request('POST', "/maestro/estimates", { json: body })) as Record<string, unknown>;
83
+ return handle;
82
84
  }
83
85
 
84
86
  }
@@ -23,8 +23,8 @@ export interface SeedreamGenerateOptions {
23
23
  prompt: string;
24
24
  /** Generate a random seed for image generation. The supported range is [-1, 2147483647], with a default value of `-1`. **Only `doubao-seedream-3.0-t2i` supports this parameter** (according to the official Volcengine documentation), other models do not accept this parameter. */
25
25
  seed?: number;
26
- /** Generate image dimensions or aspect ratios. Supports preset options (`1K`/`2K`/`3K`/`4K`), `adaptive` (adaptive reference image size), or explicit `<width>x<height>` format (e.g., `1024x1024`). **Different models support different preset options**: `doubao-seedream-5.0-pro` supports `1K`/`2K`; `doubao-seedream-5.0-lite` supports `2K`/`3K`/`4K`; `doubao-seedream-4.5` only supports `2K`/`4K`; `doubao-seedream-4.0` supports `1K`/`2K`/`4K`; `doubao-seedream-3.0-t2i` and `doubao-seedream-3.0-i2i` **do not support** any preset options and must receive explicit `<width>x<height>` values. */
27
- size?: "1K" | "2K" | "3K" | "4K" | "adaptive";
26
+ /** Generate image dimensions or aspect ratios. Supports preset options (`1K`/`2K`/`3K`/`4K`), or explicit `<width>x<height>` format (e.g., `1024x1024`). **Different models support different preset options**: `doubao-seedream-5.0-pro` supports `1K`/`2K`; `doubao-seedream-5.0-lite` supports `2K`/`3K`/`4K`; `doubao-seedream-4.5` only supports `2K`/`4K`; `doubao-seedream-4.0` supports `1K`/`2K`/`4K`; `doubao-seedream-3.0-t2i` and `doubao-seedream-3.0-i2i` **do not support** any preset options and must receive explicit `<width>x<height>` values. */
27
+ size?: "1K" | "2K" | "3K" | "4K";
28
28
  /** Reference image links for image editing are required, supporting accessible http/https URLs, or base64 encoded image strings in the format `data:image/png;base64,iVBORw0KG...`. Each image must not exceed 10MB in size. This parameter is mandatory when using image-to-image models (such as `doubao-seededit-3.0-i2i`). */
29
29
  image?: string[];
30
30
  /** List of tools that can be called by the model. Currently, only `web_search` is supported. Applicable only to `doubao-seedream-5.0-lite`. */
@@ -66,7 +66,7 @@ export class Seedream {
66
66
  body["model"] = options.model;
67
67
  body["prompt"] = options.prompt;
68
68
  if (options.seed !== undefined) body["seed"] = options.seed;
69
- body["size"] = options.size ?? "2K";
69
+ if (options.size !== undefined) body["size"] = options.size;
70
70
  if (options.image !== undefined) body["image"] = options.image;
71
71
  if (options.tools !== undefined) body["tools"] = options.tools;
72
72
  if (options.stream !== undefined) body["stream"] = options.stream;