davinci-resolve-mcp 4.1.0 → 4.1.1
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 +40 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/install.py +1 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +1 -1
- package/src/utils/execution_lifecycle.py +52 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
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.1.1 — drift detection stops comparing two different timelines
|
|
6
|
+
|
|
7
|
+
Reported by @V2arK (#224), with the root cause correctly diagnosed in the report.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`project_manager.load` emitted a drift warning for an edit that never
|
|
12
|
+
happened.** `DriftDetectionHook` compared `pre_state["duration_frames"]`
|
|
13
|
+
against the post-state's with no check that the two described the same
|
|
14
|
+
timeline — and `load` is not in `_DURATION_ALTERING_ACTIONS`, so a project
|
|
15
|
+
switch took the "unexpected drift" branch by construction. Switching from a
|
|
16
|
+
120-frame timeline in one project to a 17854-frame timeline in another
|
|
17
|
+
reported a drift of 17734 frames during an action that edited nothing.
|
|
18
|
+
|
|
19
|
+
This is the failure the verification layer exists to prevent, occurring
|
|
20
|
+
inside the verification layer: an agent reading the envelope was told an edit
|
|
21
|
+
had corrupted a timeline when no edit had occurred, and the README is
|
|
22
|
+
explicit that a confident wrong answer is worse than no answer.
|
|
23
|
+
|
|
24
|
+
- **The check is now on identity, not on an action allow-list.** The hook skips
|
|
25
|
+
the comparison when `project_name` or `timeline_name` moved between pre- and
|
|
26
|
+
post-state — both of which the state provider already reported and the hook
|
|
27
|
+
simply ignored. Identity was chosen over adding `load` to a list because the
|
|
28
|
+
set of actions that can replace the current timeline is open-ended (`load`,
|
|
29
|
+
`create`, `set_current`, anything that closes a project) while the question —
|
|
30
|
+
does the baseline still refer to what we measured? — is the same for all of
|
|
31
|
+
them. The reporter suggested both directions; this is the more general one.
|
|
32
|
+
|
|
33
|
+
- **The reset is reported, not silently omitted.** The hook returns
|
|
34
|
+
`drift_detected: false` with `baseline_reset: true`, the key that moved, and
|
|
35
|
+
a notice, rather than returning nothing. No drift record is indistinguishable
|
|
36
|
+
from "not checked"; this says the check ran and the baseline stopped
|
|
37
|
+
applying.
|
|
38
|
+
|
|
39
|
+
The case the hook exists for is unaffected: same project, same timeline,
|
|
40
|
+
duration moved under a non-duration-altering action still reports drift, and
|
|
41
|
+
a state with no identity keys at all still compares durations rather than
|
|
42
|
+
silently disabling itself. All three are covered by tests, and the two new
|
|
43
|
+
ones fail without the change.
|
|
44
|
+
|
|
5
45
|
## What's New in v4.1.0 — `timeline_markers add` can be previewed, and "false" stops meaning true
|
|
6
46
|
|
|
7
47
|
Contributed by @Rohitkanithi (#218), adapted onto v4.0.0.
|
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
|
-
> 本翻译对应 v4.1.
|
|
15
|
+
> 本翻译对应 v4.1.1 版 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.1.
|
|
40
|
+
VERSION = "4.1.1"
|
|
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
|
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
|
|
|
87
87
|
handlers=[logging.StreamHandler()],
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
VERSION = "4.1.
|
|
90
|
+
VERSION = "4.1.1"
|
|
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
|
@@ -541,9 +541,44 @@ class DriftDetectionHook(LifecycleHook):
|
|
|
541
541
|
"delete_clips", "cut_clip", "delete_item", "ripple_trim"
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
+
#: Identity keys that make a duration comparable. If either of these moved,
|
|
545
|
+
#: the two durations describe different timelines and their difference is
|
|
546
|
+
#: not drift.
|
|
547
|
+
_IDENTITY_KEYS = ("project_name", "timeline_name")
|
|
548
|
+
|
|
544
549
|
def __init__(self, state_provider: Optional[Callable[[], Optional[Dict[str, Any]]]] = None):
|
|
545
550
|
self._state_provider = state_provider
|
|
546
551
|
|
|
552
|
+
@classmethod
|
|
553
|
+
def _baseline_identity_changed(
|
|
554
|
+
cls, pre_state: Dict[str, Any], post_state: Dict[str, Any]
|
|
555
|
+
) -> Optional[str]:
|
|
556
|
+
"""Name the identity key that moved, or None if the baseline still holds.
|
|
557
|
+
|
|
558
|
+
A duration delta only means drift when both numbers describe the same
|
|
559
|
+
timeline. Actions that *replace* the current timeline rather than modify
|
|
560
|
+
it -- `project_manager.load` most obviously -- leave a pre-state
|
|
561
|
+
measuring one project's timeline and a post-state measuring another's.
|
|
562
|
+
Comparing them reports a large unexpected drift for a call during which
|
|
563
|
+
nothing was edited at all.
|
|
564
|
+
|
|
565
|
+
That is the failure this layer exists to prevent, occurring inside the
|
|
566
|
+
layer itself: the README is explicit that a confident wrong answer is
|
|
567
|
+
worse than no answer, and an agent reading the envelope is told an edit
|
|
568
|
+
corrupted a timeline when no edit happened.
|
|
569
|
+
|
|
570
|
+
Identity is checked rather than the action being allow-listed, because
|
|
571
|
+
the set of actions that can swap the current timeline is open-ended
|
|
572
|
+
(`load`, `create`, `set_current`, anything that closes a project) while
|
|
573
|
+
the question -- does the baseline still refer to the thing we measured?
|
|
574
|
+
-- is the same for all of them.
|
|
575
|
+
"""
|
|
576
|
+
for key in cls._IDENTITY_KEYS:
|
|
577
|
+
before, after = pre_state.get(key), post_state.get(key)
|
|
578
|
+
if before is not None and after is not None and before != after:
|
|
579
|
+
return key
|
|
580
|
+
return None
|
|
581
|
+
|
|
547
582
|
def after_tool_call(
|
|
548
583
|
self, ctx: ToolCallContext, result: Any, duration_ms: int
|
|
549
584
|
) -> Optional[Dict[str, Any]]:
|
|
@@ -556,6 +591,23 @@ class DriftDetectionHook(LifecycleHook):
|
|
|
556
591
|
return None
|
|
557
592
|
ctx.post_state = post_state
|
|
558
593
|
|
|
594
|
+
moved = self._baseline_identity_changed(ctx.pre_state, post_state)
|
|
595
|
+
if moved:
|
|
596
|
+
# Say so explicitly rather than returning None. "No drift
|
|
597
|
+
# record" is indistinguishable from "not checked"; this reports
|
|
598
|
+
# that the check ran and the baseline stopped applying.
|
|
599
|
+
return {
|
|
600
|
+
"drift_detected": False,
|
|
601
|
+
"baseline_reset": True,
|
|
602
|
+
"reset_on": moved,
|
|
603
|
+
"notice": (
|
|
604
|
+
f"Drift not evaluated: {moved} changed from "
|
|
605
|
+
f"{ctx.pre_state.get(moved)!r} to {post_state.get(moved)!r} "
|
|
606
|
+
f"during '{ctx.action}', so the pre-state duration is no "
|
|
607
|
+
"longer a baseline for the post-state duration."
|
|
608
|
+
),
|
|
609
|
+
}
|
|
610
|
+
|
|
559
611
|
pre_dur = ctx.pre_state.get("duration_frames")
|
|
560
612
|
post_dur = post_state.get("duration_frames")
|
|
561
613
|
|