davinci-resolve-mcp 2.158.0 → 2.160.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  Release history for the DaVinci Resolve MCP Server. The latest release is summarized in the root README; older entries live here to keep the README focused.
4
4
 
5
+ ## What's New in v2.160.0 — write-side span fidelity; the flat DRT target stops lying about black
6
+
7
+ ### Fixed
8
+
9
+ - **`eventsToOTIO` forced every transition to centered**, so a start-at-cut
10
+ fade-in re-written to OTIO demanded incoming pre-roll the source never
11
+ needed — and the round-trip dropped the fade as handle starvation. The
12
+ writer now carries the source event's actual alignment (start-at-cut,
13
+ `inOffset`, or derived from `recStart`).
14
+ - **The flat DRT target omitted nothing and authored a bogus `BL` offline
15
+ clip** for black legs. BL legs are now omitted — an empty track region
16
+ renders the same black without the media-offline lie — and the `drt`
17
+ result reports `blackLegsOmitted`.
18
+
19
+ ## What's New in v2.159.0 — the EDL writer learns transitions
20
+
21
+ ### Fixed
22
+
23
+ - **`convert_to_interchange`'s EDL target silently dropped every
24
+ transition** (the OTIO target carried them since day one). The writer now
25
+ emits the CMX pairs — a zero-length outgoing marker line plus the `D` line
26
+ with its duration — with the `BL` reel on the black side of fades, and a
27
+ zero-length fade-out carrier receives the fade's record extent per the
28
+ CMX convention. Round-trip proven: written EDLs parse back to fully
29
+ authored specs (dissolves, fade-in, fade-out; nothing dropped). Reel
30
+ names are basename-stripped before sanitizing, so path-style sources
31
+ produce clean reels.
32
+
5
33
  ## What's New in v2.158.0 — E100: the kitchen-sink certification
6
34
 
7
35
  ### Verified (one turnover, everything at once)
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.158.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.160.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-36%20(353%20full)-blue.svg)](#server-modes)
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.158.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.160.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-36%20(353%20full)-blue.svg)](#服务器模式)
@@ -12,7 +12,7 @@
12
12
  [![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
13
13
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
14
14
 
15
- > 本翻译对应 v2.158.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v2.160.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "2.158.0"
40
+ VERSION = "2.160.0"
41
41
  # Only hard floor: mcp[cli] requires Python 3.10+. There is no upper bound —
42
42
  # Resolve's scripting bridge loads into newer interpreters on recent builds
43
43
  # (Python 3.14 verified against Resolve Studio 20.3.2). Older Resolve builds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "2.158.0",
3
+ "version": "2.160.0",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -156,13 +156,22 @@ export function eventsToOTIO(events, opts = {}) {
156
156
  clip.effects.push({ OTIO_SCHEMA: 'LinearTimeWarp.1', name: 'Speed', metadata: {}, effect_name: 'LinearTimeWarp', time_scalar: (e.reverse ? -1 : 1) * ((e.speed ?? 100) / 100) });
157
157
  }
158
158
  if (e.transition) {
159
+ // Span fidelity (E102): carry the source event's actual alignment
160
+ // instead of forcing centered — a centered rewrite of a start-at-cut
161
+ // fade-in demands incoming pre-roll the source never needed, and the
162
+ // conform then drops it as handle starvation.
163
+ const d = e.transition.duration || 0;
164
+ let inOff = Math.ceil(d / 2);
165
+ if (e.transition.alignment === 'start') inOff = 0;
166
+ else if (e.transition.inOffset != null) inOff = Math.max(0, Math.min(d, e.transition.inOffset));
167
+ else if (e.transition.recStart != null && e.recIn != null) inOff = Math.max(0, Math.min(d, e.recIn - e.transition.recStart));
159
168
  children.push({
160
169
  OTIO_SCHEMA: 'Transition.1',
161
170
  metadata: {},
162
171
  name: 'Cross Dissolve',
163
172
  transition_type: 'SMPTE_Dissolve',
164
- in_offset: rt(Math.ceil((e.transition.duration || 0) / 2), fps),
165
- out_offset: rt(Math.floor((e.transition.duration || 0) / 2), fps),
173
+ in_offset: rt(inOff, fps),
174
+ out_offset: rt(d - inOff, fps),
166
175
  });
167
176
  }
168
177
  children.push(clip);
@@ -705,19 +714,41 @@ export function eventsToAssembleSpec(events, opts = {}) {
705
714
 
706
715
  export function eventsToEDL(events, opts = {}) {
707
716
  const fps = opts.fps || events.find((e) => e.fps)?.fps || 24;
708
- const vids = events.filter((e) => e.track !== 'A').sort((a, b) => (a.recIn ?? 0) - (b.recIn ?? 0));
717
+ const vids = events.filter((e) => e.track !== 'A').sort((a, b) => (a.recIn ?? 0) - (b.recIn ?? 0) || (a.recOut ?? 0) - (b.recOut ?? 0));
709
718
  const lines = [`TITLE: ${opts.name || 'CONFORMED'}`, 'FCM: NON-DROP FRAME'];
719
+ const reelOf = (e) =>
720
+ String(e.source || 'AX')
721
+ .split(/[\\/]/).pop()
722
+ .replace(/\.[^.]+$/, '')
723
+ .replace(/[^A-Za-z0-9]/g, '')
724
+ .slice(0, 8)
725
+ .toUpperCase() || 'AX';
726
+ let num = 0;
710
727
  vids.forEach((e, i) => {
711
- const num = pad(i + 1, 3);
712
- const reel =
713
- String(e.source || 'AX')
714
- .replace(/\.[^.]+$/, '')
715
- .replace(/[^A-Za-z0-9]/g, '')
716
- .slice(0, 8)
717
- .toUpperCase() || 'AX';
718
- lines.push(
719
- `${num} ${reel} V C ${framesToTc(e.srcIn, fps)} ${framesToTc(e.srcOut, fps)} ${framesToTc(e.recIn, fps)} ${framesToTc(e.recOut, fps)}`,
720
- );
728
+ const reel = reelOf(e);
729
+ // Transitions write the CMX pair (E101 — the OTIO writer carried them
730
+ // since day one, this writer silently dropped them): a zero-length cut
731
+ // of the OUTGOING at the junction, then the D line with the duration.
732
+ // Fades work identically with the BL reel on the black side.
733
+ if (e.transition && (e.transition.duration || 0) > 0) {
734
+ const prev = vids.find((o) => o !== e && (o.recOut ?? 0) === (e.recIn ?? 0) && (o.recIn ?? 0) < (o.recOut ?? 0));
735
+ const outReel = prev ? reelOf(prev) : 'BL';
736
+ const outSrc = prev ? framesToTc(prev.srcOut, fps) : framesToTc(0, fps);
737
+ lines.push(
738
+ `${pad(++num, 3)} ${outReel} V C ${outSrc} ${outSrc} ${framesToTc(e.recIn, fps)} ${framesToTc(e.recIn, fps)}`,
739
+ );
740
+ // A zero-length BL carrier (OTIO/AAF fade-out shape) gets the fade's
741
+ // own record extent — the CMX fade-out convention.
742
+ const recOut = (e.recIn ?? 0) === (e.recOut ?? 0) ? (e.recIn ?? 0) + Math.round(e.transition.duration) : e.recOut;
743
+ lines.push(
744
+ `${pad(++num, 3)} ${reel} V D ${String(Math.round(e.transition.duration)).padStart(3, '0')} ${framesToTc(e.srcIn, fps)} ${framesToTc(e.srcOut, fps)} ${framesToTc(e.recIn, fps)} ${framesToTc(recOut, fps)}`,
745
+ );
746
+ } else {
747
+ if ((e.recIn ?? 0) === (e.recOut ?? 0)) return; // zero-length markers are emitted by the transition pair itself
748
+ lines.push(
749
+ `${pad(++num, 3)} ${reel} V C ${framesToTc(e.srcIn, fps)} ${framesToTc(e.srcOut, fps)} ${framesToTc(e.recIn, fps)} ${framesToTc(e.recOut, fps)}`,
750
+ );
751
+ }
721
752
  if ((e.speed ?? 100) !== 100 || e.reverse) {
722
753
  const play = (e.reverse ? -1 : 1) * (fps * ((e.speed ?? 100) / 100));
723
754
  lines.push(`M2 ${reel} ${play.toFixed(1)} ${framesToTc(e.srcIn, fps)}`);
@@ -758,7 +789,13 @@ export function drtFlattenedRetimes(events) {
758
789
  /** Build a buildDRT spec (Resolve-native .drt) from normalized events. */
759
790
  export function eventsToDrtSpec(events, opts = {}) {
760
791
  const fps = opts.fps || events.find((e) => e.fps)?.fps || 24;
761
- const groups = byTrack(events);
792
+ // BL legs are OMITTED on this flat target (E102): a 'BL' mediaFilePath
793
+ // would author a bogus offline clip, while an empty track region renders
794
+ // black anyway — the same picture without the media-offline lie. (The
795
+ // fade transitions themselves flatten on DRT by design; use
796
+ // drt.assemble_from_interchange for a .drt that AUTHORS them.)
797
+ const isBLev = (e) => /^(BL|BLACK)$/i.test(String(e.source || '').trim());
798
+ const groups = byTrack(events.filter((e) => !isBLev(e)));
762
799
  const mkTrack = (list) => ({
763
800
  clips: list.map((e) => ({ start: e.recIn ?? 0, duration: (e.recOut ?? 0) - (e.recIn ?? 0), in: e.srcIn ?? 0, mediaFilePath: e.source || '' })),
764
801
  });
@@ -795,7 +832,11 @@ export async function authorInterchange(events, target, opts = {}) {
795
832
  if (t === 'drt') {
796
833
  const spec = eventsToDrtSpec(events, opts);
797
834
  const buf = await drt().buildDRT(spec);
798
- return { target: 'drt', spec, buffer: buf, bytes: buf.length, flattened: drtFlattenedRetimes(events) };
835
+ const blackLegsOmitted = events.filter((e) => /^(BL|BLACK)$/i.test(String(e.source || '').trim())).length;
836
+ return {
837
+ target: 'drt', spec, buffer: buf, bytes: buf.length, flattened: drtFlattenedRetimes(events),
838
+ ...(blackLegsOmitted ? { blackLegsOmitted } : {}),
839
+ };
799
840
  }
800
841
  throw new Error(`authorInterchange: unknown target '${target}' (otio|edl|drt)`);
801
842
  }
@@ -86,7 +86,7 @@ const markerSchema = z.object({
86
86
  export const editorialTool = {
87
87
  name: 'editorial',
88
88
  description:
89
- 'Editorial integrity (Cluster E) — turnover interchange → normalized events → changelist + conform manifest with TIMING silent-lie guards (flattened retime / dropped J/L-cut audio / framerate-pulldown slip / reverse dropped / transition-handle starvation → flag, skip-not-fake). Report-only (gate: review). Actions: parse_interchange (EDL/OTIO/XMEML natively + AAF via pyaaf2 + PRPROJ via gunzip+XML → normalized events incl. span-explicit transitions and BL fade legs; for AAF/PRPROJ pass the file PATH as content; AAF also returns per-sequence startTimecode/startFrame — build the timeline at THAT start, not the Resolve 01:00:00:00 default — and per-clip `geometry` for Avid transform effects), list_sequences (ONE offline picker entry point across xml/edl/otio/drt/drp/aaf/prproj → [{id,name,eventCount}], plus startTimecode/startFrame for AAF), convert_to_interchange (author OTIO/EDL/DRT Resolve CAN import from events or a parsed source — the .prproj→Resolve conform bridge, no Premiere needed; editorial timing/transitions survive and per-clip effects/color do not. SPEED/REVERSE survive on the otio (LinearTimeWarp) and edl (M2) targets ONLY — this FLAT drt target flattens every retime to 100% forward and returns `flattened`/`flattenedCount` naming each event that lost one (`flattened` is always present on `drt`, empty when there were none); for a .drt that AUTHORS retimes/dissolves/multi-track/audio, use drt.assemble_from_interchange), turnover_changelist (diff old vs new → moved/retimed/replaced/new/gone + timing flags), conform_manifest (per-event assert: source resolved/handles/retime/reverse/TC-base; BL-aware — black legs need no source, fades no black-side handles, and a fade-out tail requirement lands on the picture source), marker_roundtrip (markers with provenance tags), verify_roundtrip (input events vs re-export events -> pass/mismatches + fitted per-source TC offsets + marker compare w/ markersNotInExport honesty flag; FADE-AWARE: BL/Solid-Color legs merge out as blackSegments and fade-window boundary reshapes are excused into fadeReshapedBoundaries instead of failing; RETIME-AWARE: speed/reverse compare pairwise — EXPORT_OTIO carries an authored Sm2TimeMap back as LinearTimeWarp (measured), so a flattened/lost retime fails as drift geometry alone cannot catch; AUDIO-AWARE: declared audio events compare (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; the conform QC loop-closer). Offline (AAF needs pyaaf2; live AAF/DRP import is on the Python davinci-resolve MCP).',
89
+ 'Editorial integrity (Cluster E) — turnover interchange → normalized events → changelist + conform manifest with TIMING silent-lie guards (flattened retime / dropped J/L-cut audio / framerate-pulldown slip / reverse dropped / transition-handle starvation → flag, skip-not-fake). Report-only (gate: review). Actions: parse_interchange (EDL/OTIO/XMEML natively + AAF via pyaaf2 + PRPROJ via gunzip+XML → normalized events incl. span-explicit transitions and BL fade legs; for AAF/PRPROJ pass the file PATH as content; AAF also returns per-sequence startTimecode/startFrame — build the timeline at THAT start, not the Resolve 01:00:00:00 default — and per-clip `geometry` for Avid transform effects), list_sequences (ONE offline picker entry point across xml/edl/otio/drt/drp/aaf/prproj → [{id,name,eventCount}], plus startTimecode/startFrame for AAF), convert_to_interchange (author OTIO/EDL/DRT Resolve CAN import from events or a parsed source; the EDL target writes CMX transition pairs incl. BL fades — the .prproj→Resolve conform bridge, no Premiere needed; editorial timing/transitions survive and per-clip effects/color do not. SPEED/REVERSE survive on the otio (LinearTimeWarp) and edl (M2) targets ONLY — this FLAT drt target flattens every retime to 100% forward and returns `flattened`/`flattenedCount` naming each event that lost one (`flattened` is always present on `drt`, empty when there were none); for a .drt that AUTHORS retimes/dissolves/multi-track/audio, use drt.assemble_from_interchange), turnover_changelist (diff old vs new → moved/retimed/replaced/new/gone + timing flags), conform_manifest (per-event assert: source resolved/handles/retime/reverse/TC-base; BL-aware — black legs need no source, fades no black-side handles, and a fade-out tail requirement lands on the picture source), marker_roundtrip (markers with provenance tags), verify_roundtrip (input events vs re-export events -> pass/mismatches + fitted per-source TC offsets + marker compare w/ markersNotInExport honesty flag; FADE-AWARE: BL/Solid-Color legs merge out as blackSegments and fade-window boundary reshapes are excused into fadeReshapedBoundaries instead of failing; RETIME-AWARE: speed/reverse compare pairwise — EXPORT_OTIO carries an authored Sm2TimeMap back as LinearTimeWarp (measured), so a flattened/lost retime fails as drift geometry alone cannot catch; AUDIO-AWARE: declared audio events compare (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; the conform QC loop-closer). Offline (AAF needs pyaaf2; live AAF/DRP import is on the Python davinci-resolve MCP).',
90
90
  async handler({ action, args }) {
91
91
  if (action === 'parse_interchange') {
92
92
  const p = parseSchema.parse(args);
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
87
87
  handlers=[logging.StreamHandler()],
88
88
  )
89
89
 
90
- VERSION = "2.158.0"
90
+ VERSION = "2.160.0"
91
91
  logger = logging.getLogger("davinci-resolve-mcp")
92
92
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
93
93
  logger.info(f"Detected platform: {get_platform()}")
package/src/server.py CHANGED
@@ -11,7 +11,7 @@ Usage:
11
11
  python src/server.py --full # Start the 353-tool granular server instead
12
12
  """
13
13
 
14
- VERSION = "2.158.0"
14
+ VERSION = "2.160.0"
15
15
 
16
16
  import base64
17
17
  import os