mirror of
https://github.com/nexu-io/openmotion.git
synced 2026-12-06 19:57:27 +08:00
Consolidate Skill reading maps and media procedures (#494)
* Consolidate Skill reading maps and media procedures Keep template first-run execution in its owning reference and remove the shared creative reading dependency. Split media guidance into registered operation-specific references while preserving generation, authorization and handback rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop the stale handback ordinal and test the handbook procedure where it lives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Awek-015 <zhouhaoran@refly.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,10 @@ export const workflowRegistry = {
|
||||
status: 'ready',
|
||||
sections: {
|
||||
start: 'skills/openmotion-media/SKILL.md',
|
||||
planning: 'skills/openmotion-media/references/planning.md',
|
||||
setup: 'skills/openmotion-media/references/setup.md',
|
||||
jobs: 'skills/openmotion-media/references/jobs.md',
|
||||
inspection: 'skills/openmotion-media/references/inspection.md',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -18,66 +18,25 @@ Apply the [shared material policy](../openmotion-production/references/materials
|
||||
|
||||
Apply the shared [generation boundary](../openmotion-production/references/materials.md#generation-boundary) before discovering or generating media.
|
||||
|
||||
**Motion-first rule — generation upgrades the motion film, never replaces it**: for reference recreation, follow the recreation workflow instead of this paragraph: preserve the reference's story, shot order, motion, holds and cuts; rebuild code-representable elements natively and use approved media for footage-led subjects or actions, without adding native decoration or re-cutting to beats unless the reference or the user asks; a footage-led shot need not stand on its own when its media is hidden. For template films and scoped edits, keep the accepted motion, holds and cuts: replace or upgrade the planned asset in place and do not add movement or re-cut unless the user asks. For original films, first plan the film exactly as you would with no generation at all: the native action script with its key visual events, subject transformations, scene changes, camera moves and transitions (for example a drawn product outline that assembles, a scan or recognition beat, a scene change, a logo resolve). Then pick which elements of that plan a generated asset upgrades — a code-drawn product becomes a photoreal render or cutout that performs the same moves, a flat background becomes a plate, a placeholder becomes footage — and derive the asset list from those roles. Never drop or simplify a planned visual event to make room for a generated image, and never let one hero image become the whole film. Request assets that can move (subject on a clean or removable background, separate plates or light passes, spare canvas for push, pan and parallax, distinct states or angles). Give each generated still the motion its planned role calls for, alongside that shot's native elements; intentional holds and quiet shots remain valid. Cuts and accents follow the speech and music timing the creative workflow chose. Before preview, check the film against the native plan: it must contain every planned visual event, and with the generated pixels blanked out it must still read as a complete motion film. A "just make it, don't ask" request skips optional creative questions, not this design work and not a missing authorization for paid generation.
|
||||
|
||||
Keep credentials strictly isolated: the shared local media service reads saved workspace keys and injects authentication. Never read `secrets.json`, print or log keys, place credentials into prompts or parameters, or ask the user to paste an API key into chat. Keep user-facing setup, consent and delivery messages in plain language in the user's language; never expose internal Skill names, Tool names, guidance file paths, quoted rule text or internal labels (`mg`, `media`, `replaced — not scored`) in any message to the user.
|
||||
|
||||
## Media handbook handoff
|
||||
|
||||
The MCP handbook media-generation example is an explicit request for multimodal guidance. Start with read-only `inspect` even when the user has yet to supply a concrete asset brief. When a provider is available, continue the existing request or ask what they want to generate or which reference they want to recreate. Preserve any reference, brief and project context already supplied.
|
||||
|
||||
Follow the setup and generation sequence below. Read-only onboarding can proceed without creating a project or starting generation.
|
||||
|
||||
## 1. Define the asset job, inspect providers and confirm key-spend consent
|
||||
|
||||
Derive subject, recognizable identity features, action, framing, lighting, style, duration budget and negative space for editable native typography from the active brief, reference segment or user prompt. Reuse approved project assets before generating new ones.
|
||||
|
||||
Choose the modality from what must physically change on screen or in the mix:
|
||||
|
||||
- **Still image (`modality: "image"`)**: photographic settings, hero product frames, cutouts or backdrop plates where native HTML/CSS/GSAP camera and layer motion carry the choreography.
|
||||
- **Video (`modality: "video"`)**: continuous subject or environmental footage that native graphics cannot represent directly. Keep text, UI, charts, logos and captions as native editable HTML/SVG overlays above the video plate rather than baking copy into generated video pixels.
|
||||
- **Speech (`modality: "audio"`)**: spoken narration or dialogue. Use the discovered speech model mode (`"text-to-speech"`) and its native options. The adapter maps the prompt to the model’s actual input field; an input named `text` does not by itself mean speech (some sound-effect models also use it). When captions, visual beats or scene cuts synchronize to individual lines, generate one audio file per sentence or beat within the target duration budget rather than estimating cue timestamps from one monolithic file. Choose a voice for the film language and tone; for Mandarin, confirm the chosen voice supports Chinese. Unless the user specifies otherwise, narration language follows the on-screen copy and target market.
|
||||
- **Music / sound (`modality: "audio"`)**: background beds, stings or ambient audio where supported by the enabled provider. Use a music or sound-effect model with `mode: "text-to-audio"`. BGM is a use of music, not a separate generation mode. Do not switch to a speech model or require a voice for music/SFX; use the selected model’s native duration, looping and instrumental parameters.
|
||||
## Provider preference and authorization
|
||||
|
||||
Run read-only discovery and obtain consent before submitting any paid generation request:
|
||||
|
||||
1. Call `openmotion_media_use` with `action: "inspect"`. It lists each provider with `configured`, `available`, `verification` and `reason`, plus `defaults` (the model selected for each modality) and `settings` (where keys are managed). Saving a key in Studio's **Model providers** settings (Chinese UI: **模型供应商**, in the left rail or Settings) enables that provider, and signing in to an OpenDesign account adds its entitled models; configuration alone does not prove entitlement, quota or balance. Handle these setup cases in plain user language, folded into the workflow's single upfront question when it has one:
|
||||
- **No usable provider** (no provider has `available: true`): call `openmotion_open_preview` with `{ target: "providers" }` and follow its page handoff. Guide the user in plain words to sign in to their OpenDesign account: **Settings → Account → Sign in with OpenDesign** (Chinese UI: **设置 → 账户 → 使用 OpenDesign 登录**). Tell them a paid OpenDesign plan provides multimodal generation such as images, video and voice, managed from **Subscription & usage → Manage subscription** (Chinese UI: **订阅与用量 → 管理订阅**). Mention in one short sentence that an API key they already have from another provider can be saved under **Model providers** (**模型供应商**) instead, or that they can supply their own files. Ask them to tell you once done, then run `inspect` again and continue the same task. If a provider shows `configured: true` with `verification: "rejected"`, say the saved key was rejected (wrong, expired or lacking permission) and ask them to replace it in the same place. When they say it is saved, run `inspect` again and continue the same task.
|
||||
- **Key works but a needed kind is missing**: check each needed kind with `action: "models", provider, modality, refresh: true` (`image`, `video` or `audio`; among audio models, the discovered `mode` follows the model's operation: speech uses `text-to-speech`, music and sound effects use `text-to-audio`; an input named `text` does not by itself mean speech). If no usable provider offers it, tell the user what their key can and cannot make, explain both supported and missing parts in the consent question, including the proposed alternative (for example locally synthesized BGM if available, user-supplied music or no music). Generate supported parts after consent. Do not silently downgrade a requested capability; if existing authorization does not cover an alternative, keep that part pending and continue independent work.
|
||||
- Never silently switch to an unapproved paid provider.
|
||||
2. Provider guides show request fields as `openmotion_media_use` JSON; that shape applies only to existing project-direct jobs. For a new submission, convert it to the asset Tool: drop `provider` and `projectId`, prefix the model as `<provider>:<model>` (for example `fal:fal-ai/flux/schnell`), keep `modality`, `mode`, `prompt` and `parameters`, and poll the asset Tool with only the original `jobId`. Call `action: "reference"` with the selected provider ID from `inspect` and read only that provider's guide ([Atlas Cloud](../openmotion-production/references/media-providers/atlascloud.md), [fal.ai](../openmotion-production/references/media-providers/fal.md), [WaveSpeedAI](../openmotion-production/references/media-providers/wavespeed.md), [OpenDesign Cloud](../openmotion-production/references/media-providers/opendesign.md), [OpenDesign account](../openmotion-production/references/media-providers/account.md) or [registered compatible APIs](../openmotion-production/references/media-providers/compatible.md)) for endpoint rules, supported modes and parameter schemas.
|
||||
3. **Choose providers and models yourself; do not ask the user to choose.** For each needed asset, use OpenDesign whenever it is available and offers a fitting model: the signed-in OpenDesign account (`account`) first, then OpenDesign Cloud (`opendesign`). Only when OpenDesign cannot make that kind of asset, pick among the user's other available providers, preferring the model selected for that kind in `defaults` when it fits, otherwise the model whose documented inputs and outputs best match the job. A provider or model the user names in this conversation overrides this order. State the chosen provider and model for each asset in the consent question and the delivery reply. Call `action: "models", provider, modality, refresh: true` (add `query` to narrow large catalogs) to confirm the choice; catalog visibility establishes discoverability. Live execution establishes account access.
|
||||
4. **Confirm key-spend consent before `action: "generate"`**: Unless the user has already approved this exact plan (assets, quantities, provider/model) in the current task, state the planned asset list (modality, count or approximate duration, and selected provider/model) and ask whether they agree to consume their configured multimodal API key (or, for provider `account`, their OpenDesign account credits) before calling `action: "generate"`. Batch this consent check with any other upfront task questions rather than asking piecemeal per clip. Ask it as a plain product question in the user's language, one line per planned asset plus one line for what the key cannot make and the proposed alternative; never cite this guidance, its file path or rule text. Then end the turn and wait for the answer. Do not continue past an unanswered consent question by substituting free, local or code-made voice, music or footage for the planned generated assets, and do not tell the user the question can be ignored. Use such a substitute only when the user chooses it or declines generation.
|
||||
**Choose providers and models yourself; do not ask the user to choose.** For each needed asset, use OpenDesign whenever it is available and offers a fitting model: the signed-in OpenDesign account (`account`) first, then OpenDesign Cloud (`opendesign`). Only when OpenDesign cannot make that kind of asset, pick among the user's other available providers, preferring the model selected for that kind in `defaults` when it fits, otherwise the model whose documented inputs and outputs best match the job. A provider or model the user names in this conversation overrides this order. State the chosen provider and model for each asset in the consent question and the delivery reply. Call `action: "models", provider, modality, refresh: true` (add `query` to narrow large catalogs) to confirm the choice; catalog visibility establishes discoverability. Live execution establishes account access.
|
||||
|
||||
## 2. Generate library assets and track the original job
|
||||
**Confirm key-spend consent before `action: "generate"`**: Unless the user has already approved this exact plan (assets, quantities, provider/model) in the current task, state the planned asset list (modality, count or approximate duration, and selected provider/model) and ask whether they agree to consume their configured multimodal API key (or, for provider `account`, their OpenDesign account credits) before calling `action: "generate"`. Batch this consent check with any other upfront task questions rather than asking piecemeal per clip. Ask it as a plain product question in the user's language, one line per planned asset plus one line for what the key cannot make and the proposed alternative; never cite this guidance, its file path or rule text. Then end the turn and wait for the answer. Do not continue past an unanswered consent question by substituting free, local or code-made voice, music or footage for the planned generated assets, and do not tell the user the question can be ignored. Use such a substitute only when the user chooses it or declines generation.
|
||||
|
||||
1. Prefer `openmotion_assets_use` when it appears in `tools/list`. If only `openmotion_assets` is exposed, use its compatible asset actions; it has no `read`, so inspect adopted local files with `ffprobe`, extracted frames and available playback tools. Do not invoke an undiscovered name or silently fall back after a failed submission.
|
||||
2. Submit `action: "generate"` with a deterministic `requestId` per distinct asset intent, the **full model ID** returned by discovery (for example `fal:fal-ai/flux/schnell`), `modality`, `prompt`, optional supported `mode` and provider-specific `parameters`. No project is required for generation or a standalone asset request. State concrete subject/action/framing/lighting/text-safe space, or exact spoken script and delivery/musical structure.
|
||||
3. For image editing, first `import` a local image into the library with a stable `requestId` and real absolute `sourcePath`. Use exactly one `references: [{assetId, versionId}]`, and only an image model advertising `supportsImageReference`. Set target `assetId` and `parentVersionId` to append a version while retaining the original; the parent alone is not a reference input. Other reference operations, including library-reference image-to-video, are not supported by this route. Explain the gap and offer text-to-video or a still image animated with native Motion; do not invent reference support or send a local disk path as a remote URL. An existing project-direct task keeps its own reference form: `openmotion_media_use` accepts one project-relative PNG/JPEG/WebP under 20 MB as top-level `referenceAsset` for a model with `supportsImageReference: true`, snapshots it when queued and never overwrites the source.
|
||||
4. Queued `job.id` is not finished media. Keep that original local `jobId` and poll `action: "status", jobId` through the same asset Tool until `completed`, `failed` or `cancelled`. `jobs` can recover new project and library tasks in this workspace, but is not a reason to generate again. For `savePending: true`, repair storage and call `retry_save` with the original `jobId` and stable `requestId`; this saves retained local outputs without a model call. `cancel` requests a stop, without promising remote cancellation or a refund.
|
||||
5. **Keep old project tasks on their original route**: a task already submitted through `openmotion_media_use` retains its original Tool, `projectId`, `requestId` and `jobId`. Do not move it to a new generate call. That compatibility route saves project files directly; do not import them again. After completion, immediately `openmotion_get_project` to record the external-change snapshot before editing or restoring a version.
|
||||
6. **Regeneration**: regenerate only within the asset count and spend the user explicitly approved, including any retries they approved. If that approval does not cover another paid request, keep usable versions and ask before submitting it. Keep earlier usable versions; changing text/layout does not regenerate pixels or audio. A failed/interrupted request or uncertain outcome is not a quality regeneration: inspect the original task before considering another paid submission, never switch Tool/provider to hide an unknown result.
|
||||
## Read for the current operation
|
||||
|
||||
Classify failures from the actual status, error code and stage before deciding the next step:
|
||||
Read the applicable references before their operations; reuse complete bodies already in context. For new generation, read planning, setup and jobs for preparation, including provider schemas, before confirming the plan and authorization above; submit only after authorization, then inspect results. A continuation loads only its affected procedures.
|
||||
|
||||
- **Provider key or permission rejection (`401` / `403`) vs upstream vendor auth (`upstream_provider_unauthenticated`)**: distinguish an invalid/unauthorized workspace or provider key from an upstream model vendor authentication issue behind a gateway.
|
||||
- **Unexposed route vs missing resource (`404`)**: distinguish a gateway origin where `/api/v1/media/*` is not deployed on that environment from an unknown model slug or expired remote task ID.
|
||||
- **Timeouts and interrupted polling**: distinguish submit timeout, status-poll timeout and media-download timeout. After an unknown outcome, query `action: "status"` on the original `jobId` (or replay the exact `requestId` with identical inputs) before proposing any new billable submission. Changing prompt, model or parameters requires a new `requestId`.
|
||||
- **Tell the user the next step in plain language**: a `401` / `403` marks the saved key rejected, so ask them to replace it in **Model providers** / **模型供应商**; an error whose text names balance, credit, quota or insufficient funds means topping up in that provider's own console; for any other failure, relay the provider's message briefly without guessing a cause. Keep assets that already finished and offer the same choices as for a missing kind for the failed part.
|
||||
| Operation | Required reference |
|
||||
| --- | --- |
|
||||
| Define or revise an asset for a film or standalone request | [Planning and modality](references/planning.md) |
|
||||
| Discover providers, resolve setup or handle the MCP handbook example | [Discovery and setup](references/setup.md); read-only onboarding needs no project or generation |
|
||||
| Submit a new asset, track/resume an existing job, recover a failure or regenerate | [Submission and job recovery](references/jobs.md); new generation uses assets_use, existing media_use jobs retain their original route |
|
||||
| Inspect completed candidates, import selected versions or deliver results | [Inspection, adoption and handback](references/inspection.md) |
|
||||
|
||||
## 3. Inspect a fixed version, then adopt it
|
||||
|
||||
Only `state: "completed"` and real `libraryAssets` confirm saved library candidates. Pin each chosen `{assetId, versionId}`; `get` returns its metadata, including measured dimensions/duration. `read` through `openmotion_assets_use` returns bounded image previews, up to four requested video frames or a mono 16 kHz audio excerpt (maximum 15 seconds). These previews do not prove full-video playback or complete listening; record checks unavailable in the host as unverified.
|
||||
|
||||
1. **Inspect before adopting**: use the exact library version for visual/audio checks, rather than the asset's changing current-version pointer. Reuse already approved assets. A standalone request can deliver its pinned version without creating a film project.
|
||||
2. **Import only selected candidates into the film**: call the asset Tool with `action: "import_to_project"`, explicit `projectId`, stable `requestId`, `assetId` and `versionId`. Check per-item results and returned project-relative paths; import records a managed version but does not place media on the timeline. Then `openmotion_get_project({ projectId })` and use its refreshed `revision` / `currentVersionId` for editing. Probe the actual adopted file with `ffprobe` or available local media tools for width, height, real duration, frame rate and audio streams before timeline placement. Avoid concurrent project edits during adoption. Old `media_use` files are already in the project and must not be imported again.
|
||||
3. **Inspect visual and audio usability**:
|
||||
- **Images**: inspect decoded frames at intended crop and scale for subject fidelity, clean edges, artifacting and text-safe space.
|
||||
- **Video**: inspect sampled frames across the usable motion window for identity stability, unintended scene cuts, crop safety and embedded audio tracks. When a generated video includes native or ambient audio, explicitly mute (`muted` / `volume = 0`) or mix that track in the composition so it does not collide with narration or music.
|
||||
- **Speech and music**: verify spoken words, pronunciation, pacing and clean phrase endings; use `ffprobe` for container duration and `ffmpeg -af silencedetect` (or waveform inspection) to measure leading/trailing silence and actual spoken phrase end so composition cues, cuts and captions align to real speech rather than clipped endings or unintended black frames. If direct listening or visual inspection is unavailable in the host, record that check as unverified rather than passed.
|
||||
|
||||
## 4. Hand back to the calling workflow
|
||||
|
||||
In the delivery reply, name every part that is not generated as planned (for example local TTS, code-synthesized music or user/retrieved media) so the user knows what they received. For a standalone asset request, report the pinned asset/version identity and available file location, provider/model/job identity, measured dimensions or duration, and any quality or review limitations.
|
||||
|
||||
Inside a film workflow, continue with `openmotion_edit_project` using the refreshed `expectedRevision` and `expectedVersionId`. Generation produces candidate media, not a finished film: keep shot selection, native typography/layout, timeline choreography, Studio preview handoff and final audiovisual review in the active creative or production workflow. Generated assets never relax that workflow's own checks: segments using them pass the active workflow's applicable visual, text and measurement checks. In recreation, its [check and deliver](../openmotion-recreate/references/verify.md) step defines which measurements gate generated shots.
|
||||
MCP-only clients read this entry at `openmotion://workflow/media/start`; the references are `media/planning`, `media/setup`, `media/jobs` and `media/inspection`. Provider schemas remain in the selected production provider reference linked by the job procedure.
|
||||
|
||||
20
skills/openmotion-media/references/inspection.md
Normal file
20
skills/openmotion-media/references/inspection.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Inspect and adopt media
|
||||
|
||||
Read when inspecting completed candidates, adopting selected versions or handing back results.
|
||||
|
||||
## Inspect a fixed version, then adopt it
|
||||
|
||||
Only `state: "completed"` and real `libraryAssets` confirm saved library candidates. Pin each chosen `{assetId, versionId}`; `get` returns its metadata, including measured dimensions/duration. `read` through `openmotion_assets_use` returns bounded image previews, up to four requested video frames or a mono 16 kHz audio excerpt (maximum 15 seconds). These previews do not prove full-video playback or complete listening; record checks unavailable in the host as unverified.
|
||||
|
||||
1. **Inspect before adopting**: use the exact library version for visual/audio checks, rather than the asset's changing current-version pointer. Reuse already approved assets. A standalone request can deliver its pinned version without creating a film project.
|
||||
2. **Import only selected candidates into the film**: call the asset Tool with `action: "import_to_project"`, explicit `projectId`, stable `requestId`, `assetId` and `versionId`. Check per-item results and returned project-relative paths; import records a managed version but does not place media on the timeline. Then `openmotion_get_project({ projectId })` and use its refreshed `revision` / `currentVersionId` for editing. Probe the actual adopted file with `ffprobe` or available local media tools for width, height, real duration, frame rate and audio streams before timeline placement. Avoid concurrent project edits during adoption. Old `media_use` files are already in the project and must not be imported again.
|
||||
3. **Inspect visual and audio usability**:
|
||||
- **Images**: inspect decoded frames at intended crop and scale for subject fidelity, clean edges, artifacting and text-safe space.
|
||||
- **Video**: inspect sampled frames across the usable motion window for identity stability, unintended scene cuts, crop safety and embedded audio tracks. When a generated video includes native or ambient audio, explicitly mute (`muted` / `volume = 0`) or mix that track in the composition so it does not collide with narration or music.
|
||||
- **Speech and music**: verify spoken words, pronunciation, pacing and clean phrase endings; use `ffprobe` for container duration and `ffmpeg -af silencedetect` (or waveform inspection) to measure leading/trailing silence and actual spoken phrase end so composition cues, cuts and captions align to real speech rather than clipped endings or unintended black frames. If direct listening or visual inspection is unavailable in the host, record that check as unverified rather than passed.
|
||||
|
||||
## Hand back to the calling workflow
|
||||
|
||||
In the delivery reply, name every part that is not generated as planned (for example local TTS, code-synthesized music or user/retrieved media) so the user knows what they received. For a standalone asset request, report the pinned asset/version identity and available file location, provider/model/job identity, measured dimensions or duration, and any quality or review limitations.
|
||||
|
||||
Inside a film workflow, continue with `openmotion_edit_project` using the refreshed `expectedRevision` and `expectedVersionId`. Generation produces candidate media, not a finished film: keep shot selection, native typography/layout, timeline choreography, Studio preview handoff and final audiovisual review in the active creative or production workflow. Generated assets never relax that workflow's own checks: segments using them pass the active workflow's applicable visual, text and measurement checks. In recreation, its [check and deliver](../../openmotion-recreate/references/verify.md) step defines which measurements gate generated shots.
|
||||
23
skills/openmotion-media/references/jobs.md
Normal file
23
skills/openmotion-media/references/jobs.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Submit and track media jobs
|
||||
|
||||
Read before submission or when resuming, recovering or regenerating a job. Apply the [entry authorization](../SKILL.md#provider-preference-and-authorization) before any paid request.
|
||||
|
||||
## Provider request conversion
|
||||
|
||||
Provider guides show request fields as `openmotion_media_use` JSON; that shape applies only to existing project-direct jobs. For a new submission, convert it to the asset Tool: drop `provider` and `projectId`, prefix the model as `<provider>:<model>` (for example `fal:fal-ai/flux/schnell`), keep `modality`, `mode`, `prompt` and `parameters`, and poll the asset Tool with only the original `jobId`. Call `action: "reference"` with the selected provider ID from `inspect` and read only that provider's guide ([Atlas Cloud](../../openmotion-production/references/media-providers/atlascloud.md), [fal.ai](../../openmotion-production/references/media-providers/fal.md), [WaveSpeedAI](../../openmotion-production/references/media-providers/wavespeed.md), [OpenDesign Cloud](../../openmotion-production/references/media-providers/opendesign.md), [OpenDesign account](../../openmotion-production/references/media-providers/account.md) or [registered compatible APIs](../../openmotion-production/references/media-providers/compatible.md)) for endpoint rules, supported modes and parameter schemas.
|
||||
|
||||
## Generate library assets and track the original job
|
||||
|
||||
1. Prefer `openmotion_assets_use` when it appears in `tools/list`. If only `openmotion_assets` is exposed, use its compatible asset actions; it has no `read`, so inspect adopted local files with `ffprobe`, extracted frames and available playback tools. Do not invoke an undiscovered name or silently fall back after a failed submission.
|
||||
2. Submit `action: "generate"` with a deterministic `requestId` per distinct asset intent, the **full model ID** returned by discovery (for example `fal:fal-ai/flux/schnell`), `modality`, `prompt`, optional supported `mode` and provider-specific `parameters`. No project is required for generation or a standalone asset request. State concrete subject/action/framing/lighting/text-safe space, or exact spoken script and delivery/musical structure.
|
||||
3. For image editing, first `import` a local image into the library with a stable `requestId` and real absolute `sourcePath`. Use exactly one `references: [{assetId, versionId}]`, and only an image model advertising `supportsImageReference`. Set target `assetId` and `parentVersionId` to append a version while retaining the original; the parent alone is not a reference input. Other reference operations, including library-reference image-to-video, are not supported by this route. Explain the gap and offer text-to-video or a still image animated with native Motion; do not invent reference support or send a local disk path as a remote URL. An existing project-direct task keeps its own reference form: `openmotion_media_use` accepts one project-relative PNG/JPEG/WebP under 20 MB as top-level `referenceAsset` for a model with `supportsImageReference: true`, snapshots it when queued and never overwrites the source.
|
||||
4. Queued `job.id` is not finished media. Keep that original local `jobId` and poll `action: "status", jobId` through the same asset Tool until `completed`, `failed` or `cancelled`. `jobs` can recover new project and library tasks in this workspace, but is not a reason to generate again. For `savePending: true`, repair storage and call `retry_save` with the original `jobId` and stable `requestId`; this saves retained local outputs without a model call. `cancel` requests a stop, without promising remote cancellation or a refund.
|
||||
5. **Keep old project tasks on their original route**: a task already submitted through `openmotion_media_use` retains its original Tool, `projectId`, `requestId` and `jobId`. Do not move it to a new generate call. That compatibility route saves project files directly; do not import them again. After completion, immediately `openmotion_get_project` to record the external-change snapshot before editing or restoring a version.
|
||||
6. **Regeneration**: regenerate only within the asset count and spend the user explicitly approved, including any retries they approved. If that approval does not cover another paid request, keep usable versions and ask before submitting it. Keep earlier usable versions; changing text/layout does not regenerate pixels or audio. A failed/interrupted request or uncertain outcome is not a quality regeneration: inspect the original task before considering another paid submission, never switch Tool/provider to hide an unknown result.
|
||||
|
||||
Classify failures from the actual status, error code and stage before deciding the next step:
|
||||
|
||||
- **Provider key or permission rejection (`401` / `403`) vs upstream vendor auth (`upstream_provider_unauthenticated`)**: distinguish an invalid/unauthorized workspace or provider key from an upstream model vendor authentication issue behind a gateway.
|
||||
- **Unexposed route vs missing resource (`404`)**: distinguish a gateway origin where `/api/v1/media/*` is not deployed on that environment from an unknown model slug or expired remote task ID.
|
||||
- **Timeouts and interrupted polling**: distinguish submit timeout, status-poll timeout and media-download timeout. After an unknown outcome, query `action: "status"` on the original `jobId` (or replay the exact `requestId` with identical inputs) before proposing any new billable submission. Changing prompt, model or parameters requires a new `requestId`.
|
||||
- **Tell the user the next step in plain language**: a `401` / `403` marks the saved key rejected, so ask them to replace it in **Model providers** / **模型供应商**; an error whose text names balance, credit, quota or insufficient funds means topping up in that provider's own console; for any other failure, relay the provider's message briefly without guessing a cause. Keep assets that already finished and offer the same choices as for a missing kind for the failed part.
|
||||
16
skills/openmotion-media/references/planning.md
Normal file
16
skills/openmotion-media/references/planning.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Plan the asset
|
||||
|
||||
Read when defining or changing an asset job. Keep the active workflow and approved creative scope.
|
||||
|
||||
**Motion-first rule — generation upgrades the motion film, never replaces it**: for reference recreation, follow the recreation workflow instead of this paragraph: preserve the reference's story, shot order, motion, holds and cuts; rebuild code-representable elements natively and use approved media for footage-led subjects or actions, without adding native decoration or re-cutting to beats unless the reference or the user asks; a footage-led shot need not stand on its own when its media is hidden. For template films and scoped edits, keep the accepted motion, holds and cuts: replace or upgrade the planned asset in place and do not add movement or re-cut unless the user asks. For original films, first plan the film exactly as you would with no generation at all: the native action script with its key visual events, subject transformations, scene changes, camera moves and transitions (for example a drawn product outline that assembles, a scan or recognition beat, a scene change, a logo resolve). Then pick which elements of that plan a generated asset upgrades — a code-drawn product becomes a photoreal render or cutout that performs the same moves, a flat background becomes a plate, a placeholder becomes footage — and derive the asset list from those roles. Never drop or simplify a planned visual event to make room for a generated image, and never let one hero image become the whole film. Request assets that can move (subject on a clean or removable background, separate plates or light passes, spare canvas for push, pan and parallax, distinct states or angles). Give each generated still the motion its planned role calls for, alongside that shot's native elements; intentional holds and quiet shots remain valid. Cuts and accents follow the speech and music timing the creative workflow chose. Before preview, check the film against the native plan: it must contain every planned visual event, and with the generated pixels blanked out it must still read as a complete motion film. A "just make it, don't ask" request skips optional creative questions, not this design work and not a missing authorization for paid generation.
|
||||
|
||||
## Define the asset and modality
|
||||
|
||||
Derive subject, recognizable identity features, action, framing, lighting, style, duration budget and negative space for editable native typography from the active brief, reference segment or user prompt. Reuse approved project assets before generating new ones.
|
||||
|
||||
Choose the modality from what must physically change on screen or in the mix:
|
||||
|
||||
- **Still image (`modality: "image"`)**: photographic settings, hero product frames, cutouts or backdrop plates where native HTML/CSS/GSAP camera and layer motion carry the choreography.
|
||||
- **Video (`modality: "video"`)**: continuous subject or environmental footage that native graphics cannot represent directly. Keep text, UI, charts, logos and captions as native editable HTML/SVG overlays above the video plate rather than baking copy into generated video pixels.
|
||||
- **Speech (`modality: "audio"`)**: spoken narration or dialogue. Use the discovered speech model mode (`"text-to-speech"`) and its native options. The adapter maps the prompt to the model’s actual input field; an input named `text` does not by itself mean speech (some sound-effect models also use it). When captions, visual beats or scene cuts synchronize to individual lines, generate one audio file per sentence or beat within the target duration budget rather than estimating cue timestamps from one monolithic file. Choose a voice for the film language and tone; for Mandarin, confirm the chosen voice supports Chinese. Unless the user specifies otherwise, narration language follows the on-screen copy and target market.
|
||||
- **Music / sound (`modality: "audio"`)**: background beds, stings or ambient audio where supported by the enabled provider. Use a music or sound-effect model with `mode: "text-to-audio"`. BGM is a use of music, not a separate generation mode. Do not switch to a speech model or require a voice for music/SFX; use the selected model’s native duration, looping and instrumental parameters.
|
||||
16
skills/openmotion-media/references/setup.md
Normal file
16
skills/openmotion-media/references/setup.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Provider discovery and setup
|
||||
|
||||
Read for a new generation plan, provider setup or the MCP handbook handoff. Apply the entry's provider preference and spend authorization before submission.
|
||||
|
||||
## Media handbook handoff
|
||||
|
||||
The MCP handbook media-generation example is an explicit request for multimodal guidance. Start with read-only `inspect` even when the user has yet to supply a concrete asset brief. When a provider is available, continue the existing request or ask what they want to generate or which reference they want to recreate. Preserve any reference, brief and project context already supplied.
|
||||
|
||||
Follow the setup below and the [job procedure](jobs.md) when generation is needed. Read-only onboarding can proceed without creating a project or starting generation.
|
||||
|
||||
## Inspect providers and resolve setup
|
||||
|
||||
1. Call `openmotion_media_use` with `action: "inspect"`. It lists each provider with `configured`, `available`, `verification` and `reason`, plus `defaults` (the model selected for each modality) and `settings` (where keys are managed). Saving a key in Studio's **Model providers** settings (Chinese UI: **模型供应商**, in the left rail or Settings) enables that provider, and signing in to an OpenDesign account adds its entitled models; configuration alone does not prove entitlement, quota or balance. Handle these setup cases in plain user language, folded into the workflow's single upfront question when it has one:
|
||||
- **No usable provider** (no provider has `available: true`): call `openmotion_open_preview` with `{ target: "providers" }` and follow its page handoff. Guide the user in plain words to sign in to their OpenDesign account: **Settings → Account → Sign in with OpenDesign** (Chinese UI: **设置 → 账户 → 使用 OpenDesign 登录**). Tell them a paid OpenDesign plan provides multimodal generation such as images, video and voice, managed from **Subscription & usage → Manage subscription** (Chinese UI: **订阅与用量 → 管理订阅**). Mention in one short sentence that an API key they already have from another provider can be saved under **Model providers** (**模型供应商**) instead, or that they can supply their own files. Ask them to tell you once done, then run `inspect` again and continue the same task. If a provider shows `configured: true` with `verification: "rejected"`, say the saved key was rejected (wrong, expired or lacking permission) and ask them to replace it in the same place. When they say it is saved, run `inspect` again and continue the same task.
|
||||
- **Key works but a needed kind is missing**: check each needed kind with `action: "models", provider, modality, refresh: true` (`image`, `video` or `audio`; among audio models, the discovered `mode` follows the model's operation: speech uses `text-to-speech`, music and sound effects use `text-to-audio`; an input named `text` does not by itself mean speech). If no usable provider offers it, tell the user what their key can and cannot make, explain both supported and missing parts in the consent question, including the proposed alternative (for example locally synthesized BGM if available, user-supplied music or no music). Generate supported parts after consent. Do not silently downgrade a requested capability; if existing authorization does not cover an alternative, keep that part pending and continue independent work.
|
||||
- Never silently switch to an unapproved paid provider.
|
||||
@@ -44,7 +44,7 @@ Read Hyperframes guidance within the [native engine boundary](native.md#engine-g
|
||||
| 按既定声音决定执行或工程音轨调整,含画面锁定 | [声音执行与声画锚点](sound.md)、声音相关的 [审片](review.md);不加载原创声音构思。需要新设计声音叙事时,由所选 director 入口按需读取声音设计参考。 |
|
||||
| 原样使用模板、不做修改 | Editor-only uses the [editable preview handoff](native.md#editable-preview-handoff). Explicit file delivery applies [delivery scope](production.md#delivery-scope), [source pinning](native.md#pin-source-for-independent-deliverables) and [verification scope](verification.md#verification-scope). The selected entry owns its sequence; no authoring/creative read is required solely to export. An edited project cannot reuse an old preview. |
|
||||
| 使用/适配可编辑模板,需要创建、编辑或渲染工程 | ID/来源尚未明确时读取 [模板能力说明](templates.md);内容修改按影响审片,原样渲染按上面的文件交付范围执行,不因请求渲染而加载创作规范。 |
|
||||
| 明确要求视频转可复用模板 | [openmotion-video-to-template](../../openmotion-video-to-template/SKILL.md) 的制作与打包参考按阶段读取;制作决策、审片及实际参考视频 |
|
||||
| 明确要求视频转可复用模板 | 所选入口负责自己的分阶段读集并检查实际参考视频;按影响应用共享 [制作决策](decisions.md)、[审片](review.md) 与 [可移植工程](portable-project.md)。 |
|
||||
| 复刻视频 | [制作决策](decisions.md)、审片,另实际检查参考视频 |
|
||||
| 局部文字/视觉修改或动态审片 | 审片;沿用已有结构,不补读整套原创流程 |
|
||||
| 修改已有内容,含声音、模板内容替换和大幅重编 | 追加 [共享修改流程](edit.md);首次创作、仅查看/审片/导出无需因此加载 |
|
||||
|
||||
@@ -27,4 +27,6 @@ All hosts share the same three distinct reference IDs sampled once from the nine
|
||||
|
||||
A user-sent “yes / 好 / 就这个” after one named recommendation accepts that recommendation's exact ID. Continue with it without repeating template selection. A number, name or submitted card brief selects that exact card; only a generic agreement to several equal choices without a single recommendation needs clarification. Browsing, playing or copying a card does not authorize creation. Export follows the user's requested scope.
|
||||
|
||||
Carry the accepted ID, source and requirements through creation, workflow handoff, retry and recovery until the user explicitly changes the selection. For the curated first-run references, call `openmotion_get_template` with that ID, read its instructions and motionDocument and follow `openmotion-recreate` to build the selected reference as an editable project. Preserve its content and motion for a sample experience; unrelated workspace branding is not a request to adapt it. Use `projectType=template` only for a selected directly editable source. A source without a copyable project needs the reference workflow, not a different template. If retrieval or production is blocked, preserve the selection and explain the blocker. Shorter duration, faster export, builtin availability and technical smoke testing never justify switching to decision-tree or another sample. Before delivery, compare the actual project with the accepted source and record the source ID in its working notes; report any unmet scope.
|
||||
Carry the accepted ID, source and requirements until the user explicitly changes the selection. A directly editable source can use `projectType=template`; a reference-only source requires recreation, not a different template. Sample experiences retain the accepted content, motion and native duration; unrelated workspace branding is not a request to adapt them.
|
||||
|
||||
A native recommendation card identifies the exact ID in this chat's corresponding result. Its Recreate template button only prepares a composer draft; it does not submit a task or authorize creation/export. Draft preparation is not project creation evidence. Presentation itself remains read-only.
|
||||
|
||||
@@ -7,7 +7,7 @@ description: Browse, compare and recommend OpenMotion catalog templates with a v
|
||||
|
||||
## Scope and shared execution
|
||||
|
||||
For an accepted onboarding recommendation, first apply [accepted template selection](../openmotion-production/references/templates.md#accepted-template-selection). Carry its exact ID and requested scope into the route below; a reference-only selection uses `openmotion-recreate` before considering unchanged-template export. Workflow handoff preserves the selected source.
|
||||
For an accepted onboarding recommendation or submitted recommendation-card brief, read [first-run execution and recovery](references/first-use.md#first-run-experience-defaults) before choosing the delivery branch below.
|
||||
|
||||
For an unchanged template with explicit HTML/project or MP4 file delivery, follow [unchanged file export](references/unchanged-export.md) directly. That branch owns its reading, verification and parallel handoff sequence; resume the general flow below only when content, assets, timing or output specifications change. Opening an unchanged template without requesting files still uses the editor-only flow below.
|
||||
|
||||
@@ -15,10 +15,6 @@ Turn the selected editable template into the requested draft, editable project o
|
||||
|
||||
Changes to existing content use the [shared edit workflow](../openmotion-production/references/edit.md), including required related changes and preserved content. Missing instructions and target sources must finish returning to the model before a later call applies a template, imports, writes or exports. Entering this Skill again does not create another copy, apply the template again or repeat a completed export.
|
||||
|
||||
The accepted installation experience follows [first-run defaults](references/first-use.md#first-run-experience-defaults): use the exact template ID and unchanged sample content offered and accepted in this conversation, with that template's own duration. Resolve acceptance through [accepted template selection](../openmotion-production/references/templates.md#accepted-template-selection): a yes to one named recommendation accepts that exact ID; only agreement to several equal choices without a recommendation needs clarification. Resume an existing experience project or create one independent copy once. Open its editable preview; export only if requested. Do not restart the template/assets questionnaire or substitute a fixed default. Initial installation reply rules and few-shots come from `docs/install-onboarding.md`, section “Installation-success reply”; this Skill resumes creation after consent.
|
||||
|
||||
A native recommendation card identifies the exact ID in this chat's corresponding result. Its Recreate template button only prepares a composer draft; it does not submit a task or authorize creation/export. Wait for the user to send the brief, then honor its template title/ID, requirements, attachments and requested HTML/MP4 delivery. Do not substitute legacy frozen sample `createArgs` for a customized submitted brief. A reference card has no `createArgs`: read its exact ID and continue through recreation. Only when the accepted unchanged card is a directly editable sample that actually supplies `createArgs`, pass its complete frozen `createArgs` to `openmotion_create_project` without adding a current `sessionId`, changing its `requestId` or rewriting its title/requirements on retry. User changes form a new intent under the existing workflow; do not reuse an old request ID with altered inputs. Reuse a confirmed project from this experience, including a GUI-created copy, rather than creating again after a card redisplay. Draft preparation is not project creation evidence; reconcile an unknown write before retrying. Presentation itself remains read-only.
|
||||
|
||||
When selecting, obtaining or replacing assets, read the [shared material policy](../openmotion-production/references/materials.md), preserving the template's agreed structure, motion and content constraints. An unchanged preview handoff does not trigger asset acquisition.
|
||||
|
||||
## Browse or recommend catalog templates
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
# First-run template experience
|
||||
|
||||
Read only after the user accepts a first-run template recommendation, including a curated reference that continues through recreation. The installation welcome remains in docs/install-onboarding.md.
|
||||
Read for an accepted first-run template recommendation (including a curated reference that continues through recreation) or a submitted recommendation-card brief. Initial installation reply rules and few-shots remain in `docs/install-onboarding.md`, section “Installation-success reply”; this procedure resumes creation after consent.
|
||||
|
||||
## First-run experience defaults
|
||||
|
||||
Installation opens the library without creating a project. Resolve agreement and retain the selected source through [accepted template selection](../../openmotion-production/references/templates.md#accepted-template-selection): agreement to one named recommendation accepts its exact ID; agreement to several equal choices without a recommendation does not identify one. Reuse an existing experience project, including a Studio **Open and edit** project, instead of creating a duplicate.
|
||||
Installation opens the library without creating a project. Resolve agreement, source capability and sample scope through [accepted template selection](../../openmotion-production/references/templates.md#accepted-template-selection). Do not restart the template/assets questionnaire or substitute a fixed default. Reuse an existing experience project, including a Studio **Open and edit** project, instead of creating a duplicate.
|
||||
|
||||
For a reference-only selection, read its exact ID with `openmotion_get_template` and continue through `openmotion-recreate` with the accepted sample content or submitted changes. For a directly editable source, call `openmotion_create_project` once with projectType=template, the accepted templateId, stable requestId, title and confirmed requirements. Record the source ID and returned projectId in working notes. Preserve that selection during retries and recovery; an unavailable source is a blocker to report, not permission to switch samples. Call `openmotion_open_preview({projectId})` and open its exact previewUrl through the host's supported browser/panel; check the actual selected content and playback. Export only when requested.
|
||||
For a reference-only selection, read its exact ID with `openmotion_get_template`, read its instructions and motionDocument, and continue through `openmotion-recreate` with the accepted sample content or submitted changes. For a directly editable source, call `openmotion_create_project` once with projectType=template, the accepted templateId, stable requestId, title and confirmed requirements. Record the source ID and returned projectId in working notes. Preserve that selection during retries and recovery; if retrieval or production is blocked, explain the blocker without switching samples. Shorter duration, faster export, builtin availability and technical smoke testing never justify switching to decision-tree or another sample. Call `openmotion_open_preview({projectId})` and open its exact previewUrl through the host's supported browser/panel; check the actual selected content and playback. Before delivery, compare the actual project with the accepted source and report any unmet scope. Export only when requested.
|
||||
|
||||
For a recommendation card, wait for the user to send the brief, then honor its template title/ID, requirements, attachments and requested HTML/MP4 delivery. Do not substitute legacy frozen sample `createArgs` for a customized submitted brief. A reference card has no `createArgs`: read its exact ID and continue through recreation. Only when the accepted unchanged card is a directly editable sample that actually supplies `createArgs`, pass its complete frozen `createArgs` to `openmotion_create_project` without adding a current `sessionId`, changing its `requestId` or rewriting its title/requirements on retry. User changes form a new intent under the existing workflow; do not reuse an old request ID with altered inputs. Reuse a confirmed project from this experience, including a GUI-created copy, rather than creating again after a card redisplay. Reconcile an unknown write before retrying.
|
||||
|
||||
For a directly editable source with requested unchanged HTML/project or MP4 files, continue through [unchanged file export](unchanged-export.md), including its bounded handoff and parallel version-pinned work. Modified content uses [verification](../../openmotion-production/references/verification.md); reuse an applicable existing job or call `openmotion_export_request` once with the current projectId/versionId/revision and stable requestId. Poll `openmotion_get_project` with exportJobId; technical verification is automatic, actual playback is separate.
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@ test('media example preserves setup and task continuation across supported langu
|
||||
assert.match(media.prompt, /original request/);
|
||||
assert.ok(translations['zh-CN'][media.prompt]);
|
||||
const skill = readFileSync(new URL('../skills/openmotion-media/SKILL.md', import.meta.url), 'utf8');
|
||||
assert.match(skill, /target: "providers"/);
|
||||
assert.match(skill, /handbook/);
|
||||
const setupLink = skill.match(/\[Discovery and setup\]\(([^)]+)\)/);
|
||||
assert.ok(setupLink, 'Media entry must expose provider setup');
|
||||
const setup = readFileSync(new URL(setupLink[1], new URL('../skills/openmotion-media/SKILL.md', import.meta.url)), 'utf8');
|
||||
assert.match(setup, /target: "providers"/);
|
||||
assert.match(setup, /## Media handbook handoff/);
|
||||
assert.match(setup, /MCP handbook media-generation example/);
|
||||
assert.match(setup, /read-only `inspect`/);
|
||||
assert.match(skill, /MCP handbook example \| \[Discovery and setup\]/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user