forge-terminal 0.4.3 → 0.4.4
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 +3 -3
- package/dist/chunks/{about-credits-BIOQB4LZ.js → about-credits-QMC5GQU2.js} +1 -1
- package/dist/chunks/{args-5XWINYYE.js → args-VPUOIDWE.js} +1 -1
- package/dist/chunks/{boot-66CWEF4E.js → boot-FOKV7OHT.js} +1 -1
- package/dist/chunks/{chunk-KCCI3WEN.js → chunk-5SMYDPVX.js} +1 -1
- package/dist/chunks/{chunk-5BE5XZY5.js → chunk-I2IATJNL.js} +1 -1
- package/dist/chunks/{chunk-WMPQ5T2K.js → chunk-M7A55JKD.js} +2 -2
- package/dist/chunks/chunk-NWREILRP.js +66 -0
- package/dist/chunks/{chunk-KAQ5LMYO.js → chunk-XEQVXPPY.js} +1 -1
- package/dist/chunks/{clip-command-ANGANJ3B.js → clip-command-SGB3B4OJ.js} +1 -1
- package/dist/chunks/{colour-RMOFEV4G.js → colour-QMGYV6WQ.js} +1 -1
- package/dist/chunks/{entry-NFR27M33.js → entry-3PEVSH2X.js} +1 -1
- package/dist/chunks/{execute-JY372YAC.js → execute-WQJ37VKD.js} +1 -1
- package/dist/chunks/{extensions-K27LB6ZO.js → extensions-ZKOWPSLD.js} +1 -1
- package/dist/chunks/{extensions-command-TBOTOP4R.js → extensions-command-L2AT6OVR.js} +1 -1
- package/dist/chunks/launch-L5DKAUA3.js +15 -0
- package/dist/chunks/{manager-DLXGO25L.js → manager-TEZ3V4L4.js} +1 -1
- package/dist/chunks/{server-PQEGX3HK.js → server-7PMVIYWQ.js} +3 -3
- package/dist/chunks/{theme-BJRL3INU.js → theme-Z6X54JY4.js} +1 -1
- package/dist/chunks/{update-note-NSHFIIX6.js → update-note-RQG2RZNR.js} +1 -1
- package/dist/chunks/{watch-command-B5R6NDWW.js → watch-command-DUHMTXQL.js} +1 -1
- package/dist/index.js +6 -6
- package/package.json +7 -11
- package/dist/chunks/chunk-E55PYOCI.js +0 -66
- package/dist/chunks/launch-QNZWUCVQ.js +0 -5
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{b as P,d as R,e as B}from"./chunk-
|
|
3
|
+
import{b as P,d as R,e as B}from"./chunk-M7A55JKD.js";import{a as w,b as I,c as k,d as $,e as O,f as m}from"./chunk-TMQDQLY7.js";import{e as h}from"./chunk-EHARO6IS.js";import{i as x}from"./chunk-6L6C3GJU.js";import{Y as y,Z as C,_ as v,b as p}from"./chunk-3UEQ2OX6.js";import{a as f}from"./chunk-J7FLFHQJ.js";import{a as l}from"./chunk-I2IATJNL.js";import{a as c}from"./chunk-M66BUNYO.js";import{dirname as S,join as q}from"node:path";async function T(t){if(t.fallback!==void 0)return t.fallback;let{loadPreferences:r,expandTilde:e}=await import("./preferences-4VETUGMN.js");return e((await r()).prefs.defaultOutput)}function F(t){if(t.pasteboard)return t.pasteboard;if(!w())throw C();return I()}function E(t,r,e,o){let a=q(r.outDir,`Copied image${c[o].extensions[0]}`),s={inputs:[r.source],output:a,force:!1,recursive:!1,debug:t.debug},n={background:"#ffffff",keepMetadata:!1,...t.quality===void 0?{}:{quality:t.quality}};return o===e?{kind:"compress",...s,options:n,...t.quality===void 0?{}:{quality:t.quality},...t.maxBytes===void 0?{}:{maxBytes:t.maxBytes}}:{kind:"convert",...s,target:o,options:n,...t.maxBytes===void 0?{}:{maxBytes:t.maxBytes}}}async function J(t,r={}){let e=r.clip??{},o=F(e),a=await k(o,e.root);if(!a)throw y((await o.peek()).text?"text":"nothing");let s=await x(a.source),n=t.target??s.format,b=E(t,a,s.format,n),i=await R(b,r),g=i.results[0];if(!g||i.failures.length>0)return{report:i,status:"failed"};let u=g.job.outputs[0],d={report:i,output:u,source:{format:s.format,bytes:s.bytes},target:n};if(await $(o,a,u,n)==="changed")return{...d,status:"changed",saved:await m(u,await T(e))};if(t.save===void 0)return{...d,status:"placed"};let j=t.save===!0?await T(e):t.save,{expandTilde:D}=await import("./preferences-4VETUGMN.js");return{...d,status:"placed",saved:await m(u,D(j))}}function N(t){let r=t.target===t.source.format?"":` as ${c[t.target].label}`,e=` ${f(t.source.bytes)} \u2192 ${f(t.report.outputBytes)} \xB7 ${P(t.source.bytes,t.report.outputBytes)}`;if(t.status==="changed"){let a=t.target===t.source.format?"compressed":"converted";return[`\u2713 Copied image \u2192 ${p(t.saved)}${r}`,e,"","\u26A0 Clipboard changed"," The file you uploaded is no longer in the clipboard.",` The ${a} image is saved to ${p(S(t.saved))}.`]}let o=t.saved===void 0?"":` + ${p(t.saved)}`;return[`\u2713 Copied image \u2192 clipboard${r}${o}`,e]}async function U(t){if(!await O(F(t),t.root))throw v()}async function Z(t,r){if(t.undo)return await U(r.clip??{}),{exitCode:0,stdout:r.json?[JSON.stringify({forge:l,ok:!0,clipboard:"restored"})]:["\u2713 The original is back on the clipboard"],stderr:[]};let e=await J(t,r);if(e.status==="failed")return B(e.report,r);if(r.json){let o={...h(l,e.report),clipboard:e.status,...e.saved===void 0?{}:{saved:e.saved}};return{exitCode:0,stdout:[JSON.stringify(o)],stderr:[]}}return{exitCode:0,stdout:N(e),stderr:[]}}export{J as a,N as b,U as c,Z as d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d}from"./chunk-
|
|
3
|
+
import{a,b,c,d}from"./chunk-XEQVXPPY.js";import"./chunk-M7A55JKD.js";import"./chunk-TMQDQLY7.js";import"./chunk-I63TO22X.js";import"./chunk-DERIWZAT.js";import"./chunk-YWKMG5WO.js";import"./chunk-LNB5D67B.js";import"./chunk-BZXDNDPG.js";import"./chunk-EHARO6IS.js";import"./chunk-PSEIJXGT.js";import"./chunk-QR6QHTC3.js";import"./chunk-6L6C3GJU.js";import"./chunk-EEQSUBBL.js";import"./chunk-KAHWYWNT.js";import"./chunk-SMBK6BTC.js";import"./chunk-EXLXSKRH.js";import"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import"./chunk-LDKF7KIZ.js";import"./chunk-I2IATJNL.js";import"./chunk-AAXBN572.js";import"./chunk-HON4OV7M.js";import"./chunk-M66BUNYO.js";import"./chunk-TMUK2DD3.js";export{b as clipLines,a as runClip,d as runClipCommand,c as runUndo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{h as y,i as O,m as C}from"./chunk-FH3R2YYD.js";import{i as $,k as u,l as S}from"./chunk-IWFVEMDN.js";import{c as k,d as w,f as I}from"./chunk-PBIS2ONZ.js";import{a as h,b as g}from"./chunk-EHARO6IS.js";import"./chunk-PSEIJXGT.js";import{b as m,c as d,h as f,i as p}from"./chunk-QVACE4IE.js";import"./chunk-6L6C3GJU.js";import"./chunk-EEQSUBBL.js";import"./chunk-KAHWYWNT.js";import"./chunk-SMBK6BTC.js";import"./chunk-EXLXSKRH.js";import{c as b,n as x}from"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import"./chunk-LDKF7KIZ.js";import{a as l}from"./chunk-
|
|
3
|
+
import{h as y,i as O,m as C}from"./chunk-FH3R2YYD.js";import{i as $,k as u,l as S}from"./chunk-IWFVEMDN.js";import{c as k,d as w,f as I}from"./chunk-PBIS2ONZ.js";import{a as h,b as g}from"./chunk-EHARO6IS.js";import"./chunk-PSEIJXGT.js";import{b as m,c as d,h as f,i as p}from"./chunk-QVACE4IE.js";import"./chunk-6L6C3GJU.js";import"./chunk-EEQSUBBL.js";import"./chunk-KAHWYWNT.js";import"./chunk-SMBK6BTC.js";import"./chunk-EXLXSKRH.js";import{c as b,n as x}from"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import"./chunk-LDKF7KIZ.js";import{a as l}from"./chunk-I2IATJNL.js";import"./chunk-M66BUNYO.js";import"./chunk-TMUK2DD3.js";import{resolve as R}from"node:path";var P=({r:t,g:n,b:o},s)=>s?`\x1B[38;2;${t};${n};${o}m\u2588\u2588\x1B[39m `:"";function N(t,n){let o=d(n),s,e=Number.POSITIVE_INFINITY;for(let r of t){let a=(r.centre.L-o.L)**2+(r.centre.a-o.a)**2+(r.centre.b-o.b)**2;a<e&&(e=a,s=r)}return s}async function D(t,n){let{pixels:o}=await C(t.input),s=k(o);if(s.length===0)throw x(t.input);let e=t.inside?N(s,t.inside):void 0,r=e?w(o,e):s;if(t.svg)return{exitCode:0,stdout:[y(b(t.input),r,"light",e?.hex)],stderr:[]};if(n.json){let i=h(l,{source:R(t.input),...e?{inside:e.hex}:{},colours:r.map(c=>({hex:c.hex,rgb:f(c.rgb),oklch:p(c.rgb),share:c.share}))});return{exitCode:0,stdout:[JSON.stringify(i)],stderr:[]}}let a=I(r.map(i=>i.share));return{exitCode:0,stdout:r.map((i,c)=>`${P(i.rgb,n.colour)}${i.hex} ${String(a[c]).padStart(3)}%`),stderr:[]}}async function H(t,n){let o=$(t.colour);if(t.svg)return{exitCode:0,stdout:[O(t.colour,o)],stderr:[]};let s=o.map(e=>({...e,...S(e.rgb)}));if(n.json){let e=g(l,{reference:m(t.colour),steps:s.map(r=>({step:r.step,hex:r.hex,oklch:p(r.rgb),white:r.white,black:r.black}))});return{exitCode:0,stdout:[JSON.stringify(e)],stderr:[]}}return{exitCode:0,stdout:s.map(e=>`${String(e.step).padStart(4)} ${P(e.rgb,n.colour)}${e.hex} white ${e.white.toFixed(1)} ${u(e.white)} \xB7 black ${e.black.toFixed(1)} ${u(e.black)}`),stderr:[]}}export{D as runPalette,H as runScale};
|
|
@@ -2,5 +2,5 @@ import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
3
|
import{a as N,b as $,c as k,d as h,f,g as p,h as _}from"./chunk-6FUVEO3A.js";import{c as E}from"./chunk-QXTXBMTM.js";import{a as D,b as T,c as A,d as F,e as R}from"./chunk-JFJ3ZJQL.js";import{c as x}from"./chunk-EX7KZBI6.js";import{f as P}from"./chunk-EXLXSKRH.js";import{d as b}from"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import{a as w}from"./chunk-HON4OV7M.js";import"./chunk-M66BUNYO.js";import"./chunk-5B5XXH22.js";import"./chunk-TMUK2DD3.js";import{spawn as X}from"node:child_process";import{homedir as ge}from"node:os";import{join as M}from"node:path";import{appendFileSync as V,mkdirSync as O,readFileSync as K,renameSync as Y,rmSync as y,statSync as G}from"node:fs";import{join as C}from"node:path";var Z={quiet:500,cap:3e3,poll:50},ee=15e3,I=e=>new Promise(t=>setTimeout(t,e));async function j(e,t,n,r=Z){O(e,{recursive:!0});let i=C(e,`${t}.spool`),o=C(e,`${t}.lock`),s=m=>{try{return K(m,"utf8").split(`
|
|
4
4
|
`).filter(Boolean)}catch{return[]}},u=()=>{try{return G(i).size}catch{return 0}};for(V(i,`${n}
|
|
5
|
-
`);;){try{O(o)}catch{try{Date.now()-G(o).mtimeMs>ee&&y(o,{recursive:!0,force:!0})}catch{}if(await I(r.poll),!s(i).includes(n))return null;continue}try{let m=Date.now(),c=u(),l=Date.now();for(;Date.now()-l<r.quiet&&Date.now()-m<r.cap;){await I(r.poll);let S=u();S!==c&&(c=S,l=Date.now())}let a=`${i}.${process.pid}.${Date.now()}`;try{Y(i,a)}catch{return[n]}let g=[...new Set(s(a))];return y(a,{force:!0}),g}finally{y(o,{recursive:!0,force:!0})}}}import{realpathSync as ne}from"node:fs";import{delimiter as te,join as re}from"node:path";function q(e,t,n=process.platform){let r=s=>{try{return ne(s)}catch{return}},i=r(e)??e,o=n==="win32"?"node.exe":"node";for(let s of(t??"").split(te)){if(s==="")continue;let u=re(s,o);if(u!==e&&r(u)===i)return u}return e}import{basename as v,dirname as ie,extname as oe,join as se}from"node:path";function ae(e,t,n){if(n==="win32")return e==="wt"?["wt.exe",["-w","new",...t]]:["conhost.exe",t];if(e==="ghostty")return["/usr/bin/open",["-na","Ghostty","--args","-e",...t]];let r=`exec ${t.map(N).join(" ")}`;return["/usr/bin/osascript",[...["on run argv",...e==="iTerm.app"?['tell application "iTerm"',"create window with default profile","tell current session of current window to write text (item 1 of argv)","activate","end tell"]:['if application "Terminal" is running then','tell application "Terminal" to do script (item 1 of argv)',"else",'tell application "Terminal" to do script (item 1 of argv) in window 1',"end if",'tell application "Terminal" to activate'],"end run"].flatMap(o=>["-e",o]),r]]}function H(e){let t=v(e,oe(e));return P(se(ie(e),`${t}-sharp.png`))}function ue(e){let t=e.flatMap(o=>"output"in o?[o.output]:[]),n=e.flatMap(o=>"error"in o?[o]:[]),[r]=n;if(r===void 0)return{title:t.length===1?v(t[0]):`${t.length} files`,body:"Sharpened"};let i=r.input?v(r.input):"file";return e.length===1?{title:`${i} not sharpened`,body:r.error}:{title:`${t.length} of ${e.length} files sharpened`,body:`${i}: ${r.error}`}}async function U(e,t,n){if(e==="sharpen"){let s=[];for(let a of t){let g=await n.sharpen(a);s.push("error"in g?{input:a,...g}:g)}let{title:u,body:m}=ue(s);await n.notify(u,m);let l=s.flatMap(a=>"output"in a?[a.output]:[]).at(-1);l!==void 0&&await n.reveal(l);return}let r=e==="open"?[]:t,[i,o]=ae(n.terminal,[...n.self,"menu","open",e,...r],n.platform);await n.launch(i,o)}import{mkdirSync as le,readFileSync as ce,writeFileSync as me}from"node:fs";import{join as pe}from"node:path";async function B(e,t){if(!t.global||e.platform!=="darwin"&&e.platform!=="win32")return;let n=h(e);if(t.enabled===!1){n!==void 0&&await p(e);return}if(!(n!==void 0&&k(n,e))&&(await f(e),n===void 0))return e.platform==="darwin"?"Added Forge to Finder\u2019s Quick Actions":"Added Forge to the right-click menu"}async function J(e){let t=h(e);if(t===void 0)return;let{xdgConfigHome:n,...r}=e;await f({...r,...t})}var L=e=>pe(e.menuDir,"terminal"),fe=new Set(["Apple_Terminal","iTerm.app","ghostty"]);function z(e,t){let n=e.platform==="win32"?t.WT_SESSION?"wt":"console":fe.has(t.TERM_PROGRAM??"")?t.TERM_PROGRAM:void 0;if(n)try{le(e.menuDir,{recursive:!0}),me(L(e),n)}catch{}}function Q(e){try{return ce(L(e),"utf8").trim()||void 0}catch{return}}import{rmSync as de}from"node:fs";async function W(e,t){await p(e),t.out("\u2713 Removed Forge from the right-click menu");let{code:n,output:r}=await t.npm(["uninstall","--global","forge-terminal"]);return n!==0?(t.out(`\u2715 npm could not uninstall forge-terminal: ${R(r)}`),1):(t.out("\u2713 Uninstalled forge-terminal"),de(t.forgeDir,{recursive:!0,force:!0}),t.out("\u2713 Deleted Forge\u2019s settings"),0)}var we=()=>M(w(),"forge","menu");async function d(e){return{platform:process.platform,home:ge(),menuDir:we(),node:q(process.execPath,process.env.PATH),execArgv:process.execArgv,forge:T(process.argv[1])??"",...process.env.XDG_CONFIG_HOME?{xdgConfigHome:process.env.XDG_CONFIG_HOME}:{},version:e,sharpen:await x("boost")!==void 0,run:_}}async function Ye(e){if(process.env.FORGE_NO_MENU)return;let t=await d(e);z(t,process.env);let{loadPreferences:n}=await import("./preferences-4VETUGMN.js"),{prefs:r}=await n();return B(t,{global:D(t.forge,t.platform),enabled:r.rightClickMenu!==!1})}async function Ze(){let{isInstalled:e}=await import("./install-2A5BGKQU.js");return e(await d(""))}async function en(e){let{VERSION:t}=await import("./theme-
|
|
5
|
+
`);;){try{O(o)}catch{try{Date.now()-G(o).mtimeMs>ee&&y(o,{recursive:!0,force:!0})}catch{}if(await I(r.poll),!s(i).includes(n))return null;continue}try{let m=Date.now(),c=u(),l=Date.now();for(;Date.now()-l<r.quiet&&Date.now()-m<r.cap;){await I(r.poll);let S=u();S!==c&&(c=S,l=Date.now())}let a=`${i}.${process.pid}.${Date.now()}`;try{Y(i,a)}catch{return[n]}let g=[...new Set(s(a))];return y(a,{force:!0}),g}finally{y(o,{recursive:!0,force:!0})}}}import{realpathSync as ne}from"node:fs";import{delimiter as te,join as re}from"node:path";function q(e,t,n=process.platform){let r=s=>{try{return ne(s)}catch{return}},i=r(e)??e,o=n==="win32"?"node.exe":"node";for(let s of(t??"").split(te)){if(s==="")continue;let u=re(s,o);if(u!==e&&r(u)===i)return u}return e}import{basename as v,dirname as ie,extname as oe,join as se}from"node:path";function ae(e,t,n){if(n==="win32")return e==="wt"?["wt.exe",["-w","new",...t]]:["conhost.exe",t];if(e==="ghostty")return["/usr/bin/open",["-na","Ghostty","--args","-e",...t]];let r=`exec ${t.map(N).join(" ")}`;return["/usr/bin/osascript",[...["on run argv",...e==="iTerm.app"?['tell application "iTerm"',"create window with default profile","tell current session of current window to write text (item 1 of argv)","activate","end tell"]:['if application "Terminal" is running then','tell application "Terminal" to do script (item 1 of argv)',"else",'tell application "Terminal" to do script (item 1 of argv) in window 1',"end if",'tell application "Terminal" to activate'],"end run"].flatMap(o=>["-e",o]),r]]}function H(e){let t=v(e,oe(e));return P(se(ie(e),`${t}-sharp.png`))}function ue(e){let t=e.flatMap(o=>"output"in o?[o.output]:[]),n=e.flatMap(o=>"error"in o?[o]:[]),[r]=n;if(r===void 0)return{title:t.length===1?v(t[0]):`${t.length} files`,body:"Sharpened"};let i=r.input?v(r.input):"file";return e.length===1?{title:`${i} not sharpened`,body:r.error}:{title:`${t.length} of ${e.length} files sharpened`,body:`${i}: ${r.error}`}}async function U(e,t,n){if(e==="sharpen"){let s=[];for(let a of t){let g=await n.sharpen(a);s.push("error"in g?{input:a,...g}:g)}let{title:u,body:m}=ue(s);await n.notify(u,m);let l=s.flatMap(a=>"output"in a?[a.output]:[]).at(-1);l!==void 0&&await n.reveal(l);return}let r=e==="open"?[]:t,[i,o]=ae(n.terminal,[...n.self,"menu","open",e,...r],n.platform);await n.launch(i,o)}import{mkdirSync as le,readFileSync as ce,writeFileSync as me}from"node:fs";import{join as pe}from"node:path";async function B(e,t){if(!t.global||e.platform!=="darwin"&&e.platform!=="win32")return;let n=h(e);if(t.enabled===!1){n!==void 0&&await p(e);return}if(!(n!==void 0&&k(n,e))&&(await f(e),n===void 0))return e.platform==="darwin"?"Added Forge to Finder\u2019s Quick Actions":"Added Forge to the right-click menu"}async function J(e){let t=h(e);if(t===void 0)return;let{xdgConfigHome:n,...r}=e;await f({...r,...t})}var L=e=>pe(e.menuDir,"terminal"),fe=new Set(["Apple_Terminal","iTerm.app","ghostty"]);function z(e,t){let n=e.platform==="win32"?t.WT_SESSION?"wt":"console":fe.has(t.TERM_PROGRAM??"")?t.TERM_PROGRAM:void 0;if(n)try{le(e.menuDir,{recursive:!0}),me(L(e),n)}catch{}}function Q(e){try{return ce(L(e),"utf8").trim()||void 0}catch{return}}import{rmSync as de}from"node:fs";async function W(e,t){await p(e),t.out("\u2713 Removed Forge from the right-click menu");let{code:n,output:r}=await t.npm(["uninstall","--global","forge-terminal"]);return n!==0?(t.out(`\u2715 npm could not uninstall forge-terminal: ${R(r)}`),1):(t.out("\u2713 Uninstalled forge-terminal"),de(t.forgeDir,{recursive:!0,force:!0}),t.out("\u2713 Deleted Forge\u2019s settings"),0)}var we=()=>M(w(),"forge","menu");async function d(e){return{platform:process.platform,home:ge(),menuDir:we(),node:q(process.execPath,process.env.PATH),execArgv:process.execArgv,forge:T(process.argv[1])??"",...process.env.XDG_CONFIG_HOME?{xdgConfigHome:process.env.XDG_CONFIG_HOME}:{},version:e,sharpen:await x("boost")!==void 0,run:_}}async function Ye(e){if(process.env.FORGE_NO_MENU)return;let t=await d(e);z(t,process.env);let{loadPreferences:n}=await import("./preferences-4VETUGMN.js"),{prefs:r}=await n();return B(t,{global:D(t.forge,t.platform),enabled:r.rightClickMenu!==!1})}async function Ze(){let{isInstalled:e}=await import("./install-2A5BGKQU.js");return e(await d(""))}async function en(e){let{VERSION:t}=await import("./theme-Z6X54JY4.js"),{savePreferences:n}=await import("./preferences-4VETUGMN.js"),r=await d(t);e?await f(r):await p(r),await n({rightClickMenu:e})}async function nn(){if(!process.env.FORGE_NO_MENU)try{await J(await d(""))}catch{}}async function he(e){let{parseArgs:t}=await import("./args-VPUOIDWE.js"),{runIntent:n}=await import("./execute-WQJ37VKD.js"),r=t([e,"--sharpen","--output",H(e)]),i=await n(r),o=i.results[0]?.job.outputs[0];if(o!==void 0)return{output:o};let s=i.failures[0]?.error;return{error:b(s)?s.detail:"It could not be sharpened."}}var ye=(e,t)=>new Promise(n=>{let r=X(e,t,{detached:!0,stdio:"ignore"});r.on("error",()=>n()),r.unref(),n()});async function tn(e,t){let n=await d(t);if(e.kind==="install")return await f(n),0;if(e.kind==="remove")return await p(n),0;if(e.kind!=="run")return 2;let r=e.paths;if(n.platform==="win32"&&r.length===1){let i=await j(M(n.menuDir,"spool"),e.action,r[0]);if(i===null)return 0;r=i}return await U(e.action,r,{platform:n.platform,self:[n.node,...n.execArgv,n.forge],terminal:Q(n),launch:ye,sharpen:he,notify:(i,o)=>$(i,o,n.platform),reveal:async i=>{await E(i,n.platform)}}),0}async function rn(e,t){let n=await d(e),r=i=>new Promise(o=>{let s=n.platform==="win32"?F(n.node):void 0,[u,m]=s!==void 0?[n.node,[s,...i]]:[A(n.node),i],c="",l=X(u,m,{stdio:["ignore","pipe","pipe"]});l.stdout.setEncoding("utf8").on("data",a=>{c+=a}),l.stderr.setEncoding("utf8").on("data",a=>{c+=a}),l.on("error",a=>o({code:null,output:`${c}
|
|
6
6
|
${a.message}`})),l.on("close",a=>o({code:a,output:c}))});return W(n,{forgeDir:M(w(),"forge"),npm:r,out:t})}export{Ye as menuAtStart,Ze as menuIsOn,d as realMenuEnv,nn as resyncMenu,tn as runMenuCommand,rn as runUninstall,en as switchMenu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as a,d as b,e as c,f as d}from"./chunk-
|
|
3
|
+
import{c as a,d as b,e as c,f as d}from"./chunk-M7A55JKD.js";import"./chunk-I63TO22X.js";import"./chunk-DERIWZAT.js";import"./chunk-YWKMG5WO.js";import"./chunk-LNB5D67B.js";import"./chunk-BZXDNDPG.js";import"./chunk-EHARO6IS.js";import"./chunk-PSEIJXGT.js";import"./chunk-QR6QHTC3.js";import"./chunk-6L6C3GJU.js";import"./chunk-EEQSUBBL.js";import"./chunk-KAHWYWNT.js";import"./chunk-SMBK6BTC.js";import"./chunk-EXLXSKRH.js";import"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import"./chunk-LDKF7KIZ.js";import"./chunk-I2IATJNL.js";import"./chunk-AAXBN572.js";import"./chunk-HON4OV7M.js";import"./chunk-M66BUNYO.js";import"./chunk-TMUK2DD3.js";export{d as execute,a as exitCodeFor,c as renderRun,b as runIntent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{
|
|
3
|
+
import{lb as a,mb as b,nb as c,ob as d,pb as e}from"./chunk-NWREILRP.js";import"./chunk-IWFVEMDN.js";import"./chunk-PBIS2ONZ.js";import"./chunk-BZXDNDPG.js";import"./chunk-IBPGC4N2.js";import"./chunk-QVACE4IE.js";import"./chunk-EEQSUBBL.js";import"./chunk-3UEQ2OX6.js";import"./chunk-J7FLFHQJ.js";import"./chunk-I2IATJNL.js";import"./chunk-M66BUNYO.js";import"./chunk-5B5XXH22.js";import"./chunk-TMUK2DD3.js";export{e as ExtensionsFlow,c as byteCount,b as extensionCredits,d as extensionsChip,a as realManager};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as c}from"./chunk-J7FLFHQJ.js";import{c as d}from"./chunk-5B5XXH22.js";import"./chunk-TMUK2DD3.js";function f(e){let t=Object.entries(e.assets).find(([n])=>n.startsWith(`${process.platform}-`));return d(e)?.version??t?.[1]?.version??""}function y(e){return{id:e.entry.id,title:e.entry.title,summary:e.entry.summary,version:f(e.entry),licence:e.entry.licence,installed:e.installed??null,updateAvailable:e.updateAvailable,supported:e.supported,...e.reason!==void 0?{reason:e.reason}:{},...e.downloadBytes!==void 0?{downloadBytes:e.downloadBytes}:{}}}function x(e){return e.supported?e.installed===void 0?`not installed${e.downloadBytes?`, ${c(e.downloadBytes)} download`:""}`:e.updateAvailable?`installed ${e.installed}, update to ${d(e.entry)?.version} available`:`installed ${e.installed}`:`not available: ${e.reason??"unsupported here"}`}function E(e){let t=Math.max(...e.map(n=>n.entry.id.length));return e.flatMap((n,a)=>[...a>0?[""]:[],`${n.entry.id.padEnd(t)} ${n.entry.summary}`,`${" ".repeat(t)} ${x(n)}`,`${" ".repeat(t)} ${n.entry.licence}`])}async function g(e,t={}){let{installExtension:n,listExtensions:a,removeExtension:p}=await import("./manager-
|
|
3
|
+
import{a as c}from"./chunk-J7FLFHQJ.js";import{c as d}from"./chunk-5B5XXH22.js";import"./chunk-TMUK2DD3.js";function f(e){let t=Object.entries(e.assets).find(([n])=>n.startsWith(`${process.platform}-`));return d(e)?.version??t?.[1]?.version??""}function y(e){return{id:e.entry.id,title:e.entry.title,summary:e.entry.summary,version:f(e.entry),licence:e.entry.licence,installed:e.installed??null,updateAvailable:e.updateAvailable,supported:e.supported,...e.reason!==void 0?{reason:e.reason}:{},...e.downloadBytes!==void 0?{downloadBytes:e.downloadBytes}:{}}}function x(e){return e.supported?e.installed===void 0?`not installed${e.downloadBytes?`, ${c(e.downloadBytes)} download`:""}`:e.updateAvailable?`installed ${e.installed}, update to ${d(e.entry)?.version} available`:`installed ${e.installed}`:`not available: ${e.reason??"unsupported here"}`}function E(e){let t=Math.max(...e.map(n=>n.entry.id.length));return e.flatMap((n,a)=>[...a>0?[""]:[],`${n.entry.id.padEnd(t)} ${n.entry.summary}`,`${" ".repeat(t)} ${x(n)}`,`${" ".repeat(t)} ${n.entry.licence}`])}async function g(e,t={}){let{installExtension:n,listExtensions:a,removeExtension:p}=await import("./manager-TEZ3V4L4.js"),i,s;if(e.action==="add"&&e.id!==void 0){let o=(await a()).find(m=>m.entry.id===e.id),l=o?.installed!==void 0&&!o.updateAvailable,u=await n(e.id,{onProgress:t.onDownload});i={id:e.id,action:l?"unchanged":"added"},s=l?`${e.id} ${u.version} is already installed`:`Installed ${e.id} ${u.version}`}else if(e.action==="remove"&&e.id!==void 0){let o=await p(e.id);i={id:e.id,action:o?"removed":"unchanged"},s=o?`Removed ${e.id}`:`${e.id} was not installed`}let r=await a();return{stdout:s===void 0?E(r):[s],data:{extensions:r.map(y),...i?{changed:i}:{}}}}export{g as runExtensions,y as toExtensionJson};
|