Agent Skills › ChatCut-Inc/agent-plugin › asset-import

asset-import

GitHub

用于将本地或下载的多媒体文件导入ChatCut项目,支持同机编辑器回环桥接与上传辅助两种模式。涵盖批量导入、缺失媒体重新链接及进度监控,确保资产正确注册并可用于时间线编辑。

claude/skills/asset-import/SKILL.md ChatCut-Inc/agent-plugin

Trigger Scenarios

用户需要将本地视频或音频文件导入到视频编辑项目中 用户需要修复或重新链接项目中丢失的媒体资产

Install

npx skills add ChatCut-Inc/agent-plugin --skill asset-import -g -y
More Options

Non-standard path

npx skills add https://github.com/ChatCut-Inc/agent-plugin/tree/main/claude/skills/asset-import -g -y

Use without installing

npx skills use ChatCut-Inc/agent-plugin@asset-import

指定 Agent (Claude Code)

npx skills add ChatCut-Inc/agent-plugin --skill asset-import -a claude-code -g -y

安装 repo 全部 skill

npx skills add ChatCut-Inc/agent-plugin --all -g -y

预览 repo 内 skill

npx skills add ChatCut-Inc/agent-plugin --list

SKILL.md

Frontmatter
{
    "name": "asset-import",
    "description": "Import local or downloaded media, or relink missing media to an existing ChatCut asset, through the hosted Claude plugin. Use the editor loopback bridge when the editor and files are on the same machine; use the upload helper for imports otherwise. Desktop MCP sessions use their own built-in import tools."
}

Asset Import

Check browse_assets first when a file may already be imported.

Same-machine editor import (preferred)

  1. Open the target project using browserHandoff.url or editorUrl. Keep exactly one editor tab for this project open, on the same machine/network namespace as your shell. A remote sandbox's localhost is not the user's localhost.
  2. Start the bundled server with Node from PATH, using the origin of the actual editor URL:
node <this-skill-dir>/scripts/serve-local-media.mjs --origin <editor-origin> /path/to/source.mp4

Keep this process alive using the host's background-process support while calling MCP. It prints one JSON line and automatically exits after 900 seconds. It serves only the listed files over tokenized loopback URLs.

  1. Import multiple files in one import_media call: {"action":"from_editor","files":[...]}. Copy each file's assetId, url, filename, and sizeBytes from the printed imports array into files, omitting its per-file action. Each URL may come from a different running helper. Send 1–16 files per call; for larger sets, submit successive batches of 16. Processing is bounded to four concurrent imports. There is no loopback-specific file-size cap. The original top-level single-file arguments still work.
  2. Inspect every entry in results: successful entries have ok:true and status:"locally_imported"; failed entries have an error. Results preserve input order and include assetId and filename, with top-level succeeded/failed counts. Retry only failed files with the same asset IDs. Success means the editor has persisted local bytes and registered the asset locally. Stop the helpers only after all files succeed. Keep the editor open for server sync, background upload and transcription.
  3. Use the returned asset IDs for timeline work. Wait on track_progress target:"transcription" before transcript/caption work. Browser-renderable timelines defer original-file uploads; cloud-only or unsupported timelines upload automatically. Check browse_assets before waiting on target:"upload"; a deferred upload is not in progress. Use the editor's Upload action when cloud bytes are needed, preserving the same asset ID. If server sync is still catching up, retry the asset lookup.

On timeout, check browse_assets and retry with the same assetId; the import may still be running. Keep the same ID even if restarting the helper changes its URL. Do not blindly start a second import. Allow the editor's browser local-network permission if prompted. If the editor cannot reach the helper or the bridge is unavailable, use the fallback. A host-policy denial is not permission to try another transfer route.

For visual analysis, inspect readable original files locally rather than waiting for cloud upload. Import original source assets; do not flatten an edit into a local pre-render.

Relink an existing asset

For missing local media, preserve the existing asset and its timeline references:

  1. Get the existing assetId from browse_assets and locate its corresponding original source file.
  2. Serve that file with the same loopback helper above.
  3. Call import_media with the helper's url, filename, and sizeBytes, but set action: "relink_from_editor" and replace the generated assetId with the existing assetId. For multiple files, use the same files array form, with an existing asset ID in every entry.
  4. Wait for status: "locally_relinked" before stopping the helper. Upload/transcription may still be pending; keep the editor open.

Relink always reads the supplied file, even if the editor has cached bytes. The media type must match. Use the corresponding original, not a different replacement clip: relink preserves existing edits and transcripts. If the target is missing from the editor, let project sync finish and retry. A failed relink must not fall back to creating a new asset.

Upload-helper fallback

For a remote sandbox, unavailable editor, or blocked browser connection:

  1. Call import_media with {"action":"create_session"}.
  2. Run the bundled helper in the foreground, using the returned token and endpoint and at most four paths:
node <this-skill-dir>/scripts/upload-media.mjs --token <token> --endpoint <endpoint> /path/to/source.mp4

Resolve scripts relative to this skill. Do not install Node or replace the helper with handwritten upload/transcode commands. MCP OAuth stays inside the MCP client; only the short-lived import token goes to the helper. Larger batches need a fresh session per four files.

The helper registers placeholders early but prints its final JSON after uploads complete. Read imports[].result.assetId. On an error with retry, obtain a fresh session and rerun the returned arguments to resume the same asset.

If host policy denies transfer, stop and ask the user to upload through the editor or grant permission. Do not work around the denial. Public URLs can be downloaded locally and then imported through the appropriate route above.

Version History

  • 0dd9c5e Current 2026-09-22 02:31
  • 014586d 2026-08-27 10:42

    同步插件版本

  • e1867a8 2026-08-02 23:36
  • f39cdae 2026-07-30 21:52

Same Skill Collection

chatcut-desktop-codex-plugin/skills/connect-chatcut-desktop/SKILL.md
chatcut/skills/asset-import/SKILL.md
chatcut/skills/chatcut-plugin-basics-claude/SKILL.md
chatcut/skills/chatcut-plugin-basics/SKILL.md
chatcut/skills/create-motion-graphics/SKILL.md
chatcut/skills/export/SKILL.md
chatcut/skills/image-gen/SKILL.md
chatcut/skills/known-errors/SKILL.md
chatcut/skills/music/SKILL.md
chatcut/skills/shader-gen/SKILL.md
chatcut/skills/transcription/SKILL.md
chatcut/skills/verification/SKILL.md
chatcut/skills/video-gen/SKILL.md
chatcut/skills/voice/SKILL.md
chatcut/skills/widget-forms/SKILL.md
claude/skills/create-motion-graphics/SKILL.md
claude/skills/export/SKILL.md
claude/skills/image-gen/SKILL.md
claude/skills/known-errors/SKILL.md
claude/skills/motion-graphic-gen/SKILL.md
claude/skills/music/SKILL.md
claude/skills/shader-gen/SKILL.md
claude/skills/transcription/SKILL.md
claude/skills/verification/SKILL.md
claude/skills/video-gen/SKILL.md
claude/skills/widget-forms/SKILL.md
codex/skills/asset-import/SKILL.md
codex/skills/chatcut-plugin-basics/SKILL.md
codex/skills/create-motion-graphics/SKILL.md
codex/skills/export/SKILL.md
codex/skills/image-gen/SKILL.md
codex/skills/known-errors/SKILL.md
codex/skills/music/SKILL.md
codex/skills/shader-gen/SKILL.md
codex/skills/transcription/SKILL.md
codex/skills/verification/SKILL.md
codex/skills/video-gen/SKILL.md
codex/skills/widget-forms/SKILL.md
grok/skills/asset-import/SKILL.md
grok/skills/chatcut-plugin-basics/SKILL.md
grok/skills/create-motion-graphics/SKILL.md
grok/skills/export/SKILL.md
grok/skills/known-errors/SKILL.md
grok/skills/music/SKILL.md
grok/skills/shader-gen/SKILL.md
grok/skills/transcription/SKILL.md
grok/skills/verification/SKILL.md
grok/skills/video-gen/SKILL.md
grok/skills/widget-forms/SKILL.md

Metadata

Files
0
Version
0dd9c5e
Hash
c4a232fe
Indexed
2026-07-30 21:52

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-27 00:18
浙ICP备14020137号-1