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
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{N as D,O as F,P as N}from"./chunk-DFDXSIMI.js";import{n as j}from"./chunk-JHTMYXJM.js";import{$ as I,B as C,D as R,E as T,H as q,I as L,L as w,W as b,Y as k,Z as _,g as y,k as O,p as S,q as A,r as x,s as P,v as H,x as E,y as M}from"./chunk-DNS4ZYIO.js";var B=16e3,h=class extends Error{constructor(t,i){super(i);this.code=t}},$=class d{constructor(e,t=j,i=B){this.spec=e;this.bridge=t;this.waitMs=i;this.renders=new Map;this.host=e.host,e.items&&(this.items=n=>this.modelItems(n??{}))}async peer(){let e=await(await this.bridge()).waitFor(this.host,this.waitMs);if(!e)throw new h("not_connected",`${this.host}: the conform.tools plugin in ${this.spec.label} is not connected. ${this.spec.setup}`);return e}async needs(e){let t=await this.peer();if(!t.capabilities.includes(e))throw new h("panel_old",`${this.host}: the conform.tools plugin open in ${this.spec.label} ${t.version||""} has no ${e} (an older plugin); update it (${this.spec.setup})`);return t}async ask(e,t={},i){return await this.peer(),await(await this.bridge()).request(this.host,e,t,i)}static{this.announced=(e,t)=>e.optional_verbs.includes(t)}async support(){let e={ok:!1,reason:"the renderplugin is a DaVinci Resolve plugin"},t;try{t=await(await this.bridge()).waitFor(this.host,Math.min(3e3,this.waitMs))}catch(s){let a={ok:!1,reason:s instanceof Error?s.message:String(s)};return{export:a,open:a,render:a,markers:a,renderplugin:e}}if(!t){let s={ok:!1,reason:`the conform.tools plugin in ${this.spec.label} is not connected`,setup:this.spec.setup};return{export:s,open:s,render:s,markers:s,renderplugin:e}}let i=(s,a)=>s?{ok:!0}:{ok:!1,reason:`this plugin version has no ${a}`},n=t.capabilities;return{export:i(n.includes("timeline_read")||n.includes("timeline_write"),"timeline_read"),open:i(d.announced(t,"timeline_write.import_file"),"timeline_write.import_file"),render:i(n.includes("render"),"render"),markers:i(n.includes("markers"),"markers"),renderplugin:e}}async current(){let e=await this.ask("session.current_project");if(!e)return{project:"",timelines:[],timeline:""};let t=await this.ask("session.timeline_count",{project:e}),i=[];for(let s=1;s<=t;s++){let a=await this.ask("session.timeline_by_index",{project:e,index:s});a&&i.push(await this.ask("session.name",{handle:a}))}let n=await this.ask("session.current_timeline",{project:e});return{project:await this.ask("session.name",{handle:e}),timelines:i,timeline:n?await this.ask("session.name",{handle:n}):""}}async project(e={}){let t=await this.current();return{project:t.project,timeline:e.timeline??t.timeline,timelines:t.timelines,tracks:[],jobs:[],found:{},pool:{path:"",clips:0,folders:[]}}}async sequence(e){let t=await this.ask("session.current_project");if(!t)throw new h("no_project",`${this.host}: no project is open`);if(!e){let s=await this.ask("session.current_timeline",{project:t});if(!s)throw new h("no_timeline",`${this.host}: no timeline is active`);return{project:t,seq:s,name:await this.ask("session.name",{handle:s})}}let i=await this.ask("session.timeline_count",{project:t}),n=[];for(let s=1;s<=i;s++){let a=await this.ask("session.timeline_by_index",{project:t,index:s});if(!a)continue;let p=await this.ask("session.name",{handle:a});if(p===e)return{project:t,seq:a,name:p};n.push(p)}throw new h("not_found",`${this.host}: no timeline named "${e}" (have: ${n.join(", ")})`)}async model(e){let{project:t,seq:i}=await this.sequence(e);return await this.ask("timeline_read.model",{timeline:i,project:t},12e4)}async export(e){if(!e.out_path)throw new h("usage",`${this.host}: export needs out_path`);let t=await this.peer(),{project:i,seq:n,name:s}=await this.sequence(e.timeline),a=await this.ask("session.name",{handle:i}),p=r=>d.announced(t,r),m=e.out_path,c,l=[];if(p("timeline_write.export_otio")||p("timeline_write.export_xml")){let r=p("timeline_write.export_otio"),o=await this.ask(r?"timeline_write.export_otio":"timeline_write.export_xml",{project:i,timeline:n,path:e.out_path},12e4);if(c=o.format??(r?"otio":"xmeml"),o.ok===!1)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${e.out_path}${o.errors?.length?` (${o.errors.join("; ")})`:""}`);o.path&&o.path!==e.out_path&&(m=await this.adopt(o.path,e.out_path)),l=o.warnings??[]}else if(p("timeline_read.export_file")){let r=await this.ask("timeline_read.export_file",{timeline:n,fmt:"otio",path:e.out_path},12e4);if(!r)throw new h("export_failed",`${this.host}: ${this.spec.label} exported no OTIO`);c="otio",r!==e.out_path&&(m=await this.adopt(r,e.out_path))}else{await this.needs("timeline_read");let r=await this.ask("timeline_read.model",{timeline:n,project:i},12e4),o=J(r);await E(e.out_path,JSON.stringify(o.otio)),c="otio",l=o.notes}if(!D.includes(c))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${c}, which the engine does not read (${m})`);if(!await P(m)||(await A(m)).size===0)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${m}`);return{path:m,format:c,project:a,timeline:s,...l.length?{notes:l}:{}}}async adopt(e,t){let i=k(e)&&k(e)!==k(t)?t.slice(0,t.length-k(t).length)+k(e):t;if(await C(e,i),!F(i))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${b(e)}, which the engine does not read`);return i}async open(e){if(e.into==="scratch")throw new h("unsupported",`${this.host}: opening into a scratch project is not supported; the import lands in the open project`);let t=await this.peer();if(!d.announced(t,"timeline_write.import_file"))throw new h("unsupported",`${this.host}: this conform.tools plugin cannot import timelines (${this.spec.setup})`);let i=await this.ask("session.current_project");if(!i)throw new h("no_project",`${this.host}: no project is open`);let n=await this.ask("timeline_write.import_file",{project:i,path:e.path,sequences:null},3e5);if(!n.ok)throw new h("import_failed",`${this.host}: ${this.spec.label} did not import ${e.path}${n.issues?.length?` (${n.issues.join("; ")})`:""}`);let s=[...n.issues??[]];return n.imported.length>1&&s.push(`imported ${n.imported.length} timelines: ${n.imported.map(a=>a.name).join(", ")}`),e.name&&s.push(`${this.spec.label} names imported timelines after the file's own; name was not applied`),e.media_dirs?.length&&s.push(`${this.spec.label} links media from the paths in the file; media_dirs was not used (relink with timeline_relink before writing)`),{project:await this.ask("session.name",{handle:i}),timeline:n.imported[0]?.name??b(e.path),notes:s,restored:!e.stay,...n.bin?{folder:n.bin}:{}}}async modelItems(e){let t=await this.model(e.timeline),i=[...e.kind==="audio"?[]:t.items.map(n=>({kind:"video",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:n.handle?.$h??n.clip_id??"",name:n.name??"",color:n.color??"",flags:n.flags??[],enabled:n.enabled??!0,file:n.file_path})),...e.kind==="video"?[]:(t.audio_items??[]).map(n=>({kind:"audio",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:"",name:n.name??"",file:n.file_path??""}))].filter(n=>e.track===void 0||n.track===e.track);return{project:(await this.current()).project,timeline:t.timeline,start_frame:t.start_frame,fps:t.fps,items:i,color_groups:[],layers:1}}async apply(e){let t=e.ops.length>0&&e.ops.every(l=>l.op==="timeline_rename"&&(l.timeline||l.guid)),{project:i,seq:n,name:s}=await this.sequence(t?void 0:e.timeline),a=[],p=[],m=l=>l.op.startsWith("marker_")&&!l.item;for(let l=0;l<e.ops.length;){let r=l;for(;r<e.ops.length&&m(e.ops[r])===m(e.ops[l]);)r++;let o=e.ops.slice(l,r),u=m(o[0])?await this.markerOps(n,o):await this.clipOps(n,o,e.timeline);a.push(...u.results),p.unshift(...u.undo),l=r}let c=a.filter(l=>l.ok).length;return{project:await this.ask("session.name",{handle:i}),timeline:s,results:a,undo:p,applied:c,failed:a.length-c}}async clipOps(e,t,i){let n=await this.peer();if(n.capabilities.includes("edit"))return await this.ask("edit.apply",{timeline:e,ops:t},6e4+t.length*500);let s=(l,r)=>({op:l.op,ok:!1,detail:r});if(!n.capabilities.includes("item_meta"))return{results:t.map(l=>s(l,`${this.host}: clip edits are not reachable over this plugin`)),undo:[]};let a=await this.model(i),p=l=>l?"id"in l?{$h:l.id}:(l.kind??"video")!=="video"?null:a.items.find(r=>r.track===l.track&&r.start-a.start_frame===l.start)?.handle??null:null,m=[],c=[];for(let l of t){let r=p(l.item);try{if(!r)m.push(s(l,`no video item at ${JSON.stringify(l.item??null)}`));else if(l.op==="clip_color"){let o=await this.ask("item_meta.color",{handle:r}),u=l.color?await this.ask("item_meta.set_color",{handle:r,color:l.color}):await this.ask("item_meta.clear_color",{handle:r});m.push({op:l.op,ok:u}),u&&c.unshift({op:"clip_color",item:l.item,color:o})}else if(l.op==="enabled"&&d.announced(n,"item_meta.set_enabled")){let o=a.items.find(f=>f.handle?.$h===r.$h)?.enabled??!0,u=await this.ask("item_meta.set_enabled",{item:r,enabled:!!l.on});m.push({op:l.op,ok:u}),u&&c.unshift({op:"enabled",item:l.item,on:o})}else m.push(s(l,`${this.host}: '${l.op}' is not reachable over this plugin`))}catch(o){m.push(s(l,o instanceof Error?o.message:String(o)))}}return{results:m,undo:c}}async markerOps(e,t){let i=await this.peer(),n=r=>d.announced(i,r),s=new Map((await this.ask("markers.list",{target:e})).map(r=>[r.frame,r])),a=[],p=[],m=async r=>{let o=await this.ask("markers.add",{target:e,frame:r.frame,color:r.color??"",name:r.name??"",note:r.note??"",duration:r.duration??1,custom_data:r.custom_data??""});return o&&s.set(r.frame,{color:"",name:"",note:"",duration:1,...r}),o},c=async r=>{let o=await this.ask("markers.delete_at",{target:e,frame:r});return o&&s.delete(r),o},l=r=>({op:"marker_add",frame:r.frame,color:r.color,name:r.name,note:r.note,duration:r.duration,...r.custom_data?{data:r.custom_data}:{}});for(let r of t){let o=Number(r.frame);try{if(r.op==="marker_add"){let u=s.get(o);u&&await c(o);let f=await m({frame:o,color:r.color,name:r.name,note:r.note,duration:Number(r.duration??1),custom_data:r.data});a.push({op:r.op,ok:f}),f&&p.unshift(...u?[l(u)]:[],{op:"marker_delete",frame:o})}else if(r.op==="marker_update"){let u=s.get(o);if(!u){a.push({op:r.op,ok:!1,detail:`no marker at frame ${o}`});continue}let f=r.to_frame!==void 0?Number(r.to_frame):o,v={...u,frame:f,...r.color!==void 0?{color:String(r.color)}:{},...r.name!==void 0?{name:String(r.name)}:{},...r.note!==void 0?{note:String(r.note)}:{}},g=!0;n("markers.set_color")&&n("markers.set_text")&&n("markers.move")?(r.color!==void 0&&(g=await this.ask("markers.set_color",{target:e,frame:o,color:r.color})&&g),(r.name!==void 0||r.note!==void 0)&&(g=await this.ask("markers.set_text",{target:e,frame:o,name:r.name,note:r.note})&&g),f!==o&&(g=await this.ask("markers.move",{target:e,frame:o,to_frame:f})&&g),s.delete(o),s.set(f,v)):g=await c(o)&&await m(v),a.push({op:r.op,ok:g}),p.unshift({op:"marker_update",frame:f,color:u.color,name:u.name,note:u.note,...f!==o?{to_frame:o}:{}})}else if(r.op==="marker_delete"){let u=s.get(o),f=!!u&&await c(o);a.push({op:r.op,ok:f,...u?{}:{detail:`no marker at frame ${o}`}}),f&&u&&p.unshift(l(u))}else a.push({op:r.op,ok:!1,detail:`${this.host}: '${r.op}' is not reachable over this plugin`})}catch(u){a.push({op:r.op,ok:!1,detail:u instanceof Error?u.message:String(u)})}}return{results:a,undo:p}}async renderStart(e){if(await this.needs("render"),e.renderplugin)throw new h("unsupported","the renderplugin is a DaVinci Resolve plugin");if(e.disable_tracks?.length||e.audio_tracks?.length)throw new h("unsupported",`${this.host}: disable_tracks / audio_tracks are DaVinci Resolve's; pick a preset that renders what you need`);if(!e.preset)throw new h("usage",`${this.host}: preset is required: one of ${this.spec.label}'s export presets by name`);let{seq:t,name:i}=await this.sequence(e.timeline),n=e.name??i,s={purpose:"deliver",format:"preset",preset:e.preset,target_dir:e.target_dir,name:n,...e.range?{range:[e.range.in,e.range.out]}:{}},a=await this.ask("render.submit",{timeline:t,job:s});if(!a?.id)throw new h("render_refused",`${this.host}: ${a?.error??`${this.spec.label} refused the render`}`);if(!await this.ask("render.start",{job_ids:[a.id]}))throw new h("render_refused",`${this.host}: ${this.spec.label} did not start job ${a.id}`);return this.renders.set(a.id,{dir:e.target_dir,name:n}),{job_id:a.id,state:"queued",percent:0}}async renderStatus(e){let t=await this.ask("render.status",{job_id:e});if(!t)return{job_id:e,state:"failed",percent:0,error:`${this.host}: no render job ${e}`};let i={done:"complete",rendering:"rendering",queued:"queued",failed:"failed",cancelled:"cancelled"}[t.state]??"rendering",n={job_id:e,state:i,percent:Math.round(t.progress??(i==="complete"?100:0)),...t.error?{error:t.error}:{}};if(i==="complete"||i==="failed"||i==="cancelled"){let s=this.renders.get(e);i==="complete"&&s&&(n.outputs=await W(s.dir,s.name)),await this.ask("render.remove",{job_id:e}).catch(()=>!1),this.renders.delete(e)}return n}async renderCancel(e){return await this.ask("render.cancel",{job_id:e})?{job_id:e,state:"cancelled",percent:0}:{...await this.renderStatus(e),error:`${this.spec.label}'s running export cannot be cancelled from here; stop it in ${this.spec.label}`}}};async function W(d,e){let t=[];try{for await(let i of L(d))i.isFile&&i.name.startsWith(`${e}.`)&&t.push(_(d,i.name))}catch{}return t.sort()}function J(d){let e=(c,l)=>({OTIO_SCHEMA:"RationalTime.1",value:c,rate:l}),t=(c,l,r,o=r)=>({OTIO_SCHEMA:"TimeRange.1",start_time:e(c,r),duration:e(l,o)}),i=d.fps,n=d.tracks?.length?d.tracks:[...new Set(d.items.map(c=>c.track))].sort((c,l)=>c-l).map(c=>({index:c,enabled:!0,name:"",items:d.items.filter(l=>l.track===c)})),s=c=>(c.reversed?-1:1)*(c.speed||1)/(c.fps_factor||1),a=new Map;for(let c of d.items)if(c.file_path&&c.start_tc!=null&&c.src_abs_in!=null){let l=c.src_abs_in-c.start_tc+Math.ceil((c.end-c.start)*Math.abs(s(c))*(c.fps_factor||1));a.set(c.file_path,Math.max(a.get(c.file_path)??0,l))}let p=n.map(c=>{let l=d.start_frame,r=[];for(let o of[...c.items].sort((u,f)=>u.start-f.start)){if(o.start<l)continue;o.start>l&&r.push({OTIO_SCHEMA:"Gap.1",name:"",source_range:t(0,o.start-l,i)});let u=o.src_fps||i,f=o.start_tc!=null&&a.has(o.file_path)?o.start_tc:null,v=f!=null?o.src_abs_in:o.src_in??o.src_abs_in??0,g=s(o);r.push({OTIO_SCHEMA:"Clip.2",name:o.name??b(o.file_path||""),enabled:o.enabled!==!1,source_range:t(v,o.end-o.start,u,i),media_references:{DEFAULT_MEDIA:{OTIO_SCHEMA:"ExternalReference.1",name:b(o.file_path||""),target_url:o.file_path?`file://${o.file_path}`:"",...f!=null?{available_range:t(f,a.get(o.file_path),u)}:{},metadata:{}}},active_media_reference_key:"DEFAULT_MEDIA",effects:Math.abs(g-1)>1e-6?[{OTIO_SCHEMA:"LinearTimeWarp.1",name:"",effect_name:"LinearTimeWarp",time_scalar:g}]:[],markers:[],metadata:o.reel?{cmx_3600:{reel:o.reel}}:{}}),l=o.end}return{OTIO_SCHEMA:"Track.1",name:c.name||`V${c.index}`,kind:"Video",enabled:c.enabled!==!1,children:r,effects:[],markers:[],metadata:{}}}),m=[];return d.audio_items?.length&&m.push(`${d.audio_items.length} audio clip(s) not carried: the host's plugin reports no audio source times`),d.transitions?.length&&m.push(`${d.transitions.length} transition(s) not carried (cuts in their place)`),{otio:{OTIO_SCHEMA:"Timeline.1",name:d.timeline,global_start_time:e(d.start_frame,i),metadata:{},tracks:{OTIO_SCHEMA:"Stack.1",name:"tracks",children:p,effects:[],markers:[],metadata:{}}},notes:m}}var X=16e3;var G="Install the conform.tools panel (host_setup host=premiere action=install_panel), then in Premiere open Window > UXP Plugins > conform.tools. It connects by itself from then on.";var U=class extends ${constructor(t=j,i=X){super({host:"premiere",label:"Premiere Pro",setup:G},t,i);this.items=async(t={})=>{await this.needs("edit");let{seq:i}=await this.sequence(t.timeline),n=await this.ask("edit.items",{timeline:i,kind:t.kind,track:t.track},12e4),s=n.project_path?await K(n.project_path,n.timeline).catch(p=>({error:p instanceof Error?p.message:String(p)})):{error:"the project has never been saved"},a=0;if(!("error"in s))for(let p of n.items){let m=s.get(`${p.kind}:${p.track}:${p.start}:${Number(p.end)-Number(p.start)}`);m?Object.assign(p,m,{saved:!0}):(p.saved=!1,a++)}return{...n,color_groups:[],layers:1,..."error"in s?{saved_note:`saved project not read: ${s.error}`}:{unsaved_items:a}}};this.premiereRenders=new Map}async current(){let t=await this.ask("session.describe");return{project:t.project,timelines:t.timelines,timeline:t.current}}async liveMarkers(t){if(!$.announced(await this.peer(),"edit.markers"))return null;let{seq:i}=await this.sequence(t);return await this.ask("edit.markers",{timeline:i},12e4)}async model(t){return await super.model(t)}async projectClips(){return await this.needs("edit"),await this.ask("edit.project_clips",{},12e4)}async relinkClips(t){return await this.needs("edit"),await this.ask("edit.relink_clips",{items:t},6e4+t.length*2e3)}async cutIn(t,i){await this.needs("edit");let{seq:n}=await this.sequence(t);return await this.ask("edit.cut_in",{timeline:n,cuts:i},12e4+i.length*3e3)}async renderStart(t){if(t.range)throw new h("unsupported","premiere: a frame range is not supported yet; set in/out on the sequence in Premiere");if(!t.preset||!/\.epr$/i.test(t.preset))throw new h("usage","premiere: preset must be the path of a Media Encoder preset (.epr)");let{seq:i,name:n}=await this.sequence(t.timeline);await M(t.target_dir);let s=_(t.target_dir,`${t.name??n}.mov`),a=await this.ask("render.export_sequence",{timeline:i,output_path:s,preset_path:t.preset,queue:!1},6e4);if(!a.ok)throw new h("render_refused","premiere: Premiere refused the export");let p=a.job||`ppro-${Date.now()}`;return this.premiereRenders.set(p,s),{job_id:p,state:"rendering",percent:0}}async renderStatus(t){let i=await this.ask("render.progress"),n=i[t]??i.last,s=this.premiereRenders.get(t);return n?.event==="error"||n?.event==="onEncodeError"?{job_id:t,state:"failed",percent:0,error:String(n.data??"encode error")}:n?.event==="complete"||n?.event==="onEncodeComplete"||s&&await x(s)&&!n?{job_id:t,state:"complete",percent:100,...s?{outputs:[s]}:{}}:{job_id:t,state:"rendering",percent:typeof n?.data=="number"?Math.round(Number(n.data)*100):0}}async renderCancel(t){return{job_id:t,state:"cancelled",percent:0,error:"Premiere's export cannot be cancelled from here; cancel it in Premiere / Media Encoder"}}};async function K(d,e){let{session:t}=await N(d,"prproj"),i=t.timelines.find(s=>s.name===e),n=new Map;if(!i)throw new Error(`the saved project has no sequence "${e}" (saved before it was made?)`);for(let s of i.tracks)if(!(s.kind!=="Video"&&s.kind!=="Audio"))for(let a of s.items){if(a.kind==="gap"||a.kind==="transition")continue;let p=a;n.set(`${s.kind==="Video"?"video":"audio"}:${s.track_index}:${a.timeline_range.start.value}:${a.timeline_range.duration.value}`,{saved_id:a.id,...p.speed_factor!=null&&p.speed_factor!==1?{retime:p.speed_factor}:{},...p.speed_ramped?{ramped:!0}:{},...p.speed_reverse?{reversed:!0}:{},...a.kind==="nested"?{nested:!0}:{},...p.is_multicam?{multicam:!0}:{},...p.effects?.some(m=>/stabiliz/i.test(m.kind??""))?{stabilized:!0}:{},...p.effects?.length?{saved_effects:p.effects.map(m=>m.name??m.kind??"")}:{}})}return n}function z(d=y()){return d==="darwin"?"/Library/Application Support/Adobe/Adobe Desktop Common/RemoteComponents/UPI/UnifiedPluginInstallerAgent/UnifiedPluginInstallerAgent.app/Contents/MacOS/UnifiedPluginInstallerAgent":d==="win32"?"C:\\Program Files\\Common Files\\Adobe\\Adobe Desktop Common\\RemoteComponents\\UPI\\UnifiedPluginInstallerAgent\\UnifiedPluginInstallerAgent.exe":null}async function V(){for(let d of["./uxp-plugin/","./premiere-uxp/"]){let e=S(new URL(d,import.meta.url));if(await P(_(e,"manifest.json")))return e}throw new Error("premiere: the conform.tools panel is missing from this install")}async function Q(){return JSON.parse(await H(_(await V(),"manifest.json"))).version}async function oe(d=y()){let e=z(d);if(!e||!await x(e))return{installed:!1,listing:"Creative Cloud's plugin installer is not on this machine"};let t=await w(e,d==="win32"?["/list","all"]:["--list","all"],{timeoutMs:6e4}),i=t.stdout.split(`
4
- `).find(n=>/CONFORM\.TOOLS|conformtools/i.test(n));return{installed:!!i&&/enabled|installed/i.test(i),version:i?.match(/(\d+\.\d+\.\d+)\s*$/)?.[1],listing:t.stdout.trim()}}async function ae(d=y()){let e=z(d);if(!e||!await x(e))throw new Error("premiere: Creative Cloud's plugin installer (UnifiedPluginInstallerAgent) is not on this machine; install Creative Cloud");let t=await V(),i=await Q(),n=await q("conform-ccx-");for(let l of["manifest.json","index.html","index.js","lib","icons"])await T(_(t,l),_(n,l));let s=_(O(),"premiere");await M(s);let a=I(_(s,`conformtools-premiere-${i}.ccx`));await R(a);let p=d==="darwin"?await w("sh",["-c",`cd '${n.replace(/'/g,"'\\''")}' && zip -r -q -X '${a.replace(/'/g,"'\\''")}' manifest.json index.html index.js lib icons`]):await w("powershell",["-NoProfile","-Command",`Compress-Archive -Path '${n}\\*' -DestinationPath '${a.replace(/\.ccx$/,".zip")}' -Force; Move-Item -Force '${a.replace(/\.ccx$/,".zip")}' '${a}'`]);if(await R(n),!p.success)throw new Error(`premiere: could not package the panel: ${p.stderr.trim()}`);await w(e,d==="win32"?["/remove","conform.tools"]:["--remove","conform.tools"],{timeoutMs:12e4});let m=await w(e,d==="win32"?["/install",a]:["--install",a],{timeoutMs:18e4}),c=`${m.stdout}
5
- ${m.stderr}`.trim();if(!m.success||!/Installation Successful/i.test(c))throw new Error(`premiere: Adobe's installer refused the panel: ${c.split(`
6
- `).pop()}`);return{version:i,ccx:a,output:c}}export{$ as a,U as b,K as c,Q as d,oe as e,ae as f};
@@ -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{B as k,L as h,Z as c,a as m,k as w,l as $,r as i,v as b,x as v,y as R}from"./chunk-DNS4ZYIO.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};
Binary file
Binary file
@@ -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"./chunk-PSANHDZM.js";function S(){let e=window.__CONFORM_ENGINE__;if(e?.base)return e;let t=new URLSearchParams(window.location.search),n=l=>{try{return sessionStorage.getItem(`conform.engine.${l}`)}catch{return null}},o=(l,c)=>{try{sessionStorage.setItem(`conform.engine.${l}`,c)}catch{}},r=t.get("engine"),i=t.get("token");return r?o("url",r):r=n("url"),i?o("token",i):i=n("token"),{base:r?/^\d+$/.test(r)?`http://127.0.0.1:${r}`:r.replace(/\/$/,""):"http://127.0.0.1:7791",token:i??""}}var g=typeof window>"u"?{base:"http://127.0.0.1:7791",token:""}:S(),f=(e=!0)=>({...e?{"content-type":"application/json"}:{},...g.token?{authorization:`Bearer ${g.token}`}:{}}),y=class extends Error{constructor(n,o){super(o);this.code=n}};async function s(e,t,n,o=[]){let r;try{r=await fetch(`${g.base}${t}`,{method:e,headers:f(),body:n===void 0?void 0:JSON.stringify(n)})}catch{throw new y("engine_down",`the conform.tools engine is not running at ${g.base}`)}let i=await r.json().catch(()=>({}));if(!r.ok&&!("text"in i)&&!o.includes(r.status))throw new y(i.code??String(r.status),i.message??`HTTP ${r.status}`);return i}async function _(e,t,n,o){let r;try{r=await fetch(`${g.base}${e}`,{...t,headers:f(),signal:o})}catch{o?.aborted||n({type:"error",code:"engine_down",message:`the conform.tools engine is not running at ${g.base}`});return}if(!r.ok||!r.body){let c=await r.json().catch(()=>({}));n({type:"error",code:c.code??String(r.status),message:c.message??`HTTP ${r.status}`});return}let i=r.body.getReader(),b=new TextDecoder,l="";for(;;){let{value:c,done:m}=await i.read();if(m)break;l+=b.decode(c,{stream:!0});let u;for(;(u=l.indexOf(`
4
-
5
- `))>=0;){let h=l.slice(0,u);l=l.slice(u+2),h.startsWith("data: ")&&n(JSON.parse(h.slice(6)))}}}var w=new Set,k=null;function P(){if(k)return;let e=k=new AbortController;(async()=>{for(;!e.signal.aborted;)await _("/app/events",{method:"GET"},t=>{for(let n of w)n(t)},e.signal).catch(()=>{}),e.signal.aborted||await new Promise(t=>setTimeout(t,2e3))})()}var x={base:g.base,health:()=>s("GET","/health"),verb:(e,t={})=>s("POST",`/verbs/${e}`,t),job:e=>s("GET",`/jobs/${e}`),cancelJob:e=>s("DELETE",`/jobs/${e}`),front:e=>s("POST","/app/front",e),account:()=>s("GET","/app/account"),projects:()=>s("GET","/app/projects"),createProject:e=>s("POST","/app/projects",e),project:e=>s("GET",`/app/projects/${e}`),attachSession:(e,t)=>s("PUT",`/app/projects/${e}/sessions`,{session_id:t}),saveContext:(e,t,n)=>s("PUT",`/app/projects/${e}/context`,{text:t,base:n},[409]),frame:async(e,t,n,o,r,i,b)=>{let l=new URLSearchParams({f:String(t),w:String(n),...r?{timeline:r}:{},...i?{track:String(i)}:{},...b?{grade:"resolve",...b.host_timeline?{host_timeline:b.host_timeline}:{}}:{}}),c=await fetch(`${g.base}/app/sessions/${e}/frame?${l}`,{headers:f(!1),signal:o}).catch(()=>null);if(!c?.ok)return null;if(c.headers.get("content-type")!=="application/x-conform-pixels")return createImageBitmap(await c.blob()).catch(()=>null);let m=new Uint8Array(await c.arrayBuffer()),u=new DataView(m.buffer),h=u.getUint32(0,!0),v=u.getUint32(4,!0),T=u.getUint32(8,!0)===1,p=new Uint8ClampedArray(m.buffer,12,h*v*4);for(let d=0;d<p.length;d+=4){if(T){let R=p[d];p[d]=p[d+2],p[d+2]=R}p[d+3]=255}return createImageBitmap(new ImageData(p,h,v)).catch(()=>null)},tools:()=>s("POST","/verbs/tool",{action:"list"}).then(e=>e.tools??[]),blocks:()=>s("POST","/verbs/tool",{action:"blocks"}).then(e=>e.blocks??[]),saveTool:e=>s("POST","/verbs/tool",{action:"save",spec:e},[422]),deleteTool:e=>s("POST","/verbs/tool",{action:"delete",id:e},[422]),toolLayout:()=>s("POST","/verbs/tool",{action:"layout"}).then(e=>e.layout),arrangeTools:e=>s("POST","/verbs/tool",{action:"arrange",layout:e}).then(t=>t.layout),hideTool:(e,t)=>s("POST","/verbs/tool",{action:t?"hide":"show_tool",id:e}).then(n=>n.layout),workspace:e=>s("POST","/verbs/tool",{action:"workspace",project_id:e}).then(t=>t.workspace),saveWorkspace:(e,t)=>s("POST","/verbs/tool",{action:"workspace_save",project_id:e,workspace:t},[422]),exportTools:(e,t)=>s("POST","/verbs/tool",{action:"export",ids:e,path:t},[422]),importTools:e=>s("POST","/verbs/tool",{action:"import",path:e},[422]),hostSetup:(e,t="status")=>s("POST","/verbs/host_setup",{host:e,action:t},[422]),convert:async(e,t)=>{let n=new URLSearchParams({name:e.fileName,out:t,targets:JSON.stringify(e.targets.map(({target:r,ext:i})=>({target:r,ext:i}))),sequences:JSON.stringify(e.sequences)}),o=await fetch(`${g.base}/app/convert?${n}`,{method:"POST",headers:{...f(!1),"content-type":"application/octet-stream"},body:e.bytes});return await o.json().catch(()=>({ok:!1,error:`the engine said ${o.status}`}))},canonicalize:async(e,t=[],n=[])=>{let o=new URLSearchParams({name:e.name,sequences:JSON.stringify(t),previous:JSON.stringify(n)}),r=await fetch(`${g.base}/app/canonicalize?${o}`,{method:"POST",headers:{...f(!1),"content-type":"application/octet-stream"},body:await e.arrayBuffer()}),i=await r.json().catch(()=>({ok:!1,error:`the engine said ${r.status}`}));if(!i.ok)throw new Error(i.error??i.message??`the engine said ${r.status}`);return i},policy:()=>s("GET","/app/policy"),session:e=>s("GET",`/app/sessions/${e}`),onEvent:e=>(w.add(e),P(),()=>{w.delete(e),w.size||(k?.abort(),k=null)}),saveRunCsv:(e,t,n,o)=>s("POST","/verbs/tool_run",{action:"csv",project_id:e,path:t,id:n,table:o}),runs:(e,t)=>s("POST","/verbs/tool_run",{action:"list",project_id:e,...t?{id:t}:{}}).then(n=>n.runs??[])};async function j(e,t){let n=await fetch(`${g.base}/app/fs`,{method:"POST",headers:f(),body:JSON.stringify({op:e,...t})});if(e==="readFile"){if(!n.ok)throw Object.assign(new Error(`could not read ${String(t.path)}`),{name:"NotReadableError"});let r=await n.arrayBuffer();return{result:{byteLength:r.byteLength},bytes:r}}let o=await n.json().catch(()=>({ok:!1}));if(!o.ok)throw Object.assign(new Error(o.message??`the engine said ${n.status}`),{name:"NotFoundError"});return{result:o.result}}var a=()=>typeof window<"u"?window.__TAURI__:void 0,$={available:()=>!!a()?.core?.invoke,licenseStatus:()=>a().core.invoke("license_status"),fingerprint:()=>a().core.invoke("machine_fingerprint"),version:()=>a().app.getVersion(),installUpdate:()=>a().core.invoke("install_update"),importLicense:async()=>{let e=await a().dialog.open({multiple:!1,filters:[{name:"conform.tools licence",extensions:["lic","json"]}]});return typeof e=="string"?a().core.invoke("import_license",{path:e}):null},pickFolder:async()=>{let e=await a().dialog.open({directory:!0,multiple:!1});return typeof e=="string"?e:null},pickFiles:async()=>{let e=await a().dialog.open({directory:!1,multiple:!0});return Array.isArray(e)?e:typeof e=="string"?[e]:[]},pickFile:async()=>{let e=await a().dialog.open({directory:!1,multiple:!1});return typeof e=="string"?e:null},saveFile:async e=>{try{let t=e.split(".").pop()??"json",n=await a().dialog.save({defaultPath:e,filters:[{name:t==="csv"?"Table":"Recipe",extensions:[t]}]});return typeof n=="string"?n:null}catch{let t=await a().dialog.open({directory:!0,multiple:!1});return typeof t=="string"?`${t.replace(/[\\/]$/,"")}/${e}`:null}}};export{y as EngineError,x as engine,j as engineFs,$ as shell};
@@ -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{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n}from"./chunk-Y2QHZUGL.js";import"./chunk-DFDXSIMI.js";import"./chunk-NQNS4Y2B.js";import"./chunk-7QUSVHO2.js";import"./chunk-PFZVET7S.js";import"./chunk-YUO3UWPH.js";import"./chunk-JV7TZDKJ.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WJ5EWXP2.js";import"./chunk-C2ESM27Z.js";import"./chunk-XDI6CPPV.js";import"./chunk-DGXZB7MO.js";import"./chunk-JXTRQ3UG.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-XJNWAQON.js";import"./chunk-CJYLQ3UM.js";import"./chunk-PHAMF4JF.js";import"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";export{j as ASPECTS,a as INPUT_SCALING,f as SIZING_TARGETS,i as alignText,h as alignTimeline,k as aspectOf,l as blankingForAspect,m as blankingQc,n as blankingText,c as inputFitRatio,g as offlineLane,d as resolveProps,b as scalingOf,e as underRef};
@@ -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 T}from"./chunk-2MJAQROY.js";import{c as D}from"./chunk-ZVUKOFUX.js";import{M as A,P,W as N,Z as q}from"./chunk-DFDXSIMI.js";import"./chunk-NQNS4Y2B.js";import{k as M}from"./chunk-7QUSVHO2.js";import"./chunk-PFZVET7S.js";import"./chunk-JHTMYXJM.js";import"./chunk-YUO3UWPH.js";import"./chunk-JV7TZDKJ.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WJ5EWXP2.js";import"./chunk-C2ESM27Z.js";import"./chunk-XDI6CPPV.js";import"./chunk-DGXZB7MO.js";import"./chunk-JXTRQ3UG.js";import{b as F}from"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-XJNWAQON.js";import"./chunk-CJYLQ3UM.js";import"./chunk-PHAMF4JF.js";import{H as x,I as E,W as U,X as R,Z as k,m as O,q as S}from"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";var y=s=>{let i=s?.target_url??s?.local_path??"";return i.startsWith("file://")?O(i):i};async function H(s,i){let o=await V(s,i);return await I(s,o.session,i),o}async function I(s,i,o){let r=await s.liveMarkers(o).catch(()=>null);if(!r)return;let l=i.timelines,e=l.find(m=>m.kind!=="compound")??l[0];if(!e)return;let t=(m,f,a,p)=>({id:`live-${p??"tl"}-${m}`,time:{value:m},duration:{value:Math.max(1,f)},color:a.color,name:a.name,note:a.note,...p?{item_id:p}:{}}),n=r.timeline.map(m=>t(m.frame,m.duration,m)),c=e.tracks.filter(m=>m.kind==="Video");for(let m of r.clips){let f=c[m.track-1]?.items.find(a=>a.timeline_range?.start?.value===m.start);if(f)for(let a of m.markers)n.push(t(a.frame,a.duration,a,f.id))}e.markers=n}async function V(s,i){let o=await s.items({timeline:i,kind:"video"}),r=o.items.map(f=>`${f.kind}:${f.track}:${f.start}:${f.end-f.start}`),l=async f=>{let a=await D(f,o.timeline).catch(()=>null);if(!a||!r.every(d=>a.has(d)))return null;let{session:p}=await P(f,"prproj"),u=p.timelines.find(d=>d.name===o.timeline);return u?z(p,u):null};if(o.project_path){let f=await l(o.project_path);if(f)return await C(f),{session:f,from:"the saved project (matches the live sequence)",path:o.project_path};let a=k(R(o.project_path),"Adobe Premiere Pro Auto-Save"),p=U(o.project_path).replace(/\.prproj$/i,""),u=[];try{for await(let d of E(a))d.isFile&&d.name.startsWith(`${p}--`)&&d.name.endsWith(".prproj")&&u.push({path:k(a,d.name),mtime:(await S(k(a,d.name))).mtime?.getTime()??0})}catch{}for(let d of u.sort((g,_)=>_.mtime-g.mtime).slice(0,3)){let g=await l(d.path);if(g&&await C(g),g)return{session:g,from:`Premiere's auto-save of ${new Date(d.mtime).toLocaleTimeString()} (matches the live sequence; the project itself is not saved)`,path:d.path}}}let e=k(await x("conform-ppro-"),"live.otio"),t=await s.export({timeline:i,out_path:e}),{session:n}=await P(t.path,t.format);if(await W(s,n),await Z(n),typeof o.drop_frame=="boolean")for(let f of n.timelines)f.is_drop_frame=o.drop_frame;await C(n);for(let f of n.timelines)for(let a of f.tracks)for(let p of a.items){let u=p;u.scale=null,u.position_x=null,u.position_y=null,u.rotation=null}let c=await s.model(i).then(f=>f.items.filter(a=>Object.keys(a.sizing??{}).length).map(a=>`${a.name??a.file_path.split("/").pop()} (V${a.track} @${a.start-f.start_frame})`)).catch(()=>[]),m=`Premiere's OTIO export carries the cut, not the clips' Motion / Opacity / effects / retimes${c.length?` \u2014 ${c.length} clip(s) here have Motion that will not carry: ${c.slice(0,6).join(", ")}${c.length>6?"\u2026":""}`:""}; save the project (or wait for its auto-save) and run it again for every one of them`;return{session:n,from:"Premiere's OTIO export of the live sequence (no saved or auto-saved copy matches it yet)",path:t.path,lossy:m}}async function C(s){let i=new Set;for(let r of s.media_references??[]){if(r.binding_state==="linked")continue;let l=y(r);l&&await S(l).then(e=>e.isFile,()=>!1)&&i.add(R(l))}let o=s;for(let r of i){let l=await T(o,{media_root:r,gather:"path",criteria:{file_name:!0,file_name_mode:"tight"},lane:"both",reset:!1,dry_run:!1,compare:!1,cap:2e3,remember:!1}).catch(()=>null);l?.changed&&(o=l.session)}return o!==s&&Object.assign(s,o),(s.media_references??[]).filter(r=>r.binding_state==="linked").length}async function Z(s){let i=0;for(let o of s.media_references??[]){if(o.source_resolution_w)continue;let r=y(o),l=r?await M(r).catch(()=>null):null;if(!l)continue;let e=l;for(let t of["source_resolution_w","source_resolution_h","source_pixel_aspect","codec","container","streams"])e[t]!=null&&o[t]==null&&(o[t]=e[t]);o.source_fps??=e.source_fps??null,o.source_timecode??=e.source_timecode??null,!o.available_range&&e.available_range&&(o.available_range=e.available_range),i++}return i}async function re(s,i){let o=i.timelines.filter(t=>t.offline_reference?.clip_id);if(!o.length)return 0;let r=t=>[...t?.clip_list??[],...(t?.folders??[]).flatMap(r)],l=new Map(r((await s.project({clips:!0})).pool).map(t=>[t.id,t])),e=0;for(let t of o){let n=l.get(t.offline_reference.clip_id);if(n?.file){let c=i.media_references.find(m=>y(m)===n.file);c||(c={id:`offline-ref-${t.id??e}`,kind:"external",name:n.name,target_url:`file://${n.file}`,local_path:n.file},i.media_references.push(c)),t.offline_reference.media_reference_id=c.id,e++}else if(n&&n.name!==t.name&&(n.type==="Timeline"||/compound/i.test(n.type??""))){let{createSession:c}=await import("./store-SZKXADGI.js"),m=k(await x("conform-offline-ref-"),`${n.name.replace(/[^\w.-]+/g,"_")}.drt`),f=await s.export(n.type==="Timeline"?{timeline:n.name,out_path:m}:{clip_id:n.id,out_path:m}),{session:a}=await P(f.path,"drt");a=(await A(a))?.session??a,t.offline_reference.session_id=(await c(a,f.path,"drt")).id,e++}else t.offline_reference=null}return e}async function W(s,i){let o=(await s.projectClips()).clips,r=new Map(o.filter(e=>e.start_frame!=null&&e.fps).map(e=>[e.file,e])),l=0;for(let e of i.media_references??[]){if(e.source_timecode)continue;let t=r.get(y(e));if(t){e.source_timecode=F(t.start_frame,t.fps),e.source_fps??=t.fps,l++;continue}let n=y(e),c=n?await M(n).catch(()=>null):null;c?.source_timecode&&(e.source_timecode=c.source_timecode,e.source_fps??=c.source_fps??null,l++)}return l}function z(s,i){let o=new Map(s.timelines.map(l=>[l.id,l])),r=[i];for(let l=0;l<r.length;l++)for(let e of r[l].tracks)for(let t of e.items){let n=t.nested_timeline_id,c=n?o.get(n):void 0;c&&!r.includes(c)&&r.push(c)}return{...s,timelines:r}}function X(s,i){let o=new Map((s.media_references??[]).map(n=>[n.id,y(n)])),r=[];for(let n of i.media_references??[]){let c=o.get(n.id),m=y(n);c!==void 0&&m&&m!==c&&r.push({ref_id:n.id,old:c,new:m})}let l=new Map(r.map(n=>[n.ref_id,n])),e=[],t=i.timelines.find(n=>n.kind==="primary")??i.timelines[0];for(let n of t?.tracks??[])if(n.kind==="Video")for(let c of n.items){let m=c.media_reference_id?l.get(c.media_reference_id):void 0;!m||c.kind!=="clip"||!c.source_range||e.push({track:n.track_index,start:c.timeline_range.start.value,duration:c.timeline_range.duration.value,src_in:c.source_range.start.value,path:m.new,name:c.name??""})}return{media:r,cuts:e}}async function oe(s,i){let{session:o,from:r,lossy:l}=await H(s,i.timeline),e=await T(structuredClone(o),{media_root:i.media_root,gather:"walk",reset:!0,lane:"video",dry_run:!1,cap:2e3,criteria:i.criteria??(i.mode==="cut_in"?{file_name:!1,reel_name:!0}:{file_name:!0,file_name_mode:"loose"}),tolerances:i.tolerances}),{media:t,cuts:n}=X(o,e.session),c=[`read from ${r}`,...l&&i.mode==="new_version"?[`\u26A0 ${l}`]:[],`matched ${t.length} medi${t.length===1?"um":"a"} under ${i.media_root} (${n.length} clip use${n.length===1?"":"s"} in the sequence)`],m=t.map(u=>` ${u.old.split("/").pop()} \u2192 ${u.new}`);if(i.dry_run||!t.length)return{text:[...c,...m,i.dry_run?"(dry run \u2014 nothing changed in Premiere)":"",e.text.split(`
4
- `).slice(-6).join(`
5
- `)].filter(Boolean).join(`
6
- `),data:{media:t,cuts:n,from:r}};if(i.mode==="replace"||i.mode==="hires"||i.mode==="proxy"){let d=(await s.projectClips()).clips.flatMap(w=>t.filter(j=>j.old===w.file).map(j=>({clip:w.id,path:j.new,mode:i.mode}))),g=i.mode==="replace"?L(o,e.session,t):new Map,_=g.size?await Y(s,new Set(g.keys())):[],b=await s.relinkClips(d),h=b.results.filter(w=>w.ok).length,$=[...c,`${i.mode==="hires"?"attached full-res behind":i.mode==="proxy"?"attached as proxies to":"repointed"} ${h}/${d.length} project clip(s)${i.mode==="proxy"?" (Toggle Proxies in Premiere switches)":""}`,...m,...b.results.filter(w=>!w.ok).map(w=>` refused: ${w.detail??"Premiere refused"}`)],v=_.length?await B(s,_,g):null;return v&&$.push(...v.lines),{text:$.join(`
7
- `),data:{media:t,results:b.results,undo_relink:b.undo,...v?{refit:v.data}:{},from:r}}}if(i.mode==="cut_in"){let u=await s.items({timeline:i.timeline,kind:"video"}),d=Math.max(0,...u.items.map(h=>h.track)),g=i.track??d+1,_=await s.cutIn(i.timeline,n.map(h=>({path:h.path,track:g,start:h.start,src_in:h.src_in,duration:h.duration,copy_from:{track:h.track,start:h.start}}))),b=_.results.filter(h=>h.ok).length;return{text:[...c,`cut in ${b}/${n.length} on V${g} (video only, the originals untouched underneath; Edit > Undo ${_.undo_steps}\xD7 in Premiere takes the cuts${_.undo_steps>1?" and the carried sizing":""} back; each return clip keeps its in/out marks)`,...n.map((h,$)=>` V${h.track} @${h.start} ${h.name} \u2192 ${h.path.split("/").pop()} src ${h.src_in}${_.results[$]?.ok?"":` REFUSED: ${_.results[$]?.detail??""}`}`)].join(`
8
- `),data:{media:t,cuts:n,results:_.results,track:g,from:r}}}let f=e.session.timelines.find(u=>u.kind==="primary")??e.session.timelines[0];f&&(f.name=i.name??`${f.name}_CONFORMED`);let a=await q(e.session,"premiere-prproj",k(await x("conform-ppro-"),"/"),""),p=await s.open({path:a.path});return{text:[...c,`new sequence "${p.timeline}" in ${p.project} (the open sequence is untouched)`,...m,...p.notes,...a.issues.slice(0,10).map(u=>` note: ${u.message}`)].join(`
9
- `),data:{media:t,path:a.path,sequence:p.timeline,issues:a.issues,from:r}}}function L(s,i,o){let r=new Map,l=(e,t)=>(e.media_references??[]).find(n=>n.id===t);for(let e of o){let t=l(s,e.ref_id),n=l(i,e.ref_id),c=t?.source_resolution_w,m=t?.source_resolution_h,f=n?.source_resolution_w,a=n?.source_resolution_h;!c||!m||!f||!a||c===f||Math.abs(c/m-f/a)>.01||r.set(e.old,c/f)}return r}async function Y(s,i){let o=[];for(let r of(await s.current()).timelines){let l=await s.model(r).catch(()=>null);for(let e of l?.items??[])i.has(e.file_path)&&o.push({sequence:r,track:e.track,start:e.start-l.start_frame,file:e.file_path,zx:e.sizing.ZoomX??1,zy:e.sizing.ZoomY??e.sizing.ZoomX??1,keyframed:!!e.sizing_keyframed})}return o}async function B(s,i,o){let r=[],l={},e=new Map;for(let t of i)(e.get(t.sequence)??e.set(t.sequence,[]).get(t.sequence)).push(t);for(let[t,n]of e){let c=n.filter(a=>a.keyframed),m=n.filter(a=>!a.keyframed).map(a=>{let p=o.get(a.file);return{op:"properties",item:{kind:"video",track:a.track,start:a.start},set:{ZoomX:+(a.zx*p).toFixed(6),ZoomY:+(a.zy*p).toFixed(6)}}}),f=m.length?await s.apply({timeline:t,ops:m}):null;l[t]={rescaled:f?.applied??0,keyframed:c.length,undo:f?.undo??[]},r.push(` "${t}": ${f?.applied??0}/${m.length} use(s) rescaled to keep their framing on the new raster (one Edit > Undo)${c.length?`; ${c.length} with keyframed scale left as they are \u2014 check them`:""}`)}return{lines:["framing kept through the raster change (Premiere's Scale is a percent of the media's pixels):",...r],data:l}}async function G(s){let i=new Set;for(let e of s.timelines)for(let t of e.tracks)for(let n of t.items)n.is_adjustment&&(i.add(n.id),n.is_adjustment=!1);let o=s.timelines.flatMap(e=>e.tracks.flatMap(t=>t.items)).filter(e=>e.kind==="nested").length,r=await A(s);if(!r)throw new Error("un-nesting needs the conform.tools engine on this machine");for(let e of r.session.timelines)for(let t of e.tracks)for(let n of t.items)i.has(n.id)&&(n.is_adjustment=!0);let l=s.timelines[0]?.id;return Object.assign(s,r.session),s.timelines=s.timelines.filter(e=>e.id===l),{summary:`un-nested ${o} nest${o===1?"":"s"}`,issues:r.issues}}async function ae(s,i){let{session:o,from:r,lossy:l}=await H(s,i.timeline),e=await J(o,i.ops,i.name),t=await q(e.session,"premiere-prproj",k(await x("conform-ppro-"),"/"),""),n=await s.open({path:t.path}),c=[...e.issues,...t.issues.map(m=>m.message)];return{text:[`read from ${r}`,...l?[`\u26A0 ${l}`]:[],...e.lines,`new sequence "${n.timeline}" in ${n.project} (the open sequence is untouched)`,...c.slice(0,12).map(m=>` note: ${m}`),...c.length>12?[` \u2026and ${c.length-12} more notes`]:[]].join(`
10
- `),data:{sequence:n.timeline,path:t.path,notes:c,from:r}}}async function J(s,i,o){let r=[],l=[],e=()=>s.timelines[0];for(let n of i){if(n.kind==="unnest"){let a=await G(s);r.push(a.summary),l.push(...a.issues);continue}let c=new Set(s.timelines.map(a=>a.id)),m=N(s,n.kind,{timeline_id:e()?.id,...n.args??{}});r.push(m.summary);let f=s.timelines.find(a=>!c.has(a.id)&&a.kind!=="compound");f&&(s.timelines=z(s,f).timelines)}let t=e();if(!t)throw new Error("nothing to write: the operations left no timeline");return t.name=o??(i.length===1?`${t.name}_${i[0].kind.toUpperCase()}`:`${t.name}_EDIT`),{session:z(s,t),lines:r,issues:l}}export{C as bindAtRecordedPaths,X as changes,J as editSession,ae as hostEdit,oe as hostRelink,H as premiereSession,Z as probeRefs,L as rasterRatios,I as withLiveMarkers,z as withNests,re as withOfflineReference,W as withPremiereTimecodes};
@@ -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{f as a,g as b,h as c,i as d,j as e}from"./chunk-E5ENIKNR.js";import"./chunk-ZVUKOFUX.js";import"./chunk-56EEBHP2.js";import"./chunk-DFDXSIMI.js";import"./chunk-NQNS4Y2B.js";import"./chunk-7QUSVHO2.js";import"./chunk-PFZVET7S.js";import"./chunk-JHTMYXJM.js";import"./chunk-YUO3UWPH.js";import"./chunk-JV7TZDKJ.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WJ5EWXP2.js";import"./chunk-C2ESM27Z.js";import"./chunk-XDI6CPPV.js";import"./chunk-DGXZB7MO.js";import"./chunk-JXTRQ3UG.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-XJNWAQON.js";import"./chunk-CJYLQ3UM.js";import"./chunk-PHAMF4JF.js";import"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";export{a as AVID_SETUP,b as FLAME_SETUP,c as NUKE_SETUP,e as adapter,d as setAdapter};
package/dist/i2o-transfer DELETED
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 as a,B as b,C as c,D as d,E as e,F as f}from"./chunk-GM262EDM.js";import"./chunk-XJNWAQON.js";import"./chunk-CJYLQ3UM.js";import"./chunk-PHAMF4JF.js";import"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";export{a as createSession,f as getExtra,b as getSession,d as listSessions,e as saveExtra,c as updateSession};
@@ -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{$ as o,N as a,O as b,P as c,Q as d,R as e,S as f,T as g,U as h,V as i,W as j,X as k,Y as l,Z as m,_ as n,aa as p,ba as q,ca as r}from"./chunk-DFDXSIMI.js";import"./chunk-NQNS4Y2B.js";import"./chunk-7QUSVHO2.js";import"./chunk-PFZVET7S.js";import"./chunk-YUO3UWPH.js";import"./chunk-JV7TZDKJ.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-DKGGJM6Z.js";import"./chunk-WJ5EWXP2.js";import"./chunk-C2ESM27Z.js";import"./chunk-XDI6CPPV.js";import"./chunk-DGXZB7MO.js";import"./chunk-JXTRQ3UG.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-XJNWAQON.js";import"./chunk-CJYLQ3UM.js";import"./chunk-PHAMF4JF.js";import"./chunk-DNS4ZYIO.js";import"./chunk-PSANHDZM.js";export{i as OPERATION_KINDS,a as READ_FORMATS,j as applyOperation,k as applyOperationWithSources,q as consolidate,g as countFlags,b as detectFormat,r as judge,p as linkText,e as listClips,h as listFlags,f as listMedia,c as readTimeline,l as resolveTarget,o as routesText,d as summarize,n as writeDestination,m as writeTimeline};
File without changes