davinci-resolve-mcp 4.13.4 → 4.13.6

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,55 @@
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 v4.13.6 — `drt` downgrade stamps the real Resolve build
6
+
7
+ ### Fixed
8
+
9
+ - **`drt(action='downgrade')` (`resolve-advanced/server/tools/drt.mjs`)**: the
10
+ `DbAppVer` stamp was built by padding `targetAppVersion` to four parts, so
11
+ `19.1.3` became `19.1.3.0`, a build no Resolve has ever written. The vendored
12
+ version registry already records the real stamps read from Resolve's own
13
+ exports (19 → `19.1.3.0007` / 14, 20 → `20.3.2.0009` / 15, 21 →
14
+ `21.0.0.0048` / 17), and the vendored retarget path used them, so the two
15
+ re-stamp paths disagreed in every XML member. `DbPrjVer` now comes from an
16
+ explicit `targetProjectVersion`, then the registry row for that major, then
17
+ the known gate map. Resolve 20, which the map never had, now resolves to
18
+ schema 15 instead of throwing. `DbAppVer` comes from an explicit
19
+ `appVersionString`, then the registry row (only when its schema matches the
20
+ one being written), then the old padded form, which is now labelled and
21
+ warned about.
22
+ - The result gains `projectVersionSource`, `appVersionSource`, `registryRow`
23
+ and, when a fallback was used, `warnings`.
24
+
25
+ ### Validation
26
+
27
+ - 6 new cases in `resolve-advanced/test/drt-downgrade.test.mjs`. All 6 fail
28
+ against the previous `drt.mjs`. All `drt*.test.mjs` pass: 42/42.
29
+ - Offline Python suite and the release static checks pass. Offline file
30
+ authoring only; no live Resolve import was run for this change.
31
+
32
+ ## What's New in v4.13.5 — Missing-media diagnosis finds Windows drive and UNC volumes
33
+
34
+ Lands #293 from @AllastorV, case 4 of the Windows failures tracked in #278.
35
+ With #291 and #292, his Windows 11 run of the offline suite is now clean.
36
+
37
+ ### Fixed
38
+
39
+ - **Volume roots (`src/server.py`, `_media_path_volume_root` and
40
+ `_sanitize_media_path`)**: both helpers split on `os.sep`, so they followed
41
+ the OS running the server rather than the path's own form. Neither recognised
42
+ a Windows drive or UNC root. An unplugged card (`E:\DCIM\...`,
43
+ `\\nas\share\...`) never produced `volume_not_mounted`, and the relink plan
44
+ ran a full search instead of saying "mount the volume". On Windows a
45
+ `/Volumes/<name>` path came out as a single part. Both helpers now split on
46
+ `/` and `\`, and treat `X:\` and `\\server\share` as the volume root
47
+ alongside the existing `/Volumes/<name>` rule.
48
+ - Sanitized paths keep the volume and hide the rest, in the path's own
49
+ separator: `E:\...\clip.mov`, `\\nas\share\...\clip.mov`. POSIX output is
50
+ unchanged.
51
+ - New `MediaPathFormTests` use Windows-form fixtures and pure string checks, so
52
+ they run on every platform.
53
+
5
54
  ## What's New in v4.13.4 — Windows: the bridge claims its port exclusively
6
55
 
7
56
  Lands #292 from @AllastorV, case 2 of the Windows failures tracked in #278.
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-4.13.4-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-4.13.6-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-37%20(390%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-4.13.4-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-4.13.6-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-37%20(390%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
- > 本翻译对应 v4.13.4 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v4.13.6 版 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 = "4.13.4"
40
+ VERSION = "4.13.6"
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": "4.13.4",
3
+ "version": "4.13.6",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -128,12 +128,80 @@ function resolveTargetProjectVersion({ targetProjectVersion, targetAppVersion })
128
128
  throw new Error('provide targetProjectVersion (int) or targetAppVersion (e.g. "19.1.3")');
129
129
  }
130
130
 
131
+ /**
132
+ * The verified registry row (vendor/drt-format/resolve-versions.js) for a targetAppVersion, keyed
133
+ * by MAJOR version like the registry's own resolveVersion. null when the major has no row — the
134
+ * caller must then say it fell back, never borrow another version's stamp.
135
+ */
136
+ function registryRowFor(targetAppVersion) {
137
+ if (targetAppVersion === undefined || targetAppVersion === null || targetAppVersion === '') return null;
138
+ const { VERSIONS } = drt().resolveVersions;
139
+ const row = VERSIONS[String(targetAppVersion).split('.')[0]];
140
+ return row || null;
141
+ }
142
+
143
+ /**
144
+ * The gate value and comment stamp a downgrade writes, and where each came from. Precedence:
145
+ * - <ProjectVersion>/DbPrjVer: explicit targetProjectVersion, else the registry row's dbPrjVer,
146
+ * else PROJECT_VERSION_BY_APP (confirmed gate points with no full stamp, e.g. 18 → 11).
147
+ * - DbAppVer: explicit appVersionString, else the registry row's dbAppVer — only when the row's
148
+ * dbPrjVer is the gate being written (a 19 build stamp beside DbPrjVer 11 would be a lie) —
149
+ * else a PADDED fallback ("18.0" → "18.0.0.0") that names no real build and is labelled so.
150
+ */
151
+ function resolveDowngradeStamp(p) {
152
+ const row = registryRowFor(p.targetAppVersion);
153
+ let targetPV;
154
+ let projectVersionSource;
155
+ if (Number.isInteger(p.targetProjectVersion)) {
156
+ targetPV = p.targetProjectVersion;
157
+ projectVersionSource = 'targetProjectVersion';
158
+ } else if (row) {
159
+ targetPV = Number(row.dbPrjVer);
160
+ projectVersionSource = 'registry';
161
+ } else {
162
+ targetPV = resolveTargetProjectVersion(p);
163
+ projectVersionSource = 'version-map';
164
+ }
165
+
166
+ const warnings = [];
167
+ let appVer;
168
+ let appVersionSource;
169
+ if (p.appVersionString) {
170
+ appVer = p.appVersionString;
171
+ appVersionSource = 'appVersionString';
172
+ } else if (row && Number(row.dbPrjVer) === targetPV) {
173
+ appVer = row.dbAppVer;
174
+ appVersionSource = 'registry';
175
+ } else if (p.targetAppVersion) {
176
+ const parts = String(p.targetAppVersion).split('.');
177
+ appVer = `${p.targetAppVersion}${'.0'.repeat(Math.max(0, 4 - parts.length))}`;
178
+ appVersionSource = 'padded-fallback';
179
+ warnings.push(
180
+ row
181
+ ? `DbAppVer "${appVer}" is padded, not a verified build: the registry row for Resolve ${row.marketing} is schema ${row.dbPrjVer}, not the ${targetPV} being written. Pass appVersionString to stamp a real build.`
182
+ : `DbAppVer "${appVer}" is padded, not a verified build: the registry has no row for Resolve ${parts[0]} (known: ${Object.values(drt().resolveVersions.VERSIONS).map((v) => v.marketing).join(', ')}). The gate (<ProjectVersion> ${targetPV}) is unaffected; pass appVersionString to stamp a real build.`,
183
+ );
184
+ } else {
185
+ appVer = `${targetPV}.0.0.0000`;
186
+ appVersionSource = 'placeholder';
187
+ warnings.push(`DbAppVer "${appVer}" is a placeholder (only targetProjectVersion was given). Pass targetAppVersion or appVersionString to stamp a real build.`);
188
+ }
189
+ return {
190
+ targetPV,
191
+ appVer,
192
+ projectVersionSource,
193
+ appVersionSource,
194
+ registryRow: row ? { marketing: row.marketing, dbAppVer: row.dbAppVer, dbPrjVer: row.dbPrjVer } : null,
195
+ warnings,
196
+ };
197
+ }
198
+
131
199
  const downgradeSchema = z.object({
132
200
  drtPath: z.string().describe('Source .drt/.drp (e.g. exported from a newer Resolve)'),
133
201
  outputPath: z.string().describe('Where to write the downgraded file'),
134
202
  targetProjectVersion: z.number().int().optional().describe('On-disk <ProjectVersion> to stamp (overrides targetAppVersion)'),
135
- targetAppVersion: z.string().optional().describe('Target Resolve app version, e.g. "19.1.3" — mapped to ProjectVersion'),
136
- appVersionString: z.string().optional().describe('DbAppVer comment to stamp (default derived from targetAppVersion, else "<v>.0.0.0000")'),
203
+ targetAppVersion: z.string().optional().describe('Target Resolve app version, e.g. "19.1.3" — a major with a verified registry row (19, 20, 21) takes its DbAppVer/DbPrjVer from it; other majors use the ProjectVersion map'),
204
+ appVersionString: z.string().optional().describe('DbAppVer comment to stamp (overrides the registry; default = the verified registry build for targetAppVersion, else a padded fallback, labelled in appVersionSource)'),
137
205
  });
138
206
 
139
207
  /**
@@ -718,10 +786,8 @@ export const drtTool = {
718
786
  }
719
787
  if (action === 'downgrade') {
720
788
  const p = downgradeSchema.parse(args);
721
- const targetPV = resolveTargetProjectVersion(p);
722
- const appVer =
723
- p.appVersionString ||
724
- (p.targetAppVersion ? `${p.targetAppVersion}${'.0'.repeat(Math.max(0, 4 - String(p.targetAppVersion).split('.').length))}` : `${targetPV}.0.0.0000`);
789
+ const stamp = resolveDowngradeStamp(p);
790
+ const { targetPV, appVer } = stamp;
725
791
  const zip = await JSZip.loadAsync(await fs.readFile(p.drtPath));
726
792
  const out = new JSZip();
727
793
  let elementPatches = 0;
@@ -758,6 +824,10 @@ export const drtTool = {
758
824
  bytes: buf.length,
759
825
  targetProjectVersion: targetPV,
760
826
  appVersion: appVer,
827
+ projectVersionSource: stamp.projectVersionSource,
828
+ appVersionSource: stamp.appVersionSource,
829
+ registryRow: stamp.registryRow,
830
+ ...(stamp.warnings.length ? { warnings: stamp.warnings } : {}),
761
831
  projectVersionElementsPatched: elementPatches,
762
832
  commentStampsPatched: stampPatches,
763
833
  note: 'Stamp downgrade clears the import GATE only; verify content imports cleanly (fine clip corrections can drop across a multi-version gap).',
@@ -91,7 +91,7 @@ if not logging.getLogger().handlers:
91
91
  handlers=[logging.StreamHandler()],
92
92
  )
93
93
 
94
- VERSION = "4.13.4"
94
+ VERSION = "4.13.6"
95
95
  logger = logging.getLogger("davinci-resolve-mcp")
96
96
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
97
97
  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 377-tool granular server instead
12
12
  """
13
13
 
14
- VERSION = "4.13.4"
14
+ VERSION = "4.13.6"
15
15
 
16
16
  import base64
17
17
  import os
@@ -8455,29 +8455,48 @@ def _probe_interchange_roundtrip(proj, mp, tl, p: Dict[str, Any]):
8455
8455
  }
8456
8456
 
8457
8457
 
8458
+ _WINDOWS_DRIVE_PATH = re.compile(r"[A-Za-z]:[\\/]")
8459
+
8460
+
8461
+ def _media_path_parts(text: str) -> List[str]:
8462
+ # Resolve stores a path the way the OS that wrote it gave it, and a project
8463
+ # moves between machines, so split on both separators rather than `os.sep`:
8464
+ # a macOS path stays a macOS path when the project opens on Windows (#278).
8465
+ return [part for part in re.split(r"[\\/]", text) if part]
8466
+
8467
+
8458
8468
  def _sanitize_media_path(path: Any, *, keep_filename: bool = True) -> Optional[str]:
8459
8469
  if not path:
8460
8470
  return None
8461
8471
  text = str(path)
8462
- filename = os.path.basename(text.rstrip(os.sep))
8463
- parts = [part for part in text.split(os.sep) if part]
8472
+ parts = _media_path_parts(text)
8473
+ filename = parts[-1] if keep_filename and parts else ""
8464
8474
  if text.startswith("/Volumes/") and len(parts) >= 2:
8465
- root = f"/Volumes/{parts[1]}"
8466
- return f"{root}/.../{filename}" if keep_filename and filename else f"{root}/..."
8467
- if text.startswith(os.sep):
8468
- return f"/.../{filename}" if keep_filename and filename else "/..."
8469
- return f".../{filename}" if keep_filename and filename else "..."
8475
+ prefix, sep = f"/Volumes/{parts[1]}/...", "/"
8476
+ elif text.startswith("\\\\") and len(parts) >= 2:
8477
+ prefix, sep = f"\\\\{parts[0]}\\{parts[1]}\\...", "\\"
8478
+ elif _WINDOWS_DRIVE_PATH.match(text):
8479
+ prefix, sep = f"{text[:2]}\\...", "\\"
8480
+ elif text.startswith(("/", "\\")):
8481
+ prefix, sep = "/...", "/"
8482
+ else:
8483
+ prefix, sep = "...", "/"
8484
+ return f"{prefix}{sep}{filename}" if filename else prefix
8470
8485
 
8471
8486
 
8472
8487
  def _media_path_volume_root(path: Any) -> Optional[str]:
8473
8488
  if not path:
8474
8489
  return None
8475
8490
  text = str(path)
8476
- parts = [part for part in text.split(os.sep) if part]
8491
+ parts = _media_path_parts(text)
8477
8492
  if text.startswith("/Volumes/") and len(parts) >= 2:
8478
8493
  return f"/Volumes/{parts[1]}"
8479
- if text.startswith(os.sep) and parts:
8480
- return os.sep + parts[0]
8494
+ if text.startswith("\\\\") and len(parts) >= 2:
8495
+ return f"\\\\{parts[0]}\\{parts[1]}"
8496
+ if _WINDOWS_DRIVE_PATH.match(text):
8497
+ return f"{text[:2]}\\"
8498
+ if text.startswith(("/", "\\")) and parts:
8499
+ return text[0] + parts[0]
8481
8500
  return None
8482
8501
 
8483
8502