forge-terminal 0.1.0 → 0.2.1
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 +333 -24
- package/dist/chunks/adm-zip-SQKLKBDP.js +3 -0
- package/dist/chunks/available-HEUREG6L.js +3 -0
- package/dist/chunks/boot-BUGERSEB.js +3 -0
- package/dist/chunks/catalog-NTACQH5V.js +3 -0
- package/dist/chunks/cfb-V6M2PYOD.js +13 -0
- package/dist/chunks/chunk-2WYHI73Y.js +3 -0
- package/dist/chunks/chunk-4YCO7S4K.js +3 -0
- package/dist/chunks/chunk-5B7WODWH.js +3 -0
- package/dist/chunks/chunk-C2WYXNRM.js +4 -0
- package/dist/chunks/chunk-C7OOWUMU.js +3 -0
- package/dist/chunks/chunk-EOYBXOCV.js +4 -0
- package/dist/chunks/chunk-G2D6BKOS.js +4 -0
- package/dist/chunks/chunk-HUAEVW2A.js +3 -0
- package/dist/chunks/chunk-J7FLFHQJ.js +3 -0
- package/dist/chunks/chunk-L76Q54MB.js +3 -0
- package/dist/chunks/chunk-LFE3WRU4.js +3 -0
- package/dist/chunks/chunk-PBIS2ONZ.js +3 -0
- package/dist/chunks/chunk-PD5DFBCU.js +3 -0
- package/dist/chunks/chunk-PN73WK2S.js +3 -0
- package/dist/chunks/chunk-QVACE4IE.js +3 -0
- package/dist/chunks/chunk-TEGB7JRM.js +3 -0
- package/dist/chunks/chunk-TMUK2DD3.js +3 -0
- package/dist/chunks/chunk-UNVHKJW4.js +41 -0
- package/dist/chunks/chunk-VH5RWPGZ.js +10 -0
- package/dist/chunks/chunk-XFEHJ4C7.js +3 -0
- package/dist/chunks/chunk-YXDEOLNA.js +3 -0
- package/dist/chunks/colour-DE6N6AZO.js +3 -0
- package/dist/chunks/config-command-SQXRTBRO.js +3 -0
- package/dist/chunks/dist-J2V6ITHG.js +29 -0
- package/dist/chunks/es-T2U7NBLD.js +3 -0
- package/dist/chunks/execute-M3C3TTWB.js +3 -0
- package/dist/chunks/extensions-command-HJDBUBYO.js +3 -0
- package/dist/chunks/image-GYUUMS6H.js +3 -0
- package/dist/chunks/launch-WBUFRVQ7.js +65 -0
- package/dist/chunks/lib-TPEJ5CJJ.js +46 -0
- package/dist/chunks/lock-XD4L3WFM.js +3 -0
- package/dist/chunks/manager-KBJTXZ27.js +4 -0
- package/dist/chunks/paths-JUM6GKQU.js +3 -0
- package/dist/chunks/pdf-compress-IMRFBLZF.js +3 -0
- package/dist/chunks/react-devtools-core-UM4FS6CU.js +3 -0
- package/dist/chunks/run-RXVQD4DZ.js +4 -0
- package/dist/chunks/server-DU7QWDAH.js +73 -0
- package/dist/chunks/theme-DESCJOCE.js +3 -0
- package/dist/chunks/word-OGQ2KZAJ.js +24 -0
- package/dist/index.js +67 -95
- package/dist/third-party-licenses.txt +2856 -0
- package/package.json +28 -21
- package/skills/forge/SKILL.md +149 -0
- package/dist/cli/args.js +0 -278
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-command.js +0 -55
- package/dist/cli/config-command.js.map +0 -1
- package/dist/cli/execute.js +0 -377
- package/dist/cli/execute.js.map +0 -1
- package/dist/cli/report.js +0 -123
- package/dist/cli/report.js.map +0 -1
- package/dist/cli/spinner.js +0 -60
- package/dist/cli/spinner.js.map +0 -1
- package/dist/cli/stdin.js +0 -47
- package/dist/cli/stdin.js.map +0 -1
- package/dist/config/preferences.js +0 -143
- package/dist/config/preferences.js.map +0 -1
- package/dist/core/actions/compress.js +0 -157
- package/dist/core/actions/compress.js.map +0 -1
- package/dist/core/actions/convert.js +0 -270
- package/dist/core/actions/convert.js.map +0 -1
- package/dist/core/actions/extract.js +0 -94
- package/dist/core/actions/extract.js.map +0 -1
- package/dist/core/actions/index.js +0 -23
- package/dist/core/actions/index.js.map +0 -1
- package/dist/core/actions/merge.js +0 -16
- package/dist/core/actions/merge.js.map +0 -1
- package/dist/core/actions/rotate.js +0 -36
- package/dist/core/actions/rotate.js.map +0 -1
- package/dist/core/actions/split.js +0 -65
- package/dist/core/actions/split.js.map +0 -1
- package/dist/core/atomic.js +0 -61
- package/dist/core/atomic.js.map +0 -1
- package/dist/core/capabilities.js +0 -59
- package/dist/core/capabilities.js.map +0 -1
- package/dist/core/compress.js +0 -76
- package/dist/core/compress.js.map +0 -1
- package/dist/core/describe.js +0 -49
- package/dist/core/describe.js.map +0 -1
- package/dist/core/errors.js +0 -469
- package/dist/core/errors.js.map +0 -1
- package/dist/core/execute-jobs.js +0 -122
- package/dist/core/execute-jobs.js.map +0 -1
- package/dist/core/formats.js +0 -108
- package/dist/core/formats.js.map +0 -1
- package/dist/core/order.js +0 -44
- package/dist/core/order.js.map +0 -1
- package/dist/core/output-path.js +0 -176
- package/dist/core/output-path.js.map +0 -1
- package/dist/core/pages.js +0 -107
- package/dist/core/pages.js.map +0 -1
- package/dist/core/pdf-compress.js +0 -206
- package/dist/core/pdf-compress.js.map +0 -1
- package/dist/core/plan.js +0 -42
- package/dist/core/plan.js.map +0 -1
- package/dist/core/resolve.js +0 -115
- package/dist/core/resolve.js.map +0 -1
- package/dist/core/run.js +0 -66
- package/dist/core/run.js.map +0 -1
- package/dist/core/suggest.js +0 -50
- package/dist/core/suggest.js.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/units.js +0 -94
- package/dist/core/units.js.map +0 -1
- package/dist/core/write-safety.js +0 -128
- package/dist/core/write-safety.js.map +0 -1
- package/dist/engines/heic.js +0 -166
- package/dist/engines/heic.js.map +0 -1
- package/dist/engines/image.js +0 -342
- package/dist/engines/image.js.map +0 -1
- package/dist/engines/pdf.js +0 -444
- package/dist/engines/pdf.js.map +0 -1
- package/dist/engines/pdfium.js +0 -161
- package/dist/engines/pdfium.js.map +0 -1
- package/dist/engines/registry.js +0 -65
- package/dist/engines/registry.js.map +0 -1
- package/dist/engines/types.js +0 -2
- package/dist/engines/types.js.map +0 -1
- package/dist/engines/word.js +0 -385
- package/dist/engines/word.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/shell/App.js +0 -1972
- package/dist/shell/App.js.map +0 -1
- package/dist/shell/ClickTargets.js +0 -183
- package/dist/shell/ClickTargets.js.map +0 -1
- package/dist/shell/ThemeContext.js +0 -21
- package/dist/shell/ThemeContext.js.map +0 -1
- package/dist/shell/blocks.js +0 -160
- package/dist/shell/blocks.js.map +0 -1
- package/dist/shell/clipboard.js +0 -64
- package/dist/shell/clipboard.js.map +0 -1
- package/dist/shell/commands.js +0 -51
- package/dist/shell/commands.js.map +0 -1
- package/dist/shell/components/Banner.js +0 -73
- package/dist/shell/components/Banner.js.map +0 -1
- package/dist/shell/components/CommandPalette.js +0 -37
- package/dist/shell/components/CommandPalette.js.map +0 -1
- package/dist/shell/components/FileCard.js +0 -59
- package/dist/shell/components/FileCard.js.map +0 -1
- package/dist/shell/components/HintBar.js +0 -18
- package/dist/shell/components/HintBar.js.map +0 -1
- package/dist/shell/components/Hints.js +0 -21
- package/dist/shell/components/Hints.js.map +0 -1
- package/dist/shell/components/MergeList.js +0 -268
- package/dist/shell/components/MergeList.js.map +0 -1
- package/dist/shell/components/ModeHeader.js +0 -21
- package/dist/shell/components/ModeHeader.js.map +0 -1
- package/dist/shell/components/PageGrid.js +0 -324
- package/dist/shell/components/PageGrid.js.map +0 -1
- package/dist/shell/components/PathInput.js +0 -147
- package/dist/shell/components/PathInput.js.map +0 -1
- package/dist/shell/components/Progress.js +0 -43
- package/dist/shell/components/Progress.js.map +0 -1
- package/dist/shell/components/Prompt.js +0 -667
- package/dist/shell/components/Prompt.js.map +0 -1
- package/dist/shell/components/ResultLinks.js +0 -26
- package/dist/shell/components/ResultLinks.js.map +0 -1
- package/dist/shell/components/Select.js +0 -152
- package/dist/shell/components/Select.js.map +0 -1
- package/dist/shell/components/Slider.js +0 -48
- package/dist/shell/components/Slider.js.map +0 -1
- package/dist/shell/components/StagedFiles.js +0 -92
- package/dist/shell/components/StagedFiles.js.map +0 -1
- package/dist/shell/components/ThemePicker.js +0 -18
- package/dist/shell/components/ThemePicker.js.map +0 -1
- package/dist/shell/components/UnitRow.js +0 -30
- package/dist/shell/components/UnitRow.js.map +0 -1
- package/dist/shell/flows/pdf.js +0 -424
- package/dist/shell/flows/pdf.js.map +0 -1
- package/dist/shell/frame-geometry.js +0 -56
- package/dist/shell/frame-geometry.js.map +0 -1
- package/dist/shell/hyperlink.js +0 -27
- package/dist/shell/hyperlink.js.map +0 -1
- package/dist/shell/intro.js +0 -101
- package/dist/shell/intro.js.map +0 -1
- package/dist/shell/launch.js +0 -75
- package/dist/shell/launch.js.map +0 -1
- package/dist/shell/mark.js +0 -134
- package/dist/shell/mark.js.map +0 -1
- package/dist/shell/mouse.js +0 -209
- package/dist/shell/mouse.js.map +0 -1
- package/dist/shell/redraw.js +0 -36
- package/dist/shell/redraw.js.map +0 -1
- package/dist/shell/reveal.js +0 -24
- package/dist/shell/reveal.js.map +0 -1
- package/dist/shell/stage.js +0 -34
- package/dist/shell/stage.js.map +0 -1
- package/dist/shell/terminal-write.js +0 -16
- package/dist/shell/terminal-write.js.map +0 -1
- package/dist/shell/theme.js +0 -178
- package/dist/shell/theme.js.map +0 -1
- package/dist/shell/useFrameOrigin.js +0 -175
- package/dist/shell/useFrameOrigin.js.map +0 -1
- package/dist/shell/useKeys.js +0 -28
- package/dist/shell/useKeys.js.map +0 -1
- package/dist/shell/useMouse.js +0 -150
- package/dist/shell/useMouse.js.map +0 -1
- package/dist/shell/useMouseRouting.js +0 -69
- package/dist/shell/useMouseRouting.js.map +0 -1
- package/dist/shell/width.js +0 -62
- package/dist/shell/width.js.map +0 -1
- package/dist/utils/display-path.js +0 -31
- package/dist/utils/display-path.js.map +0 -1
- package/dist/utils/unescape-path.js +0 -68
- package/dist/utils/unescape-path.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a}from"./chunk-J7FLFHQJ.js";import{homedir as c}from"node:os";import{basename as h,isAbsolute as g,relative as f,sep as m}from"node:path";var p=/[\u0000-\u001f\u007f-\u009f--]/g;function l(e){return e.replace(p,"?")}function u(e,t){let r=f(t,e);if(r==="")return"";if(!(r===".."||r.startsWith(`..${m}`)||g(r)))return r}function C(e,t={}){return l(w(e,t))}function w(e,t){if(t.cwd!==void 0){let i=u(e,t.cwd);if(i!==void 0)return i===""?".":i}let r=u(e,t.home??c());return r!==void 0?r===""?"~":`~/${r}`:e}function n(e){return l(h(e))}var s={jpeg:{id:"jpeg",label:"JPEG",extensions:[".jpg",".jpeg"],hasAlpha:!1,animatable:!1,lossy:!0,hint:"universal",defaultQuality:82},png:{id:"png",label:"PNG",extensions:[".png"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"lossless"},webp:{id:"webp",label:"WebP",extensions:[".webp"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smaller, modern",defaultQuality:80},avif:{id:"avif",label:"AVIF",extensions:[".avif"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smallest",defaultQuality:50},heic:{id:"heic",label:"HEIC",extensions:[".heic",".heif"],hasAlpha:!0,animatable:!1,lossy:!0,hint:"Apple photos"},gif:{id:"gif",label:"GIF",extensions:[".gif"],hasAlpha:!0,animatable:!0,lossy:!1,hint:"animation"},tiff:{id:"tiff",label:"TIFF",extensions:[".tif",".tiff"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"archival"},pdf:{id:"pdf",label:"PDF",extensions:[".pdf"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"document"},docx:{id:"docx",label:"DOCX",extensions:[".docx"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"Word document"},doc:{id:"doc",label:"DOC",extensions:[".doc"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"legacy Word"}},T=Object.keys(s);function S(e){return s[e.toLowerCase()]}function H(e){let t=s[e].extensions[0];if(!t)throw new Error(`format ${e} declares no extensions`);return t}import{dirname as x}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 b(e){return e instanceof o}function O(e){return new o({code:"file-not-found",title:"File not found",detail:`${n(e)} could not be found.`,short:`${n(e)} could not be found.`,hint:"Check the filename and try again."})}function z(e){return new o({code:"not-a-file",title:"Not a file",detail:`${n(e)} is not a file.`,short:`${n(e)} is not a file.`,hint:"Point Forge at an image, or at a directory of images."})}function R(e){return new o({code:"permission-denied",title:"Permission denied",detail:`${n(e)} could not be read.`,short:`${n(e)} could not be read.`,hint:"Check the file permissions and try again."})}function U(e){return new o({code:"not-a-directory",title:"Invalid path",detail:`${n(e)} could not be found: part of its path is not a directory.`,short:`part of ${n(e)}'s path is not a folder.`,hint:"Check the path and try again."})}function M(e){return new o({code:"symlink-loop",title:"Too many symbolic links",detail:`${n(e)} could not be resolved: its path contains a symbolic-link loop.`,short:`${n(e)}'s path loops back on itself.`,hint:"Check for a circular symlink somewhere in the path."})}function L(e){return new o({code:"path-too-long",title:"Path too long",detail:`${n(e)}'s path is too long for the filesystem to resolve.`,short:`${n(e)}'s path is too long.`,hint:"Use a shorter path and try again."})}function W(e,t){return new o({code:"unreadable-path",title:"Could not read path",detail:`${n(e)} could not be checked.`,short:`${n(e)} could not be checked.`,hint:"Check the path and try again.",cause:t})}function J(e,t){return new o({code:"unsupported-source",title:"Unsupported file type",detail:`${n(e)} is ${t}, which Forge cannot read.`,short:`${n(e)} is ${t}, which Forge cannot read.`,hint:"Forge 0.1 handles images only."})}function B(e,t){return new o({code:"unsupported-source",title:"Not an image",detail:`${n(e)} is ${t}, not an image.`,hint:"A palette is taken from a photo, a screenshot or artwork."})}function _(e){return new o({code:"unsupported-source",title:"Nothing to take colours from",detail:`${n(e)} has no visible pixels.`})}function G(e){return new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${n(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 q(e,t){let r=n(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 ${r} \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 ${r} 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?`${r}'s images are a kind Forge cannot re-encode, so there is nothing to make smaller.`:`${r} 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:`${r} is ${s[e.format].label}, which has no images Forge can re-encode.`,hint:`Use --to pdf to change it to PDF instead: forge ${r} --to pdf`,shellHint:"Use /convert to change it to PDF instead."}):new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${r} 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 Q(e){let t=n(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 V(e,t,r){return new o({code:"unsupported-operation",title:`Cannot ${e} these files`,detail:`Not available for these files: ${t}.`,hint:r??"Page operations work on PDFs: --merge takes two or more, the others take one.",shellHint:r??"Use /pdf with a PDF staged \u2014 two or more for merge."})}function X(e,t,r){return new o({code:"target-unreachable",title:"Cannot get that small",detail:`${n(e.path)} is ${a(r)} even at the lowest quality, which is still over ${a(t)}.`,hint:"Try a larger --max-size, or --to a smaller format.",shellHint:"Try a larger target, or /convert to a smaller format."})}function Y(e,t,r){return new o({code:"unsupported-target",title:`Can't convert ${n(e.path)} to ${t}`,detail:`${n(e.path)} is a ${s[e.format].label} ${e.kind==="image"?"image":"document"}.`,hint:`Available: ${r.join(", ")}`})}function K(e,t){return new o({code:"corrupt-source",title:"Damaged file",detail:`${n(e)} could not be read. It may be damaged, or not a format Forge recognises.`,short:`${n(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:t})}function Z(e,t,r){return new o({code:"corrupt-source",title:`Damaged ${s[t].label}`,detail:`${n(e)} is a ${s[t].label} file, but its content could not be read.`,short:`${n(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:r})}function ee(e,t={}){let r=n(e);return new o({code:"encrypted-source",title:"This PDF is password-protected",detail:`${r} is password-protected.`,short:`${r} is password-protected.`,hint:t.attempted?"That password didn't open it. Check it and try again.":`Convert it to images instead: forge ${r} --to jpeg --password-stdin`})}var d=e=>e==="convert"||e==="boost"||e==="remove-background";function te(e,t="convert"){return new o({code:"output-exists",title:"File already exists",detail:`${n(e)} is already there.`,hint:d(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 oe(e,t){return new o({code:"output-collision",title:"Two files want the same output",detail:`${n(e[0])} and ${n(e[1])} would both become ${n(t)}.`,hint:"Convert them separately, or use --output to send them to different folders.",shellHint:"Convert them one at a time."})}function ne(e,t){return new o({code:"output-collision",title:"One output, written twice",detail:`${n(e)} would write ${n(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 re(e,t="convert"){return new o({code:"output-is-input",title:"Output would replace the original",detail:`${n(e)} is both the input and the output.`,hint:d(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:d(t)?"Choose a different folder to save it in.":"Move or rename that file first."})}function y(e,t){return new o({code:"permission-denied",title:"Permission denied",detail:`${n(x(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 $=new Set(["EACCES","EPERM","EROFS"]);function ie(e,t){if(b(t))return t;let r=t?.code;return r!==void 0&&$.has(r)?y(e,t):t}function se(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 ae(e){return new o({code:"empty-directory",title:"No images found",detail:`${n(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 le(e,t){return new o({code:"invalid-arguments",title:"Invalid arguments",detail:e,hint:t})}function de(e,t,r){return new o({code:"invalid-page-range",title:"Page range not understood",detail:t,hint:`This document has ${r} pages. Use numbers and spans, like "3-7, 12, 20-".`})}function ue(e){return new o({code:"empty-selection",title:"Nothing to write",detail:e,hint:"Select at least one page to keep."})}function pe(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 ce(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 he(e,t,r,i){return new o({code:"extension-outdated",title:"Extension out of date",detail:`${e} ${r} cannot ${t}; that needs ${i} or later.`,hint:`Update it with: forge extensions add ${e}`,shellHint:"Open /extensions to update it."})}function ge(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 fe(e,t){return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} cannot be installed on this Mac: ${t}`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function me(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 we(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 xe(e,t,r){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:r==="remove"?`Wait for that job to finish, then run: forge extensions remove ${e}`:"Wait for that job to finish, then try again.",shellHint:r==="remove"?"It can be removed when that job finishes.":"Try again when that job finishes."})}function be(e){return new o({code:"no-subject",title:"No subject found",detail:`${n(e)} has no clear subject to cut out.`,hint:"Try a photo where the subject stands apart from the background."})}function ye(e,t,r){return r===1?new o({code:"boost-too-large",title:"Too large to sharpen",detail:`${n(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?`${n(e)} is too large to boost that far; ${t}x is the most it can take.`:`${n(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 $e(e,t){return new o({code:"resize-too-large",title:"Too large to resize to",detail:`${n(e)} would be ${t.width} \xD7 ${t.height}.`,hint:"Resize works up to 16,384 px a side and 100 megapixels."})}function Fe(e){return new o({code:"nothing-to-trim",title:"Nothing to trim",detail:`${n(e)} has no empty edges.`,short:"no empty edges"})}function Ee(e){return new o({code:"animated-trim",title:"Can't trim an animation",detail:`${n(e)} is animated; trimming works on still images.`})}function ve(e,t){return new o({code:"conversion-failed",title:"Conversion failed",detail:`${n(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 ke(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 Ce(e,t={}){let r=[`\u2715 ${e.title}`,"",` ${e.detail}`];return e.hint&&r.push("",` ${e.hint}`),t.debug&&e.cause instanceof Error&&r.push("",` ${e.cause.stack??e.cause.message}`),r}export{l as a,C as b,n as c,s as d,S as e,H as f,b as g,O as h,z as i,R as j,U as k,M as l,L as m,W as n,J as o,B as p,_ as q,G as r,q as s,Q as t,V as u,X as v,Y as w,K as x,Z as y,ee as z,te as A,oe as B,ne as C,re as D,y as E,ie as F,se as G,ae as H,le as I,de as J,ue as K,pe as L,ce as M,he as N,ge as O,fe as P,me as Q,we as R,xe as S,be as T,ye as U,$e as V,Fe as W,Ee as X,ve as Y,ke as Z,Ce as _};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{j as t}from"./chunk-L76Q54MB.js";import{resolve as s}from"node:path";function c(r,e){return{forge:r,ok:!0,palette:e,failures:[]}}function f(r,e){return{forge:r,ok:!0,scale:e,failures:[]}}function a(r){let e=t(r),n=e.sources.map(o=>s(o.path));return{op:r.job.op,source:n[0]??"",sources:n,outputs:e.outputs.map(o=>s(o)),inputBytes:e.sources.reduce((o,u)=>o+u.bytes,0),outputBytes:e.outputBytes,warnings:e.warnings.map(o=>({code:o.code,message:o.message}))}}function i(r){let{error:e}=r;return{...r.path?{path:s(r.path)}:{},code:e.code,title:e.title,detail:e.detail,...e.hint===void 0?{}:{hint:e.hint}}}function l(r,e){return{forge:r,ok:e.failures.length===0,results:e.results.map(a),failures:e.failures.map(i)}}function J(r,e){return l(r,{results:[],failures:[{error:e}]})}function m(r,e){return{forge:r,ok:!0,formats:e,failures:[]}}function b(r,e){return{forge:r,ok:e.failures.length===0,probes:e.probes,failures:e.failures.map(i)}}function x(r,e,n){return{forge:r,ok:!0,config:e,warnings:n.map(o=>({code:o.code,message:o.message})),failures:[]}}function d(r,e){return{forge:r,ok:!0,extensions:e.extensions,...e.changed?{changed:e.changed}:{},failures:[]}}export{c as a,f as b,l as c,J as d,m as e,b as f,x as g,d as h};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
var m=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,i=t=>t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055;function g(t){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t.trim());if(!n)return;let r=n[1],e=r.length===3?[...r].map(o=>o+o).join(""):r;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16)}}function x({r:t,g:n,b:r}){return`#${[t,n,r].map(e=>e.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function h({r:t,g:n,b:r}){let e=m(t/255),o=m(n/255),a=m(r/255),b=Math.cbrt(.4122214708*e+.5363325363*o+.0514459929*a),u=Math.cbrt(.2119034982*e+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*e+.2817188376*o+.6299787005*a);return{L:.2104542553*b+.793617785*u-.0040720468*c,a:1.9779984951*b-2.428592205*u+.4505937099*c,b:.0259040371*b+.7827717662*u-.808675766*c}}function s({L:t,a:n,b:r}){let e=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,a=(t-.0894841775*n-1.291485548*r)**3;return[4.0767416621*e-3.3077115913*o+.2309699292*a,-1.2684380046*e+2.6097574011*o-.3413193965*a,-.0041960863*e-.7034186147*o+1.707614701*a]}function f(t){let[n,r,e]=s(t).map(o=>Math.round(Math.max(0,Math.min(1,i(Math.max(0,o))))*255));return{r:n,g:r,b:e}}function L(t){return s(t).every(n=>n>=-1e-4&&n<=1+1e-4)}function p({L:t,a:n,b:r}){return{L:t,C:Math.hypot(n,r),h:(Math.atan2(r,n)*180/Math.PI+360)%360}}function l({L:t,C:n,h:r}){let e=r*Math.PI/180;return{L:t,a:n*Math.cos(e),b:n*Math.sin(e)}}function M({r:t,g:n,b:r}){return`rgb(${t} ${n} ${r})`}function d(t){let{L:n,C:r,h:e}=p(h(t)),o=r<5e-4?0:e;return`oklch(${(n*100).toFixed(0)}% ${r.toFixed(3)} ${o.toFixed(0)})`}export{g as a,x as b,h as c,f as d,L as e,p as f,l as g,M as h,d as i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
var e="https://github.com/AtharvaN16/forge-terminal/releases/download",a=[{id:"boost",title:"Boost resolution",summary:"Sharpen, or boost resolution 2x or 4x, with a local AI model",version:"1.0.0",minMacos:14,assets:{arm64:{url:`${e}/ext-boost-v1.0.0/forge-ext-boost-1.0.0-arm64.tar.gz`,bytes:14866325,sha256:"7af24c92f95b1cd34618adde4a90926c91a8db4347d640be4921f1dc706a9a2e"}},licence:"Real-ESRGAN general-x4v3 (BSD-3-Clause), ONNX Runtime (MIT)"},{id:"remove-background",title:"Remove background",summary:"Cut the subject out of a photo, on this Mac",version:"1.0.0",minMacos:14,assets:{universal:{url:`${e}/ext-remove-background-v1.0.0/forge-ext-remove-background-1.0.0-universal.tar.gz`,bytes:32489,sha256:"9f6e055c0ce25f7504e10c7871e506a813bc75d6536396a675a8c075c4eb4686"}},licence:"Uses Apple Vision on-device; helper is MIT"}];function r(t){return a.find(o=>o.id===t)}export{a,r as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b,c)=>()=>{if(c)throw c[0];try{return a&&(b=a(a=0)),b}catch(d){throw c=[d],d}};var o=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},p=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of j(b))!l.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=i(b,e))||d.enumerable});return a};var q=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),r=a=>g(f({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f};
|