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.
Files changed (84) hide show
  1. package/README.md +54 -22
  2. package/dist/{account-GFIQC77T.js → account-IUWNSDG5.js} +1 -1
  3. package/dist/{analysis-engine-4K5K6L53.js → analysis-engine-M7W32RRC.js} +1 -1
  4. package/dist/bridge-6NCHJWE6.js +3 -0
  5. package/dist/browser/timeline_core_bg.wasm +0 -0
  6. package/dist/{chunk-56EEBHP2.js → chunk-2CY2OOOJ.js} +1 -1
  7. package/dist/chunk-3XQI5SIV.js +3 -0
  8. package/dist/chunk-5YULBQJX.js +3 -0
  9. package/dist/chunk-64X5DLH5.js +6 -0
  10. package/dist/{chunk-XJNWAQON.js → chunk-6NLB5TZ2.js} +1 -1
  11. package/dist/chunk-B77ADB26.js +3 -0
  12. package/dist/chunk-DFQWQ3EA.js +10 -0
  13. package/dist/{chunk-JXTRQ3UG.js → chunk-F4PHKOAS.js} +1 -1
  14. package/dist/chunk-G3SZDPDS.js +3 -0
  15. package/dist/chunk-IN6XVTUS.js +3 -0
  16. package/dist/{chunk-NQNS4Y2B.js → chunk-LVGGCRDW.js} +1 -1
  17. package/dist/chunk-LYM757KG.js +158 -0
  18. package/dist/chunk-N34DQ6MH.js +14 -0
  19. package/dist/chunk-NMH62JSC.js +5 -0
  20. package/dist/chunk-NXJZXXC2.js +20 -0
  21. package/dist/{chunk-6HZP2OJA.js → chunk-OMPYIH6F.js} +1 -1
  22. package/dist/{chunk-DGXZB7MO.js → chunk-P3XI63Q2.js} +1 -1
  23. package/dist/chunk-QTA36RVO.js +502 -0
  24. package/dist/chunk-QTFFVLVJ.js +8 -0
  25. package/dist/{chunk-E5ENIKNR.js → chunk-SJ56EEFP.js} +2 -2
  26. package/dist/chunk-THVX57I3.js +4 -0
  27. package/dist/chunk-UUXHJNQA.js +8 -0
  28. package/dist/chunk-VJN4UXFJ.js +8 -0
  29. package/dist/chunk-XF3YMBI7.js +3 -0
  30. package/dist/chunk-XVRTAKDK.js +6 -0
  31. package/dist/chunk-YU3SUSK3.js +3 -0
  32. package/dist/claude-setup-REU4AOKX.js +13 -0
  33. package/dist/cli.js +8 -8
  34. package/dist/emscripten-module-Q67P5WYC-HW3D2R5O.js +2161 -0
  35. package/dist/engine-6ACEWA4S.js +5 -0
  36. package/dist/ffi-7KTOX2T4.js +3 -0
  37. package/dist/framing-CVJM5TT3.js +3 -0
  38. package/dist/gfx-worker.js +1 -1
  39. package/dist/{h264-B2TLLEMI.js → h264-5OGRVYUF.js} +1 -1
  40. package/dist/{h264-mxf-3GED5PBT.js → h264-mxf-FTHNCK4B.js} +1 -1
  41. package/dist/host-relink-ZP33BK53.js +10 -0
  42. package/dist/hosted-BWAYLJXR.js +3 -0
  43. package/dist/hosts-H3IKRZF2.js +3 -0
  44. package/dist/http.js +3 -3
  45. package/dist/{inspect-D3WEYL2W.js → inspect-BJYIDVDN.js} +2 -2
  46. package/dist/{isobmff-C5A2EFKH.js → isobmff-DN6MCHEK.js} +1 -1
  47. package/dist/{mc-video-ARKIHPA7.js → mc-video-TF3MD7LN.js} +1 -1
  48. package/dist/mcp.js +8 -7
  49. package/dist/{media-3YMIZSSF.js → media-MJKEKCPN.js} +1 -1
  50. package/dist/module-ES6BEMUI-L6VQ7K3J.js +3 -0
  51. package/dist/module-asyncify-2EFITU5U-Z4EEM6X7.js +3 -0
  52. package/dist/{mxf-CQSI6H5T.js → mxf-Q5723GPD.js} +1 -1
  53. package/dist/{ops-BCTGDBXT.js → ops-B2OA7VXN.js} +1 -1
  54. package/dist/{probe-COWUTQGN.js → probe-72QZKMCC.js} +1 -1
  55. package/dist/{r3d-FX7V4BIE.js → r3d-7OOZMPWH.js} +1 -1
  56. package/dist/{sequence-patch-JVEZW24V.js → sequence-patch-CN4VC5W3.js} +1 -1
  57. package/dist/store-4WZQF6YD.js +3 -0
  58. package/dist/timeline-ZP5H4YDQ.js +3 -0
  59. package/package.json +10 -1
  60. package/dist/bridge-73XMEZLH.js +0 -3
  61. package/dist/chunk-2MJAQROY.js +0 -5
  62. package/dist/chunk-7QUSVHO2.js +0 -10
  63. package/dist/chunk-CJYLQ3UM.js +0 -5
  64. package/dist/chunk-DFDXSIMI.js +0 -39
  65. package/dist/chunk-DNS4ZYIO.js +0 -3
  66. package/dist/chunk-GM262EDM.js +0 -8
  67. package/dist/chunk-JHTMYXJM.js +0 -20
  68. package/dist/chunk-QHXX5GDD.js +0 -440
  69. package/dist/chunk-TDIY4NRQ.js +0 -3
  70. package/dist/chunk-UGVGRL5M.js +0 -3
  71. package/dist/chunk-Y2QHZUGL.js +0 -5
  72. package/dist/chunk-YC7QDS5U.js +0 -19
  73. package/dist/chunk-ZVUKOFUX.js +0 -6
  74. package/dist/claude-setup-OKOPPDMB.js +0 -5
  75. package/dist/conformtools-analyze +0 -0
  76. package/dist/conformtools-decode +0 -0
  77. package/dist/engine-274GQLUB.js +0 -5
  78. package/dist/framing-BKTUEUZO.js +0 -3
  79. package/dist/host-relink-PTV44KXF.js +0 -10
  80. package/dist/hosts-D3TR2QEV.js +0 -3
  81. package/dist/i2o-transfer +0 -0
  82. package/dist/store-SZKXADGI.js +0 -3
  83. package/dist/timeline-PEUC3G7K.js +0 -3
  84. /package/dist/{still-WUCFH2WX.js → still-SX6RJ7O6.js} +0 -0
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ var S=["family","style","stagger","ease","plate","radiusLu","padLu","uppercase","tracking"],C=["accent","primary","secondary"],_=[...C,...S],F={family:"inter",accent:"#0a84ff",primary:"#ffffff",secondary:"#cfe0ff",style:"slide",stagger:.06,ease:"outBack",plate:"tick",radiusLu:1.2,padLu:2.4,uppercase:!1,tracking:0},j=[{id:"studio",label:"Studio",note:"The house default \u2014 a gradient slab with an accent rule.",look:{...F}},{id:"broadcast",label:"Broadcast",note:"Hard-edged scrim, no radius, tracked caps. Reads at any size.",look:{family:"condensed",accent:"#e11d2e",primary:"#ffffff",secondary:"#c9ced6",style:"wipe",stagger:.05,ease:"outExpo",plate:"scrim",radiusLu:0,padLu:2.2,uppercase:!0,tracking:.08}},{id:"editorial",label:"Editorial",note:"Serif on a hairline outline. Nothing shouts.",look:{family:"instrument",accent:"#e8e2d4",primary:"#f7f4ec",secondary:"#b3ab99",style:"fade",stagger:.12,ease:"outSine",plate:"outline",radiusLu:.2,padLu:2.8,uppercase:!1,tracking:.01}},{id:"social",label:"Social",note:"Fat pill, bright fill, springs in. Built for a small screen.",look:{family:"inter",accent:"#7c3aed",primary:"#ffffff",secondary:"#ddd0ff",style:"pop",stagger:.06,ease:"outSpring",plate:"solid",radiusLu:3.2,padLu:2.8,uppercase:!1,tracking:0}},{id:"documentary",label:"Documentary",note:"A rule and nothing else. The type carries it.",look:{family:"inter",accent:"#f5c451",primary:"#ffffff",secondary:"#b8b2a4",style:"rise",stagger:.14,ease:"outQuart",plate:"rule",radiusLu:0,padLu:1.6,uppercase:!1,tracking:.015}},{id:"terminal",label:"Terminal",note:"Mono caps in a boxed outline. Technical, deliberate.",look:{family:"jetmono",accent:"#31e07f",primary:"#d8ffe9",secondary:"#5f8f76",style:"wipeUp",stagger:.04,ease:"outCirc",plate:"outline",radiusLu:0,padLu:2,uppercase:!0,tracking:.06}},{id:"minimal",label:"Minimal",note:"No plate at all. Drifts on, drifts off.",look:{family:"inter",accent:"#ffffff",primary:"#ffffff",secondary:"#9aa2ad",style:"drift",stagger:.1,ease:"outSine",plate:"none",radiusLu:0,padLu:0,uppercase:!1,tracking:.02}},{id:"noir",label:"Noir",note:"Condensed caps, deep scrim, slow. For titles over picture.",look:{family:"condensed",accent:"#c8a24a",primary:"#f4efe3",secondary:"#9b917c",style:"expand",stagger:.2,ease:"inOutCubic",plate:"scrim",radiusLu:.4,padLu:3,uppercase:!0,tracking:.12}}],Q=Object.fromEntries(j.map(e=>[e.id,e]));function Z(e,o,t,a={}){let s=new Set(a.skip??[]),r=new Set(e?.takes??S),l={...o};for(let i of S)s.has(i)||!r.has(i)||t[i]!==void 0&&(l[i]=t[i]);let n=e?.look??{};for(let i of C)if(!(s.has(i)||t[i]===void 0))for(let c of n[i]??[])l[c]=t[i];return l}function ee(e,o={}){let t={kind:"gfx.look",version:1,...o};for(let a of _)e[a]!==void 0&&(t[a]=e[a]);return t}function te(e){let o=typeof e=="string"?JSON.parse(e):e;if(!o||typeof o!="object")throw new Error("not a look");if(o.kind!==void 0&&o.kind!=="gfx.look")throw new Error(`not a look (kind: ${JSON.stringify(o.kind)})`);let t={};for(let a of _)o[a]!==void 0&&(t[a]=o[a]);if(!Object.keys(t).length)throw new Error("that look file carries no recognised fields");return{look:t,label:typeof o.label=="string"?o.label:void 0}}var R=e=>e.includes("left")?"left":e.includes("right")?"right":"center",u=(e,o,t)=>[{t:0,v:0},{t:o,v:1,ease:"outCubic"},{t:e-t,v:1},{t:e,v:0,ease:"linear"}],k=(e,o,t,a,s,r="outBack",l="outCubic")=>[{t:0,v:a},{t:o,v:0,ease:r},{t:e-t,v:0},{t:e,v:s,ease:l}],w={slide:({duration:e,anchor:o,inT:t,outT:a,dist:s})=>{let r=R(o);if(r==="center")return{opacity:u(e,t,a),riseLu:k(e,t,a,s*.7,s*.4)};let l=r==="right"?1:-1;return{opacity:u(e,t,a),slideLu:k(e,t,a,l*s,l*s*.6)}},fade:({duration:e,inT:o,outT:t})=>({opacity:u(e,o,t)}),rise:({duration:e,inT:o,outT:t,dist:a})=>({opacity:u(e,o,t),riseLu:k(e,o,t,a*.7,a*.4)}),pop:({duration:e,inT:o,outT:t})=>({opacity:u(e,o,t),scale:[{t:0,v:.72},{t:o,v:1,ease:"outBack"},{t:e-t,v:1},{t:e,v:.88,ease:"outCubic"}]}),wipe:({duration:e,inT:o,outT:t})=>({opacity:[{t:0,v:1},{t:e-t,v:1},{t:e,v:1}],reveal:[{t:0,v:0},{t:o,v:1,ease:"outCubic"},{t:e-t,v:1},{t:e,v:0,ease:"inOutCubic"}],revealAxis:"x"}),wipeUp:({duration:e,inT:o,outT:t})=>({opacity:[{t:0,v:1},{t:e-t,v:1},{t:e,v:1}],reveal:[{t:0,v:0},{t:o,v:1,ease:"outCubic"},{t:e-t,v:1},{t:e,v:0,ease:"inOutCubic"}],revealAxis:"y"}),expand:({duration:e,inT:o,outT:t})=>({opacity:u(e,o*.6,t*.6),reveal:[{t:0,v:.12},{t:o,v:1,ease:"outCubic"},{t:e-t,v:1},{t:e,v:.12,ease:"outCubic"}],revealAxis:"x"}),none:()=>({}),drift:({duration:e,anchor:o,inT:t,outT:a,dist:s})=>{let r=R(o),n=r==="center"?0:(r==="right"?1:-1)*s*.5;return{opacity:u(e,t,a),[r==="center"?"riseLu":"slideLu"]:k(e,t,a,n||s*.5,(n||s*.5)*1.6,"outCubic","linear")}}},ae=(()=>{let e=new Set,o=t=>{if(Array.isArray(t)){for(let a of t)o(a);return}if(t&&typeof t=="object"){typeof t.ease=="string"&&e.add(t.ease);for(let a of Object.values(t))o(a)}};for(let t of Object.values(w))for(let a of["bottom-left","bottom","bottom-right"])o(t({duration:6,anchor:a,inT:.5,outT:.5,dist:4}));return[...e]})(),re=[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"rise",label:"Rise"},{id:"pop",label:"Pop"},{id:"drift",label:"Drift"},{id:"wipe",label:"Wipe"},{id:"wipeUp",label:"Wipe up"},{id:"expand",label:"Expand"},{id:"none",label:"None (hold)"}],U=[{id:"none",label:"Together",seconds:0},{id:"subtle",label:"Subtle",seconds:.06},{id:"clear",label:"Clear",seconds:.12},{id:"slow",label:"Slow",seconds:.2}],ie=Object.fromEntries(U.map(e=>[e.id,e]));function L(e,{duration:o,anchor:t="bottom-left",inT:a=.55,outT:s=.5,dist:r=3.5,ease:l}={}){let n=(w[e]||w.slide)({duration:o,anchor:t,inT:a,outT:s,dist:r});if(!l)return n;let i={};for(let[c,f]of Object.entries(n)){if(!Array.isArray(f)){i[c]=f;continue}i[c]=f.map((d,p)=>p===1&&d.ease?{...d,ease:l}:d)}return i}var b={solid:(e,{radiusLu:o,padLu:t})=>({color:e,padLu:t,radiusLu:o}),gradient:(e,{radiusLu:o,padLu:t})=>({color:e,colorB:`${e}00`,padLu:t,radiusLu:o}),tick:(e,{radiusLu:o,padLu:t})=>({color:e,colorB:`${e}00`,accent:e,padLu:t,radiusLu:o}),outline:(e,{radiusLu:o,padLu:t})=>({stroke:e,strokeLu:.28,padLu:t,radiusLu:o}),scrim:(e,{radiusLu:o,padLu:t})=>({color:"#000000a6",accent:e,accentLu:.55,padLu:t,radiusLu:o}),rule:(e,{padLu:o})=>({accent:e,accentLu:.9,padLu:o,radiusLu:0}),none:()=>{}},le=Object.keys(b).map(e=>({id:e,label:e[0].toUpperCase()+e.slice(1)})),E=(e,o)=>o?String(e).toUpperCase():e;function M({name:e="Ava Reyes",title:o="Director of Photography",duration:t=6,anchor:a="bottom-left",color:s="#0a84ff",nameColor:r="#ffffff",titleColor:l="#cfe0ff",nameLu:n=5.4,titleLu:i=3.2,family:c="system",center:f=!1,style:d="slide",stagger:p=0,plate:m="tick",radiusLu:x=1.2,padLu:g=2.4,uppercase:h=!1,tracking:y=0,ease:B}={}){let v={type:"group",anchor:a,inset:{x:4,y:5},gapLu:1.1,maxWidthLu:62,stagger:p,plate:(b[m]??b.tick)(s,{radiusLu:x,padLu:g}),anim:L(d,{duration:t,anchor:a,ease:B}),children:[{text:E(e,h),sizeLu:n,weight:700,color:r,family:c,lineHeight:1.1,tracking:y},{text:o,sizeLu:i,weight:500,color:l,family:c,lineHeight:1.15,tracking:y}]};if(f){let D=a.startsWith("top")?"top":a.startsWith("bottom")?"bottom":"center",A=(O,I,N)=>({anchor:D,inset:{y:I},maxWidthLu:N,plate:{accent:null},children:[{sizeLu:n+O,align:"center"},{sizeLu:i+O*.5,align:"center"}]});v.variants={square:A(.6,8,76),portrait:A(1,11,80)}}return{duration:t,elements:[v]}}function W({text:e="*Terms and conditions apply. Offer ends 12/31/26. Financing from 3.9% APR for qualified buyers. See dealer for details. \xA92026 Acme Corp.",duration:o=6,anchor:t="bottom",align:a="left",color:s="#ffffff",sizeLu:r=2,minLu:l=1.6,sizeHpct:n=null,family:i="system",scrim:c=!1,style:f="fade"}={}){return{duration:o,elements:[{type:"group",anchor:t,inset:{x:5,y:5},gapLu:.4,plate:c?{color:"#00000073",padLu:1.6,radiusLu:.5}:void 0,anim:L(f,{duration:o,anchor:t,inT:.35,outT:.35,dist:1.2}),children:[{text:e,sizeLu:r,minLu:l,sizeHpct:n,weight:500,color:s,family:i,lineHeight:1.28,align:a}]}]}}function Y({location:e="PARIS, FRANCE",sub:o="EXT. \u2014 DAY",duration:t=5,anchor:a="top-left",color:s="#000000cc",locColor:r="#ffffff",subColor:l="#a8b3bf",locLu:n=3.6,subLu:i=2.4,family:c="mono",style:f="slide",stagger:d=0,plate:p="solid",radiusLu:m=.8,padLu:x=1.8,uppercase:g=!1,tracking:h=.04,ease:y}={}){return{duration:t,elements:[{type:"group",anchor:a,inset:{x:3,y:3},gapLu:.6,maxWidthLu:50,stagger:d,plate:(b[p]??b.solid)(s,{radiusLu:m,padLu:x}),anim:L(f,{duration:t,anchor:a,inT:.4,outT:.4,dist:2.2,ease:y}),children:[{text:E(e,g),sizeLu:n,weight:700,color:r,family:c,tracking:h},...o?[{text:E(o,g),sizeLu:i,weight:400,color:l,family:c,tracking:h}]:[]]}]}}var z=`# Directed By
4
+ Director | Ava Reyes
5
+ # Cast
6
+ Lead | Jordan Blake
7
+ Support | Sam Okafor
8
+ # Post Production
9
+ Editor | Dana Liu
10
+ Colorist | Priya Nair
11
+ VFX | Marco Vitale
12
+ # Music
13
+ Composer | Th\xE9o Marchand`;function H(e,o={}){let t=/[\t|]/,a=String(e??"").split(`
14
+ `),s=o.capsHeads??a.some(l=>t.test(l)&&!l.trim().startsWith("#")),r=[];for(let l of a){let n=l.trim();if(!n){if(!r.length)continue;let i=r[r.length-1];i.gap!=null?i.gap+=.5:r.push({gap:.5});continue}if(n.startsWith("#")){r.push({head:n.slice(1).trim()});continue}if(n.startsWith(">")){r.push({para:n.slice(1).trim()});continue}if(n.startsWith("@image")){let i=n.slice(6).trim(),c=i.match(/^(.*?)(?:\s+(\d+(?:\.\d+)?))?$/),f=(c?.[1]??i).trim(),d=c?.[2]?Number(c[2]):void 0,p=f.split("|").map(m=>m.trim()).filter(Boolean);p.length===1?r.push({image:{src:p[0],heightLu:d}}):p.length>1&&r.push({images:{srcs:p,heightLu:d}});continue}if(t.test(n)){let i=n.split(t).map(c=>c.trim());r.push({role:i[0]||"",name:i.slice(1).filter(Boolean).join(" ")});continue}if(s&&n===n.toUpperCase()&&/[A-Z]/.test(n)){r.push({head:n});continue}r.push({text:n})}for(;r.length&&r[r.length-1].gap!=null;)r.pop();return r}function K({credits:e=z,duration:o=12,lineLu:t=5.2,colGapLu:a=3,gutterFrac:s=.5,paraWidthFrac:r=.8,paraLineHeight:l=1.35,headColor:n="#ffffff",nameColor:i="#ffffff",roleColor:c="#b9c2cc",family:f="system"}={}){let d=Array.isArray(e)?e:H(e);return{duration:o,elements:[{type:"crawl",rows:d,lineLu:t,colGapLu:a,gutterFrac:s,paraWidthFrac:r,paraLineHeight:l,headColor:n,nameColor:i,roleColor:c,family:f}]}}var G=[{id:"lowerThird",label:"Lower Third",base:"lower_third",make:M,fan:"positions",defaultPositions:["bottom-left","bottom","bottom-right"],look:{accent:["color"],primary:["nameColor"],secondary:["titleColor"]},takes:["family","style","stagger","plate","radiusLu","padLu","uppercase","tracking","ease"]},{id:"locator",label:"Locator",base:"locator",make:Y,fan:"positions",defaultPositions:["top-left","top-right"],look:{accent:["color"],primary:["locColor"],secondary:["subColor"]},takes:["family","style","stagger","plate","radiusLu","padLu","uppercase","tracking","ease"]},{id:"legalLine",label:"Legal Line",base:"legal",make:W,fan:"positions",defaultPositions:["bottom"],look:{primary:["color"]},takes:["family","style"]},{id:"endCrawl",label:"End Crawl",base:"end_crawl",make:K,fan:"none",defaultPositions:[],look:{primary:["headColor","nameColor"],secondary:["roleColor"]},takes:["family"]}],$=Object.fromEntries(G.map(e=>[e.id,e])),q=[{id:"top-left",label:"Left",slug:"top_left",band:"top"},{id:"top",label:"Center",slug:"top_center",band:"top"},{id:"top-right",label:"Right",slug:"top_right",band:"top"},{id:"left",label:"Left",slug:"middle_left",band:"middle"},{id:"center",label:"Center",slug:"middle_center",band:"middle"},{id:"right",label:"Right",slug:"middle_right",band:"middle"},{id:"bottom-left",label:"Left",slug:"bottom_left",band:"bottom"},{id:"bottom",label:"Center",slug:"bottom_center",band:"bottom"},{id:"bottom-right",label:"Right",slug:"bottom_right",band:"bottom"}],T=Object.fromEntries(q.map(e=>[e.id,e]));function ce(e,o={},t){let a=$[e];if(!a)throw new Error(`unknown graphic type: ${e}`);if(a.fan!=="positions")return[{key:"main",scene:a.make(o)}];let s=(t??a.defaultPositions).filter(r=>T[r]);return s.length?s.map(r=>({position:T[r],scene:a.make({...o,anchor:r})})):[{key:"main",scene:a.make(o)}]}var J=[{id:"16x9",label:"16 : 9 \xB7 Landscape master",w:1920,h:1080,group:"landscape"},{id:"9x16",label:"9 : 16 \xB7 Reels / Stories / Shorts",w:1080,h:1920,group:"portrait",chrome:{right:.14,bottom:.18}},{id:"1x1",label:"1 : 1 \xB7 Square feed",w:1080,h:1080,group:"square"},{id:"4x5",label:"4 : 5 \xB7 Portrait feed",w:1080,h:1350,group:"portrait"},{id:"2x3",label:"2 : 3 \xB7 Portrait / Pinterest",w:1080,h:1620,group:"portrait"},{id:"4x3",label:"4 : 3 \xB7 Broadcast / legacy",w:1440,h:1080,group:"landscape"},{id:"239x1",label:"2.39 : 1 \xB7 Scope / cinema",w:2048,h:858,group:"landscape"}],V=Object.fromEntries(J.map(e=>[e.id,e])),de=V["16x9"],X=[{id:"hd",label:"HD (1080)",factor:1},{id:"uhd",label:"UHD (2160)",factor:2}],pe=Object.fromEntries(X.map(e=>[e.id,e])),P=e=>2*Math.round(e/2);function ue(e,o){return o===1?e:{...e,w:P(e.w*o),h:P(e.h*o)}}export{F as a,j as b,Q as c,Z as d,ee as e,te as f,re as g,le as h,G as i,$ as j,q as k,T as l,ce as m,J as n,V as o,X as p,pe as q,ue as r};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{Ib as R,Jb as S,Kb as E,Lb as L,Mb as A,Nb as P,Ob as T,Pb as M,Qb as D,Rb as N,Sb as z,vb as C}from"./chunk-LYM757KG.js";import{Y as l,s as j}from"./chunk-G3SZDPDS.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};
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{a as L}from"./chunk-B77ADB26.js";import{$ as P,A as R,B as W,C as I,m as _,r as C,x as N,z as O}from"./chunk-G3SZDPDS.js";import X from"node:http";import{connect as Y}from"node:net";import{createHash as M,randomBytes as U}from"node:crypto";import{Buffer as d}from"node:buffer";var j="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function A(a,e,c=!1){let n=e.length,r=c?128:0,s=n<126?d.from([128|a,r|n]):n<65536?d.from([128|a,r|126,n>>8,n&255]):(()=>{let o=d.alloc(10);return o[0]=128|a,o[1]=r|127,o.writeBigUInt64BE(BigInt(n),2),o})();if(!c)return d.concat([s,d.from(e)]);let t=U(4),i=d.from(e);for(let o=0;o<i.length;o++)i[o]^=t[o&3];return d.concat([s,t,i])}function D(a,e,c,n=!1){let r=d.alloc(0),s=[],t=0,i=!1,o=[],p=[],u=()=>{i||(i=!0,p.forEach(l=>l()))},f=(l=1e3,g="")=>{if(i)return;let h=d.from(g),m=d.alloc(2+h.length);m.writeUInt16BE(l,0),h.copy(m,2);try{a.write(A(8,m,n))}catch{}a.end(),u()};return a.on("data",l=>{for(r=d.concat([r,l]);r.length>=2;){let g=(r[0]&128)!==0,h=r[0]&15,m=(r[1]&128)!==0,v=r[1]&127,w=2;if(v===126){if(r.length<4)return;v=r.readUInt16BE(2),w=4}else if(v===127){if(r.length<10)return;let b=r.readBigUInt64BE(2);if(b>BigInt(c))return f(1009,"too big");v=Number(b),w=10}if(m===n)return f(1002,n?"server frames must not be masked":"client frames must be masked");if(v>c||t+v>c)return f(1009,"message too big");let T=m?4:0;if(r.length<w+T+v)return;let S=d.from(r.subarray(w+T,w+T+v));if(m){let b=r.subarray(w,w+4);for(let x=0;x<S.length;x++)S[x]^=b[x&3]}if(r=r.subarray(w+T+v),h===8)return f(1e3);if(h===9){a.write(A(10,S,n));continue}if(h!==10){if(h===1||h===0){if(s.push(S),t+=S.length,g){let b=d.concat(s).toString("utf8");s=[],t=0,o.forEach(x=>x(b))}continue}return f(1003,"text frames only")}}}),a.on("close",u),a.on("error",u),{origin:e,send:l=>{i||a.write(A(1,d.from(l,"utf8"),n))},close:f,onMessage:l=>{o.push(l)},onClose:l=>{p.push(l)}}}function J(a,e){let c=new Set,n=X.createServer((r,s)=>{let t=n.address();a.onHttp?.(r,s,typeof t=="object"&&t?t.port:a.port)||(s.writeHead(426,{"content-type":"text/plain"}),s.end("websocket only"))});return n.on("upgrade",(r,s)=>{let t=r.headers["sec-websocket-key"];if(r.url?.split("?")[0]!==a.path||typeof t!="string"||String(r.headers.upgrade).toLowerCase()!=="websocket"){s.end(`HTTP/1.1 400 Bad Request\r
4
+ \r
5
+ `);return}let i=M("sha1").update(t+j).digest("base64");s.write(`HTTP/1.1 101 Switching Protocols\r
6
+ Upgrade: websocket\r
7
+ Connection: Upgrade\r
8
+ Sec-WebSocket-Accept: ${i}\r
9
+ \r
10
+ `),c.add(s),s.on("close",()=>c.delete(s));let o=typeof r.headers.origin=="string"?r.headers.origin:null;e(D(s,o,a.maxBytes))}),new Promise((r,s)=>{n.once("error",s),n.listen(a.port,a.hostname,()=>{let t=n.address();r({port:typeof t=="object"&&t?t.port:a.port,close:()=>new Promise(i=>{for(let o of c)o.destroy();n.close(()=>i())})})})})}function le(a,e){let c=new URL(a);if(c.protocol!=="ws:")return Promise.reject(new Error(`only ws:// URLs: ${a}`));let n=U(16).toString("base64"),r=M("sha1").update(n+j).digest("base64");return new Promise((s,t)=>{let i=Y({host:c.hostname,port:Number(c.port||80)}),o=f=>{i.destroy(),t(f)};i.setTimeout(e.timeoutMs,()=>o(new Error(`no answer from ${c.host} within ${e.timeoutMs} ms`))),i.once("error",o),i.once("connect",()=>i.write(`GET ${c.pathname}${c.search} HTTP/1.1\r
11
+ Host: ${c.host}\r
12
+ Upgrade: websocket\r
13
+ Connection: Upgrade\r
14
+ Sec-WebSocket-Key: ${n}\r
15
+ Sec-WebSocket-Version: 13\r
16
+ \r
17
+ `));let p=d.alloc(0),u=f=>{p=d.concat([p,f]);let l=p.indexOf(`\r
18
+ \r
19
+ `);if(l<0)return;i.off("data",u);let g=p.subarray(0,l).toString("latin1").split(`\r
20
+ `),h=g.find(w=>/^sec-websocket-accept:/i.test(w))?.split(":")[1]?.trim();if(!/^HTTP\/1\.1 101/.test(g[0])||h!==r)return o(new Error(`${c.host} refused the WebSocket upgrade: ${g[0]}`));i.setTimeout(0),i.off("error",o);let m=p.subarray(l+4),v=D(i,null,e.maxBytes,!0);m.length&&i.emit("data",m),s(v)};i.on("data",u)})}import{existsSync as K,readFileSync as Q}from"node:fs";var k=1,Z=[48127,48128,48129,48130,48131,48132,48133,48134],q=5e3,F=4,ee=8*1024*1024,y=class extends Error{constructor(c,n){super(n);this.code=c}},$=()=>P(_(),"host-bridge","pairing.json"),B="/avid-panel/",te="/avid-panel/pairing",G="avid",z={"index.html":"text/html; charset=utf-8","panel.js":"text/javascript; charset=utf-8","panel.css":"text/css; charset=utf-8","icon.svg":"image/svg+xml"},ne="default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self' ws://localhost:{port} ws://127.0.0.1:{port} http://localhost:* http://127.0.0.1:* https://localhost:* https://127.0.0.1:*; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",V=a=>[`http://localhost:${a}`,`http://127.0.0.1:${a}`];function re(){for(let a of["./avid/panel/web-dist/","./avid-panel/"]){let e=C(new URL(a,import.meta.url));if(K(P(e,"index.html")))return e}return null}function oe(){let a=new Uint8Array(32);return crypto.getRandomValues(a),Array.from(a,e=>e.toString(16).padStart(2,"0")).join("")}var H=class{constructor(){this.token=oe();this.port=0;this.live=new Map;this.waiters=[];this.seq=0;this.events=[]}async start(e=Z){let c;for(let n of e)try{this.server=await J({hostname:"127.0.0.1",port:n,path:"/host-bridge",maxBytes:ee,onHttp:(r,s,t)=>this.servePanel(r,s,t)},r=>this.accept(r)),this.port=this.server.port;break}catch(r){c=r}if(!this.server)throw new y("no_port",`every host-bridge port (${e.join(", ")}) is taken: ${c}`);await R(P(_(),"host-bridge")),await O($(),JSON.stringify({protocol:k,url:`ws://127.0.0.1:${this.port}/host-bridge`,port:this.port,token:this.token})),await I($(),384)}async stop(){for(let e of this.live.values())e.conn.close(1001,"engine stopping");this.live.clear(),await this.server?.close();try{JSON.parse(await N($())).token===this.token&&await W($())}catch{}}peers(){return[...this.live.values()].map(e=>e.peer)}peer(e){return this.live.get(e)?.peer}async waitFor(e,c){return this.live.has(e)?this.peer(e):(await Promise.race([new Promise(n=>this.waiters.push({host:e,resolve:n})),new Promise(n=>setTimeout(n,c))]),this.peer(e))}request(e,c,n={},r=3e4){let s=this.live.get(e);if(!s)return Promise.reject(new y("not_connected",`${e}: its panel is not connected`));let t=`r${++this.seq}`;return new Promise((i,o)=>{let p=setTimeout(()=>{s.pending.delete(t),o(new y("timeout",`${e}: no answer to ${c} within ${Math.round(r/1e3)} s`))},r);s.pending.set(t,{resolve:i,reject:o,timer:p}),s.conn.send(JSON.stringify({type:"request",id:t,method:c,params:n}))})}servePanel(e,c,n){let r=(e.url??"").split("?")[0];if(!r.startsWith(B)&&r!==B.slice(0,-1))return!1;let s=(f,l,g,h=!1)=>{let m=typeof g=="string"?new TextEncoder().encode(g):g;return c.writeHead(f,{"content-type":l,"content-length":String(m.length),"cache-control":"no-store","x-content-type-options":"nosniff","referrer-policy":"no-referrer","cross-origin-resource-policy":"same-origin","x-frame-options":"DENY","content-security-policy":ne.replaceAll("{port}",String(n))}),c.end(h?void 0:m),!0},t=(f,l)=>s(f,"text/plain; charset=utf-8",l),i=f=>{let l=e.headers[f];return typeof l=="string"?l:void 0},o=(i("host")??"").toLowerCase();if(o!==`localhost:${n}`&&o!==`127.0.0.1:${n}`)return t(421,"misdirected request");if(r===te)return e.method==="POST"&&V(n).includes(i("origin")??"")&&(i("sec-fetch-site")??"same-origin")==="same-origin"&&i("x-ct-panel")==="1"&&(i("content-length")??"0").trim()==="0"?s(200,"application/json",JSON.stringify({protocol:k,url:`ws://localhost:${n}/host-bridge`,port:n,token:this.token})):t(403,"forbidden");if(e.method!=="GET"&&e.method!=="HEAD")return t(405,"method not allowed");let p=r.slice(B.length)||"index.html",u=re();return!z[p]||!u?t(404,"not found"):s(200,z[p],Q(P(u,p)),e.method==="HEAD")}accept(e){let c=!!e.origin&&V(this.port).includes(e.origin);if(e.origin&&/^https?:/i.test(e.origin)&&!c){e.send(JSON.stringify({type:"error",code:"origin_refused",message:"web pages may not use the host bridge"})),e.close(1008,"origin");return}let n=null,r=setTimeout(()=>{n||(e.send(JSON.stringify({type:"error",code:"hello_timeout",message:"no hello"})),e.close(1008,"hello"))},q);e.onMessage(s=>{let t;try{t=JSON.parse(s)}catch{return}if(!n){let o=(l,g)=>{clearTimeout(r),e.send(JSON.stringify({type:"error",code:l,message:g})),e.close(1008,l)};if(t.type!=="hello")return o("hello_expected","the first frame must be hello");if(t.protocol!==k)return o("protocol_mismatch",`this engine speaks protocol ${k}`);if(t.token!==this.token)return o("bad_token","the pairing token does not match: re-read the pairing file");let p=t.host??{},u=String(p.id??"");if(!/^[a-z][a-z0-9_-]{1,31}$/.test(u))return o("bad_host","host.id is missing or malformed");if(c&&u!==G)return o("origin_mismatch",`a connection from the panel page may only be host ${G}`);if(!this.live.has(u)&&this.live.size>=F)return o("too_many_peers",`at most ${F} panels`);clearTimeout(r),this.live.get(u)?.conn.close(1e3,"replaced by a newer connection"),n=u;let f={id:u,name:String(p.name??u),version:String(p.version??""),platform:String(p.platform??""),capabilities:Array.isArray(t.capabilities)?t.capabilities.map(String):[],optional_verbs:Array.isArray(t.optional_verbs)?t.optional_verbs.map(String):[]};this.live.set(u,{peer:f,conn:e,pending:new Map}),e.send(JSON.stringify({type:"welcome",protocol:k,app:{name:"conformtools",version:L}})),this.waiters=this.waiters.filter(l=>l.host===u?(l.resolve(),!1):!0);return}let i=this.live.get(n);if(!(!i||i.conn!==e))if(t.type==="response"){let o=i.pending.get(String(t.id));if(!o)return;if(i.pending.delete(String(t.id)),clearTimeout(o.timer),t.ok)o.resolve(t.result??null);else{let p=t.error??{};o.reject(new y(p.code??"peer_error",`${n}: ${p.message??p.code??"error"}`))}}else t.type==="event"&&(this.events.push({host:n,name:String(t.name),data:t.data}),this.events.length>200&&this.events.shift())}),e.onClose(()=>{if(clearTimeout(r),!n)return;let s=this.live.get(n);if(s?.conn===e){for(let t of s.pending.values())clearTimeout(t.timer),t.reject(new y("disconnected",`${n}: the panel disconnected`));this.live.delete(n)}})}},E=null;function me(){return E??=(async()=>{let a=new H;return await a.start(),a})(),E.catch(()=>{E=null}),E}function he(){E=null}export{le as a,k as b,Z as c,y as d,$ as e,B as f,V as g,H as h,me as i,he as j};
@@ -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 r,d as t}from"./chunk-6V4OEOOX.js";import{i as n}from"./chunk-JXTRQ3UG.js";async function d(e){if(!r(e.name))return null;try{return await n(t(e),{verb:"inspect"})}catch(i){return console.warn(`[probeMedia] ${e.name} probe failed:`,i),null}}export{d as a};
3
+ import{c as r,d as t}from"./chunk-6V4OEOOX.js";import{i as n}from"./chunk-F4PHKOAS.js";async function d(e){if(!r(e.name))return null;try{return await n(t(e),{verb:"inspect"})}catch(i){return console.warn(`[probeMedia] ${e.name} probe failed:`,i),null}}export{d as a};
@@ -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 _}from"./chunk-JXTRQ3UG.js";function l(f){let m=[...f].sort((s,t)=>s.first_frame-t.first_frame),e=[];for(let s of m){let t=e[e.length-1];t&&s.first_frame<=t.last_frame+1?t.last_frame=Math.max(t.last_frame,s.last_frame):e.push({...s})}return e}async function g(f,m,e){let s=l(f),t=l(f.map(r=>({first_frame:Math.max(0,r.first_frame-m),last_frame:r.last_frame+m}))),n=[];for(let r of t)try{n.push(await e(r.first_frame,r.last_frame+1))}catch(o){let i=_(o)?.file_frames,u=s.filter(a=>a.last_frame>=r.first_frame&&a.first_frame<=r.last_frame);if(i==null||r.last_frame+1<=i||u.some(a=>a.first_frame<0||a.last_frame+1>i))throw o;n.push(await e(r.first_frame,i))}return n}export{l as a,g as b};
3
+ import{d as _}from"./chunk-F4PHKOAS.js";function l(f){let m=[...f].sort((s,t)=>s.first_frame-t.first_frame),e=[];for(let s of m){let t=e[e.length-1];t&&s.first_frame<=t.last_frame+1?t.last_frame=Math.max(t.last_frame,s.last_frame):e.push({...s})}return e}async function g(f,m,e){let s=l(f),t=l(f.map(r=>({first_frame:Math.max(0,r.first_frame-m),last_frame:r.last_frame+m}))),n=[];for(let r of t)try{n.push(await e(r.first_frame,r.last_frame+1))}catch(o){let i=_(o)?.file_frames,u=s.filter(a=>a.last_frame>=r.first_frame&&a.first_frame<=r.last_frame);if(i==null||r.last_frame+1<=i||u.some(a=>a.first_frame<0||a.last_frame+1>i))throw o;n.push(await e(r.first_frame,i))}return n}export{l as a,g as b};