К основному содержанию
скилл CX Codex

runway-video — скилл для Claude Code: что делает и как установить

Скилл runway-video для Claude Code помогает проектировать и вызывать API Runway Developer для генерации видео без случайных списаний.

MIT 142 установок ★ 252 обновлён 2026-07-14

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add calesthio/generative-media-skills --skill runway-video -a claude-code
Открыть на GitHub

Что делает runway-video

Скилл координирует серверные вызовы к Runway Developer API (https://api.dev.runwayml.com). Он поддерживает нативные модели генерации Gen-4.5 (POST /v1/text_to_video и POST /v1/image_to_video), Gen-4 Turbo, редактирование роликов через Aleph 2.0 (POST /v1/video_to_video) и перенос мимики через Act-Two (POST /v1/character_performance). Работа строится на явных режимах исполнения: сухой прогон с расчётом кредитов по умолчанию, подтверждённый вызов, опрос статуса задачи или удаление.

Перед отправкой запроса скилл проверяет согласие изображённых людей, формат медиафайлов и лимиты параметров. Например, текстовый промпт Gen-4.5 ограничен 1000 единицами UTF-16, а для Aleph 2.0 требуется исходный ролик длительностью от 2 до 30 секунд с частотой до 30 кадров в секунду.

Для работы требуется доступ к api.dev.runwayml.com и баланс кредитов. Партнёрские модели вроде Veo 3 или Seedance выводятся в отдельные сценарии из-за различий в тарифах и обработке данных. Модель gen4_aleph помечена как устаревшая с закрытием 30 июля 2026 года. Без утверждённого дайджеста скилл не выполняет платные запросы.

Какие задачи решает

  • Сформировать валидный запрос к API Gen-4.5 с нужными пропорциями кадра
  • Рассчитать стоимость запроса в кредитах до отправки в Runway
  • Настроить перенос движений персонажа через Act-Two с параметрами интенсивности
  • Подготовить параметры редактирования видеоролика в Aleph 2.0 с ключевыми кадрами

Примеры запросов агенту

  • Сделай сухой прогон генерации видео в Gen-4.5 по промпту и посчитай кредиты
  • Подготовь запрос к Act-Two для видео с персонажем и проверь ограничения
  • Проверь статус задачи Runway по сохранённому task ID без повторного создания

Как установить runway-video

1Через Skills CLI (Vercel)

npx skills add calesthio/generative-media-skills --skill runway-video -a claude-code

2Вручную: положить файлы

~/.claude/skills/runway-video/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/runway-video/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о runway-video

Как установить runway-video в Claude Code?

Выполните команду npx skills add calesthio/generative-media-skills --skill runway-video -a claude-code. Конфигурация запишется в ~/.claude/skills/runway-video/SKILL.md.

Что делает runway-video?

Скилл задаёт правила и схемы для безопасной работы с видеомоделями Runway Developer API, защищая от дублирующих вызовов и проверяя права на медиа.

Что нужно для работы runway-video?

Требуются аккаунт разработчика Runway с доступом к эндпоинтам https://api.dev.runwayml.com и достаточный баланс кредитов для выбранной модели.

Исходный текст

SKILL.md · MIT
---
name: runway-video
description: Build and operate production-safe Runway API video generation, video editing, and character-performance workflows with native Runway models, explicit paid-call approval, duplicate-create protection, asynchronous task handling, secure media transfer, and evidence-aware governance.
---

# Runway Video

Use this skill for server-side integrations with the documented Runway Developer API at `https://api.dev.runwayml.com`. It covers Runway-native video models and makes partner models, still-image generation, the consumer web app, Recipes, Workflows, Characters, and third-party gateways explicit out-of-scope branches.

Research cutoff: **2026-07-10**.

## Evidence language

Interpret statements in this skill as follows:

- **Fact** — stated in a first-party Runway source or visible in the official OpenAPI-generated SDK.
- **Claim** — Runway marketing or policy language that may depend on plan or contract.
- **Heuristic** — an operational recommendation derived from the facts; validate it for the deployment.
- **Unknown** — not established by the reviewed first-party public material. Do not silently fill it in.

When a volatile fact affects money, safety, payload validity, or data governance, re-open the cited first-party page before production use.

## Start with scope, consent, and an execution mode

Before designing a request, obtain all of the following:

1. The desired mode: text-to-video, image-to-video, video edit, or performance transfer.
2. Whether Runway-native models are required or a partner model is acceptable.
3. Output duration, dimensions, delivery format, audio expectation, and iteration budget.
4. Rights to every prompt, image, video, face, voice, performance, mark, and music input.
5. Explicit permission from each depicted or heard person. Runway's Usage Policy prohibits using another person's image, video, or audio without permission.
6. A disclosure/provenance plan when realistic synthetic media could mislead viewers.
7. Data classification, approved regions/subprocessors, retention requirement, and whether the organization's contract actually provides no-training or zero-data-retention terms.
8. One of these execution modes:
   - **Plan/dry-run** — default. Validate, price, and print an approval digest. Perform no paid API creation.
   - **Approved create** — only after an exact request digest, bounded maximum cost, and explicit environment gates match.
   - **Resume** — poll an already recorded task ID; never create a replacement.
   - **Cancel/delete** — a separate destructive operation with a separate approval. Never infer it from a timeout.

Refuse requests that lack necessary rights or consent, seek moderation evasion, impersonation, fraud, non-consensual intimate imagery, sexual content involving minors, or another prohibited category. Do not “fix” blocked content by obfuscating it.

## Route the request

### Current Runway-native video surface

| Model | Documented API mode | Endpoint | Required anchors | Current public price |
|---|---|---|---|---|
| `gen4.5` | Text → video | `POST /v1/text_to_video` | `promptText`, `ratio`, integer `duration` 2–10 | 12 credits/s |
| `gen4.5` | First image + text → video | `POST /v1/image_to_video` | `promptImage`, `promptText`, `ratio`, integer `duration` 2–10 | 12 credits/s |
| `gen4_turbo` | First image (+ optional motion text) → video | `POST /v1/image_to_video` | `promptImage`, `ratio`; duration 2–10 | 5 credits/s |
| `aleph2` | Existing video + optional text/keyframes → edited video | `POST /v1/video_to_video` | `videoUri`; up to five timed keyframes | 28 credits/s, 56-credit minimum |
| `act_two` | Character image/video + driving performance video → video | `POST /v1/character_performance` | `character`, `reference`, model `act_two` | 5 credits/s; public Act-Two guide states a 3-second minimum |

**Facts:** `gen4.5`, `gen4_turbo`, `aleph2`, and `act_two` are in the current API model catalog. `gen4_aleph` is deprecated and scheduled to sunset on 2026-07-30. Do not start new work on it.

### Native mode details

- **Gen-4.5 text-to-video:** ratios are `1280:720` and `720:1280`. The request schema requires a non-empty prompt of at most 1,000 UTF-16 code units, a ratio, and an integer duration from 2 through 10.
- **Gen-4.5 image-to-video:** ratios are `1280:720`, `720:1280`, `1104:832`, `832:1104`, `1584:672`, and `960:960`. The current SDK schema accepts one first-frame image, either as a URI or an array item with `position: "first"`.
- **Gen-4 Turbo:** image input is required. It supports the six ratios above and any duration from 2 through 10 seconds. It is the lower-cost native image-driven option.
- **Aleph 2.0:** input video must be 2–30 seconds, at most 30 fps, and no more than 1080p. Output preserves input resolution up to 1080p. The API accepts optional `promptText`, `seed`, `contentModeration`, `targetAspectRatio`, and up to five keyframes. Each keyframe uses a URI and either absolute `seconds` or normalized `at`; optional edit ranges require all keyframes to use ranges or none to use them.
- **Act-Two:** `character` is `{type: "image"|"video", uri}`, and `reference` is `{type: "video", uri}`. The driving performance is 3–30 seconds. The API also accepts `bodyControl`, `expressionIntensity` 1–5, `ratio`, `seed`, and `contentModeration`. Body/gesture transfer is intended for character-image inputs; a character video retains its own environmental/camera movement and does not offer the same gesture-control behavior.

**Documented conflict:** the Inputs page also lists Gen-4.5 portrait ratio `672:1584`, but the reviewed current OpenAPI-generated SDK type omits it. Treat that ratio as unresolved rather than guessing; use one of the common values above or recheck the live API reference/SDK before approving `672:1584`.

### Partner models are a separate decision

Runway also exposes partner video models: `seedance2`, `seedance2_fast`, `seedance2_mini`, `veo3`, `veo3.1`, `veo3.1_fast`, `happyhorse_1_0`, and `gemini_omni_flash`. Magnific video upscaling is also a partner capability. They have different schemas, prices, audio behavior, moderation diagnostics, failure modes, subprocessors, and possibly different contractual controls.

Do not silently replace a native model with one of these. If the user chooses a partner model, re-research that model's current first-party Runway schema and provider-specific rights/data conditions, create a new cost formula, and obtain a new approval digest. Runway's enterprise FAQ says its enterprise terms and DPAs cover partner models and that providers have no-training commitments; that is not proof that every self-serve API account has the same terms.

### Explicitly out of scope

- Still-image routes (`/v1/text_to_image`) are a staging option, not video generation. A still-image call is separately billable and requires its own skill/workflow and approval.
- The consumer web app, Explore Mode, Apps, Edit Studio UI, and web credits are not API contracts. Web-app credits and Developer API credits are separate.
- Recipes, published Workflows, real-time Characters, avatar videos, audio-only endpoints, and video upscaling are separate products/endpoints.
- Replicate, fal, ComfyUI wrappers, reverse-engineered endpoints, browser automation, and other gateways are not the Runway Developer API.

## Build a shot specification before a prompt

Record a compact shot spec:

```yaml
intent: "one continuous 6-second product reveal"
mode: "gen4.5 text-to-video"
subject: "matte cobalt travel mug on pale limestone"
action: "a bead of condensation rolls down the mug"
environment: "quiet studio, soft morning window light"
camera: "slow 20-degree dolly arc, medium close-up"
timing: "hold composition for first second, then arc"
style: "natural commercial cinematography, restrained contrast"
ratio: "1280:720"
duration_seconds: 6
audio: "none requested; add licensed sound in post"
continuity_anchors: ["cobalt color", "logo orientation", "limestone texture"]
acceptance: ["single shot", "logo not distorted", "no camera cut"]
```

Then write a direct, positive prompt. For Gen-4.5 text-to-video, describe both what is visible and how it moves. For image-to-video, the image already establishes subject, composition, color, lighting, and style, so emphasize subject, camera, and environmental motion. Add one variable at a time during iteration.

**Heuristics:**

- Prefer one shot and one main action per short clip.
- Use concrete camera language: “locked camera,” “slow dolly in,” “handheld tracking,” or “overhead static frame.”
- Replace negatives with positive outcomes. Use “locked camera” instead of “no camera movement.”
- Do not ask the model to render critical legal copy or logos reliably; composite approved text and marks in post.
- Keep a fixed seed only when comparing prompt variants. A repeated seed is a similarity aid, not a determinism guarantee.

Example Gen-4.5 text prompt:

> A matte cobalt travel mug stands on pale limestone in soft morning window light. A bead of condensation slowly rolls down its side. The camera performs a restrained 20-degree dolly arc in a single continuous medium close-up. Natural commercial cinematography, crisp product silhouette, gentle background falloff.

For Aleph, use an action verb plus a targeted transformation: “Relight the room with cool moonlight while preserving the actor, wardrobe, camera motion, and set layout.” Start with the smallest edit. Use a keyframe when exact appearance matters; use `promptText` for motion or a transformation that is not visible in the keyframe.

For Act-Two, quality comes primarily from references rather than prose: one subject, visible face throughout, waist-up or closer, even lighting, no cuts, hands visible at the start if body control is enabled, and natural motion. Begin with `expressionIntensity: 3`. Higher values can add expression and artifacts; lower values can improve stability.

## API and asset contracts

Every API request uses:

```text
Base URL: https://api.dev.runwayml.com
Authorization: Bearer $RUNWAYML_API_SECRET
X-Runway-Version: 2024-11-06
Content-Type: application/json
```

Keep the secret server-side. Never put it in source, logs, prompts, browser code, asset URLs, approval records, or output-download requests. Pin the API base URL; do not accept it from end users.

### Input media

Runway accepts HTTPS URLs, data URIs, and `runway://` ephemeral-upload URIs.

| Input | HTTPS URL | Data URI | Ephemeral upload |
|---|---:|---:|---:|
| Image | 16 MB | 5 MB encoded | 200 MB |
| Video | 32 MB | 16 MB encoded | 200 MB |
| Audio | 32 MB | 16 MB encoded | 200 MB |

HTTPS inputs must use a hostname rather than an IP, respond to `HEAD`, return accurate `Content-Type` and `Content-Length`, and return 200 without redirects. Runway's fetch timeout is documented as 10 seconds. Supported image encodings are JPEG, PNG, and WebP; GIF is unsupported. Supported video containers/codecs are documented on the Inputs page.

**Heuristic:** use a private, exact-host allowlist and short-lived signed object URL when an approved object store already exists. Otherwise use the official ephemeral-upload API. Validate content locally before upload and bind its SHA-256 to the approval. Never let an end user supply an arbitrary fetch URL; that becomes an SSRF and data-exfiltration surface in your application even though Runway applies its own URL restrictions.

`runway://` ephemeral uploads expire after 24 hours, are rate limited, require purchased credits, and are 512 bytes–200 MB. A failed multipart upload must not be retried; create a new upload session. An upload is stateful, so record the URI without putting the API secret or source bytes in logs.

### Output media

A successful task returns an `output` array of one or more URLs. Runway says these URLs expire within 24–48 hours and must be downloaded into durable storage; do not expose them as product URLs. The official SDK type notes that retrieving the task again can return fresh URLs.

Treat output URLs as untrusted signed URLs:

- Never attach `Authorization` to them.
- Require HTTPS, no userinfo, default port, public DNS, an exact output-host allowlist, bounded redirects with every hop revalidated, bounded byte count, expected media type, and a container signature.
- Download into a private temporary file, compute SHA-256, run `ffprobe`, fully decode with `ffmpeg -v error -i … -f null -`, then atomically publish.
- Store task ID, request digest, model, endpoint, prompt hash or protected prompt, source hashes, approval, timestamps, output hash, codec/dimensions/fps/duration/audio-stream presence, and disclosure/rights records. Do not store signed query strings unless a security-reviewed incident workflow needs them.

The public API output page does not promise a single container/codec for every current model. A validator that supports only MP4 must fail closed on other output types rather than renaming them.

## Price before creating

Developer credits are publicly priced at $0.01 each before applicable tax.

Use these formulas for native modes:

```text
gen4.5:      credits = 12 × requested_output_seconds
gen4_turbo:  credits =  5 × requested_output_seconds
aleph2:      credits_upper_bound = max(56, 28 × ceil(input_video_seconds))
act_two:     credits_upper_bound = 5 × max(3, ceil(driving_performance_seconds))
usd_upper_bound = credits_upper_bound × 0.01
```

The Aleph and Act-Two ceiling formulas are conservative **heuristics** for approval when source duration is fractional. Public materials do not establish API rounding behavior for fractional seconds. Aleph's consumer Edit Studio says a ranged edit uses credits only for the range, but the reviewed API pricing page does not state the API's range-billing rule; price the full source duration unless the Developer API documentation or contract confirms otherwise.

Examples:

| Request | Credits | USD before tax |
|---|---:|---:|
| Gen-4.5, 6 s | 72 | $0.72 |
| Gen-4 Turbo, 6 s | 30 | $0.30 |
| Aleph 2.0, 5 s input | 140 | $1.40 |
| Act-Two, 8 s performance | 40 | $0.40 |

Moderated generations cost the same as successful generations. Do not use a paid Runway call as a moderation preflight. Pre-moderate in your application and include moderation failures in the budget.

Runway's public API documents tier-dependent concurrency, rolling 24-hour generation limits, and 30-day spend caps. Over concurrency, a task becomes `THROTTLED` and remains queued; over the daily create limit, creation returns 429. There is no general requests-per-minute cap documented, but this is not permission to create without your own queue, budget, and abuse controls.

## Exact paid approval

A paid request must satisfy all of these at the moment of creation:

1. Dry-run produced a canonical request envelope containing endpoint, model, exact JSON payload, input SHA-256 values, local job key, output policy, current price source date, and a conservative maximum USD cost.
2. A human reviewed the non-redacted request in a protected interface.
3. The human approved that exact envelope digest, not merely “use Runway.”
4. `SEND_RUNWAY_REQUEST=1` is set.
5. `APPROVE_RUNWAY_PAID_CALL=YES` is set.
6. `RUNWAY_APPROVAL_SHA256` exactly matches the printed SHA-256.
7. `RUNWAY_MAX_COST_USD` is present and is at least the computed upper bound.
8. The create ledger acquired the job key exclusively before the POST.

Any change to prompt, model, endpoint, seed, duration, ratio, references, content-moderation setting, price table, or source hash invalidates approval.

## Duplicate-create control and asynchronous lifecycle

Runway creation returns a task ID. The reviewed API reference and OpenAPI-generated SDK expose no documented idempotency-key parameter for these creation endpoints. Therefore:

- Create a local job record with exclusive-create semantics before the POST.
- Store a request digest and `state: creating` first.
- Send each create POST once. Disable automatic retries for create calls.
- Persist the returned task ID immediately and durably.
- If the client times out, disconnects, crashes, receives malformed success, or gets a 5xx after bytes may have been sent but before a task ID is stored, mark the job **ambiguous**. Do not create again automatically. Reconcile through provider support/usage records or accept a human-authorized possible duplicate under a new job key.
- If a task ID is known, resume `GET /v1/tasks/{id}`. Never replace it with a new generation merely because polling timed out.

The official SDK retries connection errors, 408, 409, 429, and 5xx twice by default. That is convenient for reads, but unsafe for a paid create without a provider idempotency contract. If using the SDK, instantiate the create client with `max_retries=0`; a separate read client may retry safe GETs.

Poll no more often than every five seconds. Add jitter and exponential backoff for retryable read errors. Recognize exactly:

| Status | Meaning | Action |
|---|---|---|
| `PENDING` | accepted, waiting | continue polling |
| `THROTTLED` | stored but not enqueued due to concurrency | continue polling; do not recreate |
| `RUNNING` | active; may include progress | continue polling |
| `SUCCEEDED` | terminal; output URLs available | download and validate immediately |
| `FAILED` | terminal; inspect `failureCode` and sanitized `failure` | do not blindly retry |
| `CANCELLED` | terminal | stop |

`CANCELLED` uses two “l” characters in the official SDK schema.

A polling deadline or SDK wait timeout does **not** cancel a task. `DELETE /v1/tasks/{id}` is overloaded: it cancels `PENDING`, `THROTTLED`, or `RUNNING` tasks, but deletes other tasks and their persistent output data. A read-before-delete has a race if the task completes between calls. Never invoke DELETE automatically; require a separate explicit destructive approval that acknowledges possible terminal-task deletion. The public docs do not state the refund/charge rule for cancellation, so cancellation is not a cost-control guarantee.

## Complete production reference

The following standard-library Python client implements Gen-4.5 text-to-video directly and accepts a validated source plan for native image-to-video, Aleph, or Act-Two. It is dry-run by default, binds exact approval to the paid payload, source evidence, price, output host/network policy, and governance evidence, uses an exclusive local ledger, never retries create, safely retries polling, refuses automatic cancellation, downloads without the API bearer token, and validates MP4 with `ffprobe` plus a full `ffmpeg` decode.

Python 3.11+, `ffprobe`, and `ffmpeg` are required. The companion source-plan builder after the payload templates supplies the other native modes without weakening this lifecycle.

```python
#!/usr/bin/env python3
from __future__ import annotations

import hashlib
import http.client
import ipaddress
import json
import os
import random
import socket
import ssl
import subprocess
import sys
import tempfile
import threading
import time
import urllib.error
import urllib.parse
import urllib.request
import uuid
from datetime import datetime, timezone
from decimal import Decimal, InvalidOperation, ROUND_CEILING
from pathlib import Path

API_ORIGIN = "https://api.dev.runwayml.com"
API_VERSION = "2024-11-06"
CREATE_PATH = "/v1/text_to_video"
PRICE_CREDITS_PER_SECOND = 12
USD_PER_CREDIT = Decimal("0.01")
NONTERMINAL = {"PENDING", "THROTTLED", "RUNNING"}
TERMINAL = {"SUCCEEDED", "FAILED", "CANCELLED"}
MAX_JSON = 256 * 1024
MAX_VIDEO = 512 * 1024 * 1024
MAX_TOOL_OUTPUT = 512 * 1024
UNRESOLVED_GOVERNANCE = [
    "training-use-controlling-terms", "retention-and-deletion-SLA", "zero-data-retention",
    "data-residency", "human-review", "partner-subprocessors", "incident-notification",
]
LEDGER_KEYS = {
    "schemaVersion", "state", "createdAt", "requestHash", "approvalSha256", "model", "endpoint",
    "apiVersion", "promptSha256", "sources", "outputPolicy", "evidence", "price",
    "unresolvedGovernance", "taskId", "submittedAt", "createOutcomeAt", "errorKind", "httpStatus",
    "errorBodySha256", "replayAllowed", "responseSha256", "terminalAt", "failureCode", "artifactError",
    "outputUrlSha256", "stageName", "downloadStartedAt", "artifactStaged", "artifactValidatedAt",
    "storedAt", "artifact", "manifestSha256", "costReconciliation",
}


class APIProblem(Exception):
    def __init__(self, kind: str, status: int | None = None, body_sha256: str | None = None):
        super().__init__(kind)
        self.kind, self.status, self.body_sha256 = kind, status, body_sha256


class NoRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None


NO_REDIRECT = urllib.request.build_opener(NoRedirect)


def die(message: str) -> "NoReturn":
    raise SystemExit(message)


def canonical(value: object) -> bytes:
    return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8")


def sha256_bytes(value: bytes) -> str:
    return hashlib.sha256(value).hexdigest()


def utc_now() -> str:
    return datetime.now(timezone.utc).isoformat()


def fsync_directory(path: Path) -> None:
    if os.name != "nt":
        fd = os.open(path, os.O_RDONLY)
        try:
            os.fsync(fd)
        finally:
            os.close(fd)


def atomic_json(path: Path, value: object) -> None:
    path.parent.mkdir(parents=True, exist_ok=True)
    fd, temp_name = tempfile.mkstemp(prefix=".ledger-", suffix=".json", dir=path.parent)
    try:
        os.fchmod(fd, 0o600)
        with os.fdopen(fd, "wb") as stream:
            stream.write(canonical(value) + b"\n")
            stream.flush()
            os.fsync(stream.fileno())
        os.replace(temp_name, path)
        fsync_directory(path.parent)
    finally:
        if os.path.exists(temp_name):
            os.unlink(temp_name)


def exclusive_ledger(path: Path, initial: object) -> None:
    path.parent.mkdir(parents=True, exist_ok=True)
    flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY
    fd = os.open(path, flags, 0o600)
    with os.fdopen(fd, "wb") as stream:
        stream.write(canonical(initial) + b"\n")
        stream.flush()
        os.fsync(stream.fileno())


def read_json(path: Path) -> dict:
    raw = path.read_bytes()
    if len(raw) > MAX_JSON:
        die("ledger exceeds JSON cap")
    value = json.loads(raw)
    if not isinstance(value, dict):
        die("ledger is not an object")
    return value


def exact_hosts(raw: str, name: str) -> tuple[str, ...]:
    result = []
    for item in raw.split(","):
        host = item.strip().rstrip(".").lower()
        if not host:
            continue
        if "*" in host or "/" in host or ":" in host:
            die(f"{name} accepts exact DNS hostnames only")
        try:
            ipaddress.ip_address(host)
        except ValueError:
            pass
        else:
            die(f"{name} rejects IP literals")
        result.append(host)
    if not result:
        die(f"{name} must contain at least one reviewed exact hostname")
    return tuple(sorted(set(result)))


def validate_public_https(url: str, allowed_hosts: set[str]) -> tuple[str, str, list[str]]:
    parsed = urllib.parse.urlsplit(url)
    if parsed.scheme != "https" or not parsed.hostname or parsed.username or parsed.password or parsed.fragment:
        die("output URL must be HTTPS with a hostname and no userinfo")
    if parsed.port not in (None, 443):
        die("output URL must use default HTTPS port")
    host = parsed.hostname.rstrip(".").lower()
    try:
        ipaddress.ip_address(host)
    except ValueError:
        pass
    else:
        die("output URL must not use an IP literal")
    if host not in allowed_hosts:
        die(f"output host {host!r} is not in RUNWAY_OUTPUT_HOSTS; resume after review")
    addresses = []
    for item in socket.getaddrinfo(host, 443, type=socket.SOCK_STREAM):
        address = ipaddress.ip_address(item[4][0])
        if not address.is_global:
            die(f"output host resolves to non-public address {address}")
        addresses.append(str(address))
    if not addresses:
        die("output host did not resolve")
    target = parsed.path or "/"
    if parsed.query:
        target += "?" + parsed.query
    return host, target, sorted(set(addresses))


class PinnedHTTPSConnection(http.client.HTTPSConnection):
    def __init__(self, host: str, address: str, timeout: float):
        super().__init__(host, 443, timeout=timeout, context=ssl.create_default_context())
        self.address = address

    def connect(self) -> None:
        raw = socket.create_connection((self.address, 443), self.timeout)
        try:
            self.sock = self._context.wrap_socket(raw, server_hostname=self.host)
        except Exception:
            raw.close()
            raise


def bounded_process(argv: list[str], timeout: int, cap: int = MAX_TOOL_OUTPUT) -> bytes:
    process = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    chunks: list[bytes] = []
    total = 0
    overflow = threading.Event()
    lock = threading.Lock()

    def drain(stream) -> None:
        nonlocal total
        while True:
            data = stream.read(65536)
            if not data:
                return
            with lock:
                total += len(data)
                if total > cap:
                    overflow.set()
                    process.kill()
                    return
                chunks.append(data)

    threads = [threading.Thread(target=drain, args=(stream,), daemon=True) for stream in (process.stdout, process.stderr)]
    for thread in threads:
        thread.start()
    try:
        code = process.wait(timeout=timeout)
    except subprocess.TimeoutExpired:
        process.kill()
        process.wait()
        die(f"tool timeout: {Path(argv[0]).name}")
    for thread in threads:
        thread.join(timeout=2)
    if overflow.is_set():
        die(f"tool output exceeds cap: {Path(argv[0]).name}")
    if code != 0:
        die(f"tool failed: {Path(argv[0]).name}; diagnosticsSha256={sha256_bytes(b''.join(chunks))}")
    return b"".join(chunks)


def api_json(method: str, path: str, body: dict | None, retry_reads: bool) -> dict:
    secret = os.environ.get("RUNWAYML_API_SECRET", "")
    if not secret:
        die("RUNWAYML_API_SECRET is required for network operations")
    url = API_ORIGIN + path
    headers = {
        "Authorization": f"Bearer {secret}",
        "Accept": "application/json",
        "X-Runway-Version": API_VERSION,
    }
    data = None
    if body is not None:
        data = canonical(body)
        headers["Content-Type"] = "application/json"
    attempts = 5 if retry_reads else 1
    for attempt in range(attempts):
        request = urllib.request.Request(url, data=data, headers=headers, method=method)
        try:
            with NO_REDIRECT.open(request, timeout=30) as response:
                raw = response.read(MAX_JSON + 1)
                if len(raw) > MAX_JSON:
                    raise APIProblem("response-too-large")
                try:
                    value = json.loads(raw or b"{}")
                except json.JSONDecodeError:
                    raise APIProblem("invalid-json", response.status, sha256_bytes(raw))
                if not isinstance(value, dict):
                    raise APIProblem("non-object-json", response.status, sha256_bytes(raw))
                return value
        except urllib.error.HTTPError as exc:
            error_body = exc.read(MAX_JSON + 1)
            body_hash = sha256_bytes(error_body)
            retryable = retry_reads and exc.code in {429, 502, 503, 504}
            if not retryable or attempt + 1 == attempts:
                raise APIProblem("http-error", exc.code, body_hash)
        except APIProblem:
            raise
        except (urllib.error.URLError, TimeoutError, OSError) as exc:
            if not retry_reads:
                raise APIProblem("transport-" + type(exc).__name__)
            if attempt + 1 == attempts:
                raise APIProblem("poll-transport-" + type(exc).__name__)
        time.sleep(min(30.0, 2 ** attempt) * (1.0 + random.random() * 0.5))
    die("unreachable")


def validate_task_id(value: object) -> str:
    if not isinstance(value, str):
        die("missing task id")
    try:
        uuid.UUID(value)
    except ValueError:
        die("task id is not a UUID")
    return value


def evidence_sha(name: str) -> str:
    value = os.environ.get(name, "").strip().lower()
    if len(value) != 64 or any(character not in "0123456789abcdef" for character in value):
        die(f"{name} must be the SHA-256 of the reviewed protected evidence")
    return value


def finite_positive_decimal(name: str) -> Decimal:
    try:
        value = Decimal(os.environ.get(name, ""))
    except InvalidOperation:
        die(f"{name} must be a decimal")
    if not value.is_finite() or value <= 0:
        die(f"{name} must be finite and positive")
    return value


def file_sha256(path: Path) -> str:
    digest = hashlib.sha256()
    with path.open("rb") as stream:
        for chunk in iter(lambda: stream.read(1024 * 1024), b""):
            digest.update(chunk)
    return digest.hexdigest()


def sanitized_sources(sources: list[dict]) -> list[dict]:
    return [{key: value for key, value in item.items() if key not in {"localPath", "uri"}} for item in sources]


def redacted_payload(payload: dict) -> dict:
    def redact(value, key=""):
        if key in {"uri", "videoUri", "promptImage"} and isinstance(value, str):
            return "sha256:" + sha256_bytes(value.encode("utf-8"))
        if key == "promptText" and isinstance(value, str):
            return "sha256:" + sha256_bytes(value.encode("utf-8"))
        if isinstance(value, dict):
            return {child_key: redact(child, child_key) for chil...

© calesthio · MIT · calesthio/generative-media-skills

Похожие скиллы

Все скиллы по теме «ИИ и ML» →
runway-dev-recipes runwayml Скилл runway-dev-recipes подключает готовые многошаговые воркфлоу Runway Dev API — Recipes — для генерации изображений и видео через SDK. CX Codex +1 217установок runway-dev-model-routers runwayml Скилл runway-dev-model-routers для Claude Code подключает генерацию изображений, видео и аудио через сохранённый Runway Model Router. Проверяет маршрутизацию и помогает настроить её в приложении. CX Codex +1 177установок scenario-runway scenario-labs Скилл scenario-runway для Claude Code, Codex, Cursor, Copilot, Gemini CLI и OpenCode подключает модели Runway через MCP Scenario: Gen4.5 генерирует клипы из текста или первого кадра, Aleph 2 редактирует существующие ролики. CX Codex +1 839установок muapi-ugc-video-factory SamurAIGPT Скилл muapi-ugc-video-factory генерирует вертикальные 9:16 UGC-видеоролики с озвучкой по фото человека, фото товара и тексту реплики. Помогает собирать рекламные креативы для соцсетей через команды агента. CX Codex +1 2 600установок runway social-media-skills Скилл для промптинга и режиссуры Runway: задаёт движение камеры, держит одного персонажа в разных шотах и правит готовый материал. CX Codex +1 1 200установок Runway ML mindstone MCP-сервер Runway ML подключает Runway к Claude Code для создания видео, изображений и аудио, а также управления задачами генерации. Для работы нужен ключ Runway API и Node.js 20+. CX Codex +1 ★ 14звёзд репо

Из того же набора149

Весь набор →
google-gemini-omni-video Скилл google-gemini-omni-video для Claude Code генерирует короткие видео Gemini Omni Flash. Он также редактирует ролики по изображениям и прошлым взаимодействиям. CX Codex +1 144установок audioshake-stem-separation Скилл audioshake-stem-separation для Claude Code управляет облачным сервисом AudioShake для разделения записей на дорожки. Запускается при изоляции вокала, инструментов или диалогов. CX Codex +1 144установок deepmotion-animate-3d Скилл deepmotion-animate-3d для Claude Code помогает спланировать захват движений по видео через сервис DeepMotion Animate 3D. Подключается при настройке мокапа для 3D-персонажей. CX Codex +1 143установок d3-animated-data-visualization Скилл d3-animated-data-visualization для Claude Code создаёт анимированные визуализации D3 из исходных данных и согласованных утверждений. Включается для графиков, карт и сетей. CX Codex +1 143установок meshy-3d Скилл meshy-3d для Claude Code создаёт 3D-модели из текста и изображений через Meshy. Он запускает генерацию, обработку текстур, риггинг и экспорт. CX Codex +1 142установок openai-realtime-voice Скилл openai-realtime-voice для Claude Code помогает проектировать голосовых агентов на OpenAI Realtime API. Запускается при настройке диалогов через WebRTC или WebSocket с вызовом инструментов. CX Codex +1 141установок ltx-2-video Скилл ltx-2-video для Claude Code создаёт и редактирует синхронные видео со звуком через LTX-2.3. Выбирает hosted API или локальный репозиторий для генерации и правок. CX Codex +1 141установок fish-audio-tts Скилл fish-audio-tts для Claude Code генерирует речь, клонирует голоса и настраивает потоковое аудио через Fish Audio. CX Codex +1 140установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой