rename_asset
Rename a media file and its paired cover image in data/media. Prevents overwriting and requires confirmation if referenced in plan posts.
Instructions
Rename one media file within data/media, renaming its paired .jpg cover sibling to match. sanitizeAssetName runs on BOTH names (rejects path segments / leading dots / bad charset / a disallowed extension); the extension may NOT change. Never overwrites: an existing toName is invalid_input. Confirm-gated + in-use-protected: renaming a file referenced by a plan post breaks that post's media reference, so it refuses with needs_confirm naming the using post(s) unless confirm:true (the plan rows are not auto-rewritten). A missing source is invalid_input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Current basename under data/media, e.g. old.mp4 (no path segments) | |
| actor | Yes | Who is doing this (e.g. "owner", "agent:claude"); logged to the activity feed. | |
| toName | Yes | New basename, same extension as file, e.g. new.mp4 (no path segments) | |
| confirm | No | Required true to rename a file that is still referenced by a plan post (otherwise needs_confirm). | |
| clientId | No | Optional client id to scope this call (defaults to the active client) |