conformtools 0.6.4 → 0.6.5

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.
Files changed (94) hide show
  1. package/package.json +1 -1
  2. package/dist/arriraw-3GKCR6K2.js +0 -525
  3. package/dist/browser/timeline_core_bg.wasm +0 -0
  4. package/dist/chunk-42QQI3WX.js +0 -3
  5. package/dist/chunk-6FVGUJ6L.js +0 -3
  6. package/dist/chunk-6TM32YIJ.js +0 -7
  7. package/dist/chunk-7D7H6VFW.js +0 -3
  8. package/dist/chunk-AACY2V3L.js +0 -3
  9. package/dist/chunk-BUEIRRNY.js +0 -3
  10. package/dist/chunk-BW2NQ54J.js +0 -3
  11. package/dist/chunk-C2ESM27Z.js +0 -3
  12. package/dist/chunk-CL26XMDO.js +0 -3
  13. package/dist/chunk-DKGGJM6Z.js +0 -3
  14. package/dist/chunk-DRHOPOC7.js +0 -3
  15. package/dist/chunk-EO5NIBOV.js +0 -3
  16. package/dist/chunk-EPZ6NWE4.js +0 -3
  17. package/dist/chunk-GXEVALBL.js +0 -3
  18. package/dist/chunk-HKP4P6JN.js +0 -3
  19. package/dist/chunk-JB7PR2TQ.js +0 -3
  20. package/dist/chunk-P7OVDUA5.js +0 -3
  21. package/dist/chunk-PSANHDZM.js +0 -3
  22. package/dist/chunk-QDWB7QU7.js +0 -3
  23. package/dist/chunk-QTKRMXL5.js +0 -363
  24. package/dist/chunk-QTPCU2TF.js +0 -3
  25. package/dist/chunk-SP5RGDAM.js +0 -3
  26. package/dist/chunk-TEZP6VEQ.js +0 -3
  27. package/dist/chunk-TK55FA56.js +0 -3
  28. package/dist/chunk-UCMNH6Q6.js +0 -3
  29. package/dist/chunk-WHY3DVXS.js +0 -3
  30. package/dist/chunk-WT6NIJCB.js +0 -3
  31. package/dist/chunk-Y2BEEOPB.js +0 -3
  32. package/dist/claude-setup-BM3AAUKR.js +0 -5
  33. package/dist/cli.js +0 -17
  34. package/dist/clip-state-B6JOX3JE.js +0 -3
  35. package/dist/conformtools-decode +0 -0
  36. package/dist/cr3-wasm-WKWMEK3V.js +0 -3
  37. package/dist/dng-wasm-Z5OVO4UI.js +0 -3
  38. package/dist/dpx-wasm-QNYXAOAJ.js +0 -3
  39. package/dist/esm-SFFBP7PS.js +0 -3
  40. package/dist/exr-wasm-BHSBJLQH.js +0 -3
  41. package/dist/h264-LIZVHN2W.js +0 -3
  42. package/dist/h264-mxf-MWS7DDV7.js +0 -3
  43. package/dist/http.js +0 -4
  44. package/dist/i2o-transfer +0 -0
  45. package/dist/inspect-DZF537QL.js +0 -46
  46. package/dist/isobmff-HM3UPWPZ.js +0 -3
  47. package/dist/mcp.js +0 -14
  48. package/dist/media_core-R5PPN3AY.js +0 -9
  49. package/dist/media_core_bg-FGAR5KA5.js +0 -3
  50. package/dist/media_core_bg-YK63OUDM.js +0 -3
  51. package/dist/mxf-K465SWBN.js +0 -3
  52. package/dist/onnxruntime-web-stub-PKJ2NZBF.js +0 -3
  53. package/dist/ops-73NR3X6R.js +0 -3
  54. package/dist/premiere-uxp/icons/panel.png +0 -0
  55. package/dist/premiere-uxp/icons/panel@2x.png +0 -0
  56. package/dist/premiere-uxp/icons/plugin.png +0 -0
  57. package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
  58. package/dist/premiere-uxp/index.html +0 -38
  59. package/dist/premiere-uxp/index.js +0 -93
  60. package/dist/premiere-uxp/lib/clipmeta.js +0 -170
  61. package/dist/premiere-uxp/lib/ctx.js +0 -62
  62. package/dist/premiere-uxp/lib/handles.js +0 -57
  63. package/dist/premiere-uxp/lib/markers.js +0 -198
  64. package/dist/premiere-uxp/lib/pairing.js +0 -58
  65. package/dist/premiere-uxp/lib/premiere.js +0 -82
  66. package/dist/premiere-uxp/lib/probe.js +0 -139
  67. package/dist/premiere-uxp/lib/protocol.js +0 -165
  68. package/dist/premiere-uxp/lib/render.js +0 -38
  69. package/dist/premiere-uxp/lib/session.js +0 -85
  70. package/dist/premiere-uxp/lib/sizing.js +0 -312
  71. package/dist/premiere-uxp/lib/time.js +0 -82
  72. package/dist/premiere-uxp/lib/timeline.js +0 -336
  73. package/dist/premiere-uxp/lib/verbs.js +0 -20
  74. package/dist/premiere-uxp/lib/write.js +0 -97
  75. package/dist/premiere-uxp/manifest.json +0 -102
  76. package/dist/prores-L4JZZWGH.js +0 -526
  77. package/dist/r3d-RR3FUM6H.js +0 -3
  78. package/dist/r3d-VUOYU2KQ.js +0 -1025
  79. package/dist/resolve-bridge.py +0 -1037
  80. package/dist/resolve-presets/conform.tools.xml +0 -127
  81. package/dist/source-BDJAUQVR.js +0 -3
  82. package/dist/sscd-embed-DHFTEIOC.js +0 -3
  83. package/dist/sscd-sweep-OYS4XAID.js +0 -3
  84. package/dist/statusline-GMMCFMOA.js +0 -4
  85. package/dist/statusline.js +0 -3
  86. package/dist/still-4G25EYN5.js +0 -3
  87. package/dist/tiff-wasm-QJPCR7JT.js +0 -3
  88. package/dist/timeline_core-VK2ZWPCO.js +0 -3
  89. package/dist/timeline_core_bg-2TYWZ35G.js +0 -3
  90. package/dist/udf_bg-A4WEMSAX.js +0 -3
  91. package/dist/wasm/media_core_bg.wasm +0 -0
  92. package/dist/wasm/udf_bg.wasm +0 -0
  93. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  94. package/dist/wav-63QF6SCT.js +0 -3
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var s={scrub:{output:"rgba8",detail:"coarse"},thumbnail:{output:"rgba8",detail:"coarse"},park:{output:"rgba8",detail:"exact"},render:{output:"rgba8",detail:"exact"},transcode:{output:"rgb16",detail:"exact"}};function p(e){let t=new DataView(e.buffer,e.byteOffset,8),r=t.getUint32(0,!0),n=t.getUint32(4,!0),o=e.slice(8);return{width:r,height:n,rgb16:new Uint16Array(o.buffer,o.byteOffset,r*n*3)}}var a=class extends Error{constructor(r,n){super(`COVERAGE_MISS: frame ${r} not in linked media (${n} frames)`);this.index=r;this.frameCount=n;this.name="CoverageMissError"}},m=/(?:[A-Z0-9]+_)?COVERAGE_MISS\s+(\{[\s\S]*\})/;function u(e){let r=(e instanceof Error?e.message:String(e??"")).match(m);if(!r)return null;try{return JSON.parse(r[1])}catch{return{reason:"coverage_miss"}}}var i=class extends Error{constructor(r){super(`DELIVERY_COVERAGE_MISS: ${r.reason}`+(r.cut_in!=null?` cut [${r.cut_in}..${r.cut_out}] file_frames ${r.file_frames}`:""));this.detail=r;this.name="DeliveryCoverageMissError"}};function l(e){return e instanceof i?e.detail:u(e)}var d={mov:()=>import("./isobmff-HM3UPWPZ.js").then(e=>e.isobmffFormat),crm:()=>import("./isobmff-HM3UPWPZ.js").then(e=>e.isobmffFormat),braw:()=>import("./isobmff-HM3UPWPZ.js").then(e=>e.isobmffFormat),wav:()=>import("./wav-63QF6SCT.js").then(e=>e.wavFormat),mxf:()=>import("./mxf-K465SWBN.js").then(e=>e.mxfFormat),r3d:()=>import("./r3d-RR3FUM6H.js").then(e=>e.r3dFormat),still:()=>import("./still-4G25EYN5.js").then(e=>e.stillFormat),avc1:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),avc3:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),h264:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),hvc1:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),hev1:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),hevc:()=>import("./h264-LIZVHN2W.js").then(e=>e.h264Format),h264_mxf:()=>import("./h264-mxf-MWS7DDV7.js").then(e=>e.h264MxfFormat)};async function c(e){let t=d[e];return t?await t():null}async function f(e){let t=await c(e.format);if(!t)throw new Error(`extract: no handler for format '${e.format}'`);return t.extract(e)}async function b(e,t){let r=await c(e.format);if(!r){if(t.verb==="inspect")return null;throw new Error(`mediaOp: no handler for format '${e.format}' (verb ${t.verb})`)}switch(t.verb){case"inspect":{let n=await r.inspect(e);return n&&(n.source_facts_origin="probed"),n}case"sparsify":return r.sparsify(e,t.selection);case"trim":return r.trim(e,t.selection);case"decode":{let{output:n,detail:o}=s[t.intent];if(n==="rgb16"){if(!r.decode16)throw new Error(`mediaOp: format '${e.format}' has no 16-bit decoder (intent '${t.intent}')`);return r.decode16(e,t.index)}if(!r.decode)throw new Error(`mediaOp: format '${e.format}' has no decoder (no viewer)`);return r.decode(e,t.index,{detail:o})}}}export{s as a,p as b,a as c,u as d,i as e,l as f,c as g,f as h,b as i};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- function p(e,r,l,m){let u=new DataView(e.buffer,e.byteOffset,e.byteLength),t=r;for(;t+8<=l;){let n=u.getUint32(t),s=String.fromCharCode(e[t+4],e[t+5],e[t+6],e[t+7]),f=8;if(n===1){let g=u.getUint32(t+8),k=u.getUint32(t+12);n=g*2**32+k,f=16}else n===0&&(n=l-t);if(n<f||t+n>l)break;m(s,t+f,t+n),t+=n}}var C=new Set(["moov","trak","mdia","minf","stbl"]);function T(e){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),l=null,m=(t,n)=>{let s={},f=!1,g=(k,d)=>{p(e,k,d,(b,a,S)=>{if(C.has(b)){g(a,S);return}switch(b){case"hdlr":{String.fromCharCode(e[a+8],e[a+9],e[a+10],e[a+11])==="vide"&&(f=!0);break}case"stsd":{let i=a+8;s.codec=String.fromCharCode(e[i+4],e[i+5],e[i+6],e[i+7]),s.width=r.getUint16(i+32),s.height=r.getUint16(i+34);break}case"stsz":{let i=r.getUint32(a+4),c=r.getUint32(a+8),o=[];if(i===0)for(let h=0;h<c;h++)o.push(r.getUint32(a+12+h*4));else for(let h=0;h<c;h++)o.push(i);s.sampleSizes=o;break}case"stco":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++)c.push(r.getUint32(a+8+o*4));s.chunkOffsets=c;break}case"co64":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++){let h=r.getUint32(a+8+o*8),U=r.getUint32(a+12+o*8);c.push(h*2**32+U)}s.chunkOffsets=c;break}case"stsc":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++)c.push({firstChunk:r.getUint32(a+8+o*12),samplesPerChunk:r.getUint32(a+8+o*12+4),descIdx:r.getUint32(a+8+o*12+8)});s.sampleToChunk=c;break}}})};g(t,n),f&&s.chunkOffsets&&s.sampleSizes&&s.sampleToChunk&&(l=s)};if(((t,n)=>{p(e,t,n,(s,f,g)=>{s==="moov"&&p(e,f,g,(k,d,b)=>{k==="trak"&&m(d,b)})})})(0,e.length),!l)throw new Error("could not find a video sample table");return l}function w(e){let r=[],l=0;for(let m=0;m<e.chunkOffsets.length;m++){let u=1;for(let n=0;n<e.sampleToChunk.length;n++)m+1>=e.sampleToChunk[n].firstChunk&&(u=e.sampleToChunk[n].samplesPerChunk);let t=e.chunkOffsets[m];for(let n=0;n<u&&l<e.sampleSizes.length;n++){let s=e.sampleSizes[l];r.push({offset:t,size:s}),t+=s,l++}}return r}export{T as a,w as b};
@@ -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{readFile as y,writeFile as P,appendFile as k,stat as f,readdir as U,mkdir as D,open as h,copyFile as O,mkdtemp as T,rm as R,chmod as $,rename as A,cp as M,statfs as S}from"node:fs/promises";import{execFile as W,spawn as F}from"node:child_process";import{createHash as E}from"node:crypto";import{createReadStream as B}from"node:fs";import{homedir as H,tmpdir as N,platform as C,release as z,arch as L,totalmem as I,availableParallelism as _}from"node:os";import{fileURLToPath as b}from"node:url";import j from"node:http";import m from"node:process";import{Buffer as x}from"node:buffer";import{join as w,resolve as v,sep as G}from"node:path";import{basename as Le,dirname as Ie,extname as _e,join as je,relative as Ge,resolve as Je}from"node:path";{let e=globalThis.fetch,t=typeof globalThis.Deno<"u";e&&!t&&(globalThis.fetch=(async(n,o)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url;if(r.startsWith("file:")){let i=await y(b(r)),s=r.endsWith(".wasm")?"application/wasm":"application/octet-stream";return new Response(i,{status:200,headers:{"content-type":s}})}return e(n,o)}))}var p=e=>m.env[e],ne=()=>Number(p("CONFORM_MEMORY_GB")??0)*2**30||I(),oe=()=>_(),se=()=>m.argv.slice(2),ie=e=>m.exit(e),ae=()=>m.platform,ce=()=>m.arch;function le(){let e=m.versions.deno;return{platform:`${C()} ${z()} ${L()}`,runtime:e?`deno ${e}`:`node ${m.version}`}}var me=()=>p("CONFORM_MCP_HOME")??w(g(),".conform-mcp"),g=()=>p("HOME")??H();function ue(e){let t=e.trim();if(t.length>=2&&(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1,-1)),/^file:\/\//i.test(t))try{t=b(t)}catch{}return t==="~"?t=g():(t.startsWith("~/")||t.startsWith("~\\"))&&(t=w(g(),t.slice(2))),t&&v(t)+(/[\\/]$/.test(t)&&!/[\\/]$/.test(v(t))?G:"")}var de=e=>b(e);async function fe(e){let t=await f(e);return{isFile:t.isFile(),isDirectory:t.isDirectory(),size:t.size,mtimeMs:t.mtimeMs}}async function pe(e){try{return await f(e),!0}catch{return!1}}async function ge(e){try{return(await f(e)).isFile()}catch{return!1}}async function ye(e){try{return(await f(e)).isDirectory()}catch{return!1}}async function he(e){let t=await y(e);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var be=e=>y(e,"utf8"),we=(e,t)=>P(e,t),xe=(e,t,n)=>n?.append?k(e,t):P(e,t);async function ve(e){await D(e,{recursive:!0})}var Pe=e=>R(e,{force:!0}),Re=(e,t)=>$(e,t).catch(()=>{}),Ae=(e,t)=>O(e,t),Fe=(e,t)=>A(e,t),ke=e=>R(e,{recursive:!0,force:!0}),Ue=(e,t)=>M(e,t,{recursive:!0,verbatimSymlinks:!0});async function De(e){try{let t=await S(e);return Number(t.bavail)*Number(t.bsize)}catch{return null}}var Oe=(e="conform-")=>T(w(N(),e));async function*Te(e){for(let t of await U(e,{withFileTypes:!0}))yield{name:t.name,isFile:t.isFile(),isDirectory:t.isDirectory()}}async function $e(e){let t=await h(e,"r"),n=(await t.stat()).size;return{path:e,size:n,async readAt(o,r){let i=new Uint8Array(r),s=0;for(;s<r;){let{bytesRead:c}=await t.read(i,s,r-s,o+s);if(!c)break;s+=c}return s===r?i:i.subarray(0,s)},close:()=>t.close()}}async function Me(e){let t=await h(e,"w");return{async writeAt(n,o){let r=0;for(;r<o.length;){let{bytesWritten:i}=await t.write(o,r,o.length-r,n+r);r+=i}},truncate:n=>t.truncate(n),close:()=>t.close()}}function J(e,t,n={}){return new Promise(o=>{W(e,t,{maxBuffer:1<<30,env:n.env?{...m.env,...n.env}:void 0,timeout:n.timeoutMs},(r,i,s)=>{let c=r?.code??0;o({success:!r,code:c,stdout:String(i),stderr:String(s)})})})}function Se(e,t,n,o={}){return new Promise((r,i)=>{let s=F(e,t,{env:o.env?{...m.env,...o.env}:void 0,stdio:["ignore","pipe","pipe"]}),c="";s.stdout.on("data",a=>n(a)),s.stderr.on("data",a=>{c+=new TextDecoder().decode(a)}),s.on("error",i),s.on("close",a=>r({code:a,stderr:c})),o.signal?.addEventListener("abort",()=>s.kill(),{once:!0})})}function We(e,t,n,o){let r=F(e,t,{stdio:["pipe","pipe","pipe"]});r.stdout.on("data",a=>n(a)),r.stderr.on("data",a=>o?.(new TextDecoder().decode(a)));let i=new Promise(a=>{r.on("close",l=>a(l)),r.on("error",()=>a(null))}),s=[r,r.stdout,r.stderr,r.stdin],c=a=>{for(let l of s)(a?l.ref:l.unref)?.call(l)};return c(!1),{write:a=>new Promise((l,u)=>{r.stdin.write(a,d=>d?u(d):l())}),hold:c,close:()=>{try{r.stdin.end(),r.kill()}catch{}},exited:i}}async function Ee(e){if(p("CONFORM_NO_BROWSER"))return!1;let[t,n]=m.platform==="darwin"?["open",[e]]:m.platform==="win32"?["cmd",["/c","start","",e.replace(/&/g,"^&")]]:["xdg-open",[e]];return(await J(t,n)).success}function Be(e,t){let n=j.createServer(async(o,r)=>{try{let i=[];if(o.method!=="GET"&&o.method!=="HEAD")for await(let u of o)i.push(u);let s=i.length>0,c=new Headers;for(let[u,d]of Object.entries(o.headers))d!=null&&c.set(u,Array.isArray(d)?d.join(", "):d);let a=`http://${o.headers.host??`${e.hostname}:${e.port}`}${o.url??"/"}`,l=await t(new Request(a,{method:o.method,headers:c,body:s?x.concat(i):void 0}));r.statusCode=l.status,l.headers.forEach((u,d)=>r.setHeader(d,u)),r.end(x.from(await l.arrayBuffer()))}catch(i){r.statusCode=500,r.end(JSON.stringify({ok:!1,code:"internal",message:i instanceof Error?i.message:String(i)}))}});return n.listen(e.port,e.hostname,()=>{let o=n.address();e.onListen?.(typeof o=="object"&&o?o.port:e.port)}),{close:()=>n.close()}}async function He(e){let t=E("sha256");for await(let n of B(e))t.update(n);return t.digest("hex")}async function Ne(e,t,n){let o=`${t}.part`;for(let r=0;;r++){let i=0;try{i=(await f(o)).size}catch{}try{let s=await fetch(e,{headers:i?{Range:`bytes=${i}-`}:{}});if(s.status===416)break;if(!s.ok||!s.body)throw new Error(`${e} answered ${s.status}`);i&&s.status!==206&&(i=0);let c=i+Number(s.headers.get("content-length")??0),a=await h(o,i?"a":"w");try{let l=i;for await(let u of s.body)await a.write(u),l+=u.length,n?.(l,c)}finally{await a.close()}break}catch(s){if(r>=4)throw s;await new Promise(c=>setTimeout(c,2e3*(r+1)))}}await A(o,t)}export{b as a,p as b,ne as c,oe as d,se as e,ie as f,ae as g,ce as h,le as i,me as j,g as k,ue as l,de as m,fe as n,pe as o,ge as p,ye as q,he as r,be as s,we as t,xe as u,ve as v,Pe as w,Re as x,Ae as y,Fe as z,ke as A,Ue as B,De as C,Oe as D,Te as E,$e as F,Me as G,J as H,Se as I,We as J,Ee as K,Be as L,He as M,Ne as N,Le as O,Ie as P,_e as Q,je as R,Ge as S,Je as T};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- async function s(r){let o=0,i=r.fileSize;for(;o+8<=i;){let e=await r.read(o,Math.min(16,i-o)),n=new DataView(e.buffer,e.byteOffset,e.byteLength),t=n.getUint32(0),a=8;if(t===1?(t=Number(n.getBigUint64(8)),a=16):t===0&&(t=i-o),String.fromCharCode(e[4],e[5],e[6],e[7])==="moov")return r.read(o,t);if(t<a)break;o+=t}throw new Error("moov atom not found (not a QuickTime/ProRes .mov?)")}export{s as a};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var r={png:"native",jpg:"native",jpeg:"native",gif:"native",webp:"native",avif:"native",bmp:"native",dpx:"wasm-decoder",tif:"wasm-decoder",tiff:"wasm-decoder",exr:"wasm-decoder",dng:"wasm-decoder",cr3:"wasm-decoder",psd:"none",tga:"none",heic:"none",heif:"none",pict:"none",pct:"none"};function l(e){let t=(e??"").toLowerCase();return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null}var i=[{exts:["mov","mp4","m4v"],family:"isobmff",flavor:"mov",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["crm"],family:"isobmff",flavor:"crm",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["braw"],family:"isobmff",flavor:"braw",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["mxf"],family:"mxf",flavor:"mxf",trimSupported:!0,inspectSupported:!0,protection:"proprietary"},{exts:["wav","wave","bwf"],family:"riff",flavor:"wav",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["r3d"],family:"r3d",flavor:"r3d",trimSupported:!0,inspectSupported:!0,protection:"proprietary"},{exts:Object.keys(r),family:"still",flavor:"still",trimSupported:!1,inspectSupported:!0,protection:"public"}];function n(e){return(e.split(".").pop()??"").toLowerCase()}function p(e){let t=n(e);return t?i.find(o=>o.exts.includes(t))??null:null}function s(e){let t=p(e);return!!t&&t.trimSupported}export{l as a,p as b,s as c};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var e=new URL("./wasm/media_core_bg.wasm",import.meta.url).href;export{e as a};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a as m,b as l}from"./chunk-DKGGJM6Z.js";import{Aa as u,Ca as n,V as c,p as s}from"./chunk-CL26XMDO.js";async function g(r){await n();let e=c(r);return e==="null"?null:JSON.parse(e)}async function d(r){await n();let e;try{e=s(r)}catch{return null}if(e.length<8)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getUint32(0,!0),i=t.getUint32(4,!0),o=a*i*4;return e.length<8+o?null:{width:a,height:i,rgba:new Uint8ClampedArray(e.subarray(8,8+o))}}async function y(r,e=8){await n();let t=l(u,"decode_exr_preview");if(!t)return d(r);try{return m(t(r,e))}catch{return null}}export{g as a,d as b,y as c};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var s=288,u=8;function A(r,o=288){let t=o*o,l=new Float32Array(r.length*3*t);for(let n=0;n<r.length;n++){let a=r[n],c=n*3*t;for(let e=0;e<t;e++)l[c+e]=a[e*4]/255,l[c+t+e]=a[e*4+1]/255,l[c+2*t+e]=a[e*4+2]/255}return l}function i(r,o){let t=0,l=Math.min(r.length,o.length);for(let n=0;n<l;n++)t+=r[n]*o[n];return t}function p(r){let o=0;for(let t=0;t<r.length;t++)o+=r[t]*r[t];return Math.sqrt(o)}export{s as a,u as b,A as c,i as d,p as e};
@@ -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{H as h,R as c,a as m,j as w,k as $,o as i,s as b,u as v,v as R,y as k}from"./chunk-TEZP6VEQ.js";import"./chunk-PSANHDZM.js";var y="conformtools-statusline";function x(e,n){let s=e.statusLine;return s&&!String(s.command??"").includes(y)?{settings:e,result:"kept"}:s?.command===n?{settings:e,result:"updated"}:{settings:{...e,statusLine:{type:"command",command:n,padding:0}},result:s?"updated":"installed"}}async function P(){let e=new URL(import.meta.url),n=m(new URL("./statusline.js",e));if(await i(n)){await R(w());let t=c(w(),`${y}.js`);return await k(n,t),`node "${t}"`}let s=m(new URL("../adapters/statusline.ts",e));return await i(s)?`deno run --allow-read --allow-env --no-check "${s}" ${y}`:null}function L(e,n){let s=e.permissions&&typeof e.permissions=="object"?e.permissions:{},t=Array.isArray(s.allow)?s.allow.filter(o=>typeof o=="string"):[];return t.includes(n)?{settings:e,added:!1}:{settings:{...e,permissions:{...s,allow:[...t,n]}},added:!0}}async function U(e={}){let n=e.server??"conformtools",s=`mcp__${n}`,t=e.settingsPath??c($(),".claude","settings.json"),o={};if(await i(t)){let a=await b(t);try{o=a.trim()?JSON.parse(a):{}}catch(r){throw new Error(`${t} is not valid JSON (${r instanceof Error?r.message:r}); fix it first, nothing was changed`)}}let p=L(o,s),d=p.settings,l="skipped",C=p.added,S=e.statusline===!1?null:await P();if(S){let a=x(d,S);d=a.settings,l=a.result}let f;(C||l==="installed"||l==="updated"&&d!==p.settings)&&(await i(t)?(f=`${t}.conformtools-backup`,await k(t,f)):await Deno.mkdir(c(t,".."),{recursive:!0}),await v(t,JSON.stringify(d,null,2)+`
4
- `));let u="skipped",g;if(e.register!==!1)try{if((await h("claude",["mcp","get",n])).code===0)u="already";else{let r=await h("claude",["mcp","add","-s","user",n,"--","npx","-y","conformtools@latest","mcp"]);u=r.code===0?"added":"failed",r.code!==0&&(g=r.stderr.trim().slice(-300))}}catch(a){u="failed",g=`claude CLI not found (${a instanceof Error?a.message:a}); add the server with: claude mcp add -s user ${n} -- npx -y conformtools@latest mcp`}return{settings:t,rule:s,added:C,backup:f,registered:u,detail:g,statusline:l}}function M(e){return[e.added?`Claude Code: allowed every conform.tools tool (${e.rule}) in ${e.settings}${e.backup?` (backup: ${e.backup})`:""}`:`Claude Code: ${e.rule} was already allowed in ${e.settings}`,{already:"MCP server: already registered",added:"MCP server: registered (claude mcp add -s user)",skipped:"MCP server: not checked",failed:`MCP server: not registered: ${e.detail??"claude mcp add failed"}`}[e.registered],{installed:"Status line: conform.tools (the running job and its progress) at the bottom of Claude Code",updated:"Status line: conform.tools, refreshed",kept:"Status line: you already have one, so it was left as it is (conformtools statusline prints ours)",skipped:"Status line: not installed"}[e.statusline],"Restart Claude Code (or /mcp) to load it. Remove the rule from permissions.allow to be asked again."].join(`
5
- `)}export{U as setupClaude,M as setupText,L as withAllowRule,x as withStatusLine};
package/dist/cli.js DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{$ as L,P as W,ba as J,c as A,ca as H,d as D,ea as F,f as I,fa as G}from"./chunk-QTKRMXL5.js";import{b as S,e as c,f as s}from"./chunk-TEZP6VEQ.js";import"./chunk-DRHOPOC7.js";import"./chunk-GXEVALBL.js";import"./chunk-Y2BEEOPB.js";import"./chunk-JB7PR2TQ.js";import"./chunk-C2ESM27Z.js";import"./chunk-HKP4P6JN.js";import"./chunk-EPZ6NWE4.js";import"./chunk-42QQI3WX.js";import"./chunk-6FVGUJ6L.js";import"./chunk-QDWB7QU7.js";import"./chunk-P7OVDUA5.js";import"./chunk-UCMNH6Q6.js";import"./chunk-BW2NQ54J.js";import"./chunk-WT6NIJCB.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WHY3DVXS.js";import"./chunk-BUEIRRNY.js";import"./chunk-TK55FA56.js";import"./chunk-EO5NIBOV.js";import"./chunk-QTPCU2TF.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";var i=process.stdout,M=22,j=20,R=j/2,V=(t,n)=>Math.abs(n)<=Math.min(1-.417*Math.abs(t),2.393*(1-Math.abs(t))),ot=(t,n)=>t*t+n*n<=1;function nt(t){let n=.62**-t,l=[];for(let r=0;r<j;r++){let p=[];for(let g=0;g<M;g++){let w=(g+.5)/M*2-1,u=(r+.5)/j*2-1,d=!1;if(V(w,u))for(let $=0;$<6;$++)for(let y of[!1,!0]){let m=.62**$*(y?.77:1)*n,x=.5*Math.max(0,1-m)**2;(y?ot:V)(w/m,(u-x)/m)&&(d=!y)}p.push(d)}l.push(p)}return l}var C={C:["\u25E2\u2588\u25E3","\u2588 ","\u2588 ","\u25E5\u2588\u25E4"],O:["\u25E2\u2588\u25E3","\u2588 \u2588","\u2588 \u2588","\u25E5\u2588\u25E4"],N:["\u2588\u25E3 \u2588","\u2588\u2588\u25E3\u2588","\u2588\u25E5\u2588\u2588","\u2588 \u25E5\u2588"],F:["\u2588\u2588\u2588","\u2588\u2584\u2584","\u2588 ","\u2588 "],R:["\u2588\u2588\u25E3","\u2588 \u2588","\u2588\u2588\u25E4","\u2588 \u2588"],M:["\u2588\u25E3\u25E2\u2588","\u2588\u25E5\u25E4\u2588","\u2588 \u2588","\u2588 \u2588"],T:["\u2588\u2588\u2588"," \u2588 "," \u2588 "," \u2588 "],L:["\u2588 ","\u2588 ","\u2588 ","\u2588\u2588\u2588"],S:["\u25E2\u2588\u25E3","\u25E5\u25E3 "," \u25E5\u25E3","\u25E5\u2588\u25E4"],".":[" "," "," ","\u25CF"]},Y="CONFORM.TOOLS",et=[...Y].reduce((t,n)=>t+C[n][0].length+1,-1);async function B(t){if(!i.isTTY)return!1;let n=!!S("NO_COLOR"),l=/truecolor|24bit/i.test(S("COLORTERM")??""),r=o=>e=>n?e:`\x1B[${o}m${e}\x1B[0m`,p=r(l?"38;2;255;60;0":"38;5;202"),g=r(l?"38;2;255;222;0":"38;5;220"),w=r("1"),u=r("2"),d=(i.columns??80)>=M+4+et,$=o=>[...Y].map(e=>e==="."?p(C[e][o]):w(C[e][o])).join(" "),y=(o,e)=>d&&o>=2&&o<=5?$(o-2):!d&&o===3?`${w("conform")}${p(".")}${w("tools")}`:o===7?e:"",m=(o,e,O=[])=>{let v=nt(o),_=[];for(let f=0;f<R;f++){let X=v[2*f].map((N,tt)=>{let k=v[2*f+1][tt];return N&&k?"\u2588":N?"\u2580":k?"\u2584":" "}).join(""),Z=f>=8?O[f-8]??"":"";_.push(` ${p(X)} ${Z||y(f,e)}\x1B[K`)}return _.join(`
4
- `)+`
5
- `},x=null;t.account.then(o=>{x=o});let P=o=>[o/86400,o/1440%60,o/24%60,o%24].map(e=>String(Math.floor(e)).padStart(2,"0")).join(":"),Q=!S("CI")&&S("TERM")!=="dumb";if(i.write(`
6
- `),Q){let o=()=>i.write("\x1B[?25h");process.once("SIGINT",()=>{o(),process.exit(130)}),i.write("\x1B[?25l"+m(0,g(`\u25B6 ${P(0)}`)));let e=Date.now(),O=0;for(;x===null||Date.now()-e<900;)await new Promise(v=>setTimeout(v,1e3/24)),O=Math.round((Date.now()-e)*24/1e3),i.write(`\x1B[${R}A\r`+m(O/22%1,`${g(`\u25B6 ${P(O)}`)} ${u("checking your account\u2026")}`));i.write(`\x1B[${R}A\r`),o()}let U=(x??await t.account).split(`
7
- `);return i.write(m(0,`${u("v")}${t.version} ${u("\xB7 built by post pros")}`,U.map(o=>u(o)))),i.write(`
8
- `),!0}var q=()=>B({version:I,account:Promise.race([A().catch(()=>null),new Promise(t=>setTimeout(t,1500,null))]).then(t=>t?D(t):"account: no answer (offline?)")}),rt={login:"account_login",logout:"account_logout",whoami:"account_status",status:"account_status",telemetry:"account_telemetry"};c()[0]==="mcp"&&(await import("./mcp.js"),await new Promise(()=>{}));c()[0]==="http"&&(await import("./http.js"),await new Promise(()=>{}));c()[0]==="statusline"&&((await import("./statusline-GMMCFMOA.js")).main(),s(0));if(c()[0]==="setup"){let t=c()[1];t!=="claude"&&(console.error(`conformtools setup <client>: supported: claude${t?` (not ${t} yet)`:""}`),s(2));let{setupClaude:n,setupText:l}=await import("./claude-setup-BM3AAUKR.js");try{console.log(l(await n())),s(0)}catch(r){console.error(r instanceof Error?r.message:String(r)),s(1)}}var K=c().includes("--json"),[a,T]=c().filter(t=>t!=="--json");if(!a||a==="--list"||a==="help"||a==="--help"){await q(),console.log(`conformtools <verb> '<json args>' [--json]
9
-
10
- login / whoami / logout sign in with your conform.tools Google account
11
- telemetry on|off|status optional outcome telemetry (off by default; see the README, Feedback and privacy)
12
- mcp run as an MCP server (stdio) for Claude Code, Cursor, Codex\u2026
13
- http run the local HTTP API on 127.0.0.1:7791
14
- `);let t=W()==="hosted";for(let n of F)console.log(` ${n.name.padEnd(22)} ${n.title}${t&&n.protectedStages?.length?" (on conform.tools)":""}`);t&&console.log(`
15
- (on conform.tools) = the timeline is read or written by conform.tools; the file and its media stay here`),s(0)}var h=rt[a]??a,st=G(h);st||(console.error(`unknown verb '${a}' \u2014 conformtools --list`),s(2));h==="account_login"&&console.error("opening the browser to sign in to conform.tools\u2026");var it=h==="account_telemetry"&&T&&!T.trim().startsWith("{")?JSON.stringify({action:T.trim()}):T,z;try{z=JSON.parse(it??"{}")}catch{console.error(`arguments must be JSON, e.g. conformtools ${a} '{"path":"\u2026"}'`),s(2)}var E=H(h,z),b=E.ok?await J(h,E.data):E.result;h==="account_login"&&!b.isError&&!K&&await q()||console.log(K?JSON.stringify(b.structuredContent??{ok:!b.isError,text:b.content.map(t=>t.text).join(`
16
- `)},null,1):b.content.map(t=>t.text).join(`
17
- `));await L();s(b.isError?1:0);
@@ -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"./chunk-PSANHDZM.js";function h(r){let e=new Uint32Array(1);return e[0]=r>>>0,new Float32Array(e.buffer)[0]}function U(r,e){if(r.length<12)return null;let a=new DataView(r.buffer,r.byteOffset,r.byteLength);if(a.getUint32(0,!1)!==1095911248||a.getUint32(4,!0)!==1)return null;let u=8,y=t=>{if(t<0||u+t>r.length)return null;let o=r.subarray(u,u+t);return u+=t,o},l=()=>{if(u+4>r.length)return null;let t=a.getUint32(u,!0);return u+=4,t},i=l();if(i===null)return null;let g=y(i);if(!g)return null;let n;try{n=JSON.parse(new TextDecoder().decode(g))}catch{return null}let w=l();if(w===null)return null;let c=y(w);if(!c)return null;let A=l();if(A===null)return null;if(A===0)return!e||e.key!==n.key||n.has_state?null:{key:n.key,essence:c,state:e.state};if(A!==6)return null;let s=[];for(let t=0;t<6;t++){let o=l();if(o===null||u+o>r.length)return null;s.push(r.slice(u,u+o)),u+=o}let f=t=>new Float32Array(t.buffer,t.byteOffset,t.byteLength>>>2),m=t=>new Uint16Array(t.buffer,t.byteOffset,t.byteLength>>>1);if(!Array.isArray(n.gains_8_24)||n.gains_8_24.length!==4||!Array.isArray(n.cp_bits)||n.cp_bits.length!==4)return null;let _={width:n.w,height:n.h,gains8_24:Uint32Array.from(n.gains_8_24),prepDecompand:f(s[0]),prepRecompand:m(s[1]),rptab:f(s[2]),gridA:f(s[3]),gridB:f(s[4]),finalLut:f(s[5]),cp:Float32Array.from(n.cp_bits,h),k2:h(n.k2_bits)};return{key:n.key,essence:c,state:_}}function p(r){let e=Math.round(r*65535);return e>0?e>65535?65535:e:0}function b(r){let e=r.width*r.height,a=new Uint16Array(e*3),{r:u,g:y,b:l}=r;for(let i=0;i<e;i++)a[3*i]=p(u[i]),a[3*i+1]=p(y[i]),a[3*i+2]=p(l[i]);return a}export{b as arrirawFrameToRgb16,U as parseArrirawGpuPayload,p as quantizeLogC4};
Binary file
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a,b}from"./chunk-EPZ6NWE4.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";export{b as decodeCr3Wasm,a as inspectCr3Wasm};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a,b,c}from"./chunk-HKP4P6JN.js";import"./chunk-DKGGJM6Z.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";export{c as decodeDngPreviewWasm,b as decodeDngWasm,a as inspectDngWasm};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a,b,c}from"./chunk-BW2NQ54J.js";import"./chunk-DKGGJM6Z.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";export{c as decodeDpxPreviewWasm,b as decodeDpxWasm,a as inspectDpxWasm};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{k as AsyncCompress,A as AsyncDecompress,c as AsyncDeflate,o as AsyncGunzip,k as AsyncGzip,g as AsyncInflate,P as AsyncUnzipInflate,w as AsyncUnzlib,J as AsyncZipDeflate,s as AsyncZlib,j as Compress,D as DecodeUTF8,z as Decompress,b as Deflate,E as EncodeUTF8,a as FlateErrorCode,n as Gunzip,j as Gzip,f as Inflate,Q as Unzip,O as UnzipInflate,N as UnzipPassThrough,v as Unzlib,K as Zip,I as ZipDeflate,H as ZipPassThrough,r as Zlib,l as compress,m as compressSync,B as decompress,C as decompressSync,d as deflate,e as deflateSync,p as gunzip,q as gunzipSync,l as gzip,m as gzipSync,h as inflate,i as inflateSync,G as strFromU8,F as strToU8,R as unzip,S as unzipSync,x as unzlib,y as unzlibSync,L as zip,M as zipSync,t as zlib,u as zlibSync};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a,b,c}from"./chunk-WT6NIJCB.js";import"./chunk-DKGGJM6Z.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";export{c as decodeExrPreviewWasm,b as decodeExrWasm,a as inspectExrWasm};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a as M}from"./chunk-QDWB7QU7.js";import{a as v,b as S}from"./chunk-SP5RGDAM.js";import{a as F}from"./chunk-TK55FA56.js";import"./chunk-PSANHDZM.js";var V=8,H=1500,P=new WeakMap;async function C(t){let o=P.get(t);return o||(o=k(t),P.set(t,o)),o}async function k(t){if(typeof VideoDecoder>"u")throw new Error("h264: WebCodecs (VideoDecoder) not available in this context");let o=t.parts[0],e=await F({fileSize:o.fileSize,read:o.read}),a=S(v(e)),r=M(e);if(!r)throw new Error("h264: no H.264/HEVC config in container");let s=r.decodeToPres.length||a.length,f=new Int32Array(s);for(let n=0;n<r.decodeToPres.length;n++)f[r.decodeToPres[n]]=n;let u=[];for(let n=0;n<r.keyframes.length;n++){let l=r.keyframes[n],m=n+1<r.keyframes.length?r.keyframes[n+1]:a.length;u.push([l,m])}let c={offs:a,cfg:r,gops:u,presToDecode:f,count:s,dec:null,wanted:-1,got:null,gotResolve:null,fedThrough:-1,queue:Promise.resolve()};return c.dec=new VideoDecoder({output:n=>{Number(n.timestamp)===c.wanted&&!c.got?(c.got=n,c.gotResolve?.()):n.close()},error:()=>{c.fedThrough=-1}}),c.dec.configure({codec:r.codec,description:r.description,optimizeForLatency:!0,hardwareAcceleration:"prefer-hardware"}),c}function R(t,o){let e=0,a=t.length-1,r=0;for(;e<=a;){let s=e+a>>1;t[s][0]<=o?(r=s,e=s+1):a=s-1}return r}async function I(t){let o=t.codedWidth,e=t.codedHeight;try{let a=o*e*4,r=new Uint8Array(a);return await t.copyTo(r,{format:"RGBA",colorSpace:"srgb"}),{width:o,height:e,rgba:r}}catch{let r=new OffscreenCanvas(o,e).getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("h264: no 2d context for frame readback");r.drawImage(t,0,0);let s=r.getImageData(0,0,o,e);return{width:o,height:e,rgba:new Uint8Array(s.data.buffer)}}}async function O(t,o){let e=await C(t);if(e.count===0)throw new Error("h264: empty clip");if(o<0||o>=e.count)throw new Error(`COVERAGE_MISS: frame ${o} outside 0..${e.count-1}`);let a,r=new Promise(f=>{a=f}),s=e.queue;e.queue=e.queue.then(()=>r),await s;try{let f=t.parts[0],u=e.presToDecode[o],c=R(e.gops,u),[n,l]=e.gops[c];for(let m=0;m<2;m++){let T=m===0&&e.fedThrough>n&&e.fedThrough<=l&&u>=e.fedThrough,w=T?e.fedThrough:n;if(!T&&e.fedThrough!==-1){try{await e.dec.flush()}catch{}e.fedThrough=-1}let h=Math.min(l,u+1+V);e.wanted=o,e.got=null;let D=new Promise(d=>{e.gotResolve=d});if(h>w){let d=1/0,y=0;for(let i=w;i<h;i++)d=Math.min(d,e.offs[i].offset),y=Math.max(y,e.offs[i].offset+e.offs[i].size);let E=await f.read(d,y-d);for(let i=w;i<h;i++){let b=e.offs[i];e.dec.decode(new EncodedVideoChunk({type:i===n?"key":"delta",timestamp:e.cfg.decodeToPres[i],data:E.subarray(b.offset-d,b.offset-d+b.size)}))}e.fedThrough=h}let A=new Promise(d=>setTimeout(d,H));if(await Promise.race([D,A]),!e.got){try{await e.dec.flush()}catch{}e.fedThrough=-1}let p=e.got;if(e.wanted=-1,e.gotResolve=null,e.got=null,!!p)try{return await I(p)}finally{p.close()}}throw new Error(`h264: frame ${o} did not decode`)}finally{a()}}async function g(){return(await import("./isobmff-HM3UPWPZ.js")).isobmffFormat}var U={async inspect(t){return(await g()).inspect(t)},async extract(t){return(await g()).extract(t)},async sparsify(t,o){return(await g()).sparsify(t,o)},async trim(t,o){return(await g()).trim(t,o)},async decode(t,o){return O(t,o)}};export{U as h264Format};
@@ -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{Ca as v,ha as g,ja as b}from"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";var G=8,P=1500,M=new WeakMap,S=o=>(t,e)=>o.read(t,e);function F(o){let t=new DataView(o.buffer,o.byteOffset,o.byteLength),e=t.getUint32(0,!0),n=[];for(let a=0;a<e;a++)n.push(t.getUint32(4+a*4,!0));let i=[],r=4+e*4;for(let a of n)i.push(o.subarray(r,r+a)),r+=a;return i}function V(o){for(let t=0;t+5<o.length;t++){let e=o[t]===0&&o[t+1]===0&&o[t+2]===0&&o[t+3]===1,n=o[t]===0&&o[t+1]===0&&o[t+2]===1;if(e||n){let i=t+(e?4:3);if((o[i]&31)===7){let r=a=>a.toString(16).padStart(2,"0");return`avc1.${r(o[i+1])}${r(o[i+2])}${r(o[i+3])}`}t=i-1}}return"avc1.640028"}async function A(o){if(typeof VideoDecoder>"u")throw new Error("h264-mxf: WebCodecs (VideoDecoder) not available in this context");await v();let t=o.parts[0],e=S(t),n=JSON.parse(await b(e,t.fileSize));if(!n.raps.length)throw new Error("h264-mxf: no random-access points in MXF index");let i=V(F(await g(e,t.fileSize,0,0))[0]),r={map:n,codec:i,dec:null,wanted:-1,emitted:0,got:null,gotResolve:null,fedGop:-1,fedThrough:-1,queue:Promise.resolve()};return r.dec=new VideoDecoder({output:a=>{r.emitted++===r.wanted&&!r.got?(r.got=a,r.gotResolve?.()):a.close()},error:()=>{r.fedGop=-1,r.fedThrough=-1}}),r.dec.configure({codec:i,codedWidth:n.coded_width||1920,codedHeight:n.coded_height||1088,optimizeForLatency:!0}),r}async function E(o){let t=M.get(o);return t||(t=A(o),M.set(o,t)),t}function D(o,t){let e=o.raps,n=0,i=e.length-1,r=0;for(;n<=i;){let a=n+i>>1;e[a]<=t?(r=a,n=a+1):i=a-1}return{start:e[r],end:r+1<e.length?e[r+1]:o.total_frames}}async function R(o){let t=o.visibleRect,e=t?t.width:o.codedWidth,n=t?t.height:o.codedHeight;try{let i=new Uint8Array(e*n*4);return await o.copyTo(i,{format:"RGBA",colorSpace:"srgb",rect:t??void 0}),{width:e,height:n,rgba:i}}catch{let r=new OffscreenCanvas(e,n).getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("h264-mxf: no 2d context for frame readback");r.drawImage(o,t?t.x:0,t?t.y:0,e,n,0,0,e,n);let a=r.getImageData(0,0,e,n);return{width:e,height:n,rgba:new Uint8Array(a.data.buffer)}}}async function U(o,t){let e=await E(o);if(e.map.total_frames===0)throw new Error("h264-mxf: empty clip");if(t<0||t>=e.map.total_frames)throw new Error(`COVERAGE_MISS: frame ${t} outside 0..${e.map.total_frames-1}`);let n,i=new Promise(a=>{n=a}),r=e.queue;e.queue=e.queue.then(()=>i),await r;try{let a=o.parts[0],w=S(a),{start:c,end:_}=D(e.map,t);for(let u=0;u<2;u++){let f=u===0&&e.fedGop===c&&e.fedThrough>c&&t>=e.fedThrough;if(!f&&e.fedGop!==-1){try{await e.dec.flush()}catch{}e.fedGop=-1,e.fedThrough=-1}let l=f?e.fedThrough:c,h=Math.min(_,t+1+G);f||(e.emitted=0),e.wanted=t-c,e.got=null;let T=new Promise(s=>{e.gotResolve=s});if(h>l){let s=F(await g(w,a.fileSize,l,h-1));for(let d=0;d<s.length;d++){let y=l+d;e.dec.decode(new EncodedVideoChunk({type:y===c?"key":"delta",timestamp:y*1e3,data:s[d]}))}e.fedGop=c,e.fedThrough=h}let x=new Promise(s=>setTimeout(s,P));if(await Promise.race([T,x]),!e.got){try{await e.dec.flush()}catch{}e.fedGop=-1,e.fedThrough=-1}let p=e.got;if(e.wanted=-1,e.gotResolve=null,e.got=null,!!p)try{return await R(p)}finally{p.close()}}throw new Error(`h264-mxf: frame ${t} did not decode`)}finally{n()}}async function m(){return(await import("./mxf-K465SWBN.js")).mxfFormat}var O={async inspect(o){return(await m()).inspect(o)},async extract(o){return(await m()).extract(o)},async sparsify(o,t){return(await m()).sparsify(o,t)},async trim(o,t){return(await m()).trim(o,t)},async decode(o,t){return U(o,t)}};export{O as h264MxfFormat};
package/dist/http.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
- import{b as h}from"./chunk-6TM32YIJ.js";import{O as d,P as u,X as f,Y as g,Z as T,ba as O,ca as w,ea as r,f as p}from"./chunk-QTKRMXL5.js";import{L as m,b as c}from"./chunk-TEZP6VEQ.js";import"./chunk-DRHOPOC7.js";import"./chunk-GXEVALBL.js";import"./chunk-Y2BEEOPB.js";import"./chunk-JB7PR2TQ.js";import"./chunk-C2ESM27Z.js";import"./chunk-HKP4P6JN.js";import"./chunk-EPZ6NWE4.js";import"./chunk-42QQI3WX.js";import"./chunk-6FVGUJ6L.js";import"./chunk-QDWB7QU7.js";import"./chunk-P7OVDUA5.js";import"./chunk-UCMNH6Q6.js";import"./chunk-BW2NQ54J.js";import"./chunk-WT6NIJCB.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WHY3DVXS.js";import"./chunk-BUEIRRNY.js";import"./chunk-TK55FA56.js";import"./chunk-EO5NIBOV.js";import"./chunk-QTPCU2TF.js";import"./chunk-CL26XMDO.js";import"./chunk-PSANHDZM.js";var S=Number(c("CONFORM_HTTP_PORT")??7791),E=c("CONFORM_HTTP_TOKEN")??"",k=(c("CONFORM_HTTP_ORIGINS")??"https://conform.tools,https://app.conform.tools,http://localhost:5173,http://localhost:3000").split(","),R=(t,n=new Headers)=>{let e=t.headers.get("origin")??"";return k.includes(e)&&n.set("access-control-allow-origin",e),n.set("access-control-allow-headers","authorization, content-type"),n.set("access-control-allow-methods","GET, POST, DELETE, OPTIONS"),n.set("access-control-allow-private-network","true"),n.set("vary","origin"),n},s=(t,n,e=200)=>new Response(JSON.stringify(n),{status:e,headers:R(t,new Headers({"content-type":"application/json"}))});m({hostname:"127.0.0.1",port:S,onListen:t=>console.error(`conformtools HTTP API on http://127.0.0.1:${t} (${r.length} verbs)`)},async t=>{let n=new URL(t.url);if(t.method==="OPTIONS")return new Response(null,{status:204,headers:R(t)});if(E&&t.headers.get("authorization")!==`Bearer ${E}`&&n.pathname!=="/health")return s(t,{ok:!1,code:"unauthorized"},401);let e=n.pathname.split("/").filter(Boolean);try{if(n.pathname==="/health")return s(t,{ok:!0,verbs:r.length,version:p,engine:u()});if(e[0]==="verbs"&&e.length===1&&t.method==="GET")return s(t,r.map(o=>({name:o.name,title:o.title,description:o.description,long:!!o.long,input_schema:h(d.object(o.inputSchema)),protected_stages:o.protectedStages??[],engine:u()})));if(e[0]==="verbs"&&e.length===2&&t.method==="POST"){let o=r.find(l=>l.name===e[1]);if(!o)return s(t,{ok:!1,code:"not_found",message:`unknown verb ${e[1]}`},404);let b=t.headers.get("content-type")?.includes("json")?await t.json():{},a=w(o.name,b);if(!a.ok)return s(t,{...a.result.structuredContent,text:a.result.content[0].text},400);let i=await O(o.name,a.data);return s(t,{...i.structuredContent??{ok:!i.isError},text:i.content.map(l=>l.text).join(`
4
- `)},i.isError?422:200)}if(e[0]==="jobs"&&e.length===1)return s(t,await T());if(e[0]==="jobs"&&e.length===2){if(t.method==="DELETE")return s(t,{ok:g(e[1])});let o=await f(e[1]);return o?s(t,o):s(t,{ok:!1,code:"not_found"},404)}return s(t,{ok:!1,code:"not_found"},404)}catch(o){return s(t,{ok:!1,code:"internal",message:o instanceof Error?o.message:String(o)},500)}});
package/dist/i2o-transfer DELETED
Binary file