conformtools 0.6.13 → 0.6.15
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/README.md +6 -1
- package/dist/account-W7Z2MYZU.js +3 -0
- package/dist/{agent-hook-setup-RTQT5JEN.js → agent-hook-setup-JCIZG3Q3.js} +1 -1
- package/dist/{analysis-engine-UWIK7AYB.js → analysis-engine-DCHJHZ7W.js} +1 -1
- package/dist/{bridge-PWYOJ7E7.js → bridge-RH3JRSBN.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-LZRCXSUJ.js → chunk-4RA57LTJ.js} +1 -1
- package/dist/chunk-63WQRYTJ.js +159 -0
- package/dist/chunk-6KEFHHS6.js +10 -0
- package/dist/{chunk-4VFDGL4E.js → chunk-7NGS2BN7.js} +1 -1
- package/dist/{chunk-BYMCZJBQ.js → chunk-B2KCENY6.js} +1 -1
- package/dist/chunk-DLF5AKXT.js +10 -0
- package/dist/chunk-FLLB6UZJ.js +7 -0
- package/dist/chunk-G7CVRPVA.js +5 -0
- package/dist/chunk-HTRW5GX4.js +510 -0
- package/dist/chunk-IBIAW6IW.js +6 -0
- package/dist/{chunk-G3HBKJ5L.js → chunk-IDJIOKXA.js} +1 -1
- package/dist/chunk-OWWXUNJF.js +7 -0
- package/dist/{chunk-NZLL44HU.js → chunk-QH5DTYSE.js} +1 -1
- package/dist/{chunk-PHAMF4JF.js → chunk-ROGMKTND.js} +2 -2
- package/dist/{chunk-H4BU5WA6.js → chunk-TBU2XWFD.js} +1 -1
- package/dist/{chunk-6WLSIH2N.js → chunk-UAURERD3.js} +1 -1
- package/dist/{chunk-7W5AFZYX.js → chunk-UKXSKFL3.js} +1 -1
- package/dist/{chunk-L3HRAIDR.js → chunk-VERTA23P.js} +1 -1
- package/dist/{chunk-EP4L2BWV.js → chunk-VETHR2O7.js} +1 -1
- package/dist/chunk-X527E5VI.js +3 -0
- package/dist/{chunk-4BTTR6U3.js → chunk-XVZ7KJRI.js} +5 -5
- package/dist/{claude-setup-NGZ5NDYH.js → claude-setup-CM7G2YSG.js} +8 -8
- package/dist/cli.js +2 -2
- package/dist/demo-engine-WXNT4Y7S.js +3 -0
- package/dist/engine-HXZCA42S.js +5 -0
- package/dist/framing-HVUDKTZG.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-JI62TU4W.js → h264-MAUVJTR4.js} +1 -1
- package/dist/{h264-mxf-J2QPZO4U.js → h264-mxf-2O4SAUTA.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/{host-relink-76CFY32O.js → host-relink-RI3JEY4M.js} +1 -1
- package/dist/hosted-2XACQY7J.js +3 -0
- package/dist/hosts-QW64CIJU.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-U656APGR.js → inspect-NUS3XAJH.js} +2 -2
- package/dist/isobmff-MTMGQKLK.js +3 -0
- package/dist/{mc-video-LSTKUKNL.js → mc-video-HRZC7HGH.js} +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{media-XBNKYKB7.js → media-WC4ZVKIL.js} +1 -1
- package/dist/{mxf-ZL57VJ3C.js → mxf-J5QHA3VY.js} +1 -1
- package/dist/{ops-ZQEQXW2N.js → ops-XIUVNJE2.js} +1 -1
- package/dist/probe-GIAKRPFV.js +3 -0
- package/dist/{r3d-R4TLYJVE.js → r3d-2PCOFR2Z.js} +1 -1
- package/dist/resolve-bridge.py +116 -146
- package/dist/{sequence-patch-C2QRIT5V.js → sequence-patch-DFGEAJGB.js} +1 -1
- package/dist/{store-JNWELX35.js → store-WZHNO43A.js} +1 -1
- package/dist/timeline-NOTHRTAT.js +3 -0
- package/package.json +5 -5
- package/dist/account-F54SG45Q.js +0 -3
- package/dist/chunk-B54TEGMG.js +0 -5
- package/dist/chunk-BTS3DFPD.js +0 -7
- package/dist/chunk-ERUN634Q.js +0 -6
- package/dist/chunk-I2Y2P5NH.js +0 -7
- package/dist/chunk-J43UCJ6G.js +0 -4
- package/dist/chunk-LKQTE6T5.js +0 -158
- package/dist/chunk-LRGA6QJQ.js +0 -514
- package/dist/chunk-OD445COC.js +0 -7
- package/dist/chunk-XI6XF7FQ.js +0 -3
- package/dist/chunk-Y455Y6V4.js +0 -10
- package/dist/engine-6ACEWA4S.js +0 -5
- package/dist/framing-P5RGN5V3.js +0 -3
- package/dist/hosted-L26AGRIY.js +0 -3
- package/dist/hosts-TBHEPV6A.js +0 -3
- package/dist/isobmff-UISATYUR.js +0 -3
- package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +0 -44
- package/dist/nuke/panel/python/conformtools_nuke/__init__.py +0 -10
- package/dist/nuke/panel/python/conformtools_nuke/panel.py +0 -217
- package/dist/nuke/panel/python/conformtools_nuke/verbs.py +0 -837
- package/dist/probe-ZDX6XNRF.js +0 -3
- package/dist/resolve-presets/conform.tools.xml +0 -127
- package/dist/timeline-JONFBIA3.js +0 -3
package/dist/resolve-bridge.py
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
Resolve's scripting API exists only for Python and Lua, so this file is the one place the engine
|
|
7
7
|
speaks it. It is glue, not know-how: every decision (what to import, what to render, what the
|
|
8
8
|
findings mean) is made in TypeScript; this file performs one host action and reports exactly what
|
|
9
|
-
Resolve said.
|
|
10
|
-
the next one.
|
|
9
|
+
Resolve said. `bridge.py serve` keeps one process connected (the engine's default: adapter.ts); a call
|
|
10
|
+
that hangs gets the process killed and the next call starts a fresh one.
|
|
11
11
|
|
|
12
12
|
Safety, kept by every action (see mcp/hosts/contract.ts):
|
|
13
13
|
- read-only unless the action's name says otherwise
|
|
@@ -166,17 +166,23 @@ def _project(resolve, p, args):
|
|
|
166
166
|
want_clips = bool(args.get("clips"))
|
|
167
167
|
finds = [str(q) for q in args.get("find") or []]
|
|
168
168
|
found = dict((q, []) for q in finds)
|
|
169
|
+
# the bin selected in the Media Pool (0.9.5 All Clips read every timeline in it): its path, "" = Master
|
|
170
|
+
cur = mp.GetCurrentFolder()
|
|
171
|
+
cur_id = cur.GetUniqueId() if cur and hasattr(cur, "GetUniqueId") else None
|
|
172
|
+
selected = [None]
|
|
169
173
|
|
|
170
174
|
# ponytail: GetClipProperty per clip walks the whole pool; fine for thousands, page it if it ever is not
|
|
171
175
|
def walk(folder, path):
|
|
172
176
|
clips = folder.GetClipList() or []
|
|
173
177
|
node = {"path": path, "clips": len(clips), "folders": []}
|
|
178
|
+
if cur_id and hasattr(folder, "GetUniqueId") and folder.GetUniqueId() == cur_id:
|
|
179
|
+
selected[0] = path
|
|
174
180
|
if want_clips or finds:
|
|
175
181
|
rows = []
|
|
176
182
|
for c in clips:
|
|
177
183
|
pr = c.GetClipProperty() or {}
|
|
178
184
|
row = {"id": c.GetUniqueId(), "name": c.GetName(), "file": pr.get("File Path") or "", "start_tc": pr.get("Start TC") or "",
|
|
179
|
-
"usage": pr.get("Usage") or "", "folder": path, "type": pr.get("Type") or "",
|
|
185
|
+
"usage": pr.get("Usage") or "", "folder": path, "type": pr.get("Type") or "", "duration": pr.get("Duration") or "",
|
|
180
186
|
# Grade Tracer's camera-roll clue (0.9.5 metadata.py: "Camera #", else "Camera")
|
|
181
187
|
"camera": pr.get("Camera #") or pr.get("Camera") or ""}
|
|
182
188
|
rows.append(row)
|
|
@@ -219,9 +225,11 @@ def _project(resolve, p, args):
|
|
|
219
225
|
if args.get("grades"):
|
|
220
226
|
extra["grades"] = _grab_grades(resolve, p, args["grades"], args["grades_dir"])
|
|
221
227
|
pm = resolve.GetProjectManager()
|
|
222
|
-
|
|
228
|
+
pool = walk(mp.GetRootFolder(), "")
|
|
229
|
+
return {"ok": True, "project": p.GetName(), "pool": pool, "found": found, "selected_bin": selected[0],
|
|
223
230
|
"projects": [n for n in (pm.GetProjectListInCurrentFolder() or []) if n != p.GetName()], **extra,
|
|
224
|
-
"jobs": jobs, "
|
|
231
|
+
"jobs": jobs, "render_presets": [n for n in (p.GetRenderPresetList() or []) if not n.startswith("__ct_")],
|
|
232
|
+
"timeline": t.GetName() if t else None, "tracks": tracks_of(p, t) if t else [],
|
|
225
233
|
"timelines": [x.GetName() for x in timelines(p)], "page": resolve.GetCurrentPage(),
|
|
226
234
|
**({"used": sorted(used)} if used is not None else {})}
|
|
227
235
|
|
|
@@ -792,7 +800,7 @@ def a_render_start(resolve, args):
|
|
|
792
800
|
if not os.path.isdir(target):
|
|
793
801
|
os.makedirs(target)
|
|
794
802
|
page = resolve.GetCurrentPage()
|
|
795
|
-
if args.get("
|
|
803
|
+
if args.get("preset") or args.get("audio_tracks"):
|
|
796
804
|
_deliver_ready(resolve, p)
|
|
797
805
|
prev_tl = p.GetCurrentTimeline()
|
|
798
806
|
tl = find_timeline(p, args.get("timeline"))
|
|
@@ -808,7 +816,7 @@ def a_render_start(resolve, args):
|
|
|
808
816
|
set_video_tracks(resolve, tl, off, True)
|
|
809
817
|
resolve.OpenPage(page)
|
|
810
818
|
fail("tracks_not_disabled", "Resolve did not switch off video track(s) %s; nothing was queued" % bad)
|
|
811
|
-
if args.get("
|
|
819
|
+
if args.get("preset"):
|
|
812
820
|
resolve.OpenPage("deliver")
|
|
813
821
|
try:
|
|
814
822
|
return _queue_and_start(resolve, p, tl, args, target, page, prev_tl, off)
|
|
@@ -829,12 +837,6 @@ def _queue_and_start(resolve, p, tl, args, target, page, prev_tl, off):
|
|
|
829
837
|
if mode not in (None, 1):
|
|
830
838
|
p.SetCurrentRenderMode(1)
|
|
831
839
|
routed, rejected = None, []
|
|
832
|
-
if args.get("renderplugin") is not None:
|
|
833
|
-
args["preset"] = QC_PRESET
|
|
834
|
-
for f in QC_REPORTS: # a stale report from an earlier run is the classic wrong answer
|
|
835
|
-
if os.path.exists(os.path.join(target, f)):
|
|
836
|
-
os.remove(os.path.join(target, f))
|
|
837
|
-
_write_qc_config(target, args["renderplugin"])
|
|
838
840
|
try:
|
|
839
841
|
if args.get("preset"):
|
|
840
842
|
if args["preset"] not in (p.GetRenderPresetList() or []):
|
|
@@ -871,8 +873,8 @@ def _queue_and_start(resolve, p, tl, args, target, page, prev_tl, off):
|
|
|
871
873
|
p.SetCurrentTimeline(prev_tl)
|
|
872
874
|
resolve.OpenPage(page)
|
|
873
875
|
return {"ok": True, "job_id": job, "queued": True, "timeline": tl.GetName(), "project": p.GetName(), "rejected_settings": rejected}
|
|
874
|
-
# Starting a job loads ITS settings into the Deliver panel (measured on 21.1.1:
|
|
875
|
-
#
|
|
876
|
+
# Starting a job loads ITS settings into the Deliver panel (measured on 21.1.1: the Deliver panel
|
|
877
|
+
# showed the job's codec afterwards), so the snapshot is kept and loaded again
|
|
876
878
|
# when the job ends (render_finish), then deleted.
|
|
877
879
|
if not p.StartRendering([job]):
|
|
878
880
|
p.DeleteRenderJob(job)
|
|
@@ -956,47 +958,7 @@ def a_render_finish(resolve, args, state=None):
|
|
|
956
958
|
return out
|
|
957
959
|
|
|
958
960
|
|
|
959
|
-
# ── the
|
|
960
|
-
#
|
|
961
|
-
# Resolve's scripting API cannot select a plugin codec (GetRenderFormats omits it), but a saved
|
|
962
|
-
# render preset can: it stores "<pluginUUID>:<codecUUID>". We ship that preset
|
|
963
|
-
# (presets/conform.tools.xml) and import it with Resolve.ImportRenderPreset, which names the preset
|
|
964
|
-
# after the FILE and also SELECTS it, so the user's Deliver settings are snapshotted around it.
|
|
965
|
-
# Presets live per Resolve database: ensure on every QC run.
|
|
966
|
-
|
|
967
|
-
# Resolve names an imported preset after its FILE (presets/conform.tools.xml) and may cut the name at
|
|
968
|
-
# the first dot ("conform"); a cut name is renamed back below. Earlier names of ours are renamed to it.
|
|
969
|
-
QC_PRESET = "conform.tools"
|
|
970
|
-
LEGACY_PRESETS = ("CONFORM.TOOLS", "CONFORM.TOOLS QC", "Conform Tools QC")
|
|
971
|
-
QC_REPORTS = ("qc_report.json", "qc_audio.json", "qc_filmstrip.jpg")
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
def _codec_id(xml_text):
|
|
975
|
-
import re
|
|
976
|
-
m = re.search(r"<RecordFormatSubType>([^<]+)</RecordFormatSubType>", xml_text or "")
|
|
977
|
-
return m.group(1).strip().upper() if m else ""
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
def _saved_codec_id(resolve, name):
|
|
981
|
-
"""The codec a saved preset really selects (export it and read it); None when unknowable."""
|
|
982
|
-
import glob
|
|
983
|
-
import shutil
|
|
984
|
-
import tempfile
|
|
985
|
-
exporter = getattr(resolve, "ExportRenderPreset", None)
|
|
986
|
-
if exporter is None:
|
|
987
|
-
return None
|
|
988
|
-
d = tempfile.mkdtemp(prefix="ct_preset_")
|
|
989
|
-
try:
|
|
990
|
-
exporter(name, d) # the 2nd argument is a DIRECTORY; returns True regardless: trust the file
|
|
991
|
-
for f in glob.glob(os.path.join(d, "*.xml")):
|
|
992
|
-
with open(f) as fh:
|
|
993
|
-
return _codec_id(fh.read()) or None
|
|
994
|
-
return None
|
|
995
|
-
except Exception:
|
|
996
|
-
return None
|
|
997
|
-
finally:
|
|
998
|
-
shutil.rmtree(d, ignore_errors=True)
|
|
999
|
-
|
|
961
|
+
# ── render presets: the user's Deliver settings kept around what we load ─────────────────
|
|
1000
962
|
|
|
1001
963
|
def _keeping_settings(project, fn):
|
|
1002
964
|
"""Run fn() and put the user's Deliver settings back (import and load both SELECT a preset)."""
|
|
@@ -1010,18 +972,10 @@ def _keeping_settings(project, fn):
|
|
|
1010
972
|
project.DeleteRenderPreset(keep)
|
|
1011
973
|
|
|
1012
974
|
|
|
1013
|
-
def _rename_preset(project, src, dst):
|
|
1014
|
-
project.LoadRenderPreset(src)
|
|
1015
|
-
if not project.SaveAsNewRenderPreset(dst):
|
|
1016
|
-
return False
|
|
1017
|
-
project.DeleteRenderPreset(src)
|
|
1018
|
-
return True
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
975
|
def _deliver_ready(resolve, project):
|
|
1022
976
|
"""Open the Deliver page and give its panel a moment before touching render presets, and sweep
|
|
1023
977
|
snapshot presets an interrupted earlier run left behind (ours only: the __ct_keep_ prefix).
|
|
1024
|
-
Measured 2026-10-01 on Resolve Studio 20.3.2: a first
|
|
978
|
+
Measured 2026-10-01 on Resolve Studio 20.3.2: a first plugin-codec render on a project whose Deliver
|
|
1025
979
|
page had never been opened aborted Resolve inside its Deliver panel (assertion
|
|
1026
980
|
GetUseProjectTimelineFilter in UiDeliverPanelTimelineController); the same calls on a project
|
|
1027
981
|
whose Deliver page had been opened ran clean. This is the precaution; the exact trigger is not
|
|
@@ -1036,70 +990,6 @@ def _deliver_ready(resolve, project):
|
|
|
1036
990
|
return page
|
|
1037
991
|
|
|
1038
992
|
|
|
1039
|
-
def a_renderplugin_preset(resolve, args):
|
|
1040
|
-
"""Make sure the conform.tools render preset exists and selects OUR codec. Never deletes a preset
|
|
1041
|
-
the user named; replaces ours when it is stale; renames a legacy name of ours. The user's page and
|
|
1042
|
-
Deliver settings are put back."""
|
|
1043
|
-
_pm, p = project_or_fail(resolve)
|
|
1044
|
-
with open(args["preset_path"]) as fh:
|
|
1045
|
-
expected = _codec_id(fh.read())
|
|
1046
|
-
page = _deliver_ready(resolve, p)
|
|
1047
|
-
try:
|
|
1048
|
-
presets = p.GetRenderPresetList() or []
|
|
1049
|
-
if QC_PRESET in presets:
|
|
1050
|
-
got = _saved_codec_id(resolve, QC_PRESET)
|
|
1051
|
-
if got is None or got == expected:
|
|
1052
|
-
return {"ok": True, "preset": QC_PRESET, "imported": False}
|
|
1053
|
-
_keeping_settings(p, lambda: p.DeleteRenderPreset(QC_PRESET))
|
|
1054
|
-
replaced = True
|
|
1055
|
-
else:
|
|
1056
|
-
replaced = False
|
|
1057
|
-
for legacy in LEGACY_PRESETS:
|
|
1058
|
-
if legacy in presets:
|
|
1059
|
-
got = _saved_codec_id(resolve, legacy)
|
|
1060
|
-
if got is None or got == expected:
|
|
1061
|
-
if _keeping_settings(p, lambda: _rename_preset(p, legacy, QC_PRESET)):
|
|
1062
|
-
return {"ok": True, "preset": QC_PRESET, "imported": False, "renamed_from": legacy}
|
|
1063
|
-
importer = getattr(resolve, "ImportRenderPreset", None)
|
|
1064
|
-
if importer is None:
|
|
1065
|
-
fail("no_preset_import", "this Resolve cannot import render presets (Resolve 19 or later can)")
|
|
1066
|
-
before = set(p.GetRenderPresetList() or [])
|
|
1067
|
-
_keeping_settings(p, lambda: importer(os.path.abspath(args["preset_path"])))
|
|
1068
|
-
after = p.GetRenderPresetList() or []
|
|
1069
|
-
if QC_PRESET not in after:
|
|
1070
|
-
new = [x for x in after if x not in before]
|
|
1071
|
-
if len(new) == 1: # Resolve may cut the name at the first dot
|
|
1072
|
-
_keeping_settings(p, lambda: _rename_preset(p, new[0], QC_PRESET))
|
|
1073
|
-
if QC_PRESET not in (p.GetRenderPresetList() or []):
|
|
1074
|
-
fail("preset_import_failed", "Resolve did not import the conform.tools render preset")
|
|
1075
|
-
return {"ok": True, "preset": QC_PRESET, "imported": True, "replaced": replaced}
|
|
1076
|
-
finally:
|
|
1077
|
-
if resolve.GetCurrentPage() != page:
|
|
1078
|
-
resolve.OpenPage(page)
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
def _write_qc_config(folder, config):
|
|
1082
|
-
"""<render folder>/qc_config.txt, flat key=value lines the codec reads at its first frame. No config:
|
|
1083
|
-
remove any stale one so the codec runs every check."""
|
|
1084
|
-
path = os.path.join(folder, "qc_config.txt")
|
|
1085
|
-
if not config:
|
|
1086
|
-
if os.path.exists(path):
|
|
1087
|
-
os.remove(path)
|
|
1088
|
-
return
|
|
1089
|
-
lines = ["color_space=%s" % (config.get("color_space") or "sdr_rec709")]
|
|
1090
|
-
if config.get("id"):
|
|
1091
|
-
lines.append("template_id=%s" % config["id"])
|
|
1092
|
-
for check, params in (config.get("checks") or {}).items():
|
|
1093
|
-
params = params or {}
|
|
1094
|
-
lines.append("%s.enabled=%d" % (check, 1 if params.get("enabled", True) else 0))
|
|
1095
|
-
for k, v in params.items():
|
|
1096
|
-
if k != "enabled":
|
|
1097
|
-
lines.append("%s.%s=%s" % (check, k, int(v) if isinstance(v, bool) else v))
|
|
1098
|
-
# "\n" on every platform: Windows' text mode would end each line "\r\n" (the codec's lines then carry a "\r")
|
|
1099
|
-
with open(path, "w", newline="\n") as fh:
|
|
1100
|
-
fh.write("\n".join(lines) + "\n")
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
993
|
def a_clips(resolve, args):
|
|
1104
994
|
"""The video items of a timeline (absolute frames, end exclusive) + its start frame and raster:
|
|
1105
995
|
what maps a measured frame to the clip that composites it."""
|
|
@@ -1252,6 +1142,8 @@ def _item_row(it, kind, track, t0):
|
|
|
1252
1142
|
"nodes": int(it.GetNodeGraph().GetNumNodes() or 0) if kind == "video" and it.GetNodeGraph() else 0,
|
|
1253
1143
|
"stacks": _stacks(it) if kind == "video" else [],
|
|
1254
1144
|
"media_id": mpi.GetUniqueId() if mpi else "",
|
|
1145
|
+
# Resolve's own word on the media (the viewer greys only what Resolve has offline)
|
|
1146
|
+
"online": (mpi.GetClipProperty("Online Status") or "") != "Offline" if mpi else None,
|
|
1255
1147
|
"src_in": _int_or_none(it.GetSourceStartFrame) if kind == "video" else None,
|
|
1256
1148
|
# 21.1: the clip's retime and fades (Reconform carries them; Edit Index+ lists them)
|
|
1257
1149
|
"speed": (it.GetSpeed() or {}).get("Percentage") if hasattr(it, "GetSpeed") else None,
|
|
@@ -1374,6 +1266,10 @@ def _probe_selection(t):
|
|
|
1374
1266
|
def _items(p, args):
|
|
1375
1267
|
t = find_timeline(p, args.get("timeline"))
|
|
1376
1268
|
t0 = int(t.GetStartFrame())
|
|
1269
|
+
if args.get("follow"):
|
|
1270
|
+
# where the artist is, and nothing else (the window follows this several times a second): no clip walk, and
|
|
1271
|
+
# never ColorMatchProbe, whose widget scan from its own thread crashed Resolve under a fast poll (21.1, 2026-11-04)
|
|
1272
|
+
return {"ok": True, "project": p.GetName(), "timeline": t.GetName(), "start_frame": t0, "playhead_tc": t.GetCurrentTimecode() or ""}
|
|
1377
1273
|
if args.get("selected"):
|
|
1378
1274
|
# what the artist has selected in Resolve's timeline right now (GetSelectedClips, Resolve 21), addressed
|
|
1379
1275
|
# like every item row: kind + track + start
|
|
@@ -1391,7 +1287,7 @@ def _items(p, args):
|
|
|
1391
1287
|
probe = _probe_selection(t)
|
|
1392
1288
|
for it in probe.get("items", []):
|
|
1393
1289
|
add(it)
|
|
1394
|
-
return {"ok": True, "timeline": t.GetName(), "start_frame": t0, "selected": out,
|
|
1290
|
+
return {"ok": True, "project": p.GetName(), "timeline": t.GetName(), "start_frame": t0, "selected": out, "playhead_tc": t.GetCurrentTimecode() or "",
|
|
1395
1291
|
**({"probe": True, "node": probe["node"]} if probe.get("on") else {})}
|
|
1396
1292
|
kinds = [args["kind"]] if args.get("kind") else ["video", "audio"]
|
|
1397
1293
|
out = []
|
|
@@ -1405,7 +1301,8 @@ def _items(p, args):
|
|
|
1405
1301
|
"layers": int(p.GetSetting("nodeStackLayers") or 1), "marker_data": _marker_data(t),
|
|
1406
1302
|
"playhead_tc": t.GetCurrentTimecode() or "",
|
|
1407
1303
|
"raster": list(_raster(t)),
|
|
1408
|
-
|
|
1304
|
+
# only when asked: Resolve 21.1 flips to the Color page to answer it (QC's Blanking asks, no other read)
|
|
1305
|
+
**({"output_blanking": _blanking_px(t, *_raster(t))} if args.get("blanking") and hasattr(t, "GetOutputBlanking") else {})}
|
|
1409
1306
|
|
|
1410
1307
|
|
|
1411
1308
|
def _graph(it, t, where):
|
|
@@ -1456,6 +1353,13 @@ def _blanking_px(t, w, h):
|
|
|
1456
1353
|
return {"top": max(0, round(f("Top", 0))), "bottom": max(0, round(h - f("Bottom", h))),
|
|
1457
1354
|
"left": max(0, round(f("Left", 0))), "right": max(0, round(w - f("Right", w)))}
|
|
1458
1355
|
|
|
1356
|
+
def _add_marker(h, frame, color, name, note, duration, data):
|
|
1357
|
+
"""AddMarker, and an unnamed marker kept: Resolve (21.1) refuses an empty name (measured 2026-11-04), so a marker the
|
|
1358
|
+
artist left unnamed, moved or copied or put back, would be lost; a single space reads as blank."""
|
|
1359
|
+
return bool(h.AddMarker(frame, color, name, note, duration, data)) or (
|
|
1360
|
+
not (name or "").strip() and bool(h.AddMarker(frame, color, " ", note, duration, data)))
|
|
1361
|
+
|
|
1362
|
+
|
|
1459
1363
|
def _op(p, t, op, find):
|
|
1460
1364
|
"""One edit → {ok, undo:[ops], detail?}. Raises on a bad address; returns ok False when Resolve refuses."""
|
|
1461
1365
|
kind = op["op"]
|
|
@@ -1466,7 +1370,7 @@ def _op(p, t, op, find):
|
|
|
1466
1370
|
here = (h.GetMarkers() or {})
|
|
1467
1371
|
old = here.get(f) or here.get(float(f))
|
|
1468
1372
|
addr = {"item": op["item"]} if op.get("item") else {}
|
|
1469
|
-
if kind == "marker_add" and old and op.get("data") and (old.get("customData") or "") != op["data"]:
|
|
1373
|
+
if kind == "marker_add" and old and op.get("data") and (old.get("customData") or "") != op["data"] and not op.get("overwrite"):
|
|
1470
1374
|
# Resolve holds one marker per frame and AddMarker over it replaces it: a tool's marker (tagged `data`)
|
|
1471
1375
|
# never takes the frame of someone else's (the artist's, another tool's); it goes to the next free frame
|
|
1472
1376
|
g = f + 1
|
|
@@ -1498,10 +1402,10 @@ def _op(p, t, op, find):
|
|
|
1498
1402
|
duration=int(old["duration"]), data=old.get("customData", ""))]
|
|
1499
1403
|
else:
|
|
1500
1404
|
undo = [dict(addr, op="marker_delete", frame=to)]
|
|
1501
|
-
ok = h
|
|
1405
|
+
ok = _add_marker(h, to, new.get("color", "Blue"), new.get("name", ""), new.get("note", ""),
|
|
1502
1406
|
max(1, int(new.get("duration", 1))), new.get("customData", "") or "")
|
|
1503
1407
|
if not ok and old: # put the old one back rather than lose it
|
|
1504
|
-
h
|
|
1408
|
+
_add_marker(h, f, old["color"], old["name"], old["note"], int(old["duration"]), old.get("customData", ""))
|
|
1505
1409
|
return {"ok": bool(ok), "undo": undo if ok else []}
|
|
1506
1410
|
if kind == "timeline_output_blanking":
|
|
1507
1411
|
# the timeline's output blanking (21.1+), as pixels per edge; Resolve speaks edge coordinates (0.9.5
|
|
@@ -1546,14 +1450,16 @@ def _op(p, t, op, find):
|
|
|
1546
1450
|
# 0.9.5 Reconformer's Discard: a built copy deleted by name — only one whose name ends _RECONFORMED, so this never
|
|
1547
1451
|
# deletes a real timeline; when it is open, B (its name without the suffix) is opened first. No undo (said).
|
|
1548
1452
|
name = str(op.get("timeline") or "")
|
|
1549
|
-
|
|
1453
|
+
# a second build of the same B is "..._RECONFORMED (2)" (unique_name): a build too
|
|
1454
|
+
m = re.match(r"^(.*)_RECONFORMED(?: \(\d+\))?$", name)
|
|
1455
|
+
if not m:
|
|
1550
1456
|
return {"ok": False, "undo": [], "detail": "only a ..._RECONFORMED timeline (a Reconform build) can be discarded"}
|
|
1551
1457
|
tl = find_timeline(p, name) if name in [x.GetName() for x in timelines(p)] else None
|
|
1552
1458
|
if tl is None:
|
|
1553
1459
|
return {"ok": True, "undo": [], "detail": "already gone"}
|
|
1554
1460
|
cur = p.GetCurrentTimeline()
|
|
1555
1461
|
if cur is not None and cur.GetUniqueId() == tl.GetUniqueId():
|
|
1556
|
-
base =
|
|
1462
|
+
base = m.group(1)
|
|
1557
1463
|
if base in [x.GetName() for x in timelines(p)]:
|
|
1558
1464
|
p.SetCurrentTimeline(find_timeline(p, base))
|
|
1559
1465
|
return {"ok": bool(p.GetMediaPool().DeleteTimelines([tl])), "undo": [], "detail": "deleted (a deleted timeline cannot be undone)"}
|
|
@@ -1575,6 +1481,14 @@ def _op(p, t, op, find):
|
|
|
1575
1481
|
n, f = int(round(fps)), int(tl.GetStartFrame()) + int(op.get("frame", 0))
|
|
1576
1482
|
tc = "%02d:%02d:%02d:%02d" % (f // (3600 * n), f // (60 * n) % 60, f // n % 60, f % n)
|
|
1577
1483
|
return {"ok": bool(tl.SetCurrentTimecode(tc)), "timeline": tl.GetName(), "tc": tc, "undo": []}
|
|
1484
|
+
if kind == "pool_select":
|
|
1485
|
+
# a Media Pool bin made the selected one (the tools that act on "the selected bin": Odd Image Fixer, All Clips,
|
|
1486
|
+
# Clip Renamer): a selection, not an edit, so nothing to undo
|
|
1487
|
+
mp = p.GetMediaPool()
|
|
1488
|
+
folder, _missing = pool_folder(mp, op["folder"], False)
|
|
1489
|
+
if not folder:
|
|
1490
|
+
return {"ok": False, "undo": [], "detail": "no bin %s" % op["folder"]}
|
|
1491
|
+
return {"ok": bool(mp.SetCurrentFolder(folder)), "undo": []}
|
|
1578
1492
|
if kind == "pool_folder":
|
|
1579
1493
|
# a media pool folder path (A/B/C), each missing level made; an empty folder is harmless, so nothing to undo
|
|
1580
1494
|
# (a tester's suggestion, 2026-11-02: build the job's folder tree before importing into it)
|
|
@@ -1645,16 +1559,21 @@ def _op(p, t, op, find):
|
|
|
1645
1559
|
if item is not None:
|
|
1646
1560
|
placed += 1
|
|
1647
1561
|
off += int(not exact)
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1562
|
+
if placed == 0:
|
|
1563
|
+
# nothing landed (Resolve refused every piece): no empty HISTORY track left behind
|
|
1564
|
+
t.DeleteTrack("video", k)
|
|
1565
|
+
else:
|
|
1566
|
+
t.SetTrackName("video", k, op.get("name") or "V1 HISTORY")
|
|
1567
|
+
if _RESOLVE is not None and _RESOLVE.GetCurrentPage() != "edit": # SetTrackEnable lands on the Edit page only (21.1)
|
|
1568
|
+
_RESOLVE.OpenPage("edit")
|
|
1569
|
+
t.SetTrackEnable("video", k, False)
|
|
1652
1570
|
finally:
|
|
1653
1571
|
if was and was.GetUniqueId() != t.GetUniqueId():
|
|
1654
1572
|
p.SetCurrentTimeline(was)
|
|
1655
|
-
return {"ok": placed == len(op["pieces"]), "track": k, "placed": placed, "off_by_frame": off,
|
|
1656
|
-
**({"detail": "not in the media pool: " + ", ".join(missing)} if missing else
|
|
1657
|
-
|
|
1573
|
+
return {"ok": placed == len(op["pieces"]), "track": k if placed else None, "placed": placed, "off_by_frame": off,
|
|
1574
|
+
**({"detail": "not in the media pool: " + ", ".join(missing)} if missing else
|
|
1575
|
+
{"detail": "Resolve placed none of A's %d pieces" % len(op["pieces"])} if not placed else {}),
|
|
1576
|
+
"undo": [{"op": "track_delete", "kind": "video", "index": k}] if placed else []}
|
|
1658
1577
|
if kind == "drop_in":
|
|
1659
1578
|
# 0.9.5 Reconformer "Drop in VFX": finished comps (files) into the pool's VFX bin and onto a new top video track,
|
|
1660
1579
|
# each over its plate (pieces: path, comp frames src_in / src_out, record start / end from the head, the plate
|
|
@@ -1765,6 +1684,16 @@ def _op(p, t, op, find):
|
|
|
1765
1684
|
return {"ok": whole is not None and ok, "undo": []}
|
|
1766
1685
|
if kind == "track_delete":
|
|
1767
1686
|
return {"ok": bool(t.DeleteTrack(op.get("kind", "video"), int(op["index"]))), "undo": []}
|
|
1687
|
+
if kind == "render_jobs_start":
|
|
1688
|
+
# jobs this app queued (0.9.5 Marker Batch Renderer's Start Render), by id: only those, never the rest of the
|
|
1689
|
+
# artist's queue; nothing to undo (a render is not an edit)
|
|
1690
|
+
if p.IsRenderingInProgress():
|
|
1691
|
+
return {"ok": False, "undo": [], "detail": "Resolve is already rendering"}
|
|
1692
|
+
have = set(j["JobId"] for j in (p.GetRenderJobList() or []))
|
|
1693
|
+
ids = [i for i in (op.get("ids") or []) if i in have]
|
|
1694
|
+
if not ids:
|
|
1695
|
+
return {"ok": False, "undo": [], "detail": "none of those jobs is in the render queue now"}
|
|
1696
|
+
return {"ok": bool(p.StartRendering(ids)), "undo": [], "detail": "%d job(s) started" % len(ids)}
|
|
1768
1697
|
if kind == "render_jobs_delete":
|
|
1769
1698
|
# 0.9.5 Marker Batch Renderer's "delete jobs": the render queue's all / completed / incomplete jobs. A deleted
|
|
1770
1699
|
# job cannot be brought back (no undo); one rendering now is never touched
|
|
@@ -1791,7 +1720,10 @@ def _op(p, t, op, find):
|
|
|
1791
1720
|
return {"ok": c.GetName() == op["name"],
|
|
1792
1721
|
"undo": [{"op": "pool_rename", "clip": op["clip"], "name": old}]}
|
|
1793
1722
|
if kind == "pool_move":
|
|
1723
|
+
# where each clip was, for the undo: Resolve's walk, else the bin the planner read it in (op["from"])
|
|
1724
|
+
given = op.get("from") or []
|
|
1794
1725
|
olds = [_folder_path(mp, c) for c in clips]
|
|
1726
|
+
olds = [o if o is not None else (("" if given[i] == "Master" else given[i]) if i < len(given) and given[i] else None) for i, o in enumerate(olds)]
|
|
1795
1727
|
cur = mp.GetCurrentFolder()
|
|
1796
1728
|
folder, _missing = pool_folder(mp, op["folder"], create=bool(op.get("create", True)))
|
|
1797
1729
|
mp.SetCurrentFolder(cur) # a bin made here became current; the user's stays theirs
|
|
@@ -1937,7 +1869,9 @@ def _op(p, t, op, find):
|
|
|
1937
1869
|
vt = VERSION_TYPE[op.get("type", "local")]
|
|
1938
1870
|
cur = (it.GetCurrentVersion() or {}).get("versionName", "")
|
|
1939
1871
|
if op.get("add"):
|
|
1940
|
-
|
|
1872
|
+
# AddVersion does not make the new version current (21.1, measured 2026-11-04): it is loaded, so what follows
|
|
1873
|
+
# (a traced grade copied in) lands in it and never on the version the artist had
|
|
1874
|
+
ok = it.AddVersion(op["add"], vt) and it.LoadVersionByName(op["add"], vt)
|
|
1941
1875
|
return {"ok": bool(ok), "undo": [{"op": "version", "item": item, "type": op.get("type", "local"),
|
|
1942
1876
|
"load": cur, "delete": op["add"]}]}
|
|
1943
1877
|
if op.get("delete"):
|
|
@@ -2752,7 +2686,6 @@ ACTIONS = {
|
|
|
2752
2686
|
"render_status": a_render_status,
|
|
2753
2687
|
"render_cancel": a_render_cancel,
|
|
2754
2688
|
"render_finish": a_render_finish,
|
|
2755
|
-
"renderplugin_preset": a_renderplugin_preset,
|
|
2756
2689
|
"clips": a_clips,
|
|
2757
2690
|
"markers": a_markers,
|
|
2758
2691
|
"items": a_items,
|
|
@@ -2948,5 +2881,42 @@ def _grade_node_kept(it, op, t=None):
|
|
|
2948
2881
|
return refuse("the sized grade did not come through intact")
|
|
2949
2882
|
return {"ok": True, "undo": back, "detail": (("on new local version %r" if made else "Sizing replaced on our own version %r") + " = %s + Sizing in node %d%s (%d node(s) kept)") % (name, src, num, " %r" % label if label else "", len(after))}
|
|
2950
2883
|
|
|
2884
|
+
def serve():
|
|
2885
|
+
"""bridge.py serve: one request per stdin line ({"action", "args"}) -> one reply line, Resolve connected once and kept
|
|
2886
|
+
(a call costs ~20 ms instead of a python start + connect, ~1 s). A dead connection (Resolve quit or restarted) is
|
|
2887
|
+
made again on the next call."""
|
|
2888
|
+
global _RESOLVE
|
|
2889
|
+
while True:
|
|
2890
|
+
line = sys.stdin.readline()
|
|
2891
|
+
if not line:
|
|
2892
|
+
return
|
|
2893
|
+
try:
|
|
2894
|
+
try:
|
|
2895
|
+
req = json.loads(line)
|
|
2896
|
+
except ValueError as e:
|
|
2897
|
+
fail("usage", "request is not JSON: %s" % e)
|
|
2898
|
+
act = ACTIONS.get(req.get("action"))
|
|
2899
|
+
if act is None:
|
|
2900
|
+
fail("usage", "unknown action %r" % req.get("action"))
|
|
2901
|
+
try:
|
|
2902
|
+
alive = _RESOLVE is not None and _RESOLVE.GetVersionString()
|
|
2903
|
+
except Exception:
|
|
2904
|
+
alive = False
|
|
2905
|
+
if not alive:
|
|
2906
|
+
_RESOLVE = None
|
|
2907
|
+
_RESOLVE = connect()
|
|
2908
|
+
t0 = time.time()
|
|
2909
|
+
try:
|
|
2910
|
+
out = act(_RESOLVE, req.get("args") or {})
|
|
2911
|
+
except SystemExit:
|
|
2912
|
+
raise
|
|
2913
|
+
except Exception as e:
|
|
2914
|
+
fail("resolve_error", "%s: %s" % (type(e).__name__, e))
|
|
2915
|
+
out["ms"] = int((time.time() - t0) * 1000)
|
|
2916
|
+
reply(out)
|
|
2917
|
+
except SystemExit:
|
|
2918
|
+
pass # reply()/fail() wrote the answer line and "exit": in serve mode that ends the call, not the process
|
|
2919
|
+
|
|
2920
|
+
|
|
2951
2921
|
if __name__ == "__main__":
|
|
2952
|
-
main()
|
|
2922
|
+
serve() if sys.argv[1:2] == ["serve"] else main()
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-QH5DTYSE.js";import"./chunk-ROGMKTND.js";import"./chunk-X527E5VI.js";import"./chunk-PSANHDZM.js";export{b as APPLIED,a as BACKUP_SUFFIX,e as applyPatch,c as patchFolders,g as patchName,d as planPatch,h as readRecord,f as undoPatch};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A as a,B as b,C as c,D as d,E as e,F as f,G as g}from"./chunk-
|
|
3
|
+
import{A as a,B as b,C as c,D as d,E as e,F as f,G as g}from"./chunk-VERTA23P.js";import"./chunk-OWWXUNJF.js";import"./chunk-VETHR2O7.js";import"./chunk-ROGMKTND.js";import"./chunk-X527E5VI.js";import"./chunk-PSANHDZM.js";export{a as createSession,g as getExtra,c as getSession,b as lastSessionId,e as listSessions,f as saveExtra,d as updateSession};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{$b as l,Qb as a,Rb as b,Sb as c,Tb as d,Ub as e,Vb as f,Wb as g,Xb as h,Yb as i,Zb as j,_b as k,ac as m,bc as n,cc as o,dc as p,ec as q,fc as r,gc as s,hc as t,ic as u}from"./chunk-63WQRYTJ.js";import"./chunk-IN6XVTUS.js";import"./chunk-DLF5AKXT.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-TBU2XWFD.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-WJ5EWXP2.js";import"./chunk-YUO3UWPH.js";import"./chunk-DKGGJM6Z.js";import"./chunk-JV7TZDKJ.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-UKXSKFL3.js";import"./chunk-4RA57LTJ.js";import"./chunk-FLLB6UZJ.js";import"./chunk-UAURERD3.js";import"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-VERTA23P.js";import"./chunk-OWWXUNJF.js";import"./chunk-VETHR2O7.js";import"./chunk-ROGMKTND.js";import"./chunk-X527E5VI.js";import"./chunk-PSANHDZM.js";export{k as OPERATION_KINDS,a as READ_FORMATS,l as applyOperation,n as applyOperationWithSources,t as consolidate,i as countFlags,b as detectFormat,d as detectTimelineFormat,u as judge,s as linkText,g as listClips,j as listFlags,h as listMedia,e as readTimeline,o as resolveTarget,r as routesText,c as sniffFormat,f as summarize,m as trackIndex,q as writeDestination,p as writeTimeline};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conformtools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "conform.tools on your machine: timeline exchange, relink, media trim, delivery and auto conform, as MCP tools for Claude and other AI apps, a CLI and a local HTTP API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"conformtools-darwin-arm64": "0.6.
|
|
48
|
-
"conformtools-darwin-x64": "0.6.
|
|
49
|
-
"conformtools-linux-x64": "0.6.
|
|
50
|
-
"conformtools-windows-x64": "0.6.
|
|
47
|
+
"conformtools-darwin-arm64": "0.6.15",
|
|
48
|
+
"conformtools-darwin-x64": "0.6.15",
|
|
49
|
+
"conformtools-linux-x64": "0.6.15",
|
|
50
|
+
"conformtools-windows-x64": "0.6.15"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/dist/account-F54SG45Q.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-OD445COC.js";import"./chunk-EP4L2BWV.js";import"./chunk-PHAMF4JF.js";import"./chunk-XI6XF7FQ.js";import"./chunk-PSANHDZM.js";export{b as NET_TIMEOUT_MS,c as _forgetOffline,d as accessToken,e as accountStatus,a as config,g as includesOf,l as login,m as logout,k as requireApp,i as requireEntitled,j as requireMcp,h as setAccountGate,f as statusText};
|
package/dist/chunk-B54TEGMG.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{Jb as S,Kb as L,Lb as A,Mb as E,Nb as P,Ob as T,Pb as M,Qb as D,Rb as N,Sb as z,Tb as I,wb as R}from"./chunk-LKQTE6T5.js";import{a as w}from"./chunk-PHAMF4JF.js";import{Z as l,s as j}from"./chunk-XI6XF7FQ.js";async function K(r,t){let d=t.media_root?[t.media_root]:await N();if(!d.length)throw new w("invalid_args","no media_root given and no remembered locations \u2014 pass the folder to link from");for(let e of d)try{if(!(await j(e)).isDirectory)throw 0}catch{throw new w("invalid_args",`media_root is not a folder on this machine: ${e}`)}let i=L(r,{ref_ids:t.ref_ids,lane:t.lane,reset:t.reset});if(!i.length)return{session:r,changed:!1,note:"",text:"nothing in scope: every reference in scope is already linked (use reset=true to re-point) or the ids/lane matched nothing"};if(t.reset)for(let e of i)e.binding_state="unbound",delete e.coverage_reason;let h=[],b=!1,m=[];for(let e of d)if(t.gather==="path")for(let n of i){let c=n.local_path??n.target_url??"",o=c?await E(e,c):null;o?h.push(o):m.push(`${n.id} ${l(c)}: not at its recorded path under ${e}`)}else{let n=await A(e,i,t.cap);h.push(...n.paths),b||=n.capped}let{refs:_,failed:u}=await P([...new Set(h)]);t.remember&&t.media_root&&await z(t.media_root);let k=new Set(i.map(e=>e.id)),p=R(r,_,k);if(p.splits.length){r=p.session;let e=new Set([...k,...p.splits.flatMap(n=>n.into)]);i=(r.media_references??[]).filter(n=>e.has(n.id));for(let n of p.splits){let c=o=>l(i.find(B=>B.id===o)?.target_url??o);m.push(`split ${n.ref_id} across ${n.into.length} section file(s): ${n.into.map(c).join(", ")}`)}}let a=S(t.criteria),s=T(r,i,_,a,t.tolerances),O=t.criteria?.picture?await M(r,s):[],y=[`scope: ${i.length} reference(s)${t.lane!=="both"?` (${t.lane} lane)`:""}${t.ref_ids?` (zone of ${t.ref_ids.length})`:""}; gather=${t.gather} under ${d.join(", ")}: ${_.length} candidate clip(s)${b?` (CAPPED at ${t.cap} \u2014 narrow the folder)`:""}`,`criteria: ${[...Object.entries(a).filter(([,e])=>e===!0).map(([e])=>e),...t.criteria?.picture?["picture"]:[]].join(", ")}${a.fileName?` (${a.fileNameMode})`:""}${a.fileExtensions?`; ext ${a.fileExtensions}`:""}; timecode containment + fps always on`,...u.length?[`could not probe ${u.length}: ${u.slice(0,5).join("; ")}`]:[],...m.slice(0,20),...O.slice(0,40)];if(t.dry_run)return{session:r,changed:!1,note:"",text:[...y,I(r,s,{compare:t.compare}),"(dry run \u2014 nothing changed; pass accept=[{ref_id,candidate_id}] to commit chosen rows, or run again without dry_run to apply every matched row)"].join(`
|
|
4
|
-
`)};let f,g=[];if(t.accept?.length){f=[];for(let e of t.accept){let n=s.rows.find(o=>o.ref_id===e.ref_id);n&&(n.candidate?.id===e.candidate_id||n.alternatives.some(o=>o.id===e.candidate_id))?f.push(e):g.push(`${e.ref_id} \u2192 ${e.candidate_id}: not a proposed match or alternative for that reference`)}}else f=s.rows.filter(e=>e.status==="matched"&&e.candidate).map(e=>({ref_id:e.ref_id,candidate_id:e.candidate.id}));let $=D(r,s,f),v=$.session.media_references??[],x=v.filter(e=>i.some(n=>n.id===e.id)&&e.binding_state==="linked").length,U=$.applied,C=v.filter(e=>i.some(n=>n.id===e.id)&&e.binding_state!=="linked").map(e=>` - ${e.id} ${l(e.target_url??"")}: ${e.coverage_reason??(s.rows.find(n=>n.ref_id===e.id)?.status==="ambiguous"?"ambiguous \u2014 pick one with accept":"no file matched")}`),q=[...y,`Linked ${x} of ${i.length}${g.length?`; ${g.length} pick(s) vetoed`:""}`,...U.map(e=>`- ${e.ref_id}: ${l(e.before.path??"?")} \u2192 ${e.after.path}${e.warning?` \u26A0 ${e.warning}`:""}`),...g.map(e=>` \u2717 ${e}`),...C.length?["unresolved:",...C]:[]].join(`
|
|
5
|
-
`);return{session:$.session,changed:!0,note:`relink ${t.gather} ${d[0]} (${x}/${i.length})`,text:q}}export{K as a};
|
package/dist/chunk-BTS3DFPD.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A as w,E as y,a as h,aa as c,m as x,n as k,t as u,x as C,z as A}from"./chunk-XI6XF7FQ.js";var O=new Set(["ffmpeg","ffprobe","ffplay","sox","soxi","mediainfo","exiftool","mkvmerge","mkvextract","mp4box","bmxtranswrap","raw2rgb","redline","art-cmd","oiiotool","iconvert","idiff","asdcp-wrap","asdcp-unwrap","asdcp-info","opendcp","dcp_inspect","handbrakecli","gst-launch-1.0","mencoder","mplayer","sips","afconvert","avconvert","qtfaststart","mediaconch","bwfmetaedit","x264","x265","aomenc","svtav1encapp","otiotool","otioconvert","otioview","cineform","ale2csv"]),I=["mov","mp4","m4v","mxf","mkv","avi","webm","mts","m2ts","mpg","mpeg","r3d","braw","ari","arx","crm","dng","dpx","exr","wav","aif","aiff","bwf","flac","mp3","aac","m4a","caf"],N=["aaf","avb","edl","drt","otio","fcpxml","fcpxmld","prproj","ptx","ale","xml","csv"],U=new Set(["xml","csv","png","jpg","jpeg","tif","tiff"]),L=new Set([...I,...N,...U]);var m="conformtools-hook",d=o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{},g=o=>!!o&&typeof o=="object"&&typeof o.command=="string"&&o.command.includes(m);function $(o,e,t={}){let n=d(o.hooks),r=Array.isArray(n.PostToolUse)?[...n.PostToolUse]:[],s={type:"command",command:e,timeout:10,...t.async?{async:!0}:{}};for(let i=0;i<r.length;i++){let a=d(r[i]),l=Array.isArray(a.hooks)?a.hooks:[],f=l.findIndex(g);if(f<0)continue;if(JSON.stringify(l[f])===JSON.stringify(s)&&a.matcher==="Bash")return{settings:o,result:"kept"};let b=[...l];return b[f]=s,r[i]={...a,matcher:"Bash",hooks:b},{settings:{...o,hooks:{...n,PostToolUse:r}},result:"updated"}}return{settings:{...o,hooks:{...n,PostToolUse:[...r,{matcher:"Bash",hooks:[s]}]}},result:"installed"}}function S(o){let e=d(o.hooks);if(!Array.isArray(e.PostToolUse))return{settings:o,removed:!1};let t=!1,n=e.PostToolUse.map(i=>{let a=d(i);if(!Array.isArray(a.hooks))return i;let l=a.hooks.filter(f=>!g(f));return l.length!==a.hooks.length&&(t=!0),l.length?{...a,hooks:l}:null}).filter(i=>i!==null);if(!t)return{settings:o,removed:!1};let r={...e};n.length?r.PostToolUse=n:delete r.PostToolUse;let s={...o};return Object.keys(r).length?s.hooks=r:delete s.hooks,{settings:s,removed:!0}}function T(o,e,t){let n=d(o.hooks),r=Array.isArray(n.afterShellExecution)?[...n.afterShellExecution]:[],s={command:e,timeout:10,matcher:t},i=r.findIndex(g);return i>=0&&JSON.stringify(r[i])===JSON.stringify(s)?{settings:o,result:"kept"}:(i>=0?r[i]=s:r.push(s),{settings:{version:1,...o,hooks:{...n,afterShellExecution:r}},result:i>=0?"updated":"installed"})}function P(o){let e=d(o.hooks);if(!Array.isArray(e.afterShellExecution))return{settings:o,removed:!1};let t=e.afterShellExecution.filter(s=>!g(s));if(t.length===e.afterShellExecution.length)return{settings:o,removed:!1};let n={...e};t.length?n.afterShellExecution=t:delete n.afterShellExecution;let r={...o};return Object.keys(n).length?r.hooks=n:delete r.hooks,{settings:r,removed:!0}}function E(){return`\\b(${[...O].map(e=>e.replace(/[.+-]/g,"\\$&")).join("|")})\\b|\\.(${[...L].join("|")})\\b`}function F(o){let e=(o??"").toLowerCase();return e?e.includes("claude-code")||e.includes("claude code")?"claude":e.includes("codex")?"codex":e.includes("cursor")?"cursor":null:null}var J=["claude","codex","cursor"],p=()=>({claude:c(k(),".claude","settings.json"),codex:c(k(),".codex","hooks.json"),cursor:c(k(),".cursor","hooks.json")});async function M(){let o=new URL(import.meta.url),e=h(new URL("./hook.js",o));if(await u(e)){await w(x());let n=c(x(),`${m}.js`);return await y(e,n),`node "${n}"`}let t=h(new URL("../adapters/hook.ts",o));return await u(t)?`deno run --allow-read --allow-write --allow-env --no-check --unstable-sloppy-imports "${t}" ${m}`:null}async function v(o){if(!await u(o))return{};let e=await C(o);try{return e.trim()?JSON.parse(e):{}}catch{return"invalid"}}async function j(o,e){let t;return await u(o)?(t=`${o}.conformtools-backup`,await y(o,t)):await w(c(o,"..")),await A(o,JSON.stringify(e,null,2)+`
|
|
4
|
-
`),t}async function B(o,e={}){let t=e.file??p()[o];try{let n=e.command??await M();if(!n)return{client:o,file:t,result:"skipped",detail:"no hook script beside this build"};let r=await v(t);if(r==="invalid")return{client:o,file:t,result:"failed",detail:`${t} is not valid JSON; nothing was changed`};let s=o==="cursor"?T(r,n,E()):$(r,n,{async:o==="codex"});if(s.result==="kept")return{client:o,file:t,result:"kept"};let i=await j(t,s.settings);return{client:o,file:t,result:s.result,backup:i}}catch(n){return{client:o,file:t,result:"failed",detail:n instanceof Error?n.message:String(n)}}}async function z(o,e={}){let t=e.file??p()[o],n=await v(t);if(n==="invalid")return{client:o,file:t,removed:!1};let r=o==="cursor"?P(n):S(n);if(!r.removed)return{client:o,file:t,removed:!1};let s=await j(t,r.settings);return{client:o,file:t,removed:!0,backup:s}}async function R(){let o=p(),e=[];for(let t of J)await u(c(o[t],".."))&&e.push(t);return e}var Z=async()=>Promise.all((await R()).map(o=>B(o))),G=async()=>Promise.all((await R()).map(o=>z(o)));async function D(o,e=p()[o]){let t=await v(e);return t!=="invalid"&&JSON.stringify(t).includes(m)}var H={claude:"Claude Code",codex:"Codex",cursor:"Cursor"},_="which other programs the agent ran on media or timeline files (program names and file extensions only; never a command, a path, a name, a prompt or an output)";function q(o){return o.length?o.map(e=>{let t=H[e.client],n={installed:`${t}: agent hook installed in ${e.file}${e.backup?` (backup: ${e.backup})`:""}`,updated:`${t}: agent hook refreshed in ${e.file}`,kept:`${t}: agent hook already in ${e.file}`,skipped:`${t}: agent hook not installed (${e.detail})`,failed:`${t}: agent hook not installed: ${e.detail}`}[e.result];return e.client==="codex"&&(e.result==="installed"||e.result==="updated")?`${n}; Codex asks you to trust it once (/hooks)`:n}).concat(`It records ${_}. conformtools hooks off removes it; conformtools telemetry off removes it with the rest.`).join(`
|
|
5
|
-
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine; nothing to install."}function Q(o){let e=o.filter(t=>t.removed);return e.length?e.map(t=>`${H[t.client]}: agent hook removed from ${t.file}`).join(`
|
|
6
|
-
`):"Agent hook: not installed anywhere on this machine."}async function V(){let o=await R();return o.length?[...await Promise.all(o.map(async t=>`${H[t]}: agent hook ${await D(t)?"on":"off"} (${p()[t]})`)),`It records ${_}. conformtools hooks on|off.`].join(`
|
|
7
|
-
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine."}export{F as a,J as b,p as c,M as d,B as e,z as f,R as g,Z as h,G as i,D as j,_ as k,q as l,Q as m,V as n};
|
package/dist/chunk-ERUN634Q.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{Ub as D,Vb as F,Wb as N}from"./chunk-LKQTE6T5.js";import{i as j}from"./chunk-4VFDGL4E.js";import{$ as k,A as M,E as C,G as R,H as T,K as q,L,O as w,Z as b,aa as _,ca as I,g as y,m as O,r as S,s as A,t as x,u as P,x as H,z as E}from"./chunk-XI6XF7FQ.js";var B=16e3,h=class extends Error{constructor(t,i){super(i);this.code=t}},$=class d{constructor(e,t=j,i=B){this.spec=e;this.bridge=t;this.waitMs=i;this.renders=new Map;this.host=e.host,e.items&&(this.items=n=>this.modelItems(n??{}))}async peer(){let e=await(await this.bridge()).waitFor(this.host,this.waitMs);if(!e)throw new h("not_connected",`${this.host}: the conform.tools plugin in ${this.spec.label} is not connected. ${this.spec.setup}`);return e}async needs(e){let t=await this.peer();if(!t.capabilities.includes(e))throw new h("panel_old",`${this.host}: the conform.tools plugin open in ${this.spec.label} ${t.version||""} has no ${e} (an older plugin); update it (${this.spec.setup})`);return t}async ask(e,t={},i){return await this.peer(),await(await this.bridge()).request(this.host,e,t,i)}static{this.announced=(e,t)=>e.optional_verbs.includes(t)}async support(){let e={ok:!1,reason:"the renderplugin is a DaVinci Resolve plugin"},t;try{t=await(await this.bridge()).waitFor(this.host,Math.min(3e3,this.waitMs))}catch(s){let a={ok:!1,reason:s instanceof Error?s.message:String(s)};return{export:a,open:a,render:a,markers:a,renderplugin:e}}if(!t){let s={ok:!1,reason:`the conform.tools plugin in ${this.spec.label} is not connected`,setup:this.spec.setup};return{export:s,open:s,render:s,markers:s,renderplugin:e}}let i=(s,a)=>s?{ok:!0}:{ok:!1,reason:`this plugin version has no ${a}`},n=t.capabilities;return{export:i(n.includes("timeline_read")||n.includes("timeline_write"),"timeline_read"),open:i(d.announced(t,"timeline_write.import_file"),"timeline_write.import_file"),render:i(n.includes("render"),"render"),markers:i(n.includes("markers"),"markers"),renderplugin:e}}async current(){let e=await this.ask("session.current_project");if(!e)return{project:"",timelines:[],timeline:""};let t=await this.ask("session.timeline_count",{project:e}),i=[];for(let s=1;s<=t;s++){let a=await this.ask("session.timeline_by_index",{project:e,index:s});a&&i.push(await this.ask("session.name",{handle:a}))}let n=await this.ask("session.current_timeline",{project:e});return{project:await this.ask("session.name",{handle:e}),timelines:i,timeline:n?await this.ask("session.name",{handle:n}):""}}async project(e={}){let t=await this.current();return{project:t.project,timeline:e.timeline??t.timeline,timelines:t.timelines,tracks:[],jobs:[],found:{},pool:{path:"",clips:0,folders:[]}}}async sequence(e){let t=await this.ask("session.current_project");if(!t)throw new h("no_project",`${this.host}: no project is open`);if(!e){let s=await this.ask("session.current_timeline",{project:t});if(!s)throw new h("no_timeline",`${this.host}: no timeline is active`);return{project:t,seq:s,name:await this.ask("session.name",{handle:s})}}let i=await this.ask("session.timeline_count",{project:t}),n=[];for(let s=1;s<=i;s++){let a=await this.ask("session.timeline_by_index",{project:t,index:s});if(!a)continue;let p=await this.ask("session.name",{handle:a});if(p===e)return{project:t,seq:a,name:p};n.push(p)}throw new h("not_found",`${this.host}: no timeline named "${e}" (have: ${n.join(", ")})`)}async model(e){let{project:t,seq:i}=await this.sequence(e);return await this.ask("timeline_read.model",{timeline:i,project:t},12e4)}async export(e){if(!e.out_path)throw new h("usage",`${this.host}: export needs out_path`);let t=await this.peer(),{project:i,seq:n,name:s}=await this.sequence(e.timeline),a=await this.ask("session.name",{handle:i}),p=r=>d.announced(t,r),m=e.out_path,c,l=[];if(p("timeline_write.export_otio")||p("timeline_write.export_xml")){let r=p("timeline_write.export_otio"),o=await this.ask(r?"timeline_write.export_otio":"timeline_write.export_xml",{project:i,timeline:n,path:e.out_path},12e4);if(c=o.format??(r?"otio":"xmeml"),o.ok===!1)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${e.out_path}${o.errors?.length?` (${o.errors.join("; ")})`:""}`);o.path&&o.path!==e.out_path&&(m=await this.adopt(o.path,e.out_path)),l=o.warnings??[]}else if(p("timeline_read.export_file")){let r=await this.ask("timeline_read.export_file",{timeline:n,fmt:"otio",path:e.out_path},12e4);if(!r)throw new h("export_failed",`${this.host}: ${this.spec.label} exported no OTIO`);c="otio",r!==e.out_path&&(m=await this.adopt(r,e.out_path))}else{await this.needs("timeline_read");let r=await this.ask("timeline_read.model",{timeline:n,project:i},12e4),o=J(r);await E(e.out_path,JSON.stringify(o.otio)),c="otio",l=o.notes}if(!D.includes(c))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${c}, which the engine does not read (${m})`);if(!await P(m)||(await A(m)).size===0)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${m}`);return{path:m,format:c,project:a,timeline:s,...l.length?{notes:l}:{}}}async adopt(e,t){let i=k(e)&&k(e)!==k(t)?t.slice(0,t.length-k(t).length)+k(e):t;if(await C(e,i),!F(i))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${b(e)}, which the engine does not read`);return i}async open(e){if(e.into==="scratch")throw new h("unsupported",`${this.host}: opening into a scratch project is not supported; the import lands in the open project`);let t=await this.peer();if(!d.announced(t,"timeline_write.import_file"))throw new h("unsupported",`${this.host}: this conform.tools plugin cannot import timelines (${this.spec.setup})`);let i=await this.ask("session.current_project");if(!i)throw new h("no_project",`${this.host}: no project is open`);let n=await this.ask("timeline_write.import_file",{project:i,path:e.path,sequences:null},3e5);if(!n.ok)throw new h("import_failed",`${this.host}: ${this.spec.label} did not import ${e.path}${n.issues?.length?` (${n.issues.join("; ")})`:""}`);let s=[...n.issues??[]];return n.imported.length>1&&s.push(`imported ${n.imported.length} timelines: ${n.imported.map(a=>a.name).join(", ")}`),e.name&&s.push(`${this.spec.label} names imported timelines after the file's own; name was not applied`),e.media_dirs?.length&&s.push(`${this.spec.label} links media from the paths in the file; media_dirs was not used (relink with timeline_relink before writing)`),{project:await this.ask("session.name",{handle:i}),timeline:n.imported[0]?.name??b(e.path),notes:s,restored:!e.stay,...n.bin?{folder:n.bin}:{}}}async modelItems(e){let t=await this.model(e.timeline),i=[...e.kind==="audio"?[]:t.items.map(n=>({kind:"video",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:n.handle?.$h??n.clip_id??"",name:n.name??"",color:n.color??"",flags:n.flags??[],enabled:n.enabled??!0,file:n.file_path})),...e.kind==="video"?[]:(t.audio_items??[]).map(n=>({kind:"audio",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:"",name:n.name??"",file:n.file_path??""}))].filter(n=>e.track===void 0||n.track===e.track);return{project:(await this.current()).project,timeline:t.timeline,start_frame:t.start_frame,fps:t.fps,items:i,color_groups:[],layers:1}}async apply(e){let t=e.ops.length>0&&e.ops.every(l=>l.op==="timeline_rename"&&(l.timeline||l.guid)),{project:i,seq:n,name:s}=await this.sequence(t?void 0:e.timeline),a=[],p=[],m=l=>l.op.startsWith("marker_")&&!l.item;for(let l=0;l<e.ops.length;){let r=l;for(;r<e.ops.length&&m(e.ops[r])===m(e.ops[l]);)r++;let o=e.ops.slice(l,r),u=m(o[0])?await this.markerOps(n,o):await this.clipOps(n,o,e.timeline);a.push(...u.results),p.unshift(...u.undo),l=r}let c=a.filter(l=>l.ok).length;return{project:await this.ask("session.name",{handle:i}),timeline:s,results:a,undo:p,applied:c,failed:a.length-c}}async clipOps(e,t,i){let n=await this.peer();if(n.capabilities.includes("edit"))return await this.ask("edit.apply",{timeline:e,ops:t},6e4+t.length*500);let s=(l,r)=>({op:l.op,ok:!1,detail:r});if(!n.capabilities.includes("item_meta"))return{results:t.map(l=>s(l,`${this.host}: clip edits are not reachable over this plugin`)),undo:[]};let a=await this.model(i),p=l=>l?"id"in l?{$h:l.id}:(l.kind??"video")!=="video"?null:a.items.find(r=>r.track===l.track&&r.start-a.start_frame===l.start)?.handle??null:null,m=[],c=[];for(let l of t){let r=p(l.item);try{if(!r)m.push(s(l,`no video item at ${JSON.stringify(l.item??null)}`));else if(l.op==="clip_color"){let o=await this.ask("item_meta.color",{handle:r}),u=l.color?await this.ask("item_meta.set_color",{handle:r,color:l.color}):await this.ask("item_meta.clear_color",{handle:r});m.push({op:l.op,ok:u}),u&&c.unshift({op:"clip_color",item:l.item,color:o})}else if(l.op==="enabled"&&d.announced(n,"item_meta.set_enabled")){let o=a.items.find(f=>f.handle?.$h===r.$h)?.enabled??!0,u=await this.ask("item_meta.set_enabled",{item:r,enabled:!!l.on});m.push({op:l.op,ok:u}),u&&c.unshift({op:"enabled",item:l.item,on:o})}else m.push(s(l,`${this.host}: '${l.op}' is not reachable over this plugin`))}catch(o){m.push(s(l,o instanceof Error?o.message:String(o)))}}return{results:m,undo:c}}async markerOps(e,t){let i=await this.peer(),n=r=>d.announced(i,r),s=new Map((await this.ask("markers.list",{target:e})).map(r=>[r.frame,r])),a=[],p=[],m=async r=>{let o=await this.ask("markers.add",{target:e,frame:r.frame,color:r.color??"",name:r.name??"",note:r.note??"",duration:r.duration??1,custom_data:r.custom_data??""});return o&&s.set(r.frame,{color:"",name:"",note:"",duration:1,...r}),o},c=async r=>{let o=await this.ask("markers.delete_at",{target:e,frame:r});return o&&s.delete(r),o},l=r=>({op:"marker_add",frame:r.frame,color:r.color,name:r.name,note:r.note,duration:r.duration,...r.custom_data?{data:r.custom_data}:{}});for(let r of t){let o=Number(r.frame);try{if(r.op==="marker_add"){let u=s.get(o);u&&await c(o);let f=await m({frame:o,color:r.color,name:r.name,note:r.note,duration:Number(r.duration??1),custom_data:r.data});a.push({op:r.op,ok:f}),f&&p.unshift(...u?[l(u)]:[],{op:"marker_delete",frame:o})}else if(r.op==="marker_update"){let u=s.get(o);if(!u){a.push({op:r.op,ok:!1,detail:`no marker at frame ${o}`});continue}let f=r.to_frame!==void 0?Number(r.to_frame):o,v={...u,frame:f,...r.color!==void 0?{color:String(r.color)}:{},...r.name!==void 0?{name:String(r.name)}:{},...r.note!==void 0?{note:String(r.note)}:{}},g=!0;n("markers.set_color")&&n("markers.set_text")&&n("markers.move")?(r.color!==void 0&&(g=await this.ask("markers.set_color",{target:e,frame:o,color:r.color})&&g),(r.name!==void 0||r.note!==void 0)&&(g=await this.ask("markers.set_text",{target:e,frame:o,name:r.name,note:r.note})&&g),f!==o&&(g=await this.ask("markers.move",{target:e,frame:o,to_frame:f})&&g),s.delete(o),s.set(f,v)):g=await c(o)&&await m(v),a.push({op:r.op,ok:g}),p.unshift({op:"marker_update",frame:f,color:u.color,name:u.name,note:u.note,...f!==o?{to_frame:o}:{}})}else if(r.op==="marker_delete"){let u=s.get(o),f=!!u&&await c(o);a.push({op:r.op,ok:f,...u?{}:{detail:`no marker at frame ${o}`}}),f&&u&&p.unshift(l(u))}else a.push({op:r.op,ok:!1,detail:`${this.host}: '${r.op}' is not reachable over this plugin`})}catch(u){a.push({op:r.op,ok:!1,detail:u instanceof Error?u.message:String(u)})}}return{results:a,undo:p}}async renderStart(e){if(await this.needs("render"),e.renderplugin)throw new h("unsupported","the renderplugin is a DaVinci Resolve plugin");if(e.disable_tracks?.length||e.audio_tracks?.length)throw new h("unsupported",`${this.host}: disable_tracks / audio_tracks are DaVinci Resolve's; pick a preset that renders what you need`);if(!e.preset)throw new h("usage",`${this.host}: preset is required: one of ${this.spec.label}'s export presets by name`);let{seq:t,name:i}=await this.sequence(e.timeline),n=e.name??i,s={purpose:"deliver",format:"preset",preset:e.preset,target_dir:e.target_dir,name:n,...e.range?{range:[e.range.in,e.range.out]}:{}},a=await this.ask("render.submit",{timeline:t,job:s});if(!a?.id)throw new h("render_refused",`${this.host}: ${a?.error??`${this.spec.label} refused the render`}`);if(!await this.ask("render.start",{job_ids:[a.id]}))throw new h("render_refused",`${this.host}: ${this.spec.label} did not start job ${a.id}`);return this.renders.set(a.id,{dir:e.target_dir,name:n}),{job_id:a.id,state:"queued",percent:0}}async renderStatus(e){let t=await this.ask("render.status",{job_id:e});if(!t)return{job_id:e,state:"failed",percent:0,error:`${this.host}: no render job ${e}`};let i={done:"complete",rendering:"rendering",queued:"queued",failed:"failed",cancelled:"cancelled"}[t.state]??"rendering",n={job_id:e,state:i,percent:Math.round(t.progress??(i==="complete"?100:0)),...t.error?{error:t.error}:{}};if(i==="complete"||i==="failed"||i==="cancelled"){let s=this.renders.get(e);i==="complete"&&s&&(n.outputs=await W(s.dir,s.name)),await this.ask("render.remove",{job_id:e}).catch(()=>!1),this.renders.delete(e)}return n}async renderCancel(e){return await this.ask("render.cancel",{job_id:e})?{job_id:e,state:"cancelled",percent:0}:{...await this.renderStatus(e),error:`${this.spec.label}'s running export cannot be cancelled from here; stop it in ${this.spec.label}`}}};async function W(d,e){let t=[];try{for await(let i of L(d))i.isFile&&i.name.startsWith(`${e}.`)&&t.push(_(d,i.name))}catch{}return t.sort()}function J(d){let e=(c,l)=>({OTIO_SCHEMA:"RationalTime.1",value:c,rate:l}),t=(c,l,r,o=r)=>({OTIO_SCHEMA:"TimeRange.1",start_time:e(c,r),duration:e(l,o)}),i=d.fps,n=d.tracks?.length?d.tracks:[...new Set(d.items.map(c=>c.track))].sort((c,l)=>c-l).map(c=>({index:c,enabled:!0,name:"",items:d.items.filter(l=>l.track===c)})),s=c=>(c.reversed?-1:1)*(c.speed||1)/(c.fps_factor||1),a=new Map;for(let c of d.items)if(c.file_path&&c.start_tc!=null&&c.src_abs_in!=null){let l=c.src_abs_in-c.start_tc+Math.ceil((c.end-c.start)*Math.abs(s(c))*(c.fps_factor||1));a.set(c.file_path,Math.max(a.get(c.file_path)??0,l))}let p=n.map(c=>{let l=d.start_frame,r=[];for(let o of[...c.items].sort((u,f)=>u.start-f.start)){if(o.start<l)continue;o.start>l&&r.push({OTIO_SCHEMA:"Gap.1",name:"",source_range:t(0,o.start-l,i)});let u=o.src_fps||i,f=o.start_tc!=null&&a.has(o.file_path)?o.start_tc:null,v=f!=null?o.src_abs_in:o.src_in??o.src_abs_in??0,g=s(o);r.push({OTIO_SCHEMA:"Clip.2",name:o.name??b(o.file_path||""),enabled:o.enabled!==!1,source_range:t(v,o.end-o.start,u,i),media_references:{DEFAULT_MEDIA:{OTIO_SCHEMA:"ExternalReference.1",name:b(o.file_path||""),target_url:o.file_path?`file://${o.file_path}`:"",...f!=null?{available_range:t(f,a.get(o.file_path),u)}:{},metadata:{}}},active_media_reference_key:"DEFAULT_MEDIA",effects:Math.abs(g-1)>1e-6?[{OTIO_SCHEMA:"LinearTimeWarp.1",name:"",effect_name:"LinearTimeWarp",time_scalar:g}]:[],markers:[],metadata:o.reel?{cmx_3600:{reel:o.reel}}:{}}),l=o.end}return{OTIO_SCHEMA:"Track.1",name:c.name||`V${c.index}`,kind:"Video",enabled:c.enabled!==!1,children:r,effects:[],markers:[],metadata:{}}}),m=[];return d.audio_items?.length&&m.push(`${d.audio_items.length} audio clip(s) not carried: the host's plugin reports no audio source times`),d.transitions?.length&&m.push(`${d.transitions.length} transition(s) not carried (cuts in their place)`),{otio:{OTIO_SCHEMA:"Timeline.1",name:d.timeline,global_start_time:e(d.start_frame,i),metadata:{},tracks:{OTIO_SCHEMA:"Stack.1",name:"tracks",children:p,effects:[],markers:[],metadata:{}}},notes:m}}var X=16e3;var G="Install the conform.tools panel (host_setup host=premiere action=install_panel), then in Premiere open Window > UXP Plugins > conform.tools. It connects by itself from then on.";var U=class extends ${constructor(t=j,i=X){super({host:"premiere",label:"Premiere Pro",setup:G},t,i);this.items=async(t={})=>{await this.needs("edit");let{seq:i}=await this.sequence(t.timeline),n=await this.ask("edit.items",{timeline:i,kind:t.kind,track:t.track},12e4),s=n.project_path?await K(n.project_path,n.timeline).catch(p=>({error:p instanceof Error?p.message:String(p)})):{error:"the project has never been saved"},a=0;if(!("error"in s))for(let p of n.items){let m=s.get(`${p.kind}:${p.track}:${p.start}:${Number(p.end)-Number(p.start)}`);m?Object.assign(p,m,{saved:!0}):(p.saved=!1,a++)}return{...n,color_groups:[],layers:1,..."error"in s?{saved_note:`saved project not read: ${s.error}`}:{unsaved_items:a}}};this.premiereRenders=new Map}async current(){let t=await this.ask("session.describe");return{project:t.project,timelines:t.timelines,timeline:t.current}}async liveMarkers(t){if(!$.announced(await this.peer(),"edit.markers"))return null;let{seq:i}=await this.sequence(t);return await this.ask("edit.markers",{timeline:i},12e4)}async model(t){return await super.model(t)}async projectClips(){return await this.needs("edit"),await this.ask("edit.project_clips",{},12e4)}async relinkClips(t){return await this.needs("edit"),await this.ask("edit.relink_clips",{items:t},6e4+t.length*2e3)}async cutIn(t,i){await this.needs("edit");let{seq:n}=await this.sequence(t);return await this.ask("edit.cut_in",{timeline:n,cuts:i},12e4+i.length*3e3)}async renderStart(t){if(t.range)throw new h("unsupported","premiere: a frame range is not supported yet; set in/out on the sequence in Premiere");if(!t.preset||!/\.epr$/i.test(t.preset))throw new h("usage","premiere: preset must be the path of a Media Encoder preset (.epr)");let{seq:i,name:n}=await this.sequence(t.timeline);await M(t.target_dir);let s=_(t.target_dir,`${t.name??n}.mov`),a=await this.ask("render.export_sequence",{timeline:i,output_path:s,preset_path:t.preset,queue:!1},6e4);if(!a.ok)throw new h("render_refused","premiere: Premiere refused the export");let p=a.job||`ppro-${Date.now()}`;return this.premiereRenders.set(p,s),{job_id:p,state:"rendering",percent:0}}async renderStatus(t){let i=await this.ask("render.progress"),n=i[t]??i.last,s=this.premiereRenders.get(t);return n?.event==="error"||n?.event==="onEncodeError"?{job_id:t,state:"failed",percent:0,error:String(n.data??"encode error")}:n?.event==="complete"||n?.event==="onEncodeComplete"||s&&await x(s)&&!n?{job_id:t,state:"complete",percent:100,...s?{outputs:[s]}:{}}:{job_id:t,state:"rendering",percent:typeof n?.data=="number"?Math.round(Number(n.data)*100):0}}async renderCancel(t){return{job_id:t,state:"cancelled",percent:0,error:"Premiere's export cannot be cancelled from here; cancel it in Premiere / Media Encoder"}}};async function K(d,e){let{session:t}=await N(d,"prproj"),i=t.timelines.find(s=>s.name===e),n=new Map;if(!i)throw new Error(`the saved project has no sequence "${e}" (saved before it was made?)`);for(let s of i.tracks)if(!(s.kind!=="Video"&&s.kind!=="Audio"))for(let a of s.items){if(a.kind==="gap"||a.kind==="transition")continue;let p=a;n.set(`${s.kind==="Video"?"video":"audio"}:${s.track_index}:${a.timeline_range.start.value}:${a.timeline_range.duration.value}`,{saved_id:a.id,...p.speed_factor!=null&&p.speed_factor!==1?{retime:p.speed_factor}:{},...p.speed_ramped?{ramped:!0}:{},...p.speed_reverse?{reversed:!0}:{},...a.kind==="nested"?{nested:!0}:{},...p.is_multicam?{multicam:!0}:{},...p.effects?.some(m=>/stabiliz/i.test(m.kind??""))?{stabilized:!0}:{},...p.effects?.length?{saved_effects:p.effects.map(m=>m.name??m.kind??"")}:{}})}return n}function z(d=y()){return d==="darwin"?"/Library/Application Support/Adobe/Adobe Desktop Common/RemoteComponents/UPI/UnifiedPluginInstallerAgent/UnifiedPluginInstallerAgent.app/Contents/MacOS/UnifiedPluginInstallerAgent":d==="win32"?"C:\\Program Files\\Common Files\\Adobe\\Adobe Desktop Common\\RemoteComponents\\UPI\\UnifiedPluginInstallerAgent\\UnifiedPluginInstallerAgent.exe":null}async function V(){for(let d of["./uxp-plugin/","./premiere-uxp/"]){let e=S(new URL(d,import.meta.url));if(await P(_(e,"manifest.json")))return e}throw new Error("premiere: the conform.tools panel is missing from this install")}async function Q(){return JSON.parse(await H(_(await V(),"manifest.json"))).version}async function oe(d=y()){let e=z(d);if(!e||!await x(e))return{installed:!1,listing:"Creative Cloud's plugin installer is not on this machine"};let t=await w(e,d==="win32"?["/list","all"]:["--list","all"],{timeoutMs:6e4}),i=t.stdout.split(`
|
|
4
|
-
`).find(n=>/CONFORM\.TOOLS|conformtools/i.test(n));return{installed:!!i&&/enabled|installed/i.test(i),version:i?.match(/(\d+\.\d+\.\d+)\s*$/)?.[1],listing:t.stdout.trim()}}async function ae(d=y()){let e=z(d);if(!e||!await x(e))throw new Error("premiere: Creative Cloud's plugin installer (UnifiedPluginInstallerAgent) is not on this machine; install Creative Cloud");let t=await V(),i=await Q(),n=await q("conform-ccx-");for(let l of["manifest.json","index.html","index.js","lib","icons"])await T(_(t,l),_(n,l));let s=_(O(),"premiere");await M(s);let a=I(_(s,`conformtools-premiere-${i}.ccx`));await R(a);let p=d==="darwin"?await w("sh",["-c",`cd '${n.replace(/'/g,"'\\''")}' && zip -r -q -X '${a.replace(/'/g,"'\\''")}' manifest.json index.html index.js lib icons`]):await w("powershell",["-NoProfile","-Command",`Compress-Archive -Path '${n}\\*' -DestinationPath '${a.replace(/\.ccx$/,".zip")}' -Force; Move-Item -Force '${a.replace(/\.ccx$/,".zip")}' '${a}'`]);if(await R(n),!p.success)throw new Error(`premiere: could not package the panel: ${p.stderr.trim()}`);await w(e,d==="win32"?["/remove","conform.tools"]:["--remove","conform.tools"],{timeoutMs:12e4});let m=await w(e,d==="win32"?["/install",a]:["--install",a],{timeoutMs:18e4}),c=`${m.stdout}
|
|
5
|
-
${m.stderr}`.trim();if(!m.success||!/Installation Successful/i.test(c))throw new Error(`premiere: Adobe's installer refused the panel: ${c.split(`
|
|
6
|
-
`).pop()}`);return{version:i,ccx:a,output:c}}export{$ as a,U as b,K as c,Q as d,oe as e,ae as f};
|