davinci-resolve-mcp 5.2.4 → 5.2.5

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,22 @@
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 v5.2.5 — The bridge keeps number keys in settings dicts
6
+
7
+ From #361 by @Ghoul0718.
8
+
9
+ ### Fixed
10
+
11
+ - **Over the in-app bridge, settings dicts keyed by Resolve's constants reached Resolve with string keys.** The constants are numbers (`resolve.AUDIO_SYNC_MODE` is a float on 21.0.4.5), and JSON object keys are always strings, so `{AUDIO_SYNC_MODE: AUDIO_SYNC_WAVEFORM}` arrived keyed by `"1.0"`. Resolve ignores keys it does not know: `MediaPool.AutoSyncAudio` returned False and linked nothing. The client now sends a dict whose keys are not all strings as key-value pairs, and the bridge rebuilds it with the original keys. Dicts with only string keys go on the wire unchanged. `CreateSubtitlesFromAudio` and the cloud project calls take the same kind of dict.
12
+
13
+ ### Upgrading
14
+
15
+ - The bridge inside Resolve is a copy made at install time. Reinstall it (or reinstall, then call the bridge's `reload`) for this fix to take effect. An older bridge given the new encoding passes the dict through unchanged, so those calls behave as before rather than worse.
16
+
17
+ ### Verified
18
+
19
+ - The contributor's live run on free 21.0.4.5 (macOS): `AutoSyncAudio` returned False with an empty `Synced Audio` on the previous release and True with the audio linked on this one. Not rerun on this machine.
20
+
5
21
  ## What's New in v5.2.4 — The round-trip probe leaves the current timeline alone
6
22
 
7
23
  From #364 by @Wintch.
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-5.2.4-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.5-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-5.2.4-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.5-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
- > 本翻译对应 v5.2.4 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v5.2.5 版 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 = "5.2.4"
40
+ VERSION = "5.2.5"
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": "5.2.4",
3
+ "version": "5.2.5",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
93
93
  handlers=[logging.StreamHandler()],
94
94
  )
95
95
 
96
- VERSION = "5.2.4"
96
+ VERSION = "5.2.5"
97
97
  logger = logging.getLogger("davinci-resolve-mcp")
98
98
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
99
99
  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 = "5.2.4"
14
+ VERSION = "5.2.5"
15
15
 
16
16
  import base64
17
17
  import os
@@ -290,11 +290,22 @@ class BridgeTransport:
290
290
 
291
291
 
292
292
  def _encode_argument(value: Any) -> Any:
293
- """Send a proxy back as the handle it stands for."""
293
+ """Send a proxy back as the handle it stands for.
294
+
295
+ A dict whose keys are not all strings goes as ``{"__pairs__": [[k, v], ...]}``.
296
+ JSON object keys are always strings, so ``{resolve.AUDIO_SYNC_MODE: ...}``
297
+ would otherwise reach Resolve keyed by ``"1.0"`` instead of the constant, and
298
+ Resolve ignores keys it does not recognise (AutoSyncAudio returned False on
299
+ 21.0.4.5 for exactly this reason). The bridge rebuilds the dict with the
300
+ original keys. A dict that itself has a ``"__pairs__"`` key goes the same way,
301
+ so the marker is never ambiguous on the wire.
302
+ """
294
303
  if isinstance(value, BridgeProxy):
295
304
  return {"__handle__": value._handle}
296
305
  if isinstance(value, dict):
297
- return {k: _encode_argument(v) for k, v in value.items()}
306
+ if "__pairs__" not in value and all(isinstance(k, str) for k in value):
307
+ return {k: _encode_argument(v) for k, v in value.items()}
308
+ return {"__pairs__": [[k, _encode_argument(v)] for k, v in value.items()]}
298
309
  if isinstance(value, (list, tuple)):
299
310
  return [_encode_argument(v) for v in value]
300
311
  return value
@@ -593,11 +593,27 @@ class ResolveOperations:
593
593
  handle = value.get("__handle__")
594
594
  if handle is not None:
595
595
  return self._resolve_target(handle)
596
+ if "__pairs__" in value:
597
+ # A dict with non-string keys (see the client's _encode_argument).
598
+ pairs = value["__pairs__"]
599
+ if len(value) != 1 or not isinstance(pairs, list):
600
+ raise OperationError("invalid_arguments", "__pairs__ must be the only key and hold a list")
601
+ return {self._decode_key(pair): self._decode(pair[1]) for pair in pairs}
596
602
  return {k: self._decode(v) for k, v in value.items()}
597
603
  if isinstance(value, list):
598
604
  return [self._decode(v) for v in value]
599
605
  return value
600
606
 
607
+ @staticmethod
608
+ def _decode_key(pair: Any) -> Any:
609
+ """The key of one ``[key, value]`` pair; only JSON scalars can be dict keys."""
610
+ if not (isinstance(pair, list) and len(pair) == 2):
611
+ raise OperationError("invalid_arguments", "a __pairs__ entry must be [key, value]")
612
+ key = pair[0]
613
+ if not (key is None or isinstance(key, (bool, int, float, str))):
614
+ raise OperationError("invalid_arguments", "a __pairs__ key must be a number, string, bool or null")
615
+ return key
616
+
601
617
  def op_call(self, arguments: Dict[str, Any]) -> Any:
602
618
  """Invoke one method on a live Resolve object. See the module docstring.
603
619