conformtools 0.6.27 → 0.6.29
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/dist/{account-RSL4PTDB.js → account-F4ODJBD2.js} +1 -1
- package/dist/{agent-hook-setup-IACTYSVL.js → agent-hook-setup-KBCGZNEE.js} +1 -1
- package/dist/{analysis-engine-BBOSGAB2.js → analysis-engine-LGB4OXG7.js} +1 -1
- package/dist/{bridge-42OMO43V.js → bridge-GLW34YZF.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-2DMNGWC2.js → chunk-7DH6DFYL.js} +1 -1
- package/dist/{chunk-XLRQNFJU.js → chunk-BZE7IP6U.js} +91 -91
- package/dist/{chunk-TGLH2JDW.js → chunk-FHCRWOI7.js} +1 -1
- package/dist/{chunk-NRURUPLU.js → chunk-GDPYFRSV.js} +1 -1
- package/dist/chunk-H3FD5KA2.js +7 -0
- package/dist/{chunk-BIX5ETBY.js → chunk-HHOFGYZ7.js} +1 -1
- package/dist/{chunk-YMRK5D3X.js → chunk-HZBGG7HI.js} +1 -1
- package/dist/{chunk-AR5BTVBM.js → chunk-KD7UGCLT.js} +1 -1
- package/dist/{chunk-2X2SFPWD.js → chunk-NTPDZOPF.js} +1 -1
- package/dist/chunk-QDL3XYOE.js +545 -0
- package/dist/chunk-QQBDHVUU.js +3 -0
- package/dist/chunk-RKJML7MH.js +10 -0
- package/dist/{chunk-T4B4Y5WQ.js → chunk-RVKNGIE3.js} +2 -2
- package/dist/{chunk-3KS3547B.js → chunk-SSFG7FNI.js} +1 -1
- package/dist/{chunk-UXEL636C.js → chunk-UXVABU6B.js} +1 -1
- package/dist/{chunk-6BL5HE4S.js → chunk-WJS6NM7T.js} +1 -1
- package/dist/{chunk-RL5XRG6O.js → chunk-WWE2FXAQ.js} +1 -1
- package/dist/{chunk-HNEKQMQG.js → chunk-YJREJ2MH.js} +1 -1
- package/dist/{chunk-JZCADV5C.js → chunk-ZE7BP4AE.js} +1 -1
- package/dist/{claude-setup-6RMV3QZM.js → claude-setup-FYWGYBTH.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/demo-engine-5HWLXPDJ.js +3 -0
- package/dist/{engine-I2NXY2OK.js → engine-LFB243Q6.js} +2 -2
- package/dist/{framing-PHFTZ4GL.js → framing-KHUFARKE.js} +1 -1
- package/dist/gfx-worker.js +1 -1
- package/dist/h264-QGSP23K2.js +3 -0
- package/dist/{h264-mxf-PKSTGNGH.js → h264-mxf-I4YANT5F.js} +1 -1
- package/dist/{host-relink-FHOEDE76.js → host-relink-L7I75SUH.js} +1 -1
- package/dist/{hosted-26GUD7IU.js → hosted-5Y5VX6X6.js} +1 -1
- package/dist/hosts-QMGBN2E6.js +3 -0
- package/dist/http.js +2 -2
- package/dist/{inspect-RT36GEVU.js → inspect-GP6B6UPD.js} +2 -2
- package/dist/{isobmff-65LRNCQH.js → isobmff-LAXAYC7P.js} +1 -1
- package/dist/{mc-video-2PCAX65A.js → mc-video-KQ7TP4DG.js} +1 -1
- package/dist/mcp.js +7 -7
- package/dist/{media-OXHZ3PGZ.js → media-SUPBJX64.js} +1 -1
- package/dist/{mxf-WFJNAX7D.js → mxf-2TQO552L.js} +1 -1
- package/dist/{ops-SH3IUU2Z.js → ops-CVKPID5Z.js} +1 -1
- package/dist/{probe-VB6JH6ZJ.js → probe-HUPB4H4G.js} +1 -1
- package/dist/{r3d-X2O5LUAB.js → r3d-EPSGIBPT.js} +1 -1
- package/dist/resolve-bridge.py +4 -1
- package/dist/{sequence-patch-OHYBBKKZ.js → sequence-patch-GXM3QSJC.js} +1 -1
- package/dist/{store-F2CTSR6E.js → store-K4W2LVRN.js} +1 -1
- package/dist/{timeline-AK6DUMWB.js → timeline-HTG23FEH.js} +1 -1
- package/package.json +5 -5
- package/dist/chunk-E4KQR4M3.js +0 -10
- package/dist/chunk-IDADYIY6.js +0 -7
- package/dist/chunk-M6SVZJAX.js +0 -537
- package/dist/chunk-ZPIY5DOU.js +0 -3
- package/dist/demo-engine-ITZ7VG6Q.js +0 -3
- package/dist/h264-TVMYQ7EB.js +0 -3
- package/dist/hosts-DXH4SQPZ.js +0 -3
|
@@ -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{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q}from"./chunk-
|
|
3
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q}from"./chunk-RKJML7MH.js";import"./chunk-3PVQ5QP4.js";import"./chunk-VFXMP7IF.js";import"./chunk-BBCQMZQN.js";import"./chunk-ASFUV3PB.js";import"./chunk-GDPYFRSV.js";import"./chunk-FHCRWOI7.js";import"./chunk-NU3X7P4N.js";import"./chunk-7Z65WW4I.js";import"./chunk-E75BCWXY.js";import"./chunk-QQBDHVUU.js";import"./chunk-PSANHDZM.js";export{a as MEDIA_EXTS,g as bwfAt,q as coverage,e as decodeFrameRgba,o as factsLine,h as factsText,n as findMedia,p as findText,c as folderClip,i as islandsFor,m as nameMatch,l as normName,d as openSource,f as probeMedia,b as siblingParts,k as trimMedia,j as trimSource};
|
|
@@ -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 G}from"./chunk-AACY2V3L.js";import{b as $}from"./chunk-
|
|
3
|
+
import{a as G}from"./chunk-AACY2V3L.js";import{b as $}from"./chunk-GDPYFRSV.js";import{b as j}from"./chunk-FHCRWOI7.js";import{Ja as l,M as P,R as z,b as U,ca as T,da as D,e as B,ea as E,fa as C,g as M,ga as L,ja as V,ra as W,ta as g,w as O,wa as N,ya as J}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";var v=new Uint8Array([6,14,43,52,2,5,1,1,13,1,2,1,1,17,1,0]);function se(n){e:for(let r=n.length-v.length;r>=0;r--){for(let e=0;e<v.length;e++)if(n[r+e]!==v[e])continue e;return r}return-1}function Z(n,r){if(r>=n.byteLength)return[null,0];let e=n.getUint8(r);if(e<128)return[e,1];let t=e&127;if(t===0||t>8||r+1+t>n.byteLength)return[null,1];let a=0;for(let i=0;i<t;i++)a=a*256+n.getUint8(r+1+i);return[a,1+t]}function w(n,r){let e=n.getUint32(r,!1),t=n.getUint32(r+4,!1);return e*4294967296+t}async function H(n){let r=n.fileSize,e=[];if(r<1024)return e;let a=Math.max(0,r-65536),i=r-a,o=await n.read(a,i);e.push({offset:a,length:i});let s=se(o);if(s<0)return e;let c=new DataView(o.buffer,o.byteOffset,o.byteLength),[f,te]=Z(c,s+16);if(f===null||f<16||f>65536)return e;let A=s+16+te;if(A+f>o.length)return e;let F=[],ne=new DataView(o.buffer,o.byteOffset+A,f),_=Math.floor((f-4)/12);if(_<1||_>4096)return e;for(let u=0;u<_;u++){let p=w(ne,u*12+4);p>=0&&p<r&&F.push(p)}for(let u of F){let p=Math.min(256,r-u),b=await n.read(u,p);if(b.length<80)continue;let y=new DataView(b.buffer,b.byteOffset,b.byteLength),[R,k]=Z(y,16);if(R===null)continue;let m=16+k,x,S;if(b.length<m+64){let oe=Math.min(m+64,r-u),h=await n.read(u,oe);if(h.length<m+64)continue;let I=new DataView(h.buffer,h.byteOffset,h.byteLength);x=w(I,m+32),S=w(I,m+40)}else x=w(y,m+32),S=w(y,m+40);let ae=u+16+k+R+x+S,ie=Math.min(ae+65536,r)-u;e.push({offset:u,length:ie})}return e}function q(n,r){let e=[];for(let t of n){if(t.kind!=="clip"||!t.source_range)continue;let a=t.source_range.start.value,i=t.source_range.duration.value,o=Math.max(0,Math.floor(a)-r),s=Math.floor(a+i-1)+r;s>=o&&e.push({first_frame:o,last_frame:s})}return e}function ce(n,r){let e=[...n].sort((i,o)=>i.offset-o.offset),t=[],a=0;for(let i of e)i.offset>a&&t.push({offset:a,length:i.offset-a}),a=Math.max(a,i.offset+i.length);return a<r&&t.push({offset:a,length:r-a}),t}async function K(n,r,e){let t=q(r,0);if(t.length===0)throw new Error("planMxfTrimsFromItems: no usable trim ranges in items");await l();let a=(o,s)=>n.read(o,s),i=await $(t,e,(o,s)=>g(a,n.fileSize,o,s));return i.map((o,s)=>{let c=JSON.parse(o);return i.length>1&&(c.output_clip_number=s+1,c.output_clip_count=i.length,c.output_part_number=1),c})}async function Q(n,r,e){await l();let t=q(r,e),i=await N((s,c)=>n.read(s,c),n.fileSize,JSON.stringify(t));if(i!=="null")return JSON.parse(i);console.warn(`[mxf] no parseable index \u2014 shipping the WHOLE file (${n.fileSize} bytes). The cut's ${t.length} range(s) cannot be addressed; nothing is trimmed.`);let o=(await H(n)).map(s=>({offset:s.offset,length:s.length}));return{fileSize:n.fileSize,structuralRanges:o,essenceRanges:ce(o,n.fileSize),trimInputs:t,wholeFileFallback:!0}}async function X(n){await l();let e=await J((t,a)=>n.read(t,a),n.fileSize);return JSON.parse(e)}function d(n){return(r,e)=>n.read(r,e)}var Pe={async inspect(n){let r=n.parts[0],e=await X(r);if(!e)return null;let t=e.timecode??null,a=t&&t.fps_denominator>0?t.fps_numerator/t.fps_denominator:null,i=e.width??null,o=e.height??null,s=e.inner_codec==="mpeg2"||e.inner_codec==="dv"?e.inner_codec:null;return{id:r.filename,kind:"external",target_url:r.filename,available_range:a&&e.frame_count?{start:{value:0,rate:a},duration:{value:e.frame_count,rate:a}}:null,reel_name:e.avid?.tape_name??null,source_timecode:t?.display??null,source_fps:a,source_resolution_w:i,source_resolution_h:o,container:"mxf",codec:s,size_bytes:r.fileSize,streams:[...i||o||a?[{kind:"video",codec:s,width:i??void 0,height:o??void 0,rate:a??void 0,codec_specific:null}]:[],...e.audio?[{kind:"audio",codec:e.audio.codec_fourcc,channels:e.audio.channels??void 0,rate:e.audio.sample_rate??void 0,bit_depth:e.audio.bit_depth??void 0,codec_specific:{fourcc:e.audio.codec_fourcc}}]:[]],decode_provenance:e.decode_provenance??null,vendor_metadata:{frame_count:e.frame_count,...t?{drop_frame:t.drop_frame}:{},...e.inner_codec?{inner_codec:e.inner_codec}:{},...e.truncated?{truncated:!0}:{},...e.avid?{avid:{...e.avid,kind:i||o?"picture":"sound"}}:{}},binding_state:"unbound",raw_extraction:{mxf_probe:e},metadata:{}}},async extract(n){await l();let r=n.parts[0],e=JSON.parse(await V(d(r),r.fileSize));return e.length===0?null:{v:1,container:"mxf",codec:"mxf",frame_count:G(e),granularity:"frame",segments:e}},async sparsify(n,r){let e=n.parts[0],t=await Q(e,r.items,r.handles);return[{filename:e.filename,fileSize:t.fileSize,structuralRanges:t.structuralRanges,essenceRanges:t.essenceRanges,trimInputs:t.trimInputs,wholeFileFallback:t.wholeFileFallback}]},async trim(n,r){let e=n.parts[0];if(!e.dataRanges)return K(e,r.items,r.handles);await l();let t=JSON.parse(await W(d(e),e.fileSize,JSON.stringify(e.dataRanges)));if(t.length===0)throw new Error("mxf trim: no whole frames present in this sparse file");let a=[];for(let[i,[o,s]]of t.entries()){let c=JSON.parse(await g(d(e),e.fileSize,o,s+1));t.length>1&&Object.assign(c,{output_clip_number:i+1,output_clip_count:t.length,output_part_number:1}),a.push(c)}return a},async decode(n,r,e){await l();let t=n.parts[0],a=d(t),i=await re(n),o=e.detail==="coarse",s;if(i==="arriraw")s=await M(a,t.fileSize,r,o?"preview:4":"full");else if(i==="arriraw-alev3")s=await B(a,t.fileSize,r,o?"preview:4":"full");else if(i==="dnxhr")s=await P(a,t.fileSize,r,o?"preview":"full");else if(i==="xocn")s=await z(a,t.fileSize,r,o?"preview":"full");else if(i==="prores")s=await O(a,t.fileSize,r,o?"preview":"full");else throw new Error(`mxf decode: no decoder for inner codec '${i}'`);let c=new DataView(s.buffer,s.byteOffset,8);return{width:c.getUint32(0,!0),height:c.getUint32(4,!0),rgba:s.slice(8)}},async decode16(n,r){await l();let e=n.parts[0],t=d(e),a=await re(n),i;try{if(a==="arriraw"){let o=await le(n,r);if(o)return o;i=await M(t,e.fileSize,r,"rgb16")}else if(a==="dnxhr")i=await P(t,e.fileSize,r,"rgb16");else if(a==="xocn")i=await z(t,e.fileSize,r,"rgb16");else throw new Error(`mxf decode16: no decoder for inner codec '${a}'`)}catch(o){throw ue(o,a)}return j(i)}};function ue(n,r){let e=typeof n=="string"?n:n instanceof Error?n.message:"";return/has no 16-bit decoder|no rgb16 tier/.test(e)?new Error(`mxf ${r}: has no 16-bit decoder \u2014 ${e}`):n}var Y=new WeakMap;async function le(n,r){if(!!0)return null;try{let e=await import("./arriraw-PS6V532Y.js");if(!await e.arrirawGpuAvailable())return null;let{parseArrirawGpuPayload:t,arrirawFrameToRgb16:a}=await import("./clip-state-B6JOX3JE.js"),i=n.parts[0],o=Y.get(n)??null,s=await U(d(i),i.fileSize,r,o?.key),c=t(s,o);if(!c)return null;Y.set(n,{key:c.key,state:c.state});let f=await e.decodeArrirawFrameGpu(c.essence,c.state);return f?{width:f.width,height:f.height,rgb16:a(f)}:null}catch{return null}}var ee=new WeakMap;async function re(n){let r=ee.get(n);if(r)return r;await l();let e=n.parts[0],t=d(e),a="mxf";return await D(t,e.fileSize)?a="arriraw":await T(t,e.fileSize)?a="arriraw-alev3":await C(t,e.fileSize)?a="dnxhr":await L(t,e.fileSize)?a="xocn":await E(t,e.fileSize)&&(a="prores"),ee.set(n,a),a}export{Pe as mxfFormat};
|
|
@@ -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,i}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-FHCRWOI7.js";import"./chunk-PSANHDZM.js";export{c as CoverageMissError,e as DeliveryCoverageMissError,a as INTENTS,f as asDeliveryCoverageMiss,h as extract,i as mediaOp,d as parseDeliveryCoverageMiss,g as resolveFormat,b as unpackFrame16};
|
|
@@ -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{
|
|
3
|
+
import{J as b,S as $,b as m,ea as o,h as c,k as p,p as f,v as d}from"./chunk-QQBDHVUU.js";import"./chunk-PSANHDZM.js";import{dirname as g}from"node:path";import{fileURLToPath as P}from"node:url";import x from"node:process";var a="ColorMatchProbe.ofx.bundle",R="http://127.0.0.1:9876",u="/Library/OFX/Plugins";async function v(){let r=x.execPath;for(let t of[m("CONFORM_RESOLVE_PROBE"),o(g(r),"..","Resources","resolve-probe",a),o(g(P(import.meta.url)),"..","..","..","resolve_hook","build",a)])if(t&&await d(o(t,"Contents","MacOS","ColorMatchProbe.ofx")))return t;return null}async function k(){let r=c()==="darwin"&&p()==="arm64",t=await d(o(u,a)),n=await fetch(R+"/",{signal:AbortSignal.timeout(500)}).then(i=>i.ok).catch(()=>!1),s=!!await v();return{installed:t,loaded:n,shipped:s,supported:r,next:r?n?"running: the Color page selection and the selected node are read live":t?"installed; restart Resolve to load it":s?"host_setup host=resolve action=install_probe (asks for an administrator), then restart Resolve":"not in this build":"the probe runs on Apple silicon Macs only"}}async function C(){if(c()!=="darwin"||p()!=="arm64")throw new Error("the probe runs on Apple silicon Macs only");let r=await v();if(!r)throw new Error("this build does not carry the probe (resolve_hook/build.sh makes it)");return await O(r,u,a),await b(o(f(),"Library","Application Support","Blackmagic Design","DaVinci Resolve","OFXPluginCacheV2.xml")).catch(()=>{}),{path:o(u,a),restart_required:!0}}var e=r=>`'${r.replace(/'/g,"'\\''")}'`;async function O(r,t,n){let s=o(t,n),l=o(t,`.${n}.staging`),i=o(t,`.${n}.previous`),w=[`mkdir -p ${e(t)}`,`rm -rf ${e(l)} ${e(i)}`,`cp -R ${e(r)} ${e(l)}`,`if [ -e ${e(s)} ]; then mv ${e(s)} ${e(i)}; fi`,`mv ${e(l)} ${e(s)} || { [ -e ${e(i)} ] && mv ${e(i)} ${e(s)}; exit 1; }`,`rm -rf ${e(i)}`].join(" && "),h=await $("osascript",["-e",`do shell script ${JSON.stringify(w)} with administrator privileges`]);if(!h.success)throw new Error(`installing into ${t} needs an administrator, and that was refused or failed: ${h.stderr.trim()}`)}export{a as PROBE_BUNDLE,R as PROBE_URL,C as installProbe,k as probeStatus};
|
|
@@ -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{c as l}from"./chunk-
|
|
3
|
+
import{c as l}from"./chunk-FHCRWOI7.js";import{Ca as v,Da as F,H as _,I as S,J as P,Ja as f,ka as b,la as R,za as w}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";var g=class{constructor(e=[]){this.ranges=[];for(let[r,n]of e)this.add(r,n)}add(e,r){if(r<=e)return;let n=[],[s,o]=[e,r];for(let[i,a]of this.ranges)a<s||i>o?n.push([i,a]):(s=Math.min(s,i),o=Math.max(o,a));n.push([s,o]),n.sort((i,a)=>i[0]-a[0]),this.ranges=n}has(e,r){return r<=e?!0:this.ranges.some(([n,s])=>n<=e&&s>=r)}missing(e,r){if(r<=e)return[];let n=[],s=e;for(let[o,i]of this.ranges)if(!(i<=s)&&(o>=r||(o>s&&n.push([s,Math.min(o,r)]),s=Math.max(s,i),s>=r)))break;return s<r&&n.push([s,r]),n}count(){return this.ranges.reduce((e,[r,n])=>e+(n-r),0)}toJSON(){return this.ranges.map(([e,r])=>[e,r])}};function N(t,e){let r=new g;for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value,i=Math.max(0,Math.max(0,Math.floor(s))-e),a=Math.floor(s+o)+e;a>i&&r.add(i,a)}return r.toJSON()}function O(t,e,r){let n=N(e,r),s=a=>n.some(([c,u])=>a>=c&&a<u),o=new Map,i=a=>{let c=o.get(a);return c||(c={part:a,structuralRanges:[],essenceRanges:[]},o.set(a,c)),c};for(let a of t.segments){let c=a.part??0;a.kind==="structural"?i(c).structuralRanges.push({offset:a.offset,length:a.length}):(a.kind==="frame"||a.kind==="gop")&&a.frame_in!=null&&s(a.frame_in)&&i(c).essenceRanges.push({offset:a.offset,length:a.length})}return[...o.values()].sort((a,c)=>a.part-c.part)}async function A(t,e){if(!!0)return null;try{let n=await(await import("./r3d-AKUA77ZG.js")).decodeR3dRgbaGpu(t,e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function p(t){return(e,r,n)=>t.parts[e].read(r,n)}function d(t){return JSON.stringify(t.parts.map(e=>({name:e.filename,size:e.fileSize})))}function L(t,e){let r=[];for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value;r.push({frame_in:Math.max(0,Math.floor(s)),frame_out:Math.floor(s+o),handles:e})}return JSON.stringify(r)}var k=16,h=new WeakMap,J=new WeakMap;function x(t){let e=J.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),J.set(t,e)),e}async function D(t){let e=h.get(t);return e||(await f(),e=JSON.parse(await b(p(t),d(t))),h.set(t,e)),e}async function G(t){await f();let e=await b(p(t),d(t));return h.set(t,JSON.parse(e)),e}function B(t,e){h.set(t,JSON.parse(e))}async function C(t,e){let r=JSON.parse(await R(p(t),d(t)));return{v:1,container:"r3d",codec:"redcode",frame_count:e.frame_count,granularity:"frame",...t.parts.length>1?{part_names:t.parts.map(n=>n.filename.split(/[/\\]/).pop()??n.filename)}:{},segments:r}}var V={async inspect(t){await f();let e=await w(p(t),d(t)),r=JSON.parse(e);if(!r||r.frame_count===0)return null;let n=t.parts[0],s=r.timecode??null,o=s&&s.fps_denominator>0?s.fps_numerator/s.fps_denominator:null,i=r.width??null,a=r.height??null;return{id:n.filename,kind:"external",target_url:n.filename,available_range:o&&r.frame_count?{start:{value:0,rate:o},duration:{value:r.frame_count,rate:o}}:null,reel_name:r.reel??null,source_timecode:s?.display??null,source_fps:o,source_resolution_w:i,source_resolution_h:a,container:"r3d",codec:"redcode",size_bytes:r.file_size,streams:[{kind:"video",codec:"redcode",width:i??void 0,height:a??void 0,rate:o??void 0,bit_depth:k,codec_specific:{fourcc:r.codec_fourcc??"REDCODE"}}],decode_provenance:r.decode_provenance??null,vendor_metadata:{frame_count:r.frame_count,...s?{drop_frame:s.drop_frame}:{}},binding_state:"unbound",raw_extraction:{r3d_probe:r},metadata:{}}},async extract(t){await f();let e=JSON.parse(await w(p(t),d(t)));return!e||e.frame_count===0?null:C(t,e)},async sparsify(t,e){await f();let r=JSON.parse(await R(p(t),d(t))),n={v:1,container:"r3d",codec:"redcode",frame_count:r.filter(o=>o.kind==="frame").length,granularity:"frame",segments:r},s=new Map;for(let o of r)o.kind==="frame"&&s.set(o.part??0,(s.get(o.part??0)??0)+1);return O(n,e.items,e.handles).map(o=>({filename:t.parts[o.part].filename,fileSize:t.parts[o.part].fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,frameCount:s.get(o.part)??0,keptFrames:o.essenceRanges.length}))},async trim(t,e){await f();let r=t.parts.some(a=>a.dataRanges!==void 0),n=r?JSON.stringify(t.parts.map(a=>a.dataRanges??[])):"[]",s=r?"[]":L(e.items,e.handles),o=await F(p(t),d(t),s,n);return JSON.parse(o).parts.map(a=>a.trim_plan)},async decode(t,e,r){await f();let n=await D(t);if(e<0||e>=n.length)throw new l(e,n.length);let s=n[e],o=s.part??0,i=t.parts[o];if(!i)throw new l(e,n.length);let a=await i.read(s.essenceOffset,s.essenceLength),c=2,u=await x(t),m;if(r.detail==="coarse")m=_(a,u,0);else if(v(a))m=_(a,u,c);else{let y=await A(a,u);if(y)return y;m=P(a,u)}let M=new DataView(m.buffer,m.byteOffset,8);return{width:M.getUint32(0,!0),height:M.getUint32(4,!0),rgba:m.slice(8)}},async decode16(t,e){await f();let r=await D(t);if(e<0||e>=r.length)throw new l(e,r.length);let n=r[e],s=t.parts[n.part??0];if(!s)throw new l(e,r.length);let o=await s.read(n.essenceOffset,n.essenceLength),i=S(o),a=new DataView(i.buffer,i.byteOffset,8),c=a.getUint32(0,!0),u=a.getUint32(4,!0),m=i.slice(8);return{width:c,height:u,rgb16:new Uint16Array(m.buffer,m.byteOffset,c*u*3)}}};export{G as listR3dFramesJson,V as r3dFormat,B as seedR3dFramesJson};
|
package/dist/resolve-bridge.py
CHANGED
|
@@ -48,7 +48,10 @@ def connect():
|
|
|
48
48
|
try:
|
|
49
49
|
import DaVinciResolveScript as dvr # noqa: N813 (Resolve's own module name)
|
|
50
50
|
except Exception as e: # module not installed / paths not set
|
|
51
|
-
|
|
51
|
+
where = os.environ.get("PYTHONPATH", "")
|
|
52
|
+
found = os.path.isfile(os.path.join(where, "DaVinciResolveScript.py"))
|
|
53
|
+
fail("module", "the Resolve scripting module could not be imported: %s (%s %s). Install DaVinci Resolve, or set RESOLVE_SCRIPT_API to its Developer/Scripting folder"
|
|
54
|
+
% (e, "it is in" if found else "not found in", where or "the default place"))
|
|
52
55
|
resolve = dvr.scriptapp("Resolve")
|
|
53
56
|
if not resolve:
|
|
54
57
|
fail(
|
|
@@ -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}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f}from"./chunk-SSFG7FNI.js";import"./chunk-E75BCWXY.js";import"./chunk-QQBDHVUU.js";import"./chunk-PSANHDZM.js";export{b as APPLIED,a as BACKUP_SUFFIX,e as applyPatch,c as patchFolders,d as planPatch,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-WWE2FXAQ.js";import"./chunk-KD7UGCLT.js";import"./chunk-VZ3XYHK4.js";import"./chunk-YJREJ2MH.js";import"./chunk-E75BCWXY.js";import"./chunk-QQBDHVUU.js";import"./chunk-C2ESM27Z.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};
|
|
@@ -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{$b as p,Mb as a,Nb as b,Ob as c,Pb as d,Qb as e,Rb as f,Sb as g,Tb as h,Ub as i,Vb as j,Wb as k,Xb as l,Yb as m,Zb as n,_b as o,ac as q,bc as r,cc as s,dc as t}from"./chunk-
|
|
3
|
+
import{$b as p,Mb as a,Nb as b,Ob as c,Pb as d,Qb as e,Rb as f,Sb as g,Tb as h,Ub as i,Vb as j,Wb as k,Xb as l,Yb as m,Zb as n,_b as o,ac as q,bc as r,cc as s,dc as t}from"./chunk-BZE7IP6U.js";import"./chunk-IN6XVTUS.js";import"./chunk-RKJML7MH.js";import"./chunk-3PVQ5QP4.js";import"./chunk-VFXMP7IF.js";import"./chunk-WJS6NM7T.js";import"./chunk-TNCXZIOX.js";import"./chunk-5JIFRR7U.js";import"./chunk-WRDA44QF.js";import"./chunk-PGJMKUUP.js";import"./chunk-6QB4DV22.js";import"./chunk-OSUIS4JU.js";import"./chunk-JV7TZDKJ.js";import"./chunk-BBCQMZQN.js";import"./chunk-ASFUV3PB.js";import"./chunk-GDPYFRSV.js";import"./chunk-FHCRWOI7.js";import"./chunk-WWE2FXAQ.js";import"./chunk-H3FD5KA2.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-7Z65WW4I.js";import"./chunk-KD7UGCLT.js";import"./chunk-VZ3XYHK4.js";import"./chunk-YJREJ2MH.js";import"./chunk-E75BCWXY.js";import"./chunk-QQBDHVUU.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{j as OPERATION_KINDS,a as READ_FORMATS,k as applyOperation,m as applyOperationWithSources,s as consolidate,b as detectFormat,d as detectTimelineFormat,t as judge,r as linkText,g as listClips,i as listFlags,h as listMedia,e as readTimeline,n as resolveTarget,q as routesText,c as sniffFormat,f as summarize,l as trackIndex,p as writeDestination,o as writeTimeline};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conformtools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.29",
|
|
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.29",
|
|
48
|
+
"conformtools-darwin-x64": "0.6.29",
|
|
49
|
+
"conformtools-linux-x64": "0.6.29",
|
|
50
|
+
"conformtools-windows-x64": "0.6.29"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/dist/chunk-E4KQR4M3.js
DELETED
|
@@ -1,10 +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 F}from"./chunk-3PVQ5QP4.js";import{b as ge,c as we,f as _e}from"./chunk-VFXMP7IF.js";import{f as X,h as he}from"./chunk-ASFUV3PB.js";import{a as be}from"./chunk-NRURUPLU.js";import{i as N}from"./chunk-TGLH2JDW.js";import{b as P,d as T,f as E}from"./chunk-NU3X7P4N.js";import{Ja as pe,ea as ce,fa as le,ka as ue,pa as me,ya as de,za as fe}from"./chunk-7Z65WW4I.js";import{a as ae}from"./chunk-E75BCWXY.js";import{A as J,C as K,H as V,O as v,P as z,Q as se,T as ie,aa as b,b as D,ba as x,ca as k,d as ee,da as y,e as re,h as te,l as ne,m as j,t as W,u as L,w as oe,x as R}from"./chunk-ZPIY5DOU.js";var G=!1,O=8,Ae=0,De=3,U=2;async function ze(e){let t=new Uint8Array(await e.slice(0,16).arrayBuffer()),n=i=>String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);if(t[0]===6&&t[1]===14&&t[2]===43&&t[3]===52)return"mxf";if(n(4)==="RED1"||n(4)==="RED2")return"r3d";let r=t[0]<<24|t[1]<<16|t[2]<<8|t[3],s=n(4);return/^[A-Za-z0-9 ]{4}$/.test(s)&&(r>=8||r===1)&&r<=e.size?"isobmff":null}function ke(e){let t=e.toLowerCase();return t.endsWith(".braw")?"braw":t.endsWith(".crm")?"crm":"mov"}function Ne(e){return async(t,n)=>new Uint8Array(await e.slice(t,Math.min(t+n,e.size)).arrayBuffer())}function ye(e){let t=e.timecode;return!t||!t.fps_denominator?null:t.fps_numerator/t.fps_denominator}async function ir(e){return await pe(),xe?xe.clip(e,G?"rec709":"",()=>$e(e)):$e(e)}var xe=null;async function $e(e){let t=await ze(e),n=[];if(t==="r3d"){let r=e,s=r.parts&&r.bases?r.parts:[{name:e.name,size:e.size}],o=r.bases??[0],i=async(u,d,f)=>{let p=o[u]+d;return new Uint8Array(await e.slice(p,Math.min(p+f,o[u]+s[u].size)).arrayBuffer())},c=JSON.stringify(s.map(u=>({name:u.name,size:u.size}))),a=JSON.parse(await fe(i,c)),l=JSON.parse(await ue(i,c));return s.length===1&&/_\d{3}\.r3d$/i.test(e.name)&&!/_001\.r3d$/i.test(e.name)&&n.push("spanned R3D part \u2014 only this part's frames are indexed"),{frames:l.map(u=>({offset:o[u.part??0]+u.essenceOffset,size:u.essenceLength})),w:a.width??0,h:a.height??0,fps:ye(a),startFrame:a.timecode?.start_frame??0,dropFrame:a.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:Ae},geometrySpec:{codec:"r3d",subbands:De},index:null,warnings:n}}if(t==="mxf"){let r=Ne(e),s=JSON.parse(await de(r,e.size));if(!s)throw new Error(`${e.name}: MXF index unreadable`);let o=JSON.parse(await me(r,e.size)),i=[];for(let p=0;p<o.frame_count;p++)i.push({offset:o.frames[p*2],size:o.frames[p*2+1]});let c=i.filter(p=>p.size===0).length;c&&n.push(`${c} frame(s) had no locatable picture KLV`);let a=s.width??0,l=s.height??0,u=(s.inner_codec??"").toLowerCase(),d=null,f="MXF";return u==="arriraw"?(d={codec:"arriraw",w:a,h:l,scale:O},f="ARRIRAW"):u==="xocn"?(d={codec:"xocn",scale:O,...G?{display:"rec709"}:{}},f="X-OCN"):await le(r,e.size)?(d={codec:"vc3",scale:O},f="DNxHR"):await ce(r,e.size)?(d={codec:"prores"},f="ProRes"):n.push(`MXF inner codec ${u||"unknown"} not wired to the fingerprint pool`),{frames:d?i:[],w:a,h:l,fps:ye(s),startFrame:s.timecode?.start_frame??0,dropFrame:s.timecode?.drop_frame??!1,label:f,spec:d,geometrySpec:d&&d.codec==="arriraw"?{...d,scale:U}:d&&d.codec==="xocn"?{codec:"xocn",scale:U,...G?{display:"rec709"}:{}}:d&&d.codec==="vc3"?{codec:"vc3",scale:U}:null,index:null,warnings:n}}if(t==="isobmff"){let r=await he(e),s=ke(e.name);if(r.kind==="prores")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:X(r.kind),spec:{codec:"prores"},geometrySpec:null,index:r,warnings:n};if(r.kind==="h264"||r.kind==="hevc")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:X(r.kind),spec:null,geometrySpec:null,index:r,warnings:n};let o=s==="braw"?{codec:"braw",scale:O}:r.codec==="aprh"||r.codec==="aprn"?{codec:"proresraw",scale:O}:null;return o||n.push(`codec ${r.codec} not wired to the fingerprint pool`),{frames:o?r.offs:[],w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:o?s==="braw"?"BRAW":"ProRes RAW":`unsupported (${r.codec})`,spec:o,geometrySpec:o?{...o,scale:U}:null,index:r,warnings:n}}throw new Error(`${e.name}: unrecognised container`)}var Y=null;var Te=Number(D("CONFORM_DECODERS")??0)||Math.max(2,Math.min(Math.floor(re()/2),Math.floor(ee()/2**31))),Z=0,ve=[],Me=async(...e)=>{Z>=Te?await new Promise(t=>ve.push(t)):Z++;try{return await ie(...e)}finally{let t=ve.shift();t?t():Z--}};async function Re(){let e=te()==="win32"?"conformtools-decode.exe":"conformtools-decode",t=[D("CONFORM_NATIVE_DECODE"),ne(e),W(new URL(`./${e}`,import.meta.url)),W(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let n of t)if(await oe(n))return n;return null}var S=class extends Error{constructor(n,r){super(r);this.why=n}};function Pr(e){let t=null;try{t=JSON.parse(e.trim().split(`
|
|
4
|
-
`).pop())}catch{}if(t?.why==="not_entitled")throw new ae("not_entitled",t.detail??"this machine is not licensed");return t?.detail??e.trim()}function Fe(e,t){try{let n=JSON.parse(e.trim().split(`
|
|
5
|
-
`).pop()??"");return new S(n.why,n.detail)}catch{return new S("decoder",`the native decoder exited ${t}: ${e.trim().slice(-300)}`)}}function Er(e){return Y?.owns(e)?Y.meta(`probe|${e}`,()=>Se(e)):Se(e)}async function Se(e){let t=await Re();if(!t)throw new S("missing",j("the native decoder (conformtools-decode)"));let n=[],r=await Me(t,["probe",e],s=>n.push(s));if(r.code!==0)throw Fe(r.stderr,r.code);return JSON.parse(new TextDecoder().decode(Pe(n)))}function Pe(e){let t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t),r=0;for(let s of e)n.set(s,r),r+=s.length;return n}async function Ue(e,t,n,r,s){let o=await Re();if(!o)throw new S("missing",j("the native decoder (conformtools-decode)"));let i=null,c=[],a=0,l=f=>{let p=new Uint8Array(f),m=0;for(;m<f;){let h=c[0],g=Math.min(h.length,f-m);p.set(h.subarray(0,g),m),m+=g,g===h.length?c.shift():c[0]=h.subarray(g)}return a-=f,p},u=[e,t,"--width",String(s.width??32768)];s.from!=null&&u.push("--from",String(s.from)),s.count!=null&&u.push("--count",String(s.count)),s.range&&u.push("--range",s.range);let d=await Me(o,u,f=>{if(c.push(f),a+=f.length,!i){let m=Pe(c.splice(0));c.push(m);let h=m.indexOf(10);if(h<0)return;i=JSON.parse(new TextDecoder().decode(m.subarray(0,h))),l(h+1),n(i)}let p=4+i.w*i.h*(i.bpp??(e==="rgb16"?6:4));for(;a>=p;){let m=l(p);r(new DataView(m.buffer).getUint32(0,!0),m.subarray(4))}},{signal:s.signal});if(d.code!==0||!i)throw Fe(d.stderr,d.code)}function Ee(e,t,n,r={}){return Ue("bgra",e,t,n,r)}var Ie=["none","rle","zips","zip","piz","pxr24","b44","b44a","dwaa","dwab","htj2k"],I=e=>(e>>4)*10+(e&15);function He(e){let t=I(e&63),n=I(e>>>8&127),r=I(e>>>16&127),s=I(e>>>24&63),o=i=>String(i).padStart(2,"0");return`${o(s)}:${o(r)}:${o(n)}${e&64?";":":"}${o(t)}`}function Be(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||t.getUint32(0,!0)!==20000630)return null;let n={fps:null,timecode:null,width:0,height:0,display:null,compression:null,attributes:[]},r=8,s=()=>{let i=r;for(;r<e.length&&e[r]!==0;)r++;let c=new TextDecoder().decode(e.subarray(i,r));return r++,c},o=i=>({width:t.getInt32(i+8,!0)-t.getInt32(i,!0)+1,height:t.getInt32(i+12,!0)-t.getInt32(i+4,!0)+1});for(;r<e.length;){let i=s();if(!i)break;let c=s();if(r+4>e.length)return null;let a=t.getInt32(r,!0);if(r+=4,a<0||r+a>e.length)return null;if(n.attributes.push(`${i}:${c}`),i==="framesPerSecond"&&c==="rational"&&a>=8){let l=t.getInt32(r,!0),u=t.getUint32(r+4,!0);n.fps=u?l/u:null}else i==="timeCode"&&c==="timecode"&&a>=8?n.timecode=He(t.getUint32(r,!0)):i==="dataWindow"&&c==="box2i"&&a>=16?{width:n.width,height:n.height}=o(r):i==="displayWindow"&&c==="box2i"&&a>=16?n.display=o(r):i==="compression"&&a>=1&&(n.compression=Ie[e[r]]??`type ${e[r]}`);r+=a}return n}async function je(e){let t=e,n=null,r=/^(.*?)\[(\d+)-(\d+)\](.*)$/.exec(b(e));if(await R(e))n=/^(.*?)(\d+)(\.exr)$/i;else{t=x(e);let o=r?[null,r[1],r[2],r[4]]:/^(.*?)(\d+)(\.exr)$/i.exec(b(e));if(!o)return{frames:[e],numbers:[]};let i=c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=new RegExp(`^${i(o[1])}(\\d{${o[2].length}})${i(o[3])}$`,"i")}let s=[];for await(let o of v(t)){let i=o.isFile?n.exec(o.name):null;i&&s.push({n:Number(i[i.length===4?2:1]),f:y(t,o.name)})}return s.sort((o,i)=>o.n-i.n),{frames:s.map(o=>o.f),numbers:s.map(o=>o.n)}}async function Q(e){let t=await je(e),n=t.frames[0];if(!n)throw new Error(`no .exr frames for '${b(e)}'`);let r=await z(n),s;try{s=Be(await r.readAt(0,Math.min(r.size,1<<20)))}finally{await r.close()}if(!s)throw new Error(`'${b(n)}' is not an OpenEXR file`);let o=Math.max(1,t.frames.length),i=t.numbers.length>1?t.numbers[t.numbers.length-1]-t.numbers[0]+1-t.numbers.length:0,c=s.fps??0;return{id:b(n),kind:"external",target_url:n,local_path:n,content_kind:o>1?"video":"still",source_fps:s.fps??void 0,source_timecode:s.timecode??void 0,source_resolution_w:s.width,source_resolution_h:s.height,available_range:{start:{value:0,rate:c},duration:{value:o,rate:c}},streams:[{kind:"video",codec:"exr",width:s.width,height:s.height,rate:s.fps??void 0,codec_specific:{compression:s.compression}}],vendor_metadata:{exr:{frames:o,first_frame:t.numbers[0]??null,last_frame:t.numbers[t.numbers.length-1]??null,missing_frames:i,display_window:s.display,attributes:s.attributes,fps_source:s.fps!=null?"header framesPerSecond":"not in the header",timecode_source:s.timecode?"header timeCode (first frame)":"not in the header"}}}}var C=new Set([".mov",".mp4",".m4v",".mxf",".wav",".braw",".crm",".r3d",".aif",".aiff"]);async function We(e){let t=await z(e);return{path:e,file:t,size:t.size}}function Le(e){return(t,n)=>e.file.readAt(t,n)}async function Je(e){let t=F(b(e));if(!t)return[e];let n=x(e),r=[];for await(let s of v(n)){if(!s.isFile)continue;let o=F(s.name);o&&o.clipBase===t.clipBase&&r.push({n:o.partNumber,p:y(n,s.name)})}return r.sort((s,o)=>s.n-o.n).map(s=>s.p)}async function Ke(e){let t=[],n=[];for await(let r of v(e))!r.isFile||r.name.startsWith(".")||(F(r.name)?t.push(r.name):C.has(k(r.name).toLowerCase())&&n.push(r.name));if(t.length)return y(e,t.sort()[0]);if(n.length===1)return y(e,n[0]);throw n.length?(n.sort(),new Error(`'${b(e)}' is a folder of ${n.length} clips (${n.slice(0,3).join(", ")}${n.length>3?", \u2026":""}): probe one of them, or media_find to list them all`)):new Error(`'${b(e)}' is a folder with no media file in it (looked for ${[...C].join(" ")}, and RED parts)`)}async function q(e){await R(e)&&(e=await Ke(e));let t=we(b(e));if(!t)throw new Error(`unsupported media file '${b(e)}' (supported: ${[...C].join(" ")})`);let n=await Je(e),r=await Promise.all(n.map(We));return{source:_e(t,r.map(o=>ge(b(o.path),{fileSize:o.size,read:Le(o)}))),parts:r,format:t,anchor:n[0],close:()=>r.forEach(o=>o.file.close())}}async function Br(e,t,n,r){if(!/h264|avc|hevc|h265/.test(n)){let s=null,o=await q(e);try{return await N(o.source,{verb:"decode",index:t,intent:"park"})}catch(i){s=i}finally{o.close()}try{return await Oe(e,t,r)}catch(i){throw/no decoder/.test(String(s))?i:s instanceof Error?s:new Error(String(s))}}return Oe(e,t,r)}async function Oe(e,t,n){t=Math.round(t);let r=0,s=0,o=null;if(await Ee(e,c=>{r=c.w,s=c.h},(c,a)=>{c===t&&(o=a)},{from:t,count:1,width:n}),!o)throw new Error(`the OS decoder returned no frame ${t} of ${b(e)}`);let i=o;for(let c=0;c<i.length;c+=4){let a=i[c];i[c]=i[c+2],i[c+2]=a}return{rgba:i,width:r,height:s}}async function A(e){if(await R(e)){let n=[];for await(let r of v(e))r.isFile&&/\.exr$/i.test(r.name)&&!r.name.startsWith(".")&&n.push(r.name);if(n.length)return Q(y(e,n.sort()[0]))}if(/\.exr$/i.test(e))return Q(e);let t=await q(e);try{let n=await N(t.source,{verb:"inspect"});if(!n)throw new Error(`could not read '${b(e)}' as ${t.format}`);return n.target_url=t.anchor,n.local_path=t.anchor,n.id=n.id||b(t.anchor),t.parts.length>1&&((n.vendor_metadata??={}).spanned_parts=t.parts.map(r=>b(r.path))),n.size_bytes=t.parts.reduce((r,s)=>r+s.size,0),n}finally{t.close()}}function Ve(e,t,n,r){let s=Math.abs(r*1001-Math.round(r*1001/1e3)*1e3)<1?Math.round(r)*1e3/1001:r,o=Math.floor(e*s/t+1e-6);return{tc:P(o,r),frames:Math.round(n*s/t)}}var Xe=e=>String(Math.round(e*1e3)/1e3);function jr(e,t){let n=e.streams?.find(m=>m.kind==="video"),r=e.streams?.filter(m=>m.kind==="audio")??[],s=e.vendor_metadata?.bext;if(!n&&e.available_range&&r[0]?.rate){let m=r[0].rate,h=e.available_range.duration.value,_=(t?[t]:[24e3/1001,24]).map(w=>{let $=Ve(s?.time_reference??0,s?.sample_rate||m,h,w);return`${s?`start TC ${$.tc}, `:""}${$.frames} frames @ ${Xe(w)} fps`});return[e.target_url??"",`audio only; ${h} samples (${(h/m).toFixed(3)} s)${s?`; BWF time_reference ${s.time_reference}`:"; no BWF timecode"}`,..._,...t?[]:["(pass fps for the project's rate)"],...r.map((w,$)=>`audio ${r.length>1?`${$+1}: `:""}${w.codec??"pcm"} ${w.channels??"?"}ch ${w.rate} Hz ${w.bit_depth??"?"}-bit`)].join(`
|
|
6
|
-
`)}let o=e.available_range?.duration?.value??e.declared_duration?.value??null,i=e.source_fps??n?.rate??null,c=e.size_bytes,a=e.vendor_metadata?.spanned_parts,l=n?.codec_specific??{},u=[l.profile?`${l.profile} (${l.fourcc})`:l.fourcc,l.pixel_format,n?.bit_depth?`${n.bit_depth}-bit`:null,l.colr?`color ${l.colr.primaries}/${l.colr.transfer}/${l.colr.matrix} (primaries/transfer/matrix)`:null].filter(Boolean).join(", "),d=e.source_pixel_aspect&&Math.abs(e.source_pixel_aspect-1)>.001?e.source_pixel_aspect:null,f=d&&n?.width&&n?.height?`pixel aspect ${Math.round(d*1e3)/1e3}: stored ${n.width}x${n.height}, shown ${(n.width*d/n.height).toFixed(2)}:1 (squeezed; a trim keeps it, a square-pixel copy is a new render)`:null,p=e.raw_extraction?.mov_probe?.every_sample_is_keyframe===!1&&n?"long-GOP (not every frame is a keyframe): media_trim starts on the keyframe at or before the frame asked for":null;return[e.target_url??"",n?`${n.codec??"?"} ${n.width??"?"}x${n.height??"?"}${i?` @ ${Math.round(i*1e3)/1e3} fps`:""}${u?`; ${u}`:""}`:"no video track",...[f,p].filter(m=>!!m),`start TC ${e.source_timecode??"none"}; ${o!=null?`${o} frames`:"length unknown"}${o!=null&&i?` (${(o/i).toFixed(2)} s)`:""}`,r.length?r.map((m,h)=>{let g=m.codec_specific?.channel_layout;return`audio ${r.length>1?`${h+1}: `:""}${m.codec??"pcm"} ${m.channels??"?"}ch${g?` (${g})`:""} ${m.rate??"?"} Hz ${m.bit_depth??"?"}-bit`}).join(`
|
|
7
|
-
`):"no audio",`${e.reel_name?`reel ${e.reel_name}; `:""}${c!=null?`${(c/1e6).toFixed(1)} MB`:""}${a?`; spanned ${a.length} parts`:""}`].join(`
|
|
8
|
-
`)}var Ge=8*1024*1024,H=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));async function Ye(e,t,n){if(e.executable_locally===!1)throw new Error("this trim plan is server-side only");let r=new Map(t.parts.map(o=>[b(o.path),o]));await K(x(n));let s=await se(n);try{await s.truncate(e.total_size),await s.writeAt(0,H(e.dest_header_bytes_base64));for(let o of e.src_byte_ranges){let i=o.src_file_name?r.get(b(o.src_file_name)):t.parts[0];if(!i)throw new Error(`plan references unknown source part '${o.src_file_name}'`);let c=0;for(;c<o.length;){let a=Math.min(Ge,o.length-c),l=await i.file.readAt(o.offset+c,a);if(l.length<a)throw new Error(`short read in ${b(i.path)} at ${o.offset+c}`);await s.writeAt(o.write_to_dest_offset+c,l),c+=a}}e.dest_footer_bytes_base64&&e.dest_footer_offset!=null&&await s.writeAt(e.dest_footer_offset,H(e.dest_footer_bytes_base64));for(let o of e.dest_patches??[])await s.writeAt(o.offset,H(o.bytes_base64))}finally{await s.close()}for(let o of e.dest_sidecar_writes??[])await J(y(x(n),o.name),H(o.bytes_base64))}function Ze(e,t){let n=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let s=r.source_range.start.value,o=r.source_range.duration.value,i=Math.max(0,Math.floor(s)-t),c=Math.floor(s+o-1)+t;c>=i&&n.push({first_frame:i,last_frame:c})}return be(n)}async function Qe(e,t,n,r,s){let o=await q(e);try{let i=Ze(t,n);if(!i.length)throw new Error("no usable frame ranges (items need kind=clip with source_range)");let c=await N(o.source,{verb:"trim",selection:{items:t,handles:n}}),a=k(o.anchor),l=o.format==="r3d",u=l?F(b(o.anchor))?.clipBase??b(o.anchor,a):b(o.anchor,a),d=[];for(let[f,p]of c.entries()){let m=p.output_clip_number??(i.length>1?f+1:void 0),h=i[(m??1)-1]??i[0],g=m&&(p.output_clip_count??i.length)>1?`_S${String(m).padStart(3,"0")}`:"",_;if(l){let w=p.output_part_number??f+1;_=y(r,`${u}${g}.RDC`,`${u}_${String(w).padStart(3,"0")}.R3D`),d.push({path:_,bytes:p.total_size,island:h,part:w,clip:m})}else{let w=s&&c.length===1?s:`${u}${g||`_trim_${h.first_frame}-${h.last_frame}`}${a}`;_=y(r,w),d.push({path:_,bytes:p.total_size,island:h,clip:m})}await Ye(p,o,_)}return l||await qe(e,d,!!s&&c.length===1),{outputs:d,islands:i,format:o.format}}finally{o.close()}}async function qe(e,t,n){let r=await A(e).catch(()=>null),s=r?.source_fps??r?.streams?.find(o=>o.kind==="video")?.rate??null;if(!(!r?.source_timecode||!s))for(let o of t){if(!o.island)continue;let i=await A(o.path).catch(()=>null),c=i?.available_range?.duration?.value??i?.declared_duration?.value;if(!i?.source_timecode||!c)continue;let a=E(i.source_timecode,s,r.source_timecode);if(a===o.island.first_frame&&a+c-1===o.island.last_frame||(o.island={first_frame:a,last_frame:a+c-1},n))continue;let l=o.path.replace(/_trim_\d+-\d+(\.[^./\\]+)$/,`_trim_${a}-${a+c-1}$1`);l!==o.path&&(await V(o.path,l),o.path=l)}}async function Wr(e){let t=await A(e.path),n=t.source_fps??t.streams?.find(g=>g.kind==="video")?.rate??null,r=t.available_range?.duration?.value??t.declared_duration?.value??null;if(!n)throw new Error("cannot trim: no frame rate / timecode track on this file");let s=E(e.in,n,t.source_timecode??null),o=E(e.out,n,t.source_timecode??null);e.out_exclusive&&(o-=1);let i=t.source_timecode??"00:00:00:00",c=r!=null?P((T(i,n)??0)+r-1,n,!!t.vendor_metadata?.drop_frame):null;if(o<s)throw new Error(`out ${e.out} is before in ${e.in}`);if(s<0)throw new Error(`in ${e.in} is before the file starts (${i}, frame 0)`);if(r!=null&&o>r-1)throw new Error(`out ${e.out} is past the end of the file (last frame ${c}, frame ${r-1})`);let a={id:"trim",kind:"clip",source_range:{start:{value:s,rate:n},duration:{value:o-s+1,rate:n}}},l=x(e.path),u;if(e.out_path)try{(await L(e.out_path)).isDirectory?l=e.out_path:(l=x(e.out_path),u=b(e.out_path))}catch{l=x(e.out_path),u=b(e.out_path)}let d=await Qe(e.path,[a],Math.max(0,Math.floor(e.handles??0)),l,u),f=d.islands[0],p=d.outputs.length===1&&d.outputs[0].island?d.outputs[0].island:f,m=p.first_frame,h=p.last_frame;return{outputs:d.outputs,first_frame:m,last_frame:h,frames:h-m+1,fps:n,facts:t,...m!==f.first_frame||h!==f.last_frame?{asked:{first_frame:f.first_frame,last_frame:f.last_frame}}:{}}}function Ce(e){let t=[...C].map(n=>n.slice(1)).join("|");return e.toLowerCase().replace(new RegExp(`\\.(${t})(?=[._\\s-]|$)`,"g"),"").replace(/[^a-z0-9]/g,"")}function er(e,t){let n=Ce(e),r=Ce(t);if(r&&n.includes(r))return"name";let s=t.toLowerCase().split(/[^a-z0-9]+/).filter(o=>/\d/.test(o)&&o.length>=3);return s.length&&s.every(o=>n.includes(o))?"id":null}async function Lr(e,t,n){let r=[],s=0,o=null,i=Date.now()+n.time_limit_s*1e3,c=async(a,l)=>{try{for await(let u of v(a)){if(o&&!o.startsWith("folders"))return;if(++s>n.max_entries){o=`stopped after ${n.max_entries} entries (max_entries)`;return}if(Date.now()>i){o=`stopped after ${n.time_limit_s} s (time_limit_s)`;return}if(u.name.startsWith("."))continue;let d=y(a,u.name);if(u.isDirectory)l<n.max_depth?await c(d,l+1):o??=`folders deeper than max_depth=${n.max_depth} not searched (e.g. ${d})`;else if(u.isFile&&C.has(k(u.name).toLowerCase())){let f=er(u.name,t);f&&r.push({path:d,match:f,size:(await L(d).catch(()=>({size:0}))).size})}}}catch{}};if(await c(e,0),n.probe)for(let a=0;a<r.length;a+=8)await Promise.all(r.slice(a,a+8).map(async l=>{try{l.facts=await A(l.path)}catch(u){l.error=u.message}}));return r.sort((a,l)=>a.path.localeCompare(l.path)),{hits:r,scanned:s,truncated:o}}function rr(e){let t=e.streams?.find(c=>c.kind==="video"),n=e.source_fps??t?.rate??null,r=e.available_range?.duration?.value??e.declared_duration?.value??null,s=t?.codec_specific??{},o=e.source_timecode&&n?T(e.source_timecode,n):null,i=o!=null&&r!=null&&n?P((o+r)%(Math.round(n)*86400),n,e.source_timecode.includes(";")):null;return`${t?`${t.codec??"?"}${s.profile?` ${s.profile}`:""} ${t.width??"?"}x${t.height??"?"}`:"no video"}${n?` @ ${Math.round(n*1e3)/1e3} fps`:""}; TC ${e.source_timecode??"none"}${i?`\u2013${i}`:""}; ${r??"?"} fr${r!=null&&n?` (${(r/n).toFixed(2)} s)`:""}`}function Jr(e,t,n,r){let s=e.hits.slice(0,r),o=[];e.truncated&&o.push(`TRUNCATED: ${e.truncated} \u2014 the search did NOT cover all of ${t}; the matches below may be incomplete.`),e.hits.length>s.length&&o.push(`TRUNCATED: showing ${s.length} of ${e.hits.length} matches. Pass limit=${e.hits.length} or narrow the query.`),o.push(`${e.hits.length} file${e.hits.length===1?"":"s"} match "${n}" under ${t} (${e.scanned} entries scanned)`);let i=new Map;for(let a of e.hits)i.set(b(a.path).toLowerCase(),(i.get(b(a.path).toLowerCase())??0)+1);let c=[...i].filter(([,a])=>a>1);c.length&&o.push(`same name in several folders: ${c.map(([a,l])=>`${a} \xD7${l}`).join(", ")} \u2014 they can be DIFFERENT clips; match by TC + duration, never by name alone`);for(let a of s)o.push(`- ${a.path}${a.match==="id"?" (id match)":""}
|
|
9
|
-
${a.facts?rr(a.facts):a.error?`probe failed: ${a.error}`:`${(a.size/1e6).toFixed(1)} MB`}`);return o.join(`
|
|
10
|
-
`)}async function Kr(e,t,n=0){let r=await A(e),s=r.source_fps??r.streams?.find(f=>f.kind==="video")?.rate??null,o=r.available_range?.duration?.value??r.declared_duration?.value??null;if(!s||o==null)throw new Error(`cannot check coverage: ${b(e)} has no frame rate or length`);let i=Math.round(s)*86400,c=r.source_timecode?T(r.source_timecode,s)??0:0,a=!!r.source_timecode?.includes(";"),l=f=>{let p=E(f,s,r.source_timecode??null);return typeof f=="number"||/^\d+$/.test(f.trim())?p:p<-i/2?p+i:p>i/2?p-i:p},u=f=>P(((c+f)%i+i)%i,s,a),d=t.map((f,p)=>{let m=l(f.in),h=l(f.out),g=m,_=o-h,w=g>=0&&_>=0&&h>m,$=Math.max(0,-g),B=Math.max(0,-_),M=[];return h<=m?M.push("out is not after in"):w?M.push(`covered; handles head ${g} / tail ${_} fr`):M.push(`NOT covered: short ${[$?`${$} fr at head`:"",B?`${B} fr at tail`:""].filter(Boolean).join(", ")}`),w&&n&&(g<n||_<n)&&M.push(`handles short of ${n}: ${[g<n?`head by ${n-g}`:"",_<n?`tail by ${n-_}`:""].filter(Boolean).join(", ")}`),{label:f.label??`range ${p+1}`,in_tc:u(m),out_tc:u(h),frames:h-m,covered:w,head:g,tail:_,short_head:$,short_tail:B,note:M.join("; ")}});return{facts:r,rows:d}}export{ir as a,Re as b,Pr as c,Er as d,Ee as e,je as f,C as g,Je as h,Ke as i,q as j,Br as k,A as l,Ve as m,jr as n,Ze as o,Qe as p,Wr as q,Ce as r,er as s,Lr as t,rr as u,Jr as v,Kr as w};
|
package/dist/chunk-IDADYIY6.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{B as C,C as x,G as y,a as h,da as c,o as w,p as g,v as u,z as S}from"./chunk-ZPIY5DOU.js";var I=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"]),N=["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"],J=["aaf","avb","edl","drt","otio","fcpxml","fcpxmld","prproj","ptx","ale","xml","csv"],L=new Set(["xml","csv","png","jpg","jpeg","tif","tiff"]),M=new Set([...N,...J,...L]);var m="conformtools-hook",d=o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{},k=o=>!!o&&typeof o=="object"&&typeof o.command=="string"&&o.command.includes(m),A=[["PostToolUse","Bash"],["UserPromptSubmit",null],["Stop",null]];function U(o,e,t,n){let r=Array.isArray(o[e])?[...o[e]]:[],s=(i,a)=>({...i,...t?{matcher:t}:{},hooks:a});for(let i=0;i<r.length;i++){let a=d(r[i]),l=Array.isArray(a.hooks)?a.hooks:[],f=l.findIndex(k);if(f<0)continue;if(JSON.stringify(l[f])===JSON.stringify(n)&&(!t||a.matcher===t))return"kept";let H=[...l];return H[f]=n,r[i]=s(a,H),o[e]=r,"updated"}return o[e]=[...r,s({},[n])],"installed"}function $(o,e,t={}){let n={...d(o.hooks)},r=A.map(([s,i])=>U(n,s,i,{type:"command",command:e,timeout:10,...t.async&&i?{async:!0}:{}}));return r.every(s=>s==="kept")?{settings:o,result:"kept"}:{settings:{...o,hooks:n},result:r.every(s=>s==="installed")?"installed":"updated"}}function _(o){let e={...d(o.hooks)},t=!1;for(let[r]of A){if(!Array.isArray(e[r]))continue;let s=e[r].map(i=>{let a=d(i);if(!Array.isArray(a.hooks))return i;let l=a.hooks.filter(f=>!k(f));return l.length!==a.hooks.length&&(t=!0),l.length?{...a,hooks:l}:null}).filter(i=>i!==null);s.length?e[r]=s:delete e[r]}if(!t)return{settings:o,removed:!1};let n={...o};return Object.keys(e).length?n.hooks=e:delete n.hooks,{settings:n,removed:!0}}var X=30*6e4;function E(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(k);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 O(o){let e=d(o.hooks);if(!Array.isArray(e.afterShellExecution))return{settings:o,removed:!1};let t=e.afterShellExecution.filter(s=>!k(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 j(){return`\\b(${[...I].map(e=>e.replace(/[.+-]/g,"\\$&")).join("|")})\\b|\\.(${[...M].join("|")})\\b`}function q(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 D=["claude","codex","cursor"],p=()=>({claude:c(g(),".claude","settings.json"),codex:c(g(),".codex","hooks.json"),cursor:c(g(),".cursor","hooks.json")});async function F(){let o=new URL(import.meta.url),e=h(new URL("./hook.js",o));if(await u(e)){await x(w());let n=c(w(),`${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 S(o);try{return e.trim()?JSON.parse(e):{}}catch{return"invalid"}}async function P(o,e){let t;return await u(o)?(t=`${o}.conformtools-backup`,await y(o,t)):await x(c(o,"..")),await C(o,JSON.stringify(e,null,2)+`
|
|
4
|
-
`),t}async function z(o,e={}){let t=e.file??p()[o];try{let n=e.command??await F();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"?E(r,n,j()):$(r,n,{async:o==="codex"});if(s.result==="kept")return{client:o,file:t,result:"kept"};let i=await P(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 B(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"?O(n):_(n);if(!r.removed)return{client:o,file:t,removed:!1};let s=await P(t,r.settings);return{client:o,file:t,removed:!0,backup:s}}async function R(){let o=p(),e=[];for(let t of D)await u(c(o[t],".."))&&e.push(t);return e}var V=async()=>Promise.all((await R()).map(o=>z(o))),Q=async()=>Promise.all((await R()).map(o=>B(o)));async function K(o,e=p()[o]){let t=await v(e);return t!=="invalid"&&JSON.stringify(t).includes(m)}var b={claude:"Claude Code",codex:"Codex",cursor:"Cursor"},T="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), and on each message you send it reminds the agent to log your request with every name and path taken out (the hook itself sends nothing of the message)";function Y(o){return o.length?o.map(e=>{let t=b[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 ${T}. 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 oo(o){let e=o.filter(t=>t.removed);return e.length?e.map(t=>`${b[t.client]}: agent hook removed from ${t.file}`).join(`
|
|
6
|
-
`):"Agent hook: not installed anywhere on this machine."}async function eo(){let o=await R();return o.length?[...await Promise.all(o.map(async t=>`${b[t]}: agent hook ${await K(t)?"on":"off"} (${p()[t]})`)),`It records ${T}. conformtools hooks on|off.`].join(`
|
|
7
|
-
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine."}export{q as a,D as b,p as c,F as d,z as e,B as f,R as g,V as h,Q as i,K as j,T as k,Y as l,oo as m,eo as n};
|