forge-terminal 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +3 -3
  2. package/dist/chunks/{about-credits-WSRAKKZF.js → about-credits-VRRE6342.js} +1 -1
  3. package/dist/chunks/{args-6CKJ6KH6.js → args-5BPKCNTL.js} +1 -1
  4. package/dist/chunks/{boot-HOUBXHJL.js → boot-MX7UP2M2.js} +1 -1
  5. package/dist/chunks/{chunk-LJXEQGKU.js → chunk-2NSUAERD.js} +1 -1
  6. package/dist/chunks/{chunk-CWQCFW5J.js → chunk-2ZZXIDYX.js} +1 -1
  7. package/dist/chunks/{chunk-VNZ3D7VG.js → chunk-3YWAVKDZ.js} +1 -1
  8. package/dist/chunks/{chunk-TYWGB767.js → chunk-45BFQHJB.js} +1 -1
  9. package/dist/chunks/{chunk-3FLV43Q2.js → chunk-7IWX5VSI.js} +1 -1
  10. package/dist/chunks/{chunk-J7GGNBDR.js → chunk-BI2E72HM.js} +1 -1
  11. package/dist/chunks/{chunk-7UMELAOL.js → chunk-BONMSCKD.js} +1 -1
  12. package/dist/chunks/{chunk-EITGK5OI.js → chunk-BU4YYGUJ.js} +1 -1
  13. package/dist/chunks/{chunk-PLBLOIQI.js → chunk-D4R7UACU.js} +1 -1
  14. package/dist/chunks/{chunk-IE6NFN3N.js → chunk-HACM3MAD.js} +1 -1
  15. package/dist/chunks/chunk-HFQOGB4T.js +4 -0
  16. package/dist/chunks/{chunk-ZOQA3JAR.js → chunk-HGJXGAGJ.js} +1 -1
  17. package/dist/chunks/{chunk-MBZRADAZ.js → chunk-HVMQTKP6.js} +1 -1
  18. package/dist/chunks/{chunk-KSWBIKCI.js → chunk-HYMPLIHW.js} +1 -1
  19. package/dist/chunks/{chunk-YO2DKGGU.js → chunk-JJV2YXZQ.js} +1 -1
  20. package/dist/chunks/{chunk-QPYAKAHI.js → chunk-KDBKDURW.js} +2 -2
  21. package/dist/chunks/{chunk-KS4ZE3X2.js → chunk-L5JBHB4G.js} +1 -1
  22. package/dist/chunks/chunk-MES4FVLR.js +3 -0
  23. package/dist/chunks/{chunk-LSVZEQVK.js → chunk-MMLROWBQ.js} +2 -2
  24. package/dist/chunks/{chunk-TFOEI5VF.js → chunk-OGYSMKRM.js} +1 -1
  25. package/dist/chunks/{chunk-RW4TOC5E.js → chunk-OUXPGAQL.js} +1 -1
  26. package/dist/chunks/{chunk-SBQWOZTA.js → chunk-R7BEV6PR.js} +1 -1
  27. package/dist/chunks/chunk-RLOJSZ6W.js +3 -0
  28. package/dist/chunks/{chunk-WE5MOCUL.js → chunk-SZCSV3PX.js} +1 -1
  29. package/dist/chunks/{chunk-KOHJP7T4.js → chunk-TRJXZLR6.js} +1 -1
  30. package/dist/chunks/{chunk-NS5CJZ4B.js → chunk-UGATQHEE.js} +1 -1
  31. package/dist/chunks/{chunk-BB43QVW4.js → chunk-WCOFUMZU.js} +1 -1
  32. package/dist/chunks/{chunk-YURNOHEF.js → chunk-ZBETH6BR.js} +1 -1
  33. package/dist/chunks/clip-command-WJ5P4DTN.js +3 -0
  34. package/dist/chunks/{clipboard-7KSZNWWT.js → clipboard-3VFHDKYE.js} +1 -1
  35. package/dist/chunks/{colour-PXJ2VKHU.js → colour-5YBDFXXX.js} +1 -1
  36. package/dist/chunks/{entry-RDY5AQA5.js → entry-7GW4RIK2.js} +2 -2
  37. package/dist/chunks/execute-LBGFY5TG.js +3 -0
  38. package/dist/chunks/{extensions-VHU2V3B6.js → extensions-HTBACHMC.js} +1 -1
  39. package/dist/chunks/{extensions-command-VT5CGCL5.js → extensions-command-VXZL55KR.js} +1 -1
  40. package/dist/chunks/{ffmpeg-N4SJFTIP.js → ffmpeg-Z7JQT53Y.js} +1 -1
  41. package/dist/chunks/{image-YMCS4PTS.js → image-FYCF2AVH.js} +1 -1
  42. package/dist/chunks/{install-LDERVCWM.js → install-5YXQ6YV3.js} +1 -1
  43. package/dist/chunks/{launch-UEEW4R7F.js → launch-U63VZQXC.js} +5 -5
  44. package/dist/chunks/{manager-QOSWVNWL.js → manager-QUTR3RYR.js} +2 -2
  45. package/dist/chunks/{needed-P2KDSQRO.js → needed-X5D4E5X5.js} +1 -1
  46. package/dist/chunks/{own-LYJ5WMGC.js → own-5JN35AUV.js} +1 -1
  47. package/dist/chunks/{pdfium-BAMNBCNW.js → pdfium-GKF4ES7K.js} +1 -1
  48. package/dist/chunks/{preset-command-J7RTNKQI.js → preset-command-H6G22SZD.js} +1 -1
  49. package/dist/chunks/{registry-WZUVZQHU.js → registry-LLAHKI4G.js} +1 -1
  50. package/dist/chunks/{server-HQC6RCTV.js → server-CIGFNW7X.js} +3 -3
  51. package/dist/chunks/{theme-NQIVXDUH.js → theme-HAB66OAL.js} +1 -1
  52. package/dist/chunks/{transcribe-IZGN5EFT.js → transcribe-FVCOCTGA.js} +1 -1
  53. package/dist/chunks/{transcribe-command-TMM4RLJD.js → transcribe-command-XCBGAQMI.js} +1 -1
  54. package/dist/chunks/{update-note-BEM4E3NI.js → update-note-47IPWQKY.js} +1 -1
  55. package/dist/chunks/{watch-command-4TATMV2T.js → watch-command-VL6LOERU.js} +1 -1
  56. package/dist/index.js +6 -6
  57. package/package.json +7 -3
  58. package/dist/chunks/chunk-7WZYTDFI.js +0 -3
  59. package/dist/chunks/chunk-BIBDLXCG.js +0 -3
  60. package/dist/chunks/chunk-SNXX5TVZ.js +0 -4
  61. package/dist/chunks/clip-command-S4JYPD6N.js +0 -3
  62. package/dist/chunks/execute-7NVA5QSU.js +0 -3
@@ -1,4 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{c as ie,d as ue,e as pe,g as ce,h as de}from"./chunk-RW4TOC5E.js";import{a as re,b as oe,c as se,k as ne,m as M,n as O,s as ae}from"./chunk-J7GGNBDR.js";import{b as X,c as T}from"./chunk-6RMRWBMB.js";import{a as y}from"./chunk-KSWBIKCI.js";import{b as I}from"./chunk-BB43QVW4.js";import{e as be}from"./chunk-PLBLOIQI.js";import{a as F,c as _,d as ee,e as C,f as te}from"./chunk-WE5MOCUL.js";import{e as fe,f as le,g as me,h as ge,i as he,j as ye}from"./chunk-57M4J2BR.js";import{a as g}from"./chunk-MBZRADAZ.js";import{d as $}from"./chunk-EEQSUBBL.js";import{a as Z}from"./chunk-IE6NFN3N.js";import{a as L,d as U}from"./chunk-TFOEI5VF.js";import{a as Y,c as K,d as E,e as Q}from"./chunk-BIBDLXCG.js";import{E as N,F as V,I as G,a as P,o as z,q as k,s as q,ta as H,v as J}from"./chunk-CVNYUROW.js";import{a as h,b as W}from"./chunk-J7FLFHQJ.js";import{b as x,c as w}from"./chunk-VLVNA4T3.js";import{a as R}from"./chunk-H3DIRJFE.js";import{readFile as Te}from"node:fs/promises";import{dirname as Oe,resolve as Me}from"node:path";async function we(e){let r=[],t=[...e.resolved.failures];for(let o of e.resolved.sources){let s=F(o);if(!s.includes(e.target)){t.push({path:o.path,error:q(o,e.target,s)});continue}let a={sourcePath:o.path,target:e.target,output:e.output,sourceRoot:e.resolved.roots.get(o.path)},n=E(a);K(n,o.path)&&e.target!==o.format&&(n=Q({...a,suffix:e.target})),r.push({op:"convert",sources:[o],outputs:[n],target:e.target,options:e.options})}return{jobs:r,failures:t}}import{resolve as je}from"node:path";function Be(e,r=new Set){let t={path:je(e.path),kind:e.kind,format:e.format,bytes:e.bytes},o=e.kind==="document"&&e.encrypted===!0,s={targets:F(e).filter(a=>!o||C(a)),actions:ce([e],r).filter(a=>!o||a.id===O.id).map(a=>a.id)};if(e.kind==="image")return{...t,width:e.width,height:e.height,...s};if(e.kind==="media"){let a=e.facts;return{...t,...a?{duration:a.duration}:{},...a?.video?{width:a.video.width,height:a.video.height,fps:a.video.fps}:{},...s}}return{...t,pages:e.pages,encrypted:e.encrypted,...s}}async function Ie(e){let r=await y(e,{recursive:!1}),{installedExtensionIds:t}=await import("./available-TNMISSBA.js"),o=await t();return{probes:r.sources.map(s=>Be(s,o)),failures:r.failures}}import{dirname as Se}from"node:path";var j=e=>({cwd:e.cwd??process.cwd(),...e.home===void 0?{}:{home:e.home}});function ve(e,r){let t=x(Se(e),j(r));return t==="."?"":` in ${t.endsWith("/")?t:`${t}/`}`}function xe(e,r){let{pct:t,direction:o}=W(e,r);return o==="same"?"same size":`${t}% ${o}`}function Pe(e,r={}){let t=e.results[0];if(!t)return[];let o=t.job.sources[0],s=t.job.outputs;if(s.length>1){let n=[`\u2713 ${w(o.path)} \u2192 ${s.length} files${ve(s[0],r)}`,` ${s.map(i=>w(i)).join(", ")}`,` ${h(o.bytes)} \u2192 ${h(t.outputBytes)} total`];for(let i of t.warnings)n.push("",`\u26A0 ${i.message}`);return n}let a=[`\u2713 ${w(o.path)} \u2192 ${x(s[0],j(r))}`,` ${h(o.bytes)} \u2192 ${h(t.outputBytes)} \xB7 ${xe(o.bytes,t.outputBytes)}`];for(let n of t.warnings)a.push("",`\u26A0 ${n.message}`);return a}function ke(e,r={}){let t=[`\u2713 ${e.results.length} converted`,` ${h(e.inputBytes)} \u2192 ${h(e.outputBytes)} \xB7 ${xe(e.inputBytes,e.outputBytes)}`];for(let s of e.results)for(let a of s.job.outputs)t.push(` ${x(a,j(r))}`);let o=e.results.flatMap(s=>s.warnings);if(o.length>0){t.push("");for(let s of o)t.push(`\u26A0 ${s.message}`)}return t}function $e(e,r={}){let t=e.results.flatMap(u=>u.job.outputs),o=t.map(u=>w(u)).join(", "),s=t.length===1?"file":"files",a=t[0]===void 0?"":ve(t[0],r),n=[`\u2713 ${t.length} ${s} \xB7 ${o}${a}`],i=e.results.flatMap(u=>u.warnings);for(let u of i)n.push("",`\u26A0 ${u.message}`);return n}function B(e,r){if(e.length===0)return[];let t=[];for(let o of e)t.push(...H(o.error,{debug:r.debug}),"");return t}function Re(){let e=new Set(_()),r=new Set(ee()),t=["Formats",""];for(let s of e){let a=R[s],n=r.has(s)?"read and write":"read only";t.push(` ${a.label.padEnd(6)} ${a.extensions.join(" ").padEnd(12)} ${n}`)}let o=[...e].filter(s=>!r.has(s)).map(s=>R[s].label);if(o.length>0){let s=o.join(", "),[a,n]=o.length===1?["is","it"]:["are","them"];t.push("",`${s} ${a} read only because Forge cannot yet write ${n}.`)}return t}function Ee(e,r={}){let t=[R[e.format].label,h(e.bytes)];return e.duration!==void 0&&t.push($(e.duration)),e.width!==void 0&&e.height!==void 0&&t.push(`${e.width}\xD7${e.height}`),e.fps!==void 0&&t.push(`${e.fps} fps`),e.pages!==void 0&&t.push(`${e.pages} ${e.pages===1?"page":"pages"}`),e.encrypted&&t.push("password-protected"),[`${x(e.path,j(r))} \xB7 ${t.join(" \xB7 ")}`,` converts to ${e.targets.join(", ")}`,` actions ${e.actions.join(", ")}`]}import{createInterface as Fe}from"node:readline";import{PassThrough as Je}from"node:stream";function Ne(e){return new Promise(r=>{let t=Fe({input:e,terminal:!1}),o=!1,s=a=>{if(o)return;o=!0,t.close(),e.pause(),e.unref?.(),r(a.replace(/\r$/,""))};t.once("line",s),t.once("close",()=>s(""))})}async function Ce(e){if(e.stdin)return Ne(process.stdin);if(!process.stdin.isTTY)return;let r=new Je,t=Fe({input:process.stdin,output:r,terminal:!0});try{return process.stderr.write("Password: "),await new Promise(o=>t.question("",o))}finally{process.stderr.write(`
4
- `),t.close()}}function Ae(e){return e.kind==="preset"?e.name:e.kind==="pageop"?"PDF":e.kind==="compress"?"Compress":e.kind==="convert"?"Convert":"Edit"}function A(e){return e.length===0?0:e.some(r=>r.error.code==="invalid-arguments")?2:1}function De(e,r){if(e.action==="merge")return{};if(e.action==="rotate")return{degrees:e.rotate};if(e.action==="extract")return{pages:e.pages,separate:e.separate?"many":"one"};if(e.action==="delete")return{pages:e.pages};let t=r.find(n=>n.kind==="document"),o=t?.pages??0,s=e.split;if(!s)throw N("--split needs a mode: every-page, every=N or at=N,N.");if(s.mode==="every-page")return{cuts:ie(o)};if(s.mode==="every-n")return{cuts:ue(o,s.n)};let a=Math.max(o-1,0);for(let n of s.after)if(!Number.isInteger(n)||n<1||n>a)throw V(String(n),`"${n}" is outside 1 and ${a} \u2014 ${t?w(t.path):"the document"} has ${o} pages.`,o);return{cuts:s.after.map(n=>n-1)}}function We(e,r){let t;return()=>r?(t??=Ce({stdin:e}).then(o=>e&&o===""?void 0:o),t):Promise.resolve(void 0)}async function ze(e,r,t,o){let s;if(e.encrypted){if(s=r.password??await t(),s===void 0)return{failure:{path:e.path,error:J(e.path)}};let i;try{i=await Z(await Te(e.path),s)}catch{return{failure:{path:e.path,error:J(e.path,{attempted:!0})}}}i.destroy()}let a;try{a=O.plan([e],{target:r.target,background:r.options.background,keepMetadata:r.options.keepMetadata,dpi:String(r.dpi??150),...r.options.quality===void 0?{}:{quality:r.options.quality},...r.pages===void 0?{}:{pages:r.pages},...r.output===void 0?{}:{destination:r.output},...o===void 0?{}:{sourceRoot:o}})}catch(i){if(!P(i))throw i;return{failure:{path:e.path,error:i}}}let n=a[0];if(n?.op!=="convert")throw new Error(`convertAction.plan() did not return a convert job for ${e.path}`);return s!==void 0&&(n.options.password=s),{job:n}}function S(e,r){return t=>{if(t.type==="search:attempt"){r||e.onSearch?.(t.rung.dpi===void 0?`attempt ${t.attempt} of ${t.of}`:`${t.rung.dpi} dpi \xB7 attempt ${t.attempt} of ${t.of}`);return}if(t.type==="search:settled"){r&&e.onSearch?.(`${t.completed} of ${t.total} searched`);return}if(!r&&t.type==="job:phase"&&t.progress.phase==="time"){let o=t.progress,s=`${$(o.done)} of ${$(o.total)}`;e.onEncode?.(o.pass?`pass ${o.pass.at} of 2 \xB7 ${s}`:s);return}r&&(t.type==="job:done"||t.type==="job:error")&&e.onProgress?.({completed:t.completed,total:t.total})}}var b=(e,r)=>({kind:e,results:[],failures:r,inputBytes:0,outputBytes:0});async function qe(e){let r=await y(e.inputs,{recursive:!1});if(r.sources.length===0)return b("pageop",r.failures);let t=pe.find(n=>n.id===e.action);if(!t)throw new Error(`no action registered for "${e.action}"`);let o=r.sources[0]?.path??"";if(!t.appliesTo(r.sources)){let n=de(t,r.sources)??"not available for these files";return b("pageop",[...r.failures,{path:o,error:k(e.action,n)}])}let s;try{s=t.plan(r.sources,De(e,r.sources))}catch(n){if(!P(n))throw n;return b("pageop",[...r.failures,{path:o,error:n}])}let a=await I(s,{force:e.force});return{kind:"pageop",results:a.results,failures:[...r.failures,...a.refusals,...a.failures],inputBytes:a.inputBytes,outputBytes:a.outputBytes}}async function Ve(e,r){let t=await y(e.inputs,{recursive:e.recursive}),o=[],s=[];for(let i of t.sources){if(!M.appliesTo([i])){s.push({path:i.path,error:z(i)});continue}let u=e.output!==void 0&&!Y(e.output)?Me(e.output):void 0,f=e.output===void 0||u!==void 0?Oe(i.path):Oe(E({sourcePath:i.path,target:i.format,output:e.output,sourceRoot:t.roots.get(i.path)})),[d]=M.plan([i],{mode:e.maxBytes===void 0?"quality":"size",...e.quality===void 0?{}:{quality:e.quality},...e.options.media??{},destination:f});d?.op==="convert"&&(u!==void 0&&(d.outputs=[u]),e.dpi!==void 0&&(d.options.dpi=e.dpi),o.push(d))}let a=o.length>1;a&&r.onProgress?.({completed:0,total:o.length});let n=await I(o,{force:e.force,...e.concurrency===void 0?{}:{concurrency:e.concurrency},...e.maxBytes===void 0?{}:{targetBytes:e.maxBytes},onEvent:S(r,a)});return{kind:"compress",results:n.results,failures:[...t.failures,...s,...n.refusals,...n.unreachable.map(i=>({path:i.job.sources[0].path,error:i.error})),...n.failures],inputBytes:n.inputBytes,outputBytes:n.outputBytes}}async function Ge(e,r){let t=e.kind,o=e.op==="remove-background"?L(e.target):void 0;if(o)return b(t,[{path:"",error:o}]);let{installed:s}=await import("./paths-6OENILJ4.js"),a=await s(e.op);if(!a)return b(t,[{path:"",error:G(e.op)}]);if(e.op==="boost"&&e.scale!==void 0){let{assetFor:l,catalogEntry:p}=await import("./catalog-FMHWWMUX.js"),m=p("boost"),v=m&&l(m)?.version,D=U(e.scale,a.version,v);if(D)return b(t,[{path:"",error:D}])}let n=await y(e.inputs,{recursive:e.recursive}),i=e.op==="boost"?oe:se,u=[],f=[];for(let l of n.sources){if(!i.appliesTo([l])){f.push({path:l.path,error:k(e.op,"it works on images, not documents","Try an image such as a JPEG, PNG, WebP or HEIC file.")});continue}let p=re(l,e.target);if(p){f.push({path:l.path,error:p});continue}u.push(...i.plan([l],{target:e.target,background:e.options.background,keepMetadata:e.options.keepMetadata,...e.scale===void 0?{}:{scale:e.scale},...e.options.quality===void 0?{}:{quality:e.options.quality},...e.output===void 0?{}:{output:e.output},roots:n.roots}))}let d=u.length>1;d&&r.onProgress?.({completed:0,total:u.length});let c=await I(u,{force:e.force,concurrency:1,...r.signal===void 0?{}:{signal:r.signal},onEvent:S(r,d)});return{kind:t,results:c.results,failures:[...n.failures,...f,...c.refusals,...c.failures],inputBytes:c.inputBytes,outputBytes:c.outputBytes}}async function He(e,r){let t=e.crop!==void 0?"crop":e.resize!==void 0?"resize":"trim",o=e.target===void 0?void 0:be(e.target,t);if(o)return b(e.kind,[{path:"",error:o}]);let s=await y(e.inputs,{recursive:e.recursive}),a=[],n=[],i=[];for(let p of s.sources)p.kind==="image"&&e.media===void 0?a.push(p):p.kind==="media"&&!e.trim?n.push(p):p.kind==="image"?i.push({path:p.path,error:k("cut","it works on video and sound, not images","Try a video or sound file, such as a MOV, MP4 or WAV.")}):i.push({path:p.path,error:k(t,"it works on images, not documents","Try an image such as a JPEG, PNG, WebP or HEIC file.")});let u=ne(n,{...e.media===void 0?{}:{media:e.media},...e.crop===void 0?{}:{crop:e.crop},...e.resize===void 0?{}:{resize:e.resize},...e.target===void 0?{}:{target:e.target},...e.output===void 0?{}:{output:e.output},roots:s.roots}),d=[...ae(a,{trim:e.trim,...e.crop===void 0?{}:{crop:e.crop},...e.resize===void 0?{}:{resize:e.resize},...e.target===void 0?{}:{target:e.target},...e.output===void 0?{}:{output:e.output},roots:s.roots,background:e.options.background,keepMetadata:e.options.keepMetadata,...e.options.quality===void 0?{}:{quality:e.options.quality}}),...u],c=d.length>1;c&&r.onProgress?.({completed:0,total:d.length});let l=await I(d,{force:e.force,...e.concurrency===void 0?{}:{concurrency:e.concurrency},onEvent:S(r,c)});return{kind:e.kind,results:l.results,failures:[...s.failures,...i,...l.refusals,...l.failures],inputBytes:l.inputBytes,outputBytes:l.outputBytes}}async function Le(e,r){let t=await y(e.inputs,{recursive:e.recursive}),o=m=>m.kind==="document"&&m.format==="pdf",s=C(e.target),a=s?t.sources.filter(o):[],n=s?t.sources.filter(m=>!o(m)):t.sources,i=[],u=[],f=We(e.passwordStdin??!1,r.interactive??!0);for(let m of a){let v=await ze(m,e,f,t.roots.get(m.path));"failure"in v?u.push(v.failure):i.push(v.job)}let d=await we({resolved:{sources:n,failures:[],roots:t.roots},target:e.target,options:e.options,force:e.force,...e.output===void 0?{}:{output:e.output}}),c=[...d.jobs,...i],l=c.length>1;l&&r.onProgress?.({completed:0,total:c.length});let p=await I(c,{force:e.force,...e.concurrency===void 0?{}:{concurrency:e.concurrency},...e.maxBytes===void 0?{}:{targetBytes:e.maxBytes},onEvent:S(r,l)});return{kind:"convert",results:p.results,failures:[...t.failures,...u,...d.failures,...p.refusals,...p.unreachable.map(m=>({path:m.job.sources[0].path,error:m.error})),...p.failures],inputBytes:p.inputBytes,outputBytes:p.outputBytes}}async function Ue(e,r={}){try{if(e.kind==="pageop")return await qe(e);if(e.kind==="extension-op")return await Ge(e,r);if(e.kind==="edit")return await He(e,r);if(e.kind==="preset"){let{runPresetCommand:t}=await import("./preset-command-J7RTNKQI.js");return await t(e)}return e.kind==="compress"?await Ve(e,r):await Le(e,r)}catch(t){if(!P(t))throw t;return b(e.kind,[{path:"",error:t}])}}function Ye(e,r){let t=A(e.failures);if(r.json)return{exitCode:t,stdout:[JSON.stringify(fe(g,e))],stderr:[]};let o=e.results.length===0?[]:e.kind==="pageop"?$e(e):e.results.length===1?Pe(e):ke(e);return{exitCode:t,stdout:o,stderr:B(e.failures,{debug:r.debug})}}function Ke(e,r){let t=[{path:"",error:e}],o=A(t);return r.json?{exitCode:o,stdout:[JSON.stringify(le(g,e))],stderr:[]}:{exitCode:o,stdout:[],stderr:B(t,{debug:r.debug})}}async function Qe(e,r){let{runConfig:t}=await import("./config-command-6GXRV627.js"),o=await t(e);return r?{exitCode:0,stdout:[JSON.stringify(he(g,o.config,o.warnings))],stderr:[]}:{exitCode:0,stdout:o.stdout,stderr:[]}}async function zt(e,r={}){let t=r.json??!1,o="debug"in e?e.debug:!1;try{if(e.kind==="config")return await Qe(e,t);if(e.kind==="clip"){let{runClipCommand:n}=await import("./clip-command-S4JYPD6N.js");return await n(e,{...r,json:t,debug:o})}if(e.kind==="update"){let{runUpdate:n}=await import("./update-command-DJLYU6AB.js"),i=await n(g,{...r.onInstalling?{onInstalling:r.onInstalling}:{}});return{exitCode:0,stdout:t?[JSON.stringify({forge:g,ok:!0,...i.data})]:i.stdout,stderr:[]}}if(e.kind==="uninstall"){let{runUninstall:n}=await import("./entry-RDY5AQA5.js"),i=[];return{exitCode:await n(g,f=>i.push(f)),stdout:i,stderr:[]}}if(e.kind==="extensions"){let{runExtensions:n}=await import("./extensions-command-VT5CGCL5.js"),i=await n(e,{onDownload:r.onDownload});return{exitCode:0,stdout:t?[JSON.stringify(ye(g,i.data))]:i.stdout,stderr:[]}}if(e.kind==="formats")return t?{exitCode:0,stdout:[JSON.stringify(me(g,te()))],stderr:[]}:{exitCode:0,stdout:Re(),stderr:[]};if(e.kind==="probe"){let{probes:n,failures:i}=await Ie(e.inputs),u=A(i);return t?{exitCode:u,stdout:[JSON.stringify(ge(g,{probes:n,failures:i}))],stderr:[]}:{exitCode:u,stdout:n.flatMap((f,d)=>[...d>0?[""]:[],...Ee(f)]),stderr:B(i,{debug:o})}}if(e.kind==="palette"||e.kind==="scale"){let{runPalette:n,runScale:i}=await import("./colour-PXJ2VKHU.js"),u={json:t,colour:r.colour??!1};return e.kind==="palette"?await n(e,u):await i(e,u)}if(e.kind==="transcribe"){let{runTranscribeCommand:n}=await import("./transcribe-command-TMM4RLJD.js"),i=[],u=[],f;return{exitCode:await n(e,{out:c=>i.push(c),err:c=>u.push(c),finished:c=>{f=T("Transcribe",c)}}),stdout:i,stderr:u,...f?{notice:f}:{}}}if(e.kind==="shell")return{exitCode:0,stdout:[],stderr:[]};if(e.kind==="watch")throw N("forge watch runs in a terminal until ctrl-c.","Try: forge watch ./images --to webp");let s=await Ue(e,r),a=T(Ae(e),X(s.results,s.failures));return{...Ye(s,{json:t,debug:o}),...a?{notice:a}:{}}}catch(s){if(!P(s))throw s;return Ke(s,{json:t,debug:o})}}export{Ie as a,xe as b,A as c,Ue as d,Ye as e,zt as f};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{a,b,c,d}from"./chunk-LJXEQGKU.js";import"./chunk-ZOQA3JAR.js";import"./chunk-TYWGB767.js";import"./chunk-SNXX5TVZ.js";import"./chunk-RW4TOC5E.js";import"./chunk-J7GGNBDR.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-6RMRWBMB.js";import"./chunk-KSWBIKCI.js";import"./chunk-BB43QVW4.js";import"./chunk-KS4ZE3X2.js";import"./chunk-PLBLOIQI.js";import"./chunk-WE5MOCUL.js";import"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import"./chunk-MBZRADAZ.js";import"./chunk-O7DK3GJT.js";import"./chunk-7WZYTDFI.js";import"./chunk-EEQSUBBL.js";import"./chunk-7UMELAOL.js";import"./chunk-IE6NFN3N.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{b as clipLines,a as runClip,d as runClipCommand,c as runUndo};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{c as a,d as b,e as c,f as d}from"./chunk-SNXX5TVZ.js";import"./chunk-RW4TOC5E.js";import"./chunk-J7GGNBDR.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-6RMRWBMB.js";import"./chunk-KSWBIKCI.js";import"./chunk-BB43QVW4.js";import"./chunk-KS4ZE3X2.js";import"./chunk-PLBLOIQI.js";import"./chunk-WE5MOCUL.js";import"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import"./chunk-MBZRADAZ.js";import"./chunk-O7DK3GJT.js";import"./chunk-7WZYTDFI.js";import"./chunk-EEQSUBBL.js";import"./chunk-7UMELAOL.js";import"./chunk-IE6NFN3N.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{d as execute,a as exitCodeFor,c as renderRun,b as runIntent};