forge-terminal 0.5.8 → 0.5.9

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 (46) hide show
  1. package/README.md +3 -3
  2. package/dist/chunks/{about-credits-PQSIWSE2.js → about-credits-32BUKO4K.js} +1 -1
  3. package/dist/chunks/{args-J5JEHQLE.js → args-ZVZQR23M.js} +1 -1
  4. package/dist/chunks/{boot-ETZUHG3U.js → boot-2YFTQOMG.js} +1 -1
  5. package/dist/chunks/{chunk-KTCHWHQB.js → chunk-3374PCO5.js} +1 -1
  6. package/dist/chunks/{chunk-RT6EXB2P.js → chunk-6KUWZQGG.js} +1 -1
  7. package/dist/chunks/{chunk-T4CLHCLJ.js → chunk-6MWJO3GB.js} +2 -2
  8. package/dist/chunks/{chunk-J7Z7ULLN.js → chunk-6PEIZZNE.js} +1 -1
  9. package/dist/chunks/{chunk-2M5PPZIS.js → chunk-7FW7JX74.js} +2 -2
  10. package/dist/chunks/{chunk-YISJTRB6.js → chunk-7XDMC7FL.js} +1 -1
  11. package/dist/chunks/{chunk-VBDRWNEG.js → chunk-AR3M2PLK.js} +1 -1
  12. package/dist/chunks/{chunk-TJ5YBJEO.js → chunk-ASLKQXZ2.js} +1 -1
  13. package/dist/chunks/{chunk-FEFNS6YZ.js → chunk-BKLPRILS.js} +1 -1
  14. package/dist/chunks/{chunk-DHW72U6X.js → chunk-FBVRKMAF.js} +1 -1
  15. package/dist/chunks/{chunk-Z6IQV737.js → chunk-GHYODKA3.js} +1 -1
  16. package/dist/chunks/{chunk-XGG3NYQN.js → chunk-GVVQP3LF.js} +1 -1
  17. package/dist/chunks/{chunk-RQWWUCGQ.js → chunk-K253E723.js} +1 -1
  18. package/dist/chunks/{chunk-NAE3AJ3M.js → chunk-L44NRTP4.js} +1 -1
  19. package/dist/chunks/{chunk-BP6CVOQR.js → chunk-NDYMC3HY.js} +2 -2
  20. package/dist/chunks/{chunk-6TTONCYR.js → chunk-OQBIYNGK.js} +1 -1
  21. package/dist/chunks/{chunk-H3KW7HTC.js → chunk-QQV7CCAY.js} +1 -1
  22. package/dist/chunks/{chunk-DD5Z6NSH.js → chunk-RCWFUBTG.js} +1 -1
  23. package/dist/chunks/{chunk-4OSMYHKQ.js → chunk-TGC24JEW.js} +1 -1
  24. package/dist/chunks/{chunk-NUW4YOJ6.js → chunk-VJMOZPHW.js} +1 -1
  25. package/dist/chunks/{chunk-JI7YY44M.js → chunk-YRXJDFP3.js} +1 -1
  26. package/dist/chunks/{clip-command-QIMH2U7N.js → clip-command-MDSM6KJP.js} +1 -1
  27. package/dist/chunks/{colour-3MFAFJNN.js → colour-2MYODUDY.js} +1 -1
  28. package/dist/chunks/{entry-HGEJC7CZ.js → entry-BZYPZONY.js} +1 -1
  29. package/dist/chunks/{execute-MRVDAKZO.js → execute-7M6WA4W7.js} +1 -1
  30. package/dist/chunks/{extensions-ONARRS5Q.js → extensions-E3OUBT36.js} +1 -1
  31. package/dist/chunks/{extensions-command-65QEMN2L.js → extensions-command-JZSOQJEV.js} +1 -1
  32. package/dist/chunks/{ffmpeg-RTFJS67A.js → ffmpeg-KDZEPLNA.js} +1 -1
  33. package/dist/chunks/{launch-T7YOO7BQ.js → launch-VNW4YQ4Z.js} +5 -5
  34. package/dist/chunks/{manager-5EJGANFW.js → manager-L753MI7U.js} +1 -1
  35. package/dist/chunks/{needed-6GCBKP3S.js → needed-DYERJ72M.js} +1 -1
  36. package/dist/chunks/{own-KMIT2CXF.js → own-2QGMHSKL.js} +1 -1
  37. package/dist/chunks/{preset-command-3ILRQZSJ.js → preset-command-UNMXHW5A.js} +1 -1
  38. package/dist/chunks/{registry-K245FDI2.js → registry-RS7LQ3UA.js} +1 -1
  39. package/dist/chunks/{server-M5YGJHOL.js → server-PIXRL5PA.js} +18 -18
  40. package/dist/chunks/{theme-XKWZV7OX.js → theme-P3ZE2ZYB.js} +1 -1
  41. package/dist/chunks/{transcribe-SQC6QTV5.js → transcribe-KXQXEVBJ.js} +1 -1
  42. package/dist/chunks/{transcribe-command-PAHSXMWG.js → transcribe-command-JHWN4RWU.js} +1 -1
  43. package/dist/chunks/{update-note-NRPILOCL.js → update-note-CY3LCBCJ.js} +1 -1
  44. package/dist/chunks/{watch-command-QOMMDISG.js → watch-command-QGVXM23I.js} +1 -1
  45. package/dist/index.js +6 -6
  46. package/package.json +3 -7
@@ -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,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-4OSMYHKQ.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,n as dotGradient,o as menuPalette,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
3
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-TGC24JEW.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,n as dotGradient,o as menuPalette,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n}from"./chunk-2M5PPZIS.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-HZDYZ5RD.js";import"./chunk-6TTONCYR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-ZBMJTIYR.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{h as appleDoes,e as chooseHearing,c as helperPaths,d as helpers,b as notesNeed,i as probeSound,l as readRefusal,m as renderPages,n as renderTranscript,k as runRead,j as runTranscribe,a as transcribeNeeds,f as transcribeStatus,g as whisperUseful};
3
+ import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n}from"./chunk-7FW7JX74.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-HZDYZ5RD.js";import"./chunk-OQBIYNGK.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-ZBMJTIYR.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{h as appleDoes,e as chooseHearing,c as helperPaths,d as helpers,b as notesNeed,i as probeSound,l as readRefusal,m as renderPages,n as renderTranscript,k as runRead,j as runTranscribe,a as transcribeNeeds,f as transcribeStatus,g as whisperUseful};
@@ -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 as tt}from"./chunk-NAE3AJ3M.js";import{a as S,b as Y,c as Z,d as x}from"./chunk-YPAFAG4W.js";import{c as X}from"./chunk-RT6EXB2P.js";import"./chunk-XGG3NYQN.js";import{a as M,b as B,c as H,d as K,f as q,g as z,k,o as G,p as J,q as Q,r as V,s as W}from"./chunk-2M5PPZIS.js";import"./chunk-VBDRWNEG.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-KTCHWHQB.js";import"./chunk-HZDYZ5RD.js";import"./chunk-O7DK3GJT.js";import"./chunk-RQWWUCGQ.js";import"./chunk-EEQSUBBL.js";import"./chunk-6TTONCYR.js";import"./chunk-FAUL5L2W.js";import{a as j,d as D}from"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TLHUFIXD.js";import"./chunk-4MJEEEFA.js";import{a as T,r as P}from"./chunk-V6GWPR2A.js";import"./chunk-WBW6G4N6.js";import{G as A,a as I,b as U,oa as L,qa as O,ra as y,ta as R,ua as C,va as N,y as g}from"./chunk-ZBMJTIYR.js";import"./chunk-J7FLFHQJ.js";import{c as v}from"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{existsSync as $}from"node:fs";import{stat as it}from"node:fs/promises";import{basename as l,dirname as rt,extname as w,join as et,resolve as p}from"node:path";function at(t){if(t.format)return t.format;let e=t.output;if(e===void 0||T(e))return"md";let r=w(e).toLowerCase();return j.find(n=>n.ext===r)?.id??"md"}function h(t,e,r,n){let i=`${t}${D(n)}`;return r===void 0?et(e,i):T(r)?et(p(r),i):p(r)}var nt=t=>t.split(/\s+/).filter(Boolean).length,st=t=>t.segments.reduce((e,r)=>e+nt(r.text),0);async function ct(t){let{probe:e}=await import("./registry-K245FDI2.js"),r=await e(t).catch(()=>{throw L(t)});return _(r)}async function dt(t,e,r,n){if(e.to!==void 0)throw A("--to is for video and sound: a picture or PDF gives its text as it is.",`Try: forge transcribe ${l(t.path)}`);if(!(await k())?.read)throw await Q();let o=h(l(t.path,w(t.path)),rt(t.path),e.output,n);if($(o)&&!e.force)throw g(o);let c=await J(t.path,{language:e.language,signal:r.signal,onEvent:r.onProgress}),a=M(c);if(!B(a))throw R(t.path);await P(o,await V(a,n,l(t.path),{signal:r.signal,lang:e.language})),r.document?.({path:o,markdown:H(a)});let s=t.what==="pdf"?`${t.pages} ${t.pages===1?"page":"pages"}`:w(t.path).slice(1).toUpperCase()||"picture";return r.out(`\u2713 ${v(o)} ${s} \u2192 ${nt(K(a)).toLocaleString("en-US")} words`),r.finished?.({made:[{from:[t.path],to:[o]}],failed:[]}),0}async function xt(t,e){try{let r=S(t.input);if(r?.kind==="playlist")throw O("This is a playlist.",void 0,{hint:"Pass one video's link.",shellHint:"Paste one video's link."});let n,i,o,c,a=at(t);if(r===void 0){if(n=p(t.input),!(await it(n).catch(()=>{}))?.isFile())throw U(n);let d=await X(n);if(d!=="video"&&d!=="audio"){let u=await ct(n);if(u)return await dt(u,t,e,a)}}let s=await k(t.language?{locale:t.language}:{});if(s===void 0||!s.speech)throw y(q(process.platform,s?.missing));let E=t.notes&&s.notes==="available";if(t.notes&&!E){if(!t.transcript)throw y(z(process.platform,s.notes));s.notes==="off"&&e.err("\u26A0 Apple Intelligence is off, so this is the transcript only.")}if(r===void 0){if(n=p(t.input),i={title:l(n,w(n)),from:l(n)},o=h(i.title,rt(n),t.output,a),$(o)&&!t.force)throw g(o)}else{let m=new AbortController;e.signal?.addEventListener("abort",()=>m.abort(e.signal?.reason),{once:!0});let d;c=await tt(r.url,{signal:m.signal,onEvent:u=>{u.kind==="facts"&&(d=h(x(u.facts.title),process.cwd(),t.output,a),$(d)&&!t.force&&m.abort(g(d)))}}),n=c.path,i={title:c.facts.title,from:r.url},o=d??h(x(c.facts.title),process.cwd(),t.output,a)}let f;try{f=await G(n,{notes:E,detail:t.detail,locale:t.language,signal:e.signal,onEvent:e.onProgress})}finally{await c?.dispose()}let F=Z(f,i,{transcript:t.transcript});await P(o,await W(F,a,{signal:e.signal,lang:f.locale})),e.document?.({path:o,markdown:F});let b=f.notes?.parts.length,ot=b===void 0?"":` \xB7 ${b} ${b===1?"part":"parts"}`;return e.out(`\u2713 ${v(o)} ${Y(f.seconds)} \u2192 ${st(f).toLocaleString("en-US")} words${ot}`),e.finished?.({made:[{from:[r===void 0?n:i.title],to:[o]}],failed:[]}),0}catch(r){let n=I(r)?r:C(r);for(let o of N(n,{debug:t.debug}))e.err(o);let i=S(t.input)===void 0?p(t.input):"";return e.finished?.({made:[],failed:[{path:i,message:n.message}]}),1}}export{xt as runTranscribeCommand};
3
+ import{a as _,c as tt}from"./chunk-L44NRTP4.js";import{a as S,b as Y,c as Z,d as x}from"./chunk-YPAFAG4W.js";import{c as X}from"./chunk-6KUWZQGG.js";import"./chunk-GVVQP3LF.js";import{a as M,b as B,c as H,d as K,f as q,g as z,k,o as G,p as J,q as Q,r as V,s as W}from"./chunk-7FW7JX74.js";import"./chunk-AR3M2PLK.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-3374PCO5.js";import"./chunk-HZDYZ5RD.js";import"./chunk-O7DK3GJT.js";import"./chunk-K253E723.js";import"./chunk-EEQSUBBL.js";import"./chunk-OQBIYNGK.js";import"./chunk-FAUL5L2W.js";import{a as j,d as D}from"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TLHUFIXD.js";import"./chunk-4MJEEEFA.js";import{a as T,r as P}from"./chunk-V6GWPR2A.js";import"./chunk-WBW6G4N6.js";import{G as A,a as I,b as U,oa as L,qa as O,ra as y,ta as R,ua as C,va as N,y as g}from"./chunk-ZBMJTIYR.js";import"./chunk-J7FLFHQJ.js";import{c as v}from"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{existsSync as $}from"node:fs";import{stat as it}from"node:fs/promises";import{basename as l,dirname as rt,extname as w,join as et,resolve as p}from"node:path";function at(t){if(t.format)return t.format;let e=t.output;if(e===void 0||T(e))return"md";let r=w(e).toLowerCase();return j.find(n=>n.ext===r)?.id??"md"}function h(t,e,r,n){let i=`${t}${D(n)}`;return r===void 0?et(e,i):T(r)?et(p(r),i):p(r)}var nt=t=>t.split(/\s+/).filter(Boolean).length,st=t=>t.segments.reduce((e,r)=>e+nt(r.text),0);async function ct(t){let{probe:e}=await import("./registry-RS7LQ3UA.js"),r=await e(t).catch(()=>{throw L(t)});return _(r)}async function dt(t,e,r,n){if(e.to!==void 0)throw A("--to is for video and sound: a picture or PDF gives its text as it is.",`Try: forge transcribe ${l(t.path)}`);if(!(await k())?.read)throw await Q();let o=h(l(t.path,w(t.path)),rt(t.path),e.output,n);if($(o)&&!e.force)throw g(o);let c=await J(t.path,{language:e.language,signal:r.signal,onEvent:r.onProgress}),a=M(c);if(!B(a))throw R(t.path);await P(o,await V(a,n,l(t.path),{signal:r.signal,lang:e.language})),r.document?.({path:o,markdown:H(a)});let s=t.what==="pdf"?`${t.pages} ${t.pages===1?"page":"pages"}`:w(t.path).slice(1).toUpperCase()||"picture";return r.out(`\u2713 ${v(o)} ${s} \u2192 ${nt(K(a)).toLocaleString("en-US")} words`),r.finished?.({made:[{from:[t.path],to:[o]}],failed:[]}),0}async function xt(t,e){try{let r=S(t.input);if(r?.kind==="playlist")throw O("This is a playlist.",void 0,{hint:"Pass one video's link.",shellHint:"Paste one video's link."});let n,i,o,c,a=at(t);if(r===void 0){if(n=p(t.input),!(await it(n).catch(()=>{}))?.isFile())throw U(n);let d=await X(n);if(d!=="video"&&d!=="audio"){let u=await ct(n);if(u)return await dt(u,t,e,a)}}let s=await k(t.language?{locale:t.language}:{});if(s===void 0||!s.speech)throw y(q(process.platform,s?.missing));let E=t.notes&&s.notes==="available";if(t.notes&&!E){if(!t.transcript)throw y(z(process.platform,s.notes));s.notes==="off"&&e.err("\u26A0 Apple Intelligence is off, so this is the transcript only.")}if(r===void 0){if(n=p(t.input),i={title:l(n,w(n)),from:l(n)},o=h(i.title,rt(n),t.output,a),$(o)&&!t.force)throw g(o)}else{let m=new AbortController;e.signal?.addEventListener("abort",()=>m.abort(e.signal?.reason),{once:!0});let d;c=await tt(r.url,{signal:m.signal,onEvent:u=>{u.kind==="facts"&&(d=h(x(u.facts.title),process.cwd(),t.output,a),$(d)&&!t.force&&m.abort(g(d)))}}),n=c.path,i={title:c.facts.title,from:r.url},o=d??h(x(c.facts.title),process.cwd(),t.output,a)}let f;try{f=await G(n,{notes:E,detail:t.detail,locale:t.language,signal:e.signal,onEvent:e.onProgress})}finally{await c?.dispose()}let F=Z(f,i,{transcript:t.transcript});await P(o,await W(F,a,{signal:e.signal,lang:f.locale})),e.document?.({path:o,markdown:F});let b=f.notes?.parts.length,ot=b===void 0?"":` \xB7 ${b} ${b===1?"part":"parts"}`;return e.out(`\u2713 ${v(o)} ${Y(f.seconds)} \u2192 ${st(f).toLocaleString("en-US")} words${ot}`),e.finished?.({made:[{from:[r===void 0?n:i.title],to:[o]}],failed:[]}),0}catch(r){let n=I(r)?r:C(r);for(let o of N(n,{debug:t.debug}))e.err(o);let i=S(t.input)===void 0?p(t.input):"";return e.finished?.({made:[],failed:[{path:i,message:n.message}]}),1}}export{xt as runTranscribeCommand};
@@ -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 m,c as w,d as h,i as l,j as p,k as b}from"./chunk-SZRSAL64.js";import{c as $,d as g}from"./chunk-4OSMYHKQ.js";import{e as u}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await u();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?g:$:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
3
+ import{b as m,c as w,d as h,i as l,j as p,k as b}from"./chunk-SZRSAL64.js";import{c as $,d as g}from"./chunk-TGC24JEW.js";import{e as u}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await u();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?g:$:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
@@ -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 R,d as k}from"./chunk-DD5Z6NSH.js";import{a as W,d as N}from"./chunk-RT6EXB2P.js";import"./chunk-FEFNS6YZ.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-NUW4YOJ6.js";import"./chunk-VBDRWNEG.js";import"./chunk-DHW72U6X.js";import"./chunk-KTCHWHQB.js";import{d as w,e as h}from"./chunk-YJ6XLDRA.js";import"./chunk-63XCSYHM.js";import{a as S}from"./chunk-4OSMYHKQ.js";import"./chunk-O7DK3GJT.js";import"./chunk-RQWWUCGQ.js";import"./chunk-EEQSUBBL.js";import"./chunk-6TTONCYR.js";import"./chunk-FAUL5L2W.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TLHUFIXD.js";import"./chunk-4MJEEEFA.js";import"./chunk-V6GWPR2A.js";import"./chunk-WBW6G4N6.js";import{G as L,a as M,b as I,va as E}from"./chunk-ZBMJTIYR.js";import{a as A}from"./chunk-J7FLFHQJ.js";import{c as a}from"./chunk-VLVNA4T3.js";import{a as F}from"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{readdir as T,stat as B}from"node:fs/promises";import{join as C,resolve as y}from"node:path";function K(r,t,s,n){return[`\u2713 ${r} converted${n?` to ${n}`:""}`,...t?[`${t} failed`]:[],...s?[`${s} left alone`]:[]].join(" \xB7 ")}var P=r=>{let[t,...s]=r.job.outputs,n=`${a(t??"")}${s.length?` + ${s.length} more`:""}`;return`\u2713 ${a(r.job.sources[0].path)} \u2192 ${n} ${A(r.outputBytes)}`},O=(r,t)=>`\u2715 ${a(r)} ${t.title.toLowerCase()}`,D=r=>`\u2013 ${a(r.path)} ${r.reason}`;async function v(r,t){let s=y(r.folder),n=(e,o)=>t.out(JSON.stringify({forge:S,event:e,...o}));try{let e=await B(s).catch(()=>{});if(!e)throw I(s);if(!e.isDirectory())throw L(`${a(s)} is not a folder.`,`forge watch watches a folder. Try: forge watch ${a(y(s,".."))} --to ${r.target}`)}catch(e){if(!M(e))throw e;if(t.json)n("error",{ok:!1,failures:[h({error:e})]});else for(let o of E(e,{debug:r.debug}))t.out(o);return 2}let m={target:r.target,...r.quality===void 0?{}:{quality:r.quality},dpi:r.dpi??150},$={images:m,pdfs:m,documents:m},c=r.output===void 0?void 0:y(r.output),q=F[r.target].label,p=0,i=[],u=[],b=new Set,g;if(r.newOnly)g=(await T(s,{withFileTypes:!0})).filter(o=>o.isFile()&&!W(o.name)).map(o=>C(s,o.name));else{let e=await N(s);g=e.paths;let o=await R(e,$,{destination:c});b=o.claimed;let f=[...e.failures,...o.outcome.refusals,...o.outcome.failures],j=e.kinds.flatMap(l=>l.why?[{count:l.count,why:l.why}]:[]),J=o.left.length+j.reduce((l,d)=>l+d.count,0);if(p+=o.outcome.results.length,i.push(...f),u.push(...o.left),t.json)n("converted-existing",{ok:f.length===0,results:o.outcome.results.map(w),failures:f.map(h),leftAlone:o.left});else if(e.paths.length>0){t.out(K(o.outcome.results.length,f.length,J,q));for(let l of f)t.out(O(l.path,l.error))}for(let l of j)for(let d=0;d<l.count;d++)u.push({path:"",reason:l.why})}t.json?n("watching",{folder:s,...c?{output:c}:{}}):t.out(`Watching ${a(s)} \xB7 any new files you add will be converted \xB7 ctrl-c to stop`);let x=k({dir:s,answers:$,known:g,claimed:b,destination:c,...t.settleMs===void 0?{}:{settleMs:t.settleMs},...t.pollMs===void 0?{}:{pollMs:t.pollMs},onEvent:e=>{e.type==="converted"?(p++,t.json?n("converted",{result:w(e.result)}):t.out(P(e.result))):e.type==="failed"?(i.push({path:e.path,error:e.error}),t.json?n("failed",{failure:h({path:e.path,error:e.error})}):t.out(O(e.path,e.error))):e.type==="left"&&(u.push({path:e.path,reason:e.reason}),t.json?n("left-alone",{path:e.path,reason:e.reason}):t.out(D({path:e.path,reason:e.reason})))}});return await new Promise(e=>{t.signal.aborted?e():t.signal.addEventListener("abort",()=>e(),{once:!0})}),await x.stop(),t.json?n("stopped",{converted:p,failed:i.length,leftAlone:u.length}):t.out(K(p,i.length,u.length)),i.length>0?1:0}export{v as runWatch};
3
+ import{c as R,d as k}from"./chunk-RCWFUBTG.js";import{a as W,d as N}from"./chunk-6KUWZQGG.js";import"./chunk-BKLPRILS.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-VJMOZPHW.js";import"./chunk-AR3M2PLK.js";import"./chunk-FBVRKMAF.js";import"./chunk-3374PCO5.js";import{d as w,e as h}from"./chunk-YJ6XLDRA.js";import"./chunk-63XCSYHM.js";import{a as S}from"./chunk-TGC24JEW.js";import"./chunk-O7DK3GJT.js";import"./chunk-K253E723.js";import"./chunk-EEQSUBBL.js";import"./chunk-OQBIYNGK.js";import"./chunk-FAUL5L2W.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TLHUFIXD.js";import"./chunk-4MJEEEFA.js";import"./chunk-V6GWPR2A.js";import"./chunk-WBW6G4N6.js";import{G as L,a as M,b as I,va as E}from"./chunk-ZBMJTIYR.js";import{a as A}from"./chunk-J7FLFHQJ.js";import{c as a}from"./chunk-VLVNA4T3.js";import{a as F}from"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{readdir as T,stat as B}from"node:fs/promises";import{join as C,resolve as y}from"node:path";function K(r,t,s,n){return[`\u2713 ${r} converted${n?` to ${n}`:""}`,...t?[`${t} failed`]:[],...s?[`${s} left alone`]:[]].join(" \xB7 ")}var P=r=>{let[t,...s]=r.job.outputs,n=`${a(t??"")}${s.length?` + ${s.length} more`:""}`;return`\u2713 ${a(r.job.sources[0].path)} \u2192 ${n} ${A(r.outputBytes)}`},O=(r,t)=>`\u2715 ${a(r)} ${t.title.toLowerCase()}`,D=r=>`\u2013 ${a(r.path)} ${r.reason}`;async function v(r,t){let s=y(r.folder),n=(e,o)=>t.out(JSON.stringify({forge:S,event:e,...o}));try{let e=await B(s).catch(()=>{});if(!e)throw I(s);if(!e.isDirectory())throw L(`${a(s)} is not a folder.`,`forge watch watches a folder. Try: forge watch ${a(y(s,".."))} --to ${r.target}`)}catch(e){if(!M(e))throw e;if(t.json)n("error",{ok:!1,failures:[h({error:e})]});else for(let o of E(e,{debug:r.debug}))t.out(o);return 2}let m={target:r.target,...r.quality===void 0?{}:{quality:r.quality},dpi:r.dpi??150},$={images:m,pdfs:m,documents:m},c=r.output===void 0?void 0:y(r.output),q=F[r.target].label,p=0,i=[],u=[],b=new Set,g;if(r.newOnly)g=(await T(s,{withFileTypes:!0})).filter(o=>o.isFile()&&!W(o.name)).map(o=>C(s,o.name));else{let e=await N(s);g=e.paths;let o=await R(e,$,{destination:c});b=o.claimed;let f=[...e.failures,...o.outcome.refusals,...o.outcome.failures],j=e.kinds.flatMap(l=>l.why?[{count:l.count,why:l.why}]:[]),J=o.left.length+j.reduce((l,d)=>l+d.count,0);if(p+=o.outcome.results.length,i.push(...f),u.push(...o.left),t.json)n("converted-existing",{ok:f.length===0,results:o.outcome.results.map(w),failures:f.map(h),leftAlone:o.left});else if(e.paths.length>0){t.out(K(o.outcome.results.length,f.length,J,q));for(let l of f)t.out(O(l.path,l.error))}for(let l of j)for(let d=0;d<l.count;d++)u.push({path:"",reason:l.why})}t.json?n("watching",{folder:s,...c?{output:c}:{}}):t.out(`Watching ${a(s)} \xB7 any new files you add will be converted \xB7 ctrl-c to stop`);let x=k({dir:s,answers:$,known:g,claimed:b,destination:c,...t.settleMs===void 0?{}:{settleMs:t.settleMs},...t.pollMs===void 0?{}:{pollMs:t.pollMs},onEvent:e=>{e.type==="converted"?(p++,t.json?n("converted",{result:w(e.result)}):t.out(P(e.result))):e.type==="failed"?(i.push({path:e.path,error:e.error}),t.json?n("failed",{failure:h({path:e.path,error:e.error})}):t.out(O(e.path,e.error))):e.type==="left"&&(u.push({path:e.path,reason:e.reason}),t.json?n("left-alone",{path:e.path,reason:e.reason}):t.out(D({path:e.path,reason:e.reason})))}});return await new Promise(e=>{t.signal.aborted?e():t.signal.addEventListener("abort",()=>e(),{once:!0})}),await x.stop(),t.json?n("stopped",{converted:p,failed:i.length,leftAlone:u.length}):t.out(K(p,i.length,u.length)),i.length>0?1:0}export{v as runWatch};
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __forgeCreateRequire } from 'node:module';
3
3
  const require = __forgeCreateRequire(import.meta.url);
4
- import{e as x,f as S}from"./chunks/chunk-YISJTRB6.js";import{b as g,d as C}from"./chunks/chunk-IBPGC4N2.js";import"./chunks/chunk-DHW72U6X.js";import"./chunks/chunk-KTCHWHQB.js";import"./chunks/chunk-HZDYZ5RD.js";import"./chunks/chunk-N32JL4UI.js";import{g as b}from"./chunks/chunk-YJ6XLDRA.js";import"./chunks/chunk-63XCSYHM.js";import{a as p}from"./chunks/chunk-4OSMYHKQ.js";import{b as E}from"./chunks/chunk-O7DK3GJT.js";import"./chunks/chunk-RQWWUCGQ.js";import"./chunks/chunk-EEQSUBBL.js";import"./chunks/chunk-6TTONCYR.js";import"./chunks/chunk-FAUL5L2W.js";import"./chunks/chunk-HTA25PO2.js";import"./chunks/chunk-N6RCLJE6.js";import"./chunks/chunk-WE6KP4FR.js";import"./chunks/chunk-KH5DHZ2U.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TLHUFIXD.js";import"./chunks/chunk-4MJEEEFA.js";import"./chunks/chunk-V6GWPR2A.js";import"./chunks/chunk-WBW6G4N6.js";import{G as $,a as w,ua as k,va as m}from"./chunks/chunk-ZBMJTIYR.js";import"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-VLVNA4T3.js";import"./chunks/chunk-H3DIRJFE.js";import"./chunks/chunk-KXKQDFHX.js";import"./chunks/chunk-TMUK2DD3.js";import*as j from"node:module";function v(e){return w(e)?e:k(e)}function T(e,n){return m(v(e),{debug:n})}function F(e,n){process.once("beforeExit",()=>{e()||(n(new Error("Forge stopped before it finished: it was waiting for input that never came.")),process.exitCode=1)})}E();j.enableCompileCache?.();function M({completed:e,total:n}){e===0?process.stderr.write(`Converting ${n} files
4
+ import{e as x,f as S}from"./chunks/chunk-7XDMC7FL.js";import{b as g,d as C}from"./chunks/chunk-IBPGC4N2.js";import"./chunks/chunk-FBVRKMAF.js";import"./chunks/chunk-3374PCO5.js";import"./chunks/chunk-HZDYZ5RD.js";import"./chunks/chunk-N32JL4UI.js";import{g as b}from"./chunks/chunk-YJ6XLDRA.js";import"./chunks/chunk-63XCSYHM.js";import{a as p}from"./chunks/chunk-TGC24JEW.js";import{b as E}from"./chunks/chunk-O7DK3GJT.js";import"./chunks/chunk-K253E723.js";import"./chunks/chunk-EEQSUBBL.js";import"./chunks/chunk-OQBIYNGK.js";import"./chunks/chunk-FAUL5L2W.js";import"./chunks/chunk-HTA25PO2.js";import"./chunks/chunk-N6RCLJE6.js";import"./chunks/chunk-WE6KP4FR.js";import"./chunks/chunk-KH5DHZ2U.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TLHUFIXD.js";import"./chunks/chunk-4MJEEEFA.js";import"./chunks/chunk-V6GWPR2A.js";import"./chunks/chunk-WBW6G4N6.js";import{G as $,a as w,ua as k,va as m}from"./chunks/chunk-ZBMJTIYR.js";import"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-VLVNA4T3.js";import"./chunks/chunk-H3DIRJFE.js";import"./chunks/chunk-KXKQDFHX.js";import"./chunks/chunk-TMUK2DD3.js";import*as j from"node:module";function v(e){return w(e)?e:k(e)}function T(e,n){return m(v(e),{debug:n})}function F(e,n){process.once("beforeExit",()=>{e()||(n(new Error("Forge stopped before it finished: it was waiting for input that never came.")),process.exitCode=1)})}E();j.enableCompileCache?.();function M({completed:e,total:n}){e===0?process.stderr.write(`Converting ${n} files
5
5
  `):process.stderr.write(` ${e}/${n}
6
- `)}async function D(){let e=process.argv.slice(2),n=e.includes("--debug"),d=x(e);try{if(e[0]==="__update-check"){let{checkNow:r}=await import("./chunks/check-B6NP7BEM.js");await r();return}if(e[0]==="menu"){let{openedForClick:r,parseMenuArgs:t}=await import("./chunks/command-GAGAD65W.js"),s=t(e.slice(1));if(s.kind==="open"){let{applyColourPreference:h}=await import("./chunks/theme-XKWZV7OX.js");h();let{bootShell:I}=await import("./chunks/boot-ETZUHG3U.js");await I(void 0,{opened:await r(s.action,s.paths)});return}let{runMenuCommand:c}=await import("./chunks/entry-HGEJC7CZ.js");process.exitCode=await c(s,p);return}if(e[0]==="mcp"){let{runMcpServer:r}=await import("./chunks/server-M5YGJHOL.js");await r(e.slice(1));return}let o=S(e);if(o.kind==="shell"){if(d)throw $("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
6
+ `)}async function D(){let e=process.argv.slice(2),n=e.includes("--debug"),d=x(e);try{if(e[0]==="__update-check"){let{checkNow:r}=await import("./chunks/check-B6NP7BEM.js");await r();return}if(e[0]==="menu"){let{openedForClick:r,parseMenuArgs:t}=await import("./chunks/command-GAGAD65W.js"),s=t(e.slice(1));if(s.kind==="open"){let{applyColourPreference:h}=await import("./chunks/theme-P3ZE2ZYB.js");h();let{bootShell:I}=await import("./chunks/boot-2YFTQOMG.js");await I(void 0,{opened:await r(s.action,s.paths)});return}let{runMenuCommand:c}=await import("./chunks/entry-BZYPZONY.js");process.exitCode=await c(s,p);return}if(e[0]==="mcp"){let{runMcpServer:r}=await import("./chunks/server-PIXRL5PA.js");await r(e.slice(1));return}let o=S(e);if(o.kind==="shell"){if(d)throw $("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
7
7
  Try: forge photo.jpg --to webp
8
- `),process.exitCode=2;return}let{applyColourPreference:r}=await import("./chunks/theme-XKWZV7OX.js");r();let{bootShell:t}=await import("./chunks/boot-ETZUHG3U.js");await t(void 0,{menuNote:async()=>(await import("./chunks/entry-HGEJC7CZ.js")).menuAtStart(p)});return}if(o.kind==="watch"){let{runWatch:r}=await import("./chunks/watch-command-QOMMDISG.js"),t=new AbortController;process.once("SIGINT",()=>t.abort()),process.exitCode=await r(o,{out:s=>process.stdout.write(`${s}
9
- `),json:d,signal:t.signal});return}if(o.kind==="uninstall"){let{runUninstall:r}=await import("./chunks/entry-HGEJC7CZ.js");process.exitCode=await r(p,t=>process.stdout.write(`${t}
10
- `));return}let{execute:l}=await import("./chunks/execute-MRVDAKZO.js"),i,y=0,A=(r,t)=>{let s=Date.now();if(r<t&&s-y<100)return;y=s;let c=h=>(h/1e6).toFixed(1);process.stderr.write(`\r downloading ${c(r)} / ${c(t)} MB${r>=t?`
8
+ `),process.exitCode=2;return}let{applyColourPreference:r}=await import("./chunks/theme-P3ZE2ZYB.js");r();let{bootShell:t}=await import("./chunks/boot-2YFTQOMG.js");await t(void 0,{menuNote:async()=>(await import("./chunks/entry-BZYPZONY.js")).menuAtStart(p)});return}if(o.kind==="watch"){let{runWatch:r}=await import("./chunks/watch-command-QGVXM23I.js"),t=new AbortController;process.once("SIGINT",()=>t.abort()),process.exitCode=await r(o,{out:s=>process.stdout.write(`${s}
9
+ `),json:d,signal:t.signal});return}if(o.kind==="uninstall"){let{runUninstall:r}=await import("./chunks/entry-BZYPZONY.js");process.exitCode=await r(p,t=>process.stdout.write(`${t}
10
+ `));return}let{execute:l}=await import("./chunks/execute-7M6WA4W7.js"),i,y=0,A=(r,t)=>{let s=Date.now();if(r<t&&s-y<100)return;y=s;let c=h=>(h/1e6).toFixed(1);process.stderr.write(`\r downloading ${c(r)} / ${c(t)} MB${r>=t?`
11
11
  `:""}`)},u=!!process.stderr.isTTY&&!d,f=new AbortController;o.kind==="extension-op"&&process.once("SIGINT",()=>f.abort());let B=Date.now(),a=await l(o,{json:d,...u?{onInstalling:r=>{i=g(process.stderr,`installing Forge ${r}`)}}:{},signal:f.signal,...u?{onDownload:A}:{},colour:!!process.stdout.isTTY&&!d&&C(),onProgress:u?r=>{r.completed>0&&i?.stop(),M(r)}:void 0,...u?{onSearch:r=>{i??=g(process.stderr,"finding the smallest that fits"),i.update(r)},onEncode:r=>{i??=g(process.stderr,"encoding"),i.update(r)}}:{}});if(i?.stop(),a.stdout.length>0&&process.stdout.write(`${a.stdout.join(`
12
12
  `)}
13
13
  `),a.stderr.length>0&&process.stderr.write(`${a.stderr.join(`
14
14
  `)}
15
- `),process.exitCode=f.signal.aborted?130:a.exitCode,u&&a.notice&&!f.signal.aborted){let{postFinishNotice:r}=await import("./chunks/notify-NQNNOBFC.js");await r(a.notice,Date.now()-B)}if(u&&process.stdout.isTTY&&o.kind!=="update")try{let{afterCommand:r,spawnRefresh:t}=await import("./chunks/update-note-NRPILOCL.js"),{runningScript:s}=await import("./chunks/install-MFYGS5TG.js"),c=await r(p,{refresh:()=>t(s(process.argv[1])),colour:C()});c.length>0&&process.stderr.write(`
15
+ `),process.exitCode=f.signal.aborted?130:a.exitCode,u&&a.notice&&!f.signal.aborted){let{postFinishNotice:r}=await import("./chunks/notify-NQNNOBFC.js");await r(a.notice,Date.now()-B)}if(u&&process.stdout.isTTY&&o.kind!=="update")try{let{afterCommand:r,spawnRefresh:t}=await import("./chunks/update-note-CY3LCBCJ.js"),{runningScript:s}=await import("./chunks/install-MFYGS5TG.js"),c=await r(p,{refresh:()=>t(s(process.argv[1])),colour:C()});c.length>0&&process.stderr.write(`
16
16
  ${c.join(`
17
17
  `)}
18
18
  `)}catch{}}catch(o){if(w(o)){d?process.stdout.write(`${JSON.stringify(b(p,o))}
package/package.json CHANGED
@@ -1,15 +1,11 @@
1
1
  {
2
2
  "name": "forge-terminal",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
4
4
  "description": "A terminal-native file converter for macOS, Windows and Linux",
5
5
  "whatsNew": [
6
6
  {
7
- "title": "Agents hear recordings",
8
- "text": "AI agents using Forge can now get the notes and transcript of a video, sound file or YouTube link, made on your computer."
9
- },
10
- {
11
- "title": "Agents read pictures",
12
- "text": "Agents can also get the text in a picture, screenshot, scan or PDF, with headings, lists and tables kept."
7
+ "title": "Works with any agent",
8
+ "text": "Agents on Gemini, Codex and other AI tools can now use Forge. Before, Gemini refused every request once Forge was set up."
13
9
  }
14
10
  ],
15
11
  "keywords": [