fluxflow-cli 4.17.1 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{addMemScore-W4I665ZR.js → addMemScore-HPTGXICT.js} +1 -1
- package/dist/chunks/ai-UMXT6VB5.js +1 -0
- package/dist/chunks/{app-ZHDEY5VH.js → app-GKXK24DF.js} +85 -85
- package/dist/chunks/{chat-HZ7UVZE2.js → chat-6R23AKX6.js} +1 -1
- package/dist/chunks/{chunk-EP3WAFTJ.js → chunk-33KD6VKN.js} +1 -1
- package/dist/chunks/{chunk-X3ZZM2GL.js → chunk-4XZGWK5L.js} +1 -1
- package/dist/chunks/chunk-EPGLNGLE.js +3 -0
- package/dist/chunks/{chunk-YNU56P2H.js → chunk-G3223ZQY.js} +1 -1
- package/dist/chunks/chunk-I4JQEUHE.js +1 -0
- package/dist/chunks/{chunk-VCF6JVQV.js → chunk-ORXN6WUW.js} +1 -1
- package/dist/chunks/chunk-Q2D63UDR.js +33 -0
- package/dist/chunks/chunk-QGPOMXO4.js +1 -0
- package/dist/chunks/{chunk-FDNLMLIM.js → chunk-RI37VZYB.js} +1 -1
- package/dist/chunks/{chunk-UAHJEAVX.js → chunk-RLT6EHPQ.js} +1 -1
- package/dist/chunks/{chunk-ZSVBC2ZI.js → chunk-UDJ2C3N3.js} +1 -1
- package/dist/chunks/{chunk-ZWNKNXAI.js → chunk-UN6TUQZX.js} +1 -1
- package/dist/chunks/{chunk-AZGFDR6K.js → chunk-VD2I7Z6Q.js} +258 -125
- package/dist/chunks/chunk-W6AVB2PY.js +6 -0
- package/dist/chunks/{chunk-HYGK7YDY.js → chunk-WFHGURXW.js} +1 -1
- package/dist/chunks/{chunk-72RYQ5W7.js → chunk-Y6DZDEJ5.js} +1 -1
- package/dist/chunks/{chunk-47AJJOP3.js → chunk-YK27Y77U.js} +174 -173
- package/dist/chunks/{chunk-KFM2OZWJ.js → chunk-YUJMCXJA.js} +1 -1
- package/dist/chunks/{click-G6RRSFVC.js → click-H7HTKF3R.js} +2 -2
- package/dist/chunks/{computer_action-WTHH7RBB.js → computer_action-UTDLLMF2.js} +1 -1
- package/dist/chunks/{drag-ZGH2MMP7.js → drag-U6X3O5GB.js} +1 -1
- package/dist/chunks/{emergency_rollback-EPJPKANN.js → emergency_rollback-HWM4FJ6J.js} +1 -1
- package/dist/chunks/{exec_command-255QUWWX.js → exec_command-BH3PUWVO.js} +1 -1
- package/dist/chunks/export-ZTNXWWJF.js +1 -0
- package/dist/chunks/{file_map-5KY2ADZW.js → file_map-XK7BFZFI.js} +1 -1
- package/dist/chunks/generate_image-H7B5XMXI.js +1 -0
- package/dist/chunks/{invoke-GJ72T6SR.js → invoke-CZ67HJ6V.js} +2 -2
- package/dist/chunks/{invokeSync-KGIQEPIQ.js → invokeSync-OU2V4FTC.js} +2 -2
- package/dist/chunks/{key_press-M5QNCIPH.js → key_press-QRO3OFLC.js} +1 -1
- package/dist/chunks/{keyboard_typing-CK3KVAWM.js → keyboard_typing-FXP3VJ6Q.js} +1 -1
- package/dist/chunks/{memory-OYIUYX3A.js → memory-TVFFXCSD.js} +1 -1
- package/dist/chunks/model_config-UZLNHYP5.js +1 -0
- package/dist/chunks/paths-Y7ACZJAE.js +1 -0
- package/dist/chunks/{saveSummary-ATBIFYDP.js → saveSummary-HFAPNJJH.js} +1 -1
- package/dist/chunks/{screen_grid-TDQC6CV5.js → screen_grid-EIPLWNEM.js} +1 -1
- package/dist/chunks/{scroll-GHXES2II.js → scroll-SND6RHXA.js} +1 -1
- package/dist/chunks/search_keyword-EAMQWPPI.js +8 -0
- package/dist/chunks/{secrets-XNJW2U6Y.js → secrets-RFEEPY3S.js} +1 -1
- package/dist/chunks/settings-JGWWOFEC.js +1 -0
- package/dist/chunks/{todo-SJLJJLVZ.js → todo-7Q2JBEVP.js} +1 -1
- package/dist/chunks/update_file-BXYTHDAC.js +13 -0
- package/dist/chunks/usage-H4SG5DWF.js +1 -0
- package/dist/chunks/usageServer-LRDIG27Z.js +1 -0
- package/dist/chunks/view_file-JRVPAETL.js +1 -0
- package/dist/chunks/{web_scrape-IKJE45Z6.js → web_scrape-LAQI7CVA.js} +1 -1
- package/dist/chunks/{web_search-2Q2BWH6G.js → web_search-D2GOWARI.js} +1 -1
- package/dist/chunks/{write_docx-EKUIZ7GV.js → write_docx-IUKMO7XL.js} +1 -1
- package/dist/chunks/{write_file-LOYRYIK6.js → write_file-QMTFTJ6V.js} +1 -1
- package/dist/chunks/{write_pdf-VB4IFPWX.js → write_pdf-UM6Z2J4K.js} +1 -1
- package/dist/cli.js +22 -9
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/ai-OUU7AEB6.js +0 -1
- package/dist/chunks/ai-X7EEY6S3.js +0 -1
- package/dist/chunks/app-QTWX774S.js +0 -285
- package/dist/chunks/chunk-AAPXJU65.js +0 -1
- package/dist/chunks/chunk-DRD5PTCI.js +0 -929
- package/dist/chunks/chunk-JRQMA5CG.js +0 -33
- package/dist/chunks/chunk-KRRJNFBF.js +0 -6
- package/dist/chunks/chunk-WKHYRBBK.js +0 -1
- package/dist/chunks/export-OHZ652N5.js +0 -1
- package/dist/chunks/generate_image-XYDE47LK.js +0 -1
- package/dist/chunks/invoke-PZPQJRG7.js +0 -6
- package/dist/chunks/invokeSync-KKA5TJM6.js +0 -3
- package/dist/chunks/paths-PM7MFWJK.js +0 -1
- package/dist/chunks/search_keyword-W5YEUUPO.js +0 -8
- package/dist/chunks/settings-2IFZMDUD.js +0 -1
- package/dist/chunks/update_file-SOXC3PMR.js +0 -13
- package/dist/chunks/usageServer-M7OKG6CP.js +0 -1
- package/dist/chunks/view_file-WUHFS5L7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b,c as h,d as f}from"./chunk-SIINYZWE.js";import{
|
|
1
|
+
import{a as v,b,c as h,d as f}from"./chunk-SIINYZWE.js";import{n as u,o as s,q as m}from"./chunk-RI37VZYB.js";import r from"fs-extra";import o from"path";r.ensureDirSync(u);var l=null;async function B(e,t){try{if(e.type==="create")await r.pathExists(e.filePath)&&(await r.chmod(e.filePath,438).catch(()=>{}),await r.remove(e.filePath));else if(e.type==="update"){if(!e.backupFile)return;let a=o.join(u,t.chatId,e.backupFile);if(await r.pathExists(a)){let n=h(a,null);if(!n||!n.data)throw new Error(`Backup container corrupt or empty for ${o.basename(e.filePath)}`);let p=b(n.data);await r.pathExists(e.filePath)&&await r.chmod(e.filePath,438).catch(()=>{}),await r.writeFile(e.filePath,p,"utf8")}}}catch(a){throw new Error(`Restoration failed for ${o.basename(e.filePath)}: ${a.message}`)}}async function P(e,t,a=7){let n=0;for(;n<a;)try{return await B(e,t),!0}catch{if(n++,n>=a)return!1;let d=Math.min(100*Math.pow(2,n-1),5e3);await new Promise(i=>setTimeout(i,d))}return!1}var I=null,R={async startTransaction(e,t){I=e,l={id:`tx_prompt_${Date.now()}`,chatId:e,timestamp:new Date().toISOString(),prompt:t.trim(),changes:[],reverted:!1},f(m,l)},async recordFileChange(e,t=null){try{if(!l){if(I){let i=h(s,[]),c=[...i].reverse().find(w=>w.chatId===I);if(c){if(c.changes.some(E=>E.filePath===e))return;let g=await r.pathExists(e)||t?"update":"create",y=null;if(g==="update"){let E=o.basename(e);y=`${c.id}_${E}.bak`;let x=o.join(u,c.chatId);await r.ensureDir(x);let T=o.join(x,y),F=t!==null?t:await r.readFile(e,"utf8").catch(()=>null);F!==null?f(T,{data:v(F)}):(g="create",y=null)}c.changes.push({filePath:e,type:g,backupFile:y}),f(s,i)}}return}if(l.changes.some(i=>i.filePath===e))return;let p=await r.pathExists(e)||t?"update":"create",d=null;if(p==="update"){let i=o.basename(e);d=`${l.id}_${i}.bak`;let c=o.join(u,l.chatId);await r.ensureDir(c);let w=o.join(c,d),k=t!==null?t:await r.readFile(e,"utf8").catch(()=>null);k!==null?f(w,{data:v(k)}):(p="create",d=null)}l.changes.push({filePath:e,type:p,backupFile:d}),f(m,l)}catch{}},async commitTransaction(){if(l)try{let e=h(s,[]);if(e.push(l),e.length>512e3){let t=e.shift();if(t.changes)for(let a of t.changes)a.backupFile&&await r.remove(o.join(u,t.chatId,a.backupFile)).catch(()=>{})}f(s,e),await r.remove(m).catch(()=>{})}catch{}finally{l=null}},async recoverCrashedTransaction(){try{if(await r.pathExists(m)){let e=h(m,null);if(e?.changes?.length>0){let t=h(s,[]);t.some(a=>a.id===e.id)||(t.push(e),f(s,t))}await r.remove(m).catch(()=>{})}}catch{}},async rollbackToBefore(e){let t=h(s,null);if(!t)throw new Error("No transaction ledger found.");let a=t.findIndex(i=>i.id===e);if(a===-1)throw new Error(`Transaction [${e}] not found.`);let n=t[a].chatId,p=t[a].prompt,d=t.slice(a).filter(i=>i.chatId===n&&!i.reverted).reverse();for(let i of d){for(let c of[...i.changes].reverse())await P(c,i);for(let c of i.changes)if(c.backupFile){let w=o.join(u,i.chatId,c.backupFile);await r.remove(w).catch(()=>{})}t=t.filter(c=>c.id!==i.id),f(s,t)}return{success:!0,chatId:n,targetPrompt:p}},async getChatHistory(e){try{return h(s,[]).filter(a=>a.chatId===e&&!a.reverted)}catch{return[]}},async deleteChatBackups(e){try{await r.remove(o.join(u,e));let t=h(s,[]),a=t.filter(n=>n.chatId!==e);t.length!==a.length&&f(s,a)}catch{}}};export{R as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
2
|
-
`)){let e=r.split(" ");if(e.length<12||parseInt(e[0])!==5)continue;let o=e[2],f=e[3],a=e[4],h=parseInt(e[6]),x=parseInt(e[7]),b=parseInt(e[8]),u=parseInt(e[9]),l=parseFloat(e[10]),g=e.slice(11).join(" ").trim();if(!g||l<0)continue;let m={x0:h,y0:x,x1:h+b,y1:x+u},w={text:g,confidence:l,bbox:m};n.push(w);let p=`${o}_${f}_${a}`;s.has(p)||s.set(p,{words:[],bbox:{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}});let d=s.get(p);d.words.push(w),d.bbox.x0=Math.min(d.bbox.x0,m.x0),d.bbox.y0=Math.min(d.bbox.y0,m.y0),d.bbox.x1=Math.max(d.bbox.x1,m.x1),d.bbox.y1=Math.max(d.bbox.y1,m.y1)}let i=[];for(let r of s.values())r.words.length>0&&i.push({text:r.words.map(e=>e.text).join(" "),bbox:r.bbox,words:r.words});return{words:n,lines:i}}function tt(t){if(!(t.words&&t.words.length>0)){if(t.blocks&&t.blocks.length>0){t.words=[],t.lines=[];for(let n of t.blocks)for(let s of n.paragraphs||[])for(let i of s.lines||[]){i.bbox&&t.lines.push(i);for(let r of i.words||[])r.bbox&&t.words.push(r)}if(t.words.length>0)return}if(t.tsv){let n=Y(t.tsv);t.words=n.words,t.lines=n.lines}}}function G(t,n,s=0,i=0,r=1){tt(t);let e=o=>({x0:Math.round(o.x0/r)+s,y0:Math.round(o.y0/r)+i,x1:Math.round(o.x1/r)+s,y1:Math.round(o.y1/r)+i}),c=[];if(t.lines&&t.lines.length>0)for(let o of t.lines){let f=o.text?o.text.toLowerCase().trim():"";if(!f||!o.bbox||!(f===n||new RegExp(`\\b${Q(n)}\\b`,"i").test(f)))continue;let h=o.words||(t.words?t.words.filter(l=>l.bbox&&l.bbox.x0>=o.bbox.x0-5&&l.bbox.x1<=o.bbox.x1+5&&l.bbox.y0>=o.bbox.y0-5&&l.bbox.y1<=o.bbox.y1+5):[]),x=n.split(/\s+/),b=x.map(l=>l.replace(/[^a-z0-9]/g,"")).join(" "),u=!1;if(h.length>0)for(let l=0;l<=h.length-x.length;l++){let g=h.slice(l,l+x.length),m=g.map(w=>(w.text||"").toLowerCase().trim().replace(/[^a-z0-9]/g,"")).join(" ");if(m===b||m.includes(b)){let w={x0:Math.min(...g.map(p=>p.bbox.x0)),y0:Math.min(...g.map(p=>p.bbox.y0)),x1:Math.max(...g.map(p=>p.bbox.x1)),y1:Math.max(...g.map(p=>p.bbox.y1))};c.push(e(w)),u=!0}}u||c.push(e(o.bbox))}if(c.length===0&&t.words&&t.words.length>0)for(let o of t.words){let f=o.text?o.text.toLowerCase().trim().replace(/[^a-z0-9]/g,""):"",a=n.replace(/[^a-z0-9]/g,"");f===a&&o.bbox&&c.push(e(o.bbox))}if(c.length===0&&t.words&&t.words.length>0){let o=X(n.length);for(let f of t.words){let a=f.text?f.text.toLowerCase().trim():"";a.length>=3&&Math.abs(a.length-n.length)<=o&&Z(a,n,o)<=o&&f.bbox&&c.push(e(f.bbox))}}return c}function L(t,n){let s=null,i=1/0;for(let r of t){let e=Math.round((r.x0+r.x1)/2),c=Math.round((r.y0+r.y1)/2),o=n.x>=r.x0&&n.x<=r.x1&&n.y>=r.y0&&n.y<=r.y1,f=Math.hypot(e-n.x,c-n.y),a=o?0:f;a<i&&(i=a,s={x:e,y:c,dist:f,containsPoint:o,bbox:r})}return s}function et(t,n,s,i){let c=Math.ceil(t/4),o=Math.ceil(n/2),f=[];for(let a=0;a<2;a++)for(let h=0;h<4;h++){let x=h*c,b=a*o,u=Math.min(c,t-x),l=Math.min(o,n-b),g=x+u/2,m=b+l/2,w=s>=x&&s<x+u&&i>=b&&i<b+l;f.push({x0:x,y0:b,w:u,h:l,cx:g,cy:m,containsTarget:w})}return f.sort((a,h)=>{if(a.containsTarget)return-1;if(h.containsTarget)return 1;let x=Math.hypot(a.cx-s,a.cy-i),b=Math.hypot(h.cx-s,h.cy-i);return x-b})}var W=null;async function nt(){return W||(W=(async()=>{let{createWorker:t}=await import("tesseract.js"),n=await import("fs-extra"),{CU_CACHE_DIR:s}=await import("./paths-
|
|
1
|
+
import{a as B}from"./chunk-UN6TUQZX.js";import{d as H}from"./chunk-33KD6VKN.js";import{a as j}from"./chunk-Y5JU726N.js";import J from"screenshot-desktop";import v from"sharp";import N from"fs-extra";import q from"path";import"@nut-tree-fork/nut-js";async function A(t,n,s){if(!(!process.env.SHOW_DEBUG_GRID&&!process.env.DEBUG_OCR))try{let i=q.resolve(process.cwd(),"screenshots",t);await N.ensureDir(i),await N.writeFile(q.join(i,n),s)}catch{}}function Q(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(t,n,s=1/0){if(t===n)return 0;if(t.length===0)return n.length;if(n.length===0)return t.length;if(Math.abs(t.length-n.length)>s)return s+1;let i=Array.from({length:n.length+1},(r,e)=>e);for(let r=1;r<=t.length;r++){let e=[r],c=r;for(let o=1;o<=n.length;o++){let f=t[r-1]===n[o-1]?0:1,a=Math.min(e[o-1]+1,i[o]+1,i[o-1]+f);e.push(a),a<c&&(c=a)}if(i=e,c>s)return s+1}return i[n.length]}function X(t){return t<=4?0:t<=8?1:2}async function F(t,n=3){let s=await v(t).metadata();return v(t).resize(Math.round(s.width*n),Math.round(s.height*n),{kernel:"lanczos3"}).greyscale().normalise().toBuffer()}function Y(t){if(!t)return{words:[],lines:[]};let n=[],s=new Map;for(let r of t.split(`
|
|
2
|
+
`)){let e=r.split(" ");if(e.length<12||parseInt(e[0])!==5)continue;let o=e[2],f=e[3],a=e[4],h=parseInt(e[6]),x=parseInt(e[7]),b=parseInt(e[8]),u=parseInt(e[9]),l=parseFloat(e[10]),g=e.slice(11).join(" ").trim();if(!g||l<0)continue;let m={x0:h,y0:x,x1:h+b,y1:x+u},w={text:g,confidence:l,bbox:m};n.push(w);let p=`${o}_${f}_${a}`;s.has(p)||s.set(p,{words:[],bbox:{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}});let d=s.get(p);d.words.push(w),d.bbox.x0=Math.min(d.bbox.x0,m.x0),d.bbox.y0=Math.min(d.bbox.y0,m.y0),d.bbox.x1=Math.max(d.bbox.x1,m.x1),d.bbox.y1=Math.max(d.bbox.y1,m.y1)}let i=[];for(let r of s.values())r.words.length>0&&i.push({text:r.words.map(e=>e.text).join(" "),bbox:r.bbox,words:r.words});return{words:n,lines:i}}function tt(t){if(!(t.words&&t.words.length>0)){if(t.blocks&&t.blocks.length>0){t.words=[],t.lines=[];for(let n of t.blocks)for(let s of n.paragraphs||[])for(let i of s.lines||[]){i.bbox&&t.lines.push(i);for(let r of i.words||[])r.bbox&&t.words.push(r)}if(t.words.length>0)return}if(t.tsv){let n=Y(t.tsv);t.words=n.words,t.lines=n.lines}}}function G(t,n,s=0,i=0,r=1){tt(t);let e=o=>({x0:Math.round(o.x0/r)+s,y0:Math.round(o.y0/r)+i,x1:Math.round(o.x1/r)+s,y1:Math.round(o.y1/r)+i}),c=[];if(t.lines&&t.lines.length>0)for(let o of t.lines){let f=o.text?o.text.toLowerCase().trim():"";if(!f||!o.bbox||!(f===n||new RegExp(`\\b${Q(n)}\\b`,"i").test(f)))continue;let h=o.words||(t.words?t.words.filter(l=>l.bbox&&l.bbox.x0>=o.bbox.x0-5&&l.bbox.x1<=o.bbox.x1+5&&l.bbox.y0>=o.bbox.y0-5&&l.bbox.y1<=o.bbox.y1+5):[]),x=n.split(/\s+/),b=x.map(l=>l.replace(/[^a-z0-9]/g,"")).join(" "),u=!1;if(h.length>0)for(let l=0;l<=h.length-x.length;l++){let g=h.slice(l,l+x.length),m=g.map(w=>(w.text||"").toLowerCase().trim().replace(/[^a-z0-9]/g,"")).join(" ");if(m===b||m.includes(b)){let w={x0:Math.min(...g.map(p=>p.bbox.x0)),y0:Math.min(...g.map(p=>p.bbox.y0)),x1:Math.max(...g.map(p=>p.bbox.x1)),y1:Math.max(...g.map(p=>p.bbox.y1))};c.push(e(w)),u=!0}}u||c.push(e(o.bbox))}if(c.length===0&&t.words&&t.words.length>0)for(let o of t.words){let f=o.text?o.text.toLowerCase().trim().replace(/[^a-z0-9]/g,""):"",a=n.replace(/[^a-z0-9]/g,"");f===a&&o.bbox&&c.push(e(o.bbox))}if(c.length===0&&t.words&&t.words.length>0){let o=X(n.length);for(let f of t.words){let a=f.text?f.text.toLowerCase().trim():"";a.length>=3&&Math.abs(a.length-n.length)<=o&&Z(a,n,o)<=o&&f.bbox&&c.push(e(f.bbox))}}return c}function L(t,n){let s=null,i=1/0;for(let r of t){let e=Math.round((r.x0+r.x1)/2),c=Math.round((r.y0+r.y1)/2),o=n.x>=r.x0&&n.x<=r.x1&&n.y>=r.y0&&n.y<=r.y1,f=Math.hypot(e-n.x,c-n.y),a=o?0:f;a<i&&(i=a,s={x:e,y:c,dist:f,containsPoint:o,bbox:r})}return s}function et(t,n,s,i){let c=Math.ceil(t/4),o=Math.ceil(n/2),f=[];for(let a=0;a<2;a++)for(let h=0;h<4;h++){let x=h*c,b=a*o,u=Math.min(c,t-x),l=Math.min(o,n-b),g=x+u/2,m=b+l/2,w=s>=x&&s<x+u&&i>=b&&i<b+l;f.push({x0:x,y0:b,w:u,h:l,cx:g,cy:m,containsTarget:w})}return f.sort((a,h)=>{if(a.containsTarget)return-1;if(h.containsTarget)return 1;let x=Math.hypot(a.cx-s,a.cy-i),b=Math.hypot(h.cx-s,h.cy-i);return x-b})}var W=null;async function nt(){return W||(W=(async()=>{let{createWorker:t}=await import("tesseract.js"),n=await import("fs-extra"),{CU_CACHE_DIR:s}=await import("./paths-Y7ACZJAE.js");return n.ensureDirSync(s),t("eng",1,{cachePath:s,logger:()=>{}})})().catch(t=>{throw W=null,t})),W}var S=null,V=null;async function ot(){let{getActiveDisplay:t}=await import("./screen_grid-EIPLWNEM.js"),n=await t();if(S&&V===n)return S;V=n,S={format:"png"};try{let s=await J.listDisplays();s&&s.length>0&&(S={format:"png",screen:(s[n]||s[0]).id})}catch{}return S}var gt=async(t,n={})=>{let s=!!(process.env.SHOW_DEBUG_GRID||process.env.DEBUG_OCR||process.env.VERBOSE),i=performance.now(),r=i,e=u=>{if(!s)return;let l=performance.now(),g=(l-r).toFixed(0),m=(l-i).toFixed(0);console.log(`[Click Perf] +${g}ms (${m}ms total) -> ${u}`),r=l};e("Starting click()");let c=j(t),o=c.gridId||c.grid||c.coordinate||c.target||c.id,f=(c.type||c.clickType||"single").toLowerCase(),a=(c.button||"left").toLowerCase(),h=c.intendedClickText||c.text||"";if(!o&&!h)return'ERROR: Missing required "gridId" parameter for Click tool.';let x=o;if(h)try{e("Parsing grid code");let u=o?H(o):null;e("Getting display options");let l=await ot();e("Taking desktop screenshot");let g=await J(l);e("Getting image metadata");let m=await v(g).metadata(),w=m.width||1920,p=m.height||1080,d=u?{x:Math.round(u.x*(w/1280)),y:Math.round(u.y*(p/720))}:{x:w/2,y:p/2},C=h.toLowerCase().trim();e("Acquiring OCR worker");let O=await nt(),R=null,P="",K=u?220:500;if(u){e("Pass 1: Cropping target crop (3x zoom window, 2x upscale)");let k=Math.min(Math.round(w/3),w),T=Math.min(Math.round(p/3),p),M=Math.max(0,Math.min(w-k,d.x-Math.floor(k/2))),y=Math.max(0,Math.min(p-T,d.y-Math.floor(T/2))),$=await v(g).extract({left:M,top:y,width:k,height:T}).toBuffer(),I=2,D=await F($,I),E=C.replace(/[^a-z0-9]/g,"_");await A("cropped",`crop_${Date.now()}_${E}.png`,D),e("Pass 1: Running Tesseract OCR recognize on crop (PSM 11 - Sparse Text)"),await O.setParameters({tessedit_pageseg_mode:"11"});let{data:_}=await O.recognize(D,{},{tsv:!0,blocks:!0});if(e("Pass 1: OCR recognition finished, extracting matches"),_&&_.text){s&&console.log(`[Pass 1 OCR Read]: "${_.text.trim().replace(/\s+/g," ")}"`);let U=G(_,C,M,y,I);if(U.length>0){let z=L(U,d);z&&(z.containsPoint||z.dist<=K)&&(R=z,P="centered target crop OCR")}}}if(!R){e("Pass 2: Entering Full-Screen OCR (broad scan, PSM 3 - Auto)");let k=await F(g,2),T=C.replace(/[^a-z0-9]/g,"_");await A("fullscreen",`full_${Date.now()}_${T}.png`,k),e("Pass 2: Running Tesseract on full screen"),await O.setParameters({tessedit_pageseg_mode:"3"});let{data:M}=await O.recognize(k,{},{tsv:!0,blocks:!0});if(e("Pass 2: Full-screen OCR finished"),M&&M.text){let y=G(M,C,0,0,2);if(y.length>0){let $=L(y,d);$&&(R=$,P="full-screen OCR")}}}if(!R){e("Pass 3: Entering Tiled OCR fallback (high-res 3x)");let k=et(w,p,d.x,d.y),T=C.replace(/[^a-z0-9]/g,"_");await O.setParameters({tessedit_pageseg_mode:"11"});for(let M=0;M<k.length;M++){let y=k[M];e(`Pass 3: Preprocessing tile ${M+1}/${k.length}`);let $=await v(g).extract({left:y.x0,top:y.y0,width:y.w,height:y.h}).toBuffer(),I=await F($,3);await A("tiles",`tile_${M+1}_${Date.now()}_${T}.png`,I),e(`Pass 3: Running Tesseract on tile ${M+1}`);let{data:D}=await O.recognize(I,{},{tsv:!0,blocks:!0});if(!D||!D.text)continue;let E=G(D,C,y.x0,y.y0,3);if(E.length>0){let _=L(E,d);if(_){R=_,P=`tile ${M+1} OCR (${y.containsTarget?"target tile":`offset ${y.x0},${y.y0}`})`;break}}}}if(R){let k={x:Math.round(R.x*(1280/w)),y:Math.round(R.y*(720/p))};e(`Executing mouse click on matched target (${P})`);let T=await B("click",k,{button:a,clickType:f});return e("Click completed successfully"),`${T} (${P} for "${h}" at ${Math.round(R.dist)}px distance)`}else s&&console.log(`[OCR] No match found for "${h}". Falling back to gridId.`)}catch(u){s&&console.error("[OCR Error]",u)}e(`Executing mouse click on fallback gridId: ${x}`);let b=await B("click",x,{button:a,clickType:f});return e("Fallback click completed"),b};export{gt as click};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,b as s}from"./chunk-
|
|
1
|
+
import{a as i,b as s}from"./chunk-UN6TUQZX.js";import"./chunk-33KD6VKN.js";import{a as c}from"./chunk-Y5JU726N.js";var d=async(a,p={})=>{let e=c(a),r=e.action||e.type||e.cmd,n=e.target||e.grid||e.gridCode||e.location||e.input;if(!r)return'ERROR: Missing required "action" argument for computer_action (e.g. move, click, drag, scroll, type, key_press, key_combination).';let t=r.toLowerCase();if(t.startsWith("mouse_")||["move","click","drag","scroll"].includes(t)){let o=t.replace("mouse_","");return await i(o,n,{button:e.button,clickType:e.clickType||e.type,from:e.from,to:e.to,direction:e.direction,amount:e.amount?parseInt(e.amount,10):void 0})}if(t.startsWith("key_")||t==="type"||t==="press"){let o=t;t==="press"&&(o="key_press");let u=e.autoPressEnter===!0||e.autoPressEnter==="true"||e.enter===!0||e.enter==="true";return await s(o,n||e.text||e.keys,{...e,autoPressEnter:u})}return`ERROR: Unrecognized action "${r}". Supported actions: move, click, drag, scroll, type, key_press, key_combination.`};export{d as computer_action};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-UN6TUQZX.js";import"./chunk-33KD6VKN.js";import{a as d}from"./chunk-Y5JU726N.js";var m=async(a,i={})=>{let r=d(a),o=r.fromGridId||r.from||r.start,t=r.toGridId||r.to||r.end;return!o||!t?'ERROR: Drag requires both "fromGridId" and "toGridId" parameters.':await e("drag",o,{from:o,to:t})};export{m as drag};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-ORXN6WUW.js";import{a as f}from"./chunk-Y5JU726N.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";var m=async(k,c={})=>{let l=f(k),n=l.method,d=l.id,a=c.chatId;if(!c.systemSettings?.advanceRollback)return"ERROR: Advance Rollback feature is currently disabled in settings under Security. Tell user to enable it.";if(!a)return"ERROR: No active chat transaction found for rollback.";if(n==="getCheckpoint"){let r=await i.getCheckpoints(a);if(r.length===0)return"No checkpoints available.";let s={write_file:"WriteFile",update_file:"PatchFile",view_file:"ReadFile",read_folder:"ReadFolder",exec_command:"Run",web_search:"WebSearch",web_scrape:"WebScrape",search_keyword:"SearchKeyword",CodeSearch:"SearchKeyword",code_search:"SearchKeyword",write_pdf:"WritePDF",write_docx:"WriteDoc",generate_image:"GenerateImage",file_map:"FileMap",todo:"Todo",goal:"Goal",Goal:"Goal",await:"Await",ask:"AskUser",ask_user:"AskUser",AskUser:"AskUser",askuser:"AskUser",invoke:"Invoke",invokesync:"InvokeSync",getprogress:"GetProgress",cancel:"Cancel",emergency_rollback:"EmergencyRollback",emergencyrollback:"EmergencyRollback"},t=e=>s[e]||s[e.toLowerCase()]||e,o=`Available checkpoints for rollback:
|
|
2
2
|
|
|
3
3
|
`;for(let e of r)if(e.id==="initial")o+=`--- Initial State (id: initial) ---
|
|
4
4
|
Tools Used: User Prompted for task
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-Q2D63UDR.js";import"./chunk-WFHGURXW.js";import"./chunk-Y5JU726N.js";export{c as activeChildProcess,g as adjustWindowsCommand,b as cleanTerminalOutput,h as exec_command,d as isActiveCommandPty,a as isPtyAvailable,f as terminateActiveCommand,e as writeToActiveCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-G3223ZQY.js";import"./chunk-RI37VZYB.js";export{b as exportCurrentChat,d as exportErrorLogs,e as handleExport,a as parseAgentText,c as parseLogEntries};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-RLT6EHPQ.js";import{a as N}from"./chunk-Y5JU726N.js";import{t as $}from"./chunk-RI37VZYB.js";import F from"fs-extra";import d from"path";import{createRequire as I}from"module";var E=I(import.meta.url),P=E("web-tree-sitter"),S=!1,b=new Set(["class_declaration","function_declaration","method_definition","arrow_function","function_expression","if_statement","else_clause","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","variable_declarator","export_statement","lexical_declaration","variable_declaration","interface_declaration","type_alias_declaration","enum_declaration","import_declaration","jsx_element","jsx_self_closing_element","class_definition","function_definition","decorated_definition","import_from_statement","import_statement","preproc_include","method_declaration","constructor_declaration","assignment_expression","pair","class_specifier","struct_specifier","enum_specifier","field_declaration","element","script_element","style_element"]),O=new Set(["export_statement","lexical_declaration","variable_declaration","variable_declarator","pair","assignment_expression"]);function o(n,t=50){if(!n)return"";let r=n.replace(/\s+/g," ").trim();return r.length>t?r.substring(0,t-3)+"...":r}function v(n){let t=n.type;if(t==="if_statement"){let e=n.childForFieldName("condition");return e?`if (${o(e.text,40)})`:"if"}if(t==="else_clause")return"else";if(t==="while_statement"||t==="do_statement"){let e=n.childForFieldName("condition");return`${t.split("_")[0]} (${e?o(e.text,40):""})`}if(t==="for_statement"||t==="for_in_statement"||t==="for_of_statement"){let i=n.text.split(`
|
|
2
2
|
`)[0].match(/for\s*(?:await\s*)?\((.*)\)/);return i?`for (${o(i[1],40)})`:"for"}if(t==="switch_statement"){let e=n.childForFieldName("value");return`switch (${e?o(e.text,40):""})`}if(t==="try_statement")return"try";if(t==="catch_clause")return"catch";if(t==="element"||t==="script_element"||t==="style_element"||t==="jsx_element"||t==="jsx_self_closing_element"){let e=n.childForFieldName("opening_element")||n.childForFieldName("start_tag")||n.children.find(c=>c.type==="start_tag")||n,i=e.childForFieldName("name")||e.childForFieldName("tag_name")||e.children.find(c=>c.type==="tag_name");return i?`<${o(i.text,30)}>`:null}if(["import_declaration","import_from_statement","import_statement","preproc_include"].includes(t))return o(n.text.split(`
|
|
3
3
|
`)[0],60);if(t==="pair"){let e=n.childForFieldName("key");return e?o(e.text.replace(/["']/g,""),40):null}if(t==="assignment_expression"){let e=n.childForFieldName("left");return e?`${o(e.text,30)} = ...`:null}if(t==="variable_declarator"){let e=n.childForFieldName("name")||n.children.find(i=>["identifier","object_pattern","array_pattern"].includes(i.type));return e?o(e.text,40):null}let r=n.childForFieldName("name")||n.childForFieldName("declarator")||n.children.find(e=>["identifier","type_identifier","field_identifier","property_identifier","shorthand_property_identifier"].includes(e.type));if(r){if(r.type.includes("declarator")){let e=r.descendantsOfType("identifier")[0]||r.descendantsOfType("field_identifier")[0];if(e)return o(e.text,40)}return o(r.text,40)}if(["arrow_function","function_expression","function_declaration"].includes(t)){let e=n.parent;for(;e&&e.type!=="program";){let i=v(e);if(i)return i;if(!O.has(e.type))break;e=e.parent}}return null}function L(n){let t=[];function r(e){for(let i of e.children)b.has(i.type)?t.push(i):r(i)}return r(n),t}function j(n){return n.replace(/_([a-z])/g,t=>t[1].toUpperCase())}function T(n,t=0,r=!0,e="",i=null,c=12){let s=n.type,l=v(n),u=b.has(s)||t===0,m=L(n),_=u&&t>0&&(O.has(s)&&m.length>0||l!==null&&l===i&&m.length>0),a="",p=e,g=t,h=i;if(u&&!_){let f=n.startPosition.row+1,x=n.endPosition.row+1,y=j(s),w=l?`${y} [${l}]`:y;t===0?(a+=`\u{1F4C1} ROOT (Lines: ${f}-${x})
|
|
4
4
|
`,p=e):(a+=`${e}${r?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${w} (Lines: ${f}-${x})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $}from"./chunk-YUJMCXJA.js";import{a as T}from"./chunk-Y5JU726N.js";import{o as S,p as C,q as B}from"./chunk-EPGLNGLE.js";import{a as I}from"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";import b from"fs-extra";import E from"path";var F=(a,y={})=>{try{if(a.length<8||a[0]!==137||a[1]!==80||a[2]!==78||a[3]!==71)return a;let s=[],c=[];for(let r=0;r<256;r++){let e=r;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;c[r]=e}let l=r=>{let e=4294967295;for(let n=0;n<r.length;n++)e=c[(e^r[n])&255]^e>>>8;return(e^4294967295)>>>0},f=(r,e)=>{let n=Buffer.from(r,"ascii"),i=Buffer.from(e,"utf-8"),u=n.length+1+i.length,o=Buffer.alloc(8+u+4);o.writeUInt32BE(u,0),o.write("tEXt",4,"ascii"),n.copy(o,8),o[8+n.length]=0,i.copy(o,8+n.length+1);let w=l(o.subarray(4,8+u));return o.writeUInt32BE(w,8+u),o};for(let[r,e]of Object.entries(y))e!=null&&s.push(f(r,String(e)));if(s.length===0)return a;if(a.subarray(12,16).toString("ascii")==="IHDR"){let e=a.subarray(0,33),n=a.subarray(33);return Buffer.concat([e,...s,n])}return a}catch{return a}},N=async(a,y={})=>{let s=T(a),c=s.prompt||s.text,l=s.path||s.outputPath||s.output||"generated_image.png",f=s.ratio;if(!c)return'ERROR: Missing "prompt" argument for generate_image.';let r=["nsfw","naked","nudity","nude","porn","sex","xxx","erotic","gore","bloody","violence","abuse","suicide","murder","hentai","pedophile","rape"],e=c.toLowerCase();if(r.some(i=>e.includes(i)))return"ERROR: Prompt blocked by system safety filter (inappropriate or unsafe content detected).";try{let i=await I();if(!await S(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await C()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,x={Low:"flux","Low-High":"zimage",Medium:"gptimage","Medium-High":"gptimage",High:"qwen-image",Ultra:"gptimage-large",Premium:"nanobanana-pro"}[o.quality]||"zimage",g=1024,m=1024;if(f){let t=f.replace(/\s+/g,"");t==="16:9"?(g=1024,m=576):t==="9:16"?(g=576,m=1024):t==="4:3"?(g=1024,m=768):t==="3:4"?(g=768,m=1024):t==="1:1"&&(g=1024,m=1024)}let M=Math.floor(Math.random()*1e7),k=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${x}&width=${g}&height=${m}&seed=${M}&enhance=true&reasoning=high&quality=high&negative=${encodeURIComponent("deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated hands and fingers, blurry, low quality, low resolution, extra fingers, censored, watermarks, signatures")}`,d=await fetch(k,{method:"GET",headers:{Authorization:`Bearer ${w}`}});if(!d.ok){let t=d.status,h="";try{h=await d.text()}catch{}return t===402||h.includes("Insufficient balance")||h.includes("PAYMENT_REQUIRED")?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed with status [${t}]: ${h||"Unknown API Error"}`}if((d.headers.get("content-type")||"").includes("application/json")){let t=await d.json();return t.status===402||t.error&&t.error.code==="PAYMENT_REQUIRED"?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed: ${t.error?.message||JSON.stringify(t)}`}let O=await d.arrayBuffer(),p=Buffer.from(O),P={Title:c,Description:"Generated via FluxFlow CLI",Software:"FluxFlow CLI",Author:"FluxFlow","Creation Time":new Date().toISOString(),Prompt:c,Model:`Fluxflow:${x}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=E.resolve(process.cwd(),l);await b.ensureDir(E.dirname(R)),await $.recordFileChange(R),await b.writeFile(R,p),await B(i);let v=E.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}].`}catch(i){return`ERROR: Failed during image generation: ${i instanceof Error?i.message:String(i)}`}};export{N as generate_image};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-
|
|
1
|
+
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-UMXT6VB5.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
|
|
2
2
|
Respond using tool: [tool:Answer(id="${i}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-UMXT6VB5.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-
|
|
1
|
+
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-UMXT6VB5.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
|
|
2
|
+
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-UMXT6VB5.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
|
|
3
3
|
`)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-UN6TUQZX.js";import"./chunk-33KD6VKN.js";import{a as i}from"./chunk-Y5JU726N.js";var k=async(s,c={})=>{let t=i(s),a=t.key||t.keys||t.input||t.shortcut;if(!a)return'ERROR: Missing required "key" parameter for KeyPress tool.';let r=String(a).trim().toLowerCase();if(r==="clearinput"||r==="clear_input"||r==="clear")return await e("clear_input");if(r==="back"||r==="browser_back"||r==="browserBack")return await e("browser_back");if(r.includes(";")||r.includes("+")){let o=r.split(/[;+]/).map(n=>n.trim()).filter(Boolean);return await e("key_combination",o)}return await e("key_press",r)};export{k as key_press};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-UN6TUQZX.js";import"./chunk-33KD6VKN.js";import{a as r}from"./chunk-Y5JU726N.js";var p=async(o,u={})=>{let t=r(o),e=t.text||t.input||t.value||"",s=t.autoPressEnter===!0||t.autoPressEnter==="true"||t.enter===!0||t.enter==="true";return e==null?'ERROR: Missing required "text" parameter for KeyboardTyping tool.':await n("type",String(e),{autoPressEnter:s})};export{p as keyboard_typing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,d as m}from"./chunk-SIINYZWE.js";import{
|
|
1
|
+
import{c as E,d as m}from"./chunk-SIINYZWE.js";import{k as a,l as S}from"./chunk-RI37VZYB.js";var O=4*(1024*2),D=async($,M={})=>{let s=t=>{let e=new RegExp(`${t}\\s*[:=]\\s*(["'])(.*?)\\1(?=\\s*[,)]|\\s+\\w+\\s*[:=]|$)`,"s"),n=$.match(e);if(n)return n[2].trim();let o=new RegExp(`${t}\\s*[:=]\\s*([^,\\s)]+)`,"s"),r=$.match(o);return r?r[1].trim():null},R=s("action"),u=s("method"),c=s("content"),y=s("content-new"),w=s("content-old"),p=s("id"),d=s("chat-id")||M.chatId||M.sessionId||"default-session";if(R==="temp"){if(!c)return"ERROR: Missing 'content' for temp memory.";let t=E(S,{});t[d]||(t[d]=[]),t[d].push(c),m(S,t);let e=t[d].reduce((n,o)=>n+o.length,0);return`SUCCESS: Temporary context saved for session [${d}]. (Size: ${e} chars)`}if(R==="user"){let t=E(a,[]).map(e=>(e.score===void 0&&(e.score=.5),e));if(u==="add"){if(!c)return"ERROR: Missing 'content' for memory addition.";let e=new Date,n=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`,o=c.includes("[Saved on:")?c:`${c.trim()} [Saved on: ${n}]`,r=O,i=t.reduce((g,I)=>g+(I.memory?.length||0),0);for(;t.length>0&&i+o.length>r;){let g=t.shift();i-=g.memory?.length||0}let l=s("score"),f=l?parseFloat(l):.5,h={id:`mem-${Date.now().toString(36)}`,memory:o,score:Math.min(2,isNaN(f)?.5:f)};return t.push(h),m(a,t),`SUCCESS: Memory added with ID [${h.id}] and score [${h.score}]. (Vault Size: ${i+o.length} chars)`}if(u==="update"){let e=p||w,n=y||c;if(!e||!n)return"ERROR: Missing 'id' or content for update.";let o=t.findIndex(f=>f.id===e);if(o===-1)return`ERROR: Memory ID [${e}] not found.`;let r=new Date,i=`${r.getDate()}/${r.getMonth()+1}/${r.getFullYear()}`,l=n.includes("[Saved on:")?n:`${n.trim()} [Saved on: ${i}]`;return t[o].memory=l,m(a,t),`SUCCESS: Memory [${e}] updated.`}if(u==="delete"){let e=p||c;if(!e)return"ERROR: Missing 'id' for deletion.";let n=t.length,o=t.filter(r=>r.id!==e);return o.length===n?`ERROR: Memory ID [${e}] not found.`:(m(a,o),`SUCCESS: Memory [${e}] deleted.`)}return`ERROR: Invalid method [${u}] for user memory. Use 'add', 'update', or 'delete'.`}return`ERROR: Unknown action [${R}] for memory tool.`};export{D as memory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-QGPOMXO4.js";import"./chunk-RI37VZYB.js";export{a as DEFAULT_MODEL_CONFIG,n as getDefaultModel,o as getFallbackValue,b as getModelConfig,m as getModels,l as hasModelReasoning,k as isModelMultimodal,g as removeModelFromProvider,h as renameModelInProvider,c as saveModelConfigToDisk,d as saveModelToProvider,i as setCustomMultimodal,f as setDefaultModelForProvider,e as setModelMultimodalInProvider,j as setOllamaMultimodal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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-RI37VZYB.js";export{q as ACTIVE_TX_FILE,n as BACKUPS_DIR,s as CONTEXT_FILE,u as CU_CACHE_DIR,c as DATA_DIR,a as FLUXFLOW_DIR,g as HISTORY_DIR,f as HISTORY_FILE,p as LEDGER_ADVANCE_FILE,o as LEDGER_FILE,d as LOGS_DIR,k as MEMORIES_FILE,t as PARSER_DIR,r as PATHS_FILE,e as SECRET_DIR,b as SETTINGS_FILE,m as TEMP_MEM_CHAT_FILE,l as TEMP_MEM_FILE,v as THINKING_CONFIG_FILE,i as USAGE_FILE,h as USAGE_FILE_OLD,j as USAGE_FILE_TIMED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as n}from"./chunk-SIINYZWE.js";import{
|
|
1
|
+
import{c as a,d as n}from"./chunk-SIINYZWE.js";import{l as s,m as o}from"./chunk-RI37VZYB.js";var g=async(u,E={})=>{let m=r=>{let t=new RegExp(`${r}\\s*[:=]\\s*(["'])(.*?)\\1(?=\\s*[,)]|\\s+\\w+\\s*[:=]|$)`,"s"),i=u.match(t);return i?i[2].trim():null},e=m("id"),c=m("summary");if(!e||!c)return"ERROR: Missing 'id' or 'summary' for saveSummary tool.";try{let r=a(s,{}),t=a(o,{});return t[e]=c,delete r[e],n(o,t),n(s,r),`SUCCESS: Saved summary and purged raw memories for chat [${e}].`}catch(r){let t=r instanceof Error?r.message:String(r);return`ERROR: Failed to save summary for chat [${e}]: ${t}`}};export{g as saveSummary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-33KD6VKN.js";export{a as GRID_CONFIG,c as captureGriddedScreenshot,b as getActiveDisplay,e as gridToNativeCoordinates,d as parseGridCodeTo720p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-UN6TUQZX.js";import"./chunk-33KD6VKN.js";import{a as t}from"./chunk-Y5JU726N.js";var m=async(n,i={})=>{let o=t(n),e=(o.direction||"down").toLowerCase(),c=o.amount?parseInt(o.amount,10):6,s=o.gridId||o.grid||o.coordinate||o.target||o.id||null;return await r("scroll",s,{direction:e,amount:c})};export{m as scroll};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as H}from"./chunk-Y5JU726N.js";import{a as q}from"./chunk-RI37VZYB.js";import A from"fs/promises";import P from"path";import V from"fast-glob";import{Minimatch as U}from"minimatch";import J from"fs";async function k(a,r,t=a,u=1){if(u>12)return[];let i=[],s;try{s=await A.readdir(a,{withFileTypes:!0})}catch{return[]}for(let e of s){let n=P.join(a,e.name),o=P.relative(t,n),h=o.split(P.sep).map(p=>p.toLowerCase()),C=e.name.toLowerCase();if(!r.some(p=>{let L=p.toLowerCase();return L.startsWith(".")&&C.endsWith(L)?!0:h.some(W=>W===L||W.startsWith(".pnpm"))}))if(e.isDirectory()){let p=await k(n,r,t,u+1);i=i.concat(p)}else e.isFile()&&i.push({fullPath:n,relativePath:o})}return i}function Q(a,r,t=1/0){if(a===r)return 0;if(a.length===0)return r.length;if(r.length===0)return a.length;if(Math.abs(a.length-r.length)>t)return t+1;let u=Array.from({length:r.length+1},(i,s)=>s);for(let i=1;i<=a.length;i++){let s=[i],e=i;for(let n=1;n<=r.length;n++){let o=a[i-1]===r[n-1]?0:1,h=Math.min(s[n-1]+1,u[n]+1,u[n-1]+o);s.push(h),h<e&&(e=h)}if(u=s,e>t)return t+1}return u[r.length]}function ee(a,r){if(!a||!r)return!1;let t=a.toLowerCase(),u=r.toLowerCase();if(t.includes(u))return!0;let i=t.split(/[^a-z0-9]+/).filter(e=>e.length>0),s=u.split(/[^a-z0-9]+/).filter(e=>e.length>1||u.length===1&&e.length>0);return s.length===0?!1:s.every(e=>{let n=e.length<=2?0:e.length<=5?1:2;for(let o of i)if(o.includes(e)||e.length>=3&&o.length>=3&&Math.abs(o.length-e.length)<=n&&Q(e,o,n)<=n)return!0;return!1})}async function te(a){let r=P.join(q,"skills","fluxflow"),t=P.join(r,"references");if(!J.existsSync(t))return"No documentation found in #docs.";let u=async o=>{let h=[];try{let C=await A.readdir(o,{withFileTypes:!0});for(let D of C){let p=P.join(o,D.name);D.isDirectory()?h=h.concat(await u(p)):D.isFile()&&h.push(p)}}catch{}return h},i=await u(t);if(i.length===0)return"No documentation found in #docs.";let s=null;try{s=new RegExp(a,"i")}catch{}let e=a.toLowerCase(),n=[];for(let o of i)try{let h=await A.readFile(o,"utf8");if(s&&s.test(h)||h.toLowerCase().includes(e)){let D=P.relative(r,o).replace(/\\/g,"/");n.push(D)}}catch{}return n.length===0?`No matches found for "${a}" in #docs.`:`DOCs Search "${a}":
|
|
2
|
+
${n.map(o=>`- ${o}`).join(`
|
|
3
|
+
`)}`}var ce=async a=>{let{keyword:r,path:t,fuzzy:u,subString:i,regex:s}=H(a);if(r==null)return'ERROR: Missing "keyword" argument.';let e=String(r);if(t&&(t.trim().toLowerCase()==="#docs"||t.trim().toLowerCase()==="#doc"||t.trim().toLowerCase()==="#documentation"||t.trim().toLowerCase().includes("#skill/global/fluxflow")))return te(e);let n=f=>f===!0||f==="true"||f===1||f==="1"||f==="yes",o=s===!1||s==="false"||s===0||s==="0"||s==="no",h=s===!0||s==="true"||s===1||s==="1"||s==="yes",C=n(u)||n(i),D=null,p=null;if(o)C||(p=new RegExp(`(?<![\\w])${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{D=new RegExp(e,"i")}catch(f){if(h)return`ERROR: Invalid regex pattern "${e}": ${f.message}`}p=new RegExp(`(?<![\\w])${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let L=[".git","node_modules",".gemini","dist","build",".next","out",".cache","bin","obj","vendor","venv",".idea",".gradle",".terraform","target","coverage",".vscode",".svn",".hg",".fslckout",".github",".gitlab",".circleci",".gitea",".gitee",".lerna",".changeset",".nx",".npm",".yarn",".pnpm-store",".pnpm",".expo",".nuxt",".svelte-kit",".docusaurus",".turbo",".vercel","bower_components",".netlify",".vuepress",".quasar",".output",".angular","jspm_packages",".parcel-cache",".rollup.cache",".rspack",".vitepress","__pycache__",".pytest_cache",".mypy_cache",".tox",".poetry","env","vhdl",".ipynb_checkpoints",".jupyter",".conda",".pdm-build",".bundle",".yardoc",".metadata","App_Data","ClientBin",".cargo",".rustc_info",".go","Godeps","_vendor",".rake_tasks","CMakefiles",".wakatime",".dart_tool",".fvm",".cocoapods","Pods",".pub-cache",".symlinks","DerivedData",".xcworkspace",".serverless",".aws",".gcloud",".azure",".kube",".vagrant",".docker","postgres-data","redis-data","mongo-data",".Spotlight-V100",".Trashes","$RECYCLE.BIN","System Volume Information",".DocumentRevisions-V100",".fseventsd","AppData","Application Data","Local","LocalLow","Roaming","$WinREAgent","$WINDOWS.~BT","$WINDOWS.~WS","scw","System32","SysWOW64",".AppleDouble",".AppleDB",".AppleDesktop","_CodeSignature",".cmio",".LSOverride",".localized",".TemporaryItems",".Trash",".Trash-0",".Trash-1000",".gvfs",".local",".config",".dbus",".fontconfig",".snap",".var",".lost+found","lost+found",".thumb",".thumbnails","EFI","boot","grub","logs","log",".nyc_output",".sonar",".ruff_cache",".VSCodeCounter",".exe",".dll",".so",".dylib",".png",".jpg",".jpeg",".gif",".ico",".svg",".webp",".mp3",".mp4",".avi",".zip",".tgz",".tar",".gz",".7z",".rar",".pdf",".docx",".xlsx",".pptx",".woff",".woff2",".ttf",".eot",".skills","skills"],W=150;try{let f=[],R=process.cwd(),m=null;if(t){let l=t.split(";").map(c=>c.trim()).filter(Boolean),$=l.some(c=>c.startsWith("!"));if(l.some(c=>V.isDynamicPattern(c)||/[*?{}[\]()|+]/.test(c))){m="glob";let c=t.replace(/\\/g,"/"),z=l.map(d=>d.replace(/\\/g,"/")),g=L.map(d=>d.startsWith(".")?`**/*${d}`:`**/${d}/**`);if($&&!l.some(d=>!d.startsWith("!"))){let d=await k(R,L,R),x=w=>w.endsWith("/")?w+"**":w,y=z.filter(w=>w.startsWith("!")).map(w=>x(w.slice(1))),F=z.filter(w=>!w.startsWith("!")).map(x);f=d.filter(w=>{let v=w.relativePath.replace(/\\/g,"/"),T=F.length===0||F.some(M=>{try{return new U(M).match(v)}catch{return!1}}),G=y.some(M=>{try{return new U(M).match(v)}catch{return!1}});return T&&!G})}else{let d=z.some(y=>/[\(\)\|]|\.\*/.test(y)),x=[];if(!d)try{x=await V(z,{cwd:R,ignore:g,dot:!0,onlyFiles:!0,absolute:!1})}catch{x=[]}if(x.length===0&&(d||V.isDynamicPattern(c))){let y=c.match(/^([^\*\?\(\)\|\[\]\s]+)\//),F=y&&!/[\*\?\(\)\|\[\]]/.test(y[1])?P.resolve(R,y[1]):R,w=await k(F,L,R);try{let v=c.replace(/^\.\//,"");v=v.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!v.startsWith("^")&&!v.startsWith(".*")&&(v=`.*${v}`);let T=new RegExp(v.endsWith("$")?v:`${v}$`,"i");f=w.filter(G=>{let M=G.relativePath.replace(/\\/g,"/");return T.test(M)})}catch{f=[]}}else f=x.map(y=>({fullPath:P.resolve(R,y),relativePath:y}))}}else{let c=[],z=!1,g=!1;for(let S of l){let d=S.replace(/[\/\\]+$/,""),x=P.resolve(R,d);try{let y=await A.stat(x);if(y.isDirectory()){g=!0;let F=await k(x,L,R);c.push(...F)}else if(y.isFile())z=!0,c.push({fullPath:x,relativePath:P.relative(R,x)});else return`ERROR: Path is neither a file nor a directory: ${S}`}catch{return`ERROR: Path not found: ${S}`}}f=c,z&&!g?m="file":m="dir"}}else f=await k(R,L);let X=f.map(async l=>{try{let $=await A.readFile(l.fullPath,"utf-8");if($.includes("\0"))return[];let b=$.split(/\r?\n/),c=[];for(let g=0;g<b.length;g++)(C?b[g].toLowerCase().includes(e.toLowerCase())||ee(b[g],e):o?p&&p.test(b[g]):D&&D.test(b[g])||p&&p.test(b[g]))&&c.push({line:g+1,content:b[g].trim()});return c.length===0?null:{path:l.relativePath.replace(/\\/g,"/"),matches:c}}catch{return[]}}),Y=await Promise.all(X),E=[],_=0;for(let l of Y){if(!l||!l.matches)continue;if(_>=W)break;let $=W-_,b=l.matches.slice(0,$);E.push({path:l.path,matches:b}),_+=b.length}typeof global.gc=="function"&&global.gc();let O=C?"(fuzzy mode)":h?"(regex mode)":o?"(keyword mode)":"(standard mode)";if(E.length===0){let l=m==="file"?` in '${t}'`:m==="dir"||m==="glob"?` in '${t}'`:". Try to specify files",$=m==="dir"?"[DIR]":m==="glob"?"[GLOB]":"";return`${$}${$?" ":""}Found 0 matches of '${e}'${l}${O?` ${O}`:""}`}let N=O?` ${O}`:"",K=`${E.length} file${E.length===1?"":"s"}`,B=`${_} match${_===1?"":"es"}`,I;m==="file"?I=`Found ${B} of '${e}' in '${t}'${N}:`:m==="dir"||m==="glob"?I=`Found ${B} of '${e}' in '${t}' across ${K}${N}:`:I=`Found ${B} of '${e}' across ${K}${N}:`;let Z=m==="dir"?"[DIR]":m==="glob"?"[GLOB]":"",j=`${Z}${Z?" ":""}${I}
|
|
4
|
+
|
|
5
|
+
`;for(let l of E){j+=`${l.path}
|
|
6
|
+
`;for(let $ of l.matches)j+=` ${$.line}: ${$.content}
|
|
7
|
+
`;j+=`
|
|
8
|
+
`}return j.trimEnd()}catch(f){return`ERROR: ${f.message}`}};export{ce as search_keyword};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-Y6DZDEJ5.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{a as getAPIKey,b as getProviderAPIKey,f as getSearchSecrets,d as getSecret,k as removeAPIKey,j as removeSecret,g as saveAPIKey,c as saveProviderAPIKey,i as saveSearchId,h as saveSearchKey,e as saveSecret};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-YUJMCXJA.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-SIINYZWE.js";import{c as k}from"./chunk-RI37VZYB.js";import l from"fs";import $ from"path";var G=async(R,x={})=>{let{method:f,tasks:m,markDone:d}=y(R),A=x.chatId||"default";if(!f)return'ERROR: Missing "method" argument for Goal tool (create/append/get).';let u=$.join(k,"plan",A),o=$.join(u,"todo.md"),S=t=>{if(!t||Array.isArray(t))return t;let s=String(t).trim();if(s.startsWith("[")&&s.endsWith("]")){let i=s.match(/"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/g);return i?i.map(n=>n.slice(1,-1).replace(/\\(.)/g,"$1")):s.slice(1,-1).split(",").map(n=>n.trim()).filter(Boolean)}return t},C=t=>{let s=S(t);return s?(Array.isArray(s)?s:String(s).split(`
|
|
2
2
|
`)).map(n=>{let r=String(n).trim();return r?r.startsWith("- [ ]")||r.startsWith("- [x]")||r.startsWith("- [X]")?r:`- [ ] ${r}`:null}).filter(Boolean).join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`:""},W=(t,s)=>{if(!s)return{content:t,markedCount:0};let i=S(s),n=(Array.isArray(i)?i:[i]).map(p=>String(p).replace(/^- \[[xX ]\]\s*/i,"").trim()).filter(Boolean),r=t.split(`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{g as h,h as m,i as R}from"./chunk-UDJ2C3N3.js";import{a as F}from"./chunk-YUJMCXJA.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";import c from"fs";import M from"path";var v=async(w,S={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:C,error:p}=h(n);if(p)return`ERROR: ${p}`;if(o.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let E=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":C,i=M.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=S.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
|
+
`).replace(/\r/g,`
|
|
3
|
+
`),{content:u,results:l}=m(s,o,{allowMultiple:E}),a=l.filter(r=>!r.success),f=l.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${t}].
|
|
4
|
+
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
5
|
+
`)}`;await F.recordFileChange(i,s),c.writeFileSync(i,u,"utf8");let{systemSettings:y}=await g(),d=R(s,u,l,12,y?.compressToolResults);return a.length>0?`SUCCESS: File [${t}] updated with some blocks failed. [${f.length}/${o.length}] blocks applied.
|
|
6
|
+
|
|
7
|
+
Failures:
|
|
8
|
+
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
9
|
+
`)}
|
|
10
|
+
|
|
11
|
+
${d}`:`SUCCESS: File [${t}] updated. [${l.length}/${o.length}] blocks applied.
|
|
12
|
+
|
|
13
|
+
${d}`}catch(e){let s=e instanceof Error?e.message:String(e);return`ERROR: Failed to update file [${t}]: ${s}`}};export{v as update_file};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}from"./chunk-EPGLNGLE.js";import"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{i as addToUsage,o as checkImageQuota,l as checkQuota,k as checkQuotaDetailed,c as forceFlushUsage,r as getAllUsageData,j as getCustomPeriodUsage,e as getDailyUsage,m as getImageQuotaBuckets,n as getImageQuotaLimit,p as getImageQuotaStats,f as getMonthlyUsage,b as getTimedUsage,g as incrementUsage,d as initUsage,q as recordImageGeneration,a as recordTimedUsage,h as runtimeSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-VD2I7Z6Q.js";import"./chunk-EPGLNGLE.js";import"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-4XZGWK5L.js";import"./chunk-Y5JU726N.js";import"./chunk-RI37VZYB.js";export{a as view_file};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-A73NNVCZ.js";import"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-A73NNVCZ.js";import"./chunk-RI37VZYB.js";import R from"puppeteer";import v from"turndown";import{gfm as M}from"turndown-plugin-gfm";var L=async t=>{let i=t;if(typeof t=="object"&&t!==null)i=t.url||t.targetUrl||t.href||"";else if(typeof t=="string"){let r=t.match(/url\s*=\s*["'](.*)["']/);i=r?r[1]:t}let c=typeof i=="string"?i.trim():"";if(!c)return"ERROR: No target URL provided.";let s=3,f=null;for(let r=1;r<=s;r++){let a=null;try{let m=y();a=await R.launch({headless:!0,executablePath:m.executablePath||void 0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu","--disable-dev-shm-usage"]});let o=await a.newPage();await o.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.7778.178 Safari/537.36"),await o.setViewport({width:1920,height:1440});let d=r===1?Math.random()*1e3+500:Math.random()*2e3+1e3;await new Promise(l=>setTimeout(l,d)),await o.goto(c,{waitUntil:"networkidle2",timeout:18e4}),await new Promise(l=>setTimeout(l,5e3));let w=await o.evaluate(()=>{document.querySelectorAll("script, style, noscript, svg, canvas, iframe, ad, .ads, link, meta, img").forEach(e=>e.remove());let N=document.createNodeIterator(document.body,NodeFilter.SHOW_COMMENT),b;for(;b=N.nextNode();)b.remove();for(document.querySelectorAll("*").forEach(e=>{let n=e.attributes;for(let u=n.length-1;u>=0;u--){let p=n[u].name;p!=="href"&&p!=="src"&&e.removeAttribute(p)}});document.querySelector("div, span");)document.querySelectorAll("div, span").forEach(e=>{e.parentNode&&e.replaceWith(...e.childNodes)});document.querySelectorAll("br").forEach(e=>{e.replaceWith(document.createTextNode(`
|
|
2
2
|
|
|
3
3
|
`))});let E=()=>{let e=!1;document.querySelectorAll("*").forEach(n=>{n.childNodes.length===0&&!n.innerText.trim()&&(n.remove(),e=!0)}),e&&E()};return E(),document.body.innerHTML});if(!w)throw new Error("EMPTY_RENDER_RESULT");let S=w.replace(/<br\s*\/?>/gi,`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-A73NNVCZ.js";import{
|
|
1
|
+
import{a as P}from"./chunk-A73NNVCZ.js";import{a as k}from"./chunk-Y5JU726N.js";import{d as M}from"./chunk-RI37VZYB.js";import v from"puppeteer";import _ from"fs";import q from"path";var V=async F=>{let{query:f,limit:j=5,aiMode:L=!1}=k(F);if(!f)return'ERROR: Missing "query" argument for WebSearch.';let S=3,y=null;if(L){let u=`Query: ${f}
|
|
2
2
|
|
|
3
3
|
RESPONSE RULES:
|
|
4
4
|
- ANSWER CONCISELY (TL;DR style) WITH REQUIRED DETAILS UNDER 300 WORDS.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-YUJMCXJA.js";import{a as s}from"./chunk-Y5JU726N.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";import c from"fs-extra";import n from"path";import u from"html-to-docx";var w=async m=>{let{path:t,content:r}=s(m);if(!t)return'ERROR: Missing "path" argument for write_docx.';if(!r)return'ERROR: Missing "content" (HTML) for write_docx.';let o=n.resolve(process.cwd(),t);try{await c.ensureDir(n.dirname(o)),await l.recordFileChange(o);let e=n.basename(t),a=r.includes("<html")?r:`
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-YUJMCXJA.js";import{a as R}from"./chunk-Y5JU726N.js";import{a as $}from"./chunk-I4JQEUHE.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";import r from"fs";import C from"path";var B=async(w,E={})=>{let{path:s,content:o}=R(w);if(!s)return'ERROR: Missing "path" argument for write_file.';if(o===void 0)return'ERROR: Missing "content" argument for write_file.';o=o.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let t=C.resolve(process.cwd(),s),m=C.dirname(t);try{await y.recordFileChange(t);let n="";if(r.existsSync(t))try{n=`Old File contents:
|
|
4
4
|
${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-YUJMCXJA.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";import I from"puppeteer";import i from"path";import o from"fs-extra";import{PDFDocument as L}from"pdf-lib";var _=async C=>{let{path:l,content:m,orientation:R="portrait",margin:c="0px"}=y(C);if(!l)return'ERROR: Missing "path" argument for write_pdf.';if(!m)return'ERROR: Missing "content" (HTML/CSS) for write_pdf.';let f=i.resolve(process.cwd(),l),u=null;try{await o.ensureDir(i.dirname(f)),await F.recordFileChange(f);let p=$();u=await I.launch({headless:!0,executablePath:p.executablePath||void 0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu","--disable-dev-shm-usage"]});let w=await u.newPage(),a=m,g={},x=async t=>{if(!t||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return null;try{let e=i.resolve(process.cwd(),t);if(await o.pathExists(e)){let s=i.extname(e).toLowerCase().replace(".","")||"png",d=s==="jpg"?"jpeg":s==="svg"?"svg+xml":s,h=await o.readFile(e,"base64");return`data:image/${d};base64,${h}`}}catch{}return null},v=/<link[^>]+href=["']([^"']+)["']/gi,b={},r;for(;(r=v.exec(m))!==null;){let t=r[1],e=r[0];if(t&&e.toLowerCase().includes("stylesheet")&&!t.startsWith("http://")&&!t.startsWith("https://")&&!t.startsWith("data:"))try{let s=i.resolve(process.cwd(),t);if(await o.pathExists(s)){let d=await o.readFile(s,"utf-8");b[e]=`<style>${d}</style>`}}catch{}}for(let[t,e]of Object.entries(b))a=a.split(t).join(e);let P=/<img[^>]+src=["']([^"']+)["']/gi;for(;(r=P.exec(a))!==null;){let t=r[1];if(t&&!g[t]){let e=await x(t);e&&(g[t]=e)}}let A=/url\(\s*['"]?([^'")]+?)['"]?\s*\)/gi;for(;(r=A.exec(a))!==null;){let t=r[1].trim();if(t&&!g[t]){let e=await x(t);e&&(g[t]=e)}}for(let[t,e]of Object.entries(g)){let s=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),d=new RegExp(`(src=["'])(${s})(["'])`,"gi");a=a.replace(d,`$1${e}$3`);let h=new RegExp(`url\\(\\s*(['"]?)(${s})\\1\\s*\\)`,"gi");a=a.replace(h,`url($1${e}$1)`)}let E=`
|
|
2
2
|
<style>
|
|
3
3
|
@page {
|
|
4
4
|
margin: ${c};
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as
|
|
3
|
-
[ERROR] Allocation value '${
|
|
4
|
-
`),process.exit(1));var
|
|
5
|
-
[MEMORY] Starting with: '${
|
|
2
|
+
import{a as S}from"./chunks/chunk-RI37VZYB.js";import{spawn as pe}from"child_process";import{fileURLToPath as z}from"url";import me from"os";import O from"path";import k from"fs";import C from"dotenv";try{let t=O.join(S,"AGENTS.md"),c=O.join(S,"FLUXFLOW.md");k.existsSync(S)||k.mkdirSync(S,{recursive:!0}),k.existsSync(t)||k.writeFileSync(t,"","utf8"),k.existsSync(c)||k.writeFileSync(c,"","utf8")}catch{}C.config({path:"./.env",override:!0,quiet:!0});C.config({path:`${S}/.env`,override:!0,quiet:!0});C.config({path:`${S}/.env.agents`,override:!0,quiet:!0});C.config({path:`${S}/.env.fluxflow`,override:!0,quiet:!0});C.config({path:"./.env.agents",override:!0,quiet:!0});C.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var de=me.totalmem(),J=de/(1024*1024),ue=.5,ge=Math.floor(J*ue),K=process.argv.slice(2),V=K.indexOf("--allocation"),l=V!==-1?parseInt(K[V+1],10):NaN,fe=process.env.EXPERIMENTAL_MEMORY_MANAGER==="true"||process.env.EXPERIMENTAL_MEMORY_MANAGER==="1"||process.env.EXPERIMENTAL_MEMORY_MANAGER===!0||process.env.EXPERIMENTAL_MEMORY_MANAGER===1||!1,xe=!isNaN(l)||fe||!1;!isNaN(l)&&l<64&&(console.error(`
|
|
3
|
+
[ERROR] Allocation value '${l} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
|
+
`),process.exit(1));var R=Math.floor(J*.75),we=!isNaN(l)&&l>0?Math.min(l,R):Math.max(1536,Math.min(32768,ge)),he=z(import.meta.url).endsWith(".js");if(he&&!process.execArgv.some(t=>t.includes("max-old-space-size"))&&xe)Number.isNaN(l)||(console.log(`
|
|
5
|
+
[MEMORY] Starting with: '${l>R?R:l} MB' Allocation${l>R?" (Max allowed: '"+R+" MB')":""}. Please Wait...`),await new Promise(c=>setTimeout(c,5e3))),pe(process.execPath,[`--max-old-space-size=${we}`,"--expose-gc","--max-semi-space-size=1",z(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",c=>process.exit(c||0));else{let t=process.argv.slice(2),c=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",q=t.includes("--help")&&!c,G=t.includes("--version")||t.includes("-v"),Y=t[0]==="--update",W=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:e}=await import("./chunks/usageServer-LRDIG27Z.js"),{url:n}=await e();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
|
-
\u2800\u2800\u2514\u2500 Serving at: ${
|
|
7
|
+
\u2800\u2800\u2514\u2500 Serving at: ${n}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
9
|
-
`),await new Promise(()=>{})}if(
|
|
10
|
-
Usage: fluxflow --export error`),process.exit(1)}if(
|
|
9
|
+
`),await new Promise(()=>{})}if(G||q||c||Y||W){let e=await import("fs"),n=await import("path"),{fileURLToPath:p}=await import("url"),m=n.join(n.dirname(p(import.meta.url)),"../package.json"),f=JSON.parse(e.readFileSync(m,"utf8")).version;if(W){let d=(t[1]||"").toLowerCase();if(d==="error"||d==="logs")try{let{exportErrorLogs:a}=await import("./chunks/export-ZTNXWWJF.js"),r=await a();console.log(`[EXPORT LOGS] Exported ${r.entryCount} error log entries (FluxFlow: ${r.fluxflowCount}, Memory: ${r.memoryCount}) to "${r.exportFile}"`),process.exit(0)}catch(a){console.error(`[EXPORT ERROR] Failed to export error logs: ${a.message}`),process.exit(1)}else console.error(`[EXPORT ERROR] Invalid export target "${t[1]||""}". --export only supports 'error'.
|
|
10
|
+
Usage: fluxflow --export error`),process.exit(1)}if(G&&(console.log(`v${f}`),process.exit(0)),q&&(console.log(`FluxFlow CLI Arguments:
|
|
11
11
|
--mode <flux|flow> Set startup mode (flux: Agent / flow: Chat)
|
|
12
12
|
--model <model_name> Set startup AI model
|
|
13
13
|
--key <key@provider> Set API key and provider
|
|
@@ -21,6 +21,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(N&&(console.log(`v${d}`),pro
|
|
|
21
21
|
--auto-exec <on|off> Toggle permission for autonomous command execution
|
|
22
22
|
--yolo <on|off> Same as --auto-exec
|
|
23
23
|
--external-access <on|off> Toggle permission for file reads outside CWD
|
|
24
|
+
-p, --prompt <text> One-shot non-TUI answer (custom system instruction, no loop)
|
|
24
25
|
-v, --version Show installed version
|
|
25
26
|
--help Show this help menu
|
|
26
27
|
--help commands Show available /commands
|
|
@@ -31,7 +32,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(N&&(console.log(`v${d}`),pro
|
|
|
31
32
|
--export error Export system error logs to fluxflow-error-<timestamp>.txt
|
|
32
33
|
--update check Check for new updates
|
|
33
34
|
--update check latest Show the latest version available on npm
|
|
34
|
-
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),
|
|
35
|
+
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),c&&(console.log(`FluxFlow Chat /Commands:
|
|
35
36
|
/quit Exit and shutdown Flux
|
|
36
37
|
/help Show help menu
|
|
37
38
|
/clear Clear terminal screen
|
|
@@ -63,4 +64,16 @@ Usage: fluxflow --export error`),process.exit(1)}if(N&&(console.log(`v${d}`),pro
|
|
|
63
64
|
/docs View documentation
|
|
64
65
|
/fluxflow init Create FluxFlow.md template
|
|
65
66
|
/update check Check for new version
|
|
66
|
-
/update latest Install latest release`),process.exit(0)),
|
|
67
|
+
/update latest Install latest release`),process.exit(0)),Y){let d=t[1]||"latest";if(d==="check"){let a=t[2]==="latest";try{let x=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;x||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(a?`Latest version: v${x}`:x!==f?`A new version of FluxFlow is available: v${x} (current: v${f}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${f}).`)}catch(r){console.error("Error checking for updates:",r.message),process.exit(1)}process.exit(0)}else if(d==="latest"){console.log("Checking latest version and settings...");try{let s=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;s||(console.error("Error: Could not retrieve latest version."),process.exit(1)),s===f&&(console.log(`FluxFlow is already up to date (v${f}).`),process.exit(0));let x=async()=>{let o=(await import("react")).default,{useState:P}=o,{render:D,Box:h,Text:E}=await import("ink"),_=(await import("ink-select-input")).default,g=(await import("ink-text-input")).default;return new Promise(v=>{let y=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],B=({label:$,isSelected:I})=>o.createElement(h,{width:"100%"},o.createElement(E,{bold:I},"\u2514\u2500 ",I?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",$)),F,j=()=>{let[$,I]=P("select"),[ae,ie]=P(""),le=N=>{N.value==="custom"?I("custom"):H({manager:N.value})},ce=N=>{H({manager:"custom",customCommand:N})};return $==="custom"?o.createElement(h,{flexDirection:"column",marginY:1},o.createElement(h,{marginBottom:1},o.createElement(E,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),o.createElement(h,{flexDirection:"row"},o.createElement(E,{color:"cyan",bold:!0}," \u276F "),o.createElement(g,{value:ae,onChange:ie,onSubmit:ce})),o.createElement(h,{marginTop:1},o.createElement(E,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):o.createElement(h,{flexDirection:"column",marginY:1},o.createElement(h,{marginBottom:1},o.createElement(E,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),o.createElement(_,{items:y,onSelect:le,itemComponent:B,indicatorComponent:()=>null}))},H=$=>{F&&F(),v($)},{unmount:ne}=D(o.createElement(j,null));F=ne})},i,A="",u;try{let{loadSettings:o}=await import("./chunks/settings-JGWWOFEC.js");u=await o(),i=u?.systemSettings?.updateManager||u?.updateManager}catch{}if(!i){let o=await x();i=o.manager,A=o.customCommand}let w="";i==="pnpm"?w=`pnpm add -g fluxflow-cli@${s}`:i==="bun"?w=`bun add -g fluxflow-cli@${s}`:i==="yarn"?w=`yarn global add fluxflow-cli@${s}`:i==="custom"?w=A||u?.customUpdateCommand||`npm install -g fluxflow-cli@${s}`:w=`npm install -g fluxflow-cli@${s}`,console.log(`Updating FluxFlow to v${s} using ${i}...`),console.log(`Running: ${w}`);let{execSync:M}=await import("child_process");M(w,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${s}.\x1B[0m`)}catch(a){console.error("\x1B[31m\u274C Update failed:\x1B[0m",a.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:Q}=await import("react"),{render:Z}=await import("ink"),{default:ee}=await import("./chunks/app-GKXK24DF.js");process.env.NODE_NO_WARNINGS="1";let te=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],oe=console.log,se=console.warn,re=console.error,L=e=>{let n=e.map(String).join(" ");return te.some(p=>n.includes(p))};console.log=(...e)=>!L(e)&&oe(...e),console.warn=(...e)=>!L(e)&&se(...e),console.error=(...e)=>!L(e)&&re(...e);let U=t.findIndex(e=>e==="--cwd"||e==="--path");if(U!==-1&&U+1<t.length){let e=t[U+1],n=await import("path"),p=await import("fs-extra"),m=n.default.resolve(e);try{p.default.existsSync(m)&&p.default.statSync(m).isDirectory()?process.chdir(m):(console.error(`[ERROR] Directory not found: "${e}"`),process.exit(0))}catch(b){console.error(`[ERROR] Failed to change directory to "${e}": ${b.message}`),process.exit(0)}}let T=t.findIndex(e=>e==="-p"||e==="--prompt");if(T!==-1){let e=t[T+1];e||(console.error("[ERROR] -p/--prompt requires a prompt string."),process.exit(1));let{loadSettings:n}=await import("./chunks/settings-JGWWOFEC.js"),{getProviderAPIKey:p}=await import("./chunks/secrets-RFEEPY3S.js"),{getDefaultModel:m}=await import("./chunks/model_config-UZLNHYP5.js"),{generateSimpleContent:b}=await import("./chunks/ai-UMXT6VB5.js"),{checkQuotaDetailed:f}=await import("./chunks/usage-H4SG5DWF.js"),d=await n(),a=t.filter((g,v)=>v!==T&&v!==T+1),r=g=>{for(let v of g){let y=a.indexOf(v);if(y!==-1&&y+1<a.length)return a[y+1]}return null},s=r(["--provider"])||d.aiProvider||"Google",x=r(["--model"])||d.activeModel||m(s,d.apiTier)||m(s,"paid"),i=r(["--key"])||await p(s);i||(console.error(`[ERROR] No API key resolved for provider "${s}".`),process.exit(1));let A=await f("agent",{aiProvider:s});A.allowed||(console.error(`[ERROR] ${A.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let u={aiProvider:s,apiKey:i,model:x,mode:"flow",thinkingLevel:r(["--thinking"])||"Fast",systemSettings:d.systemSettings||{}},w=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,o=M.getFullYear(),P=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),D=String(M.getDate()).padStart(2,"0"),h=M.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0}),E=`${o}-${P}-${D}, ${h}`,_=`Identity: FluxFlow. Sassy, friendly, CLI Assistant
|
|
68
|
+
NO markdown, just plain text. Dont ask questions at response end
|
|
69
|
+
-- Additional Context --
|
|
70
|
+
- OS: ${w}
|
|
71
|
+
- Model: ${O.basename(u.model).trim().replace(":free","").replace("-free","").replace("free/","").replaceAll("-"," ").replace(/\b\w/g,g=>g.toUpperCase().trim())}
|
|
72
|
+
- Time: ${E}
|
|
73
|
+
- Headless, non interactive mode. No conversation context
|
|
74
|
+
- 'fluxflow' TUI needed for full agentic capability & tools`.trim();try{let g="\x1B[36m",v="\x1B[35m",y="\x1B[0m",B=O.basename(u.model).trim().replace(":free","").replace("-free","").replace("free/","").replaceAll("-"," ").replace(/\b\w/g,j=>j.toUpperCase().trim());process.stdout.write(`Responding with ${g}${B}${y} from ${v}${u.aiProvider}${y}:
|
|
75
|
+
`);let{text:F}=await b(u,x,e,_,u.thinkingLevel);process.stdout.write((F||"").trim()+`
|
|
76
|
+
|
|
77
|
+
`)}catch(g){console.error(`[ERROR] Prompt request failed: ${g.message.trim()}
|
|
78
|
+
|
|
79
|
+
`),process.exit(1)}process.exit(0)}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let X=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",X),["SIGINT","SIGTERM","SIGHUP"].forEach(e=>{process.once(e,()=>{X(),process.exit(0)})}),t.includes("--playground")){let e=process.cwd();process.argv.push("--original-cwd",e);let{DATA_DIR:n}=await import("./chunks/paths-Y7ACZJAE.js"),p=await import("path"),m=await import("fs-extra"),b=p.default.join(n,"playground");try{m.default.ensureDirSync(b),process.chdir(b)}catch{}}Z(Q.createElement(ee,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as p,B as q,C as r,D as s,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-DRD5PTCI.js";import"./chunk-VCF6JVQV.js";import"./chunk-56EJGQU3.js";import"./chunk-KRRJNFBF.js";import"./chunk-X3ZZM2GL.js";import"./chunk-ZSVBC2ZI.js";import"./chunk-KFM2OZWJ.js";import"./chunk-72RYQ5W7.js";import"./chunk-WKHYRBBK.js";import{g as a}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-HYGK7YDY.js";import"./chunk-FDNLMLIM.js";import"./chunk-Y5JU726N.js";export{c as RE_LEADING_THINK,p as compressHistory,b as convertChannelThinkTags,q as deleteChatSummary,e as findGenuineThinkClose,r as getAIStream,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,o as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,n as runJanitorTask,s as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as p,B as q,C as r,D as s,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-47AJJOP3.js";import"./chunk-VCF6JVQV.js";import"./chunk-56EJGQU3.js";import"./chunk-KRRJNFBF.js";import"./chunk-X3ZZM2GL.js";import"./chunk-ZSVBC2ZI.js";import"./chunk-KFM2OZWJ.js";import"./chunk-72RYQ5W7.js";import"./chunk-WKHYRBBK.js";import{g as a}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-HYGK7YDY.js";import"./chunk-FDNLMLIM.js";import"./chunk-Y5JU726N.js";export{c as RE_LEADING_THINK,p as compressHistory,b as convertChannelThinkTags,q as deleteChatSummary,e as findGenuineThinkClose,r as getAIStream,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,o as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,n as runJanitorTask,s as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|