davinci-resolve-mcp 5.2.3 → 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 +28 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/docs/kernels/timeline-conform-interchange-kernel.md +1 -1
- package/install.py +1 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +30 -3
- package/src/utils/resolve_bridge_client.py +13 -2
- package/src/utils/resolve_bridge_ops.py +16 -0
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 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
|
+
|
|
21
|
+
## What's New in v5.2.4 — The round-trip probe leaves the current timeline alone
|
|
22
|
+
|
|
23
|
+
From #364 by @Wintch.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **`timeline` `probe_interchange_roundtrip` changed which timeline was current.** Resolve makes an imported timeline current, and deleting it leaves Resolve to pick another one, in practice the last in the list. The probe never switched back, so a later call on "the current timeline" could edit a different timeline. The bug was invisible whenever the starting timeline was already last. The probe now makes the starting timeline current again after cleanup, after a failed import, and with `cleanup_imported: false`, and confirms the switch by reading it back, as #344 did for other timeline switches. A new `current_timeline` field reports `restored`, with an error and the readback when the switch did not take.
|
|
28
|
+
|
|
29
|
+
### Not verified here
|
|
30
|
+
|
|
31
|
+
- Unit-tested with a fake project that behaves as the report describes. Not run against Resolve on this machine.
|
|
32
|
+
|
|
5
33
|
## What's New in v5.2.3 — SetPosition and MoveItems take a position dict
|
|
6
34
|
|
|
7
35
|
From the re-measurement in #336 by @CaptRauti. No server behaviour changes.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#server-modes)
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#服务器模式)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
|
|
15
|
-
> 本翻译对应 v5.2.
|
|
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
|
|
|
@@ -34,7 +34,7 @@ All actions are exposed through `timeline`.
|
|
|
34
34
|
| `export_timeline_checked` | Resolve export aliases and guard timeline export paths to temp locations by default. |
|
|
35
35
|
| `import_timeline_checked` | Guard timeline imports from temp locations and normalize import options. |
|
|
36
36
|
| `compare_timelines` | Compare current timeline to another timeline or two supplied snapshots. |
|
|
37
|
-
| `probe_interchange_roundtrip` | Export, import, compare, and optionally delete the imported timeline. |
|
|
37
|
+
| `probe_interchange_roundtrip` | Export, import, compare, and optionally delete the imported timeline, then make the starting timeline current again. |
|
|
38
38
|
| `detect_missing_media` | Detect missing/offline media using Resolve status fields and file-path existence, with a sanitized diagnosis block for mounted-volume/folder/file failure modes. |
|
|
39
39
|
| `build_relink_plan` | Read-only, bounded search-root scan for relink candidates by missing file basename. Skips broad scans by default when the source volume is not mounted. |
|
|
40
40
|
| `conform_boundary_report` | Return capabilities, timeline structure, gaps/overlaps, source ranges, and missing-media summary. |
|
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.
|
|
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
package/src/granular/common.py
CHANGED
|
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
|
|
|
93
93
|
handlers=[logging.StreamHandler()],
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
VERSION = "5.2.
|
|
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.
|
|
14
|
+
VERSION = "5.2.5"
|
|
15
15
|
|
|
16
16
|
import base64
|
|
17
17
|
import os
|
|
@@ -9609,6 +9609,29 @@ def _probe_interchange_roundtrip(proj, mp, tl, p: Dict[str, Any]):
|
|
|
9609
9609
|
import_path = export_result.get("primary_file") or export_result.get("path") or path
|
|
9610
9610
|
import_options = dict(p.get("import_options") or {})
|
|
9611
9611
|
requested_key = str(spec["requested"]).lower()
|
|
9612
|
+
# Resolve makes an imported timeline current, and deleting it leaves Resolve
|
|
9613
|
+
# to pick another (in practice the last in the list). The probe only reads,
|
|
9614
|
+
# so it puts back whatever was current when it started, and proves it, before
|
|
9615
|
+
# every return from here on (#364).
|
|
9616
|
+
try:
|
|
9617
|
+
original_current = proj.GetCurrentTimeline()
|
|
9618
|
+
except Exception:
|
|
9619
|
+
original_current = None
|
|
9620
|
+
|
|
9621
|
+
def _restore_current():
|
|
9622
|
+
if original_current is None:
|
|
9623
|
+
return {"restored": None, "reason": "no current timeline when the probe started"}
|
|
9624
|
+
ok, detail = _resolve_writes.set_current_timeline(proj, original_current)
|
|
9625
|
+
if ok:
|
|
9626
|
+
return {"restored": True}
|
|
9627
|
+
logger.warning("probe_interchange_roundtrip could not restore the current timeline: %s", detail)
|
|
9628
|
+
return {"restored": False,
|
|
9629
|
+
"error": ("The round-trip probe could not make the timeline that was current "
|
|
9630
|
+
f"when it started ({detail.get('wanted_timeline_id')!r}) current again; "
|
|
9631
|
+
f"the current timeline is {detail.get('current_timeline_id')!r}. "
|
|
9632
|
+
"Set it before any call that works on the current timeline."),
|
|
9633
|
+
"state": detail}
|
|
9634
|
+
|
|
9612
9635
|
if "drt" not in requested_key:
|
|
9613
9636
|
import_options.setdefault("timelineName", p.get("imported_timeline_name", f"{tl.GetName()} {spec['requested']} Roundtrip"))
|
|
9614
9637
|
import_options.setdefault("importSourceClips", _coerce_bool(p.get("import_source_clips"), False))
|
|
@@ -9622,7 +9645,8 @@ def _probe_interchange_roundtrip(proj, mp, tl, p: Dict[str, Any]):
|
|
|
9622
9645
|
},
|
|
9623
9646
|
)
|
|
9624
9647
|
if import_result.get("error") or not import_result.get("success"):
|
|
9625
|
-
return {"success": False, "stage": "import", "export": export_result, "import": import_result
|
|
9648
|
+
return {"success": False, "stage": "import", "export": export_result, "import": import_result,
|
|
9649
|
+
"current_timeline": _restore_current()}
|
|
9626
9650
|
imported_tl = None
|
|
9627
9651
|
if import_result.get("id"):
|
|
9628
9652
|
imported_tl, _ = _timeline_by_selector(proj, {"right_timeline_id": import_result["id"]}, prefix="right")
|
|
@@ -9640,6 +9664,7 @@ def _probe_interchange_roundtrip(proj, mp, tl, p: Dict[str, Any]):
|
|
|
9640
9664
|
"import": import_result,
|
|
9641
9665
|
"comparison": comparison,
|
|
9642
9666
|
"cleanup": cleanup_result,
|
|
9667
|
+
"current_timeline": _restore_current(),
|
|
9643
9668
|
}
|
|
9644
9669
|
|
|
9645
9670
|
|
|
@@ -27897,7 +27922,9 @@ def timeline(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str,
|
|
|
27897
27922
|
first with the advanced MCP drt.list_sequences / editorial.list_sequences to get
|
|
27898
27923
|
[{id, name, eventCount}] for a "which sequence?" picker. Requires Resolve open.
|
|
27899
27924
|
compare_timelines(right_timeline_id?|right_timeline_index?|left_snapshot?, right_snapshot?) -> {match, differences}
|
|
27900
|
-
probe_interchange_roundtrip(format?, output_dir?, cleanup_imported?) -> {success, export, import, comparison}
|
|
27925
|
+
probe_interchange_roundtrip(format?, output_dir?, cleanup_imported?) -> {success, export, import, comparison, cleanup, current_timeline}
|
|
27926
|
+
Puts back the timeline that was current when it started (the import makes
|
|
27927
|
+
its copy current); current_timeline.restored says whether that took.
|
|
27901
27928
|
detect_missing_media(sanitized?|sanitize_paths?, omit_raw_paths?) -> {missing, missing_count, diagnosis}
|
|
27902
27929
|
build_relink_plan(search_roots, max_depth?, max_seconds?, max_files_scanned?, skip_search_when_volume_missing?, sanitized?) -> {candidates, diagnosis}
|
|
27903
27930
|
conform_boundary_report(...) -> {capabilities, timeline, gaps_overlaps, source_ranges, missing_media}
|
|
@@ -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
|
-
|
|
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
|
|