@sogni-ai/sogni-creative-agent-skill 3.73.2 → 3.73.4

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.
@@ -3,7 +3,7 @@ name: sogni-creative-agent-skill
3
3
  description: "Generate and edit images, create Pixal3D 3D models, remove backgrounds with BiRefNet, synthesize Qwen3-TTS speech, upscale images, create video and music, animate image folders into seamless reels, and manage reusable personas with Sogni AI. Use when a Hermes user asks to draw, render, upscale, edit or restyle an image, animate an image, make a video, create music or lyrics, build a media workflow, build a playable world, apply a saved identity, or refine an earlier Sogni result."
4
4
  license: MIT
5
5
  metadata:
6
- version: "3.73.2"
6
+ version: "3.73.4"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -64,7 +64,7 @@ Prompt-only families return the directly runnable prompt with no label,
64
64
  Markdown fence, preamble, explanation, or render offer.
65
65
 
66
66
  <!-- BEGIN GENERATED PROMPT GUIDE: image-models -->
67
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
67
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
68
68
 
69
69
  ## Per-model rules from Sogni's image prompt writer
70
70
 
@@ -124,7 +124,7 @@ LTX-2.5 text-to-video, one shot, so one sentence: "A medium shot frames a woman
124
124
  ```
125
125
 
126
126
  <!-- BEGIN GENERATED PROMPT GUIDE: ltx-2.5 -->
127
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
127
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
128
128
 
129
129
  ### Sogni's prompt rules: ltx-2.5
130
130
 
@@ -179,7 +179,7 @@ Preserve requested visual style and production value without adding new objects,
179
179
  <!-- END GENERATED PROMPT GUIDE: ltx-2.5 -->
180
180
 
181
181
  <!-- BEGIN GENERATED PROMPT GUIDE: ltx-2.3 -->
182
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
182
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
183
183
 
184
184
  ### Sogni's prompt rules: ltx-2.3
185
185
 
@@ -977,7 +977,7 @@ the exact waveform-conditioned lip-sync input. Remote audio URLs and additional
977
977
  audio references keep their existing handling.
978
978
 
979
979
  <!-- BEGIN GENERATED PROMPT GUIDE: minimax-h3 -->
980
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
980
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
981
981
 
982
982
  ### Sogni's prompt rules: minimax-h3
983
983
 
@@ -1195,7 +1195,7 @@ A low tracking shot races alongside a teal 1960s convertible down a sunlit coast
1195
1195
  ```
1196
1196
 
1197
1197
  <!-- BEGIN GENERATED PROMPT GUIDE: seedance-2.5 -->
1198
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1198
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1199
1199
 
1200
1200
  ### Sogni's prompt rules: seedance-2.5
1201
1201
 
@@ -1269,7 +1269,7 @@ TARGET CAPABILITIES: Seedance 2.5 uses the same director-style prompt grammar an
1269
1269
  <!-- END GENERATED PROMPT GUIDE: seedance-2.5 -->
1270
1270
 
1271
1271
  <!-- BEGIN GENERATED PROMPT GUIDE: seedance-2.0 -->
1272
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1272
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1273
1273
 
1274
1274
  ### Sogni's prompt rules: seedance-2.0
1275
1275
 
@@ -1378,7 +1378,7 @@ writer uses close this section.
1378
1378
  motion timing, camera path, framing, and background.
1379
1379
 
1380
1380
  <!-- BEGIN GENERATED PROMPT GUIDE: wan-2.2 -->
1381
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1381
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1382
1382
 
1383
1383
  ### Sogni's prompt rules: wan-2.2
1384
1384
 
@@ -1468,7 +1468,7 @@ The rules Sogni's own prompt writer uses close this section.
1468
1468
  - Prompts may run to 20,000 characters.
1469
1469
 
1470
1470
  <!-- BEGIN GENERATED PROMPT GUIDE: wan-3 -->
1471
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1471
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1472
1472
 
1473
1473
  ### Sogni's prompt rules: wan-3
1474
1474
 
@@ -1523,7 +1523,7 @@ audio that is always on. What it renders well and the reference limits are in
1523
1523
  [models.md § HappyHorse 1.1](./models.md#happyhorse-11-prompting-tips).
1524
1524
 
1525
1525
  <!-- BEGIN GENERATED PROMPT GUIDE: happyhorse-1.1 -->
1526
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1526
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1527
1527
 
1528
1528
  ### Sogni's prompt rules: happyhorse-1.1
1529
1529
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.73.2",
3
+ "version": "3.73.4",
4
4
  "description": "Sogni Creative Agent: image, 3D, speech, video, and music generation via Sogni AI's decentralized GPU network. Supports personas, persistent memories, style transfer, and multi-step creative workflows.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.73.2",
3
+ "version": "3.73.4",
4
4
  "description": "Create images, 3D models, speech, generative video, music, and image-folder loops with Sogni AI.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [3.73.4] - 2026-11-23
2
+
3
+ - Seedance renders from a still now start: `--workflow i2v`, `l2v` and `flf` (the prompt guide's frame modes) use the still as the first or last frame and keep its shape, where the CLI refused them before.
4
+ - `--quote` and the balance check now price MiniMax H3 clips of 11 to 15 seconds.
5
+ - Use Sogni SDK 5.86.1 and intelligence-client 4.33.2.
6
+
7
+ ## [3.73.3] - 2026-11-23
8
+
9
+ - Hosts can allocate storage before saving completed renders. If a result will not fit, the CLI preserves saved files and gives commands to collect the existing render after making room.
10
+ - Optional result-download limits count decoded bytes across batches and retries. Without a configured limit or host grant protocol, downloads keep their existing behavior.
11
+
1
12
  ## [3.73.2] - 2026-11-22
2
13
 
3
14
  - If another connection takes over while a render is running, the CLI reports error 4015 immediately and prints `sogni-agent --result <project-id> --wait` for each affected project. You can collect the original render without submitting or paying for it again.
package/README.md CHANGED
@@ -455,6 +455,9 @@ Defaults live under `~/.config/sogni/` for credentials, last-render metadata, pe
455
455
  | `FFMPEG_PATH` | Custom `ffmpeg` binary |
456
456
  | `FFPROBE_PATH` | Custom `ffprobe` binary |
457
457
  | `SOGNI_MEDIA_DOWNLOAD_MAX_BYTES` | Largest download from one media URL (default: 536870912, 512 MiB); local files have no limit |
458
+ | `SOGNI_RESULT_DOWNLOAD_MAX_BYTES` | Optional total decoded-byte budget for result downloads in one CLI invocation. Unset keeps existing behavior. Counts all result files and retries, including discarded retry bytes; zero permits no result bytes. A refusal preserves existing output files, removes the current partial download, and reports `RESULT_DOWNLOAD_LIMIT` with collection commands. Hosts should reserve this many bytes before launching the CLI and account for retained files before releasing the reservation. This is not a quota for local media processing or other file writes |
459
+
460
+ Hosts that share storage across simultaneous writers can pass `--result-download-budget-stdio` instead of reserving the whole byte limit upfront. Before each result chunk is written, stderr emits one `SOGNI_DOWNLOAD_BUDGET_V1 {"id":1,"bytes":65536}` line. The host must atomically reserve those bytes and answer on stdin with `{"id":1,"allowed":true}` followed by a newline, or deny with `allowed:false`. Requests are serialized; each needs the matching ID and a boolean answer within 30 seconds. Denial reports `RESULT_DOWNLOAD_STORAGE_FULL`; a missing or malformed reply reports `RESULT_DOWNLOAD_BUDGET_UNAVAILABLE`. Both preserve existing outputs and include result-collection commands. The host must keep granted reservations until the CLI exits, account for retained files, then release them. The environment byte limit still applies. Without the flag, the CLI neither reads this protocol nor emits its request lines. Old CLI versions reject the flag, so a host cannot silently lose enforcement by running an older version.
458
461
 
459
462
  ---
460
463
 
package/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sogni-creative-agent-skill
3
3
  description: "CLI and agent skill for personal LoRAs, image, video, and music generation using Sogni AI's decentralized GPU network. Supports Pixal3D single- and multi-view image-to-GLB, BiRefNet background removal, Qwen3-TTS speech/voice cloning/design, MiniMax Music 3, SAM 3 object selection, promptless RTX VSR image upscaling through 16K, promptless FlashVSR and RelayVSR video upscaling up to 2160p, one-click image-folder loop reels, personas (people with saved photos and voices), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo (including audio-to-video from an uploaded track)/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"build a playable world\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  metadata:
5
- version: "3.73.2"
5
+ version: "3.73.4"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -277,7 +277,7 @@ sogni-agent doctor --json
277
277
  | `-w` / `-h` | Width / height | 512×512 |
278
278
  | `-n <num>` | Output count (`{a\|b\|c}` prompt variations cycle); capped at 16, raise with `SOGNI_MAX_COUNT` | 1 |
279
279
  | `--video`, `--music` | Generate video / music instead of image | - |
280
- | `--workflow <t>` | Force `t2v\|i2v\|r2v\|s2v\|ia2v\|a2v\|v2v\|animate-move\|animate-replace` | inferred |
280
+ | `--workflow <t>` | Force `t2v\|i2v\|r2v\|s2v\|ia2v\|a2v\|v2v\|animate-move\|animate-replace`. Seedance also takes the prompt guide's frame modes: `i2v` (`--ref`), `l2v` (`--ref-end`), `flf` (both) | inferred |
281
281
  | `--ref`, `-c`, `--ref-end`, `--ref-audio`, `--ref-video`, `--mask` | Frame / loose image / audio / video / mask references; audio/video repeat for H3 r2v; `--keyframe <image>@<sec>` pins an H3 keyframe (repeat, up to 8) | - |
282
282
  | `--seedance-task-type reference\|edit\|extend`; `--seedance-draft`, `--seedance-finalize <jobId>` | Seedance 2.5 loose-reference operation (v2v defaults to edit). Drafts require user consent after explaining their added cost; finalize an unchanged kept draft at 1080p by default or 4K with `--target-resolution 2160`, before `seedanceDraftExpiresAt`. See `references/models.md` § Seedance 2.5 | - |
283
283
  | `--wan3-ratio`, `--smart-duration` | Wan 3 adaptive/fixed ratio and provider-selected 2–30s duration | adaptive / fixed |
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.3",
3
3
  "name": "sogni-creative-agent",
4
4
  "display_name": "Sogni Creative Agent",
5
- "version": "3.73.2",
5
+ "version": "3.73.4",
6
6
  "description": "Generate images, video, music, and speech, and upscale images and video, on Sogni AI's decentralized GPU network — with personas, memories, and safe video editing tools.",
7
7
  "author": { "name": "Sogni AI", "url": "https://sogni.ai" },
8
8
  "homepage": "https://sogni.ai",
@@ -2,7 +2,7 @@
2
2
  "id": "sogni-creative-agent-skill",
3
3
  "name": "Sogni Creative Agent Skill — Image, Video & Music Generation",
4
4
  "description": "Agent skill and CLI for Sogni AI image, video, and music generation.",
5
- "version": "3.73.2",
5
+ "version": "3.73.4",
6
6
  "skills": [
7
7
  "."
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sogni-ai/sogni-creative-agent-skill",
3
- "version": "3.73.2",
3
+ "version": "3.73.4",
4
4
  "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, 3D, speech, video, and music generation.",
5
5
  "type": "module",
6
6
  "main": "sogni-agent.mjs",
@@ -108,7 +108,7 @@
108
108
  "progress-events.mjs"
109
109
  ],
110
110
  "dependencies": {
111
- "@sogni-ai/sogni-intelligence-client": "4.33.1",
111
+ "@sogni-ai/sogni-intelligence-client": "4.33.2",
112
112
  "execa": "^10.0.1",
113
113
  "json5": "^2.2.3",
114
114
  "sharp": "0.35.5"
@@ -64,7 +64,7 @@ Prompt-only families return the directly runnable prompt with no label,
64
64
  Markdown fence, preamble, explanation, or render offer.
65
65
 
66
66
  <!-- BEGIN GENERATED PROMPT GUIDE: image-models -->
67
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
67
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
68
68
 
69
69
  ## Per-model rules from Sogni's image prompt writer
70
70
 
@@ -124,7 +124,7 @@ LTX-2.5 text-to-video, one shot, so one sentence: "A medium shot frames a woman
124
124
  ```
125
125
 
126
126
  <!-- BEGIN GENERATED PROMPT GUIDE: ltx-2.5 -->
127
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
127
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
128
128
 
129
129
  ### Sogni's prompt rules: ltx-2.5
130
130
 
@@ -179,7 +179,7 @@ Preserve requested visual style and production value without adding new objects,
179
179
  <!-- END GENERATED PROMPT GUIDE: ltx-2.5 -->
180
180
 
181
181
  <!-- BEGIN GENERATED PROMPT GUIDE: ltx-2.3 -->
182
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
182
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
183
183
 
184
184
  ### Sogni's prompt rules: ltx-2.3
185
185
 
@@ -977,7 +977,7 @@ the exact waveform-conditioned lip-sync input. Remote audio URLs and additional
977
977
  audio references keep their existing handling.
978
978
 
979
979
  <!-- BEGIN GENERATED PROMPT GUIDE: minimax-h3 -->
980
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
980
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
981
981
 
982
982
  ### Sogni's prompt rules: minimax-h3
983
983
 
@@ -1195,7 +1195,7 @@ A low tracking shot races alongside a teal 1960s convertible down a sunlit coast
1195
1195
  ```
1196
1196
 
1197
1197
  <!-- BEGIN GENERATED PROMPT GUIDE: seedance-2.5 -->
1198
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1198
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1199
1199
 
1200
1200
  ### Sogni's prompt rules: seedance-2.5
1201
1201
 
@@ -1269,7 +1269,7 @@ TARGET CAPABILITIES: Seedance 2.5 uses the same director-style prompt grammar an
1269
1269
  <!-- END GENERATED PROMPT GUIDE: seedance-2.5 -->
1270
1270
 
1271
1271
  <!-- BEGIN GENERATED PROMPT GUIDE: seedance-2.0 -->
1272
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1272
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1273
1273
 
1274
1274
  ### Sogni's prompt rules: seedance-2.0
1275
1275
 
@@ -1378,7 +1378,7 @@ writer uses close this section.
1378
1378
  motion timing, camera path, framing, and background.
1379
1379
 
1380
1380
  <!-- BEGIN GENERATED PROMPT GUIDE: wan-2.2 -->
1381
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1381
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1382
1382
 
1383
1383
  ### Sogni's prompt rules: wan-2.2
1384
1384
 
@@ -1468,7 +1468,7 @@ The rules Sogni's own prompt writer uses close this section.
1468
1468
  - Prompts may run to 20,000 characters.
1469
1469
 
1470
1470
  <!-- BEGIN GENERATED PROMPT GUIDE: wan-3 -->
1471
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1471
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1472
1472
 
1473
1473
  ### Sogni's prompt rules: wan-3
1474
1474
 
@@ -1523,7 +1523,7 @@ audio that is always on. What it renders well and the reference limits are in
1523
1523
  [models.md § HappyHorse 1.1](./models.md#happyhorse-11-prompting-tips).
1524
1524
 
1525
1525
  <!-- BEGIN GENERATED PROMPT GUIDE: happyhorse-1.1 -->
1526
- <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.1; edit the rules there, not here. -->
1526
+ <!-- Generated by npm run sync:prompt-guides from @sogni-ai/sogni-intelligence-client 4.33.2; edit the rules there, not here. -->
1527
1527
 
1528
1528
  ### Sogni's prompt rules: happyhorse-1.1
1529
1529
 
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "4.33.1",
6
+ "@sogni-ai/sogni-intelligence-client": "4.33.2",
7
7
  "execa": "^10.0.1",
8
8
  "json5": "^2.2.3",
9
9
  "sharp": "0.35.5"
package/sogni-agent.mjs CHANGED
@@ -14,6 +14,7 @@ import { createRequire } from 'module';
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync, mkdtempSync, statSync, readdirSync, realpathSync, lstatSync, unlinkSync, rmdirSync, rmSync, renameSync, openSync, readSync, writeSync, closeSync } from 'fs';
15
15
  import { join, dirname, basename, extname, sep, resolve } from 'path';
16
16
  import { homedir, tmpdir } from 'os';
17
+ import { createInterface } from 'node:readline';
17
18
  import sharp from 'sharp';
18
19
  import { importAccountPersona } from './account-personas.mjs';
19
20
  import { getEnv, hasEnv } from './env.mjs';
@@ -1019,6 +1020,9 @@ function classifyCliError(error, context = {}) {
1019
1020
  }
1020
1021
 
1021
1022
  // The render finished; only its download failed, and `--result` (details.resultCommands) fetches it later.
1023
+ if (['RESULT_DOWNLOAD_LIMIT', 'RESULT_DOWNLOAD_STORAGE_FULL', 'RESULT_DOWNLOAD_BUDGET_UNAVAILABLE'].includes(error?.code)) {
1024
+ return { error_type: 'RESOURCE_LIMIT', category: 'resource_limit', message: rawMessage, retryable: false };
1025
+ }
1022
1026
  if (error?.code === 'RESULT_DOWNLOAD_FAILED') {
1023
1027
  return { error_type: 'PROVIDER_TIMEOUT', category: 'timeout', message: rawMessage, retryable: true };
1024
1028
  }
@@ -2462,6 +2466,15 @@ function imageOptionsFromCli() {
2462
2466
 
2463
2467
  const SEEDANCE_TASK_TYPES = new Set(['reference', 'edit', 'extend']);
2464
2468
 
2469
+ // The Seedance prompt guide names its frame-anchor modes i2v, l2v and flf.
2470
+ // The CLI sends each as dedicated frame mode (the t2v workflow with
2471
+ // --ref/--ref-end), so a named mode decides which anchors must be present.
2472
+ const SEEDANCE_GUIDE_FRAME_MODES = Object.freeze({
2473
+ i2v: { first: true, last: false, title: 'first-frame image-to-video', flags: 'the first frame with --ref and no --ref-end' },
2474
+ l2v: { first: false, last: true, title: 'last-frame image-to-video', flags: 'the last frame with --ref-end and no --ref' },
2475
+ flf: { first: true, last: true, title: 'first-and-last-frame video', flags: 'the first frame with --ref and the last frame with --ref-end' }
2476
+ });
2477
+
2465
2478
  // Seedance 2.5 draft mode: a draft's job id is what --seedance-finalize takes,
2466
2479
  // and its expiry is the last moment it can be rendered at 1080p. Reported only
2467
2480
  // for draft-mode requests, from the completed SDK job.
@@ -4308,6 +4321,7 @@ const args = process.argv.slice(2);
4308
4321
  const options = {
4309
4322
  prompt: null,
4310
4323
  output: null,
4324
+ resultDownloadBudgetStdio: false,
4311
4325
  model: null, // Will be set based on type
4312
4326
  width: 512,
4313
4327
  height: 512,
@@ -4375,6 +4389,7 @@ const options = {
4375
4389
  musicShift: null,
4376
4390
  video: false,
4377
4391
  videoWorkflow: null,
4392
+ seedanceFrameMode: null, // i2v|l2v|flf from --workflow on a Seedance model; sent as dedicated frame mode
4378
4393
  seedanceTaskType: null,
4379
4394
  seedanceDraft: false,
4380
4395
  seedanceFinalize: null,
@@ -4664,6 +4679,8 @@ for (let i = 0; i < args.length; i++) {
4664
4679
  i++;
4665
4680
  options.output = expandHomePath(raw);
4666
4681
  cliSet.output = true;
4682
+ } else if (arg === '--result-download-budget-stdio') {
4683
+ options.resultDownloadBudgetStdio = true;
4667
4684
  } else if (arg === '-m' || arg === '--model') {
4668
4685
  const raw = requireFlagValue(args, i, arg);
4669
4686
  i++;
@@ -5903,6 +5920,7 @@ Music Options:
5903
5920
  Video Options:
5904
5921
  --video, -v Generate video instead of image
5905
5922
  --workflow <type> Video workflow: t2v|i2v|r2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace
5923
+ Seedance also takes the prompt guide's frame modes: i2v (--ref), l2v (--ref-end), flf (both)
5906
5924
  --seedance-task-type <type> Seedance 2.5 loose-reference operation: reference|edit|extend
5907
5925
  --seedance-draft Seedance 2.5: render a 480p draft that --seedance-finalize can render at 1080p or 4K
5908
5926
  --seedance-finalize <draft-job-id> Seedance 2.5: render that draft at 1080p by default; --target-resolution 2160 selects 4K.
@@ -6033,6 +6051,7 @@ General:
6033
6051
  holds the project is not counted. The project is NOT cancelled; fetch it
6034
6052
  later with --result
6035
6053
  --cancel-on-timeout Cancel the project when --timeout runs out (the pre-3.53 behavior)
6054
+ --result-download-budget-stdio Host integration: require a storage grant over stdin before each result chunk
6036
6055
  --detach, --no-wait Submit, print the project id, and exit without waiting. The project keeps
6037
6056
  running; follow it with --result <projectId> --wait
6038
6057
  --status <projectId> Show a project's state and, while queued, why it is waiting
@@ -6941,7 +6960,13 @@ if (options.angles360Video && !options.angles360) {
6941
6960
 
6942
6961
  // Normalize/validate video workflow before applying defaults
6943
6962
  if (options.video) {
6944
- if (options.videoWorkflow) {
6963
+ const seedanceFrameMode = options.videoWorkflow && isSeedanceModelSelection(options.model)
6964
+ ? String(options.videoWorkflow).toLowerCase()
6965
+ : null;
6966
+ if (Object.hasOwn(SEEDANCE_GUIDE_FRAME_MODES, seedanceFrameMode)) {
6967
+ options.seedanceFrameMode = seedanceFrameMode;
6968
+ options.videoWorkflow = 't2v';
6969
+ } else if (options.videoWorkflow) {
6945
6970
  const normalized = normalizeVideoWorkflow(options.videoWorkflow);
6946
6971
  if (normalized) {
6947
6972
  options.videoWorkflow = normalized;
@@ -8441,6 +8466,26 @@ if (options.video) {
8441
8466
  fatalCliError('Seedance 2.0 audio references require --ref, --ref-video, or -c/--context image refs.', { code: 'INVALID_ARGUMENT' });
8442
8467
  }
8443
8468
 
8469
+ const seedanceFrameAnchors = isSeedanceVideo ? SEEDANCE_GUIDE_FRAME_MODES[options.seedanceFrameMode] : undefined;
8470
+ if (
8471
+ seedanceFrameAnchors
8472
+ && (Boolean(options.refImage) !== seedanceFrameAnchors.first || Boolean(options.refImageEnd) !== seedanceFrameAnchors.last)
8473
+ ) {
8474
+ fatalCliError(
8475
+ `Seedance --workflow ${options.seedanceFrameMode} is ${seedanceFrameAnchors.title}: pass ${seedanceFrameAnchors.flags}.`,
8476
+ {
8477
+ code: 'INVALID_ARGUMENT',
8478
+ details: {
8479
+ workflow: options.seedanceFrameMode,
8480
+ model: options.model,
8481
+ ref: Boolean(options.refImage),
8482
+ refEnd: Boolean(options.refImageEnd),
8483
+ },
8484
+ hint: 'Use --workflow i2v for --ref alone, l2v for --ref-end alone, or flf for both; or omit --workflow and Seedance anchors whichever frames you pass.'
8485
+ }
8486
+ );
8487
+ }
8488
+
8444
8489
  // Seedance provider roles form two mutually exclusive request shapes:
8445
8490
  // - DEDICATED FRAME MODE: --ref (first frame) and/or --ref-end (last frame)
8446
8491
  // outside the typed ia2v workflow. The platform pins them as
@@ -12949,6 +12994,16 @@ async function downloadUrlToFile(url, filePath, { projectId = null, retryOutput
12949
12994
  saved = true;
12950
12995
  return;
12951
12996
  }
12997
+ } catch (error) {
12998
+ if (['RESULT_DOWNLOAD_LIMIT', 'RESULT_DOWNLOAD_STORAGE_FULL', 'RESULT_DOWNLOAD_BUDGET_UNAVAILABLE'].includes(error?.code)) {
12999
+ const command = projectId ? `${resultCommandFor(projectId)}${retryOutput ? ` -o ${shellWord(retryOutput)}` : ''}` : null;
13000
+ error.details = {
13001
+ ...error.details,
13002
+ projectIds: projectId ? [projectId] : [],
13003
+ resultCommands: command ? [command] : [],
13004
+ };
13005
+ }
13006
+ throw error;
12952
13007
  } finally {
12953
13008
  if (!saved) {
12954
13009
  try { rmSync(tempPath, { force: true }); } catch { /* best effort */ }
@@ -12976,6 +13031,79 @@ async function downloadUrlToFile(url, filePath, { projectId = null, retryOutput
12976
13031
  throw err;
12977
13032
  }
12978
13033
 
13034
+ // One CLI invocation owns this optional budget across all result files and
13035
+ // retries. Bytes are charged before writes, including bytes a retry discards,
13036
+ // so a host can reserve this upper bound without inspecting download timing.
13037
+ let activeResultDownloadBudget;
13038
+ function resultDownloadBudget() {
13039
+ if (activeResultDownloadBudget) return activeResultDownloadBudget;
13040
+ const raw = getEnv('SOGNI_RESULT_DOWNLOAD_MAX_BYTES', { trim: true });
13041
+ const maxBytes = raw ? Number(raw) : Infinity;
13042
+ if (raw && (!Number.isSafeInteger(maxBytes) || maxBytes < 0)) {
13043
+ const error = new Error('SOGNI_RESULT_DOWNLOAD_MAX_BYTES must be a non-negative safe integer byte count.');
13044
+ error.code = 'INVALID_ARGUMENT';
13045
+ throw error;
13046
+ }
13047
+ activeResultDownloadBudget = { maxBytes, writtenBytes: 0, pending: Promise.resolve(), sequence: 0, reader: null, lines: null };
13048
+ return activeResultDownloadBudget;
13049
+ }
13050
+
13051
+ function checkResultDownloadBudget(bytes, consume = false) {
13052
+ const budget = resultDownloadBudget();
13053
+ if (bytes > budget.maxBytes - budget.writtenBytes) {
13054
+ const error = new Error(`Result downloads exceed this invocation's ${budget.maxBytes}-byte budget.`);
13055
+ error.code = 'RESULT_DOWNLOAD_LIMIT';
13056
+ error.hint = 'Do not render it again. Free storage or raise the host download budget, then collect the existing render with --result.';
13057
+ error.details = { maxBytes: budget.maxBytes, bytesWritten: budget.writtenBytes };
13058
+ throw error;
13059
+ }
13060
+ if (consume) budget.writtenBytes += bytes;
13061
+ }
13062
+
13063
+ function resultDownloadGrantError(code) {
13064
+ const error = new Error(code === 'RESULT_DOWNLOAD_STORAGE_FULL'
13065
+ ? 'The host could not reserve storage for this result download.'
13066
+ : 'The host did not provide a valid storage grant for this result download.');
13067
+ error.code = code;
13068
+ error.hint = 'Do not render it again. Check available storage and the host connection, then collect the existing render with --result.';
13069
+ return error;
13070
+ }
13071
+
13072
+ // The opt-in host protocol serializes requests, including if future callers
13073
+ // download several files at once. No bytes are written until the matching
13074
+ // grant arrives. An older CLI refuses the flag instead of ignoring a host's
13075
+ // reservation requirement. Default invocations never read stdin or emit it.
13076
+ function reserveResultDownloadBytes(bytes) {
13077
+ const budget = resultDownloadBudget();
13078
+ const work = budget.pending.then(async () => {
13079
+ checkResultDownloadBudget(bytes);
13080
+ if (options.resultDownloadBudgetStdio) {
13081
+ if (!budget.reader) {
13082
+ budget.reader = createInterface({ input: process.stdin, crlfDelay: Infinity, terminal: false });
13083
+ budget.lines = budget.reader[Symbol.asyncIterator]();
13084
+ }
13085
+ const id = ++budget.sequence;
13086
+ let timer;
13087
+ try {
13088
+ const line = budget.lines.next();
13089
+ const deadline = new Promise((_resolve, reject) => {
13090
+ timer = setTimeout(() => reject(resultDownloadGrantError('RESULT_DOWNLOAD_BUDGET_UNAVAILABLE')), 30_000);
13091
+ });
13092
+ process.stderr.write(`SOGNI_DOWNLOAD_BUDGET_V1 ${JSON.stringify({ id, bytes })}\n`);
13093
+ const answer = await Promise.race([line, deadline]);
13094
+ if (answer.done || answer.value.length > 512) throw resultDownloadGrantError('RESULT_DOWNLOAD_BUDGET_UNAVAILABLE');
13095
+ let grant;
13096
+ try { grant = JSON.parse(answer.value); } catch { throw resultDownloadGrantError('RESULT_DOWNLOAD_BUDGET_UNAVAILABLE'); }
13097
+ if (grant?.id !== id || typeof grant.allowed !== 'boolean') throw resultDownloadGrantError('RESULT_DOWNLOAD_BUDGET_UNAVAILABLE');
13098
+ if (!grant.allowed) throw resultDownloadGrantError('RESULT_DOWNLOAD_STORAGE_FULL');
13099
+ } finally { clearTimeout(timer); }
13100
+ }
13101
+ checkResultDownloadBudget(bytes, true);
13102
+ });
13103
+ budget.pending = work;
13104
+ return work;
13105
+ }
13106
+
12979
13107
  /** One GET into tempPath: fresh, or appended from state.received with a Range request. */
12980
13108
  async function downloadResultAttempt(url, tempPath, state, { stallMs, filePath, label }) {
12981
13109
  const controller = new AbortController();
@@ -13033,6 +13161,7 @@ async function downloadResultAttempt(url, tempPath, state, { stallMs, filePath,
13033
13161
  throw err;
13034
13162
  }
13035
13163
 
13164
+ if (state.total !== null) checkResultDownloadBudget(Math.max(0, state.total - state.received));
13036
13165
  if (response.body) {
13037
13166
  const reader = response.body.getReader();
13038
13167
  for (;;) {
@@ -13043,6 +13172,7 @@ async function downloadResultAttempt(url, tempPath, state, { stallMs, filePath,
13043
13172
  throw retryableDownloadError(silentFor ? `stalled with no data for ${formatDownloadDuration(silentFor)}` : downloadConnectionReason(error), error);
13044
13173
  }
13045
13174
  if (chunk.done) break;
13175
+ await reserveResultDownloadBytes(chunk.value.length);
13046
13176
  for (let offset = 0; offset < chunk.value.length;) {
13047
13177
  offset += writeSync(fd, chunk.value, offset, chunk.value.length - offset);
13048
13178
  }
@@ -15358,26 +15488,6 @@ async function buildVideoEstimateParams({ tokenType, steps }) {
15358
15488
  return params;
15359
15489
  }
15360
15490
 
15361
- function isMiniMaxH3ExtendedDurationEstimateError(err) {
15362
- const actualDuration = options.frames
15363
- ? options.frames / options.fps
15364
- : options.duration;
15365
- return isMiniMaxH3Model(options.model)
15366
- && actualDuration > 10
15367
- && /duration must be between 1 and 10 seconds/i.test(String(err?.message || err || ''));
15368
- }
15369
-
15370
- function buildMiniMaxH3EstimateUnavailableError(cause) {
15371
- const err = new Error(
15372
- 'MiniMax H3 generation supports clips through 15.08 seconds, but this client cannot pre-estimate clips over 10 seconds.'
15373
- );
15374
- err.code = 'VIDEO_COST_ESTIMATE_UNAVAILABLE';
15375
- err.retryable = false;
15376
- err.hint = 'Submit without --estimate-video-cost so the server can validate balance when the render starts, or estimate a clip of 10 seconds or less.';
15377
- err.cause = cause;
15378
- return err;
15379
- }
15380
-
15381
15491
  async function ensureSufficientVideoBalance(client, log) {
15382
15492
  if (!options.video || options.estimateVideoCost || options.quote) return;
15383
15493
  // Wan 3.0 Enhanced launch credits live in the server-side model ledger and
@@ -15426,12 +15536,7 @@ async function ensureSufficientVideoBalance(client, log) {
15426
15536
  estimate = await client.estimateVideoCost(await buildVideoEstimateParams({ tokenType, steps }));
15427
15537
  } catch (err) {
15428
15538
  if (!options.quiet) {
15429
- if (isMiniMaxH3ExtendedDurationEstimateError(err)) {
15430
- const estimateError = buildMiniMaxH3EstimateUnavailableError(err);
15431
- log(`Note: ${estimateError.message} ${estimateError.hint}`);
15432
- } else {
15433
- log(`Warning: Could not estimate video cost (${err?.message || 'error'})`);
15434
- }
15539
+ log(`Warning: Could not estimate video cost (${err?.message || 'error'})`);
15435
15540
  }
15436
15541
  return;
15437
15542
  }
@@ -15464,12 +15569,6 @@ const IMAGE_ESTIMATE_OUTPUT_FORMATS = new Set(['png', 'jpg', 'webp', 'gif']);
15464
15569
  // or a rate limit, keep their error.
15465
15570
  function asQuoteError(err) {
15466
15571
  if (err?.code === QUOTE_UNAVAILABLE) return err;
15467
- if (isMiniMaxH3ExtendedDurationEstimateError(err)) {
15468
- return quoteUnavailableError(buildMiniMaxH3EstimateUnavailableError(err).message, {
15469
- hint: 'Quote a clip of 10 seconds or less, or render without --quote; Sogni checks the price when the render starts.',
15470
- cause: err
15471
- });
15472
- }
15473
15572
  const status = err?.status ?? err?.statusCode;
15474
15573
  if (status === 400 || status === 404) {
15475
15574
  return quoteUnavailableError(`Sogni has no quote for this request: ${cliErrorMessage(err)}`, { cause: err });
@@ -16010,6 +16109,7 @@ async function main() {
16010
16109
  let client = null;
16011
16110
 
16012
16111
  try {
16112
+ resultDownloadBudget();
16013
16113
  if (options.video && isWan3ModelLocal(options.model)) {
16014
16114
  await prepareWan3ReferenceMediaPlan();
16015
16115
  }
@@ -16610,15 +16710,7 @@ async function main() {
16610
16710
  tokenType: options.tokenType || 'spark',
16611
16711
  steps
16612
16712
  });
16613
- let estimate;
16614
- try {
16615
- estimate = await client.estimateVideoCost(estimateParams);
16616
- } catch (err) {
16617
- if (isMiniMaxH3ExtendedDurationEstimateError(err)) {
16618
- throw buildMiniMaxH3EstimateUnavailableError(err);
16619
- }
16620
- throw err;
16621
- }
16713
+ const estimate = await client.estimateVideoCost(estimateParams);
16622
16714
  if (options.json) {
16623
16715
  const duration = options.frames ? Math.max(1, Math.round((options.frames - 1) / options.fps)) : options.duration;
16624
16716
  const delivered = isMiniMaxH3TwoStageModel(options.model)
@@ -18418,6 +18510,12 @@ async function main() {
18418
18510
  printHumanError(error, errorContext);
18419
18511
  }
18420
18512
  } finally {
18513
+ if (activeResultDownloadBudget?.reader) {
18514
+ activeResultDownloadBudget.reader.close();
18515
+ activeResultDownloadBudget.reader = null;
18516
+ activeResultDownloadBudget.lines = null;
18517
+ process.stdin.pause();
18518
+ }
18421
18519
  try {
18422
18520
  if (client?.isConnected?.()) {
18423
18521
  await Promise.race([
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.73.2';
1
+ export const PACKAGE_VERSION = '3.73.4';