conformtools 0.6.18 → 0.6.19
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 +3 -2
- package/dist/{account-O3J732QJ.js → account-KSE6H6DJ.js} +1 -1
- package/dist/{agent-hook-setup-HBT2LTVR.js → agent-hook-setup-SHZOVJYL.js} +1 -1
- package/dist/{analysis-engine-BZUEBW55.js → analysis-engine-KUGSWNQB.js} +1 -1
- package/dist/{bridge-25FGN67G.js → bridge-REYIYXUU.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-ANQZKVDD.js → chunk-3J2FARFO.js} +1 -1
- package/dist/{chunk-LP2MR4ZH.js → chunk-4KMSOMLG.js} +227 -219
- package/dist/chunk-4PV2UTKG.js +10 -0
- package/dist/{chunk-PIM3PV5N.js → chunk-BD54PRSN.js} +1 -1
- package/dist/{chunk-NN444GPH.js → chunk-BZQAUU3D.js} +1 -1
- package/dist/chunk-COALWMI7.js +4 -0
- package/dist/{chunk-6B3IELRW.js → chunk-CUZVK2JJ.js} +1 -1
- package/dist/{chunk-34JO3JNC.js → chunk-GTN62ZQV.js} +1 -1
- package/dist/{chunk-S5AOIOTT.js → chunk-HKHEL4MZ.js} +1 -1
- package/dist/chunk-HZG55H3B.js +3 -0
- package/dist/{chunk-UIX3TT72.js → chunk-MJKISVPS.js} +2 -2
- package/dist/{chunk-DIW5X4GI.js → chunk-NHVH373D.js} +1 -1
- package/dist/chunk-NQD6H7SY.js +7 -0
- package/dist/chunk-PY6HS3EP.js +10 -0
- package/dist/chunk-UWEM5YEM.js +161 -0
- package/dist/{chunk-AYUKWSCR.js → chunk-WM7ESQLY.js} +1 -1
- package/dist/{chunk-MHBNMYZP.js → chunk-WNDA7QSY.js} +1 -1
- package/dist/{chunk-2V5PY4P5.js → chunk-XQON6ASI.js} +1 -1
- package/dist/chunk-Y7PFSVRX.js +3 -0
- package/dist/{claude-setup-W27DLJIO.js → claude-setup-ZOEQ5NXE.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/demo-engine-ZX24TAXA.js +3 -0
- package/dist/engine-K6QYU5KJ.js +5 -0
- package/dist/framing-B6LP7MS2.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/hook.js +3 -2
- package/dist/host-relink-VYEOE3NE.js +10 -0
- package/dist/hosted-NLYSTYYN.js +3 -0
- package/dist/hosts-47EW33NY.js +3 -0
- package/dist/http.js +4 -3
- package/dist/{inspect-7XEE32P5.js → inspect-QRHOFMC2.js} +17 -17
- package/dist/mcp.js +8 -8
- package/dist/media-TPGEESEU.js +3 -0
- package/dist/{probe-YDOFGCGD.js → probe-CHT266NN.js} +1 -1
- package/dist/resolve-bridge.py +173 -27
- package/dist/{sequence-patch-2S7IPE52.js → sequence-patch-6FSMBG7O.js} +1 -1
- package/dist/{store-A5AKWOSX.js → store-CFQHKBGL.js} +1 -1
- package/dist/{timeline-ZHDJXDZJ.js → timeline-MZ6A3PQX.js} +1 -1
- package/dist/timeline_core-6BRZG4LP.js +3 -0
- package/package.json +5 -5
- package/dist/chunk-AAJRTGEP.js +0 -10
- package/dist/chunk-GTPTZRO6.js +0 -3
- package/dist/chunk-IDEKLW7C.js +0 -3
- package/dist/chunk-QBQJDV2F.js +0 -161
- package/dist/chunk-ROGMKTND.js +0 -4
- package/dist/chunk-RXRBRR3E.js +0 -10
- package/dist/chunk-T7S2UBNN.js +0 -7
- package/dist/demo-engine-JAQPM4EV.js +0 -3
- package/dist/engine-ZGBF3SQN.js +0 -5
- package/dist/framing-PGFJZIBU.js +0 -3
- package/dist/host-relink-M2VWUZW5.js +0 -10
- package/dist/hosted-4CNQYNX5.js +0 -3
- package/dist/hosts-R4BHIZJS.js +0 -3
- package/dist/media-4VUWQJLQ.js +0 -3
- package/dist/timeline_core-ZKQQHUA2.js +0 -3
package/dist/chunk-ROGMKTND.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
var n=class extends Error{constructor(o,r,s){super(r);this.code=o;this.data=s;this.name="ConformError"}};function c(e,t){return{content:[{type:"text",text:e}],...t?{structuredContent:{ok:!0,...t}}:{}}}var l=e=>c(e);function f(e){let t=e instanceof n?e:d(e);return{content:[{type:"text",text:`error [${t.code}]: ${t.message}`}],structuredContent:{ok:!1,code:t.code,message:t.message,...t.data?{data:t.data}:{}},isError:!0}}function d(e){let t=e instanceof Error?e.message:String(e);return/unknown session_id|not found on this machine|No such file|NotFound/i.test(t)?new n("not_found",t):/unsupported|not supported|no local decoder|cannot detect/i.test(t)?new n("unsupported",t):/before the file start|past the last frame|is before|required|unknown (operation|target|verb)/i.test(t)?new n("invalid_args",t):/could not read|failed to parse|engine read failed/i.test(t)?new n("unreadable",t):/refused|coverage|never shipped/i.test(t)?new n("refused",t):/abort|cancel/i.test(t)?new n("cancelled",t):new n("engine",t)}function g(e,t){let[o,...r]=t.content,s=`[conformtools ${e}]`,u=o?[{...o,text:`${s} ${o.text}`},...r]:[{type:"text",text:s}],i=t.structuredContent;return{...t,content:u,...i&&!("text"in i)?{structuredContent:{...i,text:u.map(a=>a.text).join(`
|
|
4
|
-
`)}}:{}}}function p(e){let{images:t,...o}=e;return t?.length?{...o,content:[...e.content,...t.map(r=>({type:"image",...r}))]}:o}export{n as a,c as b,l as c,f as d,g as e,p as f};
|
package/dist/chunk-RXRBRR3E.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 R}from"./chunk-3PVQ5QP4.js";import{b as be,c as ge,f as we}from"./chunk-VFXMP7IF.js";import{f as V,h as pe}from"./chunk-2DEUYEQD.js";import{a as he}from"./chunk-TD3ZHREE.js";import{i as D}from"./chunk-ND2YUUUH.js";import{b as M,d as z,f as F}from"./chunk-NU3X7P4N.js";import{Ha as fe,ea as ae,fa as ce,ja as le,oa as ue,wa as me,xa as de}from"./chunk-L2RTMZCN.js";import{a as ie}from"./chunk-ROGMKTND.js";import{$ as y,B as L,G as J,M as $,N as C,O as oe,R as se,_ as b,aa as K,b as E,ba as _,c as q,d as ee,g as re,k as te,l as H,s as B,t as j,v as ne,w as A,z as W}from"./chunk-GTPTZRO6.js";var X=!1,O=8,Ce=0,De=3,N=2;async function ze(e){let t=new Uint8Array(await e.slice(0,16).arrayBuffer()),o=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(o(4)==="RED1"||o(4)==="RED2")return"r3d";let r=t[0]<<24|t[1]<<16|t[2]<<8|t[3],s=o(4);return/^[A-Za-z0-9 ]{4}$/.test(s)&&(r>=8||r===1)&&r<=e.size?"isobmff":null}function Ne(e){let t=e.toLowerCase();return t.endsWith(".braw")?"braw":t.endsWith(".crm")?"crm":"mov"}function Te(e){return async(t,o)=>new Uint8Array(await e.slice(t,Math.min(t+o,e.size)).arrayBuffer())}function _e(e){let t=e.timecode;return!t||!t.fps_denominator?null:t.fps_numerator/t.fps_denominator}async function sr(e){return await fe(),ye?ye.clip(e,X?"rec709":"",()=>xe(e)):xe(e)}var ye=null;async function xe(e){let t=await ze(e),o=[];if(t==="r3d"){let r=e,s=r.parts&&r.bases?r.parts:[{name:e.name,size:e.size}],n=r.bases??[0],i=async(m,l,d)=>{let f=n[m]+l;return new Uint8Array(await e.slice(f,Math.min(f+d,n[m]+s[m].size)).arrayBuffer())},c=JSON.stringify(s.map(m=>({name:m.name,size:m.size}))),a=JSON.parse(await de(i,c)),u=JSON.parse(await le(i,c));return s.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:u.map(m=>({offset:n[m.part??0]+m.essenceOffset,size:m.essenceLength})),w:a.width??0,h:a.height??0,fps:_e(a),startFrame:a.timecode?.start_frame??0,dropFrame:a.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:Ce},geometrySpec:{codec:"r3d",subbands:De},index:null,warnings:o}}if(t==="mxf"){let r=Te(e),s=JSON.parse(await me(r,e.size));if(!s)throw new Error(`${e.name}: MXF index unreadable`);let n=JSON.parse(await ue(r,e.size)),i=[];for(let f=0;f<n.frame_count;f++)i.push({offset:n.frames[f*2],size:n.frames[f*2+1]});let c=i.filter(f=>f.size===0).length;c&&o.push(`${c} frame(s) had no locatable picture KLV`);let a=s.width??0,u=s.height??0,m=(s.inner_codec??"").toLowerCase(),l=null,d="MXF";return m==="arriraw"?(l={codec:"arriraw",w:a,h:u,scale:O},d="ARRIRAW"):m==="xocn"?(l={codec:"xocn",scale:O,...X?{display:"rec709"}:{}},d="X-OCN"):await ce(r,e.size)?(l={codec:"vc3",scale:O},d="DNxHR"):await ae(r,e.size)?(l={codec:"prores"},d="ProRes"):o.push(`MXF inner codec ${m||"unknown"} not wired to the fingerprint pool`),{frames:l?i:[],w:a,h:u,fps:_e(s),startFrame:s.timecode?.start_frame??0,dropFrame:s.timecode?.drop_frame??!1,label:d,spec:l,geometrySpec:l&&l.codec==="arriraw"?{...l,scale:N}:l&&l.codec==="xocn"?{codec:"xocn",scale:N,...X?{display:"rec709"}:{}}:l&&l.codec==="vc3"?{codec:"vc3",scale:N}:null,index:null,warnings:o}}if(t==="isobmff"){let r=await pe(e),s=Ne(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:V(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:V(r.kind),spec:null,geometrySpec:null,index:r,warnings:o};let n=s==="braw"?{codec:"braw",scale:O}:r.codec==="aprh"||r.codec==="aprn"?{codec:"proresraw",scale:O}: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?s==="braw"?"BRAW":"ProRes RAW":`unsupported (${r.codec})`,spec:n,geometrySpec:n?{...n,scale:N}:null,index:r,warnings:o}}throw new Error(`${e.name}: unrecognised container`)}var G=null;var ke=Number(E("CONFORM_DECODERS")??0)||Math.max(2,Math.min(Math.floor(ee()/2),Math.floor(q()/2**31))),Y=0,$e=[],Se=async(...e)=>{Y>=ke?await new Promise(t=>$e.push(t)):Y++;try{return await se(...e)}finally{let t=$e.shift();t?t():Y--}};async function Re(){let e=re()==="win32"?"conformtools-decode.exe":"conformtools-decode",t=[E("CONFORM_NATIVE_DECODE"),te(e),B(new URL(`./${e}`,import.meta.url)),B(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let o of t)if(await ne(o))return o;return null}var v=class extends Error{constructor(o,r){super(r);this.why=o}};function Fr(e){let t=null;try{t=JSON.parse(e.trim().split(`
|
|
4
|
-
`).pop())}catch{}if(t?.why==="not_entitled")throw new ie("not_entitled",t.detail??"this machine is not licensed");return t?.detail??e.trim()}function Me(e,t){try{let o=JSON.parse(e.trim().split(`
|
|
5
|
-
`).pop()??"");return new v(o.why,o.detail)}catch{return new v("decoder",`the native decoder exited ${t}: ${e.trim().slice(-300)}`)}}function Or(e){return G?.owns(e)?G.meta(`probe|${e}`,()=>ve(e)):ve(e)}async function ve(e){let t=await Re();if(!t)throw new v("missing",H("the native decoder (conformtools-decode)"));let o=[],r=await Se(t,["probe",e],s=>o.push(s));if(r.code!==0)throw Me(r.stderr,r.code);return JSON.parse(new TextDecoder().decode(Fe(o)))}function Fe(e){let t=e.reduce((s,n)=>s+n.length,0),o=new Uint8Array(t),r=0;for(let s of e)o.set(s,r),r+=s.length;return o}async function Ue(e,t,o,r,s){let n=await Re();if(!n)throw new v("missing",H("the native decoder (conformtools-decode)"));let i=null,c=[],a=0,u=d=>{let f=new Uint8Array(d),h=0;for(;h<d;){let p=c[0],g=Math.min(p.length,d-h);f.set(p.subarray(0,g),h),h+=g,g===p.length?c.shift():c[0]=p.subarray(g)}return a-=d,f},m=[e,t,"--width",String(s.width??32768)];s.from!=null&&m.push("--from",String(s.from)),s.count!=null&&m.push("--count",String(s.count)),s.range&&m.push("--range",s.range);let l=await Se(n,m,d=>{if(c.push(d),a+=d.length,!i){let h=Fe(c.splice(0));c.push(h);let p=h.indexOf(10);if(p<0)return;i=JSON.parse(new TextDecoder().decode(h.subarray(0,p))),u(p+1),o(i)}let f=4+i.w*i.h*(i.bpp??(e==="rgb16"?6:4));for(;a>=f;){let h=u(f);r(new DataView(h.buffer).getUint32(0,!0),h.subarray(4))}},{signal:s.signal});if(l.code!==0||!i)throw Me(l.stderr,l.code)}function Oe(e,t,o,r={}){return Ue("bgra",e,t,o,r)}var Ie=["none","rle","zips","zip","piz","pxr24","b44","b44a","dwaa","dwab","htj2k"],T=e=>(e>>4)*10+(e&15);function He(e){let t=T(e&63),o=T(e>>>8&127),r=T(e>>>16&127),s=T(e>>>24&63),n=i=>String(i).padStart(2,"0");return`${n(s)}:${n(r)}:${n(o)}${e&64?";":":"}${n(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 o={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},n=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(o.attributes.push(`${i}:${c}`),i==="framesPerSecond"&&c==="rational"&&a>=8){let u=t.getInt32(r,!0),m=t.getUint32(r+4,!0);o.fps=m?u/m:null}else i==="timeCode"&&c==="timecode"&&a>=8?o.timecode=He(t.getUint32(r,!0)):i==="dataWindow"&&c==="box2i"&&a>=16?{width:o.width,height:o.height}=n(r):i==="displayWindow"&&c==="box2i"&&a>=16?o.display=n(r):i==="compression"&&a>=1&&(o.compression=Ie[e[r]]??`type ${e[r]}`);r+=a}return o}async function je(e){let t=e,o=null,r=/^(.*?)\[(\d+)-(\d+)\](.*)$/.exec(b(e));if(await A(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 i=c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=new RegExp(`^${i(n[1])}(\\d{${n[2].length}})${i(n[3])}$`,"i")}let s=[];for await(let n of $(t)){let i=n.isFile?o.exec(n.name):null;i&&s.push({n:Number(i[i.length===4?2:1]),f:_(t,n.name)})}return s.sort((n,i)=>n.n-i.n),{frames:s.map(n=>n.f),numbers:s.map(n=>n.n)}}async function Pe(e){let t=await je(e),o=t.frames[0];if(!o)throw new Error(`no .exr frames for '${b(e)}'`);let r=await C(o),s;try{s=Be(await r.readAt(0,Math.min(r.size,1<<20)))}finally{await r.close()}if(!s)throw new Error(`'${b(o)}' is not an OpenEXR file`);let n=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(o),kind:"external",target_url:o,local_path:o,content_kind:n>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:n,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:n,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 Z=new Set([".mov",".mp4",".m4v",".mxf",".wav",".braw",".crm",".r3d",".aif",".aiff"]);async function We(e){let t=await C(e);return{path:e,file:t,size:t.size}}function Le(e){return(t,o)=>e.file.readAt(t,o)}async function Je(e){let t=R(b(e));if(!t)return[e];let o=y(e),r=[];for await(let s of $(o)){if(!s.isFile)continue;let n=R(s.name);n&&n.clipBase===t.clipBase&&r.push({n:n.partNumber,p:_(o,s.name)})}return r.sort((s,n)=>s.n-n.n).map(s=>s.p)}async function Q(e){if(await A(e)){let n=[];for await(let i of $(e))i.isFile&&R(i.name)&&n.push(_(e,i.name));if(!n.length)throw new Error(`'${b(e)}' is a folder with no .R3D parts`);e=n.sort()[0]}let t=ge(b(e));if(!t)throw new Error(`unsupported media file '${b(e)}' (supported: ${[...Z].join(" ")})`);let o=await Je(e),r=await Promise.all(o.map(We));return{source:we(t,r.map(n=>be(b(n.path),{fileSize:n.size,read:Le(n)}))),parts:r,format:t,anchor:o[0],close:()=>r.forEach(n=>n.file.close())}}async function Hr(e,t,o,r){if(!/h264|avc|hevc|h265/.test(o)){let s=null,n=await Q(e);try{return await D(n.source,{verb:"decode",index:t,intent:"park"})}catch(i){s=i}finally{n.close()}try{return await Ee(e,t,r)}catch(i){throw/no decoder/.test(String(s))?i:s instanceof Error?s:new Error(String(s))}}return Ee(e,t,r)}async function Ee(e,t,o){t=Math.round(t);let r=0,s=0,n=null;if(await Oe(e,c=>{r=c.w,s=c.h},(c,a)=>{c===t&&(n=a)},{from:t,count:1,width:o}),!n)throw new Error(`the OS decoder returned no frame ${t} of ${b(e)}`);let i=n;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 P(e){if(/\.exr$/i.test(e))return Pe(e);let t=await Q(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,s)=>r+s.size,0),o}finally{t.close()}}function Ke(e,t,o,r){let s=Math.abs(r*1001-Math.round(r*1001/1e3)*1e3)<1?Math.round(r)*1e3/1001:r,n=Math.floor(e*s/t+1e-6);return{tc:M(n,r),frames:Math.round(o*s/t)}}var Ve=e=>String(Math.round(e*1e3)/1e3);function Br(e,t){let o=e.streams?.find(l=>l.kind==="video"),r=e.streams?.filter(l=>l.kind==="audio")??[],s=e.vendor_metadata?.bext;if(!o&&e.available_range&&r[0]?.rate){let l=r[0].rate,d=e.available_range.duration.value,h=(t?[t]:[24e3/1001,24]).map(p=>{let g=Ke(s?.time_reference??0,s?.sample_rate||l,d,p);return`${s?`start TC ${g.tc}, `:""}${g.frames} frames @ ${Ve(p)} fps`});return[e.target_url??"",`audio only; ${d} samples (${(d/l).toFixed(3)} s)${s?`; BWF time_reference ${s.time_reference}`:"; no BWF timecode"}`,...h,...t?[]:["(pass fps for the project's rate)"],...r.map((p,g)=>`audio ${r.length>1?`${g+1}: `:""}${p.codec??"pcm"} ${p.channels??"?"}ch ${p.rate} Hz ${p.bit_depth??"?"}-bit`)].join(`
|
|
6
|
-
`)}let n=e.available_range?.duration?.value??e.declared_duration?.value??null,i=e.source_fps??o?.rate??null,c=e.size_bytes,a=e.vendor_metadata?.spanned_parts,u=o?.codec_specific??{},m=[u.profile?`${u.profile} (${u.fourcc})`:u.fourcc,u.pixel_format,o?.bit_depth?`${o.bit_depth}-bit`:null,u.colr?`color ${u.colr.primaries}/${u.colr.transfer}/${u.colr.matrix} (primaries/transfer/matrix)`:null].filter(Boolean).join(", ");return[e.target_url??"",o?`${o.codec??"?"} ${o.width??"?"}x${o.height??"?"}${i?` @ ${Math.round(i*1e3)/1e3} fps`:""}${m?`; ${m}`:""}`:"no video track",`start TC ${e.source_timecode??"none"}; ${n!=null?`${n} frames`:"length unknown"}${n!=null&&i?` (${(n/i).toFixed(2)} s)`:""}`,r.length?r.map((l,d)=>{let f=l.codec_specific?.channel_layout;return`audio ${r.length>1?`${d+1}: `:""}${l.codec??"pcm"} ${l.channels??"?"}ch${f?` (${f})`:""} ${l.rate??"?"} Hz ${l.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 Xe=8*1024*1024,k=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));async function Ge(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 L(y(o));let s=await oe(o);try{await s.truncate(e.total_size),await s.writeAt(0,k(e.dest_header_bytes_base64));for(let n of e.src_byte_ranges){let i=n.src_file_name?r.get(b(n.src_file_name)):t.parts[0];if(!i)throw new Error(`plan references unknown source part '${n.src_file_name}'`);let c=0;for(;c<n.length;){let a=Math.min(Xe,n.length-c),u=await i.file.readAt(n.offset+c,a);if(u.length<a)throw new Error(`short read in ${b(i.path)} at ${n.offset+c}`);await s.writeAt(n.write_to_dest_offset+c,u),c+=a}}e.dest_footer_bytes_base64&&e.dest_footer_offset!=null&&await s.writeAt(e.dest_footer_offset,k(e.dest_footer_bytes_base64));for(let n of e.dest_patches??[])await s.writeAt(n.offset,k(n.bytes_base64))}finally{await s.close()}for(let n of e.dest_sidecar_writes??[])await W(_(y(o),n.name),k(n.bytes_base64))}function Ye(e,t){let o=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let s=r.source_range.start.value,n=r.source_range.duration.value,i=Math.max(0,Math.floor(s)-t),c=Math.floor(s+n-1)+t;c>=i&&o.push({first_frame:i,last_frame:c})}return he(o)}async function Ze(e,t,o,r,s){let n=await Q(e);try{let i=Ye(t,o);if(!i.length)throw new Error("no usable frame ranges (items need kind=clip with source_range)");let c=await D(n.source,{verb:"trim",selection:{items:t,handles:o}}),a=K(n.anchor),u=n.format==="r3d",m=u?R(b(n.anchor))?.clipBase??b(n.anchor,a):b(n.anchor,a),l=[];for(let[d,f]of c.entries()){let h=f.output_clip_number??(i.length>1?d+1:void 0),p=i[(h??1)-1]??i[0],g=h&&(f.output_clip_count??i.length)>1?`_S${String(h).padStart(3,"0")}`:"",w;if(u){let x=f.output_part_number??d+1;w=_(r,`${m}${g}.RDC`,`${m}_${String(x).padStart(3,"0")}.R3D`),l.push({path:w,bytes:f.total_size,island:p,part:x,clip:h})}else{let x=s&&c.length===1?s:`${m}${g||`_trim_${p.first_frame}-${p.last_frame}`}${a}`;w=_(r,x),l.push({path:w,bytes:f.total_size,island:p,clip:h})}await Ge(f,n,w)}return u||await Qe(e,l,!!s&&c.length===1),{outputs:l,islands:i,format:n.format}}finally{n.close()}}async function Qe(e,t,o){let r=await P(e).catch(()=>null),s=r?.source_fps??r?.streams?.find(n=>n.kind==="video")?.rate??null;if(!(!r?.source_timecode||!s))for(let n of t){if(!n.island)continue;let i=await P(n.path).catch(()=>null),c=i?.available_range?.duration?.value??i?.declared_duration?.value;if(!i?.source_timecode||!c)continue;let a=F(i.source_timecode,s,r.source_timecode);if(a===n.island.first_frame&&a+c-1===n.island.last_frame||(n.island={first_frame:a,last_frame:a+c-1},o))continue;let u=n.path.replace(/_trim_\d+-\d+(\.[^./\\]+)$/,`_trim_${a}-${a+c-1}$1`);u!==n.path&&(await J(n.path,u),n.path=u)}}async function jr(e){let t=await P(e.path),o=t.source_fps??t.streams?.find(g=>g.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 s=F(e.in,o,t.source_timecode??null),n=F(e.out,o,t.source_timecode??null);e.out_exclusive&&(n-=1);let i=t.source_timecode??"00:00:00:00",c=r!=null?M((z(i,o)??0)+r-1,o,!!t.vendor_metadata?.drop_frame):null;if(n<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&&n>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:o},duration:{value:n-s+1,rate:o}}},u=y(e.path),m;if(e.out_path)try{(await j(e.out_path)).isDirectory?u=e.out_path:(u=y(e.out_path),m=b(e.out_path))}catch{u=y(e.out_path),m=b(e.out_path)}let l=await Ze(e.path,[a],Math.max(0,Math.floor(e.handles??0)),u,m),d=l.islands[0],f=l.outputs.length===1&&l.outputs[0].island?l.outputs[0].island:d,h=f.first_frame,p=f.last_frame;return{outputs:l.outputs,first_frame:h,last_frame:p,frames:p-h+1,fps:o,facts:t,...h!==d.first_frame||p!==d.last_frame?{asked:{first_frame:d.first_frame,last_frame:d.last_frame}}:{}}}function Ae(e){let t=[...Z].map(o=>o.slice(1)).join("|");return e.toLowerCase().replace(new RegExp(`\\.(${t})(?=[._\\s-]|$)`,"g"),"").replace(/[^a-z0-9]/g,"")}function qe(e,t){let o=Ae(e),r=Ae(t);if(r&&o.includes(r))return"name";let s=t.toLowerCase().split(/[^a-z0-9]+/).filter(n=>/\d/.test(n)&&n.length>=3);return s.length&&s.every(n=>o.includes(n))?"id":null}async function Wr(e,t,o){let r=[],s=0,n=null,i=Date.now()+o.time_limit_s*1e3,c=async(a,u)=>{try{for await(let m of $(a)){if(n&&!n.startsWith("folders"))return;if(++s>o.max_entries){n=`stopped after ${o.max_entries} entries (max_entries)`;return}if(Date.now()>i){n=`stopped after ${o.time_limit_s} s (time_limit_s)`;return}if(m.name.startsWith("."))continue;let l=_(a,m.name);if(m.isDirectory)u<o.max_depth?await c(l,u+1):n??=`folders deeper than max_depth=${o.max_depth} not searched (e.g. ${l})`;else if(m.isFile&&Z.has(K(m.name).toLowerCase())){let d=qe(m.name,t);d&&r.push({path:l,match:d,size:(await j(l).catch(()=>({size:0}))).size})}}}catch{}};if(await c(e,0),o.probe)for(let a=0;a<r.length;a+=8)await Promise.all(r.slice(a,a+8).map(async u=>{try{u.facts=await P(u.path)}catch(m){u.error=m.message}}));return r.sort((a,u)=>a.path.localeCompare(u.path)),{hits:r,scanned:s,truncated:n}}function er(e){let t=e.streams?.find(c=>c.kind==="video"),o=e.source_fps??t?.rate??null,r=e.available_range?.duration?.value??e.declared_duration?.value??null,s=t?.codec_specific??{},n=e.source_timecode&&o?z(e.source_timecode,o):null,i=n!=null&&r!=null&&o?M((n+r)%(Math.round(o)*86400),o,e.source_timecode.includes(";")):null;return`${t?`${t.codec??"?"}${s.profile?` ${s.profile}`:""} ${t.width??"?"}x${t.height??"?"}`:"no video"}${o?` @ ${Math.round(o*1e3)/1e3} fps`:""}; TC ${e.source_timecode??"none"}${i?`\u2013${i}`:""}; ${r??"?"} fr${r!=null&&o?` (${(r/o).toFixed(2)} s)`:""}`}function Lr(e,t,o,r){let s=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>s.length&&n.push(`TRUNCATED: showing ${s.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 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&&n.push(`same name in several folders: ${c.map(([a,u])=>`${a} \xD7${u}`).join(", ")} \u2014 they can be DIFFERENT clips; match by TC + duration, never by name alone`);for(let a of s)n.push(`- ${a.path}${a.match==="id"?" (id match)":""}
|
|
9
|
-
${a.facts?er(a.facts):a.error?`probe failed: ${a.error}`:`${(a.size/1e6).toFixed(1)} MB`}`);return n.join(`
|
|
10
|
-
`)}async function Jr(e,t,o=0){let r=await P(e),s=r.source_fps??r.streams?.find(d=>d.kind==="video")?.rate??null,n=r.available_range?.duration?.value??r.declared_duration?.value??null;if(!s||n==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?z(r.source_timecode,s)??0:0,a=!!r.source_timecode?.includes(";"),u=d=>{let f=F(d,s,r.source_timecode??null);return typeof d=="number"||/^\d+$/.test(d.trim())?f:f<-i/2?f+i:f>i/2?f-i:f},m=d=>M(((c+d)%i+i)%i,s,a),l=t.map((d,f)=>{let h=u(d.in),p=u(d.out),g=h,w=n-p,x=g>=0&&w>=0&&p>h,U=Math.max(0,-g),I=Math.max(0,-w),S=[];return p<=h?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`:"",I?`${I} 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:m(h),out_tc:m(p),frames:p-h,covered:x,head:g,tail:w,short_head:U,short_tail:I,note:S.join("; ")}});return{facts:r,rows:l}}export{sr as a,Re as b,Fr as c,Or as d,Oe as e,je as f,Z as g,Je as h,Q as i,Hr as j,P as k,Ke as l,Br as m,Ye as n,Ze as o,jr as p,Ae as q,qe as r,Wr as s,er as t,Lr as u,Jr as v};
|
package/dist/chunk-T7S2UBNN.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A,B as w,F as y,a as h,ba as c,n as x,o as k,u,y as C}from"./chunk-GTPTZRO6.js";var O=new Set(["ffmpeg","ffprobe","ffplay","sox","soxi","mediainfo","exiftool","mkvmerge","mkvextract","mp4box","bmxtranswrap","raw2rgb","redline","art-cmd","oiiotool","iconvert","idiff","asdcp-wrap","asdcp-unwrap","asdcp-info","opendcp","dcp_inspect","handbrakecli","gst-launch-1.0","mencoder","mplayer","sips","afconvert","avconvert","qtfaststart","mediaconch","bwfmetaedit","x264","x265","aomenc","svtav1encapp","otiotool","otioconvert","otioview","cineform","ale2csv"]),I=["mov","mp4","m4v","mxf","mkv","avi","webm","mts","m2ts","mpg","mpeg","r3d","braw","ari","arx","crm","dng","dpx","exr","wav","aif","aiff","bwf","flac","mp3","aac","m4a","caf"],N=["aaf","avb","edl","drt","otio","fcpxml","fcpxmld","prproj","ptx","ale","xml","csv"],U=new Set(["xml","csv","png","jpg","jpeg","tif","tiff"]),L=new Set([...I,...N,...U]);var m="conformtools-hook",d=o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{},g=o=>!!o&&typeof o=="object"&&typeof o.command=="string"&&o.command.includes(m);function $(o,e,t={}){let n=d(o.hooks),r=Array.isArray(n.PostToolUse)?[...n.PostToolUse]:[],s={type:"command",command:e,timeout:10,...t.async?{async:!0}:{}};for(let i=0;i<r.length;i++){let a=d(r[i]),l=Array.isArray(a.hooks)?a.hooks:[],f=l.findIndex(g);if(f<0)continue;if(JSON.stringify(l[f])===JSON.stringify(s)&&a.matcher==="Bash")return{settings:o,result:"kept"};let b=[...l];return b[f]=s,r[i]={...a,matcher:"Bash",hooks:b},{settings:{...o,hooks:{...n,PostToolUse:r}},result:"updated"}}return{settings:{...o,hooks:{...n,PostToolUse:[...r,{matcher:"Bash",hooks:[s]}]}},result:"installed"}}function S(o){let e=d(o.hooks);if(!Array.isArray(e.PostToolUse))return{settings:o,removed:!1};let t=!1,n=e.PostToolUse.map(i=>{let a=d(i);if(!Array.isArray(a.hooks))return i;let l=a.hooks.filter(f=>!g(f));return l.length!==a.hooks.length&&(t=!0),l.length?{...a,hooks:l}:null}).filter(i=>i!==null);if(!t)return{settings:o,removed:!1};let r={...e};n.length?r.PostToolUse=n:delete r.PostToolUse;let s={...o};return Object.keys(r).length?s.hooks=r:delete s.hooks,{settings:s,removed:!0}}function T(o,e,t){let n=d(o.hooks),r=Array.isArray(n.afterShellExecution)?[...n.afterShellExecution]:[],s={command:e,timeout:10,matcher:t},i=r.findIndex(g);return i>=0&&JSON.stringify(r[i])===JSON.stringify(s)?{settings:o,result:"kept"}:(i>=0?r[i]=s:r.push(s),{settings:{version:1,...o,hooks:{...n,afterShellExecution:r}},result:i>=0?"updated":"installed"})}function P(o){let e=d(o.hooks);if(!Array.isArray(e.afterShellExecution))return{settings:o,removed:!1};let t=e.afterShellExecution.filter(s=>!g(s));if(t.length===e.afterShellExecution.length)return{settings:o,removed:!1};let n={...e};t.length?n.afterShellExecution=t:delete n.afterShellExecution;let r={...o};return Object.keys(n).length?r.hooks=n:delete r.hooks,{settings:r,removed:!0}}function E(){return`\\b(${[...O].map(e=>e.replace(/[.+-]/g,"\\$&")).join("|")})\\b|\\.(${[...L].join("|")})\\b`}function F(o){let e=(o??"").toLowerCase();return e?e.includes("claude-code")||e.includes("claude code")?"claude":e.includes("codex")?"codex":e.includes("cursor")?"cursor":null:null}var J=["claude","codex","cursor"],p=()=>({claude:c(k(),".claude","settings.json"),codex:c(k(),".codex","hooks.json"),cursor:c(k(),".cursor","hooks.json")});async function M(){let o=new URL(import.meta.url),e=h(new URL("./hook.js",o));if(await u(e)){await w(x());let n=c(x(),`${m}.js`);return await y(e,n),`node "${n}"`}let t=h(new URL("../adapters/hook.ts",o));return await u(t)?`deno run --allow-read --allow-write --allow-env --no-check --unstable-sloppy-imports "${t}" ${m}`:null}async function v(o){if(!await u(o))return{};let e=await C(o);try{return e.trim()?JSON.parse(e):{}}catch{return"invalid"}}async function j(o,e){let t;return await u(o)?(t=`${o}.conformtools-backup`,await y(o,t)):await w(c(o,"..")),await A(o,JSON.stringify(e,null,2)+`
|
|
4
|
-
`),t}async function B(o,e={}){let t=e.file??p()[o];try{let n=e.command??await M();if(!n)return{client:o,file:t,result:"skipped",detail:"no hook script beside this build"};let r=await v(t);if(r==="invalid")return{client:o,file:t,result:"failed",detail:`${t} is not valid JSON; nothing was changed`};let s=o==="cursor"?T(r,n,E()):$(r,n,{async:o==="codex"});if(s.result==="kept")return{client:o,file:t,result:"kept"};let i=await j(t,s.settings);return{client:o,file:t,result:s.result,backup:i}}catch(n){return{client:o,file:t,result:"failed",detail:n instanceof Error?n.message:String(n)}}}async function z(o,e={}){let t=e.file??p()[o],n=await v(t);if(n==="invalid")return{client:o,file:t,removed:!1};let r=o==="cursor"?P(n):S(n);if(!r.removed)return{client:o,file:t,removed:!1};let s=await j(t,r.settings);return{client:o,file:t,removed:!0,backup:s}}async function R(){let o=p(),e=[];for(let t of J)await u(c(o[t],".."))&&e.push(t);return e}var Z=async()=>Promise.all((await R()).map(o=>B(o))),G=async()=>Promise.all((await R()).map(o=>z(o)));async function D(o,e=p()[o]){let t=await v(e);return t!=="invalid"&&JSON.stringify(t).includes(m)}var H={claude:"Claude Code",codex:"Codex",cursor:"Cursor"},_="which other programs the agent ran on media or timeline files (program names and file extensions only; never a command, a path, a name, a prompt or an output)";function q(o){return o.length?o.map(e=>{let t=H[e.client],n={installed:`${t}: agent hook installed in ${e.file}${e.backup?` (backup: ${e.backup})`:""}`,updated:`${t}: agent hook refreshed in ${e.file}`,kept:`${t}: agent hook already in ${e.file}`,skipped:`${t}: agent hook not installed (${e.detail})`,failed:`${t}: agent hook not installed: ${e.detail}`}[e.result];return e.client==="codex"&&(e.result==="installed"||e.result==="updated")?`${n}; Codex asks you to trust it once (/hooks)`:n}).concat(`It records ${_}. conformtools hooks off removes it; conformtools telemetry off removes it with the rest.`).join(`
|
|
5
|
-
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine; nothing to install."}function Q(o){let e=o.filter(t=>t.removed);return e.length?e.map(t=>`${H[t.client]}: agent hook removed from ${t.file}`).join(`
|
|
6
|
-
`):"Agent hook: not installed anywhere on this machine."}async function V(){let o=await R();return o.length?[...await Promise.all(o.map(async t=>`${H[t]}: agent hook ${await D(t)?"on":"off"} (${p()[t]})`)),`It records ${_}. conformtools hooks on|off.`].join(`
|
|
7
|
-
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine."}export{F as a,J as b,p as c,M as d,B as e,z as f,R as g,Z as h,G as i,D as j,_ as k,q as l,Q as m,V as n};
|