Skip to content
Agentmart
Submit a tool

seedance-story-engine

Skill by geniusdapeng-collab

IndexedMIT
Write a review

Chalk Labs

Need help deploying seedance-story-engine?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/geniusdapeng-collab-seedance-story-engine

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The publisher has not written a description yet.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
seedance-story-engine
Description
None
License
MIT
Instructions
652 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions call the network

Agent Skills spec issues

  • missing YAML frontmatter
  • name: missing
  • description: missing
  • body: 652 lines (spec recommends under 500)

Files (15)

  • SKILL.md
  • hook-factory.js · scripts/enhancers/
  • spectacle-designer.js · scripts/enhancers/
  • narrative-bridge.js · scripts/
  • story-engine.js · scripts/
  • story-plan-1778821724021.json · scripts/
  • story-plan-1778821784018.json · scripts/
  • story-plan-1778822032586.json · scripts/
  • story-plan-1778822063618.json · scripts/
  • story-plan-1778822079891.json · scripts/
  • story-plan-1778844405980.json · scripts/
  • story-plan-1778845087615.json · scripts/
  • story-plan-1778845315186.json · scripts/
  • story-plan-1778845441359.json · scripts/
  • story-plan-1778845518998.json · scripts/

SKILL.md (first lines)

#!/usr/bin/env node
/**
 * Seedance Render Engine v1.0-Core
 * 从 Director v4.2-Core Phase4 拆分独立的渲染引擎
 * 
 * 职责:将分镜片段批量提交到 Seedance API,处理 Multi-Shot / 单镜头策略,轮询下载,精确切分
 */

const fs = require('fs');
const path = require('path');
const { execAsync, shellQuote } = require('../../seedance-director/scripts/exec-utils');

// ============ 配置(v5.1-Core: 接入配置中心) ============
let CONFIG, MODEL_PRIORITY, FALLBACK_ERRORS, MAX_CONCURRENT_DEFAULT, 
    RETRY_DELAY_MS, QUOTA_RETRY_DELAYS, BATCH_COOLDOWN_MS, 
    OUTPUT_ROOT, PROMPT_MAX_LENGTH, DEGRADATION_STEPS;

function initConfig() {
  const { CONFIG: cfg } = require('../../seedance-director/scripts/config-center');
  CONFIG = cfg;
  
  MODEL_PRIORITY = cfg.render.modelPriority.map((m, i) => ({ ...m, priority: i }));
  FALLBACK_ERRORS = ['400', '429', '500', '503', '模型不可用', 'service_tier', 
                     'insufficient_quota', 'rate_limit', 'model_not_found'];
  MAX_CONCURRENT_DEFAULT = cfg.render.maxConcurrent;
  RETRY_DELAY_MS = 5000;
  QUOTA_RETRY_DELAYS = cfg.render.retryDelays;
  BATCH_COOLDOWN_MS = cfg.render.batchCooldown;
  OUTPUT_ROOT = process.env.DIRECTOR_OUTPUT_ROOT || path.join(require('os').homedir(), '.openclaw/workspace/productions');
  PROMPT_MAX_LENGTH = cfg.render.promptMaxLength;
  DEGRADATION_STEPS = cfg.render.degradationSteps;
}

// 启动时初始化配置
initConfig();

// 查找 seedance-wrapper
const WORKSPACE = path.join(require('os').homedir(), '.openclaw/workspace');
const SEEDANCE_WRAPPER = path.join(WORKSPACE, 'skills/byted-ark-seedance-skill/scripts/seedance-wrapper.js');

function ensureDir(dir) {
  if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
}

function sleep(ms) {
  return new Promise(r => setTimeout(r, ms));
}

function log(tag, msg, level = 'info') {
  const ts = new Date().toISOString().slice(0, 19).replace('T', ' ');
  console.log(`[${ts}] [${tag}] ${msg}`);
}

// 🔴 v5.1-Core: Prompt token估算(中文字符≈1token,英文≈1.5token)
function estimatePromptTokens(prompt) {
  if (!prompt) return 0;
  let tokens = 0;
  for (const char of prompt) {
    const code = char.charCodeAt(0);
    // CJK字符(中文/日文/韩文)≈1 token
    if (code >= 0x4e00 && code <= 0x9fff) tokens += 1;
    // ASCII字符
    else if (code < 128) tokens += 0.5;
    // 其他Unicode字符
    else tokens += 1;
  }
  // 英文单词额外计数(空格分隔的平均长度≈5字符≈1.5token)
  const englishWords = prompt.match(/[a-zA-Z]+/g) || [];
  tokens += englishWords.length * 0.3; // 已计数字符,额外单词开销
  
  return Math.ceil(tokens);
}

// 🔴 v5.1-Core: Prompt长度安全检查
function validatePromptLength(prompt, maxLength = PROMPT_MAX_LENGTH) {
  const tokens = estimatePromptTokens(prompt);
  const length = prompt?.length || 0;
  
  if (length > maxLength) {
    log('RenderEngine', `⚠️ Prompt超长(${length}/${maxLength}字符, ~${tokens}tokens),将截断`, 'warn');
    return { 
      valid: false, 
      prompt: prompt.substring(0, maxLength - 3) + '...', 
      originalLength: length,
      tokens 
    };
  }
  
  if (tokens > maxLength * 1.5) {
    log('RenderEngine', `⚠️ Prompt token估算偏高(~${tokens}),建议精简`, 'warn');
  }
  
  return { valid: true, prompt, length, tokens };
}

// 🔴 v5.1-Core: 429降级策略 — 降低motionStrength + 缩短prompt
function applyDegradation(prompt, modelConfig, retryIndex) {
  const step = DEGRADATION_STEPS[Math.min(retryIndex, DEGRADATION_STEPS.length - 1)];
  if (!step) return { prompt, modelConfig };
  
  let degradedPrompt = prompt;
  let degradedModel = { ...modelConfig };
  
  // 缩短prompt
  if (step.promptTrim > 0 && degradedPrompt.length > step.promptTrim + 10) {
    degradedPrompt = degradedPrompt.substring(0, degradedPrompt.length - step.promptTrim) + '...';
    log('RenderEngine', `🔧 降级: prompt缩短${step.promptTrim}字符(${prompt.length}→${degradedPrompt.length})`, 'warn');
  }
  
  // 降低motionStrength
  if (step.motionStrength !== undefined) {
    degradedModel = { ...degradedModel, motionStrength: step.motionStrength };
    log('RenderEngine', `🔧 降级: motionStrength→${step.motionStrength}`, 'warn');
  }
  
  // 降低cfgScale
  if (step.cfgScale !== undefined) {
    degradedModel = { ...degradedModel, cfgScale: step.cfgScale };
    log('RenderEngine', `🔧 降级: cfgScale→${step.cfgScale}`, 'warn');
  }

From geniusdapeng-collab/StormaxeAIVideoSystem, MIT.

More from geniusdapeng-collab/StormaxeAIVideoSystem

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jun 29, 2026 (4 months ago)
Last release
Jun 28, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get seedance-story-engine running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying seedance-story-engine?

CallGet help
Cite this page

seedance-story-engine skill. Agent Mart. https://agentmart.dev/skills/geniusdapeng-collab-seedance-story-engine (last updated 2026-10-24)