davinci-resolve-mcp 4.19.1 → 4.19.2
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 +12 -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/embeddings.py +46 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.19.2 — Media analysis says whether CLAP audio embedding actually works
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`audio.verified` and `audio.last_error` in the embedding capabilities.** `audio.available` only means the packages import, which is how #343 reported `clap_audio` as available while no embedding call had ever succeeded. `verified` is true once an embedding call has succeeded in this process. `last_error` is the most recent failure of one, and the next success clears it.
|
|
10
|
+
- **`probe_audio_backend()`** runs one real audio embedding (a second of silence) and one text embedding, and fills those two fields. It loads the model, so the first call may download it. Capability detection never runs it.
|
|
11
|
+
|
|
12
|
+
### Not changed
|
|
13
|
+
|
|
14
|
+
- `audio.available` keeps its import-level meaning.
|
|
15
|
+
- Nothing calls the probe from a tool yet; it is a library function. Covered by mocked tests only: not run against a real model or a real transformers 5.x install. No Resolve behavior changed.
|
|
16
|
+
|
|
5
17
|
## What's New in v4.19.1 — CLAP audio embeddings work on transformers 5.x
|
|
6
18
|
|
|
7
19
|
### Fixed
|
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.19.
|
|
15
|
+
> 本翻译对应 v4.19.2 版 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.19.
|
|
40
|
+
VERSION = "4.19.2"
|
|
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 = "4.19.
|
|
96
|
+
VERSION = "4.19.2"
|
|
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
package/src/utils/embeddings.py
CHANGED
|
@@ -51,6 +51,10 @@ _EMBED_TIMEOUT_SECONDS = 120.0
|
|
|
51
51
|
_ST_MODEL = None
|
|
52
52
|
_CLIP_STATE: Optional[Tuple[Any, Any, Any]] = None # (model, preprocess, torch)
|
|
53
53
|
_CLAP_STATE: Optional[Tuple[str, Any]] = None # (backend, state)
|
|
54
|
+
# What this process has actually observed of the audio backend. ``available``
|
|
55
|
+
# only means the packages import; these say whether an embedding call worked.
|
|
56
|
+
_CLAP_VERIFIED = False
|
|
57
|
+
_CLAP_LAST_ERROR: Optional[str] = None
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
def _now() -> str:
|
|
@@ -189,6 +193,11 @@ def detect_embedding_capabilities() -> Dict[str, Any]:
|
|
|
189
193
|
"backends": audio_backends,
|
|
190
194
|
"model": CLAP_HF_MODEL if audio_backends else None,
|
|
191
195
|
"ffmpeg": ffmpeg_available,
|
|
196
|
+
# ``available`` is import-level only. ``verified`` is True once an
|
|
197
|
+
# embedding call has succeeded in this process; ``last_error`` is
|
|
198
|
+
# the most recent failure of one (cleared by the next success).
|
|
199
|
+
"verified": _CLAP_VERIFIED,
|
|
200
|
+
"last_error": _CLAP_LAST_ERROR,
|
|
192
201
|
},
|
|
193
202
|
"install_guidance": guidance,
|
|
194
203
|
}
|
|
@@ -391,6 +400,38 @@ def _clap_process_audio(processor: Any, waveforms: List[Any]) -> Any:
|
|
|
391
400
|
return processor(audios=waveforms, **kwargs)
|
|
392
401
|
|
|
393
402
|
|
|
403
|
+
def _clap_record(error: Optional[BaseException]) -> None:
|
|
404
|
+
global _CLAP_VERIFIED, _CLAP_LAST_ERROR
|
|
405
|
+
if error is None:
|
|
406
|
+
_CLAP_VERIFIED, _CLAP_LAST_ERROR = True, None
|
|
407
|
+
else:
|
|
408
|
+
_CLAP_VERIFIED, _CLAP_LAST_ERROR = False, f"{type(error).__name__}: {error}"
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
def probe_audio_backend() -> Dict[str, Any]:
|
|
412
|
+
"""Run one real CLAP embedding on a second of silence.
|
|
413
|
+
|
|
414
|
+
Loads the model (the first call may download it), so it is never run by
|
|
415
|
+
``detect_embedding_capabilities``. The outcome lands in that report's
|
|
416
|
+
``audio.verified`` / ``audio.last_error``.
|
|
417
|
+
"""
|
|
418
|
+
caps = detect_embedding_capabilities()["audio"]
|
|
419
|
+
if not caps["available"]:
|
|
420
|
+
return {"success": False, "error": "No audio-embedding backend available"}
|
|
421
|
+
try:
|
|
422
|
+
import numpy as np
|
|
423
|
+
|
|
424
|
+
vectors, model = _clap_audio_vectors([np.zeros(CLAP_SAMPLE_RATE, dtype=np.float32)])
|
|
425
|
+
except Exception as exc: # noqa: BLE001
|
|
426
|
+
_clap_record(exc)
|
|
427
|
+
return {"success": False, "error": _CLAP_LAST_ERROR}
|
|
428
|
+
text = embed_text_for_audio_query("probe") # records its own outcome
|
|
429
|
+
if not text.get("success"):
|
|
430
|
+
return {"success": False, "error": text.get("error")}
|
|
431
|
+
_clap_record(None)
|
|
432
|
+
return {"success": True, "model": model, "dimensions": len(vectors[0])}
|
|
433
|
+
|
|
434
|
+
|
|
394
435
|
def _clap_audio_vectors(waveforms: List[Any]) -> Tuple[List[List[float]], str]:
|
|
395
436
|
backend, state = _clap_state()
|
|
396
437
|
if backend == "transformers_clap":
|
|
@@ -443,7 +484,9 @@ def embed_audio_windows(file_path: str, windows: List[Tuple[float, float]]) -> D
|
|
|
443
484
|
try:
|
|
444
485
|
vectors, model = _clap_audio_vectors(waveforms)
|
|
445
486
|
except Exception as exc: # noqa: BLE001 — backend failures surface as data
|
|
487
|
+
_clap_record(exc)
|
|
446
488
|
return {"success": False, "error": f"{type(exc).__name__}: {exc}"}
|
|
489
|
+
_clap_record(None)
|
|
447
490
|
return {
|
|
448
491
|
"success": True,
|
|
449
492
|
"vectors": [vectors[slot] if slot is not None else None for slot in slots],
|
|
@@ -471,11 +514,14 @@ def embed_text_for_audio_query(text: str) -> Dict[str, Any]:
|
|
|
471
514
|
with torch.no_grad():
|
|
472
515
|
features = _clap_embedding_tensor(model.get_text_features(**inputs))
|
|
473
516
|
features = features / features.norm(dim=-1, keepdim=True)
|
|
517
|
+
_clap_record(None)
|
|
474
518
|
return {"success": True, "vector": [float(x) for x in features[0].tolist()],
|
|
475
519
|
"model": f"transformers_clap:{CLAP_HF_MODEL}"}
|
|
476
520
|
vectors = state.get_text_embedding([str(text), ""], use_tensor=False)
|
|
521
|
+
_clap_record(None)
|
|
477
522
|
return {"success": True, "vector": [float(x) for x in vectors[0]], "model": "laion_clap:default"}
|
|
478
523
|
except Exception as exc: # noqa: BLE001
|
|
524
|
+
_clap_record(exc)
|
|
479
525
|
return {"success": False, "error": f"{type(exc).__name__}: {exc}"}
|
|
480
526
|
|
|
481
527
|
|