@tanstack/ai-byteplus 0.1.0 → 0.1.2

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.
@@ -393,6 +393,18 @@ function supportsStructuredOutput(model) {
393
393
  * All supported Seedance video model identifiers.
394
394
  */
395
395
  var BYTEPLUS_VIDEO_MODELS = [
396
+ {
397
+ name: "dreamina-seedance-2-5-260628",
398
+ supports: {
399
+ input: [
400
+ "text",
401
+ "image",
402
+ "video",
403
+ "audio"
404
+ ],
405
+ output: ["video", "audio"]
406
+ }
407
+ }.name,
396
408
  {
397
409
  name: "dreamina-seedance-2-0-260128",
398
410
  supports: {
@@ -465,6 +477,13 @@ function isKnownBytePlusVideoModel(model) {
465
477
  * Runtime duration table backing `availableDurations()` / `snapDuration()`.
466
478
  */
467
479
  var BYTEPLUS_VIDEO_DURATIONS = {
480
+ "dreamina-seedance-2-5-260628": {
481
+ kind: "range",
482
+ min: 4,
483
+ max: 30,
484
+ step: 1,
485
+ unit: "seconds"
486
+ },
468
487
  "dreamina-seedance-2-0-260128": {
469
488
  kind: "range",
470
489
  min: 4,
@@ -512,15 +531,15 @@ var BYTEPLUS_VIDEO_DURATIONS = {
512
531
  * Duration hint for a model this package has no table for.
513
532
  *
514
533
  * Spans every range Seedance has shipped so far (2s on the 1.0 models through
515
- * 15s on the 2.0 family) so `availableDurations()` can still drive a UI. It is
534
+ * 30s on Seedance 2.5) so `availableDurations()` can still drive a UI. It is
516
535
  * a hint, not a contract: the adapter does **not** snap an unknown model's
517
- * duration against it, because clamping a future model's legitimate 20-second
518
- * request down to 15 would corrupt the request rather than protect it.
536
+ * duration against it, because clamping a future model's legitimate longer
537
+ * request down to 30 would corrupt the request rather than protect it.
519
538
  */
520
539
  var BYTEPLUS_VIDEO_FALLBACK_DURATIONS = {
521
540
  kind: "range",
522
541
  min: 2,
523
- max: 15,
542
+ max: 30,
524
543
  step: 1,
525
544
  unit: "seconds"
526
545
  };
@@ -1 +1 @@
1
- {"version":3,"file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["/**\n * BytePlus ModelArk model metadata.\n *\n * Every Ark model id in this file — chat, video and image — was verified live\n * against `https://ark.ap-southeast.bytepluses.com/api/v3` on 2026-07-31. The\n * two Seed Speech ids are the exception: they live on the voice host, which\n * needs a separate key that was not available, so they are docs-derived.\n * Capability metadata is a mix of probed and docs-derived facts; anything not\n * confirmed against the live API is annotated as such at its declaration.\n * BytePlus\n * deactivates model ids aggressively (the whole `seedance-1-0-lite-*` family,\n * `seed-1-6-lite-*`, `seedream-3-0-*`, and the `doubao-`/`skylark-` names are\n * all 404s internationally), so only dated, probe-confirmed ids are shipped.\n *\n * Prefix rules, also probe-confirmed:\n * - `dola-seed-2-1-turbo-260628` and `dola-seedream-5-0-pro-260628` are the\n * canonical ids; the bare forms resolve as aliases but the API echoes the\n * prefixed id back.\n * - The Seedance 2.0 family *requires* the `dreamina-` prefix.\n * - Older models reject the `dola-` prefix outright.\n */\nimport type { DurationOptions } from '@tanstack/ai/adapters'\nimport type { BytePlusTextProviderOptions } from './text/text-provider-options'\n\n/**\n * BytePlus exposes no server-side provider tools (no hosted web search, code\n * interpreter, …) on the international Ark endpoint, so every chat model\n * advertises an empty tool set. Typing it as `never` makes passing another\n * provider's `ProviderTool` to a BytePlus adapter a compile-time error.\n */\nexport type BytePlusProviderToolKind = never\n\n/**\n * Internal metadata structure describing a BytePlus model.\n */\ninterface ModelMeta {\n name: string\n supports: {\n input: ReadonlyArray<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: ReadonlyArray<'text' | 'image' | 'audio' | 'video'>\n capabilities?: ReadonlyArray<\n 'reasoning' | 'tool_calling' | 'structured_outputs'\n >\n tools?: ReadonlyArray<BytePlusProviderToolKind>\n }\n context_window?: number\n max_input_tokens?: number\n max_output_tokens?: number\n}\n\n// ============================================================================\n// Chat models (Seed / GLM / DeepSeek / gpt-oss on Ark)\n// ============================================================================\n\nconst DOLA_SEED_2_1_TURBO = {\n name: 'dola-seed-2-1-turbo-260628',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 256_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_LITE_260428 = {\n name: 'seed-2-0-lite-260428',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_MINI_260428 = {\n name: 'seed-2-0-mini-260428',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_PRO_260328 = {\n name: 'seed-2-0-pro-260328',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n // Live-probed 2026-07-31: accepts json_schema, despite the docs table\n // saying otherwise.\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_LITE_260228 = {\n name: 'seed-2-0-lite-260228',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_MINI_260215 = {\n name: 'seed-2-0-mini-260215',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_CODE_PREVIEW_260328 = {\n name: 'seed-2-0-code-preview-260328',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_8_251228 = {\n name: 'seed-1-8-251228',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 64_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_250915 = {\n name: 'seed-1-6-250915',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_250615 = {\n name: 'seed-1-6-250615',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_FLASH_250715 = {\n name: 'seed-1-6-flash-250715',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_FLASH_250615 = {\n name: 'seed-1-6-flash-250615',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst GLM_5_2_260617 = {\n name: 'glm-5-2-260617',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Live-probed 2026-07-31: accepts json_schema, despite the docs table\n // saying otherwise.\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst GLM_4_7_251222 = {\n name: 'glm-4-7-251222',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Adherence-probed 2026-07-31: ACCEPTS a json_schema with 200 but ignores\n // it and answers in prose, so it is not a structured-output model. A\n // status-code-only probe reads this as support — see the note on\n // BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst DEEPSEEK_V4_PRO_260425 = {\n name: 'deepseek-v4-pro-260425',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 384_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst DEEPSEEK_V4_FLASH_260425 = {\n name: 'deepseek-v4-flash-260425',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 384_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n// The one model on Ark that defaults to `thinking: disabled`.\nconst DEEPSEEK_V3_2_251201 = {\n name: 'deepseek-v3-2-251201',\n context_window: 128_000,\n max_input_tokens: 128_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n// The only model accepting `thinking: {type: 'auto'}`. Tool calling is\n// undocumented on Ark and unverified, so it is not advertised.\nconst GPT_OSS_120B_250805 = {\n name: 'gpt-oss-120b-250805',\n context_window: 128_000,\n max_input_tokens: 96_000,\n max_output_tokens: 64_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported BytePlus chat model identifiers.\n */\nexport const BYTEPLUS_CHAT_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_LITE_260428.name,\n SEED_2_0_MINI_260428.name,\n SEED_2_0_PRO_260328.name,\n SEED_2_0_LITE_260228.name,\n SEED_2_0_MINI_260215.name,\n SEED_2_0_CODE_PREVIEW_260328.name,\n SEED_1_8_251228.name,\n SEED_1_6_250915.name,\n SEED_1_6_250615.name,\n SEED_1_6_FLASH_250715.name,\n SEED_1_6_FLASH_250615.name,\n GLM_5_2_260617.name,\n GLM_4_7_251222.name,\n DEEPSEEK_V4_PRO_260425.name,\n DEEPSEEK_V4_FLASH_260425.name,\n DEEPSEEK_V3_2_251201.name,\n GPT_OSS_120B_250805.name,\n] as const\n\n/**\n * Union of all supported BytePlus chat model names.\n */\nexport type BytePlusChatModel = (typeof BYTEPLUS_CHAT_MODELS)[number]\n\n/**\n * Chat models that emit a `encrypted_content` blob alongside\n * `reasoning_content` when thinking is enabled (\"thinking summary\" models).\n *\n * The blob is an opaque signature over the reasoning trace: when it is\n * present it must be echoed back verbatim on the assistant message in the\n * next turn. Live probing showed omitting it did *not* fail a simple tool\n * round-trip, so adapters preserve and replay it when present but must never\n * treat its absence as an error.\n */\nexport const BYTEPLUS_THINKING_SUMMARY_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_LITE_260428.name,\n SEED_2_0_MINI_260428.name,\n SEED_2_0_PRO_260328.name,\n] as const\n\n/**\n * Union of chat models that emit `encrypted_content`.\n */\nexport type BytePlusThinkingSummaryModel =\n (typeof BYTEPLUS_THINKING_SUMMARY_MODELS)[number]\n\nconst THINKING_SUMMARY_MODEL_SET: ReadonlySet<string> = new Set(\n BYTEPLUS_THINKING_SUMMARY_MODELS,\n)\n\n/**\n * True when the model emits `encrypted_content` that should be round-tripped\n * on subsequent turns.\n */\nexport function emitsEncryptedContent(model: string): boolean {\n return THINKING_SUMMARY_MODEL_SET.has(model)\n}\n\n/**\n * Chat models that accept `response_format: {type: 'json_schema'}`.\n *\n * Live-probed against all 18 chat models on 2026-07-31, not docs-derived — the\n * BytePlus capability tables are wrong here in both directions.\n *\n * Membership needs TWO things, because the API has both failure modes:\n * 1. The request is accepted. Seven models (`seed-2-0-lite-260428`,\n * `seed-2-0-mini-260428`, `seed-2-0-code-preview-260328`, both\n * `deepseek-v4-*`, `deepseek-v3-2-251201`, `gpt-oss-120b-250805`) answer a\n * JSON schema with 400 InvalidParameter — and reject\n * `{type: 'json_object'}` too, so there is no JSON-mode fallback.\n * 2. The schema is actually honoured. `glm-4-7-251222` accepts the request\n * with 200 and then ignores the schema, answering in prose (reproduced\n * twice by the adherence probe). A status-code-only probe wrongly reads\n * that as support, so it is excluded.\n *\n * Models that fail either check need tool-shaped extraction instead.\n *\n * Note that the default chat model `seed-2-0-lite-260428` is one of the\n * rejecting models: structured-output work needs `seed-2-0-lite-260228` or\n * `dola-seed-2-1-turbo-260628`.\n */\nexport const BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_PRO_260328.name,\n SEED_2_0_LITE_260228.name,\n SEED_2_0_MINI_260215.name,\n SEED_1_8_251228.name,\n SEED_1_6_250915.name,\n SEED_1_6_250615.name,\n SEED_1_6_FLASH_250715.name,\n SEED_1_6_FLASH_250615.name,\n GLM_5_2_260617.name,\n] as const\n\nconst STRUCTURED_OUTPUT_MODEL_SET: ReadonlySet<string> = new Set(\n BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS,\n)\n\n/**\n * True when the model supports native JSON-schema structured output.\n */\nexport function supportsStructuredOutput(model: string): boolean {\n return STRUCTURED_OUTPUT_MODEL_SET.has(model)\n}\n\n/**\n * Type-only map from chat model name to whether it supports native\n * JSON-schema structured output.\n */\nexport type BytePlusChatModelStructuredOutputByName = {\n [K in BytePlusChatModel]: K extends BytePlusStructuredOutputChatModel\n ? true\n : false\n}\n\n/**\n * Union of chat models supporting native JSON-schema structured output.\n */\nexport type BytePlusStructuredOutputChatModel =\n (typeof BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS)[number]\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * Used for type inference when constructing multimodal messages.\n */\nexport type BytePlusModelInputModalitiesByName = {\n [DOLA_SEED_2_1_TURBO.name]: typeof DOLA_SEED_2_1_TURBO.supports.input\n [SEED_2_0_LITE_260428.name]: typeof SEED_2_0_LITE_260428.supports.input\n [SEED_2_0_MINI_260428.name]: typeof SEED_2_0_MINI_260428.supports.input\n [SEED_2_0_PRO_260328.name]: typeof SEED_2_0_PRO_260328.supports.input\n [SEED_2_0_LITE_260228.name]: typeof SEED_2_0_LITE_260228.supports.input\n [SEED_2_0_MINI_260215.name]: typeof SEED_2_0_MINI_260215.supports.input\n [SEED_2_0_CODE_PREVIEW_260328.name]: typeof SEED_2_0_CODE_PREVIEW_260328.supports.input\n [SEED_1_8_251228.name]: typeof SEED_1_8_251228.supports.input\n [SEED_1_6_250915.name]: typeof SEED_1_6_250915.supports.input\n [SEED_1_6_250615.name]: typeof SEED_1_6_250615.supports.input\n [SEED_1_6_FLASH_250715.name]: typeof SEED_1_6_FLASH_250715.supports.input\n [SEED_1_6_FLASH_250615.name]: typeof SEED_1_6_FLASH_250615.supports.input\n [GLM_5_2_260617.name]: typeof GLM_5_2_260617.supports.input\n [GLM_4_7_251222.name]: typeof GLM_4_7_251222.supports.input\n [DEEPSEEK_V4_PRO_260425.name]: typeof DEEPSEEK_V4_PRO_260425.supports.input\n [DEEPSEEK_V4_FLASH_260425.name]: typeof DEEPSEEK_V4_FLASH_260425.supports.input\n [DEEPSEEK_V3_2_251201.name]: typeof DEEPSEEK_V3_2_251201.supports.input\n [GPT_OSS_120B_250805.name]: typeof GPT_OSS_120B_250805.supports.input\n}\n\n/**\n * Type-only map from chat model name to its supported provider tools.\n * BytePlus exposes no provider-tool factories, so every model gets an empty\n * tuple — passing another provider's tool is then a compile-time error.\n */\nexport type BytePlusChatModelToolCapabilitiesByName = {\n [K in BytePlusChatModel]: ReadonlyArray<BytePlusProviderToolKind>\n}\n\n/**\n * Type-only map from chat model name to its provider options type.\n */\nexport type BytePlusChatModelProviderOptionsByName = {\n [K in BytePlusChatModel]: BytePlusTextProviderOptions\n}\n\n// ============================================================================\n// Video models (Seedance, async task API)\n// ============================================================================\n\n/**\n * Output aspect ratios accepted by the Seedance task API. `adaptive` is only\n * meaningful for image-to-video, where the ratio follows the input frame.\n */\nexport type BytePlusVideoRatio =\n | '16:9'\n | '9:16'\n | '4:3'\n | '3:4'\n | '1:1'\n | '21:9'\n | 'adaptive'\n\n/**\n * Resolution tiers accepted by the Seedance task API.\n *\n * All four are probe-verified per model (2026-07-31). Two findings contradict\n * the BytePlus prose docs: there is **no 2K tier on any Seedance model** —\n * `2k`/`2K` is rejected everywhere, including on the 2.0 flagship documented\n * as reaching 4K — and `4k` exists only on `dreamina-seedance-2-0-260128`.\n *\n * The API matches this field case-insensitively (`4K`, `4k` and `1080P` are\n * all accepted), so this package standardizes on the lowercase spelling.\n */\nexport type BytePlusVideoResolution = '480p' | '720p' | '1080p' | '4k'\n\n/**\n * Generic `size` template for Seedance models: either a bare aspect ratio\n * (\"16:9\") or `ratio_resolution` (\"16:9_720p\"). The Seedance API takes the\n * two as separate `ratio` / `resolution` fields; the adapter splits this\n * template back apart.\n */\nexport type BytePlusVideoSize<\n TResolution extends BytePlusVideoResolution = BytePlusVideoResolution,\n> = BytePlusVideoRatio | `${BytePlusVideoRatio}_${TResolution}`\n\n// The Seedance 2.0 family's `audio` input modality is docs-derived, not\n// live-probed: the docs' multimodal-reference caps list `reference_audio`\n// parts (up to 3, never sent without a visual reference). Every 2.0 model id\n// below is itself probe-verified live; only the audio-reference capability\n// rests on the docs.\nconst DREAMINA_SEEDANCE_2_0 = {\n name: 'dreamina-seedance-2-0-260128',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst DREAMINA_SEEDANCE_2_0_FAST = {\n name: 'dreamina-seedance-2-0-fast-260128',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst DREAMINA_SEEDANCE_2_0_MINI = {\n name: 'dreamina-seedance-2-0-mini-260615',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_5_PRO = {\n name: 'seedance-1-5-pro-251215',\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_0_PRO = {\n name: 'seedance-1-0-pro-250528',\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_0_PRO_FAST = {\n name: 'seedance-1-0-pro-fast-251015',\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seedance video model identifiers.\n */\nexport const BYTEPLUS_VIDEO_MODELS = [\n DREAMINA_SEEDANCE_2_0.name,\n DREAMINA_SEEDANCE_2_0_FAST.name,\n DREAMINA_SEEDANCE_2_0_MINI.name,\n SEEDANCE_1_5_PRO.name,\n SEEDANCE_1_0_PRO.name,\n SEEDANCE_1_0_PRO_FAST.name,\n] as const\n\n/**\n * Union of all supported Seedance video model names.\n */\nexport type BytePlusVideoModel = (typeof BYTEPLUS_VIDEO_MODELS)[number]\n\n/**\n * Type-only map from video model name to the non-text prompt modalities it\n * accepts. The Seedance 2.0 family takes multimodal references (start/end\n * frames, reference images, reference video and audio); the 1.x models take\n * start/end frames only.\n */\nexport type BytePlusVideoModelInputModalitiesByName = {\n [DREAMINA_SEEDANCE_2_0.name]: readonly ['image', 'video', 'audio']\n [DREAMINA_SEEDANCE_2_0_FAST.name]: readonly ['image', 'video', 'audio']\n [DREAMINA_SEEDANCE_2_0_MINI.name]: readonly ['image', 'video', 'audio']\n [SEEDANCE_1_5_PRO.name]: readonly ['image']\n [SEEDANCE_1_0_PRO.name]: readonly ['image']\n [SEEDANCE_1_0_PRO_FAST.name]: readonly ['image']\n}\n\n/**\n * Type-only map from video model name to the resolutions it accepts.\n *\n * Probe-verified per model on 2026-07-31. Note `seedance-1-0-pro-fast-251015`\n * does accept `1080p`, despite the BytePlus docs listing it as 480p/720p.\n */\nexport type BytePlusVideoModelResolutionByName = {\n [DREAMINA_SEEDANCE_2_0.name]: '480p' | '720p' | '1080p' | '4k'\n [DREAMINA_SEEDANCE_2_0_FAST.name]: '480p' | '720p'\n [DREAMINA_SEEDANCE_2_0_MINI.name]: '480p' | '720p'\n [SEEDANCE_1_5_PRO.name]: '480p' | '720p' | '1080p'\n [SEEDANCE_1_0_PRO.name]: '480p' | '720p' | '1080p'\n [SEEDANCE_1_0_PRO_FAST.name]: '480p' | '720p' | '1080p'\n}\n\n/**\n * Type-only map from video model name to its accepted `size` strings.\n */\nexport type BytePlusVideoModelSizeByName = {\n [K in BytePlusVideoModel]: BytePlusVideoSize<\n BytePlusVideoModelResolutionByName[K]\n >\n}\n\n/**\n * A Seedance model id: one this package knows, or any other string.\n *\n * The open half is a deliberate escape hatch for models BytePlus ships between\n * releases of this package. **Seedance 2.5 is the live example.** Its real id\n * is `dreamina-seedance-2-5-260628` — note the June date suffix, which is why\n * guessing ids around its 2026-07-31 announcement never landed. It is absent\n * from the table below because its capability cells are unverified, not\n * because it is unreachable: probing it returns 404 `ModelNotOpen` (\"your\n * account has not activated the model\"), so no capability question can be\n * answered until someone enables it in the Ark Console. Passing it through\n * the escape hatch works today for an account that has.\n *\n * Adding a model here *narrows* it — the adapter's guards switch on and reject\n * against this file's tables. For a model whose real limits are unknown that\n * is strictly worse than the open path, which lets Ark judge. So an id lands\n * here only once probed.\n *\n * Discovering ids: `GET /models` on the Ark data plane enumerates the catalog\n * (id, `task_type`, `modalities`, `status`) and is how 2.5 was found. It is\n * not exhaustive — `seedream-5-0-lite-260128` answers requests but is missing\n * from the listing — so absence there is not evidence of absence. The ModelArk\n * release notes (https://docs.byteplus.com/en/docs/ModelArk/1159178) are the\n * other watch surface.\n *\n * To probe an id, POST `/contents/generations/tasks` with only\n * `{\"model\": \"<id>\"}`. Three outcomes, all live-verified:\n * - 400 `MissingParameter` (about `content`) — live and usable.\n * - 404 `ModelNotOpen` — real, but not activated on this account.\n * - 404 `InvalidEndpointOrModel.NotFound` — no such model.\n *\n * Unknown ids trade compile-time narrowing for reach: the full size surface is\n * accepted, provider options are ungated, and the adapter's model-specific\n * runtime guards stand down so a new model's legitimate request reaches Ark.\n * Known ids keep their probe-verified narrowing.\n */\nexport type BytePlusVideoModelOrString = BytePlusVideoModel | (string & {})\n\n/**\n * Resolve the `size` type for a video model: the model's probe-verified\n * template union when known, otherwise the full template surface plus any\n * string (a future model may bring ratios or resolution tiers that do not\n * exist today).\n */\nexport type ResolveBytePlusVideoSize<TModel extends string> =\n TModel extends BytePlusVideoModel\n ? BytePlusVideoModelSizeByName[TModel]\n : BytePlusVideoSize | (string & {})\n\n/**\n * Resolve the accepted non-text prompt modalities for a video model. Unknown\n * models accept all three rather than none, so a new model's reference media\n * is not a compile error.\n */\nexport type ResolveBytePlusVideoInputModalities<TModel extends string> =\n TModel extends BytePlusVideoModel\n ? BytePlusVideoModelInputModalitiesByName[TModel]\n : readonly ['image', 'video', 'audio']\n\nconst VIDEO_MODEL_SET: ReadonlySet<string> = new Set(BYTEPLUS_VIDEO_MODELS)\n\n/**\n * True when the id is one this package has probe-verified metadata for.\n *\n * The adapter uses this to decide whether its model-specific guards apply:\n * see {@link BytePlusVideoModelOrString}.\n */\nexport function isKnownBytePlusVideoModel(\n model: string,\n): model is BytePlusVideoModel {\n return VIDEO_MODEL_SET.has(model)\n}\n\n/**\n * Per-model duration type. Seedance accepts any integer second inside the\n * model's range, so this is a continuous range expressed as `number` — a\n * literal union cannot represent it. (The API also accepts `duration: -1` on\n * Seedance 2.0 and 1.5-pro to let the model choose; that is reachable through\n * provider options, not through the generic `duration`.)\n */\nexport type BytePlusVideoModelDurationByName = {\n [K in BytePlusVideoModel]: number\n}\n\n/**\n * Runtime duration table backing `availableDurations()` / `snapDuration()`.\n */\nexport const BYTEPLUS_VIDEO_DURATIONS: {\n readonly [TModel in BytePlusVideoModel]: DurationOptions<\n BytePlusVideoModelDurationByName[TModel]\n >\n} = {\n 'dreamina-seedance-2-0-260128': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'dreamina-seedance-2-0-fast-260128': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'dreamina-seedance-2-0-mini-260615': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-5-pro-251215': {\n kind: 'range',\n min: 4,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-0-pro-250528': {\n kind: 'range',\n min: 2,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-0-pro-fast-251015': {\n kind: 'range',\n min: 2,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n}\n\n/**\n * Duration hint for a model this package has no table for.\n *\n * Spans every range Seedance has shipped so far (2s on the 1.0 models through\n * 15s on the 2.0 family) so `availableDurations()` can still drive a UI. It is\n * a hint, not a contract: the adapter does **not** snap an unknown model's\n * duration against it, because clamping a future model's legitimate 20-second\n * request down to 15 would corrupt the request rather than protect it.\n */\nexport const BYTEPLUS_VIDEO_FALLBACK_DURATIONS: DurationOptions<number> = {\n kind: 'range',\n min: 2,\n max: 15,\n step: 1,\n unit: 'seconds',\n}\n\n/**\n * Look up the duration options for a Seedance video model, falling back to\n * {@link BYTEPLUS_VIDEO_FALLBACK_DURATIONS} for an id this package does not\n * know.\n */\nexport function getBytePlusVideoDurationOptions(\n model: BytePlusVideoModelOrString,\n): DurationOptions<number> {\n return isKnownBytePlusVideoModel(model)\n ? BYTEPLUS_VIDEO_DURATIONS[model]\n : BYTEPLUS_VIDEO_FALLBACK_DURATIONS\n}\n\n// ============================================================================\n// Image models (Seedream)\n// ============================================================================\n\n/**\n * Shorthand size tokens accepted by `/images/generations`. A request uses\n * either a token or an explicit `WxH` string — never both.\n */\nexport type BytePlusImageSizeToken = '1K' | '2K' | '4K'\n\n/**\n * Accepted `size` values for Seedream models: a shorthand token or an\n * explicit pixel size such as `2048x2048`.\n */\nexport type BytePlusImageSize = BytePlusImageSizeToken | `${number}x${number}`\n\nconst DOLA_SEEDREAM_5_0_PRO = {\n name: 'dola-seedream-5-0-pro-260628',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_5_0 = {\n name: 'seedream-5-0-260128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_5_0_LITE = {\n name: 'seedream-5-0-lite-260128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_4_5 = {\n name: 'seedream-4-5-251128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_4_0 = {\n name: 'seedream-4-0-250828',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seedream image model identifiers.\n */\nexport const BYTEPLUS_IMAGE_MODELS = [\n DOLA_SEEDREAM_5_0_PRO.name,\n SEEDREAM_5_0.name,\n SEEDREAM_5_0_LITE.name,\n SEEDREAM_4_5.name,\n SEEDREAM_4_0.name,\n] as const\n\n/**\n * Union of all supported Seedream image model names.\n */\nexport type BytePlusImageModel = (typeof BYTEPLUS_IMAGE_MODELS)[number]\n\n/**\n * Type-only map from image model name to its accepted `size` strings.\n */\nexport type BytePlusImageModelSizeByName = {\n [K in BytePlusImageModel]: BytePlusImageSize\n}\n\n/**\n * Maximum number of reference images accepted per editing request.\n * Seedream 5.0 Pro caps at 10 references; the other editing-capable models\n * accept up to 14.\n *\n * Docs-derived, not live-probed. The 14 for `seedream-5-0-260128` is weaker\n * still — the docs never state a cap for that model, so it is inferred from\n * the rest of the family.\n */\nexport const BYTEPLUS_IMAGE_MAX_REFERENCE_IMAGES: {\n readonly [K in BytePlusImageModel]: number\n} = {\n 'dola-seedream-5-0-pro-260628': 10,\n 'seedream-5-0-260128': 14,\n 'seedream-5-0-lite-260128': 14,\n 'seedream-4-5-251128': 14,\n 'seedream-4-0-250828': 14,\n}\n\n// ============================================================================\n// Seed Speech models (voice host — separate product and API key)\n// ============================================================================\n\nconst SEED_AUDIO_1_0 = {\n name: 'seed-audio-1.0',\n supports: {\n input: ['text', 'audio'],\n output: ['audio'],\n },\n} as const satisfies ModelMeta\n\n// Seed Speech ASR is endpoint-addressed: `POST /api/v3/auc/bigmodel/recognize/\n// flash` selects the model through the `X-Api-Resource-Id` header\n// (`volc.seedasr.auc_turbo`) and takes no `model` field in the body. This\n// synthetic identifier satisfies the SDK's `TranscriptionOptions.model`\n// contract and gives logging and fixture matching a stable value.\nconst SEED_ASR = {\n name: 'seed-asr',\n supports: {\n input: ['audio'],\n output: ['text'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seed Speech TTS model identifiers.\n *\n * Note: TTS runs on `voice.ap-southeast-1.bytepluses.com` with an\n * `X-Api-Key` header and a *different* API key from Ark.\n */\nexport const BYTEPLUS_TTS_MODELS = [SEED_AUDIO_1_0.name] as const\n\n/**\n * All supported Seed Speech transcription model identifiers.\n */\nexport const BYTEPLUS_TRANSCRIPTION_MODELS = [SEED_ASR.name] as const\n\n/**\n * Union of all supported Seed Speech TTS model names.\n */\nexport type BytePlusTTSModel = (typeof BYTEPLUS_TTS_MODELS)[number]\n\n/**\n * Union of all supported Seed Speech transcription model names.\n */\nexport type BytePlusTranscriptionModel =\n (typeof BYTEPLUS_TRANSCRIPTION_MODELS)[number]\n\n// ============================================================================\n// Type resolution helpers\n// ============================================================================\n\n/**\n * Resolve provider options for a specific model. Models listed in the chat\n * map get their explicit options; anything else falls back to the base chat\n * options.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof BytePlusChatModelProviderOptionsByName\n ? BytePlusChatModelProviderOptionsByName[TModel]\n : BytePlusTextProviderOptions\n\n/**\n * Resolve input modalities for a specific model. Models missing from the map\n * are treated as text-only.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof BytePlusModelInputModalitiesByName\n ? BytePlusModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"mappings":";AAsDA,IAAM,sBAAsB;CAC1B,MAAM;CACN,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,UAAU;EACR,OAAO;GAAC;GAAQ;GAAS;EAAO;EAChC,QAAQ,CAAC,MAAM;EACf,cAAc;GAAC;GAAa;GAAgB;EAAoB;EAChE,OAAO,CAAC;CACV;AACF;AAEA,IAAM,uBAAuB;CAC3B,MAAM;CACN,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,UAAU;EACR,OAAO;GAAC;GAAQ;GAAS;GAAS;EAAO;EACzC,QAAQ,CAAC,MAAM;EAEf,cAAc,CAAC,aAAa,cAAc;EAC1C,OAAO,CAAC;CACV;AACF;AAEA,IAAM,uBAAuB;CAC3B,MAAM;CACN,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,UAAU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C,OAAO;CAClB;AACF;AAOA,IAAM,WAAW;CACf,MAAM;CACN,UAAU;EACR,OAAO,CAAC,OAAO;EACf,QAAQ,CAAC,MAAM;CACjB;AACF;;;;;;;AAQA,IAAa,sBAAsB,CAAC,eAAe,IAAI;;;;AAKvD,IAAa,gCAAgC,CAAC,SAAS,IAAI"}
1
+ {"version":3,"file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["/**\n * BytePlus ModelArk model metadata.\n *\n * Every Ark model id in this file — chat, video and image — was verified live\n * against `https://ark.ap-southeast.bytepluses.com/api/v3` on 2026-07-31. The\n * two Seed Speech ids are the exception: they live on the voice host, which\n * needs a separate key that was not available, so they are docs-derived.\n * Capability metadata is a mix of probed and docs-derived facts; anything not\n * confirmed against the live API is annotated as such at its declaration.\n * BytePlus\n * deactivates model ids aggressively (the whole `seedance-1-0-lite-*` family,\n * `seed-1-6-lite-*`, `seedream-3-0-*`, and the `doubao-`/`skylark-` names are\n * all 404s internationally), so only dated, probe-confirmed ids are shipped.\n *\n * Prefix rules, also probe-confirmed:\n * - `dola-seed-2-1-turbo-260628` and `dola-seedream-5-0-pro-260628` are the\n * canonical ids; the bare forms resolve as aliases but the API echoes the\n * prefixed id back.\n * - The Seedance 2.0 family *requires* the `dreamina-` prefix.\n * - Older models reject the `dola-` prefix outright.\n */\nimport type { DurationOptions } from '@tanstack/ai/adapters'\nimport type { BytePlusTextProviderOptions } from './text/text-provider-options'\n\n/**\n * BytePlus exposes no server-side provider tools (no hosted web search, code\n * interpreter, …) on the international Ark endpoint, so every chat model\n * advertises an empty tool set. Typing it as `never` makes passing another\n * provider's `ProviderTool` to a BytePlus adapter a compile-time error.\n */\nexport type BytePlusProviderToolKind = never\n\n/**\n * Internal metadata structure describing a BytePlus model.\n */\ninterface ModelMeta {\n name: string\n supports: {\n input: ReadonlyArray<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: ReadonlyArray<'text' | 'image' | 'audio' | 'video'>\n capabilities?: ReadonlyArray<\n 'reasoning' | 'tool_calling' | 'structured_outputs'\n >\n tools?: ReadonlyArray<BytePlusProviderToolKind>\n }\n context_window?: number\n max_input_tokens?: number\n max_output_tokens?: number\n}\n\n// ============================================================================\n// Chat models (Seed / GLM / DeepSeek / gpt-oss on Ark)\n// ============================================================================\n\nconst DOLA_SEED_2_1_TURBO = {\n name: 'dola-seed-2-1-turbo-260628',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 256_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_LITE_260428 = {\n name: 'seed-2-0-lite-260428',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_MINI_260428 = {\n name: 'seed-2-0-mini-260428',\n context_window: 256_000,\n max_input_tokens: 256_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_PRO_260328 = {\n name: 'seed-2-0-pro-260328',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n // Live-probed 2026-07-31: accepts json_schema, despite the docs table\n // saying otherwise.\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_LITE_260228 = {\n name: 'seed-2-0-lite-260228',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_MINI_260215 = {\n name: 'seed-2-0-mini-260215',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_2_0_CODE_PREVIEW_260328 = {\n name: 'seed-2-0-code-preview-260328',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_8_251228 = {\n name: 'seed-1-8-251228',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 64_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_250915 = {\n name: 'seed-1-6-250915',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_250615 = {\n name: 'seed-1-6-250615',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_FLASH_250715 = {\n name: 'seed-1-6-flash-250715',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst SEED_1_6_FLASH_250615 = {\n name: 'seed-1-6-flash-250615',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst GLM_5_2_260617 = {\n name: 'glm-5-2-260617',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Live-probed 2026-07-31: accepts json_schema, despite the docs table\n // saying otherwise.\n capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst GLM_4_7_251222 = {\n name: 'glm-4-7-251222',\n context_window: 256_000,\n max_input_tokens: 224_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Adherence-probed 2026-07-31: ACCEPTS a json_schema with 200 but ignores\n // it and answers in prose, so it is not a structured-output model. A\n // status-code-only probe reads this as support — see the note on\n // BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst DEEPSEEK_V4_PRO_260425 = {\n name: 'deepseek-v4-pro-260425',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 384_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\nconst DEEPSEEK_V4_FLASH_260425 = {\n name: 'deepseek-v4-flash-260425',\n context_window: 1_024_000,\n max_input_tokens: 1_024_000,\n max_output_tokens: 384_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n// The one model on Ark that defaults to `thinking: disabled`.\nconst DEEPSEEK_V3_2_251201 = {\n name: 'deepseek-v3-2-251201',\n context_window: 128_000,\n max_input_tokens: 128_000,\n max_output_tokens: 32_000,\n supports: {\n input: ['text'],\n output: ['text'],\n // Live-probed 2026-07-31: rejects both json_schema and json_object.\n capabilities: ['reasoning', 'tool_calling'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n// The only model accepting `thinking: {type: 'auto'}`. Tool calling is\n// undocumented on Ark and unverified, so it is not advertised.\nconst GPT_OSS_120B_250805 = {\n name: 'gpt-oss-120b-250805',\n context_window: 128_000,\n max_input_tokens: 96_000,\n max_output_tokens: 64_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning'],\n tools: [] as const,\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported BytePlus chat model identifiers.\n */\nexport const BYTEPLUS_CHAT_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_LITE_260428.name,\n SEED_2_0_MINI_260428.name,\n SEED_2_0_PRO_260328.name,\n SEED_2_0_LITE_260228.name,\n SEED_2_0_MINI_260215.name,\n SEED_2_0_CODE_PREVIEW_260328.name,\n SEED_1_8_251228.name,\n SEED_1_6_250915.name,\n SEED_1_6_250615.name,\n SEED_1_6_FLASH_250715.name,\n SEED_1_6_FLASH_250615.name,\n GLM_5_2_260617.name,\n GLM_4_7_251222.name,\n DEEPSEEK_V4_PRO_260425.name,\n DEEPSEEK_V4_FLASH_260425.name,\n DEEPSEEK_V3_2_251201.name,\n GPT_OSS_120B_250805.name,\n] as const\n\n/**\n * Union of all supported BytePlus chat model names.\n */\nexport type BytePlusChatModel = (typeof BYTEPLUS_CHAT_MODELS)[number]\n\n/**\n * Chat models that emit a `encrypted_content` blob alongside\n * `reasoning_content` when thinking is enabled (\"thinking summary\" models).\n *\n * The blob is an opaque signature over the reasoning trace: when it is\n * present it must be echoed back verbatim on the assistant message in the\n * next turn. Live probing showed omitting it did *not* fail a simple tool\n * round-trip, so adapters preserve and replay it when present but must never\n * treat its absence as an error.\n */\nexport const BYTEPLUS_THINKING_SUMMARY_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_LITE_260428.name,\n SEED_2_0_MINI_260428.name,\n SEED_2_0_PRO_260328.name,\n] as const\n\n/**\n * Union of chat models that emit `encrypted_content`.\n */\nexport type BytePlusThinkingSummaryModel =\n (typeof BYTEPLUS_THINKING_SUMMARY_MODELS)[number]\n\nconst THINKING_SUMMARY_MODEL_SET: ReadonlySet<string> = new Set(\n BYTEPLUS_THINKING_SUMMARY_MODELS,\n)\n\n/**\n * True when the model emits `encrypted_content` that should be round-tripped\n * on subsequent turns.\n */\nexport function emitsEncryptedContent(model: string): boolean {\n return THINKING_SUMMARY_MODEL_SET.has(model)\n}\n\n/**\n * Chat models that accept `response_format: {type: 'json_schema'}`.\n *\n * Live-probed against all 18 chat models on 2026-07-31, not docs-derived — the\n * BytePlus capability tables are wrong here in both directions.\n *\n * Membership needs TWO things, because the API has both failure modes:\n * 1. The request is accepted. Seven models (`seed-2-0-lite-260428`,\n * `seed-2-0-mini-260428`, `seed-2-0-code-preview-260328`, both\n * `deepseek-v4-*`, `deepseek-v3-2-251201`, `gpt-oss-120b-250805`) answer a\n * JSON schema with 400 InvalidParameter — and reject\n * `{type: 'json_object'}` too, so there is no JSON-mode fallback.\n * 2. The schema is actually honoured. `glm-4-7-251222` accepts the request\n * with 200 and then ignores the schema, answering in prose (reproduced\n * twice by the adherence probe). A status-code-only probe wrongly reads\n * that as support, so it is excluded.\n *\n * Models that fail either check need tool-shaped extraction instead.\n *\n * Note that the default chat model `seed-2-0-lite-260428` is one of the\n * rejecting models: structured-output work needs `seed-2-0-lite-260228` or\n * `dola-seed-2-1-turbo-260628`.\n */\nexport const BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS = [\n DOLA_SEED_2_1_TURBO.name,\n SEED_2_0_PRO_260328.name,\n SEED_2_0_LITE_260228.name,\n SEED_2_0_MINI_260215.name,\n SEED_1_8_251228.name,\n SEED_1_6_250915.name,\n SEED_1_6_250615.name,\n SEED_1_6_FLASH_250715.name,\n SEED_1_6_FLASH_250615.name,\n GLM_5_2_260617.name,\n] as const\n\nconst STRUCTURED_OUTPUT_MODEL_SET: ReadonlySet<string> = new Set(\n BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS,\n)\n\n/**\n * True when the model supports native JSON-schema structured output.\n */\nexport function supportsStructuredOutput(model: string): boolean {\n return STRUCTURED_OUTPUT_MODEL_SET.has(model)\n}\n\n/**\n * Type-only map from chat model name to whether it supports native\n * JSON-schema structured output.\n */\nexport type BytePlusChatModelStructuredOutputByName = {\n [K in BytePlusChatModel]: K extends BytePlusStructuredOutputChatModel\n ? true\n : false\n}\n\n/**\n * Union of chat models supporting native JSON-schema structured output.\n */\nexport type BytePlusStructuredOutputChatModel =\n (typeof BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS)[number]\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * Used for type inference when constructing multimodal messages.\n */\nexport type BytePlusModelInputModalitiesByName = {\n [DOLA_SEED_2_1_TURBO.name]: typeof DOLA_SEED_2_1_TURBO.supports.input\n [SEED_2_0_LITE_260428.name]: typeof SEED_2_0_LITE_260428.supports.input\n [SEED_2_0_MINI_260428.name]: typeof SEED_2_0_MINI_260428.supports.input\n [SEED_2_0_PRO_260328.name]: typeof SEED_2_0_PRO_260328.supports.input\n [SEED_2_0_LITE_260228.name]: typeof SEED_2_0_LITE_260228.supports.input\n [SEED_2_0_MINI_260215.name]: typeof SEED_2_0_MINI_260215.supports.input\n [SEED_2_0_CODE_PREVIEW_260328.name]: typeof SEED_2_0_CODE_PREVIEW_260328.supports.input\n [SEED_1_8_251228.name]: typeof SEED_1_8_251228.supports.input\n [SEED_1_6_250915.name]: typeof SEED_1_6_250915.supports.input\n [SEED_1_6_250615.name]: typeof SEED_1_6_250615.supports.input\n [SEED_1_6_FLASH_250715.name]: typeof SEED_1_6_FLASH_250715.supports.input\n [SEED_1_6_FLASH_250615.name]: typeof SEED_1_6_FLASH_250615.supports.input\n [GLM_5_2_260617.name]: typeof GLM_5_2_260617.supports.input\n [GLM_4_7_251222.name]: typeof GLM_4_7_251222.supports.input\n [DEEPSEEK_V4_PRO_260425.name]: typeof DEEPSEEK_V4_PRO_260425.supports.input\n [DEEPSEEK_V4_FLASH_260425.name]: typeof DEEPSEEK_V4_FLASH_260425.supports.input\n [DEEPSEEK_V3_2_251201.name]: typeof DEEPSEEK_V3_2_251201.supports.input\n [GPT_OSS_120B_250805.name]: typeof GPT_OSS_120B_250805.supports.input\n}\n\n/**\n * Type-only map from chat model name to its supported provider tools.\n * BytePlus exposes no provider-tool factories, so every model gets an empty\n * tuple — passing another provider's tool is then a compile-time error.\n */\nexport type BytePlusChatModelToolCapabilitiesByName = {\n [K in BytePlusChatModel]: ReadonlyArray<BytePlusProviderToolKind>\n}\n\n/**\n * Type-only map from chat model name to its provider options type.\n */\nexport type BytePlusChatModelProviderOptionsByName = {\n [K in BytePlusChatModel]: BytePlusTextProviderOptions\n}\n\n// ============================================================================\n// Video models (Seedance, async task API)\n// ============================================================================\n\n/**\n * Output aspect ratios accepted by the Seedance task API. `adaptive` is only\n * meaningful for image-to-video, where the ratio follows the input frame.\n */\nexport type BytePlusVideoRatio =\n | '16:9'\n | '9:16'\n | '4:3'\n | '3:4'\n | '1:1'\n | '21:9'\n | 'adaptive'\n\n/**\n * Resolution tiers accepted by the Seedance task API.\n *\n * Resolution tiers are model-specific (see\n * {@link BytePlusVideoModelResolutionByName}). Two findings that still\n * contradict older BytePlus prose: there is **no 2K tier on any Seedance\n * model**, and `4k` exists only on `dreamina-seedance-2-0-260128` (Seedance\n * 2.5 is 480p/720p only, per the live ModelArk docs).\n *\n * The API matches this field case-insensitively (`4K`, `4k` and `1080P` are\n * all accepted), so this package standardizes on the lowercase spelling.\n */\nexport type BytePlusVideoResolution = '480p' | '720p' | '1080p' | '4k'\n\n/**\n * Generic `size` template for Seedance models: either a bare aspect ratio\n * (\"16:9\") or `ratio_resolution` (\"16:9_720p\"). The Seedance API takes the\n * two as separate `ratio` / `resolution` fields; the adapter splits this\n * template back apart.\n */\nexport type BytePlusVideoSize<\n TResolution extends BytePlusVideoResolution = BytePlusVideoResolution,\n> = BytePlusVideoRatio | `${BytePlusVideoRatio}_${TResolution}`\n\n// Multimodal reference-media capabilities (reference images / video / audio)\n// are docs-derived from the ModelArk create-task page. Model ids and the\n// resolution / duration tables for 2.0 were also live-probed on 2026-07-31;\n// 2.5 lands from the public docs once the model was fully opened (2026-08-07).\nconst DREAMINA_SEEDANCE_2_5 = {\n name: 'dreamina-seedance-2-5-260628',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst DREAMINA_SEEDANCE_2_0 = {\n name: 'dreamina-seedance-2-0-260128',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst DREAMINA_SEEDANCE_2_0_FAST = {\n name: 'dreamina-seedance-2-0-fast-260128',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst DREAMINA_SEEDANCE_2_0_MINI = {\n name: 'dreamina-seedance-2-0-mini-260615',\n supports: {\n input: ['text', 'image', 'video', 'audio'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_5_PRO = {\n name: 'seedance-1-5-pro-251215',\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_0_PRO = {\n name: 'seedance-1-0-pro-250528',\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDANCE_1_0_PRO_FAST = {\n name: 'seedance-1-0-pro-fast-251015',\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seedance video model identifiers.\n */\nexport const BYTEPLUS_VIDEO_MODELS = [\n DREAMINA_SEEDANCE_2_5.name,\n DREAMINA_SEEDANCE_2_0.name,\n DREAMINA_SEEDANCE_2_0_FAST.name,\n DREAMINA_SEEDANCE_2_0_MINI.name,\n SEEDANCE_1_5_PRO.name,\n SEEDANCE_1_0_PRO.name,\n SEEDANCE_1_0_PRO_FAST.name,\n] as const\n\n/**\n * Union of all supported Seedance video model names.\n */\nexport type BytePlusVideoModel = (typeof BYTEPLUS_VIDEO_MODELS)[number]\n\n/**\n * Type-only map from video model name to the non-text prompt modalities it\n * accepts. Seedance 2.5 and the 2.0 family take multimodal references\n * (start/end frames, reference images, reference video and audio); the 1.x\n * models take start/end frames only.\n */\nexport type BytePlusVideoModelInputModalitiesByName = {\n [DREAMINA_SEEDANCE_2_5.name]: readonly ['image', 'video', 'audio']\n [DREAMINA_SEEDANCE_2_0.name]: readonly ['image', 'video', 'audio']\n [DREAMINA_SEEDANCE_2_0_FAST.name]: readonly ['image', 'video', 'audio']\n [DREAMINA_SEEDANCE_2_0_MINI.name]: readonly ['image', 'video', 'audio']\n [SEEDANCE_1_5_PRO.name]: readonly ['image']\n [SEEDANCE_1_0_PRO.name]: readonly ['image']\n [SEEDANCE_1_0_PRO_FAST.name]: readonly ['image']\n}\n\n/**\n * Type-only map from video model name to the resolutions it accepts.\n *\n * 2.0 / 1.x cells were probe-verified on 2026-07-31; 2.5 comes from the\n * public ModelArk create-task docs (2026-08-07). Note\n * `seedance-1-0-pro-fast-251015` does accept `1080p`, despite older BytePlus\n * prose listing it as 480p/720p.\n */\nexport type BytePlusVideoModelResolutionByName = {\n [DREAMINA_SEEDANCE_2_5.name]: '480p' | '720p'\n [DREAMINA_SEEDANCE_2_0.name]: '480p' | '720p' | '1080p' | '4k'\n [DREAMINA_SEEDANCE_2_0_FAST.name]: '480p' | '720p'\n [DREAMINA_SEEDANCE_2_0_MINI.name]: '480p' | '720p'\n [SEEDANCE_1_5_PRO.name]: '480p' | '720p' | '1080p'\n [SEEDANCE_1_0_PRO.name]: '480p' | '720p' | '1080p'\n [SEEDANCE_1_0_PRO_FAST.name]: '480p' | '720p' | '1080p'\n}\n\n/**\n * Type-only map from video model name to its accepted `size` strings.\n */\nexport type BytePlusVideoModelSizeByName = {\n [K in BytePlusVideoModel]: BytePlusVideoSize<\n BytePlusVideoModelResolutionByName[K]\n >\n}\n\n/**\n * A Seedance model id: one this package knows, or any other string.\n *\n * The open half is a deliberate escape hatch for models BytePlus ships between\n * releases of this package. Adding a model to {@link BYTEPLUS_VIDEO_MODELS}\n * *narrows* it — the adapter's guards switch on and reject against this\n * file's tables. For a model whose real limits are unknown that is strictly\n * worse than the open path, which lets Ark judge. So an id lands in the\n * known table only once its capability cells are documented or probed.\n *\n * Discovering ids: `GET /models` on the Ark data plane enumerates the catalog\n * (id, `task_type`, `modalities`, `status`). It is not exhaustive —\n * `seedream-5-0-lite-260128` answers requests but is missing from the\n * listing — so absence there is not evidence of absence. The ModelArk\n * release notes (https://docs.byteplus.com/en/docs/ModelArk/1159178) are the\n * other watch surface.\n *\n * To probe an id, POST `/contents/generations/tasks` with only\n * `{\"model\": \"<id>\"}`. Three outcomes, all live-verified:\n * - 400 `MissingParameter` (about `content`) — live and usable.\n * - 404 `ModelNotOpen` — real, but not activated on this account.\n * - 404 `InvalidEndpointOrModel.NotFound` — no such model.\n *\n * Unknown ids trade compile-time narrowing for reach: the full size surface is\n * accepted, provider options are ungated, and the adapter's model-specific\n * runtime guards stand down so a new model's legitimate request reaches Ark.\n * Known ids keep their documented / probe-verified narrowing.\n */\nexport type BytePlusVideoModelOrString = BytePlusVideoModel | (string & {})\n\n/**\n * Resolve the `size` type for a video model: the model's probe-verified\n * template union when known, otherwise the full template surface plus any\n * string (a future model may bring ratios or resolution tiers that do not\n * exist today).\n */\nexport type ResolveBytePlusVideoSize<TModel extends string> =\n TModel extends BytePlusVideoModel\n ? BytePlusVideoModelSizeByName[TModel]\n : BytePlusVideoSize | (string & {})\n\n/**\n * Resolve the accepted non-text prompt modalities for a video model. Unknown\n * models accept all three rather than none, so a new model's reference media\n * is not a compile error.\n */\nexport type ResolveBytePlusVideoInputModalities<TModel extends string> =\n TModel extends BytePlusVideoModel\n ? BytePlusVideoModelInputModalitiesByName[TModel]\n : readonly ['image', 'video', 'audio']\n\nconst VIDEO_MODEL_SET: ReadonlySet<string> = new Set(BYTEPLUS_VIDEO_MODELS)\n\n/**\n * True when the id is one this package has probe-verified metadata for.\n *\n * The adapter uses this to decide whether its model-specific guards apply:\n * see {@link BytePlusVideoModelOrString}.\n */\nexport function isKnownBytePlusVideoModel(\n model: string,\n): model is BytePlusVideoModel {\n return VIDEO_MODEL_SET.has(model)\n}\n\n/**\n * Per-model duration type. Seedance accepts any integer second inside the\n * model's range, so this is a continuous range expressed as `number` — a\n * literal union cannot represent it. (The API also accepts `duration: -1` on\n * Seedance 2.5, 2.0 and 1.5-pro to let the model choose; that is reachable\n * through provider options, not through the generic `duration`.)\n */\nexport type BytePlusVideoModelDurationByName = {\n [K in BytePlusVideoModel]: number\n}\n\n/**\n * Runtime duration table backing `availableDurations()` / `snapDuration()`.\n */\nexport const BYTEPLUS_VIDEO_DURATIONS: {\n readonly [TModel in BytePlusVideoModel]: DurationOptions<\n BytePlusVideoModelDurationByName[TModel]\n >\n} = {\n 'dreamina-seedance-2-5-260628': {\n kind: 'range',\n min: 4,\n max: 30,\n step: 1,\n unit: 'seconds',\n },\n 'dreamina-seedance-2-0-260128': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'dreamina-seedance-2-0-fast-260128': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'dreamina-seedance-2-0-mini-260615': {\n kind: 'range',\n min: 4,\n max: 15,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-5-pro-251215': {\n kind: 'range',\n min: 4,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-0-pro-250528': {\n kind: 'range',\n min: 2,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n 'seedance-1-0-pro-fast-251015': {\n kind: 'range',\n min: 2,\n max: 12,\n step: 1,\n unit: 'seconds',\n },\n}\n\n/**\n * Duration hint for a model this package has no table for.\n *\n * Spans every range Seedance has shipped so far (2s on the 1.0 models through\n * 30s on Seedance 2.5) so `availableDurations()` can still drive a UI. It is\n * a hint, not a contract: the adapter does **not** snap an unknown model's\n * duration against it, because clamping a future model's legitimate longer\n * request down to 30 would corrupt the request rather than protect it.\n */\nexport const BYTEPLUS_VIDEO_FALLBACK_DURATIONS: DurationOptions<number> = {\n kind: 'range',\n min: 2,\n max: 30,\n step: 1,\n unit: 'seconds',\n}\n\n/**\n * Look up the duration options for a Seedance video model, falling back to\n * {@link BYTEPLUS_VIDEO_FALLBACK_DURATIONS} for an id this package does not\n * know.\n */\nexport function getBytePlusVideoDurationOptions(\n model: BytePlusVideoModelOrString,\n): DurationOptions<number> {\n return isKnownBytePlusVideoModel(model)\n ? BYTEPLUS_VIDEO_DURATIONS[model]\n : BYTEPLUS_VIDEO_FALLBACK_DURATIONS\n}\n\n// ============================================================================\n// Image models (Seedream)\n// ============================================================================\n\n/**\n * Shorthand size tokens accepted by `/images/generations`. A request uses\n * either a token or an explicit `WxH` string — never both.\n */\nexport type BytePlusImageSizeToken = '1K' | '2K' | '4K'\n\n/**\n * Accepted `size` values for Seedream models: a shorthand token or an\n * explicit pixel size such as `2048x2048`.\n */\nexport type BytePlusImageSize = BytePlusImageSizeToken | `${number}x${number}`\n\nconst DOLA_SEEDREAM_5_0_PRO = {\n name: 'dola-seedream-5-0-pro-260628',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_5_0 = {\n name: 'seedream-5-0-260128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_5_0_LITE = {\n name: 'seedream-5-0-lite-260128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_4_5 = {\n name: 'seedream-4-5-251128',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\nconst SEEDREAM_4_0 = {\n name: 'seedream-4-0-250828',\n supports: {\n input: ['text', 'image'],\n output: ['image'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seedream image model identifiers.\n */\nexport const BYTEPLUS_IMAGE_MODELS = [\n DOLA_SEEDREAM_5_0_PRO.name,\n SEEDREAM_5_0.name,\n SEEDREAM_5_0_LITE.name,\n SEEDREAM_4_5.name,\n SEEDREAM_4_0.name,\n] as const\n\n/**\n * Union of all supported Seedream image model names.\n */\nexport type BytePlusImageModel = (typeof BYTEPLUS_IMAGE_MODELS)[number]\n\n/**\n * Type-only map from image model name to its accepted `size` strings.\n */\nexport type BytePlusImageModelSizeByName = {\n [K in BytePlusImageModel]: BytePlusImageSize\n}\n\n/**\n * Maximum number of reference images accepted per editing request.\n * Seedream 5.0 Pro caps at 10 references; the other editing-capable models\n * accept up to 14.\n *\n * Docs-derived, not live-probed. The 14 for `seedream-5-0-260128` is weaker\n * still — the docs never state a cap for that model, so it is inferred from\n * the rest of the family.\n */\nexport const BYTEPLUS_IMAGE_MAX_REFERENCE_IMAGES: {\n readonly [K in BytePlusImageModel]: number\n} = {\n 'dola-seedream-5-0-pro-260628': 10,\n 'seedream-5-0-260128': 14,\n 'seedream-5-0-lite-260128': 14,\n 'seedream-4-5-251128': 14,\n 'seedream-4-0-250828': 14,\n}\n\n// ============================================================================\n// Seed Speech models (voice host — separate product and API key)\n// ============================================================================\n\nconst SEED_AUDIO_1_0 = {\n name: 'seed-audio-1.0',\n supports: {\n input: ['text', 'audio'],\n output: ['audio'],\n },\n} as const satisfies ModelMeta\n\n// Seed Speech ASR is endpoint-addressed: `POST /api/v3/auc/bigmodel/recognize/\n// flash` selects the model through the `X-Api-Resource-Id` header\n// (`volc.seedasr.auc_turbo`) and takes no `model` field in the body. This\n// synthetic identifier satisfies the SDK's `TranscriptionOptions.model`\n// contract and gives logging and fixture matching a stable value.\nconst SEED_ASR = {\n name: 'seed-asr',\n supports: {\n input: ['audio'],\n output: ['text'],\n },\n} as const satisfies ModelMeta\n\n/**\n * All supported Seed Speech TTS model identifiers.\n *\n * Note: TTS runs on `voice.ap-southeast-1.bytepluses.com` with an\n * `X-Api-Key` header and a *different* API key from Ark.\n */\nexport const BYTEPLUS_TTS_MODELS = [SEED_AUDIO_1_0.name] as const\n\n/**\n * All supported Seed Speech transcription model identifiers.\n */\nexport const BYTEPLUS_TRANSCRIPTION_MODELS = [SEED_ASR.name] as const\n\n/**\n * Union of all supported Seed Speech TTS model names.\n */\nexport type BytePlusTTSModel = (typeof BYTEPLUS_TTS_MODELS)[number]\n\n/**\n * Union of all supported Seed Speech transcription model names.\n */\nexport type BytePlusTranscriptionModel =\n (typeof BYTEPLUS_TRANSCRIPTION_MODELS)[number]\n\n// ============================================================================\n// Type resolution helpers\n// ============================================================================\n\n/**\n * Resolve provider options for a specific model. Models listed in the chat\n * map get their explicit options; anything else falls back to the base chat\n * options.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof BytePlusChatModelProviderOptionsByName\n ? BytePlusChatModelProviderOptionsByName[TModel]\n : BytePlusTextProviderOptions\n\n/**\n * Resolve input modalities for a specific model. Models missing from the map\n * are treated as text-only.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof BytePlusModelInputModalitiesByName\n ? BytePlusModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"mappings":";AAsDA,IAAM,sBAAsB;CAC1B,MAAM;CACN,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,UAAU;EACR,OAAO;GAAC;GAAQ;GAA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EACN,UAAU;GACR,OAAO,CAAC,QAAQ,OAAO;GACvB,QAAQ,CAAC,OAAO;EAClB;CAgCA,EAAa;CACb;EA7BA,MAAM;EACN,UAAU;GACR,OAAO,CAAC,QAAQ,OAAO;GACvB,QAAQ,CAAC,OAAO;EAClB;CAyBA,EAAkB;CAClB;EAtBA,MAAM;EACN,UAAU;GACR,OAAO,CAAC,QAAQ,OAAO;GACvB,QAAQ,CAAC,OAAO;EAClB;CAkBA,EAAa;CACb;EAfA,MAAM;EACN,UAAU;GACR,OAAO,CAAC,QAAQ,OAAO;GACvB,QAAQ,CAAC,OAAO;EAClB;CAWA,EAAa;AACf;;;;;;;;;;AAuBA,IAAa,sCAET;CACF,gCAAgC;CAChC,uBAAuB;CACvB,4BAA4B;CAC5B,uBAAuB;CACvB,uBAAuB;AACzB;AAMA,IAAM,iBAAiB;CACrB,MAAM;CACN,UAAU;EACR,OAAO,CAAC,QAAQ,OAAO;EACvB,QAAQ,CAAC,OAAO;CAClB;AACF;AAOA,IAAM,WAAW;CACf,MAAM;CACN,UAAU;EACR,OAAO,CAAC,OAAO;EACf,QAAQ,CAAC,MAAM;CACjB;AACF;;;;;;;AAQA,IAAa,sBAAsB,CAAC,eAAe,IAAI;;;;AAKvD,IAAa,gCAAgC,CAAC,SAAS,IAAI"}
@@ -8,12 +8,22 @@ import { BytePlusVideoModel, BytePlusVideoModelOrString, BytePlusVideoRatio, Byt
8
8
  * price, with no latency guarantee. Task ids come back with a `cgt-batch-`
9
9
  * prefix (live-verified).
10
10
  *
11
- * Only the Seedance 1.x models accept this field. The Seedance 2.0 family
12
- * rejects it ("service_tier is not supported … must be empty").
11
+ * Only the Seedance 1.x models accept this field. Seedance 2.5 and the 2.0
12
+ * family reject it ("service_tier is not supported … must be empty" / "not
13
+ * currently supported").
13
14
  *
14
15
  * @experimental Video generation is an experimental feature and may change.
15
16
  */
16
17
  export type BytePlusVideoServiceTier = 'default' | 'flex';
18
+ /**
19
+ * Container format of the generated video.
20
+ *
21
+ * Seedance 2.5 documents `mp4` (default) and `mov`. Other models historically
22
+ * return `mp4` only; scalar applicability is left to Ark (see file header).
23
+ *
24
+ * @experimental Video generation is an experimental feature and may change.
25
+ */
26
+ export type BytePlusVideoOutputFormat = 'mp4' | 'mov';
17
27
  /**
18
28
  * Provider-specific options for Seedance video generation. These map one-to-one
19
29
  * onto the create-task request body and take precedence over the values the
@@ -29,24 +39,24 @@ export interface BytePlusVideoProviderOptions {
29
39
  /**
30
40
  * Output aspect ratio. Overrides the ratio half of the generic `size`.
31
41
  *
32
- * `adaptive` (follow the input frame) is the default on Seedance 2.0 and
33
- * 1.5-pro but is rejected by Seedance 1.0-pro / 1.0-pro-fast for
42
+ * `adaptive` (follow the input frame) is the default on Seedance 2.5, 2.0
43
+ * and 1.5-pro but is rejected by Seedance 1.0-pro / 1.0-pro-fast for
34
44
  * text-to-video.
35
45
  */
36
46
  ratio?: BytePlusVideoRatio;
37
47
  /**
38
48
  * Output resolution tier. Overrides the resolution half of the generic
39
49
  * `size`. Matched case-insensitively by the API; this package uses
40
- * lowercase throughout. `4k` exists only on `dreamina-seedance-2-0-260128`,
41
- * and there is no 2K tier on any model.
50
+ * lowercase throughout. `4k` exists only on `dreamina-seedance-2-0-260128`
51
+ * (Seedance 2.5 is 480p/720p only), and there is no 2K tier on any model.
42
52
  */
43
53
  resolution?: BytePlusVideoResolution;
44
54
  /**
45
55
  * Whole seconds of output. Overrides the generic `duration`, and unlike it
46
56
  * is sent verbatim rather than snapped into the model's range.
47
57
  *
48
- * `-1` asks the model to choose its own length; accepted by Seedance 2.0
49
- * and 1.5-pro only.
58
+ * `-1` asks the model to choose its own length; accepted by Seedance 2.5,
59
+ * 2.0 and 1.5-pro only. On 2.5 video-editing tasks, `-1` is required.
50
60
  */
51
61
  duration?: number;
52
62
  /**
@@ -66,7 +76,7 @@ export interface BytePlusVideoProviderOptions {
66
76
  * Appends a "fix the camera" instruction to the prompt. Best-effort — the
67
77
  * model is not constrained to obey it.
68
78
  *
69
- * Seedance 1.5-pro, 1.0-pro and 1.0-pro-fast only; the 2.0 family rejects
79
+ * Seedance 1.5-pro, 1.0-pro and 1.0-pro-fast only; the 2.x family rejects
70
80
  * it.
71
81
  */
72
82
  camera_fixed?: boolean;
@@ -78,11 +88,12 @@ export interface BytePlusVideoProviderOptions {
78
88
  * better results.
79
89
  *
80
90
  * Accepted by every model at the API's validation layer, but only Seedance
81
- * 2.0 and 1.5-pro actually produce audio.
91
+ * 2.5, 2.0 and 1.5-pro actually produce audio.
82
92
  */
83
93
  generate_audio?: boolean;
84
94
  /**
85
- * Inference queue. Seedance 1.x only — the 2.0 family has no offline tier.
95
+ * Inference queue. Seedance 1.x only — Seedance 2.5 and the 2.0 family have
96
+ * no offline tier.
86
97
  */
87
98
  service_tier?: BytePlusVideoServiceTier;
88
99
  /**
@@ -99,14 +110,19 @@ export interface BytePlusVideoProviderOptions {
99
110
  */
100
111
  draft?: boolean;
101
112
  /**
102
- * Queue priority, `[0, 9]`. Seedance 2.0 family only — 1.5-pro rejects it,
103
- * and the 1.0 models accept it without acting on it.
113
+ * Queue priority, `[0, 9]`. Seedance 2.5 and the 2.0 family — 1.5-pro
114
+ * rejects it, and the 1.0 models accept it without acting on it.
104
115
  */
105
116
  priority?: number;
117
+ /**
118
+ * Container of the generated video. Seedance 2.5 documents `mp4` (default)
119
+ * and `mov`; other models historically ship `mp4` only.
120
+ */
121
+ output_format?: BytePlusVideoOutputFormat;
106
122
  /**
107
123
  * Seconds after `created_at` at which an unfinished task is abandoned and
108
124
  * marked `expired`. Documented range `[3600, 259200]`, default 172800
109
- * (48 hours). The floor is enforced on Seedance 1.x but not on the 2.0
125
+ * (48 hours). The floor is enforced on Seedance 1.x but not on the 2.x
110
126
  * family.
111
127
  */
112
128
  execution_expires_after?: number;
@@ -148,6 +164,13 @@ export declare function supportsReferenceMedia(model: string): boolean;
148
164
  * @experimental Video generation is an experimental feature and may change.
149
165
  */
150
166
  export declare function supportsLastFrame(model: string): boolean;
167
+ /**
168
+ * True when the model is *known* to accept a reference-audio input without a
169
+ * visual reference. Same unknown-id caveat as {@link supportsReferenceMedia}.
170
+ *
171
+ * @experimental Video generation is an experimental feature and may change.
172
+ */
173
+ export declare function supportsAudioOnlyReference(model: string): boolean;
151
174
  /**
152
175
  * Splits a `size` template into its Seedance request fields.
153
176
  *
@@ -4,13 +4,15 @@ import { isKnownBytePlusVideoModel } from "../model-meta.js";
4
4
  * Provider options and per-model capability tables for the BytePlus Seedance
5
5
  * video models.
6
6
  *
7
- * Every applicability claim below was probed live against
7
+ * Applicability for Seedance 1.x / 2.0 was probed live against
8
8
  * `https://ark.ap-southeast.bytepluses.com/api/v3` on 2026-07-31. The probe
9
9
  * sent an out-of-range `seed` alongside the field under test, so requests that
10
10
  * passed validation still failed before a task was created (nothing billed):
11
11
  * an error naming the field under test means "rejected", an error naming
12
12
  * `seed` means "accepted". Ark reports only one arbitrary invalid parameter
13
- * per request, so each cell was retried until a verdict repeated.
13
+ * per request, so each cell was retried until a verdict repeated. Seedance 2.5
14
+ * cells come from the public ModelArk create-task docs once the model was
15
+ * fully opened (2026-08-07).
14
16
  *
15
17
  * Ark rejects an inapplicable field outright — "the specified parameter
16
18
  * `draft` is not supported for model seedance-1-0-pro in t2v, must be empty" —
@@ -19,15 +21,15 @@ import { isKnownBytePlusVideoModel } from "../model-meta.js";
19
21
  *
20
22
  * **Where the adapter guards, and where it doesn't** (deliberate, not an
21
23
  * oversight). Scalar applicability — `service_tier`, `draft`, `priority`,
22
- * `frames`, `camera_fixed` — is left to Ark, whose 400 names the offending
23
- * field and the model precisely enough to act on, and whose per-model rules
24
- * shift as BytePlus ships models. Duplicating that here would mean a table
25
- * that silently goes stale and starts rejecting requests the API would have
26
- * accepted. The adapter guards locally only where the API's own error is
27
- * misleading or arrives too late to be actionable: prompt media shape (role
28
- * vocabulary, frame-vs-reference exclusivity, frame cardinality) and the
29
- * resolution tier, both of which are derived from a caller's `prompt` /
30
- * `size` rather than passed through verbatim.
24
+ * `frames`, `camera_fixed`, `output_format` — is left to Ark, whose 400 names
25
+ * the offending field and the model precisely enough to act on, and whose
26
+ * per-model rules shift as BytePlus ships models. Duplicating that here would
27
+ * mean a table that silently goes stale and starts rejecting requests the API
28
+ * would have accepted. The adapter guards locally only where the API's own
29
+ * error is misleading or arrives too late to be actionable: prompt media shape
30
+ * (role vocabulary, frame-vs-reference exclusivity, frame cardinality,
31
+ * audio-only reference) and the resolution tier, both of which are derived
32
+ * from a caller's `prompt` / `size` rather than passed through verbatim.
31
33
  *
32
34
  * @experimental Video generation is an experimental feature and may change.
33
35
  */
@@ -48,15 +50,17 @@ var BYTEPLUS_VIDEO_RATIOS = [
48
50
  "adaptive"
49
51
  ];
50
52
  /**
51
- * Resolutions each model accepts, live-probed.
52
- *
53
- * Two findings here contradict the BytePlus prose docs and are worth calling
54
- * out: there is no 2K tier on any Seedance model (`2k`/`2K` is rejected
55
- * everywhere, including on the 2.0 flagship whose docs advertise "up to 4K"),
56
- * and `seedance-1-0-pro-fast-251015` does accept `1080p` despite being
57
- * documented as 480p/720p only.
53
+ * Resolutions each model accepts.
54
+ *
55
+ * 2.0 / 1.x cells were live-probed; 2.5 comes from the public ModelArk docs.
56
+ * Two findings still contradict older prose: there is no 2K tier on any
57
+ * Seedance model (`2k`/`2K` is rejected everywhere), and
58
+ * `seedance-1-0-pro-fast-251015` does accept `1080p` despite being documented
59
+ * as 480p/720p only. Seedance 2.5 is 480p/720p only — it does **not** offer
60
+ * the 2.0 flagship's 4k tier.
58
61
  */
59
62
  var BYTEPLUS_VIDEO_RESOLUTIONS = {
63
+ "dreamina-seedance-2-5-260628": ["480p", "720p"],
60
64
  "dreamina-seedance-2-0-260128": [
61
65
  "480p",
62
66
  "720p",
@@ -87,6 +91,7 @@ var BYTEPLUS_VIDEO_RESOLUTIONS = {
87
91
  * models reject it with "the specified task_type r2v does not support model …".
88
92
  */
89
93
  var BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS = /* @__PURE__ */ new Set([
94
+ "dreamina-seedance-2-5-260628",
90
95
  "dreamina-seedance-2-0-260128",
91
96
  "dreamina-seedance-2-0-fast-260128",
92
97
  "dreamina-seedance-2-0-mini-260615"
@@ -97,6 +102,7 @@ var BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS = /* @__PURE__ */ new Set([
97
102
  * does text-to-video and single-first-frame image-to-video only.
98
103
  */
99
104
  var BYTEPLUS_VIDEO_LAST_FRAME_MODELS = /* @__PURE__ */ new Set([
105
+ "dreamina-seedance-2-5-260628",
100
106
  "dreamina-seedance-2-0-260128",
101
107
  "dreamina-seedance-2-0-fast-260128",
102
108
  "dreamina-seedance-2-0-mini-260615",
@@ -104,6 +110,12 @@ var BYTEPLUS_VIDEO_LAST_FRAME_MODELS = /* @__PURE__ */ new Set([
104
110
  "seedance-1-0-pro-250528"
105
111
  ]);
106
112
  /**
113
+ * Models that accept a reference-audio input without a visual reference
114
+ * alongside it. Seedance 2.5 documents audio-only reference-to-video; the 2.0
115
+ * family rejects it with "reference_audio cannot be the only reference input".
116
+ */
117
+ var BYTEPLUS_VIDEO_AUDIO_ONLY_REFERENCE_MODELS = /* @__PURE__ */ new Set(["dreamina-seedance-2-5-260628"]);
118
+ /**
107
119
  * True when the model is *known* to support reference-media mode (reference
108
120
  * images, video and audio). An id this package has no metadata for answers
109
121
  * `false`; callers must decide whether that means "no" or "unknown" — the
@@ -124,6 +136,15 @@ function supportsLastFrame(model) {
124
136
  return BYTEPLUS_VIDEO_LAST_FRAME_MODELS.has(model);
125
137
  }
126
138
  /**
139
+ * True when the model is *known* to accept a reference-audio input without a
140
+ * visual reference. Same unknown-id caveat as {@link supportsReferenceMedia}.
141
+ *
142
+ * @experimental Video generation is an experimental feature and may change.
143
+ */
144
+ function supportsAudioOnlyReference(model) {
145
+ return BYTEPLUS_VIDEO_AUDIO_ONLY_REFERENCE_MODELS.has(model);
146
+ }
147
+ /**
127
148
  * Splits a `size` template into its Seedance request fields.
128
149
  *
129
150
  * The template is either a bare aspect ratio (`'16:9'`) or
@@ -186,6 +207,6 @@ function resolveBytePlusVideoSize(model, size) {
186
207
  };
187
208
  }
188
209
  //#endregion
189
- export { parseBytePlusVideoSize, resolveBytePlusVideoResolution, resolveBytePlusVideoSize, supportsLastFrame, supportsReferenceMedia };
210
+ export { parseBytePlusVideoSize, resolveBytePlusVideoResolution, resolveBytePlusVideoSize, supportsAudioOnlyReference, supportsLastFrame, supportsReferenceMedia };
190
211
 
191
212
  //# sourceMappingURL=video-provider-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"video-provider-options.js","names":[],"sources":["../../../src/video/video-provider-options.ts"],"sourcesContent":["/**\n * Provider options and per-model capability tables for the BytePlus Seedance\n * video models.\n *\n * Every applicability claim below was probed live against\n * `https://ark.ap-southeast.bytepluses.com/api/v3` on 2026-07-31. The probe\n * sent an out-of-range `seed` alongside the field under test, so requests that\n * passed validation still failed before a task was created (nothing billed):\n * an error naming the field under test means \"rejected\", an error naming\n * `seed` means \"accepted\". Ark reports only one arbitrary invalid parameter\n * per request, so each cell was retried until a verdict repeated.\n *\n * Ark rejects an inapplicable field outright — \"the specified parameter\n * `draft` is not supported for model seedance-1-0-pro in t2v, must be empty\" —\n * so these tables are not cosmetic: sending a field to the wrong model is a\n * 400, not a no-op.\n *\n * **Where the adapter guards, and where it doesn't** (deliberate, not an\n * oversight). Scalar applicability — `service_tier`, `draft`, `priority`,\n * `frames`, `camera_fixed` — is left to Ark, whose 400 names the offending\n * field and the model precisely enough to act on, and whose per-model rules\n * shift as BytePlus ships models. Duplicating that here would mean a table\n * that silently goes stale and starts rejecting requests the API would have\n * accepted. The adapter guards locally only where the API's own error is\n * misleading or arrives too late to be actionable: prompt media shape (role\n * vocabulary, frame-vs-reference exclusivity, frame cardinality) and the\n * resolution tier, both of which are derived from a caller's `prompt` /\n * `size` rather than passed through verbatim.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\n\nimport { isKnownBytePlusVideoModel } from '../model-meta'\nimport type {\n BytePlusVideoModel,\n BytePlusVideoModelOrString,\n BytePlusVideoRatio,\n BytePlusVideoResolution,\n} from '../model-meta'\n\n/**\n * Inference queue for the request.\n *\n * - `default` — online inference: lower RPM and concurrency quotas, lowest\n * latency.\n * - `flex` — offline batch inference: higher daily token quotas at half the\n * price, with no latency guarantee. Task ids come back with a `cgt-batch-`\n * prefix (live-verified).\n *\n * Only the Seedance 1.x models accept this field. The Seedance 2.0 family\n * rejects it (\"service_tier is not supported … must be empty\").\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type BytePlusVideoServiceTier = 'default' | 'flex'\n\n/**\n * Provider-specific options for Seedance video generation. These map one-to-one\n * onto the create-task request body and take precedence over the values the\n * adapter derives from the generic `size` / `duration` options.\n *\n * Fields are model-dependent; each one documents where it applies. Passing a\n * field to a model that does not accept it is a 400 from Ark, not a silent\n * ignore.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport interface BytePlusVideoProviderOptions {\n /**\n * Output aspect ratio. Overrides the ratio half of the generic `size`.\n *\n * `adaptive` (follow the input frame) is the default on Seedance 2.0 and\n * 1.5-pro but is rejected by Seedance 1.0-pro / 1.0-pro-fast for\n * text-to-video.\n */\n ratio?: BytePlusVideoRatio\n\n /**\n * Output resolution tier. Overrides the resolution half of the generic\n * `size`. Matched case-insensitively by the API; this package uses\n * lowercase throughout. `4k` exists only on `dreamina-seedance-2-0-260128`,\n * and there is no 2K tier on any model.\n */\n resolution?: BytePlusVideoResolution\n\n /**\n * Whole seconds of output. Overrides the generic `duration`, and unlike it\n * is sent verbatim rather than snapped into the model's range.\n *\n * `-1` asks the model to choose its own length; accepted by Seedance 2.0\n * and 1.5-pro only.\n */\n duration?: number\n\n /**\n * Frame count instead of `duration`, for fractional-second output. Takes\n * precedence over `duration` server-side. Valid values are the integers of\n * the form `25 + 4n` within `[29, 289]`, at 24 fps.\n *\n * Seedance 1.0-pro and 1.0-pro-fast only.\n */\n frames?: number\n\n /**\n * Randomness seed, an integer in `[-1, 2^32-1]`. `-1` (the default) leaves\n * generation unseeded. Accepted by every Seedance model.\n */\n seed?: number\n\n /**\n * Appends a \"fix the camera\" instruction to the prompt. Best-effort — the\n * model is not constrained to obey it.\n *\n * Seedance 1.5-pro, 1.0-pro and 1.0-pro-fast only; the 2.0 family rejects\n * it.\n */\n camera_fixed?: boolean\n\n /** Burn a watermark into the output. Defaults to `false`. */\n watermark?: boolean\n\n /**\n * Generate an audio track synchronized with the visuals — dialogue, effects\n * and score inferred from the prompt. Quote dialogue in the prompt for\n * better results.\n *\n * Accepted by every model at the API's validation layer, but only Seedance\n * 2.0 and 1.5-pro actually produce audio.\n */\n generate_audio?: boolean\n\n /**\n * Inference queue. Seedance 1.x only — the 2.0 family has no offline tier.\n */\n service_tier?: BytePlusVideoServiceTier\n\n /**\n * Also return the video's final frame as a watermark-free PNG, readable from\n * the finished task as `content.last_frame_url`. Chain it into the next\n * task's first frame to extend a shot. Accepted by every model.\n */\n return_last_frame?: boolean\n\n /**\n * Render a cheap, low-fidelity preview to sanity-check staging and camera\n * work before paying for the real thing.\n *\n * Seedance 1.5-pro only.\n */\n draft?: boolean\n\n /**\n * Queue priority, `[0, 9]`. Seedance 2.0 family only — 1.5-pro rejects it,\n * and the 1.0 models accept it without acting on it.\n */\n priority?: number\n\n /**\n * Seconds after `created_at` at which an unfinished task is abandoned and\n * marked `expired`. Documented range `[3600, 259200]`, default 172800\n * (48 hours). The floor is enforced on Seedance 1.x but not on the 2.0\n * family.\n */\n execution_expires_after?: number\n\n /**\n * URL that receives a POST with the full task payload on every status\n * change. BytePlus retries a failed delivery three times.\n */\n callback_url?: string\n\n /**\n * Stable opaque identifier for the end user driving the request, for abuse\n * attribution. Max 64 characters — hash the real identifier rather than\n * sending it.\n */\n safety_identifier?: string\n}\n\n/**\n * Type-only map from video model name to its provider options. Seedance takes\n * the same option surface across models; applicability is per-field and\n * documented on {@link BytePlusVideoProviderOptions}.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type BytePlusVideoModelProviderOptionsByName = {\n [K in BytePlusVideoModel]: BytePlusVideoProviderOptions\n}\n\n/**\n * Aspect ratios accepted by the create endpoint.\n *\n * `adaptive` is rejected by Seedance 1.0-pro / 1.0-pro-fast for text-to-video\n * but is the documented default for their image-to-video path, so it is not\n * filtered per model here.\n */\nconst BYTEPLUS_VIDEO_RATIOS: ReadonlyArray<string> = [\n '16:9',\n '9:16',\n '4:3',\n '3:4',\n '1:1',\n '21:9',\n 'adaptive',\n]\n\n/**\n * Resolutions each model accepts, live-probed.\n *\n * Two findings here contradict the BytePlus prose docs and are worth calling\n * out: there is no 2K tier on any Seedance model (`2k`/`2K` is rejected\n * everywhere, including on the 2.0 flagship whose docs advertise \"up to 4K\"),\n * and `seedance-1-0-pro-fast-251015` does accept `1080p` despite being\n * documented as 480p/720p only.\n */\nconst BYTEPLUS_VIDEO_RESOLUTIONS: {\n readonly [K in BytePlusVideoModel]: ReadonlyArray<BytePlusVideoResolution>\n} = {\n 'dreamina-seedance-2-0-260128': ['480p', '720p', '1080p', '4k'],\n 'dreamina-seedance-2-0-fast-260128': ['480p', '720p'],\n 'dreamina-seedance-2-0-mini-260615': ['480p', '720p'],\n 'seedance-1-5-pro-251215': ['480p', '720p', '1080p'],\n 'seedance-1-0-pro-250528': ['480p', '720p', '1080p'],\n 'seedance-1-0-pro-fast-251015': ['480p', '720p', '1080p'],\n}\n\n/**\n * Models accepting reference-media mode (`r2v`): reference images, video and\n * audio that the output draws on without pinning specific frames. The 1.x\n * models reject it with \"the specified task_type r2v does not support model …\".\n */\nconst BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS: ReadonlySet<string> = new Set([\n 'dreamina-seedance-2-0-260128',\n 'dreamina-seedance-2-0-fast-260128',\n 'dreamina-seedance-2-0-mini-260615',\n])\n\n/**\n * Models accepting a closing frame (`flf2v`, first-and-last-frame mode).\n * `seedance-1-0-pro-fast-251015` is the one Seedance model without it — it\n * does text-to-video and single-first-frame image-to-video only.\n */\nconst BYTEPLUS_VIDEO_LAST_FRAME_MODELS: ReadonlySet<string> = new Set([\n 'dreamina-seedance-2-0-260128',\n 'dreamina-seedance-2-0-fast-260128',\n 'dreamina-seedance-2-0-mini-260615',\n 'seedance-1-5-pro-251215',\n 'seedance-1-0-pro-250528',\n])\n\n/**\n * True when the model is *known* to support reference-media mode (reference\n * images, video and audio). An id this package has no metadata for answers\n * `false`; callers must decide whether that means \"no\" or \"unknown\" — the\n * adapter treats it as unknown and lets Ark rule.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function supportsReferenceMedia(model: string): boolean {\n return BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS.has(model)\n}\n\n/**\n * True when the model is *known* to support pinning the video's closing\n * frame. Same unknown-id caveat as {@link supportsReferenceMedia}.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function supportsLastFrame(model: string): boolean {\n return BYTEPLUS_VIDEO_LAST_FRAME_MODELS.has(model)\n}\n\n/**\n * Splits a `size` template into its Seedance request fields.\n *\n * The template is either a bare aspect ratio (`'16:9'`) or\n * `ratio_resolution` (`'16:9_720p'`), mirroring the grok video adapter.\n * Returns `undefined` when the string doesn't match the template at all.\n *\n * The resolution half comes back lowercased. Ark itself matches the field\n * case-insensitively, but this package standardizes on lowercase so callers\n * can compare the result against {@link BytePlusVideoResolution} directly.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function parseBytePlusVideoSize(\n size: string,\n): { ratio: string; resolution?: string } | undefined {\n const match = /^(\\d+:\\d+|adaptive)(?:_(.+))?$/.exec(size)\n const [, ratio, resolution] = match ?? []\n if (ratio === undefined) return undefined\n return {\n ratio,\n ...(resolution !== undefined && { resolution: resolution.toLowerCase() }),\n }\n}\n\n/**\n * Validates a resolution against a model's tiers, returning it lowercased.\n *\n * Used for both halves of the request: the resolution parsed out of the\n * generic `size`, and a `modelOptions.resolution` that overrides it. A model\n * this package has no table for is normalized but not checked — see\n * {@link BytePlusVideoModelOrString}.\n *\n * @throws Error when a known model does not offer the tier.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function resolveBytePlusVideoResolution(\n model: BytePlusVideoModelOrString,\n resolution: string,\n): string {\n const normalized = resolution.toLowerCase()\n if (!isKnownBytePlusVideoModel(model)) return normalized\n\n const allowed = BYTEPLUS_VIDEO_RESOLUTIONS[model]\n if (!allowed.includes(normalized as BytePlusVideoResolution)) {\n throw new Error(\n `byteplus: resolution \"${resolution}\" is not supported by model ` +\n `\"${model}\". Supported resolutions: ${allowed.join(', ')}.`,\n )\n }\n return normalized\n}\n\n/**\n * Validates a `size` template against a model and returns the request fields\n * it maps onto, with the resolution lowercased.\n *\n * For an unknown model only the template's *shape* is checked — enough to\n * split it into `ratio` and `resolution` — because a future model may bring\n * ratios and tiers that do not exist today. Ark validates the values.\n *\n * @throws Error when the template is malformed, or (known models only) the\n * ratio is unknown or the resolution is not offered by this model.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function resolveBytePlusVideoSize(\n model: BytePlusVideoModelOrString,\n size: string,\n): { ratio: string; resolution?: string } {\n const parsed = parseBytePlusVideoSize(size)\n const known = isKnownBytePlusVideoModel(model)\n if (!parsed || (known && !BYTEPLUS_VIDEO_RATIOS.includes(parsed.ratio))) {\n throw new Error(\n `byteplus: size \"${size}\" is not supported by model \"${model}\". Expected ` +\n `\"ratio\" or \"ratio_resolution\" (e.g. \"16:9_720p\") with ratio one of: ` +\n `${BYTEPLUS_VIDEO_RATIOS.join(', ')}.`,\n )\n }\n\n return {\n ratio: parsed.ratio,\n ...(parsed.resolution !== undefined && {\n resolution: resolveBytePlusVideoResolution(model, parsed.resolution),\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqMA,IAAM,wBAA+C;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;AAWA,IAAM,6BAEF;CACF,gCAAgC;EAAC;EAAQ;EAAQ;EAAS;CAAI;CAC9D,qCAAqC,CAAC,QA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BAAsB,KAAK,IAAI,EAAE,EACxC;CAGF,OAAO;EACL,OAAO,OAAO;EACd,GAAI,OAAO,eAAe,KAAA,KAAa,EACrC,YAAY,+BAA+B,OAAO,OAAO,UAAU,EACrE;CACF;AACF"}
1
+ {"version":3,"file":"video-provider-options.js","names":[],"sources":["../../../src/video/video-provider-options.ts"],"sourcesContent":["/**\n * Provider options and per-model capability tables for the BytePlus Seedance\n * video models.\n *\n * Applicability for Seedance 1.x / 2.0 was probed live against\n * `https://ark.ap-southeast.bytepluses.com/api/v3` on 2026-07-31. The probe\n * sent an out-of-range `seed` alongside the field under test, so requests that\n * passed validation still failed before a task was created (nothing billed):\n * an error naming the field under test means \"rejected\", an error naming\n * `seed` means \"accepted\". Ark reports only one arbitrary invalid parameter\n * per request, so each cell was retried until a verdict repeated. Seedance 2.5\n * cells come from the public ModelArk create-task docs once the model was\n * fully opened (2026-08-07).\n *\n * Ark rejects an inapplicable field outright — \"the specified parameter\n * `draft` is not supported for model seedance-1-0-pro in t2v, must be empty\" —\n * so these tables are not cosmetic: sending a field to the wrong model is a\n * 400, not a no-op.\n *\n * **Where the adapter guards, and where it doesn't** (deliberate, not an\n * oversight). Scalar applicability — `service_tier`, `draft`, `priority`,\n * `frames`, `camera_fixed`, `output_format` — is left to Ark, whose 400 names\n * the offending field and the model precisely enough to act on, and whose\n * per-model rules shift as BytePlus ships models. Duplicating that here would\n * mean a table that silently goes stale and starts rejecting requests the API\n * would have accepted. The adapter guards locally only where the API's own\n * error is misleading or arrives too late to be actionable: prompt media shape\n * (role vocabulary, frame-vs-reference exclusivity, frame cardinality,\n * audio-only reference) and the resolution tier, both of which are derived\n * from a caller's `prompt` / `size` rather than passed through verbatim.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\n\nimport { isKnownBytePlusVideoModel } from '../model-meta'\nimport type {\n BytePlusVideoModel,\n BytePlusVideoModelOrString,\n BytePlusVideoRatio,\n BytePlusVideoResolution,\n} from '../model-meta'\n\n/**\n * Inference queue for the request.\n *\n * - `default` — online inference: lower RPM and concurrency quotas, lowest\n * latency.\n * - `flex` — offline batch inference: higher daily token quotas at half the\n * price, with no latency guarantee. Task ids come back with a `cgt-batch-`\n * prefix (live-verified).\n *\n * Only the Seedance 1.x models accept this field. Seedance 2.5 and the 2.0\n * family reject it (\"service_tier is not supported … must be empty\" / \"not\n * currently supported\").\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type BytePlusVideoServiceTier = 'default' | 'flex'\n\n/**\n * Container format of the generated video.\n *\n * Seedance 2.5 documents `mp4` (default) and `mov`. Other models historically\n * return `mp4` only; scalar applicability is left to Ark (see file header).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type BytePlusVideoOutputFormat = 'mp4' | 'mov'\n\n/**\n * Provider-specific options for Seedance video generation. These map one-to-one\n * onto the create-task request body and take precedence over the values the\n * adapter derives from the generic `size` / `duration` options.\n *\n * Fields are model-dependent; each one documents where it applies. Passing a\n * field to a model that does not accept it is a 400 from Ark, not a silent\n * ignore.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport interface BytePlusVideoProviderOptions {\n /**\n * Output aspect ratio. Overrides the ratio half of the generic `size`.\n *\n * `adaptive` (follow the input frame) is the default on Seedance 2.5, 2.0\n * and 1.5-pro but is rejected by Seedance 1.0-pro / 1.0-pro-fast for\n * text-to-video.\n */\n ratio?: BytePlusVideoRatio\n\n /**\n * Output resolution tier. Overrides the resolution half of the generic\n * `size`. Matched case-insensitively by the API; this package uses\n * lowercase throughout. `4k` exists only on `dreamina-seedance-2-0-260128`\n * (Seedance 2.5 is 480p/720p only), and there is no 2K tier on any model.\n */\n resolution?: BytePlusVideoResolution\n\n /**\n * Whole seconds of output. Overrides the generic `duration`, and unlike it\n * is sent verbatim rather than snapped into the model's range.\n *\n * `-1` asks the model to choose its own length; accepted by Seedance 2.5,\n * 2.0 and 1.5-pro only. On 2.5 video-editing tasks, `-1` is required.\n */\n duration?: number\n\n /**\n * Frame count instead of `duration`, for fractional-second output. Takes\n * precedence over `duration` server-side. Valid values are the integers of\n * the form `25 + 4n` within `[29, 289]`, at 24 fps.\n *\n * Seedance 1.0-pro and 1.0-pro-fast only.\n */\n frames?: number\n\n /**\n * Randomness seed, an integer in `[-1, 2^32-1]`. `-1` (the default) leaves\n * generation unseeded. Accepted by every Seedance model.\n */\n seed?: number\n\n /**\n * Appends a \"fix the camera\" instruction to the prompt. Best-effort — the\n * model is not constrained to obey it.\n *\n * Seedance 1.5-pro, 1.0-pro and 1.0-pro-fast only; the 2.x family rejects\n * it.\n */\n camera_fixed?: boolean\n\n /** Burn a watermark into the output. Defaults to `false`. */\n watermark?: boolean\n\n /**\n * Generate an audio track synchronized with the visuals — dialogue, effects\n * and score inferred from the prompt. Quote dialogue in the prompt for\n * better results.\n *\n * Accepted by every model at the API's validation layer, but only Seedance\n * 2.5, 2.0 and 1.5-pro actually produce audio.\n */\n generate_audio?: boolean\n\n /**\n * Inference queue. Seedance 1.x only — Seedance 2.5 and the 2.0 family have\n * no offline tier.\n */\n service_tier?: BytePlusVideoServiceTier\n\n /**\n * Also return the video's final frame as a watermark-free PNG, readable from\n * the finished task as `content.last_frame_url`. Chain it into the next\n * task's first frame to extend a shot. Accepted by every model.\n */\n return_last_frame?: boolean\n\n /**\n * Render a cheap, low-fidelity preview to sanity-check staging and camera\n * work before paying for the real thing.\n *\n * Seedance 1.5-pro only.\n */\n draft?: boolean\n\n /**\n * Queue priority, `[0, 9]`. Seedance 2.5 and the 2.0 family — 1.5-pro\n * rejects it, and the 1.0 models accept it without acting on it.\n */\n priority?: number\n\n /**\n * Container of the generated video. Seedance 2.5 documents `mp4` (default)\n * and `mov`; other models historically ship `mp4` only.\n */\n output_format?: BytePlusVideoOutputFormat\n\n /**\n * Seconds after `created_at` at which an unfinished task is abandoned and\n * marked `expired`. Documented range `[3600, 259200]`, default 172800\n * (48 hours). The floor is enforced on Seedance 1.x but not on the 2.x\n * family.\n */\n execution_expires_after?: number\n\n /**\n * URL that receives a POST with the full task payload on every status\n * change. BytePlus retries a failed delivery three times.\n */\n callback_url?: string\n\n /**\n * Stable opaque identifier for the end user driving the request, for abuse\n * attribution. Max 64 characters — hash the real identifier rather than\n * sending it.\n */\n safety_identifier?: string\n}\n\n/**\n * Type-only map from video model name to its provider options. Seedance takes\n * the same option surface across models; applicability is per-field and\n * documented on {@link BytePlusVideoProviderOptions}.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type BytePlusVideoModelProviderOptionsByName = {\n [K in BytePlusVideoModel]: BytePlusVideoProviderOptions\n}\n\n/**\n * Aspect ratios accepted by the create endpoint.\n *\n * `adaptive` is rejected by Seedance 1.0-pro / 1.0-pro-fast for text-to-video\n * but is the documented default for their image-to-video path, so it is not\n * filtered per model here.\n */\nconst BYTEPLUS_VIDEO_RATIOS: ReadonlyArray<string> = [\n '16:9',\n '9:16',\n '4:3',\n '3:4',\n '1:1',\n '21:9',\n 'adaptive',\n]\n\n/**\n * Resolutions each model accepts.\n *\n * 2.0 / 1.x cells were live-probed; 2.5 comes from the public ModelArk docs.\n * Two findings still contradict older prose: there is no 2K tier on any\n * Seedance model (`2k`/`2K` is rejected everywhere), and\n * `seedance-1-0-pro-fast-251015` does accept `1080p` despite being documented\n * as 480p/720p only. Seedance 2.5 is 480p/720p only — it does **not** offer\n * the 2.0 flagship's 4k tier.\n */\nconst BYTEPLUS_VIDEO_RESOLUTIONS: {\n readonly [K in BytePlusVideoModel]: ReadonlyArray<BytePlusVideoResolution>\n} = {\n 'dreamina-seedance-2-5-260628': ['480p', '720p'],\n 'dreamina-seedance-2-0-260128': ['480p', '720p', '1080p', '4k'],\n 'dreamina-seedance-2-0-fast-260128': ['480p', '720p'],\n 'dreamina-seedance-2-0-mini-260615': ['480p', '720p'],\n 'seedance-1-5-pro-251215': ['480p', '720p', '1080p'],\n 'seedance-1-0-pro-250528': ['480p', '720p', '1080p'],\n 'seedance-1-0-pro-fast-251015': ['480p', '720p', '1080p'],\n}\n\n/**\n * Models accepting reference-media mode (`r2v`): reference images, video and\n * audio that the output draws on without pinning specific frames. The 1.x\n * models reject it with \"the specified task_type r2v does not support model …\".\n */\nconst BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS: ReadonlySet<string> = new Set([\n 'dreamina-seedance-2-5-260628',\n 'dreamina-seedance-2-0-260128',\n 'dreamina-seedance-2-0-fast-260128',\n 'dreamina-seedance-2-0-mini-260615',\n])\n\n/**\n * Models accepting a closing frame (`flf2v`, first-and-last-frame mode).\n * `seedance-1-0-pro-fast-251015` is the one Seedance model without it — it\n * does text-to-video and single-first-frame image-to-video only.\n */\nconst BYTEPLUS_VIDEO_LAST_FRAME_MODELS: ReadonlySet<string> = new Set([\n 'dreamina-seedance-2-5-260628',\n 'dreamina-seedance-2-0-260128',\n 'dreamina-seedance-2-0-fast-260128',\n 'dreamina-seedance-2-0-mini-260615',\n 'seedance-1-5-pro-251215',\n 'seedance-1-0-pro-250528',\n])\n\n/**\n * Models that accept a reference-audio input without a visual reference\n * alongside it. Seedance 2.5 documents audio-only reference-to-video; the 2.0\n * family rejects it with \"reference_audio cannot be the only reference input\".\n */\nconst BYTEPLUS_VIDEO_AUDIO_ONLY_REFERENCE_MODELS: ReadonlySet<string> = new Set(\n ['dreamina-seedance-2-5-260628'],\n)\n\n/**\n * True when the model is *known* to support reference-media mode (reference\n * images, video and audio). An id this package has no metadata for answers\n * `false`; callers must decide whether that means \"no\" or \"unknown\" — the\n * adapter treats it as unknown and lets Ark rule.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function supportsReferenceMedia(model: string): boolean {\n return BYTEPLUS_VIDEO_REFERENCE_MEDIA_MODELS.has(model)\n}\n\n/**\n * True when the model is *known* to support pinning the video's closing\n * frame. Same unknown-id caveat as {@link supportsReferenceMedia}.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function supportsLastFrame(model: string): boolean {\n return BYTEPLUS_VIDEO_LAST_FRAME_MODELS.has(model)\n}\n\n/**\n * True when the model is *known* to accept a reference-audio input without a\n * visual reference. Same unknown-id caveat as {@link supportsReferenceMedia}.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function supportsAudioOnlyReference(model: string): boolean {\n return BYTEPLUS_VIDEO_AUDIO_ONLY_REFERENCE_MODELS.has(model)\n}\n\n/**\n * Splits a `size` template into its Seedance request fields.\n *\n * The template is either a bare aspect ratio (`'16:9'`) or\n * `ratio_resolution` (`'16:9_720p'`), mirroring the grok video adapter.\n * Returns `undefined` when the string doesn't match the template at all.\n *\n * The resolution half comes back lowercased. Ark itself matches the field\n * case-insensitively, but this package standardizes on lowercase so callers\n * can compare the result against {@link BytePlusVideoResolution} directly.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function parseBytePlusVideoSize(\n size: string,\n): { ratio: string; resolution?: string } | undefined {\n const match = /^(\\d+:\\d+|adaptive)(?:_(.+))?$/.exec(size)\n const [, ratio, resolution] = match ?? []\n if (ratio === undefined) return undefined\n return {\n ratio,\n ...(resolution !== undefined && { resolution: resolution.toLowerCase() }),\n }\n}\n\n/**\n * Validates a resolution against a model's tiers, returning it lowercased.\n *\n * Used for both halves of the request: the resolution parsed out of the\n * generic `size`, and a `modelOptions.resolution` that overrides it. A model\n * this package has no table for is normalized but not checked — see\n * {@link BytePlusVideoModelOrString}.\n *\n * @throws Error when a known model does not offer the tier.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function resolveBytePlusVideoResolution(\n model: BytePlusVideoModelOrString,\n resolution: string,\n): string {\n const normalized = resolution.toLowerCase()\n if (!isKnownBytePlusVideoModel(model)) return normalized\n\n const allowed = BYTEPLUS_VIDEO_RESOLUTIONS[model]\n if (!allowed.includes(normalized as BytePlusVideoResolution)) {\n throw new Error(\n `byteplus: resolution \"${resolution}\" is not supported by model ` +\n `\"${model}\". Supported resolutions: ${allowed.join(', ')}.`,\n )\n }\n return normalized\n}\n\n/**\n * Validates a `size` template against a model and returns the request fields\n * it maps onto, with the resolution lowercased.\n *\n * For an unknown model only the template's *shape* is checked — enough to\n * split it into `ratio` and `resolution` — because a future model may bring\n * ratios and tiers that do not exist today. Ark validates the values.\n *\n * @throws Error when the template is malformed, or (known models only) the\n * ratio is unknown or the resolution is not offered by this model.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function resolveBytePlusVideoSize(\n model: BytePlusVideoModelOrString,\n size: string,\n): { ratio: string; resolution?: string } {\n const parsed = parseBytePlusVideoSize(size)\n const known = isKnownBytePlusVideoModel(model)\n if (!parsed || (known && !BYTEPLUS_VIDEO_RATIOS.includes(parsed.ratio))) {\n throw new Error(\n `byteplus: size \"${size}\" is not supported by model \"${model}\". Expected ` +\n `\"ratio\" or \"ratio_resolution\" (e.g. \"16:9_720p\") with ratio one of: ` +\n `${BYTEPLUS_VIDEO_RATIOS.join(', ')}.`,\n )\n }\n\n return {\n ratio: parsed.ratio,\n ...(parsed.resolution !== undefined && {\n resolution: resolveBytePlusVideoResolution(model, parsed.resolution),\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyNA,IAAM,wBAA+C;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;AAYA,IAAM,6BAEF;CACF,gCAAgC,CAAC,QAAQ,MAAM;CAC/C,gCAAgC;EAAC;EAAQ;EAAQ;EAAS;CAAI;CAC9D,qCAAqC,CAAC,QAAQ,MAAM;CACpD,qCAAqC,CAAC,QAAQ,MAAM;CACpD,2BAA2B;EAAC;EAAQ;EAAQ;CAAO;CACnD,2BAA2B;EAAC;EAAQ;EAAQ;CAAO;CACnD,gCAAgC;EAAC;EAAQ;EAAQ;CAAO;AAC1D;;;;;;AAOA,IAAM,wDAA6D,IAAI,IAAI;CACzE;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,IAAM,mDAAwD,IAAI,IAAI;CACpE;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,IAAM,6DAAkE,IAAI,IAC1E,CAAC,8BAA8B,CAC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**
75
- * An audio input. Live-verified: audio can only accompany another reference
76
- * input — "reference_audio cannot be the only reference input".
75
+ * An audio input.
76
+ *
77
+ * On Seedance 2.0, audio can only accompany another reference input —
78
+ * "reference_audio cannot be the only reference input". Seedance 2.5
79
+ * documents audio-only reference-to-video.
77
80
  */
78
81
  export interface BytePlusVideoAudioContent {
79
82
  type: 'audio_url';
@@ -86,9 +89,10 @@ export interface BytePlusVideoAudioContent {
86
89
  * One entry of the `content[]` array.
87
90
  *
88
91
  * The create schema declares `maxItems: 5`, but the live API does not enforce
89
- * it — 7 entries (6 reference images plus text) were accepted on
90
- * `dreamina-seedance-2-0-260128`. The adapter therefore does not cap the array
91
- * locally; a genuinely over-long request gets whatever Ark decides to say.
92
+ * it — Seedance 2.5 accepts up to 30 reference images plus videos and audio,
93
+ * and 7 entries were accepted on `dreamina-seedance-2-0-260128`. The adapter
94
+ * therefore does not cap the array locally; a genuinely over-long request
95
+ * gets whatever Ark decides to say.
92
96
  */
93
97
  export type BytePlusVideoContentPart = BytePlusVideoTextContent | BytePlusVideoImageContent | BytePlusVideoVideoContent | BytePlusVideoAudioContent;
94
98
  /**
@@ -98,19 +102,21 @@ export type BytePlusVideoContentPart = BytePlusVideoTextContent | BytePlusVideoI
98
102
  * model-dependent — Ark rejects an inapplicable field outright ("the
99
103
  * specified parameter `draft` is not supported for model … must be empty")
100
104
  * rather than ignoring it, so the adapter only sends what the caller asked
101
- * for. See `video-provider-options.ts` for the live-probed applicability
102
- * matrix.
105
+ * for. See `video-provider-options.ts` for the applicability matrix.
103
106
  */
104
107
  export interface BytePlusVideoCreateRequest {
105
108
  /** Seedance model id (or a preconfigured endpoint id). */
106
109
  model: string;
107
- /** Prompt text plus any image / video / audio inputs, max 5 entries. */
110
+ /** Prompt text plus any image / video / audio inputs. */
108
111
  content: Array<BytePlusVideoContentPart>;
109
112
  /** Output aspect ratio, e.g. `16:9`. `adaptive` follows the input frame. */
110
113
  ratio?: string;
111
114
  /** Resolution tier, e.g. `720p`. Matched case-insensitively by the API. */
112
115
  resolution?: string;
113
- /** Whole seconds of output. `-1` lets the model choose (Seedance 2.0 / 1.5). */
116
+ /**
117
+ * Whole seconds of output. `-1` lets the model choose (Seedance 2.5 / 2.0 /
118
+ * 1.5-pro).
119
+ */
114
120
  duration?: number;
115
121
  /** Frame count, an alternative to `duration` that allows fractional seconds. */
116
122
  frames?: number;
@@ -130,6 +136,8 @@ export interface BytePlusVideoCreateRequest {
130
136
  draft?: boolean;
131
137
  /** Queue priority `[0, 9]`. */
132
138
  priority?: number;
139
+ /** Container of the generated video, e.g. `mp4` or `mov`. */
140
+ output_format?: string;
133
141
  /** Seconds from `created_at` after which the task is marked `expired`. */
134
142
  execution_expires_after?: number;
135
143
  /** URL that receives a POST with the task payload on each status change. */