davinci-resolve-mcp 2.187.0 → 2.189.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,48 @@
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.189.0 — E136: Premiere markers belong to their sequence and read their real fields
6
+
7
+ ### Fixed
8
+
9
+ - **Every project marker landed on every sequence, at frame 0, unnamed.**
10
+ The marker walk returned every `Marker` object in the project for each
11
+ sequence and read fields the real shape does not carry: on a real Premiere
12
+ 2025 turnover that was 1,228 bogus markers per sequence. A sequence's
13
+ markers are its own — `Sequence.MarkerOwner.Markers` → a markers container
14
+ → `<Marker>` pairs → marker objects whose payload is a `DVAMarker` JSON
15
+ blob (`mStartTime.ticks`, `mName`, `mComment`, `mType`, `mEndTime`). They
16
+ now read from that blob (ticks to frames, duration from an end time),
17
+ sorted by frame; the legacy field shape still reads when a sequence owns
18
+ it; a sequence without a marker owner reports none. On the turnover: 188
19
+ markers across 66 sequences, where every sequence used to show 1,228.
20
+
21
+ ### Measured (filed in api-limitations)
22
+
23
+ - The Premiere 2025 marker ownership chain and the `DVAMarker` JSON payload.
24
+
25
+ ## What's New in v2.188.0 — E135: Premiere tracks are lanes; nested blocks first-fit; an audio lane ceiling
26
+
27
+ ### Fixed
28
+
29
+ - **Every Premiere track was labelled `V` or `A`.** Multi-track sequences
30
+ collapsed onto one lane: on a real Premiere 2025 reels project 687 of 741
31
+ sequences had cuts overlapping on the same lane (4,631 pairs), which the
32
+ bridge refuses. Tracks now number per kind in track order (`V`, `V2` … /
33
+ `A`, `A2` …) across track groups and the legacy lists, and clip events,
34
+ fade legs and transitions carry the lane.
35
+ - **Nested sequences expand in a second pass, first-fit.** Two nested
36
+ sequences stacked on different parent lanes each bring their own inner
37
+ lanes, and a fixed lane offset collided on 7,615 pairs. A nested block now
38
+ expands after every parent lane is known and shifts up by the smallest
39
+ offset at which none of its cuts overlap what the parent or an earlier
40
+ block holds (`laneShift` records it). On the reels project the only
41
+ "overlaps" left are zero-length fade carriers — none real.
42
+ - **An audio lane ceiling in the bridge.** Flattened nested sequences can
43
+ stack audio lanes to A40 (3,586 events above lane 16 on that project, in
44
+ 30 sequences); Resolve authors A1–A16. Events above 16 now drop with a
45
+ reason in `audioLanesBeyondCeiling` instead of authoring blind.
46
+
5
47
  ## What's New in v2.187.0 — E134: real Premiere transitions attach, with their real type
6
48
 
7
49
  ### Fixed
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.187.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.189.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.187.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.189.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.187.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v2.189.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
@@ -322,7 +322,7 @@ equivalent, blocking full automation.
322
322
  - **Object:** `editorial.parse_interchange / list_sequences (prproj)`
323
323
  - **Signature:** `(path.prproj) -> sequences/events`
324
324
  - **Behavior:** Measured on a real 130 MB colour turnover (E132): objects are defined in TWO id spaces — numeric ObjectID referenced by ObjectRef, and uuid ObjectUID referenced by ObjectURef — and Sequence, ClipProjectItem, MasterClip, Media, VideoClipTrack and AudioClipTrack are all UID-defined. A Sequence lists its tracks through <TrackGroups><TrackGroup><Second ObjectRef> → VideoTrackGroup / AudioTrackGroup (a third DataTrackGroup is empty) → <TrackGroup><Tracks><Track ObjectURef> → Video/AudioClipTrack → <ClipTrack><ClipItems><TrackItems><TrackItem ObjectRef>. An item's record span sits under <ClipTrackItem><TrackItem> (Start/End ticks) and its source under ClipTrackItem.SubClip → SubClip.Clip → VideoClip.Clip (InPoint/OutPoint, Source) → VideoMediaSource.MediaSource.Media (ObjectURef) → Media (FilePath / ActualMediaFilePath); SubClip.Name and MasterClip.Name are the fallbacks. A ZERO is written as ABSENCE (the counting leader at record 0 has End and no Start). Names are direct <Name> children. Legacy/synthetic files instead use ObjectID/ObjectRef throughout, <VideoTracks>/<AudioTracks> track lists, Start/End/InPoint/OutPoint on the item and Node/Properties names.
325
- - **Workaround / current handling:** Index both id spaces and follow both reference attributes; walk TrackGroups when present; read timing through the *TrackItem child; treat a missing Start/InPoint beside a present End/OutPoint as 0. With that, the turnover lists all 739 sequences and its reel walks 335 events (it listed ZERO before). A NESTED SEQUENCE used as a clip has Clip.Source → VideoSequenceSource / AudioSequenceSource → SequenceSource.Sequence ObjectURef → the nested Sequence (E133: 3607 such items in the reels project); parse_interchange flattens them through the clip's InPoint window with fromCompound. TRANSITIONS sit in a SEPARATE track list, ClipTrack.TransitionItems.TrackItems (E134): a Video/AudioTransitionTrackItem carries TransitionTrackItem.TrackItem{Start,End} (the span), DisplayName / MatchName (the effect), Alignment (ticks) and HasIncomingClip / HasOutgoingClip — false marks a fade from/to black or silence.
325
+ - **Workaround / current handling:** Index both id spaces and follow both reference attributes; walk TrackGroups when present; read timing through the *TrackItem child; treat a missing Start/InPoint beside a present End/OutPoint as 0. With that, the turnover lists all 739 sequences and its reel walks 335 events (it listed ZERO before). A NESTED SEQUENCE used as a clip has Clip.Source → VideoSequenceSource / AudioSequenceSource → SequenceSource.Sequence ObjectURef → the nested Sequence (E133: 3607 such items in the reels project); parse_interchange flattens them through the clip's InPoint window with fromCompound. TRANSITIONS sit in a SEPARATE track list, ClipTrack.TransitionItems.TrackItems (E134): a Video/AudioTransitionTrackItem carries TransitionTrackItem.TrackItem{Start,End} (the span), DisplayName / MatchName (the effect), Alignment (ticks) and HasIncomingClip / HasOutgoingClip — false marks a fade from/to black or silence. MARKERS (E136): a sequence owns its markers through Sequence.MarkerOwner.Markers → a Markers container → <Markers><Marker><Second ObjectRef> → a Marker object whose payload is a DVAMarker JSON string ({mMarkerID, mStartTime.ticks, mType, mName?, mComment?, mEndTime?}); clips own theirs the same way via Clip.MarkerOwner. Marker objects exist project-wide (1228 on the turnover) — only the owner chain says whose they are.
326
326
  - **Tags:** prproj, premiere, interchange, silent-failure
327
327
 
328
328
  ### ProjectManager.CreateProject (discards an unsaved current project)
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "2.187.0"
40
+ VERSION = "2.189.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.187.0",
3
+ "version": "2.189.0",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -436,6 +436,7 @@ export function eventsToAssembleSpec(events, opts = {}) {
436
436
  const audioTrackNum = (t) => { const m = /^A(\d+)?$/.exec(String(t)); return m && m[1] ? parseInt(m[1], 10) : 1; };
437
437
  const audioPlacements = [];
438
438
  const audioRetimesSkipped = [];
439
+ const audioLanesBeyondCeiling = [];
439
440
  const audioTransCandidates = [];
440
441
  let audioBlackLegsSkipped = 0;
441
442
  for (const e of auds) {
@@ -460,6 +461,14 @@ export function eventsToAssembleSpec(events, opts = {}) {
460
461
  audioRetimesSkipped.push({ index: e.index, source: e.source, speed: e.speed, reverse: !!e.reverse, reason: 'audio retime not authorable — the audio engine ignores the clip timemap (measured: reads back retimed, renders 100%); played at 100%' });
461
462
  }
462
463
  const track = audioTrackNum(e.track);
464
+ // AUDIO LANE CEILING (E135): Resolve authors audio tracks A1–A16 (A9–A16
465
+ // render-verified); flattened nested sequences can stack lanes far past
466
+ // that (A40 measured on a real Premiere reels project). Anything above
467
+ // 16 drops with a reason — named in the ledger, never authored blind.
468
+ if (track > 16) {
469
+ audioLanesBeyondCeiling.push({ index: e.index, source: e.source, track: e.track, recIn: e.recIn, recOut: e.recOut, reason: `audio lane ${track} exceeds the A16 ceiling Resolve authors — flatten fewer stacked nested sequences or remix the bed` });
470
+ continue;
471
+ }
463
472
  const cut = { startFrame: recIn, durationFrames, srcIn: toTl(e.srcIn ?? 0, e.fps), audioOnly: true, track };
464
473
  if (e.transition) {
465
474
  let d = Math.max(2, toTl(e.transition.duration || 0, e.fps) || 2);
@@ -730,6 +739,7 @@ export function eventsToAssembleSpec(events, opts = {}) {
730
739
  unresolvedCompounds,
731
740
  authoredAudioEvents: audioPlacements.length,
732
741
  audioRetimesSkipped,
742
+ audioLanesBeyondCeiling,
733
743
  ...(elements.length || audioBlackLegsSkipped ? {
734
744
  blackLegs: { authoredGenerators: elements.length, audioSilenceLegsSkipped: audioBlackLegsSkipped },
735
745
  } : {}),
@@ -260,10 +260,17 @@ function walkSequence(seqEntry, byId, depth = 0, seen = new Set()) {
260
260
  const refs = asArray(grp.node.TrackGroup?.Tracks?.Track);
261
261
  if (refs.length) trackLists.push({ trackKind, refs });
262
262
  }
263
+ // Lanes number per kind in track order — V, V2, V3 … / A, A2 … — like
264
+ // every other parser (E109/E135): labelling every track 'V'/'A' stacked
265
+ // 687 of 741 real sequences' cuts onto one lane (4631 overlapping pairs).
266
+ const laneCount = { V: 0, A: 0 };
263
267
  for (const { trackKind, refs: trackRefs } of trackLists) {
264
268
  for (const tref of trackRefs) {
265
269
  const tEntry = byId.get(refId(tref));
266
270
  if (!tEntry) continue;
271
+ laneCount[trackKind] += 1;
272
+ const laneNum = laneCount[trackKind];
273
+ const trackLabel = laneNum === 1 ? trackKind : `${trackKind}${laneNum}`;
267
274
  // Real Premiere 2025 keeps a track's TRANSITIONS in a separate list,
268
275
  // ClipTrack.TransitionItems (E134, measured: 2 video + 1 audio on the
269
276
  // reel — none reached the parser from ClipItems alone).
@@ -279,29 +286,19 @@ function walkSequence(seqEntry, byId, depth = 0, seen = new Set()) {
279
286
  const cEntry = byId.get(refId(iref));
280
287
  if (!cEntry) continue;
281
288
  if (/ClipTrackItem$/.test(cEntry.tag)) {
282
- const ev = clipEvent(cEntry.node, byId, trackKind, fps, idx++);
289
+ const ev = clipEvent(cEntry.node, byId, trackLabel, fps, idx++);
283
290
  const nested = ev.__nested;
284
291
  delete ev.__nested;
285
292
  const nestedKey = nested ? String(nested.node['@_ObjectUID'] ?? nested.node['@_ObjectID'] ?? '') : '';
286
293
  if (nested && depth < 8 && !seenHere.has(nestedKey)) {
287
- // FLATTEN the nested sequence into this record span (E133, the
288
- // OTIO Stack / AAF nested-composition flatten for Premiere): walk
289
- // it with its own cursor, keep this track kind's lanes, translate
290
- // through the window [srcIn, srcIn + record length), tag fromCompound.
291
- const inner = walkSequence(nested, byId, depth + 1, seenHere).filter((e) => e.track.charAt(0) === trackKind && e.recIn != null && e.recOut != null);
292
- const winStart = ev.srcIn ?? 0;
293
- const winLen = (ev.recOut ?? 0) - (ev.recIn ?? 0);
294
- let first = true;
295
- for (const e of inner) {
296
- const a = e.recIn - winStart, b = e.recOut - winStart;
297
- const a2 = Math.max(0, a), b2 = Math.min(winLen, b);
298
- if (b2 <= a2) continue;
299
- const k = ((e.speed ?? 100) / 100) * (e.reverse ? -1 : 1);
300
- const flat = { ...e, index: idx++, recIn: ev.recIn + a2, recOut: ev.recIn + b2, srcIn: e.srcIn != null ? Math.round(e.srcIn + (a2 - a) * k) : e.srcIn, srcOut: e.srcOut != null ? Math.round(e.srcOut - (b - b2) * k) : e.srcOut, fromCompound: ev.source };
301
- if (first && ev.transition && !flat.transition) flat.transition = ev.transition;
302
- first = false;
303
- clipEvents.push(flat);
304
- }
294
+ // Defer the FLATTEN (E133/E135): expanded after every parent lane
295
+ // is known, so a nested block's inner lanes can first-fit above
296
+ // whatever the parent already stacks there two nested
297
+ // sequences on different parent lanes each bring their own inner
298
+ // lanes, and a fixed offset collides (measured: 7615 overlapping
299
+ // pairs on the reels project).
300
+ ev.__nestedExpand = { nested, laneNum, trackKind, seenHere };
301
+ clipEvents.push(ev);
305
302
  continue;
306
303
  }
307
304
  if (nested) ev.compound = ev.source; // cycle/depth guard: keep it as a named compound hole
@@ -333,36 +330,120 @@ function walkSequence(seqEntry, byId, depth = 0, seen = new Set()) {
333
330
  incoming.transition = trans;
334
331
  const outgoing = clipEvents.find((e) => e !== incoming && e.recOut > tr.recIn - 1 && e.recOut <= end);
335
332
  if (!outgoing) {
336
- clipEvents.push({ index: idx++, track: trackKind, source: 'BL', srcIn: 0, srcOut: 0, recIn: incoming.recIn, recOut: incoming.recIn, speed: 100, reverse: false, transition: null, fps });
333
+ clipEvents.push({ index: idx++, track: trackLabel, source: 'BL', srcIn: 0, srcOut: 0, recIn: incoming.recIn, recOut: incoming.recIn, speed: 100, reverse: false, transition: null, fps });
337
334
  }
338
335
  } else {
339
336
  const outgoing = clipEvents.find((e) => e.recOut > tr.recIn - 1 && e.recOut <= end);
340
337
  if (outgoing) {
341
- clipEvents.push({ index: idx++, track: trackKind, source: 'BL', srcIn: 0, srcOut: 0, recIn: outgoing.recOut, recOut: outgoing.recOut, speed: 100, reverse: false, transition: trans, fps });
338
+ clipEvents.push({ index: idx++, track: trackLabel, source: 'BL', srcIn: 0, srcOut: 0, recIn: outgoing.recOut, recOut: outgoing.recOut, speed: 100, reverse: false, transition: trans, fps });
342
339
  }
343
340
  }
344
341
  }
345
342
  events.push(...clipEvents);
346
343
  }
347
344
  }
348
- return events;
345
+ return expandNestedPlaceholders(events, byId, fps, depth);
346
+ }
347
+
348
+ /**
349
+ * Flatten every deferred nested-sequence placeholder into the parent record
350
+ * time (E133/E135). Inner lanes land on the parent's lane and the lanes above
351
+ * it, shifted up by the smallest offset at which none of the block's cuts
352
+ * overlap what the parent (or an earlier block) already holds on those lanes.
353
+ */
354
+ function expandNestedPlaceholders(events, byId, fps, depth) {
355
+ const laneOf = (t) => parseInt(String(t).replace(/\D/g, '') || '1', 10);
356
+ const label = (kind, n) => (n === 1 ? kind : `${kind}${n}`);
357
+ const occupancy = new Map(); // lane label → [[recIn, recOut], …]
358
+ const occupy = (e) => { if (e.recIn == null || e.recOut == null) return; (occupancy.get(e.track) || occupancy.set(e.track, []).get(e.track)).push([e.recIn, e.recOut]); };
359
+ const free = (lane, a, b) => !(occupancy.get(lane) || []).some(([x, y]) => a < y && b > x);
360
+ for (const e of events) if (!e.__nestedExpand) occupy(e);
361
+ const out = [];
362
+ let idx = 1;
363
+ for (const ev of events) {
364
+ const ph = ev.__nestedExpand;
365
+ if (!ph) { out.push({ ...ev, index: idx++ }); continue; }
366
+ delete ev.__nestedExpand;
367
+ const { nested, laneNum, trackKind, seenHere } = ph;
368
+ const inner = walkSequence(nested, byId, depth + 1, seenHere).filter((e) => e.track.charAt(0) === trackKind && e.recIn != null && e.recOut != null);
369
+ const winStart = ev.srcIn ?? 0;
370
+ const winLen = (ev.recOut ?? 0) - (ev.recIn ?? 0);
371
+ const block = [];
372
+ for (const e of inner) {
373
+ const a = e.recIn - winStart, b = e.recOut - winStart;
374
+ const a2 = Math.max(0, a), b2 = Math.min(winLen, b);
375
+ if (b2 <= a2) continue;
376
+ const k = ((e.speed ?? 100) / 100) * (e.reverse ? -1 : 1);
377
+ block.push({ ...e, recIn: ev.recIn + a2, recOut: ev.recIn + b2, srcIn: e.srcIn != null ? Math.round(e.srcIn + (a2 - a) * k) : e.srcIn, srcOut: e.srcOut != null ? Math.round(e.srcOut - (b - b2) * k) : e.srcOut, fromCompound: ev.source, __innerLane: laneOf(e.track) });
378
+ }
379
+ // First-fit: the smallest upward shift at which every cut of the block finds its lane free.
380
+ let shift = 0;
381
+ for (; shift < 64; shift += 1) {
382
+ if (block.every((e) => free(label(trackKind, laneNum + e.__innerLane - 1 + shift), e.recIn, e.recOut))) break;
383
+ }
384
+ let first = true;
385
+ for (const e of block) {
386
+ const placed = { ...e, index: idx++, track: label(trackKind, laneNum + e.__innerLane - 1 + shift) };
387
+ delete placed.__innerLane;
388
+ if (shift) placed.laneShift = shift;
389
+ if (first && ev.transition && !placed.transition) placed.transition = ev.transition;
390
+ first = false;
391
+ occupy(placed);
392
+ out.push(placed);
393
+ }
394
+ if (!block.length) out.push({ ...ev, index: idx++, compound: ev.source });
395
+ }
396
+ return out;
349
397
  }
350
398
 
351
- /** Enumerate marker objects (project- or sequence-level) with tick→frame positions. */
352
- function collectMarkers(byId, fps) {
399
+ /**
400
+ * A sequence's OWN markers (E136). Real Premiere 2025: Sequence.MarkerOwner.
401
+ * Markers → a Markers container → <Markers><Marker><Second ObjectRef> → a
402
+ * Marker object whose payload is a DVAMarker JSON string ({mStartTime.ticks,
403
+ * mName, mComment, mType, mMarkerID}; a duration/end when present). The old
404
+ * walk returned EVERY Marker object in the project on EVERY sequence, with
405
+ * frame 0 and an empty name (1228 bogus markers per sequence on a real
406
+ * turnover). Legacy/synthetic Marker objects (Position/Name/Comment fields)
407
+ * are read the same way when a sequence owns them; without an owner chain a
408
+ * sequence reports none.
409
+ */
410
+ function markerFromObject(node, fps) {
411
+ const raw = childText(node, 'DVAMarker');
412
+ if (raw) {
413
+ try {
414
+ const m = JSON.parse(String(raw)).DVAMarker || {};
415
+ const startTicks = m.mStartTime && m.mStartTime.ticks != null ? Number(m.mStartTime.ticks) : null;
416
+ const endTicks = m.mEndTime && m.mEndTime.ticks != null ? Number(m.mEndTime.ticks) : null;
417
+ const frame = startTicks != null ? ticksToFrames(startTicks, fps) : null;
418
+ const duration = startTicks != null && endTicks != null ? Math.max(0, ticksToFrames(endTicks - startTicks, fps) || 0) : 0;
419
+ return { frame, duration, name: m.mName || '', note: m.mComment || '', type: m.mType || 'Comment', id: m.mMarkerID || null };
420
+ } catch {
421
+ return null;
422
+ }
423
+ }
424
+ return {
425
+ frame: ticksToFrames(childText(node, 'Position'), fps),
426
+ duration: ticksToFrames(childText(node, 'Duration'), fps) || 0,
427
+ name: childText(node, 'Name') || '',
428
+ note: childText(node, 'Comment') || '',
429
+ type: Number(childText(node, 'MarkerType')) || 0,
430
+ colorIndex: Number(childText(node, 'ColorIndex')) || 0,
431
+ };
432
+ }
433
+
434
+ function collectMarkers(seqEntry, byId, fps) {
435
+ const owner = asArray(seqEntry.node.MarkerOwner)[0];
436
+ const container = owner ? byId.get(ref(owner, 'Markers') || '') : null;
437
+ if (!container) return [];
438
+ const list = asArray(container.node.Markers && container.node.Markers.Marker);
353
439
  const markers = [];
354
- for (const { tag, node } of byId.values()) {
355
- if (tag !== 'Marker') continue;
356
- markers.push({
357
- frame: ticksToFrames(childText(node, 'Position'), fps),
358
- duration: ticksToFrames(childText(node, 'Duration'), fps) || 0,
359
- name: childText(node, 'Name') || '',
360
- note: childText(node, 'Comment') || '',
361
- type: Number(childText(node, 'MarkerType')) || 0,
362
- colorIndex: Number(childText(node, 'ColorIndex')) || 0,
363
- });
440
+ for (const pair of list) {
441
+ const mk = byId.get(refId(asArray(pair.Second)[0]) || '');
442
+ if (!mk || mk.tag !== 'Marker') continue;
443
+ const m = markerFromObject(mk.node, fps);
444
+ if (m && m.frame != null) markers.push(m);
364
445
  }
365
- return markers;
446
+ return markers.sort((a, b) => a.frame - b.frame);
366
447
  }
367
448
 
368
449
  function sequenceEntries(byId) {
@@ -387,7 +468,7 @@ export function parsePrprojDoc(pathOrBuffer) {
387
468
  fps,
388
469
  eventCount: events.length,
389
470
  events,
390
- markers: collectMarkers(byId, fps),
471
+ markers: collectMarkers(entry, byId, fps),
391
472
  };
392
473
  });
393
474
  const mediaPaths = [...new Set(collectMediaPaths(byId))].sort();
@@ -154,7 +154,7 @@ function requirePathArg(args, key, action) {
154
154
  export const drtTool = {
155
155
  name: 'drt',
156
156
  description:
157
- 'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; fades AUTHOR across ALL FOUR formats (EDL BL legs, OTIO gap-adjacent Transitions, XMEML edge transitionitems, AAF filler-adjacent Transitions) and AAF overlap-consuming dissolves reconcile+author (CutPoint honored; before E93 they threw at the overlap gate) — BL legs become Solid Color generators and the fade a real clip-to-generator dissolve, luma-ramp render-verified, while Resolve\'s OWN EDL importer drops BL dissolves silently; ledger in `conform`), assemble (spec → IMPORTABLE native-schema .drt via template-spliced real structures; pass targetAppVersion e.g. \'19.1\' for pre-21 hosts), parse, list_sequences (enumerate the timelines inside a .drp/.drt → [{id,name,eventCount,index,kind,nestedIn}] to drive a "which sequence?" picker — names and kind (timeline|compound) come from the pool folder, since a SeqContainer carries no timeline name and its first <Name> is a CLIP\'s (measured, E127); a compound container is nestedIn every timeline that places it, and a media-less clip named after a compound is tagged `compound` in parse), author, validate, inject_into_drp, extract_from_drp (pull one SeqContainer out as a .drt — by timelineName, an explicit timelineIndex, or by default the first container the pool kinds as a TIMELINE (index 0 is name-sorted by DbId and was an inner compound on Resolve\'s own export, E128); a timeline keeps its compound containers recursively; feed the .drt to the Python davinci-resolve MCP timeline.import_timeline_checked, or use timeline.import_from_drp to do both), downgrade (stamp <ProjectVersion> down so an OLDER Resolve will import a .drt/.drp from a newer one — pass targetAppVersion like "19.1.3" or targetProjectVersion).',
157
+ 'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; audio events above lane A16 drop with a reason in audioLanesBeyondCeiling (flattened nested sequences can stack lanes to A40 — measured); fades AUTHOR across ALL FOUR formats (EDL BL legs, OTIO gap-adjacent Transitions, XMEML edge transitionitems, AAF filler-adjacent Transitions) and AAF overlap-consuming dissolves reconcile+author (CutPoint honored; before E93 they threw at the overlap gate) — BL legs become Solid Color generators and the fade a real clip-to-generator dissolve, luma-ramp render-verified, while Resolve\'s OWN EDL importer drops BL dissolves silently; ledger in `conform`), assemble (spec → IMPORTABLE native-schema .drt via template-spliced real structures; pass targetAppVersion e.g. \'19.1\' for pre-21 hosts), parse, list_sequences (enumerate the timelines inside a .drp/.drt → [{id,name,eventCount,index,kind,nestedIn}] to drive a "which sequence?" picker — names and kind (timeline|compound) come from the pool folder, since a SeqContainer carries no timeline name and its first <Name> is a CLIP\'s (measured, E127); a compound container is nestedIn every timeline that places it, and a media-less clip named after a compound is tagged `compound` in parse), author, validate, inject_into_drp, extract_from_drp (pull one SeqContainer out as a .drt — by timelineName, an explicit timelineIndex, or by default the first container the pool kinds as a TIMELINE (index 0 is name-sorted by DbId and was an inner compound on Resolve\'s own export, E128); a timeline keeps its compound containers recursively; feed the .drt to the Python davinci-resolve MCP timeline.import_timeline_checked, or use timeline.import_from_drp to do both), downgrade (stamp <ProjectVersion> down so an OLDER Resolve will import a .drt/.drp from a newer one — pass targetAppVersion like "19.1.3" or targetProjectVersion).',
158
158
  async handler({ action, args }) {
159
159
  if (action === 'parse') {
160
160
  const p = parseSchema.parse(requirePathArg(args, 'drtPath', 'parse'));
@@ -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 — incl. Resolve-written OTIO generator clips (a Solid Color is a Clip with a NULL media_reference; it walks as a BL leg with generatorName, and an OTIO GeneratorReference carries its colour) and nested OTIO Stacks (compound clips — Resolve\'s writer nests them with a trim window) FLATTEN into record time with fromCompound on each cut, so Resolve\'s own OTIO exports re-conform (its FCP7 XML writer flattens a compound to ONE media-less clipitem instead — tagged `compound`, which the bridge drops with a reason in unresolvedCompounds unless the sourceMap maps the compound name to a flattened media file), Resolve-written FCP7 -1 junction edges (paired in record order) + Solid Color / Color Matte generators carrying their `fillcolor` (BL legs with `color` → fade-to-white and colour mattes author, E110), XMEML audio-track transitionitems as audio cross-fades on numbered lanes A/A2/…, and CMX FROM/TO CLIP NAME comments over the generic AX reel — + AAF via pyaaf2 (flat sound/picture slots number A/A2/… and V/V2/… in slot order so separate beds keep their lanes; NestedScope layers keep layer numbering; a NESTED SEQUENCE used as a clip — a SourceClip referencing a named CompositionMob — flattens through its reference window with fromCompound, like OTIO Stacks) + PRPROJ via gunzip+XML (real Premiere 2025 files — uuid ObjectUID/ObjectURef graph, TrackGroups, ClipTrackItem→SubClip→VideoClip→MediaSource→Media chain, zeros written as absence — and the legacy ObjectID/VideoTracks shape both walk; measured on a 739-sequence turnover that used to list ZERO; a NESTED SEQUENCE used as a clip — Source = Video/AudioSequenceSource → Sequence — flattens through its in-point window with fromCompound, like OTIO Stacks and AAF nested compositions; 13,711 such events on one real reels project; real transitions live in the track\'s TransitionItems list — read alongside ClipItems, attached with their DisplayName as type, HasOutgoingClip/HasIncomingClip false = fade from/to black or silence) → normalized events incl. span-explicit transitions, BL fade legs, and freezes as zero-speed events (OTIO FreezeFrame, XMEML timeremap 0, PrProj in==out, AAF 0% motion effects); 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 and nestedIn — an AAF composition another composition uses as a clip is NESTED in it; offer the parent, its cuts arrive flattened), 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/trimmed/replaced/new/gone PLUS the junction diff: transition_added/transition_dropped/transition_changed with fade in/out or dissolve, outgoing/incoming, span and duration/type/pre-roll deltas — zero-length CMX carrier lines and the BL legs that carry fades fold into the junction diff instead of reading as gone/new sources; events pair by closest record position, consumed once, so a source cut twice at two speeds compares instance to instance; + timing flags incl. transition_dropped and dropped_split_audio on any A-track; a compound seen collapsed in one cut and flattened in the other reports compound_collapsed/compound_expanded once, never replaced+gone), 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; a compound clipitem fails source_resolved by NAME with the remedy — map it to a flattened file or turn over as OTIO), 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 (a video-only export such as EXPORT_EDL flags audioNotInExport instead of failing) (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; COLOUR-AWARE: an input generator leg carrying a fillcolor (fade-to-white, colour matte) must come back on the same track over its span with the same colour — Resolve\'s FCP7 writer emits it — else generator-colour fails (generatorColours reports the compare) — pass exportedFormat: an OTIO/EDL re-export cannot carry colour (measured) and reports generatorColourNotInExport instead of failing; COMPOUND-AWARE: an XML re-export that collapsed a compound to one clipitem over cuts the input flattened from that compound reports compoundsCollapsedInExport instead of count/source drift; 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 — incl. Resolve-written OTIO generator clips (a Solid Color is a Clip with a NULL media_reference; it walks as a BL leg with generatorName, and an OTIO GeneratorReference carries its colour) and nested OTIO Stacks (compound clips — Resolve\'s writer nests them with a trim window) FLATTEN into record time with fromCompound on each cut, so Resolve\'s own OTIO exports re-conform (its FCP7 XML writer flattens a compound to ONE media-less clipitem instead — tagged `compound`, which the bridge drops with a reason in unresolvedCompounds unless the sourceMap maps the compound name to a flattened media file), Resolve-written FCP7 -1 junction edges (paired in record order) + Solid Color / Color Matte generators carrying their `fillcolor` (BL legs with `color` → fade-to-white and colour mattes author, E110), XMEML audio-track transitionitems as audio cross-fades on numbered lanes A/A2/…, and CMX FROM/TO CLIP NAME comments over the generic AX reel — + AAF via pyaaf2 (flat sound/picture slots number A/A2/… and V/V2/… in slot order so separate beds keep their lanes; NestedScope layers keep layer numbering; a NESTED SEQUENCE used as a clip — a SourceClip referencing a named CompositionMob — flattens through its reference window with fromCompound, like OTIO Stacks) + PRPROJ via gunzip+XML (real Premiere 2025 files — uuid ObjectUID/ObjectURef graph, TrackGroups, ClipTrackItem→SubClip→VideoClip→MediaSource→Media chain, zeros written as absence — and the legacy ObjectID/VideoTracks shape both walk; measured on a 739-sequence turnover that used to list ZERO; a NESTED SEQUENCE used as a clip — Source = Video/AudioSequenceSource → Sequence — flattens through its in-point window with fromCompound, like OTIO Stacks and AAF nested compositions; 13,711 such events on one real reels project; real transitions live in the track\'s TransitionItems list — read alongside ClipItems, attached with their DisplayName as type, HasOutgoingClip/HasIncomingClip false = fade from/to black or silence; tracks number as lanes V/V2…/A/A2… and a flattened nested sequence\'s inner lanes first-fit above what the parent already stacks — laneShift records the shift; markers are the sequence\'s OWN, read from Premiere\'s DVAMarker JSON) → normalized events incl. span-explicit transitions, BL fade legs, and freezes as zero-speed events (OTIO FreezeFrame, XMEML timeremap 0, PrProj in==out, AAF 0% motion effects); 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 and nestedIn — an AAF composition another composition uses as a clip is NESTED in it; offer the parent, its cuts arrive flattened), 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/trimmed/replaced/new/gone PLUS the junction diff: transition_added/transition_dropped/transition_changed with fade in/out or dissolve, outgoing/incoming, span and duration/type/pre-roll deltas — zero-length CMX carrier lines and the BL legs that carry fades fold into the junction diff instead of reading as gone/new sources; events pair by closest record position, consumed once, so a source cut twice at two speeds compares instance to instance; + timing flags incl. transition_dropped and dropped_split_audio on any A-track; a compound seen collapsed in one cut and flattened in the other reports compound_collapsed/compound_expanded once, never replaced+gone), 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; a compound clipitem fails source_resolved by NAME with the remedy — map it to a flattened file or turn over as OTIO), 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 (a video-only export such as EXPORT_EDL flags audioNotInExport instead of failing) (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; COLOUR-AWARE: an input generator leg carrying a fillcolor (fade-to-white, colour matte) must come back on the same track over its span with the same colour — Resolve\'s FCP7 writer emits it — else generator-colour fails (generatorColours reports the compare) — pass exportedFormat: an OTIO/EDL re-export cannot carry colour (measured) and reports generatorColourNotInExport instead of failing; COMPOUND-AWARE: an XML re-export that collapsed a compound to one clipitem over cuts the input flattened from that compound reports compoundsCollapsedInExport instead of count/source drift; 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.187.0"
90
+ VERSION = "2.189.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.187.0"
14
+ VERSION = "2.189.0"
15
15
 
16
16
  import base64
17
17
  import os
@@ -2919,7 +2919,14 @@ API_TRUTH: List[Dict[str, Any]] = [
2919
2919
  "TransitionTrackItem.TrackItem{Start,End} (the span), "
2920
2920
  "DisplayName / MatchName (the effect), Alignment (ticks) "
2921
2921
  "and HasIncomingClip / HasOutgoingClip — false marks a "
2922
- "fade from/to black or silence.",
2922
+ "fade from/to black or silence. MARKERS (E136): a "
2923
+ "sequence owns its markers through Sequence.MarkerOwner."
2924
+ "Markers → a Markers container → <Markers><Marker><Second "
2925
+ "ObjectRef> → a Marker object whose payload is a DVAMarker "
2926
+ "JSON string ({mMarkerID, mStartTime.ticks, mType, mName?, "
2927
+ "mComment?, mEndTime?}); clips own theirs the same way via "
2928
+ "Clip.MarkerOwner. Marker objects exist project-wide (1228 "
2929
+ "on the turnover) — only the owner chain says whose they are.",
2923
2930
  "tags": ["prproj", "premiere", "interchange", "silent-failure"],
2924
2931
  "submit": "missing",
2925
2932
  "mitigation": ["editorial.parse_interchange prproj", "editorial.list_sequences"],