conformtools 0.6.10 → 0.6.12
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 +54 -22
- package/dist/{account-GFIQC77T.js → account-IUWNSDG5.js} +1 -1
- package/dist/{analysis-engine-4K5K6L53.js → analysis-engine-M7W32RRC.js} +1 -1
- package/dist/bridge-6NCHJWE6.js +3 -0
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-56EEBHP2.js → chunk-2CY2OOOJ.js} +1 -1
- package/dist/chunk-3XQI5SIV.js +3 -0
- package/dist/chunk-5YULBQJX.js +3 -0
- package/dist/chunk-64X5DLH5.js +6 -0
- package/dist/{chunk-XJNWAQON.js → chunk-6NLB5TZ2.js} +1 -1
- package/dist/chunk-B77ADB26.js +3 -0
- package/dist/chunk-DFQWQ3EA.js +10 -0
- package/dist/{chunk-JXTRQ3UG.js → chunk-F4PHKOAS.js} +1 -1
- package/dist/chunk-G3SZDPDS.js +3 -0
- package/dist/chunk-IN6XVTUS.js +3 -0
- package/dist/{chunk-NQNS4Y2B.js → chunk-LVGGCRDW.js} +1 -1
- package/dist/chunk-LYM757KG.js +158 -0
- package/dist/chunk-N34DQ6MH.js +14 -0
- package/dist/chunk-NMH62JSC.js +5 -0
- package/dist/chunk-NXJZXXC2.js +20 -0
- package/dist/{chunk-6HZP2OJA.js → chunk-OMPYIH6F.js} +1 -1
- package/dist/{chunk-DGXZB7MO.js → chunk-P3XI63Q2.js} +1 -1
- package/dist/chunk-QTA36RVO.js +502 -0
- package/dist/chunk-QTFFVLVJ.js +8 -0
- package/dist/{chunk-E5ENIKNR.js → chunk-SJ56EEFP.js} +2 -2
- package/dist/chunk-THVX57I3.js +4 -0
- package/dist/chunk-UUXHJNQA.js +8 -0
- package/dist/chunk-VJN4UXFJ.js +8 -0
- package/dist/chunk-XF3YMBI7.js +3 -0
- package/dist/chunk-XVRTAKDK.js +6 -0
- package/dist/chunk-YU3SUSK3.js +3 -0
- package/dist/claude-setup-REU4AOKX.js +13 -0
- package/dist/cli.js +8 -8
- package/dist/emscripten-module-Q67P5WYC-HW3D2R5O.js +2161 -0
- package/dist/engine-6ACEWA4S.js +5 -0
- package/dist/ffi-7KTOX2T4.js +3 -0
- package/dist/framing-CVJM5TT3.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-B2TLLEMI.js → h264-5OGRVYUF.js} +1 -1
- package/dist/{h264-mxf-3GED5PBT.js → h264-mxf-FTHNCK4B.js} +1 -1
- package/dist/host-relink-ZP33BK53.js +10 -0
- package/dist/hosted-BWAYLJXR.js +3 -0
- package/dist/hosts-H3IKRZF2.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-D3WEYL2W.js → inspect-BJYIDVDN.js} +2 -2
- package/dist/{isobmff-C5A2EFKH.js → isobmff-DN6MCHEK.js} +1 -1
- package/dist/{mc-video-ARKIHPA7.js → mc-video-TF3MD7LN.js} +1 -1
- package/dist/mcp.js +8 -7
- package/dist/{media-3YMIZSSF.js → media-MJKEKCPN.js} +1 -1
- package/dist/module-ES6BEMUI-L6VQ7K3J.js +3 -0
- package/dist/module-asyncify-2EFITU5U-Z4EEM6X7.js +3 -0
- package/dist/{mxf-CQSI6H5T.js → mxf-Q5723GPD.js} +1 -1
- package/dist/{ops-BCTGDBXT.js → ops-B2OA7VXN.js} +1 -1
- package/dist/{probe-COWUTQGN.js → probe-72QZKMCC.js} +1 -1
- package/dist/{r3d-FX7V4BIE.js → r3d-7OOZMPWH.js} +1 -1
- package/dist/{sequence-patch-JVEZW24V.js → sequence-patch-CN4VC5W3.js} +1 -1
- package/dist/store-4WZQF6YD.js +3 -0
- package/dist/timeline-ZP5H4YDQ.js +3 -0
- package/package.json +10 -1
- package/dist/bridge-73XMEZLH.js +0 -3
- package/dist/chunk-2MJAQROY.js +0 -5
- package/dist/chunk-7QUSVHO2.js +0 -10
- package/dist/chunk-CJYLQ3UM.js +0 -5
- package/dist/chunk-DFDXSIMI.js +0 -39
- package/dist/chunk-DNS4ZYIO.js +0 -3
- package/dist/chunk-GM262EDM.js +0 -8
- package/dist/chunk-JHTMYXJM.js +0 -20
- package/dist/chunk-QHXX5GDD.js +0 -440
- package/dist/chunk-TDIY4NRQ.js +0 -3
- package/dist/chunk-UGVGRL5M.js +0 -3
- package/dist/chunk-Y2QHZUGL.js +0 -5
- package/dist/chunk-YC7QDS5U.js +0 -19
- package/dist/chunk-ZVUKOFUX.js +0 -6
- package/dist/claude-setup-OKOPPDMB.js +0 -5
- package/dist/conformtools-analyze +0 -0
- package/dist/conformtools-decode +0 -0
- package/dist/engine-274GQLUB.js +0 -5
- package/dist/framing-BKTUEUZO.js +0 -3
- package/dist/host-relink-PTV44KXF.js +0 -10
- package/dist/hosts-D3TR2QEV.js +0 -3
- package/dist/i2o-transfer +0 -0
- package/dist/store-SZKXADGI.js +0 -3
- package/dist/timeline-PEUC3G7K.js +0 -3
- /package/dist/{still-WUCFH2WX.js → still-SX6RJ7O6.js} +0 -0
|
@@ -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{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o,u as p,v as q}from"./chunk-
|
|
3
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o,u as p,v as q}from"./chunk-DFQWQ3EA.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-P3XI63Q2.js";import"./chunk-F4PHKOAS.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";export{a as MEDIA_EXTS,g as bwfAt,q as coverage,e as decodeFrameRgb16,d as decodeFrameRgba,o as factsLine,h as factsText,n as findMedia,p as findText,i as islandsFor,m as nameMatch,l as normName,c as openSource,f as probeMedia,b as siblingParts,k as trimMedia,j as trimSource};
|
|
@@ -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{h as l,i as o,j as p,k as e}from"./chunk-QTFFVLVJ.js";import"./chunk-PSANHDZM.js";export{l as QuickJSModuleCallbacks,e as QuickJSWASMModule,o as applyBaseRuntimeOptions,p as applyModuleEvalRuntimeOptions};
|
|
@@ -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 $}from"./chunk-AACY2V3L.js";import{b as J}from"./chunk-
|
|
3
|
+
import{a as $}from"./chunk-AACY2V3L.js";import{b as J}from"./chunk-P3XI63Q2.js";import{b as j}from"./chunk-F4PHKOAS.js";import{Ha as N,Ia as l,M,R as P,b as B,ca as D,da as T,e as I,ea as E,fa as L,g as S,ga as C,ia as O,ra as V,ua as W,w as k,wa as G}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var z=new Uint8Array([6,14,43,52,2,5,1,1,13,1,2,1,1,17,1,0]);function se(t){e:for(let r=t.length-z.length;r>=0;r--){for(let e=0;e<z.length;e++)if(t[r+e]!==z[e])continue e;return r}return-1}function Z(t,r){if(r>=t.byteLength)return[null,0];let e=t.getUint8(r);if(e<128)return[e,1];let n=e&127;if(n===0||n>8||r+1+n>t.byteLength)return[null,1];let a=0;for(let i=0;i<n;i++)a=a*256+t.getUint8(r+1+i);return[a,1+n]}function b(t,r){let e=t.getUint32(r,!1),n=t.getUint32(r+4,!1);return e*4294967296+n}async function H(t){let r=t.fileSize,e=[];if(r<1024)return e;let a=Math.max(0,r-65536),i=r-a,o=await t.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 F=s+16+te;if(F+f>o.length)return e;let A=[],ne=new DataView(o.buffer,o.byteOffset+F,f),g=Math.floor((f-4)/12);if(g<1||g>4096)return e;for(let u=0;u<g;u++){let d=b(ne,u*12+4);d>=0&&d<r&&A.push(d)}for(let u of A){let d=Math.min(256,r-u),p=await t.read(u,d);if(p.length<80)continue;let y=new DataView(p.buffer,p.byteOffset,p.byteLength),[R,v]=Z(y,16);if(R===null)continue;let m=16+v,_,x;if(p.length<m+64){let oe=Math.min(m+64,r-u),h=await t.read(u,oe);if(h.length<m+64)continue;let U=new DataView(h.buffer,h.byteOffset,h.byteLength);_=b(U,m+32),x=b(U,m+40)}else _=b(y,m+32),x=b(y,m+40);let ae=u+16+v+R+_+x,ie=Math.min(ae+65536,r)-u;e.push({offset:u,length:ie})}return e}function q(t,r){let e=[];for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let a=n.source_range.start.value,i=n.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(t,r){let e=[...t].sort((i,o)=>i.offset-o.offset),n=[],a=0;for(let i of e)i.offset>a&&n.push({offset:a,length:i.offset-a}),a=Math.max(a,i.offset+i.length);return a<r&&n.push({offset:a,length:r-a}),n}async function K(t,r,e){let n=q(r,0);if(n.length===0)throw new Error("planMxfTrimsFromItems: no usable trim ranges in items");await l();let a=(o,s)=>t.read(o,s),i=await J(n,e,(o,s)=>V(a,t.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(t,r,e){await l();let n=q(r,e),i=await W((s,c)=>t.read(s,c),t.fileSize,JSON.stringify(n));if(i!=="null")return JSON.parse(i);console.warn(`[mxf] no parseable index \u2014 shipping the WHOLE file (${t.fileSize} bytes). The cut's ${n.length} range(s) cannot be addressed; nothing is trimmed.`);let o=(await H(t)).map(s=>({offset:s.offset,length:s.length}));return{fileSize:t.fileSize,structuralRanges:o,essenceRanges:ce(o,t.fileSize),trimInputs:n,wholeFileFallback:!0}}async function X(t){await l();let e=await G((n,a)=>t.read(n,a),t.fileSize);return JSON.parse(e)}function w(t){return(r,e)=>t.read(r,e)}var Me={async inspect(t){let r=t.parts[0],e=await X(r);if(!e)return null;let n=e.timecode??null,a=n&&n.fps_denominator>0?n.fps_numerator/n.fps_denominator:null,i=e.width??null,o=e.height??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:null,source_timecode:n?.display??null,source_fps:a,source_resolution_w:i,source_resolution_h:o,container:"mxf",codec:null,size_bytes:r.fileSize,streams:[...i||o||a?[{kind:"video",codec:null,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,...n?{drop_frame:n.drop_frame}:{},...e.inner_codec?{inner_codec:e.inner_codec}:{},...e.truncated?{truncated:!0}:{}},binding_state:"unbound",raw_extraction:{mxf_probe:e},metadata:{}}},async extract(t){await l();let r=t.parts[0],e=JSON.parse(await O(w(r),r.fileSize));return e.length===0?null:{v:1,container:"mxf",codec:"mxf",frame_count:$(e),granularity:"frame",segments:e}},async sparsify(t,r){let e=t.parts[0],n=await Q(e,r.items,r.handles);return[{filename:e.filename,fileSize:n.fileSize,structuralRanges:n.structuralRanges,essenceRanges:n.essenceRanges,trimInputs:n.trimInputs,wholeFileFallback:n.wholeFileFallback}]},async trim(t,r){let e=t.parts[0];return K(e,r.items,r.handles)},async decode(t,r,e){await l();let n=t.parts[0],a=w(n),i=await re(t),o=e.detail==="coarse",s;if(i==="arriraw")s=await S(a,n.fileSize,r,o?"preview:4":"full");else if(i==="arriraw-alev3")s=await I(a,n.fileSize,r,o?"preview:4":"full");else if(i==="dnxhr")s=await M(a,n.fileSize,r,o?"preview":"full");else if(i==="xocn")s=await P(a,n.fileSize,r,o?"preview":"full");else if(i==="prores")s=await k(a,n.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(t,r){await l();let e=t.parts[0],n=w(e),a=await re(t),i;try{if(a==="arriraw"){let o=await ue(t,r);if(o)return o;i=await S(n,e.fileSize,r,"rgb16")}else if(a==="dnxhr")i=await M(n,e.fileSize,r,"rgb16");else if(a==="xocn")i=await P(n,e.fileSize,r,"rgb16");else throw new Error(`mxf decode16: no decoder for inner codec '${a}'`)}catch(o){throw fe(o,a)}return j(i)}};function fe(t,r){let e=typeof t=="string"?t:t instanceof Error?t.message:"";return/has no 16-bit decoder|no rgb16 tier/.test(e)?new Error(`mxf ${r}: has no 16-bit decoder \u2014 ${e}`):t}var Y=new WeakMap;async function ue(t,r){if(!N)return null;try{let e=await import("./arriraw-YIJ3BYNN.js");if(!await e.arrirawGpuAvailable())return null;let{parseArrirawGpuPayload:n,arrirawFrameToRgb16:a}=await import("./clip-state-B6JOX3JE.js"),i=t.parts[0],o=Y.get(t)??null,s=await B(w(i),i.fileSize,r,o?.key),c=n(s,o);if(!c)return null;Y.set(t,{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(t){let r=ee.get(t);if(r)return r;await l();let e=t.parts[0],n=w(e),a="mxf";return await T(n,e.fileSize)?a="arriraw":await D(n,e.fileSize)?a="arriraw-alev3":await L(n,e.fileSize)?a="dnxhr":await C(n,e.fileSize)?a="xocn":await E(n,e.fileSize)&&(a="prores"),ee.set(t,a),a}export{Me 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-F4PHKOAS.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{d as h}from"./chunk-
|
|
3
|
+
import{d as h}from"./chunk-2CY2OOOJ.js";import{$ as o,F as d,b as p,g as n,i as a,n as u,t as s}from"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";import{dirname as m}from"node:path";import{fileURLToPath as P}from"node:url";import w from"node:process";var r="ColorMatchProbe.ofx.bundle",x="http://127.0.0.1:9876",i="/Library/OFX/Plugins";async function b(){let e=w.execPath;for(let t of[p("CONFORM_RESOLVE_PROBE"),o(m(e),"..","Resources","resolve-probe",r),o(m(P(import.meta.url)),"..","..","..","resolve_hook","build",r)])if(t&&await s(o(t,"Contents","MacOS","ColorMatchProbe.ofx")))return t;return null}async function E(){let e=n()==="darwin"&&a()==="arm64",t=await s(o(i,r)),l=await fetch(x+"/",{signal:AbortSignal.timeout(500)}).then(f=>f.ok).catch(()=>!1),c=!!await b();return{installed:t,loaded:l,shipped:c,supported:e,next:e?l?"running: the Color page selection and the selected node are read live":t?"installed; restart Resolve to load it":c?"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 S(){if(n()!=="darwin"||a()!=="arm64")throw new Error("the probe runs on Apple silicon Macs only");let e=await b();if(!e)throw new Error("this build does not carry the probe (resolve_hook/build.sh makes it)");return await h("darwin",e,i,r),await d(o(u(),"Library","Application Support","Blackmagic Design","DaVinci Resolve","OFXPluginCacheV2.xml")).catch(()=>{}),{path:o(i,r),restart_required:!0}}export{r as PROBE_BUNDLE,x as PROBE_URL,S as installProbe,E 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-F4PHKOAS.js";import{Aa as v,Ba as F,H as _,Ha as O,I as S,Ia as f,J as P,ja as b,ka as R,xa as w}from"./chunk-DPA26AOI.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 U(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 J(t,e,r){let n=U(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(!O)return null;try{let n=await(await import("./r3d-I6EYEYX7.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,D=new WeakMap;function x(t){let e=D.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),D.set(t,e)),e}async function N(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 J(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 N(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 N(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};
|
|
@@ -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-XF3YMBI7.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.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};
|
|
@@ -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{A as a,B as b,C as c,D as d,E as e,F as f,G as g}from"./chunk-VJN4UXFJ.js";import"./chunk-6NLB5TZ2.js";import"./chunk-64X5DLH5.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.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 i,Tb as a,Ub as b,Vb as c,Wb as d,Xb as e,Yb as f,Zb as g,_b as h,ac as j,bc as k,cc as l,dc as m,ec as n,fc as o,gc as p,hc as q,ic as r,jc as s}from"./chunk-LYM757KG.js";import"./chunk-IN6XVTUS.js";import"./chunk-DFQWQ3EA.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-B77ADB26.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-WJ5EWXP2.js";import"./chunk-YUO3UWPH.js";import"./chunk-JV7TZDKJ.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-P3XI63Q2.js";import"./chunk-F4PHKOAS.js";import"./chunk-ISKNIQVO.js";import"./chunk-DKGGJM6Z.js";import"./chunk-THVX57I3.js";import"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-VJN4UXFJ.js";import"./chunk-6NLB5TZ2.js";import"./chunk-64X5DLH5.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";export{i as OPERATION_KINDS,a as READ_FORMATS,j as applyOperation,l as applyOperationWithSources,r as consolidate,g as countFlags,b as detectFormat,s as judge,q as linkText,e as listClips,h as listFlags,f as listMedia,c as readTimeline,m as resolveTarget,p as routesText,d as summarize,k as trackIndex,o as writeDestination,n as writeTimeline};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conformtools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
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",
|
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
"@napi-rs/canvas": "^0.1.80"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
|
|
24
25
|
"@modelcontextprotocol/sdk": "1.31.0",
|
|
25
26
|
"esbuild": "^0.25",
|
|
26
27
|
"opentype.js": "^2.0.0",
|
|
28
|
+
"quickjs-emscripten-core": "0.32.0",
|
|
29
|
+
"sucrase": "3.35.1",
|
|
27
30
|
"zod-to-json-schema": "3.25.2"
|
|
28
31
|
},
|
|
29
32
|
"homepage": "https://conform.tools",
|
|
@@ -39,5 +42,11 @@
|
|
|
39
42
|
],
|
|
40
43
|
"publishConfig": {
|
|
41
44
|
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"optionalDependencies": {
|
|
47
|
+
"conformtools-darwin-arm64": "0.6.12",
|
|
48
|
+
"conformtools-darwin-x64": "0.6.12",
|
|
49
|
+
"conformtools-linux-x64": "0.6.12",
|
|
50
|
+
"conformtools-windows-x64": "0.6.12"
|
|
42
51
|
}
|
|
43
52
|
}
|
package/dist/bridge-73XMEZLH.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{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}from"./chunk-JHTMYXJM.js";import"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";export{c as BridgeError,g as HostBridge,e as PANEL_PREFIX,b as PORTS,a as PROTOCOL,h as hostBridge,d as pairingPath,f as panelOrigins,i as resetHostBridge};
|
package/dist/chunk-2MJAQROY.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{A,B as P,C as T,D as M,E as D,F as N,G as z,j as C,w as R,x as S,y as E,z as L}from"./chunk-DFDXSIMI.js";import{W as l,q as j}from"./chunk-DNS4ZYIO.js";async function H(r,t){let d=t.media_root?[t.media_root]:await D();if(!d.length)throw new Error("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 Error(`media_root is not a folder on this machine: ${e}`)}let i=S(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 g=[],w=!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 L(e,c):null;o?g.push(o):m.push(`${n.id} ${l(c)}: not at its recorded path under ${e}`)}else{let n=await E(e,i,t.cap);g.push(...n.paths),w||=n.capped}let{refs:_,failed:u}=await A([...new Set(g)]);t.remember&&t.media_root&&await N(t.media_root);let b=new Set(i.map(e=>e.id)),p=C(r,_,b);if(p.splits.length){r=p.session;let e=new Set([...b,...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(q=>q.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=R(t.criteria),s=P(r,i,_,a,t.tolerances),I=t.criteria?.picture?await T(r,s):[],k=[`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)${w?` (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),...I.slice(0,40)];if(t.dry_run)return{session:r,changed:!1,note:"",text:[...k,z(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,h=[];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):h.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 $=M(r,s,f),y=$.session.media_references??[],v=y.filter(e=>i.some(n=>n.id===e.id)&&e.binding_state==="linked").length,O=$.applied,x=y.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")}`),U=[...k,`Linked ${v} of ${i.length}${h.length?`; ${h.length} pick(s) vetoed`:""}`,...O.map(e=>`- ${e.ref_id}: ${l(e.before.path??"?")} \u2192 ${e.after.path}${e.warning?` \u26A0 ${e.warning}`:""}`),...h.map(e=>` \u2717 ${e}`),...x.length?["unresolved:",...x]:[]].join(`
|
|
5
|
-
`);return{session:$.session,changed:!0,note:`relink ${t.gather} ${d[0]} (${v}/${i.length})`,text:U}}export{H as a};
|
package/dist/chunk-7QUSVHO2.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 M}from"./chunk-PFZVET7S.js";import{b as fe,c as pe,f as he}from"./chunk-6V4OEOOX.js";import{f as K,h as me}from"./chunk-XDI6CPPV.js";import{a as de}from"./chunk-DGXZB7MO.js";import{i as D}from"./chunk-JXTRQ3UG.js";import{b as C,d as J,f as R}from"./chunk-NU3X7P4N.js";import{Ia as ue,ea as oe,fa as ie,ja as se,oa as ae,wa as ce,xa as le}from"./chunk-DPA26AOI.js";import{a as ne}from"./chunk-PHAMF4JF.js";import{C as W,I as v,J as A,K as re,N as te,W as b,X as y,Y as L,Z as _,b as E,c as Z,d as Q,g as q,p as I,q as B,s as ee,t as O,w as H,y as j}from"./chunk-DNS4ZYIO.js";var V=!1;var F=8,Me=0,Fe=3,z=2;async function Pe(e){let t=new Uint8Array(await e.slice(0,16).arrayBuffer()),o=s=>String.fromCharCode(t[s],t[s+1],t[s+2],t[s+3]);if(t[0]===6&&t[1]===14&&t[2]===43&&t[3]===52)return"mxf";if(o(4)==="RED1"||o(4)==="RED2")return"r3d";let r=t[0]<<24|t[1]<<16|t[2]<<8|t[3],i=o(4);return/^[A-Za-z0-9 ]{4}$/.test(i)&&(r>=8||r===1)&&r<=e.size?"isobmff":null}function Ee(e){let t=e.toLowerCase();return t.endsWith(".braw")?"braw":t.endsWith(".crm")?"crm":"mov"}function Oe(e){return async(t,o)=>new Uint8Array(await e.slice(t,Math.min(t+o,e.size)).arrayBuffer())}function be(e){let t=e.timecode;return!t||!t.fps_denominator?null:t.fps_numerator/t.fps_denominator}async function nr(e){return await ue(),ge?ge.clip(e,V?"rec709":"",()=>we(e)):we(e)}var ge=null;async function we(e){let t=await Pe(e),o=[];if(t==="r3d"){let r=e,i=r.parts&&r.bases?r.parts:[{name:e.name,size:e.size}],n=r.bases??[0],s=async(u,m,d)=>{let f=n[u]+m;return new Uint8Array(await e.slice(f,Math.min(f+d,n[u]+i[u].size)).arrayBuffer())},a=JSON.stringify(i.map(u=>({name:u.name,size:u.size}))),c=JSON.parse(await le(s,a)),l=JSON.parse(await se(s,a));return i.length===1&&/_\d{3}\.r3d$/i.test(e.name)&&!/_001\.r3d$/i.test(e.name)&&o.push("spanned R3D part \u2014 only this part's frames are indexed"),{frames:l.map(u=>({offset:n[u.part??0]+u.essenceOffset,size:u.essenceLength})),w:c.width??0,h:c.height??0,fps:be(c),startFrame:c.timecode?.start_frame??0,dropFrame:c.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:Me},geometrySpec:{codec:"r3d",subbands:Fe},index:null,warnings:o}}if(t==="mxf"){let r=Oe(e),i=JSON.parse(await ce(r,e.size));if(!i)throw new Error(`${e.name}: MXF index unreadable`);let n=JSON.parse(await ae(r,e.size)),s=[];for(let f=0;f<n.frame_count;f++)s.push({offset:n.frames[f*2],size:n.frames[f*2+1]});let a=s.filter(f=>f.size===0).length;a&&o.push(`${a} frame(s) had no locatable picture KLV`);let c=i.width??0,l=i.height??0,u=(i.inner_codec??"").toLowerCase(),m=null,d="MXF";return u==="arriraw"?(m={codec:"arriraw",w:c,h:l,scale:F},d="ARRIRAW"):u==="xocn"?(m={codec:"xocn",scale:F,...V?{display:"rec709"}:{}},d="X-OCN"):await ie(r,e.size)?(m={codec:"vc3",scale:F},d="DNxHR"):await oe(r,e.size)?(m={codec:"prores"},d="ProRes"):o.push(`MXF inner codec ${u||"unknown"} not wired to the fingerprint pool`),{frames:m?s:[],w:c,h:l,fps:be(i),startFrame:i.timecode?.start_frame??0,dropFrame:i.timecode?.drop_frame??!1,label:d,spec:m,geometrySpec:m&&m.codec==="arriraw"?{...m,scale:z}:m&&m.codec==="xocn"?{codec:"xocn",scale:z,...V?{display:"rec709"}:{}}:m&&m.codec==="vc3"?{codec:"vc3",scale:z}:null,index:null,warnings:o}}if(t==="isobmff"){let r=await me(e),i=Ee(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:K(r.kind),spec:{codec:"prores"},geometrySpec:null,index:r,warnings:o};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:K(r.kind),spec:null,geometrySpec:null,index:r,warnings:o};let n=i==="braw"?{codec:"braw",scale:F}:r.codec==="aprh"||r.codec==="aprn"?{codec:"proresraw",scale:F}:null;return n||o.push(`codec ${r.codec} not wired to the fingerprint pool`),{frames:n?r.offs:[],w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:n?i==="braw"?"BRAW":"ProRes RAW":`unsupported (${r.codec})`,spec:n,geometrySpec:n?{...n,scale:z}:null,index:r,warnings:o}}throw new Error(`${e.name}: unrecognised container`)}var Ae=Number(E("CONFORM_DECODERS")??0)||Math.max(2,Math.min(Math.floor(Q()/2),Math.floor(Z()/2**31))),X=0,_e=[],Ce=async(...e)=>{X>=Ae?await new Promise(t=>_e.push(t)):X++;try{return await te(...e)}finally{let t=_e.shift();t?t():X--}};async function De(){let e=q()==="win32"?"conformtools-decode.exe":"conformtools-decode",t=[E("CONFORM_NATIVE_DECODE"),I(new URL(`./${e}`,import.meta.url)),I(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let o of t)if(await ee(o))return o;return null}var $=class extends Error{constructor(o,r){super(r);this.why=o}};function Mr(e){let t=null;try{t=JSON.parse(e.trim().split(`
|
|
4
|
-
`).pop())}catch{}if(t?.why==="not_entitled")throw new ne("not_entitled",t.detail??"this machine is not licensed");return t?.detail??e.trim()}function ze(e,t){try{let o=JSON.parse(e.trim().split(`
|
|
5
|
-
`).pop()??"");return new $(o.why,o.detail)}catch{return new $("decoder",`the native decoder exited ${t}: ${e.trim().slice(-300)}`)}}function Ne(e){let t=e.reduce((i,n)=>i+n.length,0),o=new Uint8Array(t),r=0;for(let i of e)o.set(i,r),r+=i.length;return o}async function ye(e,t,o,r,i){let n=await De();if(!n)throw new $("missing","the native decoder (conformtools-decode) is not installed");let s=null,a=[],c=0,l=d=>{let f=new Uint8Array(d),p=0;for(;p<d;){let h=a[0],g=Math.min(h.length,d-p);f.set(h.subarray(0,g),p),p+=g,g===h.length?a.shift():a[0]=h.subarray(g)}return c-=d,f},u=[e,t,"--width",String(i.width??32768)];i.from!=null&&u.push("--from",String(i.from)),i.count!=null&&u.push("--count",String(i.count)),i.range&&u.push("--range",i.range);let m=await Ce(n,u,d=>{if(a.push(d),c+=d.length,!s){let p=Ne(a.splice(0));a.push(p);let h=p.indexOf(10);if(h<0)return;s=JSON.parse(new TextDecoder().decode(p.subarray(0,h))),l(h+1),o(s)}let f=4+s.w*s.h*(s.bpp??(e==="rgb16"?6:4));for(;c>=f;){let p=l(f);r(new DataView(p.buffer).getUint32(0,!0),p.subarray(4))}},{signal:i.signal});if(m.code!==0||!s)throw ze(m.stderr,m.code)}function xe(e,t,o,r={}){return ye("bgra",e,t,o,r)}function $e(e,t,o,r={}){return ye("rgb16",e,t,(i,n)=>o(i,new Uint16Array(n.buffer,n.byteOffset,n.length>>1)),r)}var Te=["none","rle","zips","zip","piz","pxr24","b44","b44a","dwaa","dwab","htj2k"],N=e=>(e>>4)*10+(e&15);function Ue(e){let t=N(e&63),o=N(e>>>8&127),r=N(e>>>16&127),i=N(e>>>24&63),n=s=>String(s).padStart(2,"0");return`${n(i)}:${n(r)}:${n(o)}${e&64?";":":"}${n(t)}`}function ke(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||t.getUint32(0,!0)!==20000630)return null;let o={fps:null,timecode:null,width:0,height:0,display:null,compression:null,attributes:[]},r=8,i=()=>{let s=r;for(;r<e.length&&e[r]!==0;)r++;let a=new TextDecoder().decode(e.subarray(s,r));return r++,a},n=s=>({width:t.getInt32(s+8,!0)-t.getInt32(s,!0)+1,height:t.getInt32(s+12,!0)-t.getInt32(s+4,!0)+1});for(;r<e.length;){let s=i();if(!s)break;let a=i();if(r+4>e.length)return null;let c=t.getInt32(r,!0);if(r+=4,c<0||r+c>e.length)return null;if(o.attributes.push(`${s}:${a}`),s==="framesPerSecond"&&a==="rational"&&c>=8){let l=t.getInt32(r,!0),u=t.getUint32(r+4,!0);o.fps=u?l/u:null}else s==="timeCode"&&a==="timecode"&&c>=8?o.timecode=Ue(t.getUint32(r,!0)):s==="dataWindow"&&a==="box2i"&&c>=16?{width:o.width,height:o.height}=n(r):s==="displayWindow"&&a==="box2i"&&c>=16?o.display=n(r):s==="compression"&&c>=1&&(o.compression=Te[e[r]]??`type ${e[r]}`);r+=c}return o}async function Ie(e){let t=e,o=null,r=/^(.*?)\[(\d+)-(\d+)\](.*)$/.exec(b(e));if(await O(e))o=/^(.*?)(\d+)(\.exr)$/i;else{t=y(e);let n=r?[null,r[1],r[2],r[4]]:/^(.*?)(\d+)(\.exr)$/i.exec(b(e));if(!n)return{frames:[e],numbers:[]};let s=a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=new RegExp(`^${s(n[1])}(\\d{${n[2].length}})${s(n[3])}$`,"i")}let i=[];for await(let n of v(t)){let s=n.isFile?o.exec(n.name):null;s&&i.push({n:Number(s[s.length===4?2:1]),f:_(t,n.name)})}return i.sort((n,s)=>n.n-s.n),{frames:i.map(n=>n.f),numbers:i.map(n=>n.n)}}async function ve(e){let t=await Ie(e),o=t.frames[0];if(!o)throw new Error(`no .exr frames for '${b(e)}'`);let r=await A(o),i;try{i=ke(await r.readAt(0,Math.min(r.size,1<<20)))}finally{await r.close()}if(!i)throw new Error(`'${b(o)}' is not an OpenEXR file`);let n=Math.max(1,t.frames.length),s=t.numbers.length>1?t.numbers[t.numbers.length-1]-t.numbers[0]+1-t.numbers.length:0,a=i.fps??0;return{id:b(o),kind:"external",target_url:o,local_path:o,content_kind:n>1?"video":"still",source_fps:i.fps??void 0,source_timecode:i.timecode??void 0,source_resolution_w:i.width,source_resolution_h:i.height,available_range:{start:{value:0,rate:a},duration:{value:n,rate:a}},streams:[{kind:"video",codec:"exr",width:i.width,height:i.height,rate:i.fps??void 0,codec_specific:{compression:i.compression}}],vendor_metadata:{exr:{frames:n,first_frame:t.numbers[0]??null,last_frame:t.numbers[t.numbers.length-1]??null,missing_frames:s,display_window:i.display,attributes:i.attributes,fps_source:i.fps!=null?"header framesPerSecond":"not in the header",timecode_source:i.timecode?"header timeCode (first frame)":"not in the header"}}}}var G=new Set([".mov",".mp4",".m4v",".mxf",".wav",".braw",".crm",".r3d",".aif",".aiff"]);async function Be(e){let t=await A(e);return{path:e,file:t,size:t.size}}function He(e){return(t,o)=>e.file.readAt(t,o)}async function je(e){let t=M(b(e));if(!t)return[e];let o=y(e),r=[];for await(let i of v(o)){if(!i.isFile)continue;let n=M(i.name);n&&n.clipBase===t.clipBase&&r.push({n:n.partNumber,p:_(o,i.name)})}return r.sort((i,n)=>i.n-n.n).map(i=>i.p)}async function Y(e){if(await O(e)){let n=[];for await(let s of v(e))s.isFile&&M(s.name)&&n.push(_(e,s.name));if(!n.length)throw new Error(`'${b(e)}' is a folder with no .R3D parts`);e=n.sort()[0]}let t=pe(b(e));if(!t)throw new Error(`unsupported media file '${b(e)}' (supported: ${[...G].join(" ")})`);let o=await je(e),r=await Promise.all(o.map(Be));return{source:he(t,r.map(n=>fe(b(n.path),{fileSize:n.size,read:He(n)}))),parts:r,format:t,anchor:o[0],close:()=>r.forEach(n=>n.file.close())}}async function We(e,t,o,r){if(!/h264|avc|hevc|h265/.test(o)){let i=null,n=await Y(e);try{return await D(n.source,{verb:"decode",index:t,intent:"park"})}catch(s){i=s}finally{n.close()}try{return await Se(e,t,r)}catch(s){throw/no decoder/.test(String(i))?s:i instanceof Error?i:new Error(String(i))}}return Se(e,t,r)}async function kr(e,t,o,r={}){if(/\.mxf$/i.test(e)&&(!o||/h264|avc|mxf/.test(o))){let a=null,c=null;try{await $e(e,l=>{a=l},(l,u)=>{l===t&&(c=u.slice())},{from:t,count:1,range:r.range})}catch(l){if(!(l instanceof $)||!/unsupported|missing/.test(l.why))throw l}if(c&&a){let l=a;return{rgb:c,width:l.w,height:l.h,bits:l.bit_depth??16,decoder:"media-core",full_range:l.full_range??null}}}let i=await We(e,t,o),n=i.width*i.height,s=new Uint16Array(n*3);for(let a=0;a<n;a++)s[a*3]=i.rgba[a*4]*257,s[a*3+1]=i.rgba[a*4+1]*257,s[a*3+2]=i.rgba[a*4+2]*257;return{rgb:s,width:i.width,height:i.height,bits:8,decoder:"8-bit",full_range:null}}async function Se(e,t,o){t=Math.round(t);let r=0,i=0,n=null;if(await xe(e,a=>{r=a.w,i=a.h},(a,c)=>{a===t&&(n=c)},{from:t,count:1,width:o}),!n)throw new Error(`the OS decoder returned no frame ${t} of ${b(e)}`);let s=n;for(let a=0;a<s.length;a+=4){let c=s[a];s[a]=s[a+2],s[a+2]=c}return{rgba:s,width:r,height:i}}async function P(e){if(/\.exr$/i.test(e))return ve(e);let t=await Y(e);try{let o=await D(t.source,{verb:"inspect"});if(!o)throw new Error(`could not read '${b(e)}' as ${t.format}`);return o.target_url=t.anchor,o.local_path=t.anchor,o.id=o.id||b(t.anchor),t.parts.length>1&&((o.vendor_metadata??={}).spanned_parts=t.parts.map(r=>b(r.path))),o.size_bytes=t.parts.reduce((r,i)=>r+i.size,0),o}finally{t.close()}}function Le(e,t,o,r){let i=Math.abs(r*1001-Math.round(r*1001/1e3)*1e3)<1?Math.round(r)*1e3/1001:r,n=Math.floor(e*i/t+1e-6);return{tc:C(n,r),frames:Math.round(o*i/t)}}var Je=e=>String(Math.round(e*1e3)/1e3);function Ir(e,t){let o=e.streams?.find(m=>m.kind==="video"),r=e.streams?.filter(m=>m.kind==="audio")??[],i=e.vendor_metadata?.bext;if(!o&&e.available_range&&r[0]?.rate){let m=r[0].rate,d=e.available_range.duration.value,p=(t?[t]:[24e3/1001,24]).map(h=>{let g=Le(i?.time_reference??0,i?.sample_rate||m,d,h);return`${i?`start TC ${g.tc}, `:""}${g.frames} frames @ ${Je(h)} fps`});return[e.target_url??"",`audio only; ${d} samples (${(d/m).toFixed(3)} s)${i?`; BWF time_reference ${i.time_reference}`:"; no BWF timecode"}`,...p,...t?[]:["(pass fps for the project's rate)"],...r.map((h,g)=>`audio ${r.length>1?`${g+1}: `:""}${h.codec??"pcm"} ${h.channels??"?"}ch ${h.rate} Hz ${h.bit_depth??"?"}-bit`)].join(`
|
|
6
|
-
`)}let n=e.available_range?.duration?.value??e.declared_duration?.value??null,s=e.source_fps??o?.rate??null,a=e.size_bytes,c=e.vendor_metadata?.spanned_parts,l=o?.codec_specific??{},u=[l.profile?`${l.profile} (${l.fourcc})`:l.fourcc,l.pixel_format,o?.bit_depth?`${o.bit_depth}-bit`:null,l.colr?`color ${l.colr.primaries}/${l.colr.transfer}/${l.colr.matrix} (primaries/transfer/matrix)`:null].filter(Boolean).join(", ");return[e.target_url??"",o?`${o.codec??"?"} ${o.width??"?"}x${o.height??"?"}${s?` @ ${Math.round(s*1e3)/1e3} fps`:""}${u?`; ${u}`:""}`:"no video track",`start TC ${e.source_timecode??"none"}; ${n!=null?`${n} frames`:"length unknown"}${n!=null&&s?` (${(n/s).toFixed(2)} s)`:""}`,r.length?r.map((m,d)=>{let f=m.codec_specific?.channel_layout;return`audio ${r.length>1?`${d+1}: `:""}${m.codec??"pcm"} ${m.channels??"?"}ch${f?` (${f})`:""} ${m.rate??"?"} Hz ${m.bit_depth??"?"}-bit`}).join(`
|
|
7
|
-
`):"no audio",`${e.reel_name?`reel ${e.reel_name}; `:""}${a!=null?`${(a/1e6).toFixed(1)} MB`:""}${c?`; spanned ${c.length} parts`:""}`].join(`
|
|
8
|
-
`)}var Ke=8*1024*1024,T=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));async function Ve(e,t,o){if(e.executable_locally===!1)throw new Error("this trim plan is server-side only");let r=new Map(t.parts.map(n=>[b(n.path),n]));await j(y(o));let i=await re(o);try{await i.truncate(e.total_size),await i.writeAt(0,T(e.dest_header_bytes_base64));for(let n of e.src_byte_ranges){let s=n.src_file_name?r.get(b(n.src_file_name)):t.parts[0];if(!s)throw new Error(`plan references unknown source part '${n.src_file_name}'`);let a=0;for(;a<n.length;){let c=Math.min(Ke,n.length-a),l=await s.file.readAt(n.offset+a,c);if(l.length<c)throw new Error(`short read in ${b(s.path)} at ${n.offset+a}`);await i.writeAt(n.write_to_dest_offset+a,l),a+=c}}e.dest_footer_bytes_base64&&e.dest_footer_offset!=null&&await i.writeAt(e.dest_footer_offset,T(e.dest_footer_bytes_base64));for(let n of e.dest_patches??[])await i.writeAt(n.offset,T(n.bytes_base64))}finally{await i.close()}for(let n of e.dest_sidecar_writes??[])await H(_(y(o),n.name),T(n.bytes_base64))}function Xe(e,t){let o=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let i=r.source_range.start.value,n=r.source_range.duration.value,s=Math.max(0,Math.floor(i)-t),a=Math.floor(i+n-1)+t;a>=s&&o.push({first_frame:s,last_frame:a})}return de(o)}async function Ge(e,t,o,r,i){let n=await Y(e);try{let s=Xe(t,o);if(!s.length)throw new Error("no usable frame ranges (items need kind=clip with source_range)");let a=await D(n.source,{verb:"trim",selection:{items:t,handles:o}}),c=L(n.anchor),l=n.format==="r3d",u=l?M(b(n.anchor))?.clipBase??b(n.anchor,c):b(n.anchor,c),m=[];for(let[d,f]of a.entries()){let p=f.output_clip_number??(s.length>1?d+1:void 0),h=s[(p??1)-1]??s[0],g=p&&(f.output_clip_count??s.length)>1?`_S${String(p).padStart(3,"0")}`:"",w;if(l){let x=f.output_part_number??d+1;w=_(r,`${u}${g}.RDC`,`${u}_${String(x).padStart(3,"0")}.R3D`),m.push({path:w,bytes:f.total_size,island:h,part:x,clip:p})}else{let x=i&&a.length===1?i:`${u}${g||`_trim_${h.first_frame}-${h.last_frame}`}${c}`;w=_(r,x),m.push({path:w,bytes:f.total_size,island:h,clip:p})}await Ve(f,n,w)}return l||await Ye(e,m,!!i&&a.length===1),{outputs:m,islands:s,format:n.format}}finally{n.close()}}async function Ye(e,t,o){let r=await P(e).catch(()=>null),i=r?.source_fps??r?.streams?.find(n=>n.kind==="video")?.rate??null;if(!(!r?.source_timecode||!i))for(let n of t){if(!n.island)continue;let s=await P(n.path).catch(()=>null),a=s?.available_range?.duration?.value??s?.declared_duration?.value;if(!s?.source_timecode||!a)continue;let c=R(s.source_timecode,i,r.source_timecode);if(c===n.island.first_frame&&c+a-1===n.island.last_frame||(n.island={first_frame:c,last_frame:c+a-1},o))continue;let l=n.path.replace(/_trim_\d+-\d+(\.[^./\\]+)$/,`_trim_${c}-${c+a-1}$1`);l!==n.path&&(await W(n.path,l),n.path=l)}}async function Br(e){let t=await P(e.path),o=t.source_fps??t.streams?.find(p=>p.kind==="video")?.rate??null,r=t.available_range?.duration?.value??t.declared_duration?.value??null;if(!o)throw new Error("cannot trim: no frame rate / timecode track on this file");let i=R(e.in,o,t.source_timecode??null),n=R(e.out,o,t.source_timecode??null);if(e.out_exclusive&&(n-=1),n<i)throw new Error(`out (${n}) is before in (${i})`);if(i<0)throw new Error(`in (${i}) is before the file start (TC ${t.source_timecode})`);if(r!=null&&n>r-1)throw new Error(`out (${n}) is past the last frame (${r-1})`);let s={id:"trim",kind:"clip",source_range:{start:{value:i,rate:o},duration:{value:n-i+1,rate:o}}},a=y(e.path),c;if(e.out_path)try{(await B(e.out_path)).isDirectory?a=e.out_path:(a=y(e.out_path),c=b(e.out_path))}catch{a=y(e.out_path),c=b(e.out_path)}let l=await Ge(e.path,[s],Math.max(0,Math.floor(e.handles??0)),a,c),u=l.islands[0],m=l.outputs.length===1&&l.outputs[0].island?l.outputs[0].island:u,d=m.first_frame,f=m.last_frame;return{outputs:l.outputs,first_frame:d,last_frame:f,frames:f-d+1,fps:o,facts:t,...d!==u.first_frame||f!==u.last_frame?{asked:{first_frame:u.first_frame,last_frame:u.last_frame}}:{}}}function Re(e){let t=[...G].map(o=>o.slice(1)).join("|");return e.toLowerCase().replace(new RegExp(`\\.(${t})(?=[._\\s-]|$)`,"g"),"").replace(/[^a-z0-9]/g,"")}function Ze(e,t){let o=Re(e),r=Re(t);if(r&&o.includes(r))return"name";let i=t.toLowerCase().split(/[^a-z0-9]+/).filter(n=>/\d/.test(n)&&n.length>=3);return i.length&&i.every(n=>o.includes(n))?"id":null}async function Hr(e,t,o){let r=[],i=0,n=null,s=Date.now()+o.time_limit_s*1e3,a=async(c,l)=>{try{for await(let u of v(c)){if(n&&!n.startsWith("folders"))return;if(++i>o.max_entries){n=`stopped after ${o.max_entries} entries (max_entries)`;return}if(Date.now()>s){n=`stopped after ${o.time_limit_s} s (time_limit_s)`;return}if(u.name.startsWith("."))continue;let m=_(c,u.name);if(u.isDirectory)l<o.max_depth?await a(m,l+1):n??=`folders deeper than max_depth=${o.max_depth} not searched (e.g. ${m})`;else if(u.isFile&&G.has(L(u.name).toLowerCase())){let d=Ze(u.name,t);d&&r.push({path:m,match:d,size:(await B(m).catch(()=>({size:0}))).size})}}}catch{}};if(await a(e,0),o.probe)for(let c=0;c<r.length;c+=8)await Promise.all(r.slice(c,c+8).map(async l=>{try{l.facts=await P(l.path)}catch(u){l.error=u.message}}));return r.sort((c,l)=>c.path.localeCompare(l.path)),{hits:r,scanned:i,truncated:n}}function Qe(e){let t=e.streams?.find(a=>a.kind==="video"),o=e.source_fps??t?.rate??null,r=e.available_range?.duration?.value??e.declared_duration?.value??null,i=t?.codec_specific??{},n=e.source_timecode&&o?J(e.source_timecode,o):null,s=n!=null&&r!=null&&o?C((n+r)%(Math.round(o)*86400),o,e.source_timecode.includes(";")):null;return`${t?`${t.codec??"?"}${i.profile?` ${i.profile}`:""} ${t.width??"?"}x${t.height??"?"}`:"no video"}${o?` @ ${Math.round(o*1e3)/1e3} fps`:""}; TC ${e.source_timecode??"none"}${s?`\u2013${s}`:""}; ${r??"?"} fr${r!=null&&o?` (${(r/o).toFixed(2)} s)`:""}`}function jr(e,t,o,r){let i=e.hits.slice(0,r),n=[];e.truncated&&n.push(`TRUNCATED: ${e.truncated} \u2014 the search did NOT cover all of ${t}; the matches below may be incomplete.`),e.hits.length>i.length&&n.push(`TRUNCATED: showing ${i.length} of ${e.hits.length} matches. Pass limit=${e.hits.length} or narrow the query.`),n.push(`${e.hits.length} file${e.hits.length===1?"":"s"} match "${o}" under ${t} (${e.scanned} entries scanned)`);let s=new Map;for(let c of e.hits)s.set(b(c.path).toLowerCase(),(s.get(b(c.path).toLowerCase())??0)+1);let a=[...s].filter(([,c])=>c>1);a.length&&n.push(`same name in several folders: ${a.map(([c,l])=>`${c} \xD7${l}`).join(", ")} \u2014 they can be DIFFERENT clips; match by TC + duration, never by name alone`);for(let c of i)n.push(`- ${c.path}${c.match==="id"?" (id match)":""}
|
|
9
|
-
${c.facts?Qe(c.facts):c.error?`probe failed: ${c.error}`:`${(c.size/1e6).toFixed(1)} MB`}`);return n.join(`
|
|
10
|
-
`)}async function Wr(e,t,o=0){let r=await P(e),i=r.source_fps??r.streams?.find(d=>d.kind==="video")?.rate??null,n=r.available_range?.duration?.value??r.declared_duration?.value??null;if(!i||n==null)throw new Error(`cannot check coverage: ${b(e)} has no frame rate or length`);let s=Math.round(i)*86400,a=r.source_timecode?J(r.source_timecode,i)??0:0,c=!!r.source_timecode?.includes(";"),l=d=>{let f=R(d,i,r.source_timecode??null);return typeof d=="number"||/^\d+$/.test(d.trim())?f:f<-s/2?f+s:f>s/2?f-s:f},u=d=>C(((a+d)%s+s)%s,i,c),m=t.map((d,f)=>{let p=l(d.in),h=l(d.out),g=p,w=n-h,x=g>=0&&w>=0&&h>p,U=Math.max(0,-g),k=Math.max(0,-w),S=[];return h<=p?S.push("out is not after in"):x?S.push(`covered; handles head ${g} / tail ${w} fr`):S.push(`NOT covered: short ${[U?`${U} fr at head`:"",k?`${k} fr at tail`:""].filter(Boolean).join(", ")}`),x&&o&&(g<o||w<o)&&S.push(`handles short of ${o}: ${[g<o?`head by ${o-g}`:"",w<o?`tail by ${o-w}`:""].filter(Boolean).join(", ")}`),{label:d.label??`range ${f+1}`,in_tc:u(p),out_tc:u(h),frames:h-p,covered:x,head:g,tail:w,short_head:U,short_tail:k,note:S.join("; ")}});return{facts:r,rows:m}}export{nr as a,De as b,Mr as c,xe as d,Ie as e,G as f,je as g,Y as h,We as i,kr as j,P as k,Le as l,Ir as m,Xe as n,Ge as o,Br as p,Re as q,Ze as r,Hr as s,Qe as t,jr as u,Wr as v};
|
package/dist/chunk-CJYLQ3UM.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{a as f}from"./chunk-PHAMF4JF.js";import{O as w,b as m,f as d,g as y,p,s as g}from"./chunk-DNS4ZYIO.js";async function E(){let e=y()==="win32"?"conformtools-analyze.exe":"conformtools-analyze",r=[m("CONFORM_ANALYZE"),p(new URL(`./${e}`,import.meta.url)),p(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let n of r)if(await g(n))return n;return null}var b=e=>e.code==="not_entitled"?new f("not_entitled",String(e.why)):void 0;async function v(e){let r=await h(),n=await r.ask({op:"job",reference:e.reference,clips:e.clips,lite:e.lite??!0,display:!!e.display});if(!n.ok)throw r.close(),b(n)??new Error(`analysis engine: ${n.why}`);return r}async function k(e,r,n){let s=await h(),i=()=>s.close();n?.addEventListener("abort",i);let t;try{t=await s.ask(e,r)}finally{n?.removeEventListener("abort",i),s.close()}if(n?.aborted)throw new Error("cancelled");if(!t.ok)throw b(t)??new Error(t.why??`the analysis engine could not run ${e.op}`);return t}async function h(){let e=await E();if(!e)throw new Error("the analysis engine (conformtools-analyze) is not installed");let r="",n=null,s=w(e,["serve"],l=>{r+=new TextDecoder().decode(l);let a;for(;(a=r.indexOf(`
|
|
4
|
-
`))>=0;){let u=r.slice(0,a);r=r.slice(a+1);let o=JSON.parse(u);if(o.progress){n?.progress?.(o.progress[0],o.progress[1],o.phase??"");continue}let c=n;n=null,c?.done(o)}},l=>console.error(l.trimEnd()));s.exited.then(()=>n?.done({ok:!1,why:"the analysis engine exited"}));let i=Promise.resolve();return{ask:(l,a)=>{let u=i.then(async()=>{s.hold(!0);try{let o=new Promise(x=>{n={done:x,progress:a}});await s.write(new TextEncoder().encode(JSON.stringify(l)+`
|
|
5
|
-
`));let c=await o;return c.miss&&(console.error(`[mirror] MISS \u2014 ${c.miss} is not in the mirror. Replay never reads the source drive; record this case again with the drive mounted (CONFORM_MIRROR_MODE=record).`),d(75)),c}finally{s.hold(!1)}});return i=u.catch(()=>{}),u},close:()=>s.close()}}export{E as a,v as b,k as c,h as d};
|