{"slug": "agents-writing-video-scenerok-sdk-vs-vidscript", "title": "Agents Writing Video: `@scenerok/sdk` vs VidScript", "summary": "A developer behind the Scenerok video tooling outlined when AI agents should author videos in VidScript, a declarative DSL, versus TypeScript via the public @scenerok/sdk, arguing both compile to the same intermediate timeline so preview and render semantics stay identical. The guidance recommends VidScript for short promos and templates and the SDK for loops, branches, computed timing and agent-driven work, with validation and render checks wired into the agent loop. The author warns against using the SDK for everything, hand-copied pretend-loops in VidScript, and unpinned generative calls that re-resolve assets on every pass.", "body_md": "People ask a practical question once the demo lands: **should my agent write VidScript or TypeScript?**\n\nThe honest answer is the one on the public `@scenerok/sdk` README, expanded into engineering judgment:\n\n| Use | Language | \n|---|---|\n| Short promos, human edits, templates | VidScript ( `.vid` ) | \n| Loops, branches, computed timing, agents | TypeScript + `@scenerok/sdk` | \n\nBoth emit the same intermediate timeline for preview and render. That sameness is the feature. This essay is how to choose without cargo-culting either side.\n\nVidScript is for when the video *wants* to look like a script.\n\nImports pull generative providers. Inputs declare footage you already have. Time ranges place layers on a clock. Compile-time slots resolve model calls before composition. Output sets container and destination.\n\nWhy humans like it:\n\nWhy agents like it *sometimes*:\n\nIf the job is \"15s reel, hero clip, VO, end card,\" start in VidScript. Do not open with a framework.\n\n`@scenerok/sdk` exists because some videos are **data**.\n\nExamples that outgrow a tidy `.vid`:\n\nIn TypeScript you get real control flow, real tests, real module imports, and the same `toIR()` exit. Public surface includes timeline construction, `loadVideo` / `loadAudio` probing helpers, text/audio factories, grid areas, transitions — see the npm README for the current API. Stay on that surface in articles; do not invent private methods for blog flair.\n\nAgents already live in TypeScript. Giving them a first-class authoring SDK is how \"write the launch video too\" stops being a metaphor.\n\nIf VidScript and the SDK drifted into different semantics, you would fork the product: preview lies depending on path; templates refuse to migrate; agents and humans cannot hand off.\n\nSo the rule is strict: **authoring is plural; timeline meaning is singular.**\n\nOperational consequences:\n\n`scenerok validate` style checks apply to both (public CLI behavior).\n`.vid` `.ts` folders; forks should not surprise you at render.\nThis is the same lesson compilers learned decades ago: multiple languages, one machine model — here the \"machine\" is the timeline + render contract.\n\nUse **VidScript** when:\n\nUse **`@scenerok/sdk`** when:\n\nUse **both in one shop** when:\n\n**Pitfall: SDK for everything.**\n\nYou get enterprise-shaped code for a six-second bumper. Prefer the DSL until it hurts.\n\n**Pitfall: VidScript with pretend-loops.**\n\nCopy-pasting twenty near-identical blocks is a smell. Migrate that scene to TS.\n\n**Pitfall: Generative calls without pins.**\n\nEither language will burn money if every agent pass re-resolves assets. Make pinning part of the workflow, not an afterthought.\n\n**Pitfall: Teaching agents only prompts, not validate/render.**\n\nThe loop is edit → validate → preview → (maybe) final. Wire MCP/CLI skills to that loop; do not stop at \"emit text.\"\n\nFrom the SDK README, the flavor is intentional: build a timeline, assign clips to ranges, return `toIR()`. From the site, VidScript shows timed ranges and compile-time generative functions side by side with brand inputs. Cloneable showcase material lives in the public GitHub showcase — fork, change a string, re-render. That loop is the pedagogy.\n\nA good agent skill does not always emit TypeScript because TypeScript is familiar. It classifies the job:\n\nIf your skill always scaffolds the SDK, you will get correct-but-heavy programs. If it always scaffolds VidScript, you will get unmaintainable copy-paste. The classifier is the product.\n\nThe sweet spot we see:\n\nWhen the template outgrows declarative form, a human (or agent with a migration brief) ports the skeleton to `@scenerok/sdk` once — then the campaign scales in TS. Migration is a deliberate event, not a surprise rewrite mid-flight.\n\nYou cannot unit-test taste. You can test structure:\n\nKeep tests on the IR/validate layer so VidScript and SDK share them. That reinforces the peace treaty: two frontends, one meaning.\n\nEverything above stays within what you can learn from [scenerok.com](https://scenerok.com), the npm README for `@scenerok/sdk`, and the public showcase. If an API is not documented there, do not teach it in GTM essays. Longevity beats insider flex.\n\nAgents should not \"prompt a video.\" They should **author a program** that compiles into one.\n\nPick VidScript when clarity wins. Pick `@scenerok/sdk` when computation wins. Refuse a world where those choices fork your renderer.\n\nInstall the SDK from npm, open the editor or CLI path on [scenerok.com](https://scenerok.com), and let the IR be the peace treaty between humans and agents.", "url": "https://wpnews.pro/news/agents-writing-video-scenerok-sdk-vs-vidscript", "canonical_source": "https://dev.to/nidheeshdas/agents-writing-video-sceneroksdk-vs-vidscript-4dmg", "published_at": "2026-09-27 04:34:58+00:00", "updated_at": "2026-09-27 05:30:56.764625+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Scenerok", "@scenerok/sdk", "VidScript", "TypeScript", "GitHub", "npm"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/agents-writing-video-scenerok-sdk-vs-vidscript", "markdown": "https://wpnews.pro/news/agents-writing-video-scenerok-sdk-vs-vidscript.md", "text": "https://wpnews.pro/news/agents-writing-video-scenerok-sdk-vs-vidscript.txt", "jsonld": "https://wpnews.pro/news/agents-writing-video-scenerok-sdk-vs-vidscript.jsonld"}}