forge-terminal 0.2.1 → 0.3.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 +38 -10
- package/dist/chunks/available-QN6QAGCU.js +3 -0
- package/dist/chunks/boot-3M2WUSSL.js +3 -0
- package/dist/chunks/catalog-O3V24DK7.js +3 -0
- package/dist/chunks/check-DN7SEN44.js +3 -0
- package/dist/chunks/chunk-4L6HNYSN.js +4 -0
- package/dist/chunks/{chunk-XFEHJ4C7.js → chunk-6ZEGAH36.js} +1 -1
- package/dist/chunks/chunk-775ILWZI.js +3 -0
- package/dist/chunks/chunk-E5QDHFKQ.js +3 -0
- package/dist/chunks/{chunk-VH5RWPGZ.js → chunk-GDQQDHXJ.js} +2 -2
- package/dist/chunks/chunk-HON4OV7M.js +3 -0
- package/dist/chunks/chunk-IBPGC4N2.js +3 -0
- package/dist/chunks/chunk-LI2JPLF7.js +3 -0
- package/dist/chunks/{chunk-5B7WODWH.js → chunk-M6LD6DHO.js} +1 -1
- package/dist/chunks/chunk-NY6BX7QS.js +5 -0
- package/dist/chunks/chunk-OIZCRBLT.js +3 -0
- package/dist/chunks/chunk-Q45MSMTN.js +3 -0
- package/dist/chunks/chunk-RE7E6NA7.js +3 -0
- package/dist/chunks/{chunk-PN73WK2S.js → chunk-VNAIHACR.js} +1 -1
- package/dist/chunks/chunk-W42HVOBD.js +3 -0
- package/dist/chunks/chunk-XSOCV3F2.js +3 -0
- package/dist/chunks/chunk-XYYVNUE6.js +4 -0
- package/dist/chunks/chunk-YILLB45O.js +3 -0
- package/dist/chunks/chunk-YZG5A3GA.js +4 -0
- package/dist/chunks/chunk-Z5PQWCG5.js +4 -0
- package/dist/chunks/chunk-ZRP5CWIK.js +3 -0
- package/dist/chunks/{catalog-NTACQH5V.js → clipboard-CPHPA4FH.js} +1 -1
- package/dist/chunks/colour-6YGDI44N.js +3 -0
- package/dist/chunks/config-command-UW6BYQ2K.js +3 -0
- package/dist/chunks/execute-BRPAGFUR.js +3 -0
- package/dist/chunks/extensions-command-5QO6YX6O.js +3 -0
- package/dist/chunks/image-ESDL7GZU.js +3 -0
- package/dist/chunks/install-HCF5BIA6.js +3 -0
- package/dist/chunks/launch-ILBEFGNR.js +65 -0
- package/dist/chunks/lock-RZ6NVZFD.js +3 -0
- package/dist/chunks/manager-7HNOLCYH.js +4 -0
- package/dist/chunks/paths-H2WS22BA.js +3 -0
- package/dist/chunks/preferences-AKDCPHJ5.js +3 -0
- package/dist/chunks/restart-6ONEYN6T.js +3 -0
- package/dist/chunks/run-C475RRUL.js +4 -0
- package/dist/chunks/{server-DU7QWDAH.js → server-ETHSTOP6.js} +6 -6
- package/dist/chunks/theme-TYCKAIEA.js +3 -0
- package/dist/chunks/update-command-HT2RBFLR.js +3 -0
- package/dist/chunks/update-note-ES7TWSUT.js +3 -0
- package/dist/index.js +33 -29
- package/package.json +7 -4
- package/skills/forge/SKILL.md +3 -0
- package/dist/chunks/available-HEUREG6L.js +0 -3
- package/dist/chunks/boot-BUGERSEB.js +0 -3
- package/dist/chunks/chunk-2WYHI73Y.js +0 -3
- package/dist/chunks/chunk-4YCO7S4K.js +0 -3
- package/dist/chunks/chunk-C2WYXNRM.js +0 -4
- package/dist/chunks/chunk-C7OOWUMU.js +0 -3
- package/dist/chunks/chunk-EOYBXOCV.js +0 -4
- package/dist/chunks/chunk-G2D6BKOS.js +0 -4
- package/dist/chunks/chunk-HUAEVW2A.js +0 -3
- package/dist/chunks/chunk-L76Q54MB.js +0 -3
- package/dist/chunks/chunk-PD5DFBCU.js +0 -3
- package/dist/chunks/chunk-TEGB7JRM.js +0 -3
- package/dist/chunks/chunk-YXDEOLNA.js +0 -3
- package/dist/chunks/colour-DE6N6AZO.js +0 -3
- package/dist/chunks/config-command-SQXRTBRO.js +0 -3
- package/dist/chunks/execute-M3C3TTWB.js +0 -3
- package/dist/chunks/extensions-command-HJDBUBYO.js +0 -3
- package/dist/chunks/image-GYUUMS6H.js +0 -3
- package/dist/chunks/launch-WBUFRVQ7.js +0 -65
- package/dist/chunks/lock-XD4L3WFM.js +0 -3
- package/dist/chunks/manager-KBJTXZ27.js +0 -4
- package/dist/chunks/paths-JUM6GKQU.js +0 -3
- package/dist/chunks/run-RXVQD4DZ.js +0 -4
- package/dist/chunks/theme-DESCJOCE.js +0 -3
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c}from"./chunk-XFEHJ4C7.js";import"./chunk-4YCO7S4K.js";import"./chunk-TEGB7JRM.js";import"./chunk-PD5DFBCU.js";import"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";export{a as WAIT_MS,b as extensionInUse,c as withExtensionLock};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as T}from"./chunk-XFEHJ4C7.js";import{a as m,b as z,c as $}from"./chunk-4YCO7S4K.js";import{a as b,b as A}from"./chunk-TEGB7JRM.js";import{I as P,O as g,P as j,Q as y,R as S,g as R}from"./chunk-PD5DFBCU.js";import{a as O}from"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";import{createHash as H,randomBytes as K}from"node:crypto";import{createReadStream as ie,createWriteStream as se}from"node:fs";import{mkdir as U,readdir as B,readFile as X,rename as q,rm as w,rmdir as Q,stat as V,statfs as ae,writeFile as ce}from"node:fs/promises";import{release as fe}from"node:os";import{join as c}from"node:path";import{Readable as ue,Transform as de}from"node:stream";import{pipeline as le}from"node:stream/promises";import{gunzip as he}from"node:zlib";import{mkdir as W,writeFile as ne}from"node:fs/promises";import{dirname as re,join as L,normalize as oe}from"node:path";var v=512;function x(e,n,t){let r=e.indexOf(0,n);return e.toString("utf8",n,r===-1||r>n+t?n+t:r)}function _(e,n,t){let r=Number.parseInt(x(e,n,t).trim()||"0",8);if(Number.isNaN(r))throw new Error("bad tar header");return r}async function D(e,n){let t=0,r;for(;t+v<=e.length;){let o=e.subarray(t,t+v);if(o.every(f=>f===0))return;let u=_(o,124,12),l=_(o,100,8),i=String.fromCharCode(o[156]??0),p=x(o,345,155),h=p.length>0?`${p}/${x(o,0,100)}`:x(o,0,100);t+=v;let d=e.subarray(t,t+u);if(d.length<u)throw new Error("truncated tar");if(t+=Math.ceil(u/v)*v,i==="L"){r=x(d,0,d.length);continue}if(i==="x"){let f=/(?:^|\n)\d+ path=([^\n]*)\n/.exec(d.toString("utf8"));f?.[1]!==void 0&&(r=f[1]);continue}if(i==="g")continue;r!==void 0&&(h=r,r=void 0);let a=oe(h);if(a.startsWith("/")||a===".."||a.startsWith("../"))throw new Error(`unsafe path in archive: ${h}`);if(i==="5")await W(L(n,a),{recursive:!0});else if(i==="0"||i==="\0"){let f=L(n,a);await W(re(f),{recursive:!0}),await ne(f,d,{mode:l&64?493:420})}else throw new Error(`unsupported entry type in archive: ${h}`)}}async function Y(e){let n=0;for(let t of await B(e,{withFileTypes:!0}).catch(()=>[])){let r=c(e,t.name);t.isDirectory()?n+=await Y(r):t.isFile()&&(n+=(await V(r).catch(()=>{}))?.size??0)}return n}function me(){let e=Number.parseInt(fe(),10);return e>=25?e+1:e-9}function C(e){let n=process.arch==="arm64"?"arm64":process.arch==="x64"?"x64":void 0;return e.assets.universal??(n===void 0?void 0:e.assets[n])}function Z(e){return process.platform!=="darwin"?{supported:!1,reason:"extensions need macOS"}:me()<e.minMacos?{supported:!1,reason:`needs macOS ${e.minMacos} or later`}:C(e)===void 0?{supported:!1,reason:`no build for ${process.arch} Macs`}:{supported:!0}}async function Te(){return Promise.all(b.map(async e=>{let n=await $(e.id),t=Z(e),r={entry:e,updateAvailable:n!==void 0&&n.version!==e.version,supported:t.supported};n!==void 0&&(r.installed=n.version,r.installedBytes=await Y(c(m(),e.id))),t.reason!==void 0&&(r.reason=t.reason);let o=C(e);return t.supported&&o!==void 0&&(r.downloadBytes=o.bytes),r}))}var we=e=>new Promise((n,t)=>{he(e,(r,o)=>r?t(r):n(o))});async function pe(e){let n=H("sha256");for await(let t of ie(e))n.update(t);return n.digest("hex")}async function ge(e,n){let t=JSON.parse(await X(c(e,"manifest.json"),"utf8"));if(t.id!==n.id||t.version!==n.version)throw new Error("the archive is for a different extension or version");let r=t.files;if(typeof r!="object"||r===null)throw new Error("manifest lists no files");if(t.kind!=="node"&&t.kind!=="exec"||typeof t.entry!="string"||!(t.entry in r))throw new Error("manifest has no valid entry");for(let[o,u]of Object.entries(r)){if(o.startsWith("/")||o.split("/").includes(".."))throw new Error(`unsafe path ${o}`);if(await pe(c(e,o)).catch(()=>{})!==u)throw new Error(`${o} does not match the manifest`)}}async function ye(e,n){let t=c(e,`.current-${K(4).toString("hex")}`);await ce(t,`${n}
|
|
4
|
-
`),await q(t,c(e,"current"))}function G(e){let n=process.env.FORGE_EXTENSIONS_BASE_URL;return n===void 0||n===""?e:`${n.replace(/\/+$/,"")}/${e.slice(e.lastIndexOf("/")+1)}`}var be=600*1e3;async function ee(e){let n=Date.now()-be,t=async(r,o)=>{for(let u of await B(r).catch(()=>[])){if(!u.startsWith(o))continue;let l=c(r,u),i=await V(l).catch(()=>{});i!==void 0&&i.mtimeMs<n&&await w(l,{recursive:!0,force:!0}).catch(()=>{})}};await t(e,".download-");for(let r of b){let o=c(e,r.id);await t(o,".staging-"),await t(o,".current-"),await Q(o).catch(()=>{})}}function J(e){return e?.code==="ENOSPC"}var k=class extends Error{};async function We(e,n={}){let t=A(e);if(t===void 0)throw P(`${e} is not a known extension.`,`Try one of: ${b.map(a=>a.id).join(", ")}.`);await ee(m());let r=Z(t),o=C(t);if(!r.supported||o===void 0)throw j(e,r.reason??"no build for this Mac");let u=await $(t.id);if(u?.version===t.version)return u;let l=m(),i=c(l,t.id);await U(i,{recursive:!0});try{let a=await ae(l);if(a.bavail*a.bsize<o.bytes*2.5)throw S(e,`not enough free disk space (about ${O(Math.ceil(o.bytes*2.5))} needed).`)}catch(a){if(R(a))throw a}let p=K(6).toString("hex"),h=c(l,`.download-${p}.tar.gz`),d=c(i,`.staging-${p}`);try{let a=n.fetchImpl??fetch,f;try{f=await a(G(o.url),{signal:n.signal})}catch{throw y(e,`could not reach ${new URL(G(o.url)).host}.`)}if(!f.ok||f.body===null)throw y(e,`the server answered ${f.status}.`);let F=H("sha256"),E=0,te=new de({transform(s,ve,M){if(E+=s.length,E>o.bytes)return M(new k);F.update(s),n.onProgress?.(E,o.bytes),M(null,s)}});try{await le(ue.fromWeb(f.body),te,se(h),n.signal?{signal:n.signal}:{})}catch(s){throw n.signal?.aborted?s:s instanceof k?g(e,"the download is larger than its published size."):J(s)?S(e,"the disk filled up during the download."):y(e,"the connection dropped before the download finished.")}if(E<o.bytes)throw y(e,"the download ended early.");if(F.digest("hex")!==o.sha256)throw g(e,"the download does not match its published checksum.");n.signal?.throwIfAborted();try{await U(d,{recursive:!0}),await D(await we(await X(h)),d),await ge(d,t)}catch(s){throw J(s)?S(e,"the disk filled up while unpacking."):g(e,s instanceof Error?s.message:"the archive could not be unpacked.")}n.signal?.throwIfAborted();let I=c(i,t.version);await w(I,{recursive:!0,force:!0}),await q(d,I),await ye(i,t.version);for(let s of await B(i))s!==t.version&&s!=="current"&&z.test(s)&&await w(c(i,s),{recursive:!0,force:!0});let N=await $(t.id);if(N===void 0)throw g(e,"the installed files could not be read.");return N}finally{await w(h,{force:!0}),await w(d,{recursive:!0,force:!0}),await Q(i).catch(()=>{})}}async function Le(e){let n=A(e);if(n===void 0)throw P(`${e} is not a known extension.`,`Try one of: ${b.map(t=>t.id).join(", ")}.`);return T(n.id,async()=>{await ee(m());let t=c(m(),n.id),r=(await B(t).catch(()=>[])).some(o=>!o.startsWith("."));return await w(t,{recursive:!0,force:!0}),r},{waitMs:0,action:"remove",what:`${n.title} is being removed`})}export{We as installExtension,Te as listExtensions,Le as removeExtension};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c}from"./chunk-4YCO7S4K.js";import"./chunk-TEGB7JRM.js";import"./chunk-TMUK2DD3.js";export{b as SAFE_NAME,a as extensionsRoot,c as installed};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as x}from"./chunk-XFEHJ4C7.js";import"./chunk-4YCO7S4K.js";import"./chunk-TEGB7JRM.js";import{T as w,U as E,Y as d}from"./chunk-PD5DFBCU.js";import"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";import{spawn as P}from"node:child_process";var p=Promise.resolve();function J(e,r,n={}){let t=()=>(n.onStart?.(),L(e,r,n)),s=p.then(()=>e.id===void 0?t():x(e.id,t,{...n.what!==void 0?{what:n.what}:{},...n.signal!==void 0?{signal:n.signal}:{},...n.onWait!==void 0?{onWait:n.onWait}:{}}));return p=s.catch(()=>{}),s}function O(e){let r=e.indexOf("--in");return(r>=0?e[r+1]:e[0])??""}function y(e,r,n,t){return e==="no-subject"?w(n):e==="boost-too-large"?E(n,t.maxScale??0):d(n,new Error(r))}function L(e,r,n){let{signal:t}=n,s=n.subject??O(r);return t?.aborted?Promise.reject(t.reason??new Error("aborted")):new Promise((R,a)=>{let[S,k]=e.kind==="node"?[process.execPath,[e.entry,...r]]:[e.entry,r],u=P(S,k,{stdio:["ignore","pipe","pipe"]}),c="",b="",g=!1,l=i=>{g||(g=!0,t?.removeEventListener("abort",f),i())},f=()=>u.kill("SIGKILL");u.on("exit",()=>{t?.aborted&&l(()=>a(t.reason??new Error("aborted")))}),t?.addEventListener("abort",f,{once:!0}),u.stdout.setEncoding("utf8").on("data",i=>{c+=i}),u.stderr.setEncoding("utf8").on("data",i=>{b+=i}),u.on("error",i=>l(()=>a(d(s,i)))),u.on("close",i=>l(()=>{let h=c.split(`
|
|
4
|
-
`).filter(v=>v.trim().startsWith("{")).at(-1),m;try{m=h?JSON.parse(h):void 0}catch{m=void 0}let o=m;if(o&&o.ok===!0&&i===0)return R({width:Number(o.width),height:Number(o.height),ms:Number(o.ms)});if(o&&o.ok===!1)return a(y(String(o.code??""),String(o.message??""),s,n));a(d(s,new Error(`extension exited ${i} without a result: ${(b||c).trim().slice(-500)}`)))}))})}export{J as runExtension};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-G2D6BKOS.js";import"./chunk-TMUK2DD3.js";export{r as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,i as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,t as applyColourPreference,s as colourEnabled,q as colourProp,n as commandsPalette,m as dotGradient,j as modeColours,h as modeForKey,k as modeGradient,o as modePalette,l as modeWash,p as paletteFor};
|