forge-terminal 0.4.5 → 0.5.0

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 (151) hide show
  1. package/README.md +104 -19
  2. package/dist/chunks/{about-credits-TJBWWNH6.js → about-credits-5UQU5WHE.js} +2 -2
  3. package/dist/chunks/args-QKAIL3E4.js +3 -0
  4. package/dist/chunks/{available-GYIHVSRX.js → available-M6Z62OWE.js} +1 -1
  5. package/dist/chunks/boot-MGR26CBU.js +3 -0
  6. package/dist/chunks/catalog-VPSTQTFD.js +3 -0
  7. package/dist/chunks/check-B6NP7BEM.js +3 -0
  8. package/dist/chunks/chunk-37P6QZ5Q.js +3 -0
  9. package/dist/chunks/chunk-3GJ7GV3V.js +19 -0
  10. package/dist/chunks/{chunk-EHARO6IS.js → chunk-57M4J2BR.js} +1 -1
  11. package/dist/chunks/chunk-63XCSYHM.js +3 -0
  12. package/dist/chunks/{chunk-JFJ3ZJQL.js → chunk-63ZK5SRQ.js} +1 -1
  13. package/dist/chunks/chunk-C4UCCBCX.js +3 -0
  14. package/dist/chunks/{chunk-DERIWZAT.js → chunk-CKZBBDAW.js} +1 -1
  15. package/dist/chunks/chunk-DZOBIUV6.js +3 -0
  16. package/dist/chunks/chunk-EKTUUKDP.js +80 -0
  17. package/dist/chunks/chunk-F34DPQFQ.js +63 -0
  18. package/dist/chunks/chunk-G46QQBT3.js +3 -0
  19. package/dist/chunks/chunk-GSK2A3TN.js +3 -0
  20. package/dist/chunks/chunk-H3DIRJFE.js +3 -0
  21. package/dist/chunks/chunk-HKINXTUW.js +3 -0
  22. package/dist/chunks/chunk-HOZ6XGQQ.js +6 -0
  23. package/dist/chunks/chunk-I6754KTB.js +36 -0
  24. package/dist/chunks/{chunk-YYB3TTGT.js → chunk-JMBEZPYC.js} +1 -1
  25. package/dist/chunks/chunk-K7KKCR7V.js +6 -0
  26. package/dist/chunks/chunk-KH5DHZ2U.js +8 -0
  27. package/dist/chunks/chunk-KXKQDFHX.js +3 -0
  28. package/dist/chunks/chunk-LVYQVJOF.js +3 -0
  29. package/dist/chunks/chunk-N6RCLJE6.js +4 -0
  30. package/dist/chunks/chunk-N72E43Z3.js +3 -0
  31. package/dist/chunks/chunk-NDECMPOM.js +3 -0
  32. package/dist/chunks/chunk-NXJGO66P.js +3 -0
  33. package/dist/chunks/chunk-OK7XOZFO.js +3 -0
  34. package/dist/chunks/chunk-P4RAYEM7.js +6 -0
  35. package/dist/chunks/{chunk-EX7KZBI6.js → chunk-PE5LAYGF.js} +1 -1
  36. package/dist/chunks/chunk-PPR7B5AR.js +3 -0
  37. package/dist/chunks/chunk-Q6KQWJ4J.js +3 -0
  38. package/dist/chunks/{chunk-GJ2GZHRI.js → chunk-RMD7F3QX.js} +1 -1
  39. package/dist/chunks/chunk-SK2UZ25Y.js +3 -0
  40. package/dist/chunks/chunk-SNDFMJIX.js +3 -0
  41. package/dist/chunks/{chunk-IGF6ZFTM.js → chunk-SZRSAL64.js} +1 -1
  42. package/dist/chunks/chunk-THDAQBQ3.js +3 -0
  43. package/dist/chunks/chunk-TL5MACSF.js +3 -0
  44. package/dist/chunks/chunk-V3I6DSF4.js +3 -0
  45. package/dist/chunks/{chunk-A6RK5ALT.js → chunk-W6SY5PPG.js} +2 -2
  46. package/dist/chunks/chunk-WC6SJN5Y.js +3 -0
  47. package/dist/chunks/chunk-WE6KP4FR.js +3 -0
  48. package/dist/chunks/chunk-WIPP5TWQ.js +3 -0
  49. package/dist/chunks/{chunk-GKECNCKO.js → chunk-XBOMWF34.js} +1 -1
  50. package/dist/chunks/chunk-XRI5XKEB.js +66 -0
  51. package/dist/chunks/chunk-Y7LOIHFU.js +3 -0
  52. package/dist/chunks/chunk-YINYF6C7.js +3 -0
  53. package/dist/chunks/chunk-ZRHYGR2L.js +134 -0
  54. package/dist/chunks/chunk-ZZZAPVKM.js +3 -0
  55. package/dist/chunks/clip-command-R2NKW4TI.js +3 -0
  56. package/dist/chunks/clipboard-GICOXMMN.js +3 -0
  57. package/dist/chunks/colour-APVBMEJQ.js +3 -0
  58. package/dist/chunks/command-GYCYLUHN.js +3 -0
  59. package/dist/chunks/config-command-6YUMMZF3.js +3 -0
  60. package/dist/chunks/continue-editing-QE5RRIMG.js +3 -0
  61. package/dist/chunks/decoded-UNCEUPNW.js +3 -0
  62. package/dist/chunks/entry-TSLQHDP7.js +6 -0
  63. package/dist/chunks/execute-S5WN34PS.js +3 -0
  64. package/dist/chunks/extensions-XI5R74TS.js +3 -0
  65. package/dist/chunks/{extensions-command-ABJSGDPK.js → extensions-command-25JOL47P.js} +1 -1
  66. package/dist/chunks/ffmpeg-3CJ6C37W.js +3 -0
  67. package/dist/chunks/image-QSTDWHJ4.js +3 -0
  68. package/dist/chunks/install-IDUHZTTS.js +3 -0
  69. package/dist/chunks/{install-V62EEK54.js → install-L5C2UT6M.js} +1 -1
  70. package/dist/chunks/install-size-PZUFEDGI.js +3 -0
  71. package/dist/chunks/launch-LFFWVTFE.js +17 -0
  72. package/dist/chunks/libs-EK64ACG3.js +3 -0
  73. package/dist/chunks/lock-PTQUMNYX.js +3 -0
  74. package/dist/chunks/manager-CQ6NNQY4.js +4 -0
  75. package/dist/chunks/needed-MYXIUZI4.js +3 -0
  76. package/dist/chunks/own-WNA6BFYL.js +3 -0
  77. package/dist/chunks/{paths-5XI5L4KW.js → paths-EOYKOUBC.js} +1 -1
  78. package/dist/chunks/pdfium-WFGSET5S.js +3 -0
  79. package/dist/chunks/preferences-3P4V2EDX.js +3 -0
  80. package/dist/chunks/preset-command-HMOFTZSG.js +3 -0
  81. package/dist/chunks/registry-4IOXO6DT.js +3 -0
  82. package/dist/chunks/{reveal-L6TBFOMV.js → reveal-D5FCZYOA.js} +1 -1
  83. package/dist/chunks/run-HGZVOXRW.js +5 -0
  84. package/dist/chunks/{server-TUWDAECT.js → server-KKF3XBQG.js} +8 -8
  85. package/dist/chunks/text-layer-LHZNDMPZ.js +3 -0
  86. package/dist/chunks/{theme-7IVYHKTP.js → theme-NAWQ77WF.js} +1 -1
  87. package/dist/chunks/transcribe-Q5NLWSSR.js +3 -0
  88. package/dist/chunks/transcribe-command-2L7F7MCG.js +3 -0
  89. package/dist/chunks/{update-command-GMBG7BK6.js → update-command-JCTCRPCS.js} +1 -1
  90. package/dist/chunks/update-note-FRMHMUMD.js +3 -0
  91. package/dist/chunks/watch-command-XCCMIQIM.js +3 -0
  92. package/dist/fonts/NotoSans-Bold.ttf.gz +0 -0
  93. package/dist/fonts/NotoSans-Regular.ttf.gz +0 -0
  94. package/dist/fonts/OFL.txt +93 -0
  95. package/dist/helpers/forge-transcribe +0 -0
  96. package/dist/helpers/forge-transcribe-whisper.mjs +525 -0
  97. package/dist/index.js +8 -8
  98. package/dist/third-party-licenses.txt +98 -0
  99. package/package.json +43 -12
  100. package/dist/chunks/args-MGXWV4UD.js +0 -3
  101. package/dist/chunks/boot-AE6XH7Z3.js +0 -3
  102. package/dist/chunks/catalog-YSMT3PXT.js +0 -3
  103. package/dist/chunks/check-KAR72Y4X.js +0 -3
  104. package/dist/chunks/chunk-3UEQ2OX6.js +0 -3
  105. package/dist/chunks/chunk-5B5XXH22.js +0 -3
  106. package/dist/chunks/chunk-5IS7O673.js +0 -6
  107. package/dist/chunks/chunk-6FUVEO3A.js +0 -78
  108. package/dist/chunks/chunk-6L6C3GJU.js +0 -3
  109. package/dist/chunks/chunk-7S5DBC3J.js +0 -66
  110. package/dist/chunks/chunk-AAXBN572.js +0 -4
  111. package/dist/chunks/chunk-BZXDNDPG.js +0 -3
  112. package/dist/chunks/chunk-CEULBUUM.js +0 -63
  113. package/dist/chunks/chunk-DOWMSJ6R.js +0 -3
  114. package/dist/chunks/chunk-EXLXSKRH.js +0 -3
  115. package/dist/chunks/chunk-FH3R2YYD.js +0 -19
  116. package/dist/chunks/chunk-FWIXOYXE.js +0 -3
  117. package/dist/chunks/chunk-I63TO22X.js +0 -3
  118. package/dist/chunks/chunk-IWFVEMDN.js +0 -3
  119. package/dist/chunks/chunk-JSMGNA55.js +0 -3
  120. package/dist/chunks/chunk-KAHWYWNT.js +0 -3
  121. package/dist/chunks/chunk-LDKF7KIZ.js +0 -6
  122. package/dist/chunks/chunk-LNB5D67B.js +0 -3
  123. package/dist/chunks/chunk-M66BUNYO.js +0 -3
  124. package/dist/chunks/chunk-PSEIJXGT.js +0 -3
  125. package/dist/chunks/chunk-QR6QHTC3.js +0 -3
  126. package/dist/chunks/chunk-QXTXBMTM.js +0 -3
  127. package/dist/chunks/chunk-SMBK6BTC.js +0 -3
  128. package/dist/chunks/chunk-TDW6KQH6.js +0 -3
  129. package/dist/chunks/chunk-TMQDQLY7.js +0 -21
  130. package/dist/chunks/chunk-XSOCV3F2.js +0 -3
  131. package/dist/chunks/chunk-YWKMG5WO.js +0 -3
  132. package/dist/chunks/clip-command-D3DE2WUR.js +0 -3
  133. package/dist/chunks/clipboard-CPHPA4FH.js +0 -3
  134. package/dist/chunks/colour-U6QBTJTQ.js +0 -3
  135. package/dist/chunks/command-I5M275ZV.js +0 -3
  136. package/dist/chunks/config-command-TYNYVUMP.js +0 -3
  137. package/dist/chunks/entry-4GMHXHST.js +0 -6
  138. package/dist/chunks/execute-D4H7QWGR.js +0 -3
  139. package/dist/chunks/extensions-DOTV7SIR.js +0 -3
  140. package/dist/chunks/ffmpeg-PF3VLTHK.js +0 -3
  141. package/dist/chunks/image-J4FT4ACZ.js +0 -3
  142. package/dist/chunks/install-2A5BGKQU.js +0 -3
  143. package/dist/chunks/launch-XVWOLOXM.js +0 -15
  144. package/dist/chunks/lock-KN7CF4YN.js +0 -3
  145. package/dist/chunks/manager-TVGSLNBE.js +0 -4
  146. package/dist/chunks/preferences-4VETUGMN.js +0 -3
  147. package/dist/chunks/preset-command-HORY7KZQ.js +0 -3
  148. package/dist/chunks/run-6BK4REXK.js +0 -4
  149. package/dist/chunks/transcribe-command-YUSBCQEQ.js +0 -3
  150. package/dist/chunks/update-note-A7C2OJKU.js +0 -3
  151. package/dist/chunks/watch-command-NOMNFJ75.js +0 -3
@@ -0,0 +1,3 @@
1
+ import { createRequire as __forgeCreateRequire } from 'node:module';
2
+ const require = __forgeCreateRequire(import.meta.url);
3
+ import{a as l}from"./chunk-J7FLFHQJ.js";import{a as s}from"./chunk-H3DIRJFE.js";import{homedir as $}from"node:os";import{posix as f,win32 as m}from"node:path";var x=/[\u0000-\u001f\u007f-\u009f‪-‮⁦-⁩]/g;function c(e){return e.replace(x,"?")}function g(e,t,n){let i=n.relative(t,e);if(i==="")return"";if(!(i===".."||i.startsWith(`..${n.sep}`)||n.isAbsolute(i)))return i}function I(e,t={}){return c(y(e,t))}function y(e,t){let n=(t.platform??process.platform)==="win32"?m:f;if(t.cwd!==void 0){let a=g(e,t.cwd,n);if(a!==void 0)return a===""?".":a}let i=g(e,t.home??$(),n);return i!==void 0?i===""?"~":`~${n.sep}${i}`:e}function r(e,t=process.platform){return c((t==="win32"?m:f).basename(e))}import{dirname as F}from"node:path";var o=class extends Error{code;title;detail;short;hint;shellHint;constructor(t){super(`${t.title}: ${t.detail}`,t.cause===void 0?void 0:{cause:t.cause}),this.name="ForgeError",this.code=t.code,this.title=t.title,this.detail=t.detail,this.short=t.short,this.hint=t.hint,this.shellHint=t.shellHint}};function E(e){return e instanceof o}function W(e){return new o({code:"file-not-found",title:"File not found",detail:`${r(e)} could not be found.`,short:`${r(e)} could not be found.`,hint:"Check the filename and try again."})}function D(e){return new o({code:"not-a-file",title:"Not a file",detail:`${r(e)} is not a file.`,short:`${r(e)} is not a file.`,hint:"Point Forge at an image, or at a directory of images."})}function J(e){return new o({code:"permission-denied",title:"Permission denied",detail:`${r(e)} could not be read.`,short:`${r(e)} could not be read.`,hint:"Check the file permissions and try again."})}function M(e){return new o({code:"not-a-directory",title:"Invalid path",detail:`${r(e)} could not be found: part of its path is not a directory.`,short:`part of ${r(e)}'s path is not a folder.`,hint:"Check the path and try again."})}function j(e){return new o({code:"symlink-loop",title:"Too many symbolic links",detail:`${r(e)} could not be resolved: its path contains a symbolic-link loop.`,short:`${r(e)}'s path loops back on itself.`,hint:"Check for a circular symlink somewhere in the path."})}function z(e){return new o({code:"path-too-long",title:"Path too long",detail:`${r(e)}'s path is too long for the filesystem to resolve.`,short:`${r(e)}'s path is too long.`,hint:"Use a shorter path and try again."})}function L(e,t){return new o({code:"unreadable-path",title:"Could not read path",detail:`${r(e)} could not be checked.`,short:`${r(e)} could not be checked.`,hint:"Check the path and try again.",cause:t})}function q(e,t){return new o({code:"unsupported-source",title:"Unsupported file type",detail:`${r(e)} is ${t}, which Forge cannot read.`,short:`${r(e)} is ${t}, which Forge cannot read.`,hint:"Forge 0.1 handles images only."})}function Y(e,t){return new o({code:"unsupported-source",title:"Not an image",detail:`${r(e)} is ${t}, not an image.`,hint:"A palette is taken from a photo, a screenshot or artwork."})}function V(e){return new o({code:"unsupported-source",title:"Nothing to take colours from",detail:`${r(e)} has no visible pixels.`})}function _(e,t=process.platform){if(t!=="darwin"){let n=t==="win32"?"Windows":t==="linux"?"Linux":"this system";return new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${r(e,t)} is a HEIC photo, which needs Forge's free HEIC extension on ${n}.`,short:"HEIC needs the heic extension.",hint:"Install it with: forge extensions add heic",shellHint:"Open /extensions to install it."})}return new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${r(e)} is a HEIC photo, which Forge decodes with the macOS sips tool.`,short:"HEIC needs sips, which could not be run.",hint:"sips could not be run. It ships with macOS at /usr/bin/sips."})}function X(e,t=process.platform){if(t!=="darwin"){let n=t==="win32"?"Windows":t==="linux"?"Linux":"this system";return new o({code:"raw-decoder-unavailable",title:"Cannot read RAW here",detail:`${r(e,t)} is a camera RAW photo, which needs Forge's free RAW extension on ${n}.`,short:"RAW needs the raw extension.",hint:"Install it with: forge extensions add raw",shellHint:"Open /extensions to install it."})}return new o({code:"raw-decoder-unavailable",title:"Cannot read RAW here",detail:`${r(e,t)} is a camera RAW photo, which Forge reads with macOS's own RAW support.`,short:"RAW needs sips, which could not be run.",hint:"sips could not be run. It ships with macOS at /usr/bin/sips."})}function B(e){return new o({code:"raw-decoder-unavailable",title:"Cannot read this RAW",detail:`${r(e)} is a camera RAW photo that this Mac cannot read.`,short:"macOS cannot read RAW photos from this camera.",hint:"A newer camera usually needs a newer macOS."})}function G(e,t){let n=r(e.path);if(t!==void 0&&t!==e.format){let i=s[t].label;return s[t].lossy?new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`Forge cannot search ${n} \u2192 ${i} toward a size yet.`,hint:"Convert it first, then compress the result with --max-size.",shellHint:"Convert it first, then /compress the result to a size."}):new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`${i} is lossless \u2014 there is no quality to trade away, so ${n} cannot be made to fit as ${i}.`,hint:"Drop --max-size, or choose a lossy target. forge --formats lists them.",shellHint:"Choose a lossy target to aim for a size."})}if(e.kind==="document"&&e.format==="pdf"){let i=e.images?.skipped??0;return new o({code:"unsupported-compress",title:"Nothing to compress",detail:i>0?`${n}'s images are a kind Forge cannot re-encode, so there is nothing to make smaller.`:`${n} has no images \u2014 it is text and layout, which compression cannot shrink.`,hint:"Try a page operation such as --extract to keep fewer pages, or --to <format> to turn its pages into images.",shellHint:"Try /pdf to keep fewer pages, or /convert to turn its pages into images."})}return e.kind==="document"?new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${n} is ${s[e.format].label}, which has no images Forge can re-encode.`,hint:`Use --to pdf to change it to PDF instead: forge ${n} --to pdf`,shellHint:"Use /convert to change it to PDF instead."}):new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${n} is ${s[e.format].label}, which is lossless \u2014 there is no quality to trade away.`,hint:"Use --to to change it to a smaller format instead. forge --formats lists them.",shellHint:"Use /convert to change it to a smaller format instead."})}function K(e){let t=r(e.path);return new o({code:"unsupported-pdf",title:"/pdf needs a PDF",detail:`${t} is ${s[e.format].label}, not a PDF.`,hint:"Converting it instead."})}function Q(e,t,n){return new o({code:"unsupported-operation",title:`Cannot ${e} these files`,detail:`Not available for these files: ${t}.`,hint:n??"Page operations work on PDFs: --merge takes two or more, the others take one.",shellHint:n??"Use /pdf with a PDF staged \u2014 two or more for merge."})}function Z(e,t,n){let i=e.kind==="media"?`The smallest ${r(e.path)} can get is ${l(n)}, which is still over ${l(t)}.`:`${r(e.path)} is ${l(n)} even at the lowest quality, which is still over ${l(t)}.`;return new o({code:"target-unreachable",title:"Cannot get that small",detail:i,hint:"Try a larger --max-size, or --to a smaller format.",shellHint:"Try a larger target, or /convert to a smaller format."})}function ee(e,t,n){return new o({code:"unsupported-target",title:`Can't convert ${r(e.path)} to ${t}`,detail:`${r(e.path)} is a ${s[e.format].label} ${e.kind==="image"?"image":"document"}.`,hint:`Available: ${n.join(", ")}`})}function te(e,t){return new o({code:"corrupt-source",title:"Damaged file",detail:`${r(e)} could not be read. It may be damaged, or not a format Forge recognises.`,short:`${r(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:t})}function oe(e,t,n){return new o({code:"corrupt-source",title:`Damaged ${s[t].label}`,detail:`${r(e)} is a ${s[t].label} file, but its content could not be read.`,short:`${r(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:n})}function ne(e,t={}){let n=r(e);return new o({code:"encrypted-source",title:"This PDF is password-protected",detail:`${n} is password-protected.`,short:`${n} is password-protected.`,hint:t.attempted?"That password didn't open it. Check it and try again.":`Convert it to images instead: forge ${n} --to jpeg --password-stdin`})}var p=e=>e==="convert"||e==="boost"||e==="remove-background";function re(e,t="convert"){return new o({code:"output-exists",title:"File already exists",detail:`${r(e)} is already there.`,hint:p(t)?"Pass --force to replace it, or choose a different --output.":"Pass --force to replace it, or move the existing file out of the way.",shellHint:"Run it again and Forge will ask before replacing it."})}function ie(e,t){return new o({code:"output-collision",title:"Two files want the same output",detail:`${r(e[0])} and ${r(e[1])} would both become ${r(t)}.`,hint:"Convert them separately, or use --output to send them to different folders.",shellHint:"Convert them one at a time."})}function ae(e,t){return new o({code:"output-collision",title:"One output, written twice",detail:`${r(e)} would write ${r(t)} twice, and only the second would survive.`,hint:"Every output has to be its own file. Check the selection for a repeated page."})}function se(e,t="convert"){return new o({code:"output-is-input",title:"Output would replace the original",detail:`${r(e)} is both the input and the output.`,hint:p(t)?"Choose a different --output, or pass --force to overwrite in place.":"Move or rename that file first, or pass --force to overwrite it in place.",shellHint:p(t)?"Choose a different folder to save it in.":"Move or rename that file first."})}function v(e,t){return new o({code:"permission-denied",title:"Permission denied",detail:`${r(F(e))} is not a folder you can write to.`,hint:"Choose a different --output, or check the folder permissions.",shellHint:"Choose a different folder, or check its permissions.",cause:t})}var k=new Set(["EACCES","EPERM","EROFS"]);function le(e,t){if(E(t))return t;let n=t?.code;return n!==void 0&&k.has(n)?v(e,t):t}function de(e,t){return new o({code:"output-invalid",title:"Cannot write there",detail:`${e} could not be written to.`,hint:"Check that the path is valid and that you have permission to write to it.",cause:t})}function ue(e){return new o({code:"empty-directory",title:"No images found",detail:`${r(e)} contains no images Forge can convert.`,hint:"Try --recursive to look inside subfolders.",shellHint:"Only files directly inside a folder are read \u2014 drop the files themselves, or the folder that holds them."})}function ce(e,t){return new o({code:"invalid-arguments",title:"Invalid arguments",detail:e,hint:t})}function pe(e,t,n){return new o({code:"invalid-page-range",title:"Page range not understood",detail:t,hint:`This document has ${n} pages. Use numbers and spans, like "3-7, 12, 20-".`})}function he(e){return new o({code:"empty-selection",title:"Nothing to write",detail:e,hint:"Select at least one page to keep."})}function ge(e){return new o({code:"invalid-dpi",title:"Invalid resolution",detail:`${String(e)} is not a resolution Forge can use.`,hint:"Give a number between 36 and 600. The default is 150."})}function fe(e){return new o({code:"extension-missing",title:"Extension not installed",detail:`${e} is an optional extension and is not installed.`,hint:`Install it with: forge extensions add ${e}`,shellHint:"Open /extensions to install it."})}function me(e,t,n,i){return new o({code:"extension-outdated",title:"Extension out of date",detail:`${e} ${n} cannot ${t}; that needs ${i} or later.`,hint:`Update it with: forge extensions add ${e}`,shellHint:"Open /extensions to update it."})}function we(e,t){return new o({code:"extension-corrupt",title:"Extension failed verification",detail:`${e}: ${t}`,hint:`Nothing was installed. Try again with: forge extensions add ${e}`,shellHint:"Nothing was installed. Try again from /extensions."})}function be(e,t,n=process.platform){let i=n==="win32"?"PC":n==="darwin"?"Mac":"computer";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} cannot be installed on this ${i}: ${t}`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function xe(e,t=process.platform){let n=t==="win32"?"Windows":t==="darwin"?"macOS":t==="linux"?"Linux":"this system";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} is not available on ${n}.`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function $e(e){return new o({code:"update-unavailable",title:"Cannot update this Forge",detail:`This copy of Forge was not installed with npm i -g, so ${e} cannot be installed over it.`,hint:"npm i -g forge-terminal"})}function ye(e,t=process.platform){return t==="win32"?new o({code:"update-denied",title:"Forge is in use",detail:`npm could not replace Forge's files to update it to ${e}. Windows keeps them locked while Forge runs: close every Forge window, then run the command below. If Node is installed for every user, run it in a terminal opened as administrator.`,short:"Windows locks Forge while it runs: close it, then run this",hint:`npm i -g forge-terminal@${e}`}):new o({code:"update-denied",title:"npm needs permission",detail:`npm needs permission to update Forge to ${e}.`,short:"npm needs permission to update Forge",hint:`sudo npm i -g forge-terminal@${e}`})}function Fe(e,t){return new o({code:"update-failed",title:"Update failed",detail:`npm could not install Forge ${e}: ${t}`,short:"npm could not install the update",hint:`npm i -g forge-terminal@${e}`})}function Ee(){return new o({code:"update-unreachable",title:"Could not check for updates",detail:"The npm registry could not be reached.",short:"could not reach npm",hint:"Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge update",shellHint:"Check your connection, then try again."})}function ve(e,t){return new o({code:"extension-download-failed",title:"Download failed",detail:`${e}: ${t}`,hint:`Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge extensions add ${e}`,shellHint:"Check your connection, then try again from /extensions."})}function ke(e,t){return new o({code:"extension-download-failed",title:"Not enough disk space",detail:`${e}: ${t}`,hint:`Free some disk space, then run: forge extensions add ${e}`,shellHint:"Free some disk space, then try again from /extensions."})}function Ce(e,t,n){let i=t?t.what?`${t.what} (forge, pid ${t.pid})`:`another forge (pid ${t.pid}) is using it`:"another forge is using it";return new o({code:"extension-in-use",title:"Extension in use",detail:`${e} is in use: ${i}.`,hint:n==="remove"?`Wait for that job to finish, then run: forge extensions remove ${e}`:"Wait for that job to finish, then try again.",shellHint:n==="remove"?"It can be removed when that job finishes.":"Try again when that job finishes."})}function Se(e){return new o({code:"no-subject",title:"No subject found",detail:`${r(e)} has no clear subject to cut out.`,hint:"Try a photo where the subject stands apart from the background."})}function Te(e,t,n){return n===1?new o({code:"boost-too-large",title:"Too large to sharpen",detail:`${r(e)} is too large to sharpen.`,hint:"Sharpen works on images up to 16,384 px a side and 100 megapixels."}):new o({code:"boost-too-large",title:"Too large to boost",detail:t>=2?`${r(e)} is too large to boost that far; ${t}x is the most it can take.`:`${r(e)} is already too large to boost.`,hint:t>=2?`Try --boost ${t}.`:"Boost works on images up to 100 megapixels.",shellHint:t>=2?`Choose ${t}x instead.`:void 0})}function Ne(e,t,n,i=process.platform){let a=n===1?"sharpen":"boost",d=i==="win32"?"PC":i==="darwin"?"Mac":"computer",u=Math.max(1,Math.round(t/60));return new o({code:"boost-too-slow",title:`Too slow to ${a}`,detail:`${r(e)} would take about ${u} ${u===1?"minute":"minutes"} to ${a} on this ${d}.`,hint:"Try a smaller photo."})}function Pe(e,t){return new o({code:"resize-too-large",title:"Too large to resize to",detail:`${r(e)} would be ${t.width} \xD7 ${t.height}.`,hint:"Resize works up to 16,384 px a side and 100 megapixels."})}var C={darwin:"\u2303\u21E7\u23184",win32:"Win+Shift+S"};function Ie(e,t=process.platform){let n=C[t];return new o({code:"no-clipboard-image",title:"No image",detail:e==="text"?"The clipboard holds text, not a picture.":"The clipboard is empty.",hint:n===void 0?"Copy a picture or a screenshot, then run forge clip again.":`Copy a picture, or take a screenshot with ${n}, then run forge clip again.`})}function He(e=process.platform){return new o({code:"clipboard-unavailable",title:"No clipboard",detail:e==="linux"?"Forge reads the clipboard of a Wayland or X11 desktop, and not over SSH.":"Forge reads the clipboard on macOS, Windows and Linux, and not over SSH."})}function Re(e){return new o({code:"clipboard-tool-missing",title:`Clipboard needs ${e}`,detail:`Forge reaches the clipboard through ${e}, and it is not on this computer.`,short:`${e} is not on this computer`,hint:`Install it with sudo apt install ${e} (or your distribution's package manager), then try again.`})}function Oe(){return new o({code:"nothing-to-undo",title:"Nothing to undo",detail:"No copied image has been changed yet."})}function Ae(e,t,n,i=!1){let a=r(e);if(i)return new o({code:"cannot-compress-more",title:"Cannot compress more",detail:`${a} is no smaller even at the lowest quality, so nothing was written.`,short:"nothing written"});let d=n>t?`would grow from ${l(t)} to ${l(n)}`:`would stay at ${l(t)}`;return new o({code:"cannot-compress-more",title:"Cannot compress more",detail:`${a} ${d}, so nothing was written.`,short:"nothing written",hint:"Try a lower --quality.",shellHint:"Try a lower quality."})}function Ue(e,t,n){return new o({code:"cannot-compress-more",title:"Already small enough",detail:`${r(e)} is ${l(t)}, already under ${l(n)}, so nothing was written.`,short:"already under that size"})}function We(e){return new o({code:"nothing-to-trim",title:"Nothing to trim",detail:`${r(e)} has no empty edges.`,short:"no empty edges"})}function De(e){return new o({code:"animated-trim",title:"Can't trim an animation",detail:`${r(e)} is animated; trimming works on still images.`})}function Je(e,t){return new o({code:"nothing-to-crop",title:"Nothing to crop",detail:`${r(e)} is already ${t}.`,short:`already ${t}`})}function Me(e){return new o({code:"animated-crop",title:"Can't crop an animation",detail:`${r(e)} is animated; cropping works on still images.`})}function je(e){return new o({code:"animated-rotate",title:"Can't rotate an animation",detail:`${r(e)} is animated; rotating works on still images.`})}function ze(e,t=process.platform,n=!1){let i=h(t),a=n?`forge extensions add video (or ${i})`:t==="linux"?`${i} (or your distribution's package manager)`:i;return new o({code:"ffmpeg-missing",title:"Video and audio need ffmpeg",detail:`${r(e)} is a video or audio file, and ffmpeg is not on this computer.`,short:"ffmpeg is not on this computer",hint:`Install it with ${a}, then run Forge again.`})}function Le(e,t,n=process.platform){let i=s[e].label,a=/^[AEFHILMNORSX]/.test(t.codec)?"an":"a",d=t.encoders,u=d.length>1?`${d.slice(0,-1).join(", ")} or ${d.at(-1)}`:d[0]??"",w=d.length>1?"any of them":"it",b=n==="linux"?"Install a full build of ffmpeg, then run Forge again. On Fedora, RPM Fusion's ffmpeg replaces ffmpeg-free.":n==="win32"?`Install a full build of ffmpeg, such as gyan.dev's (${h(n)}), then run Forge again.`:`Install a full build of ffmpeg (${h(n)}), then run Forge again.`;return new o({code:"encoder-missing",title:`Your ffmpeg can't write ${i}`,detail:`${i} needs ${a} ${t.codec} encoder${t.sound?" for its sound":""}: ${u}. Your ffmpeg was built without ${w}.`,short:`Your ffmpeg has no ${t.codec} encoder`,hint:b})}function h(e=process.platform){return e==="win32"?"winget install ffmpeg":e==="linux"?"sudo apt install ffmpeg":"brew install ffmpeg"}function qe(e,t){return new o({code:"conversion-failed",title:"Conversion failed",detail:`${r(e)} could not be converted.`,hint:"Run again with --debug for the underlying error.",shellHint:"Run the same conversion with forge --debug from the command line to see why.",cause:t})}function Ye(e){return new o({code:"no-sound",title:"Nothing to transcribe",detail:`${r(e)} has no sound.`})}function Ve(e,t=process.platform,n=t==="darwin"?"apple":"whisper"){return n==="whisper"?new o({code:"unsupported-source",title:"Cannot transcribe this file",detail:`${r(e,t)} cannot be read by whisper.`,hint:"Video and sound files can be transcribed."}):new o({code:"unsupported-source",title:"Cannot transcribe this file",detail:`${r(e)} cannot be read by Apple's speech recogniser.`,hint:"MP4, MOV, M4A, MP3, WAV and AIFF can be transcribed; with ffmpeg (brew install ffmpeg), any video or sound file."})}function _e(e,t=process.platform,n=t==="darwin"?"apple":"whisper"){let i=n==="apple"?"Apple's speech recogniser":"The whisper extension";return new o({code:"language-unsupported",title:"Language not supported",detail:`${i} does not support ${e}.`,hint:"Pass another with --language, for example --language en-US."})}function Xe(e,t,n={}){return new o({code:"link-unavailable",title:"Cannot transcribe this link",detail:e,...n,...t===void 0?{}:{cause:t}})}function Be(e){return new o({code:"transcribe-unavailable",title:"Transcribe is not available",detail:e})}function Ge(e=!1){return e?new o({code:"read-unavailable",title:"Reading text is not available",detail:"Reading text needs Forge's free read-text extension.",short:"Needs the read-text extension.",hint:"Install it with: forge extensions add read-text",shellHint:"Open /extensions to install it."}):new o({code:"read-unavailable",title:"Reading text is not available",detail:"Reading text needs macOS 26 or later.",short:"Reading text needs macOS 26 or later."})}function Ke(e){let t=r(e);return new o({code:"no-text",title:"No text found",detail:`No text found in ${t}`,short:`No text found in ${t}`})}function Qe(e){return new o({code:"unexpected",title:"Something went wrong",detail:e instanceof Error?e.message:String(e),hint:"This was not expected. Try again \u2014 if it keeps happening, it may be worth reporting.",cause:e})}function Ze(e,t={}){let n=[`\u2715 ${e.title}`,"",` ${e.detail}`];return e.hint&&n.push("",` ${e.hint}`),t.debug&&e.cause instanceof Error&&n.push("",` ${e.cause.stack??e.cause.message}`),n}export{c as a,I as b,r as c,E as d,W as e,D as f,J as g,M as h,j as i,z as j,L as k,q as l,Y as m,V as n,_ as o,X as p,B as q,G as r,K as s,Q as t,Z as u,ee as v,te as w,oe as x,ne as y,re as z,ie as A,ae as B,se as C,v as D,le as E,de as F,ue as G,ce as H,pe as I,he as J,ge as K,fe as L,me as M,we as N,be as O,xe as P,$e as Q,ye as R,Fe as S,Ee as T,ve as U,ke as V,Ce as W,Se as X,Te as Y,Ne as Z,Pe as _,Ie as $,He as aa,Re as ba,Oe as ca,Ae as da,Ue as ea,We as fa,De as ga,Je as ha,Me as ia,je as ja,ze as ka,Le as la,h as ma,qe as na,Ye as oa,Ve as pa,_e as qa,Xe as ra,Be as sa,Ge as ta,Ke as ua,Qe as va,Ze as wa};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- var v="0.4.5",x={ok:"\u2713",fail:"\u2715",warn:"\u26A0",cursor:"\u276F",strip:"\u258C",star:"\u2605",arrow:"\u2192",tip:"\u2727",longArrow:"\u2500\u2500\u2192",longArrowDown:`\u2502
3
+ var v="0.5.0",x={ok:"\u2713",fail:"\u2715",warn:"\u26A0",cursor:"\u276F",strip:"\u258C",star:"\u2605",arrow:"\u2192",tip:"\u2727",longArrow:"\u2500\u2500\u2192",longArrowDown:`\u2502
4
4
  \u25BC`,dotFilled:"\u25CF",dotEmpty:"\u25CB"},f={name:"dark",fg:"#e7e7e7",dim:"#b0b0b0",accent:"#e5a23c",ok:"#6fcf7f",warn:"#e5c07b",fail:"#e8796d",failTint:"#2e2020",failTintDim:"#b0b0b0",larger:"#f2994a",shedHatch:"#47774f",grownFill:"#403225",tag:"#63c1d8",label:"#a68ce0",modeConvert:"#55c7d9",modeConvertBg:"#122c33",modeCompress:"#79c98b",modeCompressBg:"#182c1e",modePdf:"#ff6b4a",modePdfBg:"#361c16",modeColour:"#f27ba8",modeColourBg:"#3a1e2b",modeEdit:"#b39ae8",modeEditBg:"#2a2238",modeTranscribe:"#e63946",modeTranscribeBg:"#3a1a1d",border:"#808080",selectionBg:"#2c2c2c",band:"#2c2c2c",canvas:"#1e1e1e",textSelectionBg:"#3f5c86",brand:"#e5a23c",keycapBg:"#333333",violet:"#a68ce0",faint:"#4d4d4d",listBand:"#323232",shelf:"#242424",tabChip:"#262626",panelBand:"#404040",ink:"#0c1d22",track:"#2e2e2e",trackFill:"#515151",thumb:"#e7e7e7",folderChip:"#414141",pill:"#e7e7e7",fieldBand:"#3d3d3d",defaultTagBg:"#33261a",defaultTag:"#c98a4b",newTagBg:"#2a3448",newTag:"#4f77c5"},o={name:"light",fg:"#262626",dim:"#4f4f4f",accent:"#915a01",ok:"#0e702c",warn:"#8a6100",fail:"#a43c32",failTint:"#f9e3df",failTintDim:"#4a4a4a",larger:"#8b4d01",shedHatch:"#87b896",grownFill:"#ece3d6",tag:"#0a6b86",label:"#5e4b99",modeConvert:"#036b7b",modeConvertBg:"#e6f7fa",modeCompress:"#24733a",modeCompressBg:"#eaf5ec",modePdf:"#b82a06",modePdfBg:"#fceee9",modeColour:"#b0306a",modeColourBg:"#f7e3ec",modeEdit:"#64569f",modeEditBg:"#f0ebfa",modeTranscribe:"#c0102c",modeTranscribeBg:"#fef0ef",border:"#767676",selectionBg:"#e4e4e4",band:"#e4e4e4",canvas:"#ffffff",textSelectionBg:"#b9cfe8",brand:"#915a01",keycapBg:"#e1e1e1",violet:"#5e4b99",faint:"#b2b2b2",listBand:"#dcdcdc",shelf:"#f3f3f3",tabChip:"#f0f0f0",panelBand:"#d5d5d5",ink:"#ffffff",track:"#e4e4e4",trackFill:"#afafaf",thumb:"#262626",folderChip:"#d0d0d0",pill:"#262626",fieldBand:"#d7d7d7",defaultTagBg:"#f5e2cc",defaultTag:"#8f5000",newTagBg:"#e1e7f4",newTag:"#3358a3"},i={name:"neutral",fg:"",dim:"gray",accent:"yellow",ok:"green",warn:"yellow",fail:"red",failTint:"",failTintDim:"gray",larger:"yellow",shedHatch:"green",grownFill:"",tag:"cyan",label:"magenta",modeConvert:"cyan",modeConvertBg:"",modeCompress:"green",modeCompressBg:"",modePdf:"red",modePdfBg:"",modeColour:"magenta",modeColourBg:"",modeEdit:"magenta",modeEditBg:"",modeTranscribe:"redBright",modeTranscribeBg:"",border:"gray",selectionBg:"",band:"",canvas:"",textSelectionBg:"",brand:"yellow",keycapBg:"",violet:"magenta",faint:"gray",listBand:"",shelf:"",tabChip:"",panelBand:"",ink:"",track:"",trackFill:"",thumb:"",folderChip:"",pill:"",fieldBand:"",defaultTagBg:"",defaultTag:"",newTagBg:"",newTag:""},d=["convert","compress","pdf","edit","transcribe","colour"],k=`1\u2013${d.length}`;function E(e,t){let r=d,n=e==="menu"?r.length:r.indexOf(e),a=Math.max(0,Math.min(r.length-1,n+t));return r[a]}function P(e){return/^[1-9]$/.test(e)?d[Number(e)-1]:void 0}var S={convert:"\u2194",compress:"\u2193",pdf:"\u25A3",colour:"\u25D0",edit:"\u2726",transcribe:"\xB6"},c="#7d6ad0",l="#cc8ae2";function s(e,t){return t==="compress"?{fg:e.modeCompress,bg:e.modeCompressBg}:t==="pdf"?{fg:e.modePdf,bg:e.modePdfBg}:t==="colour"?{fg:e.modeColour,bg:e.modeColourBg}:t==="edit"?{fg:e.modeEdit,bg:e.modeEditBg}:t==="transcribe"?{fg:e.modeTranscribe,bg:e.modeTranscribeBg}:{fg:e.modeConvert,bg:e.modeConvertBg}}var g=["#f26e69","#e5a23c","#ace02c","#55c7d9","#6579fd","#ad95e9"],b=["#e5a23c","#f2cf6b"],m={convert:["#1e96a7","#1e94b3","#1e92c0","#1d8ed2","#1b86ef","#4a7df8","#6974f8","#816af8","#995cf8"],compress:["#24b459","#22ab6d","#21a479","#209f81","#1f9c89","#1f9a91","#1e9998","#1e97a0","#1e96a7"],pdf:["#eb4319","#e3541a","#de601b","#db6a1c","#d9731d","#d87c1e","#d8841f","#d98c20","#d99522"],edit:["#9b5af8","#985cf8","#965ef8","#945ff8","#9161f8","#8f62f8","#8d64f8","#8a65f8","#8867f8"],transcribe:["#f3233e","#f12259","#ee2270","#ea2186","#e6219b","#e121b0","#da22c6","#d122dc","#c723f2"],colour:["#f42335","#e05b1a","#d87d1e","#da9b23","#d2b427","#b4c027","#5bbf23","#20a27c","#1e989b","#1e94b6","#1c8cd9","#577af8","#7371f8","#8568f8","#965df8"]},u=["#d99522","#da9822","#da9b23","#da9f24","#d9a224","#d9a525","#d8a825","#d7ab26","#d6ad26"],B={convert:["#d6f7fd","#ddf5fe","#e1f4fe","#e4f2fe","#e7f1fe","#eaf0fe","#eceffe","#efeefe","#f1edfe"],compress:["#e0f7e4","#def8e7","#dcf8ea","#daf8ed","#d8f8f1","#d7f8f4","#d6f8f7","#d6f8fa","#d6f7fd"],pdf:["#feece7","#feece6","#feece5","#feece3","#feece2","#feede0","#feedde","#feeddc","#feeed9"],edit:["#f2edfe","#f1edfe","#f1edfe","#f1eefe","#f0eefe","#f0eefe","#f0eefe","#f0eefe","#efeefe"],transcribe:["#feebea","#feebec","#feebee","#feeaf0","#feeaf2","#feeaf5","#fee9f9","#fde9fd","#f9eafe"],colour:["#feebe9","#feece5","#feede0","#feeed7","#f7f1d6","#eff3d9","#e5f6df","#dbf8eb","#d6f8f8","#def5fe","#e5f2fe","#ebf0fe","#edeffe","#efeefe","#f1edfe"]},p=["#feeed9","#feeed8","#feeed7","#fdeed6","#fcefd6","#fbefd6","#fbefd6","#faefd6","#f9f0d6"],T={convert:["#138291","#8467bd"],compress:["#2b8748","#138291"],pdf:["#d54322","#a06c10"],edit:["#8567bc","#7b67cd"],transcribe:["#df3140","#9c5cb1"],colour:["#cb4b49","#a06c10","#618110","#138291","#5869ec","#8268bd"]};function C(e,t){return e.name==="light"?t==="menu"?u:m[t]:t==="menu"?e.name==="dark"?b:[e.brand]:t==="compress"?[e.modeCompress,e.modeConvert]:t==="pdf"?[e.modePdf,e.brand]:t==="colour"?e.name==="dark"?g:[e.modeColour,e.violet]:t==="edit"?[e.modeEdit,e.name==="dark"?c:e.violet]:t==="transcribe"?[e.modeTranscribe,e.name==="dark"?l:e.violet]:[e.modeConvert,e.violet]}function y(e,t){if(e.name==="light")return t==="menu"?p:B[t]}function w(e,t){return e.name==="light"?T[t]:C(e,t)}function M(e){return{...e,accent:e.brand,tag:e.brand,label:e.brand}}function R(e,t){let{fg:r,bg:n}=s(e,t);return{...e,accent:r,tag:r,label:r,band:n===""?e.band:n}}function H(e){return e.canvas!==""}function O(e){return e==="dark"?f:e==="light"?o:i}function D(e){return e===""?void 0:e}var _={filled:"\u2501",empty:"\u2501",knob:"\u25CF"};function h(){return process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!==""?!1:process.stdout.isTTY===!0}function F(){h()||(process.env.FORCE_COLOR="0")}export{v as a,x as b,f as c,o as d,i as e,d as f,k as g,E as h,P as i,S as j,s as k,C as l,y as m,w as n,M as o,R as p,H as q,O as r,D as s,_ as t,h as u,F as v};