davinci-resolve-mcp 2.23.0
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/AGENTS.md +85 -0
- package/CHANGELOG.md +802 -0
- package/CLAUDE.md +15 -0
- package/LICENSE +21 -0
- package/README.md +159 -0
- package/SECURITY.md +53 -0
- package/bin/davinci-resolve-mcp.mjs +376 -0
- package/docs/README.md +56 -0
- package/docs/SKILL.md +1145 -0
- package/docs/authoring/fuse-dctl-authoring.md +242 -0
- package/docs/authoring/script-plugin-authoring.md +195 -0
- package/docs/contributing.md +82 -0
- package/docs/guides/color-decision-guide.md +387 -0
- package/docs/guides/editorial-decision-guide.md +136 -0
- package/docs/guides/media-analysis-guide.md +615 -0
- package/docs/guides/multicam-setup-guide.md +138 -0
- package/docs/install.md +198 -0
- package/docs/integrations/workflow-integrations.md +120 -0
- package/docs/kernels/README.md +28 -0
- package/docs/kernels/audio-fairlight-kernel.md +86 -0
- package/docs/kernels/color-grade-kernel.md +103 -0
- package/docs/kernels/extension-authoring-kernel.md +101 -0
- package/docs/kernels/fusion-composition-kernel.md +91 -0
- package/docs/kernels/media-pool-ingest-kernel.md +147 -0
- package/docs/kernels/project-lifecycle-kernel.md +120 -0
- package/docs/kernels/render-deliver-kernel.md +92 -0
- package/docs/kernels/review-annotation-kernel.md +110 -0
- package/docs/kernels/timeline-conform-interchange-kernel.md +99 -0
- package/docs/kernels/timeline-edit-kernel.md +189 -0
- package/docs/notes/codec-plugin-notes.md +136 -0
- package/docs/notes/dctl-notes.md +234 -0
- package/docs/notes/fusion-template-notes.md +136 -0
- package/docs/notes/lut-notes.md +136 -0
- package/docs/notes/openfx-notes.md +120 -0
- package/docs/process/release-process.md +152 -0
- package/docs/reference/api-coverage.md +488 -0
- package/docs/reference/resolve_scripting_api.txt +1012 -0
- package/examples/README.md +53 -0
- package/examples/markers/README.md +81 -0
- package/examples/media/README.md +94 -0
- package/examples/timeline/README.md +98 -0
- package/install.py +1196 -0
- package/package.json +52 -0
- package/scripts/audit_api_parity.py +275 -0
- package/scripts/live_media_analysis_polish_probe.py +65 -0
- package/src/__init__.py +3 -0
- package/src/analysis_dashboard.py +4936 -0
- package/src/control_panel.py +13 -0
- package/src/granular/__init__.py +17 -0
- package/src/granular/common.py +727 -0
- package/src/granular/folder.py +287 -0
- package/src/granular/gallery.py +306 -0
- package/src/granular/graph.py +309 -0
- package/src/granular/media_pool.py +679 -0
- package/src/granular/media_pool_item.py +852 -0
- package/src/granular/media_storage.py +179 -0
- package/src/granular/project.py +1594 -0
- package/src/granular/resolve_control.py +521 -0
- package/src/granular/timeline.py +1074 -0
- package/src/granular/timeline_item.py +2251 -0
- package/src/resolve_mcp_server.py +43 -0
- package/src/server.py +15691 -0
- package/src/utils/__init__.py +3 -0
- package/src/utils/app_control.py +319 -0
- package/src/utils/audio_fairlight_live_probe.py +263 -0
- package/src/utils/cdl.py +20 -0
- package/src/utils/cloud_operations.py +192 -0
- package/src/utils/color_grade_live_probe.py +444 -0
- package/src/utils/dctl_templates.py +368 -0
- package/src/utils/extension_authoring_live_probe.py +292 -0
- package/src/utils/fuse_templates.py +1968 -0
- package/src/utils/fusion_composition_live_probe.py +284 -0
- package/src/utils/layout_presets.py +333 -0
- package/src/utils/mcp_stdio.py +32 -0
- package/src/utils/media_analysis.py +3618 -0
- package/src/utils/media_analysis_jobs.py +796 -0
- package/src/utils/media_pool_ingest_live_probe.py +592 -0
- package/src/utils/multicam.py +393 -0
- package/src/utils/object_inspection.py +287 -0
- package/src/utils/platform.py +157 -0
- package/src/utils/project_lifecycle_live_probe.py +376 -0
- package/src/utils/project_properties.py +601 -0
- package/src/utils/render_deliver_live_probe.py +384 -0
- package/src/utils/resolve_connection.py +77 -0
- package/src/utils/review_annotation_live_probe.py +352 -0
- package/src/utils/script_templates.py +1193 -0
- package/src/utils/sync_detection.py +887 -0
- package/src/utils/timeline_conform_live_probe.py +280 -0
- package/src/utils/timeline_kernel_live_probe.py +1091 -0
- package/src/utils/timeline_kernel_probe.py +185 -0
- package/src/utils/timeline_title_text.py +87 -0
- package/src/utils/update_check.py +610 -0
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "davinci-resolve-mcp",
|
|
3
|
+
"version": "2.23.0",
|
|
4
|
+
"description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Samuel Gursky <samgursky@gmail.com>",
|
|
7
|
+
"homepage": "https://github.com/samuelgursky/davinci-resolve-mcp#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/samuelgursky/davinci-resolve-mcp.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/samuelgursky/davinci-resolve-mcp/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"davinci-resolve-mcp": "./bin/davinci-resolve-mcp.mjs"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin/",
|
|
21
|
+
"src/**/*.py",
|
|
22
|
+
"docs/**/*.md",
|
|
23
|
+
"docs/reference/resolve_scripting_api.txt",
|
|
24
|
+
"examples/**/*.md",
|
|
25
|
+
"scripts/**/*.py",
|
|
26
|
+
"install.py",
|
|
27
|
+
"README.md",
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"SECURITY.md",
|
|
31
|
+
"AGENTS.md",
|
|
32
|
+
"CLAUDE.md"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"smoke": "node bin/davinci-resolve-mcp.mjs --help && node bin/davinci-resolve-mcp.mjs --version",
|
|
36
|
+
"pack:check": "npm pack --dry-run"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"davinci-resolve",
|
|
40
|
+
"resolve",
|
|
41
|
+
"mcp",
|
|
42
|
+
"model-context-protocol",
|
|
43
|
+
"video-editing",
|
|
44
|
+
"post-production"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18.17"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""API-docs-vs-source parity guard for davinci-resolve-mcp.
|
|
3
|
+
|
|
4
|
+
Catches three regressions that have shipped in past releases:
|
|
5
|
+
|
|
6
|
+
1. **Broken imports** — `from api.X import Y` patterns that crash on first call
|
|
7
|
+
(the bug class fixed in v2.3.2 by removing 25 broken granular tools).
|
|
8
|
+
2. **Undocumented Resolve methods** — wrappers around methods that don't appear
|
|
9
|
+
in `docs/reference/resolve_scripting_api.txt` (the bug class fixed in v2.3.2/v2.3.3
|
|
10
|
+
by removing wrappers for ExportProjectToCloud, AddUserToCloudProject, etc.).
|
|
11
|
+
3. **Documented methods missing from both layers** — Resolve API methods that
|
|
12
|
+
are documented but exposed neither in compound (`src/server.py`) nor
|
|
13
|
+
granular (`src/granular/*.py`).
|
|
14
|
+
|
|
15
|
+
Exit codes: 0 if no issues, 1 if any check fails.
|
|
16
|
+
|
|
17
|
+
Run: `python3 scripts/audit_api_parity.py`
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import re
|
|
23
|
+
import sys
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
from typing import Dict, List, Set, Tuple
|
|
26
|
+
|
|
27
|
+
REPO_ROOT = Path(__file__).resolve().parent.parent
|
|
28
|
+
DOCS_PATH = REPO_ROOT / "docs" / "reference" / "resolve_scripting_api.txt"
|
|
29
|
+
SERVER_PATH = REPO_ROOT / "src" / "server.py"
|
|
30
|
+
GRANULAR_DIR = REPO_ROOT / "src" / "granular"
|
|
31
|
+
|
|
32
|
+
# Class-prefixed methods like Resolve.OpenPage are split into class+method when
|
|
33
|
+
# we extract; the class name comes from the section heading above the method.
|
|
34
|
+
CLASS_HEADING_RE = re.compile(r"^([A-Z][A-Za-z]+)\s*$")
|
|
35
|
+
METHOD_RE = re.compile(r"^\s+([A-Z][A-Za-z0-9_]+)\s*\(")
|
|
36
|
+
|
|
37
|
+
# Methods to ignore in the "missing from both layers" check. These are either:
|
|
38
|
+
# - intrinsic Python object methods we don't want to wrap
|
|
39
|
+
# - methods that exist on multiple classes where one exposure is enough
|
|
40
|
+
# - methods that are documented but optional on older Resolve builds
|
|
41
|
+
IGNORE_METHODS: Set[str] = set()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def parse_documented_methods(docs_path: Path) -> Dict[str, Set[str]]:
|
|
45
|
+
"""Return {class_name: {method_name, ...}}. Skips:
|
|
46
|
+
- standalone sections like 'Cache Mode information' that aren't class headings
|
|
47
|
+
- everything after the 'Deprecated Resolve API Functions' marker
|
|
48
|
+
- everything after the 'Unsupported Resolve API Functions' marker
|
|
49
|
+
"""
|
|
50
|
+
classes: Dict[str, Set[str]] = {}
|
|
51
|
+
current_class: str | None = None
|
|
52
|
+
text = docs_path.read_text()
|
|
53
|
+
# Truncate at the first deprecation marker
|
|
54
|
+
for marker in ("\nDeprecated Resolve API Functions",
|
|
55
|
+
"\nUnsupported Resolve API Functions"):
|
|
56
|
+
idx = text.find(marker)
|
|
57
|
+
if idx != -1:
|
|
58
|
+
text = text[:idx]
|
|
59
|
+
for line in text.splitlines():
|
|
60
|
+
if not line.strip():
|
|
61
|
+
continue
|
|
62
|
+
if not line.startswith(" "):
|
|
63
|
+
m = CLASS_HEADING_RE.match(line)
|
|
64
|
+
if m:
|
|
65
|
+
# Heuristic: class headings are short single words, not section
|
|
66
|
+
# titles like "Looking up Render Settings"
|
|
67
|
+
candidate = m.group(1)
|
|
68
|
+
if len(candidate.split()) == 1:
|
|
69
|
+
current_class = candidate
|
|
70
|
+
classes.setdefault(current_class, set())
|
|
71
|
+
else:
|
|
72
|
+
current_class = None
|
|
73
|
+
continue
|
|
74
|
+
if current_class is None:
|
|
75
|
+
continue
|
|
76
|
+
mm = METHOD_RE.match(line)
|
|
77
|
+
if mm:
|
|
78
|
+
classes[current_class].add(mm.group(1))
|
|
79
|
+
return classes
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def collect_source_text() -> str:
|
|
83
|
+
"""Concatenate every Python file under src/ for substring searches."""
|
|
84
|
+
parts: List[str] = []
|
|
85
|
+
for py_path in (REPO_ROOT / "src").rglob("*.py"):
|
|
86
|
+
if "__pycache__" in py_path.parts:
|
|
87
|
+
continue
|
|
88
|
+
try:
|
|
89
|
+
parts.append(py_path.read_text())
|
|
90
|
+
except (OSError, UnicodeDecodeError):
|
|
91
|
+
continue
|
|
92
|
+
return "\n".join(parts)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def find_broken_api_imports() -> List[Tuple[Path, int, str]]:
|
|
96
|
+
"""Find any `from api.X import Y` lines (the v2.3.2 bug class)."""
|
|
97
|
+
hits: List[Tuple[Path, int, str]] = []
|
|
98
|
+
pattern = re.compile(r"^\s*from\s+api\.\w+\s+import\s+")
|
|
99
|
+
for py_path in (REPO_ROOT / "src").rglob("*.py"):
|
|
100
|
+
if "__pycache__" in py_path.parts:
|
|
101
|
+
continue
|
|
102
|
+
try:
|
|
103
|
+
for i, line in enumerate(py_path.read_text().splitlines(), 1):
|
|
104
|
+
if pattern.search(line):
|
|
105
|
+
hits.append((py_path.relative_to(REPO_ROOT), i, line.strip()))
|
|
106
|
+
except (OSError, UnicodeDecodeError):
|
|
107
|
+
continue
|
|
108
|
+
return hits
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def find_methods_missing_from_source(
|
|
112
|
+
docs: Dict[str, Set[str]],
|
|
113
|
+
source_text: str,
|
|
114
|
+
) -> Dict[str, Set[str]]:
|
|
115
|
+
"""For each class.method documented in the API, return those whose
|
|
116
|
+
method name does not appear in any src/*.py file at all.
|
|
117
|
+
|
|
118
|
+
This is a coarse check (substring match) — it will not catch overload gaps
|
|
119
|
+
or incomplete dict-key forwarding. Those are checked separately at
|
|
120
|
+
development time, not in CI.
|
|
121
|
+
"""
|
|
122
|
+
missing: Dict[str, Set[str]] = {}
|
|
123
|
+
for cls, methods in docs.items():
|
|
124
|
+
for method in methods:
|
|
125
|
+
if method in IGNORE_METHODS:
|
|
126
|
+
continue
|
|
127
|
+
# A simple but effective signal: look for ".MethodName(" anywhere
|
|
128
|
+
# in src/. Compound dispatchers and granular wrappers both call
|
|
129
|
+
# `obj.MethodName(...)` — so this catches both layers in one pass.
|
|
130
|
+
if f".{method}(" not in source_text:
|
|
131
|
+
missing.setdefault(cls, set()).add(method)
|
|
132
|
+
return missing
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
# Methods that ARE real Resolve API surface but are documented elsewhere
|
|
136
|
+
# (Fusion compositing API, UIManager, internal type-discrimination helpers).
|
|
137
|
+
# These should NOT be flagged as suspicious even though they don't appear
|
|
138
|
+
# in docs/reference/resolve_scripting_api.txt.
|
|
139
|
+
ALLOWLIST_UNDOCUMENTED: Set[str] = {
|
|
140
|
+
# Fusion API (documented in Blackmagic's Fusion scripting docs, not in
|
|
141
|
+
# the Resolve scripting README that ships alongside Resolve)
|
|
142
|
+
"AddTool", "FindTool", "GetTool", "GetToolList", "Delete", "GetAttrs",
|
|
143
|
+
"SetAttrs", "GetCurrentComp", "GetInput", "GetInputList", "GetOutput",
|
|
144
|
+
"GetOutputList", "GetConnectedOutput", "SetInput", "GetKeyFrames",
|
|
145
|
+
"AddKeyframe", "DeleteKeyframe", "ModifyKeyframe", "RemoveKeyFrame",
|
|
146
|
+
"GetKeyframeAtIndex", "GetKeyframeCount", "GetPropertyAtKeyframeIndex",
|
|
147
|
+
"SetKeyframeInterpolation", "Render", "StartUndo",
|
|
148
|
+
# UIManager / Resolve app-control API (documented under UIManager, not
|
|
149
|
+
# the main Resolve scripting README)
|
|
150
|
+
"GetUIManager", "OpenPreferences", "SetHighPriority",
|
|
151
|
+
"OpenProjectSettings", "LoadUILayout", "SaveUILayout",
|
|
152
|
+
# Lua-table iteration helper used as a fallback in object_inspection.py
|
|
153
|
+
"GetKeyList",
|
|
154
|
+
# Project metadata accessor used defensively (hasattr-guarded)
|
|
155
|
+
"GetPath",
|
|
156
|
+
# GetRenderSettings: documented inverse of SetRenderSettings; the docs
|
|
157
|
+
# only show SetRenderSettings explicitly but Resolve exposes the getter.
|
|
158
|
+
"GetRenderSettings",
|
|
159
|
+
# Internal type-discrimination helpers used as guards inside tools
|
|
160
|
+
# (not exposed as user-facing wrappers themselves)
|
|
161
|
+
"GetType", "GetMediaType",
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def find_undocumented_method_wrappers(
|
|
166
|
+
docs: Dict[str, Set[str]],
|
|
167
|
+
source_text: str,
|
|
168
|
+
) -> List[Tuple[str, str, int]]:
|
|
169
|
+
"""Find calls to .MethodName( in source where MethodName is NOT documented
|
|
170
|
+
in any class of the API docs and not in the allowlist. Likely candidates
|
|
171
|
+
for removal.
|
|
172
|
+
|
|
173
|
+
Skips: dunder methods, common Python builtins, snake_case methods (which
|
|
174
|
+
aren't Resolve API), and methods whose names overlap with stdlib/MCP.
|
|
175
|
+
"""
|
|
176
|
+
documented: Set[str] = set()
|
|
177
|
+
for methods in docs.values():
|
|
178
|
+
documented.update(methods)
|
|
179
|
+
documented |= ALLOWLIST_UNDOCUMENTED
|
|
180
|
+
|
|
181
|
+
skip_prefixes = ("Get", "Set", "Is", "Has", "Add", "Delete", "Create", "Update",
|
|
182
|
+
"Load", "Save", "Open", "Close", "Start", "Stop", "Import",
|
|
183
|
+
"Export", "Append", "Remove", "Move", "Copy", "Insert",
|
|
184
|
+
"Replace", "Find", "Reset", "Refresh", "Reveal", "Restore",
|
|
185
|
+
"Convert", "Detect", "Apply", "Render", "Transcribe", "Clear",
|
|
186
|
+
"Link", "Unlink", "Relink", "Sync", "Make", "Build", "Run",
|
|
187
|
+
"Generate", "Cancel", "Pause", "Resume", "Process", "Execute",
|
|
188
|
+
"Validate", "Initialize", "Quit", "Show", "Hide", "Mark",
|
|
189
|
+
"Auto", "Switch", "Assign", "Monitor", "Disable", "Enable",
|
|
190
|
+
"Modify", "Duplicate", "Merge", "Split", "Trim", "Slip",
|
|
191
|
+
"Slide", "Scale", "Rotate", "Flip", "Crop")
|
|
192
|
+
|
|
193
|
+
# Find every .MethodName( call site
|
|
194
|
+
call_pattern = re.compile(r"\.([A-Z][A-Za-z0-9_]+)\(")
|
|
195
|
+
suspicious: List[Tuple[str, str, int]] = []
|
|
196
|
+
seen: Set[str] = set()
|
|
197
|
+
|
|
198
|
+
for py_path in (REPO_ROOT / "src").rglob("*.py"):
|
|
199
|
+
if "__pycache__" in py_path.parts:
|
|
200
|
+
continue
|
|
201
|
+
try:
|
|
202
|
+
for i, line in enumerate(py_path.read_text().splitlines(), 1):
|
|
203
|
+
for m in call_pattern.finditer(line):
|
|
204
|
+
name = m.group(1)
|
|
205
|
+
if name in documented or name in seen:
|
|
206
|
+
continue
|
|
207
|
+
if not any(name.startswith(p) for p in skip_prefixes):
|
|
208
|
+
continue
|
|
209
|
+
seen.add(name)
|
|
210
|
+
suspicious.append((str(py_path.relative_to(REPO_ROOT)), name, i))
|
|
211
|
+
except (OSError, UnicodeDecodeError):
|
|
212
|
+
continue
|
|
213
|
+
return suspicious
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def main() -> int:
|
|
217
|
+
if not DOCS_PATH.exists():
|
|
218
|
+
print(f"FAIL: API docs not found at {DOCS_PATH}", file=sys.stderr)
|
|
219
|
+
return 1
|
|
220
|
+
|
|
221
|
+
docs = parse_documented_methods(DOCS_PATH)
|
|
222
|
+
source_text = collect_source_text()
|
|
223
|
+
|
|
224
|
+
failures = 0
|
|
225
|
+
|
|
226
|
+
print("=" * 70)
|
|
227
|
+
print("Check 1: broken `from api.X import` imports (v2.3.2 bug class)")
|
|
228
|
+
print("=" * 70)
|
|
229
|
+
broken = find_broken_api_imports()
|
|
230
|
+
if broken:
|
|
231
|
+
for path, line_no, snippet in broken:
|
|
232
|
+
print(f" FAIL {path}:{line_no} {snippet}")
|
|
233
|
+
failures += len(broken)
|
|
234
|
+
else:
|
|
235
|
+
print(" OK — no broken api.* imports")
|
|
236
|
+
|
|
237
|
+
print()
|
|
238
|
+
print("=" * 70)
|
|
239
|
+
print("Check 2: documented methods missing from source")
|
|
240
|
+
print("=" * 70)
|
|
241
|
+
missing = find_methods_missing_from_source(docs, source_text)
|
|
242
|
+
if missing:
|
|
243
|
+
for cls in sorted(missing):
|
|
244
|
+
for m in sorted(missing[cls]):
|
|
245
|
+
print(f" MISSING {cls}.{m}")
|
|
246
|
+
failures += 1
|
|
247
|
+
else:
|
|
248
|
+
print(" OK — every documented method appears somewhere in src/")
|
|
249
|
+
|
|
250
|
+
print()
|
|
251
|
+
print("=" * 70)
|
|
252
|
+
print("Check 3: wrappers calling undocumented Resolve methods (advisory)")
|
|
253
|
+
print("=" * 70)
|
|
254
|
+
suspicious = find_undocumented_method_wrappers(docs, source_text)
|
|
255
|
+
if suspicious:
|
|
256
|
+
# Advisory only — these may legitimately be helper methods on non-Resolve
|
|
257
|
+
# objects (e.g., MCP framework, FastMCP). Print but do not count as failure.
|
|
258
|
+
for path, name, line in sorted(set(suspicious))[:30]:
|
|
259
|
+
print(f" REVIEW {path}:{line} .{name}(")
|
|
260
|
+
if len(suspicious) > 30:
|
|
261
|
+
print(f" ... and {len(suspicious) - 30} more (advisory only)")
|
|
262
|
+
else:
|
|
263
|
+
print(" OK — no suspicious method calls")
|
|
264
|
+
|
|
265
|
+
print()
|
|
266
|
+
print("=" * 70)
|
|
267
|
+
if failures:
|
|
268
|
+
print(f"FAIL — {failures} parity issue(s) found")
|
|
269
|
+
return 1
|
|
270
|
+
print("PASS — all checks clean")
|
|
271
|
+
return 0
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
if __name__ == "__main__":
|
|
275
|
+
sys.exit(main())
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Opt-in live probe for media-analysis polish.
|
|
3
|
+
|
|
4
|
+
This script connects to the currently open Resolve project and exercises only
|
|
5
|
+
source-safe planning/review surfaces. It may write analysis artifacts under the
|
|
6
|
+
project analysis root, but it does not import, transcode, proxy, move, rename,
|
|
7
|
+
or write beside source media.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import asyncio
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
|
21
|
+
if str(PROJECT_ROOT) not in sys.path:
|
|
22
|
+
sys.path.insert(0, str(PROJECT_ROOT))
|
|
23
|
+
|
|
24
|
+
from src.server import media_analysis # noqa: E402
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
async def main() -> int:
|
|
28
|
+
parser = argparse.ArgumentParser(description="Run a source-safe live media-analysis polish probe.")
|
|
29
|
+
parser.add_argument("--target", default="project", help="project, selected, bin:<path>, or absolute file path")
|
|
30
|
+
parser.add_argument("--depth", default="standard", choices=["quick", "standard", "deep", "custom"])
|
|
31
|
+
parser.add_argument("--analysis-root", default=None, help="Optional base analysis root; project subdir is still added")
|
|
32
|
+
parser.add_argument("--max-samples", type=int, default=8, help="Marker thumbnail samples for review")
|
|
33
|
+
parser.add_argument("--execute", action="store_true", help="Execute analysis instead of dry-run planning")
|
|
34
|
+
parser.add_argument("--persist", action="store_true", help="Keep executed analysis artifacts under the project root")
|
|
35
|
+
args = parser.parse_args()
|
|
36
|
+
|
|
37
|
+
common = {
|
|
38
|
+
"target": args.target,
|
|
39
|
+
"depth": args.depth,
|
|
40
|
+
"analysis_root": args.analysis_root,
|
|
41
|
+
"dry_run": not args.execute,
|
|
42
|
+
"persist": args.persist,
|
|
43
|
+
"session_only": bool(args.execute and not args.persist),
|
|
44
|
+
"reuse_existing": True,
|
|
45
|
+
"max_analysis_frames": 8,
|
|
46
|
+
"vision": {"enabled": False},
|
|
47
|
+
"transcription": {"enabled": False},
|
|
48
|
+
}
|
|
49
|
+
plan = await media_analysis("plan", common)
|
|
50
|
+
review = await media_analysis("review_timeline_markers", {
|
|
51
|
+
"analysis_root": args.analysis_root,
|
|
52
|
+
"max_samples": args.max_samples,
|
|
53
|
+
"vision": {"enabled": False},
|
|
54
|
+
})
|
|
55
|
+
print(json.dumps({
|
|
56
|
+
"success": bool(plan.get("success")),
|
|
57
|
+
"cwd": os.getcwd(),
|
|
58
|
+
"plan": plan,
|
|
59
|
+
"marker_review": review,
|
|
60
|
+
}, indent=2, ensure_ascii=False))
|
|
61
|
+
return 0 if plan.get("success") else 1
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if __name__ == "__main__":
|
|
65
|
+
raise SystemExit(asyncio.run(main()))
|
package/src/__init__.py
ADDED