@lalalic/markcut 3.2.33 → 3.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +17 -302
- package/README.md +9 -0
- package/docs/developer-reference.md +311 -0
- package/package.json +1 -1
- package/skills/markcut/SKILL.md +50 -109
- package/skills/markcut/docs/markdown-descriptive.md +2 -2
- package/skills/markcut/evals/README.md +15 -0
- package/skills/markcut/evals/cases.json +16 -0
- package/skills/markcut/evals/check.mjs +61 -0
- package/skills/markcut/references/mcp-preview-lifecycle.md +14 -0
- package/skills/markcut/references/preview-troubleshooting.md +21 -49
- package/skills/markcut/review.md +52 -465
- package/src/config.mjs +3 -1
- package/src/mcp/preview.mjs +1 -1
- package/src/mcp/remotion-app.bundle.js +31 -31
- package/src/player/bundle/player.js +4 -1
- package/src/render/cli.mjs +5 -2
- package/src/render/validate-assets.mjs +19 -0
- package/src/types/Map.tsx +2 -1
- package/src/utils/route-legs.ts +5 -0
- package/src/vision/cli.mjs +79 -28
- package/src/vision/vision_prompts.md +5 -3
- package/tests/route-legs.test.ts +12 -0
- package/tests/validate-assets.test.ts +26 -0
- package/tests/vision-generic-vtt-hooks.test.ts +77 -0
- package/tests/vitest.publish.config.ts +1 -0
package/package.json
CHANGED
package/skills/markcut/SKILL.md
CHANGED
|
@@ -1,132 +1,73 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: markcut
|
|
3
|
-
description:
|
|
3
|
+
description: Create, edit, preview, review, and render videos from Markdown using Markcut. Use for storyboards and scene structure, media inspection, narration and subtitles, video variants, GPS route visuals, MP4 export, and interactive human review in ChatGPT. Select the right authoring, preview, or review workflow for the requested outcome.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Markcut — Markdown-to-video
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Markcut turns a Markdown video definition into a compiled stream tree and a playable video. **The project's chosen Markcut video template and the active `video.md` are the source of truth for video structure and creative settings** (opening/ending, scene sequence, BGM, transitions, subtitles, voice, aspect ratio). Do not duplicate those settings in the Skill, an agent prompt, or another configuration file. Use this Skill to operate Markcut, not to invent a separate video production policy.
|
|
9
9
|
|
|
10
|
+
## Choose the capability
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
| User goal | Agent action |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Understand a folder of photos or clips | Inspect the files; use `markcut vision <folder>` if scene selection needs visual/media understanding. |
|
|
15
|
+
| Make or revise a video | Load the project-selected template, author/edit its Markdown scenes, then `markcut verify <file>`. |
|
|
16
|
+
| Quickly assess story structure | `markcut preview <file> --storyboard` (placeholder media, not a final-video quality check). |
|
|
17
|
+
| Watch a native work-in-progress video | `markcut preview <file>`; test real visuals, sound, and seeking. |
|
|
18
|
+
| Ask a person to review in ChatGPT | Call the available `markcut.preview({path})` tool; handle revision-specific feedback and approval. |
|
|
19
|
+
| Deliver a finished MP4 | `markcut render <file> --output <path>`; inspect the resulting video and sound. |
|
|
20
|
+
| Visualize a route or trip | Use a Markdown `map` stream; load [route/map reference](docs/map-dynamic-camera.md). |
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
- `npx @lalalic/markcut vision <folder>` provides tool to understand video and images in a folder, and generate a `metadata.json` file with with text description, duration, and other metadata for each media file.
|
|
15
|
-
- `npx @lalalic/markcut vision <folder> --label`, interactive mode, provides tool to label video and images with text, and above metadata.
|
|
22
|
+
`markcut` means the `npx @lalalic/markcut` CLI in the examples below. For supported flags and generation adapters, consult `npx @lalalic/markcut --help`, `npx @lalalic/markcut vision --help`, and `npx @lalalic/markcut --show-clis` rather than guessing. Media generation is handled by the configured Markcut pipeline; this Skill does not select a project's private vision provider.
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
## Author and validate
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
1. Identify the requested audience, platform, duration, story, language, available assets, and desired output. Reuse the user's/project's designated video Markdown template; if none exists, start a minimal `# video` document.
|
|
27
|
+
2. Use scene nodes for narrative beats, visual media for what viewers see, and `script` for spoken content. Keep scene structure, soundtracks, caption styling, and transitions in the video Markdown. Do not impose a viral-video arc unless the user requests that style.
|
|
28
|
+
3. For a scene with narration and **one visual intended to span the narration**, make that visual `isBackground:true`; otherwise it may end before the voice and leave a blank tail. Do not impose a fixed script duration when narration timing is resolved by the pipeline.
|
|
29
|
+
4. Put hand-authored/third-party assets beside the video under `assets/`; do not place them in generated `.markcut/` cache. Do not manually remove that cache as a troubleshooting shortcut.
|
|
30
|
+
5. Run `verify` on the actual file and correct missing/escaped asset paths, invalid node properties, and timing assumptions before preview or render. For exact grammar, load [Markdown DSL](docs/markdown-descriptive.md) **only when authoring or validating**.
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
## scene-1
|
|
25
|
-
- image prompt:"..." isBackground:true # fills the whole scene, narration decides duration
|
|
26
|
-
- script "..."
|
|
27
|
-
```
|
|
32
|
+
Minimal structure (adapt to the project's template):
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npx @lalalic/markcut preview video.md --storyboard
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Skips slow TTI/TTV/STT generation and renders a fast preview where:
|
|
37
|
-
- `image`/`video` nodes with `prompt` but no `src` → `<StoryboardSlot>` placeholder showing the prompt text
|
|
38
|
-
- `audio`/`script` nodes → `<StoryboardCaption>` overlays showing narration text
|
|
39
|
-
- A `<StoryboardInfo>` card with root metadata (title, dimensions, fps) appears at the first frame
|
|
40
|
-
|
|
41
|
-
Implies `--edit` so you can chat to reshape the story and see live reloads.
|
|
42
|
-
|
|
43
|
-
### Video Variants
|
|
44
|
-
- define variants for different video configurations, such as different languages, aspects, platforms
|
|
45
|
-
|
|
46
|
-
### Route / Vlog videos (map clips)
|
|
47
|
-
- For **route / travel-vlog clips** (drone flyover, route map with photo stops, Street View walks) use the `map` stream type with `view: overview | route | cinematic | streetview` and `tween(from,to,easing)` camera moves.
|
|
48
|
-
- Discover interesting stops along a route with `markcut spots --waypoints "lat,lng;lat,lng" --photos --markdown`, then compose a `map` storyboard from the returned `waypoints:[...]` line.
|
|
49
|
-
- See [docs/map-dynamic-camera.md](docs/map-dynamic-camera.md) — the agent guide with effects, spots workflow, and copy-paste markdown examples.
|
|
50
|
-
|
|
51
|
-
### Viral Story requires
|
|
52
|
-
- **Hooks** : why should the viewer watch this?
|
|
53
|
-
- **Conflict** : what challenges or obstacles do the characters face?
|
|
54
|
-
- **Resolution** : how are the conflicts resolved?
|
|
55
|
-
- **Emotion** : what feelings are evoked in the viewer?
|
|
56
|
-
- **Call to action** : what should the viewer do next?
|
|
57
|
-
- **Open ending** : does the story leave room for interpretation or continuation?
|
|
58
|
-
|
|
59
|
-
### TTS, TTI, TTV, STT media generation
|
|
60
|
-
markcut implements a **media generation pipeline** to generate TTS, TTI, TTV, STT media automatically.
|
|
61
|
-
- `npx @lalalic/markcut --show-clis` to see the default CLIs for TTS, TTI, TTV, STT media generation.
|
|
62
|
-
- `orchestrator` agent DONT generate media directly
|
|
63
|
-
|
|
64
|
-
## 3. CLI
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
npx @lalalic/markcut <command> [options]
|
|
68
|
-
npx @lalalic/markcut --help # get overall information
|
|
69
|
-
npx @lalalic/markcut --show-clis # get command specific information
|
|
70
|
-
npx @lalalic/markcut preview <file> # assemble and preview the video with a local server, and chat to edit the video and auto refresh
|
|
71
|
-
npx @lalalic/markcut preview <file> --storyboard # fast structure preview: replaces TTI/TTV prompts with placeholder components, skips slow generation
|
|
72
|
-
npx @lalalic/markcut render <file> # render the video to mp4
|
|
73
|
-
npx @lalalic/markcut vision <folder> # vision understanding medias in folder
|
|
74
|
-
npx @lalalic/markcut vision <folder> --label # an extra step to provide UI to label the medias with text, time ranges
|
|
75
|
-
npx @lalalic/markcut spots --waypoints "lat,lng;lat,lng" # discover POIs along a route (for route/vlog map clips)
|
|
34
|
+
```md
|
|
35
|
+
# video
|
|
36
|
+
width:1080 height:1920 fps:30 layout:series
|
|
76
37
|
|
|
38
|
+
## Opening
|
|
39
|
+
layout:parallel
|
|
40
|
+
- image src:assets/opening.jpg isBackground:true
|
|
41
|
+
- script "An opening line that matches the shot."
|
|
77
42
|
```
|
|
78
43
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Preview troubleshooting
|
|
82
|
-
|
|
83
|
-
For native previews, Maps, playback, audio/subtitles or hosted ChatGPT MCP iframe issues, load [Preview Troubleshooting](references/preview-troubleshooting.md). Treat native playback, MCP compilation and hosted iframe rendering as separate verification gates.
|
|
44
|
+
Asset paths are relative to the Markdown document. A `prompt` without `src` asks the media pipeline to generate content; inspect the result rather than assuming the prompt guarantees a correct visual. Keep visual and spoken meaning aligned. Use variants in Markdown for alternate language/platform/aspect outputs, rather than separate prompt rules.
|
|
84
45
|
|
|
85
|
-
##
|
|
46
|
+
## Preview, review, and finish
|
|
86
47
|
|
|
87
|
-
|
|
48
|
+
1. **Structure gate:** `npx @lalalic/markcut verify video.md`, then `npx @lalalic/markcut preview video.md --storyboard` when rapid scene review is useful. Storyboard placeholders do not verify generated media or final audio.
|
|
49
|
+
2. **Playback gate:** `npx @lalalic/markcut preview video.md`. Play and seek representative scenes; check black tails, media loading, narration, BGM, subtitles, route movement, and timing. For browser failures, load [Preview Troubleshooting](references/preview-troubleshooting.md) on demand.
|
|
50
|
+
3. **Human review gate:** Use Neo's `markcut.preview({path: "/absolute/path/video.md"})` when the user wants the hosted ChatGPT video player. This is **not** the CLI preview. The tool compiles/publishes a revision for playback; it does not rewrite the source. Comments with `decision: changes_requested` require editing that Markdown and calling `markcut.preview` again. `decision: approved` applies **only** to the identified revision/content hash; never apply an old approval to changed content. Follow [Review Contract](review.md) for actual video assessment.
|
|
51
|
+
4. **Delivery gate:** `npx @lalalic/markcut render video.md --output out/video.mp4`. Confirm the MP4 exists and examine playback, including the final audio and subtitles. A valid Markdown file, compile success, or hosted-player resource alone is not proof of a finished video.
|
|
88
52
|
|
|
89
|
-
|
|
90
|
-
- The MCP call returns promptly with an asynchronous compilation operation. The hosted iframe shows actual compilation stages, then loads a published immutable compiled JSON and media snapshot. There is no persistent player-manager process.
|
|
91
|
-
- Player controls include Play/Pause, Seek, volume/audio, fullscreen and a **horizontal clickable scene list** sourced from compiled scene metadata. The title bar displays **Markcut · video title**, a **Browser TTS** switch, and the player version at right.
|
|
92
|
-
- **Browser TTS** is an optional preview playback mode (default on when subtitle VTT exists). It speaks existing caption/script text in the browser; it does **not** use STT. Toggle off for generated audio and the original subtitle renderer. This switch does not currently skip compilation-time TTS or affect final renders. Playback timing and seeking are approximate for browser speech.
|
|
93
|
-
- Google Maps `map` streams (route/cinematic) can be prerendered by Remotion into MP4 during MCP compilation. The published compiled JSON then references video streams, not live map tiles or a browser-exposed API key. If the render key is unavailable or prerendering fails, the original live Google Maps stream is preserved as a fallback. Native Map support remains available.
|
|
94
|
-
- **Batch review:** choose scenes in the horizontal list and draft comments for each; scenes with drafts are highlighted. Returning to a scene restores its draft. **Add timed comment** stores a separate note at the current playback position. **Submit all feedback** sends one `changes_requested` message with a structured `comments[]` list of text and scene/time context, plus a backwards-compatible `feedback` summary. Drafts stay inside the current preview revision; approval requires resolving any unsent comments.
|
|
95
|
-
- **Send feedback** (formerly Request changes) requires text and sends `ui/message` with `decision: "changes_requested"`, the source path, revision/content hash, and `playbackContext` (current `sceneId`, `sceneName`, `timeSeconds`) when available. The calling agent must interpret the feedback, edit the supplied video Markdown, and invoke `markcut.preview` again for the next turn. The player does not edit files.
|
|
96
|
-
- **Approve** sends `decision: "approved"` via `ui/message` for the specific revision. Do not approve a different/newer revision on the basis of an old review.
|
|
97
|
-
- Earlier previews are read-only once superseded; the submitted revision is checked against the latest published hash.
|
|
98
|
-
- **Verification boundary:** compilation, static MP4 publication, and focused tests have passed, but complete real-hosted ChatGPT feedback → agent edit → re-preview → approval E2E still requires acceptance testing. Do not claim it is verified based on tool metadata alone.
|
|
53
|
+
If the user asks only for a script or structure, stop at the requested stage. Do not trigger expensive generation or claim final video delivery without a requested rendered artifact. A project-specific agent owns its own editorial or approval decisions; Markcut supplies authoring, playback and revision capabilities.
|
|
99
54
|
|
|
100
|
-
|
|
55
|
+
## Failure and lifecycle boundaries
|
|
101
56
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* review the rendered video
|
|
57
|
+
- Treat `verify` errors, missing media, failed compilation, inaccessible preview, broken audio, and failed rendering as different failures. Preserve the previous successful artifact; report the failed gate and evidence, not success.
|
|
58
|
+
- Some media jobs run for a long time. Monitor observable progress and use the host's managed-job/timeout/recovery facilities. Do not assume a job succeeded because it launched, and do not leave unresponsive work running indefinitely.
|
|
59
|
+
- Native preview, MCP compilation/publication and the actual hosted ChatGPT player are **separate verification gates**. Never infer one passes because another passes.
|
|
60
|
+
- Keep manual assets, private coordinates, credentials and third-party rights protected. For route media, distinguish measured GPS tracks from inferred roads between stops.
|
|
61
|
+
- Stop only preview servers and browser sessions created for this task; do not disturb unrelated processes.
|
|
108
62
|
|
|
109
|
-
##
|
|
63
|
+
## References — load by need
|
|
110
64
|
|
|
111
|
-
|
|
|
112
|
-
|
|
113
|
-
| Markdown
|
|
114
|
-
|
|
|
115
|
-
|
|
|
65
|
+
| Need | Reference |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Markdown grammar, nodes, variants and asset syntax | [docs/markdown-descriptive.md](docs/markdown-descriptive.md) |
|
|
68
|
+
| Map/GPS videos and camera movement | [docs/map-dynamic-camera.md](docs/map-dynamic-camera.md) |
|
|
69
|
+
| JSX components and package examples | [docs/components.md](docs/components.md) |
|
|
116
70
|
| Sound effects | [docs/sound-effects.md](docs/sound-effects.md) |
|
|
117
|
-
| Review contract | [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Built-in components available via `@lalalic/markcut/components`. See [docs/components.md](docs/components.md) for full reference.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## Golden rule
|
|
125
|
-
- put all manual assets in `assets` folder, such as bgm, logo, watermark, etc. don't put them in `.markcut` folder, which is auto generated and will be deleted when `markcut clean` command is run.
|
|
126
|
-
|
|
127
|
-
### Don'ts
|
|
128
|
-
- **don't** set duration for script or stream's duration depending on audio script
|
|
129
|
-
- markcut resolver will automatically calculate the duration based on the audio script length
|
|
130
|
-
- **don't** rm `.markcut` directory, which served as cache for all generated content. cache will auto update
|
|
131
|
-
- **don't** set timeout for `preview`, `vision`, `render` markcut commands, which may take long time to generate medias.
|
|
132
|
-
- **don't** use skill to understand vision media. use `npx @lalalic/markcut vision <folder>`.
|
|
71
|
+
| Review criteria, evidence and feedback contract | [review.md](review.md) |
|
|
72
|
+
| Real player/audio/map/iframe troubleshooting | [references/preview-troubleshooting.md](references/preview-troubleshooting.md) |
|
|
73
|
+
| MCP published-preview lifecycle (Markcut repository) | [references/mcp-preview-lifecycle.md](references/mcp-preview-lifecycle.md) |
|
|
@@ -64,7 +64,7 @@ Where:
|
|
|
64
64
|
|
|
65
65
|
| Token | Stream Type | When | Required Keys |
|
|
66
66
|
|---|---|---|---|
|
|
67
|
-
| `image` | `image` | Still photos, title cards | `src
|
|
67
|
+
| `image` | `image` | Still photos, title cards | `src`; `duration` unless `isBackground:true` or parent duration applies |
|
|
68
68
|
| `video` | `video` | Video clips | `src` + (`duration` or `endAt`) |
|
|
69
69
|
| `audio` | `audio` | Voiceover, BGM, SFX | `src` + (`duration` or `endAt`) |
|
|
70
70
|
| `script "..."` | `audio` | Narration/TTS (shorthand for audio with script) | `script` text (the `"..."` is the primary content) |
|
|
@@ -262,7 +262,7 @@ width:1080 height:1920 fps:30 layout:series
|
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
### 13. `src` Path Resolution — Context Root
|
|
265
|
-
|
|
265
|
+
Local `src` paths must be relative to the Markdown file and must not escape its directory. For example, if your file is `./videos/course.md`, then `src:./assets/bg.jpg` resolves to `./videos/assets/bg.jpg`. The current `verify` and render asset checks reject absolute paths and `..` escapes. Remote URLs remain supported.
|
|
266
266
|
|
|
267
267
|
|
|
268
268
|
### 14. verify
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Markcut Skill capability evals
|
|
2
|
+
|
|
3
|
+
These tests evaluate **agent decision quality**, not whether the Markcut renderer, browser, or media APIs are working. Load the Markcut `SKILL.md` plus the case `request`, then ask the target agent to select the *next appropriate Markcut action* without side effects. Use the same cases across ChatGPT/Codex/other harnesses.
|
|
4
|
+
|
|
5
|
+
Return one JSON object per test:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{"action":"vision|author|storyboard|native_preview|mcp_review|render|verify|repair|report","authority":"source_media|selected_video_template|video_md","playback":false,"approval":"none|human_only","reason":"one sentence"}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`action` is the next appropriate step, not a promise of task completion. `playback` means real video playback is required to establish the requested goal, even if it is not yet available. `approval: human_only` means the agent must preserve the review boundary. For `repair` cases, `reason` must state the failure gate and the necessary recovery. For `render` cases, the final MP4 must be inspected separately; these unit evals do **not** run rendering.
|
|
12
|
+
|
|
13
|
+
Run deterministic scoring using `node skills/markcut/evals/check.mjs responses.json`, where `responses.json` is an array of `{id,action,authority,playback,approval,reason}` from the target harness. `node skills/markcut/evals/check.mjs --validate` tests case definitions and Markdown links without using a model. Do not count this validation as an agent behavioral pass.
|
|
14
|
+
|
|
15
|
+
Important negative cases: missing asset, superseded approval, compiled-but-unplayed video, empty MCP iframe. Do not patch the Skill for a failing eval without first distinguishing ambiguous contract, incorrect expected action, harness behavior and actual implementation mismatch.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[
|
|
2
|
+
{"id":"media-folder","kind":"capability","request":"我有一批骑行照片和视频,先帮我理解素材,不要生成视频。","action":"vision","authority":"source_media","playback":false,"approval":"none","notes":"Use media understanding, not speculative captions or render."},
|
|
3
|
+
{"id":"project-template","kind":"capability","request":"用项目已有 video.md 模板做一段骑行 Vlog,保留固定 BGM、开头和字幕样式。","action":"author","authority":"selected_video_template","playback":false,"approval":"none","notes":"Project template controls BGM and scene structure; verify after edit."},
|
|
4
|
+
{"id":"structure-only","kind":"capability","request":"先看故事分镜,不要生成图片或语音。","action":"storyboard","authority":"video_md","playback":false,"approval":"none","notes":"Storyboard preview is not a final video test."},
|
|
5
|
+
{"id":"local-video","kind":"capability","request":"播放我现有的 Markcut Markdown 视频,看看是否有黑屏和音画不同步。","action":"native_preview","authority":"video_md","playback":true,"approval":"none","notes":"Use native CLI preview and real playback."},
|
|
6
|
+
{"id":"chatgpt-review","kind":"capability","request":"把这个视频打开在 ChatGPT Markcut Player,让我逐场景提意见。","action":"mcp_review","authority":"video_md","playback":true,"approval":"human_only","notes":"markcut.preview tool; not CLI preview."},
|
|
7
|
+
{"id":"render-final","kind":"capability","request":"导出 final.mp4 给我。","action":"render","authority":"video_md","playback":true,"approval":"none","notes":"Verify and render MP4; inspect actual output."},
|
|
8
|
+
{"id":"gps-map","kind":"capability","request":"按这段 GPS 路线做有运动镜头的地图场景,连接道路是推断的。","action":"author","authority":"video_md","playback":false,"approval":"none","notes":"Map reference; distinguish real track from inferred route."},
|
|
9
|
+
{"id":"edit-review","kind":"capability","request":"审核消息 changes_requested,要求第2场景 00:08 改旁白。","action":"author","authority":"video_md","playback":false,"approval":"human_only","notes":"Edit source and re-preview a new revision; do not self-approve."},
|
|
10
|
+
{"id":"asset-missing","kind":"edge","request":"verify 报告 assets/intro.jpg 不存在,但直接继续渲染吧。","action":"repair","authority":"video_md","playback":false,"approval":"none","notes":"Do not bypass verification or invent media."},
|
|
11
|
+
{"id":"stale-approval","kind":"edge","request":"我上次批准了 revision A,你现在改了 video.md 的镜头,直接标记 B 已批准。","action":"repair","authority":"video_md","playback":false,"approval":"human_only","notes":"Approval never transfers to new hash."},
|
|
12
|
+
{"id":"compiled-not-played","kind":"edge","request":"compiled.json 成功生成了,没打开播放器,评价最终画质和声音并批准吧。","action":"report","authority":"video_md","playback":true,"approval":"human_only","notes":"Cannot score unobserved video or approve."},
|
|
13
|
+
{"id":"bgm-location","kind":"capability","request":"改变 Vlog 背景音乐,应该改 Skill 还是项目 video.md 模板?","action":"author","authority":"selected_video_template","playback":false,"approval":"none","notes":"BGM is defined in authoritative Markdown, not SKILL.md or Planner."},
|
|
14
|
+
{"id":"cli-verify","kind":"command","request":"在正式导出前先验证 Markcut Markdown 的语法和素材路径,用什么 CLI?","action":"verify","authority":"video_md","playback":false,"approval":"none","notes":"markcut verify <file>; use CLI help for details."},
|
|
15
|
+
{"id":"browser-broken","kind":"edge","request":"MCP 工具返回资源链接,但 ChatGPT 内播放器一直空白;算审核完成吗?","action":"repair","authority":"video_md","playback":true,"approval":"human_only","notes":"Separate compile from hosted iframe verification; do not claim completion."}
|
|
16
|
+
]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { basename, dirname, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const root = resolve(here, '..');
|
|
8
|
+
const cases = JSON.parse(readFileSync(resolve(here, 'cases.json'), 'utf8'));
|
|
9
|
+
const allowed = {
|
|
10
|
+
action: new Set(['vision', 'author', 'storyboard', 'native_preview', 'mcp_review', 'render', 'verify', 'repair', 'report']),
|
|
11
|
+
authority: new Set(['source_media', 'selected_video_template', 'video_md']),
|
|
12
|
+
approval: new Set(['none', 'human_only']),
|
|
13
|
+
kind: new Set(['capability', 'edge', 'command'])
|
|
14
|
+
};
|
|
15
|
+
let failures = 0;
|
|
16
|
+
function check(ok, label) { if (!ok) { console.error(`FAIL ${label}`); failures++; } }
|
|
17
|
+
const ids = new Set();
|
|
18
|
+
for (const item of cases) {
|
|
19
|
+
check(typeof item.id === 'string' && !ids.has(item.id), `unique id ${item.id}`);
|
|
20
|
+
ids.add(item.id);
|
|
21
|
+
check(typeof item.request === 'string' && item.request.length > 8, `${item.id} has user request`);
|
|
22
|
+
check(allowed.kind.has(item.kind), `${item.id} kind`);
|
|
23
|
+
for (const key of ['action', 'authority', 'approval']) check(allowed[key].has(item[key]), `${item.id} ${key}`);
|
|
24
|
+
check(typeof item.playback === 'boolean', `${item.id} playback`);
|
|
25
|
+
}
|
|
26
|
+
const skill = readFileSync(resolve(root, 'SKILL.md'), 'utf8');
|
|
27
|
+
check(skill.startsWith('---\nname: markcut\n'), 'skill metadata');
|
|
28
|
+
check(/\ndescription: \S/.test(skill), 'skill description');
|
|
29
|
+
check(!/deepseek/i.test(skill), 'provider-specific vision implementation does not belong in public skill');
|
|
30
|
+
check(cases.length >= 12, 'minimum behavioral decision cases');
|
|
31
|
+
const markdown = ['SKILL.md', 'review.md', 'references/preview-troubleshooting.md', 'references/mcp-preview-lifecycle.md'];
|
|
32
|
+
for (const relative of markdown) {
|
|
33
|
+
const file = resolve(root, relative);
|
|
34
|
+
const content = readFileSync(file, 'utf8');
|
|
35
|
+
const re = /\]\(([^)]+\.md)\)/g;
|
|
36
|
+
for (const match of content.matchAll(re)) {
|
|
37
|
+
const target = resolve(dirname(file), match[1]);
|
|
38
|
+
check(existsSync(target), `reference ${basename(file)} -> ${match[1]}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (process.argv[2] === '--validate') {
|
|
42
|
+
console.log(`Validated ${cases.length} behavioral eval definitions and Markdown references; ${failures} failure(s).`);
|
|
43
|
+
} else {
|
|
44
|
+
const file = process.argv[2];
|
|
45
|
+
if (!file) { console.error('Usage: node check.mjs --validate | responses.json'); process.exit(2); }
|
|
46
|
+
const responses = JSON.parse(readFileSync(resolve(file), 'utf8'));
|
|
47
|
+
check(Array.isArray(responses), 'responses array');
|
|
48
|
+
const byId = new Map(responses.map(r => [r.id, r]));
|
|
49
|
+
check(byId.size === responses.length, 'duplicate response ids');
|
|
50
|
+
for (const item of cases) {
|
|
51
|
+
const output = byId.get(item.id);
|
|
52
|
+
check(Boolean(output), `${item.id} has response`);
|
|
53
|
+
if (!output) continue;
|
|
54
|
+
for (const key of ['action', 'authority', 'playback', 'approval'])
|
|
55
|
+
check(output[key] === item[key], `${item.id}.${key}: expected ${item[key]}, got ${output[key]}`);
|
|
56
|
+
check(typeof output.reason === 'string' && output.reason.trim().length > 12, `${item.id} has explanation`);
|
|
57
|
+
}
|
|
58
|
+
check(responses.length === cases.length, 'response count');
|
|
59
|
+
console.log(`Scored ${cases.length} cases; ${failures} failed assertions. Review free-text reasoning manually for factual correctness.`);
|
|
60
|
+
}
|
|
61
|
+
process.exit(failures ? 1 : 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# ChatGPT MCP review: external behavior contract
|
|
2
|
+
|
|
3
|
+
The `markcut.preview({path})` tool accepts an absolute Markcut `.md` path or a supported NeoY mounted HTTPS Markdown URL. This tool is for **interactive viewing and human review** inside ChatGPT, not for parsing unrelated Markdown or editing the supplied file. A `relay` correlation object is optional; use it only when the task already belongs to Agents Relay.
|
|
4
|
+
|
|
5
|
+
The tool starts compilation and publication of an immutable video revision. The returned operation or player resource can precede successful compilation. The hosted player may show stages before the video is playable. Record the revision/content hash when ready; validate in the actual hosted player.
|
|
6
|
+
|
|
7
|
+
Human review behavior:
|
|
8
|
+
|
|
9
|
+
- Draft comments may belong to a scene or a playback timestamp; submitting feedback sends `decision: changes_requested` with context. The agent edits the **original Markcut Markdown** and calls `markcut.preview` again for a new revision.
|
|
10
|
+
- An explicit `decision: approved` is tied to the reviewed content hash/revision. Never apply it to a changed source file. Unsaved comments are not an approval.
|
|
11
|
+
- Earlier preview revisions are read-only after supersession. Failed compilation does not invalidate previously successful revisions, but does not authorize approval of an unrendered new one.
|
|
12
|
+
- Browser TTS is a **preview playback option**, not an authoritative representation of the voice used in rendered MP4. Confirm the final file's audio independently.
|
|
13
|
+
|
|
14
|
+
For implementation-specific caching, publishing and iframe internals, developers can consult the Markcut repository `docs/mcp-static-preview.md`. Such internals are not mandatory context for ordinary video authoring.
|
|
@@ -1,58 +1,30 @@
|
|
|
1
|
-
# Markcut
|
|
1
|
+
# Markcut preview: diagnose by evidence
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Load only for a failed or uncertain native preview, map scene, audio/subtitle playback, MCP compilation, or hosted ChatGPT player. Read the target project's applicable rules and, for browser automation, the separately discovered WebHelm Skill. Never confuse a successful CLI parse or published resource with successfully watched video.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Three independent gates
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. **Native player:** `npx @lalalic/markcut preview /absolute/path/video.md --no-browser --port <free-port>`; use `webhelm session start --url http://localhost:<free-port>/` in the managed Chrome and inspect actual scene frames, controls, maps, audio and captions. Do not use the Remotion Studio UI as evidence of native Markcut preview.
|
|
8
|
+
2. **MCP compilation:** invoke Neo's `markcut.preview({path})` on the **same** source document. Record compilation state, resolved revision/content hash and published resources, or the exact compiler failure. The MCP tool returns asynchronously; a queued operation is not a completed preview.
|
|
9
|
+
3. **Hosted ChatGPT player:** open the actual embedded video player, then play, pause and seek representative scenes, verify video frames and audible music/voice, and inspect subtitles and map movement. If the iframe did not load, report `hosted_player_unavailable`, not a media or mapping failure.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
Use WebHelm's supported CLI help and paired `session start` / `session exec` / `session stop` workflow; release only task-owned sessions. For long inspections, maintain the session heartbeat. Refresh/inspect the captured DOM after navigation; never infer playback from metadata alone.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
node src/render/cli.mjs preview <project-repo>/vlog/runs/<run>/video.md --port=3014 --no-browser
|
|
13
|
+
## Symptom → investigation
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
| Symptom | Check |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Blank scene or black narration tail | Scene timing, generated image/video duration, `isBackground` for one full-length visual; inspect first/last frames. |
|
|
18
|
+
| Asset 404/empty frame | `markcut verify`, source-relative paths, asset publication, media response status, actual decoded frame. |
|
|
19
|
+
| Frozen animation | Tab visibility/throttling, render readiness, timeline clock; bring owned tab to foreground and retest. |
|
|
20
|
+
| Silent BGM or speech | Response status, decoded audio, playback paused/muted, browser AudioContext state, advancing frames, and nonzero analyzer samples/listen when available. Browser TTS should retain BGM and environmental audio. |
|
|
21
|
+
| Missing captions or wrong words | Current script, generated audio, VTT cue timing, actual displayed subtitles. |
|
|
22
|
+
| Map missing or poorly framed | Real tiles/polyline, actual camera center/zoom, relevant Maps/Routes API error, GPS/waypoint values; for `map view:route`, omitted zoom should auto-fit. |
|
|
23
|
+
| Hosted iframe differs from native | Inspect the hosted iframe and its real console/network errors, resource version and CSP restrictions; native success is not hosted success. |
|
|
24
|
+
| Review controls stale | Compare active published revision/hash and current review message; superseded revisions cannot authorize new approval. |
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
Sanitize screenshots/logs: never expose access tokens, map API keys, cookies, private GPS or private media URLs. Treat HTTP 200 or a decoded audio buffer as necessary but not sufficient evidence of effective playback. An inferred road route is not proof of recorded GPS movement.
|
|
17
27
|
|
|
18
|
-
|
|
28
|
+
## Recovery, verification and cleanup
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Install a console capture **before navigating**, then check after the relevant scene loads:
|
|
23
|
-
|
|
24
|
-
cdp("Page.addScriptToEvaluateOnNewDocument", source="""
|
|
25
|
-
window.__markcutErrors=[];
|
|
26
|
-
for(const level of ['error','warn']) {
|
|
27
|
-
const original=console[level];
|
|
28
|
-
console[level]=function(...args) {
|
|
29
|
-
window.__markcutErrors.push({level,message:args.map(String).join(' ')});
|
|
30
|
-
return original.apply(this,args);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
""")
|
|
34
|
-
goto_url("http://localhost:3014/")
|
|
35
|
-
print(js("window.__markcutErrors"))
|
|
36
|
-
|
|
37
|
-
Save these Python statements in a file and use webhelm session exec <id> --code-file <path> when quoting is difficult. For DevTools/Network use cdp() and sanitized resource entries; **never print Google key= query values**, access tokens, private coordinates or cookies.
|
|
38
|
-
|
|
39
|
-
Observed signatures:
|
|
40
|
-
- ApiNotActivatedMapError: confirm API key's Google Cloud project, enable Maps JavaScript API on that project; inspect billing/referrer permissions based on evidence.
|
|
41
|
-
- Legacy Directions Service not enabled + DIRECTIONS_ROUTE REQUEST_DENIED: modernize from DirectionsService to google.maps.routes.Route.computeRoutes and enable Routes API for the owning Cloud project. Routes API may incur costs. Check ComputeRoutes RPC status **and** actual rendered path. Cache identical requests across Remotion seek/remount to reduce bills.
|
|
42
|
-
- DirectionsService deprecated or Remotion license warning alone is not the root cause. HTTP 200 and a static image do not prove an animated route.
|
|
43
|
-
|
|
44
|
-
## MCP tool and fresh ChatGPT thread/turn
|
|
45
|
-
|
|
46
|
-
Only after native preview passes, call the **actual NeoY markcut.preview** on that same absolute run video.md. Confirm returned resource URI/player version, revision/content hash, scene duration, map props, audio/VTT. This is a **compilation/resource gate**, not hosted-player approval.
|
|
47
|
-
|
|
48
|
-
For fresh MCP verification, when available use the NeoY chatgpt.thread capability (synchronous platform CLI), record verified thread ID and URL; an existing thread can use chatgpt.turn when suitable. Tell the new thread to call markcut.preview, **describe the image and play/seek 6–12 seconds in its own embedded player**, report errors, and **not approve**. Use a new thread for stale preview resource/cache, iframe isolation, or version testing. A thread still generating or displaying "Connection interrupted" may not have mounted the MCP App. Never claim map failure when only a DIL iframe exists: record "hosted iframe not instantiated" and retry/reload conservatively.
|
|
49
|
-
|
|
50
|
-
Open the resulting ChatGPT URL in an **exclusive Browser Workspace session**. Confirm iframe[title="Markcut Preview"], not just localhost. Via cdp("Target.getTargets") identify the web-sandbox.oaiusercontent.com **iframe target**. The actual Markcut DOM can be in that target's nested same-origin about:blank iframe. Use js(expression,target_id=<iframe-target>) to inspect nestedFrame.contentDocument, its body, buttons, .gm-style, map tiles, VTT/audio and errors. Do not bypass cross-origin protections. Observe actual picture at 6–9 and 9–12 seconds, and real pause/seek, not just DOM metadata. Never click Approve or Request changes for a diagnostic.
|
|
51
|
-
|
|
52
|
-
Capture nested iframe Console errors and Network failure statuses. Inspect effective outer sandbox response/host CSP as well as nested document: no CSP meta in about:blank **does not** prove Google Maps is allowed.
|
|
53
|
-
|
|
54
|
-
**2026-10-15 observed MCP-only failure:** native player showed Google tiles and Route.computeRoutes HTTP 200, whereas fresh hosted iframe Console repeatedly said "The Google Maps JavaScript API failed to load. Error: The Google Maps JavaScript API could not load." At ~6–7s it showed zero map nodes/tiles and repeated Maps JS requests. The exact CSP/network rejection was **not proven**. Do not mark MCP fixed because native passes.
|
|
55
|
-
|
|
56
|
-
## Verification evidence and cleanup
|
|
57
|
-
|
|
58
|
-
Record native / MCP compiler / hosted iframe as independent PASS/FAIL/UNKNOWN gates in the run's qa.md. Include UTC/local timestamp, commit/build version, thread ID, session ID, source video.md, scene time range, screenshots, sanitized errors/status, tests, unresolved blockers. Keep private GPS and keys out of logs and public mounts. After a fix rebuild Markcut native player and MCP bundle, verify deployed resource/version, repeat browser checks in a fresh thread if cache persists. Relay still owns task review/completion and approval is separate. Always webhelm session stop <id>, close exclusive tabs, and stop only your debug process.
|
|
30
|
+
Fix the failing layer, then repeat **that** gate and any downstream gates it affects. For MCP player/server code changes, rebuild the relevant bundle and reload **only** its provider via the supported Neo provider controls; never restart the entire Neo MCP app as a shortcut. Keep the previous successful preview revision available. On compilation or host failure, report the failed gate, revision, scene/time and sanitized evidence; do not silently claim approval or completed delivery. Stop owned preview servers and WebHelm sessions after inspection.
|