chatcut-media-guide
GitHub指导在本地编辑器中导入或重新链接媒体文件。通过启动回环服务器提供文件,调用import_media接口完成批量导入或重链,并验证资产状态。
Trigger Scenarios
Install
npx skills add ChatCut-Inc/agent-plugin --skill chatcut-media-guide -g -y
SKILL.md
Frontmatter
{
"name": "chatcut-media-guide",
"description": "Use when the user needs to import local or downloaded media, or relink missing media to an existing ChatCut asset. Prefer the editor loopback bridge when the editor and files are on the same machine."
}
ChatCut Media Guide
Check browse_assets first when a file may already be imported.
Same-machine editor import
- Confirm the user selected the file for import. Open the target project using
browserHandoff.urloreditorUrl, and keep exactly one editor tab for it open on the same machine/network namespace as the local shell. A remote sandbox's localhost is not the user's localhost. - Start the bundled loopback server with Node 18+ and the origin of the actual editor URL:
node <this-skill-dir>/scripts/serve-local-media.mjs --origin <editor-origin> /path/to/source.mp4
Keep it alive using the host's background-process support while calling MCP. It serves only the listed files over tokenized 127.0.0.1 URLs and exits after 900 seconds.
- Import multiple files in one
import_mediacall:{"action":"from_editor","files":[...]}. Copy each file'sassetId,url,filename, andsizeBytesfrom the printedimportsarray intofiles, omitting its per-fileaction. URLs may come from different running helpers. Send 1–16 files per call; for larger sets, submit successive batches of 16. Up to eight files are processed concurrently; the editor streams each one straight into its local store, so a card with transfer progress appears as soon as the download starts. The original top-level single-file arguments still work. - Inspect every entry in
results: successful entries haveok:trueandstatus:"locally_imported"; failed entries have anerror. Results preserve input order and includeassetIdandfilename, with top-levelsucceeded/failedcounts. Retry only failed files with the same asset IDs. Keep the helpers alive until all files succeed, and keep the editor open for server sync, background upload, and transcription. - Verify the asset with
browse_assetsbefore placing it on the timeline. Wait ontrack_progress target:"transcription"before transcript or caption work. Do not wait for upload unless the next operation explicitly requires cloud bytes.
On timeout, check browse_assets and retry with the same assetId. Keep that ID even if restarting the helper changes its URL. If the editor cannot reach the helper, browser local-network access is unavailable, or host policy denies the transfer, stop and ask the user to upload through the visible editor instead of trying another transfer route.
Relink an existing asset
For missing local media, preserve the existing asset and all timeline references:
- Get the existing
assetIdfrombrowse_assetsand locate the corresponding original source file. - Serve that file with
scripts/serve-local-media.mjsas above. - Call
import_mediawith the helper'surl,filename, andsizeBytes, setaction: "relink_from_editor", and replace the generated ID with the existing assetId. For multiple files, use the samefilesarray form, with an existing asset ID in every entry. - Wait for
status: "locally_relinked"before stopping the helper. Keep the editor open while upload or transcription finishes.
Relink always reads the supplied file. The media type must match, and the file must be the corresponding original rather than a replacement edit. If project sync has not exposed the target to the editor, wait and retry. A failed relink must not fall back to creating a new asset.
Fallback
If the host cannot run the helper or the editor cannot access its loopback URL, ask the user to upload the file in the visible target-project editor. Do not invent asset IDs or URLs, and do not upload files the user did not identify or approve. Public URLs must be downloaded to a readable local file before using the same-machine route.
Version History
-
e76472a
Current 2026-09-27 13:28
并发导入限制从4个调整为8个;上传逻辑改为仅在后续操作明确要求时等待。
- 0dd9c5e 2026-09-22 02:34


