conformtools 0.6.16 → 0.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/account-O3J732QJ.js +3 -0
- package/dist/{agent-hook-setup-JCIZG3Q3.js → agent-hook-setup-HBT2LTVR.js} +1 -1
- package/dist/{analysis-engine-DCHJHZ7W.js → analysis-engine-BZUEBW55.js} +1 -1
- package/dist/{arriraw-YIJ3BYNN.js → arriraw-PS6V532Y.js} +7 -7
- package/dist/bridge-25FGN67G.js +3 -0
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-XDI6CPPV.js → chunk-2DEUYEQD.js} +1 -1
- package/dist/chunk-2GRXBIJB.js +3 -0
- package/dist/{chunk-RJD44NQU.js → chunk-2V5PY4P5.js} +2 -2
- package/dist/{chunk-JL454FFL.js → chunk-34JO3JNC.js} +2 -2
- package/dist/chunk-3DYCTUSQ.js +3 -0
- package/dist/chunk-3PVQ5QP4.js +3 -0
- package/dist/chunk-567IWIX6.js +3 -0
- package/dist/{chunk-MGMDNGNX.js → chunk-6B3IELRW.js} +2 -2
- package/dist/{chunk-5W57ITT2.js → chunk-AAJRTGEP.js} +2 -2
- package/dist/{chunk-UAURERD3.js → chunk-ANQZKVDD.js} +1 -1
- package/dist/chunk-ATEWMIY5.js +3 -0
- package/dist/{chunk-QRZO5GOI.js → chunk-AYUKWSCR.js} +1 -1
- package/dist/{chunk-RGMTLNMF.js → chunk-BBCQMZQN.js} +1 -1
- package/dist/{chunk-XVZ7KJRI.js → chunk-DIW5X4GI.js} +1 -1
- package/dist/{chunk-WJ5EWXP2.js → chunk-EWW5KWAO.js} +1 -1
- package/dist/chunk-GTPTZRO6.js +3 -0
- package/dist/{chunk-LVGGCRDW.js → chunk-IDEKLW7C.js} +1 -1
- package/dist/{chunk-DPA26AOI.js → chunk-L2RTMZCN.js} +1 -1
- package/dist/chunk-LP2MR4ZH.js +516 -0
- package/dist/chunk-LUKA7UUJ.js +3 -0
- package/dist/{chunk-HOACOBAY.js → chunk-MHBNMYZP.js} +3 -3
- package/dist/{chunk-4RA57LTJ.js → chunk-ND2YUUUH.js} +1 -1
- package/dist/{chunk-VETHR2O7.js → chunk-NN444GPH.js} +1 -1
- package/dist/chunk-OSUIS4JU.js +3 -0
- package/dist/chunk-PIM3PV5N.js +3 -0
- package/dist/{chunk-VWFEMXYZ.js → chunk-QBQJDV2F.js} +103 -101
- package/dist/chunk-RXRBRR3E.js +10 -0
- package/dist/chunk-S5AOIOTT.js +3 -0
- package/dist/{chunk-FLLB6UZJ.js → chunk-T7S2UBNN.js} +1 -1
- package/dist/{chunk-UKXSKFL3.js → chunk-TD3ZHREE.js} +1 -1
- package/dist/chunk-UIX3TT72.js +7 -0
- package/dist/{chunk-6V4OEOOX.js → chunk-VFXMP7IF.js} +1 -1
- package/dist/{claude-setup-CM7G2YSG.js → claude-setup-W27DLJIO.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{cr3-wasm-NYCB34ND.js → cr3-wasm-DIWL7CPH.js} +1 -1
- package/dist/{demo-engine-CBFAAPPO.js → demo-engine-JAQPM4EV.js} +1 -1
- package/dist/dng-wasm-PE463PG2.js +3 -0
- package/dist/dpx-wasm-DKE3LJ6Z.js +3 -0
- package/dist/{engine-6YYXTF2Q.js → engine-ZGBF3SQN.js} +2 -2
- package/dist/exr-wasm-HAFH3YA5.js +3 -0
- package/dist/framing-PGFJZIBU.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-MAUVJTR4.js → h264-YX5KP63E.js} +1 -1
- package/dist/{h264-mxf-2O4SAUTA.js → h264-mxf-VAHIJCA7.js} +1 -1
- package/dist/hook.js +2 -2
- package/dist/{host-relink-NVLUO73P.js → host-relink-M2VWUZW5.js} +1 -1
- package/dist/hosted-4CNQYNX5.js +3 -0
- package/dist/hosts-R4BHIZJS.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-YIFLNOJW.js → inspect-7XEE32P5.js} +18 -18
- package/dist/isobmff-RHP3N5K2.js +3 -0
- package/dist/{mc-video-HRZC7HGH.js → mc-video-CHBOYPI5.js} +1 -1
- package/dist/mcp.js +8 -8
- package/dist/media-4VUWQJLQ.js +3 -0
- package/dist/{media_core_bg-FDL7GJZP.js → media_core_bg-ZMRCKALR.js} +1 -1
- package/dist/mxf-R2ONKSYU.js +3 -0
- package/dist/{ops-XIUVNJE2.js → ops-MKDFWWPG.js} +1 -1
- package/dist/{probe-GIAKRPFV.js → probe-YDOFGCGD.js} +1 -1
- package/dist/{r3d-I6EYEYX7.js → r3d-EKISZSKU.js} +5 -5
- package/dist/r3d-F4OWLQE2.js +3 -0
- package/dist/sequence-patch-2S7IPE52.js +3 -0
- package/dist/{source-QGWWLMME.js → source-L2JNTYS6.js} +1 -1
- package/dist/{still-4UR35GZH.js → still-IDLCMQRD.js} +1 -1
- package/dist/{still-wasm-RTPOMH7S.js → still-wasm-54HEDTRX.js} +1 -1
- package/dist/{store-MWNX47IK.js → store-A5AKWOSX.js} +1 -1
- package/dist/tiff-wasm-O7XUGXIO.js +3 -0
- package/dist/timeline-ZHDJXDZJ.js +3 -0
- package/dist/{wav-HSCUCY4U.js → wav-OLA3QYFJ.js} +1 -1
- package/package.json +5 -5
- package/dist/account-W7Z2MYZU.js +0 -3
- package/dist/bridge-UPSJ7F3S.js +0 -3
- package/dist/chunk-DKGGJM6Z.js +0 -3
- package/dist/chunk-DLF5AKXT.js +0 -10
- package/dist/chunk-EEDLRRKU.js +0 -3
- package/dist/chunk-IDJIOKXA.js +0 -3
- package/dist/chunk-ISKNIQVO.js +0 -3
- package/dist/chunk-JKOB3U54.js +0 -3
- package/dist/chunk-JM5LHKTU.js +0 -510
- package/dist/chunk-OWWXUNJF.js +0 -7
- package/dist/chunk-PFZVET7S.js +0 -3
- package/dist/chunk-QH5DTYSE.js +0 -3
- package/dist/chunk-RVZQ3Y6N.js +0 -3
- package/dist/chunk-X527E5VI.js +0 -3
- package/dist/chunk-YUO3UWPH.js +0 -3
- package/dist/dng-wasm-XCPPBXPZ.js +0 -3
- package/dist/dpx-wasm-XACWNFPB.js +0 -3
- package/dist/exr-wasm-FQBUR6QT.js +0 -3
- package/dist/framing-QYRCUEB5.js +0 -3
- package/dist/hosted-2XACQY7J.js +0 -3
- package/dist/hosts-GEXAZFB3.js +0 -3
- package/dist/isobmff-MTMGQKLK.js +0 -3
- package/dist/media-WC4ZVKIL.js +0 -3
- package/dist/mxf-J5QHA3VY.js +0 -3
- package/dist/r3d-2PCOFR2Z.js +0 -3
- package/dist/sequence-patch-DFGEAJGB.js +0 -3
- package/dist/tiff-wasm-N2S267IA.js +0 -3
- package/dist/timeline-Z3KD2CJX.js +0 -3
- /package/dist/{chunk-D6YDLKSA.js → chunk-LMRPCWHV.js} +0 -0
- /package/dist/{media_core_bg-XRBVKQZH.js → media_core_bg-57CDWER6.js} +0 -0
- /package/dist/{prores-RIG37OIH.js → prores-CFX64NME.js} +0 -0
- /package/dist/{timeline_core_bg-JW42YM3G.js → timeline_core_bg-5COJCLPG.js} +0 -0
- /package/dist/{udf_bg-B37GKRIH.js → udf_bg-HOHEKAVF.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as R}from"./chunk-3PVQ5QP4.js";import{b as be,c as ge,f as we}from"./chunk-VFXMP7IF.js";import{f as V,h as pe}from"./chunk-2DEUYEQD.js";import{a as he}from"./chunk-TD3ZHREE.js";import{i as D}from"./chunk-ND2YUUUH.js";import{b as M,d as z,f as F}from"./chunk-NU3X7P4N.js";import{Ha as fe,ea as ae,fa as ce,ja as le,oa as ue,wa as me,xa as de}from"./chunk-L2RTMZCN.js";import{a as ie}from"./chunk-ROGMKTND.js";import{$ as y,B as L,G as J,M as $,N as C,O as oe,R as se,_ as b,aa as K,b as E,ba as _,c as q,d as ee,g as re,k as te,l as H,s as B,t as j,v as ne,w as A,z as W}from"./chunk-GTPTZRO6.js";var X=!1,O=8,Ce=0,De=3,N=2;async function ze(e){let t=new Uint8Array(await e.slice(0,16).arrayBuffer()),o=i=>String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);if(t[0]===6&&t[1]===14&&t[2]===43&&t[3]===52)return"mxf";if(o(4)==="RED1"||o(4)==="RED2")return"r3d";let r=t[0]<<24|t[1]<<16|t[2]<<8|t[3],s=o(4);return/^[A-Za-z0-9 ]{4}$/.test(s)&&(r>=8||r===1)&&r<=e.size?"isobmff":null}function Ne(e){let t=e.toLowerCase();return t.endsWith(".braw")?"braw":t.endsWith(".crm")?"crm":"mov"}function Te(e){return async(t,o)=>new Uint8Array(await e.slice(t,Math.min(t+o,e.size)).arrayBuffer())}function _e(e){let t=e.timecode;return!t||!t.fps_denominator?null:t.fps_numerator/t.fps_denominator}async function sr(e){return await fe(),ye?ye.clip(e,X?"rec709":"",()=>xe(e)):xe(e)}var ye=null;async function xe(e){let t=await ze(e),o=[];if(t==="r3d"){let r=e,s=r.parts&&r.bases?r.parts:[{name:e.name,size:e.size}],n=r.bases??[0],i=async(m,l,d)=>{let f=n[m]+l;return new Uint8Array(await e.slice(f,Math.min(f+d,n[m]+s[m].size)).arrayBuffer())},c=JSON.stringify(s.map(m=>({name:m.name,size:m.size}))),a=JSON.parse(await de(i,c)),u=JSON.parse(await le(i,c));return s.length===1&&/_\d{3}\.r3d$/i.test(e.name)&&!/_001\.r3d$/i.test(e.name)&&o.push("spanned R3D part \u2014 only this part's frames are indexed"),{frames:u.map(m=>({offset:n[m.part??0]+m.essenceOffset,size:m.essenceLength})),w:a.width??0,h:a.height??0,fps:_e(a),startFrame:a.timecode?.start_frame??0,dropFrame:a.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:Ce},geometrySpec:{codec:"r3d",subbands:De},index:null,warnings:o}}if(t==="mxf"){let r=Te(e),s=JSON.parse(await me(r,e.size));if(!s)throw new Error(`${e.name}: MXF index unreadable`);let n=JSON.parse(await ue(r,e.size)),i=[];for(let f=0;f<n.frame_count;f++)i.push({offset:n.frames[f*2],size:n.frames[f*2+1]});let c=i.filter(f=>f.size===0).length;c&&o.push(`${c} frame(s) had no locatable picture KLV`);let a=s.width??0,u=s.height??0,m=(s.inner_codec??"").toLowerCase(),l=null,d="MXF";return m==="arriraw"?(l={codec:"arriraw",w:a,h:u,scale:O},d="ARRIRAW"):m==="xocn"?(l={codec:"xocn",scale:O,...X?{display:"rec709"}:{}},d="X-OCN"):await ce(r,e.size)?(l={codec:"vc3",scale:O},d="DNxHR"):await ae(r,e.size)?(l={codec:"prores"},d="ProRes"):o.push(`MXF inner codec ${m||"unknown"} not wired to the fingerprint pool`),{frames:l?i:[],w:a,h:u,fps:_e(s),startFrame:s.timecode?.start_frame??0,dropFrame:s.timecode?.drop_frame??!1,label:d,spec:l,geometrySpec:l&&l.codec==="arriraw"?{...l,scale:N}:l&&l.codec==="xocn"?{codec:"xocn",scale:N,...X?{display:"rec709"}:{}}:l&&l.codec==="vc3"?{codec:"vc3",scale:N}:null,index:null,warnings:o}}if(t==="isobmff"){let r=await pe(e),s=Ne(e.name);if(r.kind==="prores")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:V(r.kind),spec:{codec:"prores"},geometrySpec:null,index:r,warnings:o};if(r.kind==="h264"||r.kind==="hevc")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:V(r.kind),spec:null,geometrySpec:null,index:r,warnings:o};let n=s==="braw"?{codec:"braw",scale:O}:r.codec==="aprh"||r.codec==="aprn"?{codec:"proresraw",scale:O}:null;return n||o.push(`codec ${r.codec} not wired to the fingerprint pool`),{frames:n?r.offs:[],w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:n?s==="braw"?"BRAW":"ProRes RAW":`unsupported (${r.codec})`,spec:n,geometrySpec:n?{...n,scale:N}:null,index:r,warnings:o}}throw new Error(`${e.name}: unrecognised container`)}var G=null;var ke=Number(E("CONFORM_DECODERS")??0)||Math.max(2,Math.min(Math.floor(ee()/2),Math.floor(q()/2**31))),Y=0,$e=[],Se=async(...e)=>{Y>=ke?await new Promise(t=>$e.push(t)):Y++;try{return await se(...e)}finally{let t=$e.shift();t?t():Y--}};async function Re(){let e=re()==="win32"?"conformtools-decode.exe":"conformtools-decode",t=[E("CONFORM_NATIVE_DECODE"),te(e),B(new URL(`./${e}`,import.meta.url)),B(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let o of t)if(await ne(o))return o;return null}var v=class extends Error{constructor(o,r){super(r);this.why=o}};function Fr(e){let t=null;try{t=JSON.parse(e.trim().split(`
|
|
4
|
+
`).pop())}catch{}if(t?.why==="not_entitled")throw new ie("not_entitled",t.detail??"this machine is not licensed");return t?.detail??e.trim()}function Me(e,t){try{let o=JSON.parse(e.trim().split(`
|
|
5
|
+
`).pop()??"");return new v(o.why,o.detail)}catch{return new v("decoder",`the native decoder exited ${t}: ${e.trim().slice(-300)}`)}}function Or(e){return G?.owns(e)?G.meta(`probe|${e}`,()=>ve(e)):ve(e)}async function ve(e){let t=await Re();if(!t)throw new v("missing",H("the native decoder (conformtools-decode)"));let o=[],r=await Se(t,["probe",e],s=>o.push(s));if(r.code!==0)throw Me(r.stderr,r.code);return JSON.parse(new TextDecoder().decode(Fe(o)))}function Fe(e){let t=e.reduce((s,n)=>s+n.length,0),o=new Uint8Array(t),r=0;for(let s of e)o.set(s,r),r+=s.length;return o}async function Ue(e,t,o,r,s){let n=await Re();if(!n)throw new v("missing",H("the native decoder (conformtools-decode)"));let i=null,c=[],a=0,u=d=>{let f=new Uint8Array(d),h=0;for(;h<d;){let p=c[0],g=Math.min(p.length,d-h);f.set(p.subarray(0,g),h),h+=g,g===p.length?c.shift():c[0]=p.subarray(g)}return a-=d,f},m=[e,t,"--width",String(s.width??32768)];s.from!=null&&m.push("--from",String(s.from)),s.count!=null&&m.push("--count",String(s.count)),s.range&&m.push("--range",s.range);let l=await Se(n,m,d=>{if(c.push(d),a+=d.length,!i){let h=Fe(c.splice(0));c.push(h);let p=h.indexOf(10);if(p<0)return;i=JSON.parse(new TextDecoder().decode(h.subarray(0,p))),u(p+1),o(i)}let f=4+i.w*i.h*(i.bpp??(e==="rgb16"?6:4));for(;a>=f;){let h=u(f);r(new DataView(h.buffer).getUint32(0,!0),h.subarray(4))}},{signal:s.signal});if(l.code!==0||!i)throw Me(l.stderr,l.code)}function Oe(e,t,o,r={}){return Ue("bgra",e,t,o,r)}var Ie=["none","rle","zips","zip","piz","pxr24","b44","b44a","dwaa","dwab","htj2k"],T=e=>(e>>4)*10+(e&15);function He(e){let t=T(e&63),o=T(e>>>8&127),r=T(e>>>16&127),s=T(e>>>24&63),n=i=>String(i).padStart(2,"0");return`${n(s)}:${n(r)}:${n(o)}${e&64?";":":"}${n(t)}`}function Be(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||t.getUint32(0,!0)!==20000630)return null;let o={fps:null,timecode:null,width:0,height:0,display:null,compression:null,attributes:[]},r=8,s=()=>{let i=r;for(;r<e.length&&e[r]!==0;)r++;let c=new TextDecoder().decode(e.subarray(i,r));return r++,c},n=i=>({width:t.getInt32(i+8,!0)-t.getInt32(i,!0)+1,height:t.getInt32(i+12,!0)-t.getInt32(i+4,!0)+1});for(;r<e.length;){let i=s();if(!i)break;let c=s();if(r+4>e.length)return null;let a=t.getInt32(r,!0);if(r+=4,a<0||r+a>e.length)return null;if(o.attributes.push(`${i}:${c}`),i==="framesPerSecond"&&c==="rational"&&a>=8){let u=t.getInt32(r,!0),m=t.getUint32(r+4,!0);o.fps=m?u/m:null}else i==="timeCode"&&c==="timecode"&&a>=8?o.timecode=He(t.getUint32(r,!0)):i==="dataWindow"&&c==="box2i"&&a>=16?{width:o.width,height:o.height}=n(r):i==="displayWindow"&&c==="box2i"&&a>=16?o.display=n(r):i==="compression"&&a>=1&&(o.compression=Ie[e[r]]??`type ${e[r]}`);r+=a}return o}async function je(e){let t=e,o=null,r=/^(.*?)\[(\d+)-(\d+)\](.*)$/.exec(b(e));if(await A(e))o=/^(.*?)(\d+)(\.exr)$/i;else{t=y(e);let n=r?[null,r[1],r[2],r[4]]:/^(.*?)(\d+)(\.exr)$/i.exec(b(e));if(!n)return{frames:[e],numbers:[]};let i=c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=new RegExp(`^${i(n[1])}(\\d{${n[2].length}})${i(n[3])}$`,"i")}let s=[];for await(let n of $(t)){let i=n.isFile?o.exec(n.name):null;i&&s.push({n:Number(i[i.length===4?2:1]),f:_(t,n.name)})}return s.sort((n,i)=>n.n-i.n),{frames:s.map(n=>n.f),numbers:s.map(n=>n.n)}}async function Pe(e){let t=await je(e),o=t.frames[0];if(!o)throw new Error(`no .exr frames for '${b(e)}'`);let r=await C(o),s;try{s=Be(await r.readAt(0,Math.min(r.size,1<<20)))}finally{await r.close()}if(!s)throw new Error(`'${b(o)}' is not an OpenEXR file`);let n=Math.max(1,t.frames.length),i=t.numbers.length>1?t.numbers[t.numbers.length-1]-t.numbers[0]+1-t.numbers.length:0,c=s.fps??0;return{id:b(o),kind:"external",target_url:o,local_path:o,content_kind:n>1?"video":"still",source_fps:s.fps??void 0,source_timecode:s.timecode??void 0,source_resolution_w:s.width,source_resolution_h:s.height,available_range:{start:{value:0,rate:c},duration:{value:n,rate:c}},streams:[{kind:"video",codec:"exr",width:s.width,height:s.height,rate:s.fps??void 0,codec_specific:{compression:s.compression}}],vendor_metadata:{exr:{frames:n,first_frame:t.numbers[0]??null,last_frame:t.numbers[t.numbers.length-1]??null,missing_frames:i,display_window:s.display,attributes:s.attributes,fps_source:s.fps!=null?"header framesPerSecond":"not in the header",timecode_source:s.timecode?"header timeCode (first frame)":"not in the header"}}}}var Z=new Set([".mov",".mp4",".m4v",".mxf",".wav",".braw",".crm",".r3d",".aif",".aiff"]);async function We(e){let t=await C(e);return{path:e,file:t,size:t.size}}function Le(e){return(t,o)=>e.file.readAt(t,o)}async function Je(e){let t=R(b(e));if(!t)return[e];let o=y(e),r=[];for await(let s of $(o)){if(!s.isFile)continue;let n=R(s.name);n&&n.clipBase===t.clipBase&&r.push({n:n.partNumber,p:_(o,s.name)})}return r.sort((s,n)=>s.n-n.n).map(s=>s.p)}async function Q(e){if(await A(e)){let n=[];for await(let i of $(e))i.isFile&&R(i.name)&&n.push(_(e,i.name));if(!n.length)throw new Error(`'${b(e)}' is a folder with no .R3D parts`);e=n.sort()[0]}let t=ge(b(e));if(!t)throw new Error(`unsupported media file '${b(e)}' (supported: ${[...Z].join(" ")})`);let o=await Je(e),r=await Promise.all(o.map(We));return{source:we(t,r.map(n=>be(b(n.path),{fileSize:n.size,read:Le(n)}))),parts:r,format:t,anchor:o[0],close:()=>r.forEach(n=>n.file.close())}}async function Hr(e,t,o,r){if(!/h264|avc|hevc|h265/.test(o)){let s=null,n=await Q(e);try{return await D(n.source,{verb:"decode",index:t,intent:"park"})}catch(i){s=i}finally{n.close()}try{return await Ee(e,t,r)}catch(i){throw/no decoder/.test(String(s))?i:s instanceof Error?s:new Error(String(s))}}return Ee(e,t,r)}async function Ee(e,t,o){t=Math.round(t);let r=0,s=0,n=null;if(await Oe(e,c=>{r=c.w,s=c.h},(c,a)=>{c===t&&(n=a)},{from:t,count:1,width:o}),!n)throw new Error(`the OS decoder returned no frame ${t} of ${b(e)}`);let i=n;for(let c=0;c<i.length;c+=4){let a=i[c];i[c]=i[c+2],i[c+2]=a}return{rgba:i,width:r,height:s}}async function P(e){if(/\.exr$/i.test(e))return Pe(e);let t=await Q(e);try{let o=await D(t.source,{verb:"inspect"});if(!o)throw new Error(`could not read '${b(e)}' as ${t.format}`);return o.target_url=t.anchor,o.local_path=t.anchor,o.id=o.id||b(t.anchor),t.parts.length>1&&((o.vendor_metadata??={}).spanned_parts=t.parts.map(r=>b(r.path))),o.size_bytes=t.parts.reduce((r,s)=>r+s.size,0),o}finally{t.close()}}function Ke(e,t,o,r){let s=Math.abs(r*1001-Math.round(r*1001/1e3)*1e3)<1?Math.round(r)*1e3/1001:r,n=Math.floor(e*s/t+1e-6);return{tc:M(n,r),frames:Math.round(o*s/t)}}var Ve=e=>String(Math.round(e*1e3)/1e3);function Br(e,t){let o=e.streams?.find(l=>l.kind==="video"),r=e.streams?.filter(l=>l.kind==="audio")??[],s=e.vendor_metadata?.bext;if(!o&&e.available_range&&r[0]?.rate){let l=r[0].rate,d=e.available_range.duration.value,h=(t?[t]:[24e3/1001,24]).map(p=>{let g=Ke(s?.time_reference??0,s?.sample_rate||l,d,p);return`${s?`start TC ${g.tc}, `:""}${g.frames} frames @ ${Ve(p)} fps`});return[e.target_url??"",`audio only; ${d} samples (${(d/l).toFixed(3)} s)${s?`; BWF time_reference ${s.time_reference}`:"; no BWF timecode"}`,...h,...t?[]:["(pass fps for the project's rate)"],...r.map((p,g)=>`audio ${r.length>1?`${g+1}: `:""}${p.codec??"pcm"} ${p.channels??"?"}ch ${p.rate} Hz ${p.bit_depth??"?"}-bit`)].join(`
|
|
6
|
+
`)}let n=e.available_range?.duration?.value??e.declared_duration?.value??null,i=e.source_fps??o?.rate??null,c=e.size_bytes,a=e.vendor_metadata?.spanned_parts,u=o?.codec_specific??{},m=[u.profile?`${u.profile} (${u.fourcc})`:u.fourcc,u.pixel_format,o?.bit_depth?`${o.bit_depth}-bit`:null,u.colr?`color ${u.colr.primaries}/${u.colr.transfer}/${u.colr.matrix} (primaries/transfer/matrix)`:null].filter(Boolean).join(", ");return[e.target_url??"",o?`${o.codec??"?"} ${o.width??"?"}x${o.height??"?"}${i?` @ ${Math.round(i*1e3)/1e3} fps`:""}${m?`; ${m}`:""}`:"no video track",`start TC ${e.source_timecode??"none"}; ${n!=null?`${n} frames`:"length unknown"}${n!=null&&i?` (${(n/i).toFixed(2)} s)`:""}`,r.length?r.map((l,d)=>{let f=l.codec_specific?.channel_layout;return`audio ${r.length>1?`${d+1}: `:""}${l.codec??"pcm"} ${l.channels??"?"}ch${f?` (${f})`:""} ${l.rate??"?"} Hz ${l.bit_depth??"?"}-bit`}).join(`
|
|
7
|
+
`):"no audio",`${e.reel_name?`reel ${e.reel_name}; `:""}${c!=null?`${(c/1e6).toFixed(1)} MB`:""}${a?`; spanned ${a.length} parts`:""}`].join(`
|
|
8
|
+
`)}var Xe=8*1024*1024,k=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));async function Ge(e,t,o){if(e.executable_locally===!1)throw new Error("this trim plan is server-side only");let r=new Map(t.parts.map(n=>[b(n.path),n]));await L(y(o));let s=await oe(o);try{await s.truncate(e.total_size),await s.writeAt(0,k(e.dest_header_bytes_base64));for(let n of e.src_byte_ranges){let i=n.src_file_name?r.get(b(n.src_file_name)):t.parts[0];if(!i)throw new Error(`plan references unknown source part '${n.src_file_name}'`);let c=0;for(;c<n.length;){let a=Math.min(Xe,n.length-c),u=await i.file.readAt(n.offset+c,a);if(u.length<a)throw new Error(`short read in ${b(i.path)} at ${n.offset+c}`);await s.writeAt(n.write_to_dest_offset+c,u),c+=a}}e.dest_footer_bytes_base64&&e.dest_footer_offset!=null&&await s.writeAt(e.dest_footer_offset,k(e.dest_footer_bytes_base64));for(let n of e.dest_patches??[])await s.writeAt(n.offset,k(n.bytes_base64))}finally{await s.close()}for(let n of e.dest_sidecar_writes??[])await W(_(y(o),n.name),k(n.bytes_base64))}function Ye(e,t){let o=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let s=r.source_range.start.value,n=r.source_range.duration.value,i=Math.max(0,Math.floor(s)-t),c=Math.floor(s+n-1)+t;c>=i&&o.push({first_frame:i,last_frame:c})}return he(o)}async function Ze(e,t,o,r,s){let n=await Q(e);try{let i=Ye(t,o);if(!i.length)throw new Error("no usable frame ranges (items need kind=clip with source_range)");let c=await D(n.source,{verb:"trim",selection:{items:t,handles:o}}),a=K(n.anchor),u=n.format==="r3d",m=u?R(b(n.anchor))?.clipBase??b(n.anchor,a):b(n.anchor,a),l=[];for(let[d,f]of c.entries()){let h=f.output_clip_number??(i.length>1?d+1:void 0),p=i[(h??1)-1]??i[0],g=h&&(f.output_clip_count??i.length)>1?`_S${String(h).padStart(3,"0")}`:"",w;if(u){let x=f.output_part_number??d+1;w=_(r,`${m}${g}.RDC`,`${m}_${String(x).padStart(3,"0")}.R3D`),l.push({path:w,bytes:f.total_size,island:p,part:x,clip:h})}else{let x=s&&c.length===1?s:`${m}${g||`_trim_${p.first_frame}-${p.last_frame}`}${a}`;w=_(r,x),l.push({path:w,bytes:f.total_size,island:p,clip:h})}await Ge(f,n,w)}return u||await Qe(e,l,!!s&&c.length===1),{outputs:l,islands:i,format:n.format}}finally{n.close()}}async function Qe(e,t,o){let r=await P(e).catch(()=>null),s=r?.source_fps??r?.streams?.find(n=>n.kind==="video")?.rate??null;if(!(!r?.source_timecode||!s))for(let n of t){if(!n.island)continue;let i=await P(n.path).catch(()=>null),c=i?.available_range?.duration?.value??i?.declared_duration?.value;if(!i?.source_timecode||!c)continue;let a=F(i.source_timecode,s,r.source_timecode);if(a===n.island.first_frame&&a+c-1===n.island.last_frame||(n.island={first_frame:a,last_frame:a+c-1},o))continue;let u=n.path.replace(/_trim_\d+-\d+(\.[^./\\]+)$/,`_trim_${a}-${a+c-1}$1`);u!==n.path&&(await J(n.path,u),n.path=u)}}async function jr(e){let t=await P(e.path),o=t.source_fps??t.streams?.find(g=>g.kind==="video")?.rate??null,r=t.available_range?.duration?.value??t.declared_duration?.value??null;if(!o)throw new Error("cannot trim: no frame rate / timecode track on this file");let s=F(e.in,o,t.source_timecode??null),n=F(e.out,o,t.source_timecode??null);e.out_exclusive&&(n-=1);let i=t.source_timecode??"00:00:00:00",c=r!=null?M((z(i,o)??0)+r-1,o,!!t.vendor_metadata?.drop_frame):null;if(n<s)throw new Error(`out ${e.out} is before in ${e.in}`);if(s<0)throw new Error(`in ${e.in} is before the file starts (${i}, frame 0)`);if(r!=null&&n>r-1)throw new Error(`out ${e.out} is past the end of the file (last frame ${c}, frame ${r-1})`);let a={id:"trim",kind:"clip",source_range:{start:{value:s,rate:o},duration:{value:n-s+1,rate:o}}},u=y(e.path),m;if(e.out_path)try{(await j(e.out_path)).isDirectory?u=e.out_path:(u=y(e.out_path),m=b(e.out_path))}catch{u=y(e.out_path),m=b(e.out_path)}let l=await Ze(e.path,[a],Math.max(0,Math.floor(e.handles??0)),u,m),d=l.islands[0],f=l.outputs.length===1&&l.outputs[0].island?l.outputs[0].island:d,h=f.first_frame,p=f.last_frame;return{outputs:l.outputs,first_frame:h,last_frame:p,frames:p-h+1,fps:o,facts:t,...h!==d.first_frame||p!==d.last_frame?{asked:{first_frame:d.first_frame,last_frame:d.last_frame}}:{}}}function Ae(e){let t=[...Z].map(o=>o.slice(1)).join("|");return e.toLowerCase().replace(new RegExp(`\\.(${t})(?=[._\\s-]|$)`,"g"),"").replace(/[^a-z0-9]/g,"")}function qe(e,t){let o=Ae(e),r=Ae(t);if(r&&o.includes(r))return"name";let s=t.toLowerCase().split(/[^a-z0-9]+/).filter(n=>/\d/.test(n)&&n.length>=3);return s.length&&s.every(n=>o.includes(n))?"id":null}async function Wr(e,t,o){let r=[],s=0,n=null,i=Date.now()+o.time_limit_s*1e3,c=async(a,u)=>{try{for await(let m of $(a)){if(n&&!n.startsWith("folders"))return;if(++s>o.max_entries){n=`stopped after ${o.max_entries} entries (max_entries)`;return}if(Date.now()>i){n=`stopped after ${o.time_limit_s} s (time_limit_s)`;return}if(m.name.startsWith("."))continue;let l=_(a,m.name);if(m.isDirectory)u<o.max_depth?await c(l,u+1):n??=`folders deeper than max_depth=${o.max_depth} not searched (e.g. ${l})`;else if(m.isFile&&Z.has(K(m.name).toLowerCase())){let d=qe(m.name,t);d&&r.push({path:l,match:d,size:(await j(l).catch(()=>({size:0}))).size})}}}catch{}};if(await c(e,0),o.probe)for(let a=0;a<r.length;a+=8)await Promise.all(r.slice(a,a+8).map(async u=>{try{u.facts=await P(u.path)}catch(m){u.error=m.message}}));return r.sort((a,u)=>a.path.localeCompare(u.path)),{hits:r,scanned:s,truncated:n}}function er(e){let t=e.streams?.find(c=>c.kind==="video"),o=e.source_fps??t?.rate??null,r=e.available_range?.duration?.value??e.declared_duration?.value??null,s=t?.codec_specific??{},n=e.source_timecode&&o?z(e.source_timecode,o):null,i=n!=null&&r!=null&&o?M((n+r)%(Math.round(o)*86400),o,e.source_timecode.includes(";")):null;return`${t?`${t.codec??"?"}${s.profile?` ${s.profile}`:""} ${t.width??"?"}x${t.height??"?"}`:"no video"}${o?` @ ${Math.round(o*1e3)/1e3} fps`:""}; TC ${e.source_timecode??"none"}${i?`\u2013${i}`:""}; ${r??"?"} fr${r!=null&&o?` (${(r/o).toFixed(2)} s)`:""}`}function Lr(e,t,o,r){let s=e.hits.slice(0,r),n=[];e.truncated&&n.push(`TRUNCATED: ${e.truncated} \u2014 the search did NOT cover all of ${t}; the matches below may be incomplete.`),e.hits.length>s.length&&n.push(`TRUNCATED: showing ${s.length} of ${e.hits.length} matches. Pass limit=${e.hits.length} or narrow the query.`),n.push(`${e.hits.length} file${e.hits.length===1?"":"s"} match "${o}" under ${t} (${e.scanned} entries scanned)`);let i=new Map;for(let a of e.hits)i.set(b(a.path).toLowerCase(),(i.get(b(a.path).toLowerCase())??0)+1);let c=[...i].filter(([,a])=>a>1);c.length&&n.push(`same name in several folders: ${c.map(([a,u])=>`${a} \xD7${u}`).join(", ")} \u2014 they can be DIFFERENT clips; match by TC + duration, never by name alone`);for(let a of s)n.push(`- ${a.path}${a.match==="id"?" (id match)":""}
|
|
9
|
+
${a.facts?er(a.facts):a.error?`probe failed: ${a.error}`:`${(a.size/1e6).toFixed(1)} MB`}`);return n.join(`
|
|
10
|
+
`)}async function Jr(e,t,o=0){let r=await P(e),s=r.source_fps??r.streams?.find(d=>d.kind==="video")?.rate??null,n=r.available_range?.duration?.value??r.declared_duration?.value??null;if(!s||n==null)throw new Error(`cannot check coverage: ${b(e)} has no frame rate or length`);let i=Math.round(s)*86400,c=r.source_timecode?z(r.source_timecode,s)??0:0,a=!!r.source_timecode?.includes(";"),u=d=>{let f=F(d,s,r.source_timecode??null);return typeof d=="number"||/^\d+$/.test(d.trim())?f:f<-i/2?f+i:f>i/2?f-i:f},m=d=>M(((c+d)%i+i)%i,s,a),l=t.map((d,f)=>{let h=u(d.in),p=u(d.out),g=h,w=n-p,x=g>=0&&w>=0&&p>h,U=Math.max(0,-g),I=Math.max(0,-w),S=[];return p<=h?S.push("out is not after in"):x?S.push(`covered; handles head ${g} / tail ${w} fr`):S.push(`NOT covered: short ${[U?`${U} fr at head`:"",I?`${I} fr at tail`:""].filter(Boolean).join(", ")}`),x&&o&&(g<o||w<o)&&S.push(`handles short of ${o}: ${[g<o?`head by ${o-g}`:"",w<o?`tail by ${o-w}`:""].filter(Boolean).join(", ")}`),{label:d.label??`range ${f+1}`,in_tc:m(h),out_tc:m(p),frames:p-h,covered:x,head:g,tail:w,short_head:U,short_tail:I,note:S.join("; ")}});return{facts:r,rows:l}}export{sr as a,Re as b,Fr as c,Or as d,Oe as e,je as f,Z as g,Je as h,Q as i,Hr as j,P as k,Ke as l,Br as m,Ye as n,Ze as o,jr as p,Ae as q,qe as r,Wr as s,er as t,Lr as u,Jr as v};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as F}from"./chunk-ROGMKTND.js";import{A as S,B as m,D as v,F as x,G as g,H as D,M as $,ba as a,n as _,t as b,u as p}from"./chunk-GTPTZRO6.js";var R="_originalframes",y="zAPPLIED_PATCHES",u=t=>t.replace(/[\\/][^\\/]+[\\/]?$/,""),k=()=>a(_(),"move-undo");async function P(t){let n=[];for await(let o of $(t))o.isFile&&!o.name.startsWith(".")&&n.push(o.name);return n.sort()}async function T(t){let n=[];for await(let o of $(u(t)))o.isDirectory&&/patch/i.test(o.name)&&o.name!==y&&n.push(o.name);return n.sort()}async function A(t,n){let o=new Set(await P(t)),e=[];for(let r of n){let s=a(u(t),r);if(await p(s))for(let w of await P(s))e.push({file:w,folder:r,replaces:o.has(w)})}return e}async function j(t,n,o){if(!await p(t)||!(await b(t)).isDirectory)throw new F("invalid_args",`not a folder: ${t}`);let e=u(t),r=[],s=[];for(let i of await A(t,n)){if(o&&!o.has(`${i.folder}/${i.file}`))continue;if(!i.replaces){r.push(`${i.file}: not in the sequence`);continue}let f=a(t,i.file),c=a(e,i.folder,i.file),l=`${t}${R}`,h=a(l,i.file);for(let d=1;await p(h);d++)h=a(`${t}${R}${String(d).padStart(2,"0")}`,i.file);await m(u(h));try{await g(f,h)}catch(d){r.push(`${i.file}: ${d.message}`);continue}try{await x(c,f)}catch(d){await g(h,f).catch(()=>{}),r.push(`${i.file}: ${d.message}`);continue}s.push({file:i.file,backup:h,patch_src:c,applied:c,folder:i.folder}),l=""}let w=[];if(s.length){let i=a(e,y);await m(i);for(let f of new Set(s.map(c=>c.folder))){let c=a(i,f);for(let l=1;await p(c);l++)c=a(i,`${f}_${l}`);try{await g(a(e,f),c),w.push({from:a(e,f),to:c});for(let l of s)l.folder===f&&(l.applied=a(c,l.file))}catch(l){r.push(`${f}: not filed under ${y} (${l.message})`)}}}if(!s.length)return{patched:0,errors:r};let E=`files-${Date.now().toString(36)}`;return await m(k()),await S(a(k(),`${E}.json`),JSON.stringify({patch:!0,sequence:t,entries:s.map(({folder:i,...f})=>f),folders:w})),{patched:s.length,errors:r,undo_id:E}}async function L(t){let n=[];for(let e of t.folders)await p(e.to)&&!await p(e.from)&&await g(e.to,e.from).catch(r=>n.push({path:e.to,error:r.message}));let o=0;for(let e of t.entries){let r=a(t.sequence,e.file);if(await p(e.backup))try{await p(r)&&await v(r),await g(e.backup,r),o++}catch(s){n.push({path:r,error:s.message})}}for(let e of new Set([...t.entries.map(r=>u(r.backup)),...t.folders.map(r=>u(r.to))]))if(await p(e)&&!(await P(e)).length){let r=!0;for await(let s of $(e)){r=!1;break}r&&await D(e).catch(()=>{})}return{restored:o,failed:n}}export{R as a,y as b,T as c,A as d,j as e,L as f};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A,B as w,F as y,a as h,ba as c,n as x,o as k,u,y as C}from"./chunk-
|
|
3
|
+
import{A,B as w,F as y,a as h,ba as c,n as x,o as k,u,y as C}from"./chunk-GTPTZRO6.js";var O=new Set(["ffmpeg","ffprobe","ffplay","sox","soxi","mediainfo","exiftool","mkvmerge","mkvextract","mp4box","bmxtranswrap","raw2rgb","redline","art-cmd","oiiotool","iconvert","idiff","asdcp-wrap","asdcp-unwrap","asdcp-info","opendcp","dcp_inspect","handbrakecli","gst-launch-1.0","mencoder","mplayer","sips","afconvert","avconvert","qtfaststart","mediaconch","bwfmetaedit","x264","x265","aomenc","svtav1encapp","otiotool","otioconvert","otioview","cineform","ale2csv"]),I=["mov","mp4","m4v","mxf","mkv","avi","webm","mts","m2ts","mpg","mpeg","r3d","braw","ari","arx","crm","dng","dpx","exr","wav","aif","aiff","bwf","flac","mp3","aac","m4a","caf"],N=["aaf","avb","edl","drt","otio","fcpxml","fcpxmld","prproj","ptx","ale","xml","csv"],U=new Set(["xml","csv","png","jpg","jpeg","tif","tiff"]),L=new Set([...I,...N,...U]);var m="conformtools-hook",d=o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{},g=o=>!!o&&typeof o=="object"&&typeof o.command=="string"&&o.command.includes(m);function $(o,e,t={}){let n=d(o.hooks),r=Array.isArray(n.PostToolUse)?[...n.PostToolUse]:[],s={type:"command",command:e,timeout:10,...t.async?{async:!0}:{}};for(let i=0;i<r.length;i++){let a=d(r[i]),l=Array.isArray(a.hooks)?a.hooks:[],f=l.findIndex(g);if(f<0)continue;if(JSON.stringify(l[f])===JSON.stringify(s)&&a.matcher==="Bash")return{settings:o,result:"kept"};let b=[...l];return b[f]=s,r[i]={...a,matcher:"Bash",hooks:b},{settings:{...o,hooks:{...n,PostToolUse:r}},result:"updated"}}return{settings:{...o,hooks:{...n,PostToolUse:[...r,{matcher:"Bash",hooks:[s]}]}},result:"installed"}}function S(o){let e=d(o.hooks);if(!Array.isArray(e.PostToolUse))return{settings:o,removed:!1};let t=!1,n=e.PostToolUse.map(i=>{let a=d(i);if(!Array.isArray(a.hooks))return i;let l=a.hooks.filter(f=>!g(f));return l.length!==a.hooks.length&&(t=!0),l.length?{...a,hooks:l}:null}).filter(i=>i!==null);if(!t)return{settings:o,removed:!1};let r={...e};n.length?r.PostToolUse=n:delete r.PostToolUse;let s={...o};return Object.keys(r).length?s.hooks=r:delete s.hooks,{settings:s,removed:!0}}function T(o,e,t){let n=d(o.hooks),r=Array.isArray(n.afterShellExecution)?[...n.afterShellExecution]:[],s={command:e,timeout:10,matcher:t},i=r.findIndex(g);return i>=0&&JSON.stringify(r[i])===JSON.stringify(s)?{settings:o,result:"kept"}:(i>=0?r[i]=s:r.push(s),{settings:{version:1,...o,hooks:{...n,afterShellExecution:r}},result:i>=0?"updated":"installed"})}function P(o){let e=d(o.hooks);if(!Array.isArray(e.afterShellExecution))return{settings:o,removed:!1};let t=e.afterShellExecution.filter(s=>!g(s));if(t.length===e.afterShellExecution.length)return{settings:o,removed:!1};let n={...e};t.length?n.afterShellExecution=t:delete n.afterShellExecution;let r={...o};return Object.keys(n).length?r.hooks=n:delete r.hooks,{settings:r,removed:!0}}function E(){return`\\b(${[...O].map(e=>e.replace(/[.+-]/g,"\\$&")).join("|")})\\b|\\.(${[...L].join("|")})\\b`}function F(o){let e=(o??"").toLowerCase();return e?e.includes("claude-code")||e.includes("claude code")?"claude":e.includes("codex")?"codex":e.includes("cursor")?"cursor":null:null}var J=["claude","codex","cursor"],p=()=>({claude:c(k(),".claude","settings.json"),codex:c(k(),".codex","hooks.json"),cursor:c(k(),".cursor","hooks.json")});async function M(){let o=new URL(import.meta.url),e=h(new URL("./hook.js",o));if(await u(e)){await w(x());let n=c(x(),`${m}.js`);return await y(e,n),`node "${n}"`}let t=h(new URL("../adapters/hook.ts",o));return await u(t)?`deno run --allow-read --allow-write --allow-env --no-check --unstable-sloppy-imports "${t}" ${m}`:null}async function v(o){if(!await u(o))return{};let e=await C(o);try{return e.trim()?JSON.parse(e):{}}catch{return"invalid"}}async function j(o,e){let t;return await u(o)?(t=`${o}.conformtools-backup`,await y(o,t)):await w(c(o,"..")),await A(o,JSON.stringify(e,null,2)+`
|
|
4
4
|
`),t}async function B(o,e={}){let t=e.file??p()[o];try{let n=e.command??await M();if(!n)return{client:o,file:t,result:"skipped",detail:"no hook script beside this build"};let r=await v(t);if(r==="invalid")return{client:o,file:t,result:"failed",detail:`${t} is not valid JSON; nothing was changed`};let s=o==="cursor"?T(r,n,E()):$(r,n,{async:o==="codex"});if(s.result==="kept")return{client:o,file:t,result:"kept"};let i=await j(t,s.settings);return{client:o,file:t,result:s.result,backup:i}}catch(n){return{client:o,file:t,result:"failed",detail:n instanceof Error?n.message:String(n)}}}async function z(o,e={}){let t=e.file??p()[o],n=await v(t);if(n==="invalid")return{client:o,file:t,removed:!1};let r=o==="cursor"?P(n):S(n);if(!r.removed)return{client:o,file:t,removed:!1};let s=await j(t,r.settings);return{client:o,file:t,removed:!0,backup:s}}async function R(){let o=p(),e=[];for(let t of J)await u(c(o[t],".."))&&e.push(t);return e}var Z=async()=>Promise.all((await R()).map(o=>B(o))),G=async()=>Promise.all((await R()).map(o=>z(o)));async function D(o,e=p()[o]){let t=await v(e);return t!=="invalid"&&JSON.stringify(t).includes(m)}var H={claude:"Claude Code",codex:"Codex",cursor:"Cursor"},_="which other programs the agent ran on media or timeline files (program names and file extensions only; never a command, a path, a name, a prompt or an output)";function q(o){return o.length?o.map(e=>{let t=H[e.client],n={installed:`${t}: agent hook installed in ${e.file}${e.backup?` (backup: ${e.backup})`:""}`,updated:`${t}: agent hook refreshed in ${e.file}`,kept:`${t}: agent hook already in ${e.file}`,skipped:`${t}: agent hook not installed (${e.detail})`,failed:`${t}: agent hook not installed: ${e.detail}`}[e.result];return e.client==="codex"&&(e.result==="installed"||e.result==="updated")?`${n}; Codex asks you to trust it once (/hooks)`:n}).concat(`It records ${_}. conformtools hooks off removes it; conformtools telemetry off removes it with the rest.`).join(`
|
|
5
5
|
`):"Agent hook: no Claude Code, Codex or Cursor folder on this machine; nothing to install."}function Q(o){let e=o.filter(t=>t.removed);return e.length?e.map(t=>`${H[t.client]}: agent hook removed from ${t.file}`).join(`
|
|
6
6
|
`):"Agent hook: not installed anywhere on this machine."}async function V(){let o=await R();return o.length?[...await Promise.all(o.map(async t=>`${H[t]}: agent hook ${await D(t)?"on":"off"} (${p()[t]})`)),`It records ${_}. conformtools hooks on|off.`].join(`
|
|
@@ -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-
|
|
3
|
+
import{d as _}from"./chunk-ND2YUUUH.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};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as ee}from"./chunk-NN444GPH.js";import{a as d}from"./chunk-ROGMKTND.js";import{A as I,B as M,C as q,D as S,E as V,M as X,P as Z,T as W,U as Q,b as c,ba as s,g,h as Y,n as p,o as _,u as H,y as f}from"./chunk-GTPTZRO6.js";var _e=["pro","studio","enterprise"],Be=e=>_e.includes((e??"").toLowerCase()),te=["align","reconform","conform-reference"],he={transferGB:2e3},l={payg:{id:"payg",name:"Pay As You Go",includes:{web:!0,mcp:!1,app:!1,studio_tools:!1}},web:{id:"web",name:"Indie",unlisted:!0,includes:{web:!0,mcp:!1,app:!1,studio_tools:!1},allowance:{transferGB:50}},indie:{id:"indie",name:"Pro",popular:!0,includes:{web:!0,mcp:!0,app:!0,studio_tools:!1},allowance:{transferGB:250}},pro:{id:"pro",name:"Studio",includes:{web:!0,mcp:!0,app:!0,studio_tools:!0},allowance:{transferGB:1e3}},studio:{id:"studio",name:"Enterprise",includes:{web:!0,mcp:!0,app:!0,studio_tools:!0},allowance:he}},ne={web:!0,mcp:!0,app:!0,studio_tools:!0};import{createPrivateKey as Je,createPublicKey as we,sign as Ke,verify as ye}from"node:crypto";import{Buffer as h}from"node:buffer";var be="CONFORMTOOLS_LICENSE_V1",ae=/^[0-9A-F]{8}(-[0-9A-F]{8}){3}$/,re=e=>JSON.stringify({dev_mode:e.dev_mode??!1,email:e.email,expires_at:e.expires_at,features:e.features,issued_at:e.issued_at,machine_fingerprint:e.machine_fingerprint,tier:e.tier});function ie(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(a=>a&&!a.startsWith("#")&&!a.startsWith("-----")).join(""),n=JSON.parse(h.from(t,"base64").toString("utf8"));if(n?.magic!==be||!n.payload?.data)throw new Error("not a conform.tools licence");return n.payload}function oe(e,t){let n=h.from(e.signature,"base64"),a=h.from(re(e.data));return n.length!==64?!1:t.some(r=>ye(null,a,we({key:h.concat([h.from("302a300506032b6570032100","hex"),h.from(r)]),format:"der",type:"spki"}),n))}var xe=["cMwVBrEYKMzlG6pC7FF2lNKIoEqGz2xB5yph6clNnTg=","qnheqkkDU09l1oI6h2CFh4uQ97bY/hkTA5niGKH0+X8="],ve=xe.map(e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)));function E(){let e=c("CONFORM_RECORDS_DIR");if(e)return e;let t=_(),n=g()==="darwin"?s(t,"Library/Application Support"):g()==="win32"?c("LOCALAPPDATA")??s(t,"AppData/Local"):c("XDG_DATA_HOME")??s(t,".local/share");return s(n,"conform.tools")}var Se=()=>c("CONFORM_LICENSE_PATH")??s(E(),"license.lic"),N=()=>s(E(),"grant.lic"),ke=null;function $(){return ke??=(async()=>{let e=await ee();if(!e)return[];let t=await Z(e,["machine"],{timeoutMs:15e3}).catch(()=>null);try{return JSON.parse(t?.stdout??"").machines.filter(n=>ae.test(n))}catch{return[]}})()}function Oe(e,t,n=Date.now()){if(!oe(e,ve))return{ok:!1,reason:"invalid licence signature"};let a=Date.parse(e.data.expires_at);return!Number.isFinite(a)||a<n?{ok:!1,reason:`licence expired ${e.data.expires_at}`}:[t??[]].flat().includes(e.data.machine_fingerprint)?{ok:!0,data:e.data}:{ok:!1,reason:"licence is for another machine"}}async function se(){let e;try{e=await f(Se())}catch{return null}try{return Oe(ie(e),await $())}catch(t){return{ok:!1,reason:t.message}}}var Ae={production:{supabaseUrl:"https://sttpwvjbpsetzbhrkohl.supabase.co",anonKey:"sb_publishable_cyuIPsrQa5Ye7lqFxjnknQ_ozDuwwzp",appBase:"https://conform.tools"},staging:{supabaseUrl:"https://slxggvbvgzkiwojcgykx.supabase.co",anonKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNseGdndmJ2Z3praXdvamNneWt4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzEyODUzMTksImV4cCI6MjA4Njg2MTMxOX0.b18iDsWftny0k9VmOCcbN6kLlyZsZ7GULn_jRH9CE9I",appBase:"https://beta.conform.tools"}};function i(){let e=c("CONFORM_ENV")==="staging"?"staging":"production",t=Ae[e];return{env:e,supabaseUrl:c("CONFORM_SUPABASE_URL")??t.supabaseUrl,anonKey:c("CONFORM_SUPABASE_ANON_KEY")??t.anonKey,appBase:c("CONFORM_APP_BASE")??t.appBase}}var Pe=600*1e3,ce=72*3600*1e3,Le=300*1e3,y=()=>s(p(),i().env==="production"?"auth.json":`auth-${i().env}.json`);async function b(){for(let e of new Set([y(),s(p(),"auth.json")]))try{let t=JSON.parse(await f(e));if(t.env===i().env&&t.access_token)return t}catch{}return await Ee()}var Ie=()=>{let e=g()==="win32"?c("APPDATA")??s(_(),"AppData","Roaming"):g()==="darwin"?s(_(),"Library","Application Support"):c("XDG_CONFIG_HOME")??s(_(),".config");return s(e,"conform-tools","kv-store.json")};async function Ee(){let e=Ie();try{let t=JSON.parse(await f(e)),n=JSON.parse(t["ct-supabase-auth"]??"null");if(!n?.access_token||!n.refresh_token)return null;let a=n.access_token.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");if(JSON.parse(atob(a+"=".repeat(-a.length&3))).iss!==`${i().supabaseUrl}/auth/v1`)return null;let o={env:i().env,access_token:n.access_token,refresh_token:n.refresh_token,expires_at:n.expires_at??0};return await D(o),delete t["ct-supabase-auth"],await I(e,JSON.stringify(t)),o}catch{return null}}async function Ne(){try{for await(let e of X(p())){if(!/^auth(?:-(\w+))?\.json$/.exec(e.name))continue;let n=JSON.parse(await f(s(p(),e.name)));if(n.access_token&&n.env&&n.env!==i().env)return{other_env:n.env}}}catch{}return{}}async function D(e){await M(p()),await I(y(),JSON.stringify(e)),await V(y(),384)}var j=6e3,A=0,B=()=>Date.now()<A,ue=()=>{A=Date.now()+6e4};function nt(){A=0}var pe=e=>e.expires_at-60>Date.now()/1e3;async function R(e){let t=await b();return t&&t.refresh_token!==e.refresh_token&&Object.assign(e,t),pe(e)}async function G(e){if(pe(e))return e.access_token;if(B())return null;if(await R(e))return e.access_token;let t=await q(`${y()}.lock`);try{if(await R(e))return e.access_token;let n=i(),a=await fetch(`${n.supabaseUrl}/auth/v1/token?grant_type=refresh_token`,{method:"POST",headers:{apikey:n.anonKey,"content-type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token}),signal:AbortSignal.timeout(j)}).catch(o=>{throw ue(),o});if(!a.ok)return a.status!==400&&a.status!==401?null:await R(e)?e.access_token:"";let r=await a.json();return e.access_token=r.access_token,r.refresh_token&&(e.refresh_token=r.refresh_token),e.expires_at=r.expires_at??Math.floor(Date.now()/1e3)+(r.expires_in??3600),await D(e),e.access_token}catch{return null}finally{await t()}}async function at(){return(await b().catch(()=>null))?.last_entitlement?.model_key??null}async function rt(){let e=await b();return e&&await G(e)||null}var w=null;function le(e,t){return{signed_in:!0,entitled:e.entitled,env:i().env,email:e.email,access:e.access,tier:e.tier,trial_days_remaining:e.trial_days_remaining,source:t,...e.entitled?{}:{reason:"not_entitled"},...e.invite_only?{invite_only:!0}:{}}}async function fe(e={}){let t=await se();if(t?.ok)return{signed_in:!!await b().catch(()=>null),entitled:!0,env:i().env,email:t.data.email,access:"licence",tier:t.data.tier,source:"licence"};let n=await $e(e);return t&&!n.entitled?{...n,licence_error:t.reason}:n}async function $e(e){if(!e.force&&w&&Date.now()-w.at<Pe)return{...w.status,source:"cache"};let t=i(),n=await b();if(!n)return{signed_in:!1,entitled:!1,env:t.env,reason:"not_signed_in",...await Ne()};let a=await G(n);if(a==="")return{signed_in:!0,entitled:!1,env:t.env,reason:"auth_rejected"};if(a&&!B())try{let r=(await $())[0],o=await fetch(`${t.supabaseUrl}/functions/v1/v1-billing/v1/billing/entitlement${r?`?machine=${r}`:""}`,{headers:{authorization:`Bearer ${a}`,apikey:t.anonKey},signal:AbortSignal.timeout(j)}).catch(u=>{throw ue(),u});if(o.status===401||o.status===403)return{signed_in:!0,entitled:!1,env:t.env,reason:"auth_rejected"};if(o.ok){let{grant:u,...P}=(await o.json()).data;r&&await De(u),n.last_entitlement=P,n.last_entitlement_at=Date.now(),await D(n);let L=le(P,"live");return w={at:Date.now(),status:L},L}}catch{}if(n.last_entitlement&&n.last_entitlement_at&&Date.now()-n.last_entitlement_at<ce){let r=ce-(Date.now()-n.last_entitlement_at);return{...le(n.last_entitlement,"grace"),grace_remaining_h:Math.round(r/36e4)/10}}return{signed_in:!0,entitled:!1,env:t.env,reason:"offline_grace_expired"}}async function De(e){try{if(!e)return await S(N());await M(E()),await I(N(),e)}catch{}}function Te(e){return e.source==="licence"?`${e.email} \xB7 machine licence (${e.tier}) \u2014 runs offline, no account check`:Ce(e)+(e.licence_error?`
|
|
4
|
+
(the machine licence was not used: ${e.licence_error})`:"")}function Ce(e){let t=i();if(!e.signed_in)return`not signed in (${t.env})${e.other_env?`; you are signed in to ${e.other_env} only (each server keeps its own sign-in)`:""}. Run the account_login tool, or \`npx -y conformtools@latest login\` in a terminal.`;if(e.reason==="auth_rejected")return"signed-in session was rejected (expired or revoked) \u2014 sign in again with account_login.";if(e.reason==="offline_grace_expired")return"offline for more than 72 h since the last account check \u2014 reconnect and run account_status.";let n=`${e.email??"(unknown email)"} \xB7 ${t.env}`;if(!e.entitled&&e.invite_only)return`${n}
|
|
5
|
+
the conform.tools engine (the MCP and the app) is invite-only for now, and ${e.email??"this account"} is not on the list. If that is the wrong Google account, run account_logout, then account_login with the invited one.`;if(!e.entitled)return`${n}
|
|
6
|
+
no active plan on ${e.email??"this account"}: the MCP is in the ${l.indie.name} plan and up. If that is the wrong Google account, run account_logout, then account_login and pick the account with the plan; otherwise choose a plan at ${t.appBase}/pricing, then run account_status.`;let a=e.access==="trial"?`trial, ${e.trial_days_remaining??"?"} day(s) left`:e.access==="allowlist"?"invited (early access)":`subscribed${e.tier?` (${F(e.tier)})`:""}`,r=T(e),o=r?` \xB7 includes ${[r.web&&"the web tools",r.mcp&&"the MCP",r.app&&"the app"].filter(Boolean).join(", ")||"the web tools"}`:"";return`${n}
|
|
7
|
+
${a}${o}${e.source==="grace"?` \u2014 offline, using the last check (${e.grace_remaining_h} h of grace left)`:""}`}function F(e){return l[e.toLowerCase()]?.name??e}function T(e){if(e.access==="trial")return ne;let t=(e.tier??"").toLowerCase();return(t==="enterprise"?l.studio:l[t])?.includes??null}var de=()=>fe();function it(e){de=e}async function me(){let e=await de();if(e.entitled)return e;let t=e.signed_in&&e.reason==="not_entitled"?"not_entitled":"not_signed_in";throw new d(t,Te(e),{account:e})}async function ot(){let e=await me();if(e.source==="licence"||T(e)?.mcp!==!1)return e;throw new d("not_entitled",`The conform.tools MCP is in the ${l.indie.name} plan and up. ${e.access==="trial"?"Your trial":`Your plan${e.tier?` (${F(e.tier)})`:""}`} includes Timeline Exchange and Conform Connect on ${i().appBase}, but not the engine on this machine. Upgrade at ${i().appBase}/pricing, then run account_status.`,{account:e,needs:"mcp"})}async function Ue(){let e=await me();if(e.source==="licence")return e;if(!T(e)?.app)throw new d("not_entitled",`The conform.tools app is in the ${l.indie.name} plan and up. ${e.access==="trial"?"Your trial":`Your plan${e.tier?` (${F(e.tier)})`:""}`} does not include the app. Upgrade at ${i().appBase}/pricing, then reopen the app.`,{account:e,needs:"app"});let t=await Re();if(t)throw new d("seat_in_use",`This seat is in use on ${t}. Each seat runs the app on one computer at a time: quit the app there (or sign out), or wait 15 minutes after it last ran, then reopen it here.`,{account:e,needs:"seat",in_use_by:t});return e}async function st(e){if(!te.includes(e))return;let t=await Ue();if(!(t.source==="licence"||T(t)?.studio_tools!==!1))throw new d("not_entitled",`This tool is in the ${l.pro.name} plan. Upgrade at ${i().appBase}/pricing.`,{account:t,needs:"studio_tools"})}var Me=240*1e3,O=null;async function Re(){if(O&&Date.now()-O.at<Me)return O.busy;let e=await ge("POST").catch(()=>null);return O={at:Date.now(),busy:e},e}async function ge(e){let t=i(),n=await b(),a=(await $())[0],r=n&&await G(n);if(!r||!a||B())return null;let o=await fetch(`${t.supabaseUrl}/functions/v1/v1-billing/v1/billing/seat`,{method:e,headers:{authorization:`Bearer ${r}`,apikey:t.anonKey,"content-type":"application/json"},body:JSON.stringify({machine:a,name:Y()}),signal:AbortSignal.timeout(j)});return o.status===409?(await o.json()).in_use_by??"another computer":null}var k=null;function ct(e={}){if(k)return k;let t=i(),n=crypto.randomUUID().replaceAll("-","");return k=new Promise((a,r)=>{let o=!1,u=x=>{o||(o=!0,clearTimeout(L),setTimeout(()=>P.close(),250),k=null,x())},P=Q({hostname:"127.0.0.1",port:0,onListen:async x=>{let v=`${t.appBase}/plugin-auth?client=engine&port=${x}&state=${n}`,m=await W(v);e.onUrl?.(v,m)}},async x=>{let v=new URL(x.url);if(v.pathname!=="/callback")return new Response("not found",{status:404});let m=v.searchParams,J=m.get("access_token")??"",K=m.get("refresh_token")??"",C=!!J&&!!K&&m.get("state")===n;if(C){let z=Number(m.get("expires_at"));await D({env:t.env,access_token:J,refresh_token:K,expires_at:z>0?z:Math.floor(Date.now()/1e3)+3600}),w=null,A=0,fe({force:!0}).then(U=>u(()=>a(U)),U=>u(()=>r(U)))}return new Response(je(C),{status:C?200:400,headers:{"content-type":"text/html; charset=utf-8"}})}),L=setTimeout(()=>u(()=>r(new d("not_signed_in","sign-in was not completed within 5 minutes"))),e.timeoutMs??Le)}),k}async function lt(){await ge("DELETE").catch(()=>{}),O=null,w=null,A=0,await H(y())&&await S(y()),await S(N()).catch(()=>{});let e=s(p(),"auth.json");try{JSON.parse(await f(e)).env===i().env&&await S(e)}catch{}}function je(e){let[t,n]=e?["Connected","You're signed in \u2014 you can close this tab."]:["Sign-in failed","Please try again."];return`<!doctype html><meta charset=utf-8><title>conform.tools</title><body style='font:16px -apple-system,Helvetica,Arial,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7;color:#1d1d1f'><div style='text-align:center'><div style='font-size:22px;font-weight:700'>conform<span style='color:#ff3c00'>.tools</span></div><div style='margin-top:14px;font-size:20px;font-weight:600'>${t}</div><div style='margin-top:6px;color:#6e6e73'>${n}</div></div></body>`}export{Be as a,l as b,i as c,Ie as d,j as e,nt as f,at as g,rt as h,fe as i,Te as j,T as k,it as l,me as m,ot as n,Ue as o,st as p,ct as q,lt as r};
|
|
@@ -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{b as i}from"./chunk-
|
|
3
|
+
import{b as i}from"./chunk-BBCQMZQN.js";function m(r){return{filename:r.name,fileSize:r.size,async read(e,t){let n=Math.min(e+t,r.size),a;for(let o=0;o<4;o++)try{return new Uint8Array(await r.slice(e,n).arrayBuffer())}catch(s){a=s,await new Promise(l=>setTimeout(l,25*(o+1)))}throw a}}}function f(r,e){return{filename:r,fileSize:e.fileSize,read:(t,n)=>e.read(t,n)}}function u(r){return i(r)?.flavor??null}function d(r){let e=u(r.name);if(!e)throw new Error(`sourceFromFile: unrecognized media format for '${r.name}'`);return{parts:[m(r)],format:e}}function F(r){if(r.length===0)throw new Error("sourceFromFiles: no parts");let e=u(r[0].name);if(!e)throw new Error(`sourceFromFiles: unrecognized media format for '${r[0].name}'`);return{parts:r.map(m),format:e}}function p(r,e){if(e.length===0)throw new Error("sourceFromParts: no parts");return{parts:e,format:r}}export{m as a,f as b,u as c,d,F as e,p as f};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A as m,B as w,F as p,P as k,a as C,ba as u,n as y,o as v,u as c,y as b}from"./chunk-
|
|
3
|
+
import{A as m,B as w,F as p,P as k,a as C,ba as u,n as y,o as v,u as c,y as b}from"./chunk-GTPTZRO6.js";import"./chunk-PSANHDZM.js";var S="conformtools-statusline";function O(e,n){let t=e.statusLine;return t&&!String(t.command??"").includes(S)?{settings:e,result:"kept"}:t?.command===n?{settings:e,result:"updated"}:{settings:{...e,statusLine:{type:"command",command:n,padding:0}},result:t?"updated":"installed"}}async function _(){let e=new URL(import.meta.url),n=C(new URL("./statusline.js",e));if(await c(n)){await w(y());let s=u(y(),`${S}.js`);return await p(n,s),`node "${s}"`}let t=C(new URL("../adapters/statusline.ts",e));return await c(t)?`deno run --allow-read --allow-env --no-check "${t}" ${S}`:null}function A(e,n){let t=e.permissions&&typeof e.permissions=="object"?e.permissions:{},s=Array.isArray(t.allow)?t.allow.filter(o=>typeof o=="string"):[];return s.includes(n)?{settings:e,added:!1}:{settings:{...e,permissions:{...t,allow:[...s,n]}},added:!0}}async function T(e={}){let n=e.server??"conformtools",t=`mcp__${n}`,s=e.settingsPath??u(v(),".claude","settings.json"),o={};if(await c(s)){let r=await b(s);try{o=r.trim()?JSON.parse(r):{}}catch(d){throw new Error(`${s} is not valid JSON (${d instanceof Error?d.message:d}); fix it first, nothing was changed`)}}let a=A(o,t),i=a.settings,l="skipped",f=a.added,P=e.statusline===!1?null:await _();if(P){let r=O(i,P);i=r.settings,l=r.result}let x;(f||l==="installed"||l==="updated"&&i!==a.settings)&&(await c(s)?(x=`${s}.conformtools-backup`,await p(s,x)):await w(u(s,"..")),await m(s,JSON.stringify(i,null,2)+`
|
|
4
4
|
`));let g="skipped",$;if(e.register!==!1)try{let r=await k("claude",["mcp","get",n]),d=r.code===0&&r.stdout.includes("conformtools@latest")&&!r.stdout.includes("--prefer-online");if(r.code===0&&!d)g="already";else{d&&await k("claude",["mcp","remove","-s","user",n]);let h=await k("claude",["mcp","add","-s","user",n,"--","npx",...R]);g=h.code===0?d?"updated":"added":"failed",h.code!==0&&($=h.stderr.trim().slice(-300))}}catch(r){g="failed",$=`claude CLI not found (${r instanceof Error?r.message:r}); add the server with: claude mcp add -s user ${n} -- npx ${R.join(" ")}`}return{settings:s,rule:t,added:f,backup:x,registered:g,detail:$,statusline:l}}function U(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); every new session runs the newest version",updated:"MCP server: registered again so every new session runs the newest version (it was set up to keep a cached copy)",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
5
|
`)}var R=["-y","--prefer-online","conformtools@latest","mcp"],L='args = ["-y", "conformtools@latest", "mcp"]',j=e=>`[mcp_servers.${e}]
|
|
6
6
|
command = "npx"
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{
|
|
3
|
+
import{k as G,l as V,o as Y,p as B}from"./chunk-LP2MR4ZH.js";import"./chunk-3DYCTUSQ.js";import"./chunk-2V5PY4P5.js";import"./chunk-AAJRTGEP.js";import"./chunk-6B3IELRW.js";import"./chunk-S5AOIOTT.js";import"./chunk-YU3SUSK3.js";import"./chunk-QTFFVLVJ.js";import"./chunk-5YULBQJX.js";import{Lc as S,P as W,Sc as J,Tc as F}from"./chunk-QBQJDV2F.js";import"./chunk-IN6XVTUS.js";import"./chunk-RXRBRR3E.js";import"./chunk-3PVQ5QP4.js";import"./chunk-VFXMP7IF.js";import"./chunk-MHBNMYZP.js";import{a as D}from"./chunk-PIM3PV5N.js";import"./chunk-LUKA7UUJ.js";import"./chunk-ATEWMIY5.js";import"./chunk-2GRXBIJB.js";import"./chunk-EWW5KWAO.js";import"./chunk-567IWIX6.js";import"./chunk-OSUIS4JU.js";import"./chunk-JV7TZDKJ.js";import"./chunk-BBCQMZQN.js";import"./chunk-2DEUYEQD.js";import"./chunk-TD3ZHREE.js";import"./chunk-ND2YUUUH.js";import"./chunk-T7S2UBNN.js";import"./chunk-ANQZKVDD.js";import"./chunk-IDEKLW7C.js";import"./chunk-C2ESM27Z.js";import"./chunk-LMRPCWHV.js";import"./chunk-DIW5X4GI.js";import"./chunk-N34DQ6MH.js";import{b as L}from"./chunk-NU3X7P4N.js";import"./chunk-L2RTMZCN.js";import"./chunk-34JO3JNC.js";import{i as H,j as I}from"./chunk-UIX3TT72.js";import"./chunk-NN444GPH.js";import"./chunk-ROGMKTND.js";import{b as O,e as l,f as c}from"./chunk-GTPTZRO6.js";import"./chunk-PSANHDZM.js";var m=process.stdout,C=22,E=20,R=E/2,K=(o,n)=>Math.abs(n)<=Math.min(1-.417*Math.abs(o),2.393*(1-Math.abs(o))),so=(o,n)=>o*o+n*n<=1;function ro(o){let n=.62**-o,u=[];for(let s=0;s<E;s++){let a=[];for(let r=0;r<C;r++){let f=(r+.5)/C*2-1,i=(s+.5)/E*2-1,d=!1;if(K(f,i))for(let x=0;x<6;x++)for(let y of[!1,!0]){let p=.62**x*(y?.77:1)*n,$=.5*Math.max(0,1-p)**2;(y?so:K)(f/p,(i-$)/p)&&(d=!y)}a.push(d)}u.push(a)}return u}var A={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"]},q="CONFORM.TOOLS",io=[...q].reduce((o,n)=>o+A[n][0].length+1,-1);async function z(o){if(!m.isTTY)return!1;let n=!!O("NO_COLOR"),u=/truecolor|24bit/i.test(O("COLORTERM")??""),s=t=>e=>n?e:`\x1B[${t}m${e}\x1B[0m`,a=s(u?"38;2;255;60;0":"38;5;202"),r=s(u?"38;2;255;222;0":"38;5;220"),f=s("1"),i=s("2"),d=(m.columns??80)>=C+4+io,x=t=>[...q].map(e=>e==="."?a(A[e][t]):f(A[e][t])).join(" "),y=(t,e)=>d&&t>=2&&t<=5?x(t-2):!d&&t===3?`${f("conform")}${a(".")}${f("tools")}`:t===7?e:"",p=(t,e,T=[])=>{let k=ro(t),P=[];for(let w=0;w<R;w++){let to=k[2*w].map((_,eo)=>{let N=k[2*w+1][eo];return _&&N?"\u2588":_?"\u2580":N?"\u2584":" "}).join(""),no=w>=8?T[w-8]??"":"";P.push(` ${a(to)} ${no||y(w,e)}\x1B[K`)}return P.join(`
|
|
4
4
|
`)+`
|
|
5
5
|
`},$=null;o.account.then(t=>{$=t});let j=t=>L(t,24),Z=!O("CI")&&O("TERM")!=="dumb";if(m.write(`
|
|
6
6
|
`),Z){let t=()=>m.write("\x1B[?25h");process.once("SIGINT",()=>{t(),process.exit(130)}),m.write("\x1B[?25l"+p(0,r(`\u25B6 ${j(0)}`)));let e=Date.now(),T=0;for(;$===null||Date.now()-e<900;)await new Promise(k=>setTimeout(k,1e3/24)),T=Math.round((Date.now()-e)*24/1e3),m.write(`\x1B[${R}A\r`+p(T/22%1,`${r(`\u25B6 ${j(T)}`)} ${i("checking your account\u2026")}`));m.write(`\x1B[${R}A\r`),t()}let oo=($??await o.account).split(`
|
|
7
7
|
`);return m.write(p(0,`${i("v")}${o.version} ${i("\xB7 built by post pros")}`,oo.map(t=>i(t)))),m.write(`
|
|
8
|
-
`),!0}var U=()=>z({version:D,account:Promise.race([H().catch(()=>null),new Promise(o=>setTimeout(o,1500,null))]).then(o=>o?I(o):"account: no answer (offline?)")}),co={login:"account_login",logout:"account_logout",whoami:"account_status",status:"account_status",telemetry:"account_telemetry"};l()[0]==="mcp"&&(await import("./mcp.js"),await new Promise(()=>{}));l()[0]==="http"&&(await import("./http.js"),await new Promise(()=>{}));l()[0]==="statusline"&&((await import("./statusline-GMMCFMOA.js")).main(),c(0));if(l()[0]==="setup"){let o=l()[1];o!=="claude"&&o!=="codex"&&(console.error(`conformtools setup <client>: supported: claude, codex${o?` (not ${o} yet)`:""}`),c(2));let{setupClaude:n,setupText:u,setupCodex:s,codexText:a}=await import("./claude-setup-
|
|
8
|
+
`),!0}var U=()=>z({version:D,account:Promise.race([H().catch(()=>null),new Promise(o=>setTimeout(o,1500,null))]).then(o=>o?I(o):"account: no answer (offline?)")}),co={login:"account_login",logout:"account_logout",whoami:"account_status",status:"account_status",telemetry:"account_telemetry"};l()[0]==="mcp"&&(await import("./mcp.js"),await new Promise(()=>{}));l()[0]==="http"&&(await import("./http.js"),await new Promise(()=>{}));l()[0]==="statusline"&&((await import("./statusline-GMMCFMOA.js")).main(),c(0));if(l()[0]==="setup"){let o=l()[1];o!=="claude"&&o!=="codex"&&(console.error(`conformtools setup <client>: supported: claude, codex${o?` (not ${o} yet)`:""}`),c(2));let{setupClaude:n,setupText:u,setupCodex:s,codexText:a}=await import("./claude-setup-W27DLJIO.js"),{installAgentHook:r,hooksText:f}=await import("./agent-hook-setup-HBT2LTVR.js");try{console.log(o==="codex"?a(await s()):u(await n())),await S()&&console.log(f([await r(o)])),c(0)}catch(i){console.error(i instanceof Error?i.message:String(i)),c(1)}}if(l()[0]==="hooks"){let{installAllAgentHooks:o,removeAllAgentHooks:n,hooksText:u,hooksRemovedText:s,hooksStatusText:a}=await import("./agent-hook-setup-HBT2LTVR.js"),r=l()[1]??"status";r==="on"?console.log(await S()?u(await o()):"outcome telemetry is off, so the agent hook stays off: conformtools telemetry on first"):r==="off"?console.log(s(await n())):r==="status"?console.log(await a()):(console.error("conformtools hooks on|off|status"),c(2)),c(0)}F("cli");var Q=l().includes("--json"),[g,v]=l().filter(o=>o!=="--json");if(!g||g==="--list"||g==="help"||g==="--help"){await U(),console.log(`conformtools <verb> '<json args>' [--json]
|
|
9
9
|
|
|
10
10
|
login / whoami / logout sign in with your conform.tools Google account
|
|
11
11
|
telemetry on|off|status outcome telemetry (on by default, content-free; see the README, Feedback and privacy)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-EWW5KWAO.js";import"./chunk-L2RTMZCN.js";import"./chunk-PSANHDZM.js";export{b as decodeCr3Wasm,a as inspectCr3Wasm};
|