davinci-resolve-mcp 5.3.0 → 5.3.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 CHANGED
@@ -2,6 +2,26 @@
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.3.2 — OFX choice and color parameters decode
6
+
7
+ From #383.
8
+
9
+ ### Added
10
+
11
+ - **`extractOFXTools` decodes OFX choice menus and RGB colors.** Before, both came back as `null`. A choice parameter now decodes to `{choice: index}`, and a color to `{rgb: [r, g, b], alpha?}`, from the bytes Resolve 19.1.3 writes in a node's OFX container. Index 0 is stored as an empty field, and a parameter left at its default isn't stored at all, so a missing parameter means "default". Only the raw index is returned; what it means depends on each plugin's own menu.
12
+
13
+ ### Not verified here
14
+
15
+ - Decoding was measured on stills exported from Resolve Studio 19.1.3. No other Resolve version was checked.
16
+
17
+ ## What's New in v5.3.1 — prettier dev-dependency update
18
+
19
+ From #375 (Dependabot).
20
+
21
+ ### Dependencies
22
+
23
+ - **`prettier` 3.9.10 → 3.10.1** in `resolve-advanced` (dev dependency only). No runtime or tool behaviour changes.
24
+
5
25
  ## What's New in v5.3.0 — Writes no longer follow the current timeline to another client's
6
26
 
7
27
  Fixes #382, reported by @willturner-maker.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md) | [繁體中文](README.zh-TW.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.3.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.3.2-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) | 简体中文 | [繁體中文](README.zh-TW.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.3.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.3.2-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.3.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v5.3.2 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
package/README.zh-TW.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | 繁體中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.3.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.3.2-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.3.0 版 README。如與英文原版有出入,以[英文原版](README.md)為準。
15
+ > 本翻譯對應 v5.3.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 = "5.3.0"
40
+ VERSION = "5.3.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -47,6 +47,6 @@
47
47
  "node": ">=20.9"
48
48
  },
49
49
  "devDependencies": {
50
- "prettier": "^3.9.10"
50
+ "prettier": "^3.10.1"
51
51
  }
52
52
  }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * OFX parameter value encodings beyond float64 / int / string: CHOICE menus and
3
+ * RGB colors, as Resolve 19.1.3 writes them in a node's OFX container (measured
4
+ * on stills exported from a node with a choice parameter set to non-default
5
+ * indices, and a color parameter set to 128/255 grey).
6
+ *
7
+ * choice: value F2 -> F4 { F1 = zigzag varint(index) }. Index 0 is stored as an
8
+ * EMPTY F4 (proto3 drops the zero), and a parameter left at its
9
+ * default is not stored at all (no F5 entry).
10
+ * color: value F2 -> F7 { F1, F2, F3 = float32 r, g, b (F4 = a when present) }.
11
+ *
12
+ * Generic: indices and components only. What an index MEANS is the plugin's own
13
+ * menu, which is not this library's business.
14
+ */
15
+ const test = require('node:test');
16
+ const assert = require('node:assert/strict');
17
+
18
+ const { extractOFXTools, _internals } = require('../extract-ofx-params');
19
+
20
+ function encVarint(value) {
21
+ let n = BigInt(value);
22
+ const bytes = [];
23
+ while (n > 0x7fn) {
24
+ bytes.push(Number((n & 0x7fn) | 0x80n));
25
+ n >>= 7n;
26
+ }
27
+ bytes.push(Number(n & 0x7fn));
28
+ return Buffer.from(bytes);
29
+ }
30
+ const tag = (f, w) => encVarint((f << 3) | w);
31
+ const bytesField = (f, buf) => Buffer.concat([tag(f, 2), encVarint(buf.length), buf]);
32
+ const varintField = (f, v) => Buffer.concat([tag(f, 0), encVarint(v)]);
33
+ const f32 = (f, v) => { const b = Buffer.alloc(4); b.writeFloatLE(v); return Buffer.concat([tag(f, 5), b]); };
34
+ const f64 = (f, v) => { const b = Buffer.alloc(8); b.writeDoubleLE(v); return Buffer.concat([tag(f, 1), b]); };
35
+ const zigzag = (n) => (n << 1) ^ (n >> 31);
36
+ const entry = (name, valueBuf) => Buffer.concat([bytesField(1, Buffer.from(name)), bytesField(2, valueBuf)]);
37
+
38
+ test('choice: F2.F4.F1 zigzag varint decodes to {choice: index}', () => {
39
+ // The exact bytes Resolve wrote for index 10: 22 02 08 14.
40
+ assert.deepEqual(Buffer.from('22020814', 'hex'), bytesField(4, varintField(1, zigzag(10))));
41
+ assert.deepEqual(_internals.decodeParamEntry(entry('aspect', Buffer.from('22020814', 'hex'))), { name: 'aspect', value: { choice: 10 } });
42
+ assert.deepEqual(_internals.decodeParamEntry(entry('aspect', Buffer.from('22020820', 'hex'))).value, { choice: 16 });
43
+ });
44
+
45
+ test('choice: an empty F4 is index 0, not "no value"', () => {
46
+ assert.deepEqual(_internals.decodeParamEntry(entry('version', Buffer.from('2200', 'hex'))).value, { choice: 0 });
47
+ });
48
+
49
+ test('color: F2.F7 float32 components decode to {rgb: [r, g, b]}', () => {
50
+ // Resolve's bytes for 128/255 grey: 3a 0f 0d <f32> 15 <f32> 1d <f32>.
51
+ const grey = Buffer.from('3a0f0d8180003f158180003f1d8180003f', 'hex');
52
+ const v = _internals.decodeParamEntry(entry('fill', grey)).value;
53
+ assert.ok(v && Array.isArray(v.rgb) && v.rgb.length === 3);
54
+ for (const c of v.rgb) assert.ok(Math.abs(c - 128 / 255) < 1e-6, `component ${c}`);
55
+ const rgba = bytesField(7, Buffer.concat([f32(1, 1), f32(2, 0.5), f32(3, 0.25), f32(4, 0.75)]));
56
+ assert.deepEqual(_internals.decodeParamEntry(entry('fill', rgba)).value, { rgb: [1, 0.5, 0.25], alpha: 0.75 });
57
+ });
58
+
59
+ test('null controls: float64, int and string values decode as before', () => {
60
+ assert.equal(_internals.decodeParamEntry(entry('scale', f64(2, 90))).value, 90);
61
+ assert.deepEqual(_internals.decodeParamEntry(entry('n', varintField(3, 4))).value, { int: 4 });
62
+ assert.equal(_internals.decodeParamEntry(entry('s', bytesField(5, Buffer.from('x')))).value, 'x');
63
+ // An unknown wrapped field is still "no value", never guessed as a choice or color.
64
+ assert.equal(_internals.decodeParamEntry(entry('u', varintField(9, 1))).value, null);
65
+ });
66
+
67
+ test('end to end: a container with a choice and a color comes back through extractOFXTools', () => {
68
+ const container = Buffer.concat([
69
+ varintField(1, 0x4f4659),
70
+ bytesField(2, Buffer.from('com.example.plugin')),
71
+ bytesField(3, Buffer.from('inst-1')),
72
+ varintField(4, 1),
73
+ bytesField(5, entry('aspect', Buffer.from('22020814', 'hex'))),
74
+ bytesField(5, entry('fill', bytesField(7, Buffer.concat([f32(1, 0.5), f32(2, 0.5), f32(3, 0.5)])))),
75
+ bytesField(5, entry('scale', f64(2, 90))),
76
+ ]);
77
+ const toolEntry = Buffer.concat([varintField(1, 2), bytesField(2, bytesField(21, container))]);
78
+ const tools = extractOFXTools(bytesField(1, toolEntry));
79
+ assert.equal(tools.length, 1);
80
+ assert.deepEqual(tools[0].params, { aspect: { choice: 10 }, fill: { rgb: [0.5, 0.5, 0.5] }, scale: 90 });
81
+ });
@@ -14,13 +14,16 @@
14
14
  * F4 = enabled varint (1)
15
15
  * F5[] = repeated param entries
16
16
  * F1 = param name UTF-8
17
- * F2 = wrapped value: F2 (float64) OR F5 (UTF-8 string)
17
+ * F2 = wrapped value: F2 (float64), F3 (varint int), F5 (UTF-8 string),
18
+ * F4 { F1 = zigzag varint } (CHOICE index; an empty F4 is index 0) or
19
+ * F7 { F1..F3 float32 r,g,b; F4 alpha } (RGB(A) color)
18
20
  *
19
21
  * extractOFXTools(toolListBuf | toolListField) returns
20
22
  * Array<{ pluginId, instanceId, enabled, params: {name: value} }>
21
23
  *
22
- * Each `value` is either a number (when F2.F2 was a float64) or a
23
- * string (when F2.F5 was UTF-8).
24
+ * Each `value` is a number (F2.F2 float64), {int} (F2.F3), a string (F2.F5),
25
+ * {choice: index} (F2.F4) or {rgb: [r,g,b], alpha?} (F2.F7). A choice left at
26
+ * its default is not stored by Resolve at all: absent is "default", not 0.
24
27
  *
25
28
  * P2 coverage: tool IDs beyond Film Grain land in the registry as
26
29
  * AutoResearch lands them. The extractor doesn't depend on the tool ID
@@ -111,6 +114,27 @@ function decodeParamEntry(entryBuf) {
111
114
  value = { int: Number(inn.value) };
112
115
  } else if (inn.fieldNum === 5 && inn.wireType === 2) {
113
116
  value = utf8(inn.value);
117
+ } else if (inn.fieldNum === 4 && inn.wireType === 2) {
118
+ // CHOICE menu: F4 { F1 = zigzag varint(index) }. Index 0 is an EMPTY F4
119
+ // (proto3 drops the zero). Measured on Resolve 19.1.3 stills.
120
+ let index = 0;
121
+ for (const c of readAllFields(inn.value)) {
122
+ if (c.fieldNum === 1 && c.wireType === 0) {
123
+ const z = c.value;
124
+ index = Number((z >> 1n) ^ -(z & 1n));
125
+ }
126
+ }
127
+ value = { choice: index };
128
+ } else if (inn.fieldNum === 7 && inn.wireType === 2) {
129
+ // RGB(A) color: F7 { F1, F2, F3 = float32 r, g, b; F4 = alpha when present }.
130
+ const comp = [0, 0, 0];
131
+ let alpha = null;
132
+ for (const c of readAllFields(inn.value)) {
133
+ if (c.wireType !== 5) continue;
134
+ if (c.fieldNum >= 1 && c.fieldNum <= 3) comp[c.fieldNum - 1] = c.value;
135
+ else if (c.fieldNum === 4) alpha = c.value;
136
+ }
137
+ value = alpha === null ? { rgb: comp } : { rgb: comp, alpha };
114
138
  }
115
139
  }
116
140
  }
@@ -94,7 +94,7 @@ if not logging.getLogger().handlers:
94
94
  handlers=[logging.StreamHandler()],
95
95
  )
96
96
 
97
- VERSION = "5.3.0"
97
+ VERSION = "5.3.2"
98
98
  logger = logging.getLogger("davinci-resolve-mcp")
99
99
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
100
100
  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.3.0"
14
+ VERSION = "5.3.2"
15
15
 
16
16
  import base64
17
17
  import os