davinci-resolve-mcp 2.181.0 → 2.182.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,23 @@
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.182.0 — E128: `extract_from_drp` defaults to the pool's timeline, not the first-sorted compound
6
+
7
+ ### Fixed
8
+
9
+ - **The default extraction picked an inner compound.** `extract_from_drp`
10
+ used index 0 by default, and SeqContainers list name-sorted by DbId; on
11
+ Resolve's own export of a compound timeline (the E127 fixture) index 0 was
12
+ the inner compound E57_IN, so the default emitted a hollow inner container
13
+ instead of the timeline. The default is now the first container the pool
14
+ kinds as a timeline (index 0 only when the export carries no pool kinds);
15
+ `timelineName` picks a container by its pool name; an explicit
16
+ `timelineIndex` still means exactly that container. The result reports
17
+ `pickedBy`, the container's name and kind, and every container kept (a
18
+ timeline keeps its compounds recursively). Verified on the fixture: the
19
+ default yields E57_NESTED with E57_OUT and E57_IN kept; `timelineName`
20
+ E57_OUT yields E57_OUT + E57_IN; index 0 yields E57_IN alone.
21
+
5
22
  ## What's New in v2.181.0 — E127: DRT timelines get their real names, and compounds their kind
6
23
 
7
24
  ### 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.181.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.182.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.181.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.182.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.181.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v2.182.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.181.0"
40
+ VERSION = "2.182.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.181.0",
3
+ "version": "2.182.0",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -97,7 +97,8 @@ const injectIntoDrpSchema = z.object({
97
97
  const extractFromDrpSchema = z.object({
98
98
  drpPath: z.string().describe('Source .drp'),
99
99
  outputPath: z.string().describe('Path for the emitted .drt'),
100
- timelineIndex: z.number().int().nonnegative().optional().describe('Which SeqContainer to extract (0-based, default 0)'),
100
+ timelineIndex: z.number().int().nonnegative().optional().describe('Which SeqContainer to extract (0-based). Omitted: the first container the pool kinds as a TIMELINE — SeqContainers list name-sorted by DbId, so index 0 is often a compound\'s inner container (measured, E128)'),
101
+ timelineName: z.string().optional().describe('Extract the container the pool names this (timeline or compound) — see list_sequences'),
101
102
  });
102
103
 
103
104
  // Verified Resolve app-version → on-disk <ProjectVersion> map (the import GATE).
@@ -153,7 +154,7 @@ function requirePathArg(args, key, action) {
153
154
  export const drtTool = {
154
155
  name: 'drt',
155
156
  description:
156
- '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 — 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; 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
158
  async handler({ action, args }) {
158
159
  if (action === 'parse') {
159
160
  const p = parseSchema.parse(requirePathArg(args, 'drtPath', 'parse'));
@@ -579,7 +580,32 @@ export const drtTool = {
579
580
  const p = extractFromDrpSchema.parse(args);
580
581
  const drpZip = await JSZip.loadAsync(await fs.readFile(p.drpPath));
581
582
  const seqEntries = drt().listSeqContainerEntries(drpZip);
582
- const idx = p.timelineIndex ?? 0;
583
+ // Which container (E128): SeqContainers list name-sorted by DbId, so a
584
+ // bare index 0 picked whichever container's uuid sorted first — on
585
+ // Resolve's export of a compound timeline that was an INNER compound.
586
+ // Resolve by pool name/kind unless an index is given explicitly.
587
+ const poolNames = await drt().loadPoolSequenceNames(drpZip);
588
+ const containerInfo = [];
589
+ for (const entryName of seqEntries) {
590
+ const sx = await drpZip.file(entryName).async('string');
591
+ const sid = (sx.match(/<Sequence>([0-9a-f-]{36})<\/Sequence>/) || [])[1];
592
+ const pool = sid ? poolNames.get(sid) : null;
593
+ containerInfo.push({ entry: entryName, name: pool ? pool.name : null, kind: pool ? pool.kind : null });
594
+ }
595
+ let idx;
596
+ let pickedBy;
597
+ if (p.timelineName != null) {
598
+ idx = containerInfo.findIndex((c) => c.name === p.timelineName);
599
+ if (idx < 0) return { error: `no SeqContainer named ${JSON.stringify(p.timelineName)} — containers: ${containerInfo.map((c) => `${c.name ?? '?'}${c.kind ? ` (${c.kind})` : ''}`).join(', ')}` };
600
+ pickedBy = 'timelineName';
601
+ } else if (p.timelineIndex != null) {
602
+ idx = p.timelineIndex;
603
+ pickedBy = 'timelineIndex';
604
+ } else {
605
+ idx = containerInfo.findIndex((c) => c.kind === 'timeline');
606
+ pickedBy = idx >= 0 ? 'first timeline in the pool' : 'first container (pool carries no kinds)';
607
+ if (idx < 0) idx = 0;
608
+ }
583
609
  if (idx >= seqEntries.length) {
584
610
  return { error: `timelineIndex ${idx} out of range (${seqEntries.length} SeqContainers)` };
585
611
  }
@@ -674,6 +700,9 @@ export const drtTool = {
674
700
  outputPath: p.outputPath,
675
701
  bytes: outBuf.length,
676
702
  sourceSeqContainer: keepEntry,
703
+ pickedBy,
704
+ container: { name: containerInfo[idx].name, kind: containerInfo[idx].kind },
705
+ keptContainers: [...keepContainers].map((e) => ({ entry: e, name: (containerInfo.find((c) => c.entry === e) || {}).name ?? null })),
677
706
  droppedTimelines,
678
707
  note: 'The imported timeline is named after the FILE. Source must be a SAVED project export — ExportProject snapshots the saved DB state, so unsaved edits are absent.',
679
708
  };
@@ -205,4 +205,4 @@ async function parseDRT(drtPathOrBuffer, options = {}) {
205
205
  };
206
206
  }
207
207
 
208
- module.exports = { parseDRT, listSeqContainerEntries };
208
+ module.exports = { parseDRT, listSeqContainerEntries, loadPoolSequenceNames };
@@ -23,6 +23,7 @@ module.exports = {
23
23
  // Canonical SeqContainer-entry matcher (both tool-authored SeqContainer<N>.xml and
24
24
  // real Resolve SeqContainer/<uuid>.xml). Shared so callers don't re-inline the regex.
25
25
  listSeqContainerEntries: drtParser.listSeqContainerEntries,
26
+ loadPoolSequenceNames: drtParser.loadPoolSequenceNames,
26
27
 
27
28
  // Resolve version registry + retargeting (re-stamp to a target Resolve version).
28
29
  // The registry + re-stamp core are universal across DRT/DRP/DRX (same version stamp);
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
87
87
  handlers=[logging.StreamHandler()],
88
88
  )
89
89
 
90
- VERSION = "2.181.0"
90
+ VERSION = "2.182.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.181.0"
14
+ VERSION = "2.182.0"
15
15
 
16
16
  import base64
17
17
  import os