fluxflow-cli 5.4.2 → 5.6.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/README.md +1 -1
- package/dist/chunks/{ai-FLHPNZ2Y.js → ai-XPXVNDUQ.js} +1 -1
- package/dist/chunks/answerSubagent-LFLPQQSS.js +1 -0
- package/dist/chunks/{apinex-COGJR7W4.js → apinex-BN3E62ML.js} +1 -1
- package/dist/chunks/{app-F46WEHMM.js → app-PTS5SZLA.js} +168 -168
- package/dist/chunks/ask_user-RJTHGJNS.js +1 -0
- package/dist/chunks/{auto_completion-LB3W4Z2X.js → auto_completion-4ADVOCVI.js} +1 -1
- package/dist/chunks/{awaitSubagent-JKQ2EHVY.js → awaitSubagent-ZXLUWTW7.js} +1 -1
- package/dist/chunks/cancel-C2BQ3FGV.js +1 -0
- package/dist/chunks/chat-34HLGFEJ.js +1 -0
- package/dist/chunks/chunk-3PZTWZTT.js +1 -0
- package/dist/chunks/chunk-3WV6FIZV.js +1 -0
- package/dist/chunks/{chunk-GQENTVZQ.js → chunk-BD6HA64O.js} +6 -6
- package/dist/chunks/chunk-JWNCKRN6.js +4 -0
- package/dist/chunks/{chunk-ZPSNXBWW.js → chunk-KTD4WQBO.js} +1 -1
- package/dist/chunks/chunk-KWSISKDF.js +896 -0
- package/dist/chunks/{chunk-5MJKHQVE.js → chunk-KYIMFUZS.js} +1 -1
- package/dist/chunks/{chunk-MZB7MCUR.js → chunk-LTNOPF2E.js} +5 -5
- package/dist/chunks/chunk-MS7BITZ6.js +1 -0
- package/dist/chunks/{chunk-4PTLFXTU.js → chunk-O74INBF3.js} +3 -3
- package/dist/chunks/{chunk-3SMC2C3F.js → chunk-QN4UHB5C.js} +1 -1
- package/dist/chunks/{click-WWAFZ4BZ.js → click-R6CYDOMM.js} +2 -2
- package/dist/chunks/coarena-SGBBHWAP.js +2 -0
- package/dist/chunks/computer_action-WRT67RP2.js +1 -0
- package/dist/chunks/{custom_openai-JUCNWDKV.js → custom_openai-MM5T6QBQ.js} +1 -1
- package/dist/chunks/drag-4JO6XSNT.js +1 -0
- package/dist/chunks/{emergency_rollback-J3SMQXBP.js → emergency_rollback-X55BPJ7Q.js} +1 -1
- package/dist/chunks/{exec_command-G67OSEZL.js → exec_command-PIC3AFGH.js} +1 -1
- package/dist/chunks/{file_map-U6SWDUPK.js → file_map-3YMVODEE.js} +8 -8
- package/dist/chunks/find_file-RBJ4LKPD.js +4 -0
- package/dist/chunks/generate_image-NDIBDL5E.js +1 -0
- package/dist/chunks/{getProgress-J34K43Y7.js → getProgress-4D67AF3H.js} +2 -2
- package/dist/chunks/{infron-KCX7Z3RE.js → infron-4M36NBSA.js} +1 -1
- package/dist/chunks/invoke-ZLCJZ4KB.js +6 -0
- package/dist/chunks/invokeSync-FEPQMT4S.js +7 -0
- package/dist/chunks/key_press-KJNHQOI7.js +1 -0
- package/dist/chunks/keyboard_typing-M4UZB3TK.js +1 -0
- package/dist/chunks/{ollama-BJHC4S6H.js → ollama-X7ARM2CC.js} +1 -1
- package/dist/chunks/{read_folder-UWFC5DNX.js → read_folder-OJ7UWWOR.js} +1 -1
- package/dist/chunks/recapture_screen-IYOK5JYN.js +1 -0
- package/dist/chunks/{screen_grid-Z5JHZZKA.js → screen_grid-PHZTVWOJ.js} +1 -1
- package/dist/chunks/scroll-DXOBGF4W.js +1 -0
- package/dist/chunks/search_keyword-ZAEFTMSC.js +9 -0
- package/dist/chunks/{secrets-OHIQHB63.js → secrets-6RUMHIWR.js} +1 -1
- package/dist/chunks/{secrets_v2-W4225MDM.js → secrets_v2-5NIKKQXX.js} +1 -1
- package/dist/chunks/{settings-Y7ODX5TH.js → settings-UL5E3OYC.js} +1 -1
- package/dist/chunks/steerSubagent-UNAOFQZJ.js +1 -0
- package/dist/chunks/{todo-ZFQ6BQVI.js → todo-OX7SMIKN.js} +2 -2
- package/dist/chunks/{tokenharbor-2TAFOMPU.js → tokenharbor-KKGRGQXG.js} +1 -1
- package/dist/chunks/update_file-OD5V45KN.js +15 -0
- package/dist/chunks/{usage-3CNTEZUA.js → usage-MKFPGZUK.js} +1 -1
- package/dist/chunks/{usageServer-7NPU35BP.js → usageServer-JFFFEUMY.js} +8 -2
- package/dist/chunks/view_file-XYWGDYAY.js +1 -0
- package/dist/chunks/wait-RQSCCCXW.js +1 -0
- package/dist/chunks/{web_search-MOI3CNWS.js → web_search-B2XM4T5D.js} +11 -11
- package/dist/chunks/write_docx-BMIF6ZDY.js +13 -0
- package/dist/chunks/{write_file-MNAF43T6.js → write_file-AUCXXODD.js} +1 -1
- package/dist/chunks/write_pdf-CTBFENCU.js +31 -0
- package/dist/chunks/{xkiro-GN4FCYYQ.js → xkiro-3R4IOLSP.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/answerSubagent-BPNNJXPC.js +0 -1
- package/dist/chunks/ask_user-K2DLZF6H.js +0 -1
- package/dist/chunks/cancel-F3ZOEBKW.js +0 -1
- package/dist/chunks/chat-V5FZDYET.js +0 -1
- package/dist/chunks/chunk-3HGLLXBK.js +0 -1
- package/dist/chunks/chunk-IWIVGFAT.js +0 -1
- package/dist/chunks/chunk-KQNW7DK5.js +0 -1
- package/dist/chunks/chunk-XL72TK36.js +0 -888
- package/dist/chunks/chunk-Y5JU726N.js +0 -4
- package/dist/chunks/computer_action-B6QH77NT.js +0 -1
- package/dist/chunks/drag-3VRYDGVU.js +0 -1
- package/dist/chunks/find_file-GBEBP5NZ.js +0 -4
- package/dist/chunks/generate_image-2JIYAW5L.js +0 -1
- package/dist/chunks/invoke-HNUJ223N.js +0 -6
- package/dist/chunks/invokeSync-H3GJAEK4.js +0 -3
- package/dist/chunks/key_press-J2ZSWOT2.js +0 -1
- package/dist/chunks/keyboard_typing-FFC7OTDM.js +0 -1
- package/dist/chunks/recapture_screen-P7YVVVSF.js +0 -1
- package/dist/chunks/scroll-GBV6YRQT.js +0 -1
- package/dist/chunks/search_keyword-KE5VBMVA.js +0 -9
- package/dist/chunks/steerSubagent-UETXH2CB.js +0 -1
- package/dist/chunks/update_file-C5HRYCQN.js +0 -15
- package/dist/chunks/view_file-PEZ7HS36.js +0 -1
- package/dist/chunks/wait-TJR6LAR4.js +0 -1
- package/dist/chunks/write_docx-A3GAUZEW.js +0 -13
- package/dist/chunks/write_pdf-YQ3JTZ5U.js +0 -31
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var w=e=>{let b={};if(!e)return b;let t=0;for(;t<e.length;){for(;t<e.length&&/[\s,]/.test(e[t]);)t++;if(t>=e.length)break;let m=e.substring(t).match(/^(\w+)\s*=\s*/);if(!m){t++;continue}let r=m[1];t+=m[0].length;let l="";if(t<e.length&&(e[t]==='"'||e[t]==="'"||e[t]==="`")){let i=e[t];t++;let n=t,c=-1,o=t;for(;o<e.length;){let s=e.indexOf(i,o);if(s===-1)break;let u=0;for(let d=s-1;d>=0&&e[d]==="\\";d--)u++;if(u%2!==0){o=s+1;continue}let h=e.substring(s+1),a=h.trim(),p=a===""||/^,\s*\w+\s*=/.test(a)||a.startsWith(")")&&(a.length===1||/^\)\s*([,\]\s]|\[\[?tool:)/i.test(a));if(p&&h.startsWith(`
|
|
2
|
-
`)){let d=a.split(`
|
|
3
|
-
`)[0];if(!d.includes("=")&&!d.includes(")")){o=s+1;continue}}if(p){c=s;break}o=s+1}c!==-1?(l=e.substring(n,c),t=c+1):(l=e.substring(n),t=e.length);let f=r.toLowerCase().includes("path")||["dest","source","to","from"].includes(r.toLowerCase());l=l.replace(/\\(.)/g,(s,u)=>{switch(u){case"n":return`
|
|
4
|
-
`;case"r":return"\r";case"t":return" ";case"\\":return"\\";default:return u===i?i:u}})}else if(t<e.length&&e[t]==="["){let i=0,n=null,c=t,o=-1;for(let f=t;f<e.length;f++){let s=e[f];if(n&&s===n){let u=0;for(let h=f-1;h>=0&&e[h]==="\\";h--)u++;u%2===0&&(n=null)}else!n&&(s==='"'||s==="'"||s==="`")&&(n=s);if(!n&&(s==="["?i++:s==="]"&&i--,i===0)){o=f;break}}if(o!==-1){l=e.substring(c,o+1),t=o+1;try{let f=l.trim();f.startsWith("'")||f.includes("'")}catch{}}else l=e.substring(c),t=e.length}else{let i=e.substring(t),n=i.match(/,\s*\w+\s*=|(?:\s*\)\s*(?:$|\]\]))/);if(n){let c=n.index;l=i.substring(0,c).trim(),t+=c}else l=i.trim(),t=e.length}l==="true"?l=!0:l==="false"?l=!1:typeof l=="string"&&!isNaN(l)&&l.trim()!==""&&(l=Number(l)),typeof l=="string"&&(r.toLowerCase().includes("path")||["dest","source","to","from"].includes(r.toLowerCase()))&&(l=l.replace(/\x0C/g,"\\f").replace(/\x0D/g,"\\r").replace(/\x0B/g,"\\v").replace(/\x08/g,"\\b")),b[r]=l}return b};export{w as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i,b as s}from"./chunk-ZPSNXBWW.js";import"./chunk-3SMC2C3F.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 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-ZPSNXBWW.js";import"./chunk-3SMC2C3F.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 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-Y5JU726N.js";import{w as C,x as F}from"./chunk-NPXJIGAI.js";import q from"fs/promises";import y from"path";function S(n){let e=n.toLowerCase();if(e.length===0)return[];if(e.length===1)return[e];let o=[];for(let t=0;t<e.length-1;t++)o.push(e.slice(t,t+2));return o}function w(n,e){if(n===e)return 1;if(!n||!e)return 0;let o=S(n),t=S(e);if(o.length===0||t.length===0)return 0;let i=new Map;for(let l of t)i.set(l,(i.get(l)||0)+1);let r=0;for(let l of o){let a=i.get(l)||0;a>0&&(r++,i.set(l,a-1))}return 2*r/(o.length+t.length)}async function E(n,e,o=n,t=1,i=15){if(t>i)return[];let r;try{r=await q.readdir(n,{withFileTypes:!0})}catch{return[]}let l=[];for(let a of r){if(e.has(a.name))continue;let h=y.join(n,a.name);if(a.isDirectory()){let m=await E(h,e,o,t+1,i);l.push(...m)}else{let m=y.relative(o,h).replace(/\\/g,"/");l.push({name:a.name,relPath:`./${m}`})}}return l}var O=async n=>{let e=typeof n=="object"&&n!==null?n:R(n),o=e.basename||e.name||e.path||e.file||e.filename||e.query;if(!o&&typeof n=="string"&&n.trim()){let f=n.trim().replace(/^["']|["']$/g,"");!f.startsWith("{")&&!f.includes("=")&&(o=f)}if(!o)return'ERROR: "basename" parameter is required for FindFile';let t=String(o).trim().replace(/^["']|["']$/g,""),i=t.replace(/^(\.\/|\.\\)/,"").replace(/\\/g,"/"),r=i.toLowerCase(),a=t.includes("*")||t.includes("?")?new RegExp("^"+t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")+"$","i"):null,h=process.cwd(),m=new Set([...C,...F(h)]);try{let f=await E(h,m,h),g=[];for(let s of f){let u=s.name.toLowerCase(),P=y.parse(s.name).name.toLowerCase(),p=s.relPath.toLowerCase(),d=p.startsWith("./")?p.slice(2):p,c=0;if(s.name===i||s.relPath===`./${i}`)c=1;else if(u===r||p===`./${r}`||d===r)c=.98;else if(P===r)c=.95;else if(a&&(a.test(s.name)||a.test(d)))c=.9;else if(u.includes(r)||d.includes(r))c=.7+r.length/Math.max(u.length,r.length)*.15;else{let W=w(r,u),x=w(r,P),D=w(r,d),L=Math.max(W,x,D);L>=.75&&(c=L*.85)}c>=.6&&g.push({relPath:s.relPath,score:c})}if(g.length===0)return`No file found matching name "${t}" in CWD. If working outside CWD use Run`;g.sort((s,u)=>u.score-s.score||s.relPath.length-u.relPath.length);let $=Array.from(new Set(g.map(s=>s.relPath))),b=$.length;return`${`Found ${b} file${b===1?"":"s"} matching "${t}" in CWD:
|
|
2
|
-
|
|
3
|
-
`}${$.join(`
|
|
4
|
-
`)}`}catch(f){return`ERROR: Failed to find file: ${f.message}`}};export{O as find_file};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk-2RTYI6K3.js";import{a as b}from"./chunk-Y5JU726N.js";import{v as B,w as T,x as $}from"./chunk-5MJKHQVE.js";import{b as I}from"./chunk-KQNW7DK5.js";import"./chunk-Y6O7SAPD.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.js";import C from"fs-extra";import x 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=b(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 B(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await T()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,E={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),S=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${E}&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(S,{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:${E}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=x.resolve(process.cwd(),l);await C.ensureDir(x.dirname(R)),await k.recordFileChange(R),await C.writeFile(R,p),await $(i);let v=x.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`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 +0,0 @@
|
|
|
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-FLHPNZ2Y.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=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:C||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=[],A={...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
|
-
Respond using tool: [action:Answer(id="${i}", answer="...")]
|
|
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((M,_)=>M+_.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,A,E,f,null,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]")||n.startsWith("[Action Result]")){let o=n.split(`
|
|
4
|
-
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
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-FLHPNZ2Y.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)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-FLHPNZ2Y.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,null);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-FLHPNZ2Y.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
|
-
`)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-ZPSNXBWW.js";import"./chunk-3SMC2C3F.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 +0,0 @@
|
|
|
1
|
-
import{b as n}from"./chunk-ZPSNXBWW.js";import"./chunk-3SMC2C3F.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 +0,0 @@
|
|
|
1
|
-
import{f as n}from"./chunk-3SMC2C3F.js";import{a as c}from"./chunk-Y5JU726N.js";var m=async(r,o={})=>{let t=typeof r=="string"?c(r):r||{},a=t.canvasMode===!0||t.canvasMode==="true"||t.canvas_mode===!0||t.canvas_mode==="true";try{let e=await n({canvasMode:a});if(e&&e.base64)return{text:`Screen recaptured${a?" (static canvas grid mode)":""}.`,binaryPart:{inlineData:{mimeType:e.mimeType,data:e.base64}}}}catch{}return"Screen recaptured."};export{m as recapture_screen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-ZPSNXBWW.js";import"./chunk-3SMC2C3F.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};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as st}from"./chunk-Y5JU726N.js";import{b as et}from"./chunk-KQNW7DK5.js";import"./chunk-Y6O7SAPD.js";import"./chunk-ZGORMZE5.js";import{w as J,x as Q,y as Y,z as tt}from"./chunk-NPXJIGAI.js";import K from"fs/promises";import v from"path";import j from"fast-glob";import{Minimatch as rt}from"minimatch";async function O(f,l,y=f,m=1){if(m>12)return[];let h=[],s;try{s=await K.readdir(f,{withFileTypes:!0})}catch{return[]}for(let t of s){let e=v.join(f,t.name),w=v.relative(y,e),F=w.split(v.sep).map(L=>L.toLowerCase()),N=t.name.toLowerCase();if(!l.some(L=>{let E=L.toLowerCase();return E.startsWith(".")&&N.endsWith(E)?!0:F.some(P=>P===E||P.startsWith(".pnpm"))}))if(t.isDirectory()){let L=await O(e,l,y,m+1);h=h.concat(L)}else t.isFile()&&h.push({fullPath:e,relativePath:w})}return h}function lt(f,l,y=1/0){if(f===l)return 0;if(f.length===0)return l.length;if(l.length===0)return f.length;if(Math.abs(f.length-l.length)>y)return y+1;let m=Array.from({length:l.length+1},(h,s)=>s);for(let h=1;h<=f.length;h++){let s=[h],t=h;for(let e=1;e<=l.length;e++){let w=f[h-1]===l[e-1]?0:1,F=Math.min(s[e-1]+1,m[e]+1,m[e-1]+w);s.push(F),F<t&&(t=F)}if(m=s,t>y)return y+1}return m[l.length]}function at(f,l){if(!f||!l)return!1;let y=f.toLowerCase(),m=l.toLowerCase();if(y.includes(m))return!0;let h=y.split(/[^a-z0-9]+/).filter(t=>t.length>0),s=m.split(/[^a-z0-9]+/).filter(t=>t.length>1||m.length===1&&t.length>0);return s.length===0?!1:s.every(t=>{let e=t.length<=2?0:t.length<=5?1:2;for(let w of h)if(w.includes(t)||t.length>=3&&w.length>=3&&Math.abs(w.length-t.length)<=e&<(t,w,e)<=e)return!0;return!1})}var $t=async f=>{let{keyword:l,path:y,fuzzy:m,subString:h,regex:s}=st(f);if(l==null)return'ERROR: Missing "keyword" argument.';let t=String(l),e=y,w=!1;if(e){let{resolvedPath:n,isTildeResolved:d}=tt(e);e=n,w=d;let i=e.trim().toLowerCase();if(i==="#docs"||i==="#doc"||i==="#documentation"||i.includes("#skill/global/fluxflow")||i.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let F=n=>n===!0||n==="true"||n===1||n==="1"||n==="yes",N=s===!1||s==="false"||s===0||s==="0"||s==="no",B=s===!0||s==="true"||s===1||s==="1"||s==="yes",L=F(m)||F(h),E=null,P=null;if(N)L||(P=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{let n=t;E=new RegExp(n,"i")}catch(n){if(B)return`ERROR: Invalid regex pattern "${t}": ${n.message}`}P=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let S=Array.from(new Set([...J,...Q(process.cwd())])),X=150;try{let n=[],d=process.cwd(),i=null;if(e){let o=r=>r.startsWith("!")||!r.startsWith("-")?r:"!"+r.replace(/^-+/,""),u=e.split(";").map(r=>r.trim()).filter(Boolean).map(o).filter(r=>r!=="!"),c=u.some(r=>r.startsWith("!"));if(u.some(r=>j.isDynamicPattern(r)||/[*?{}[\]()|+]/.test(r))){i="glob";let r=e.replace(/\\/g,"/"),a=u.map(g=>g.replace(/\\/g,"/")),z=S.map(g=>g.startsWith(".")?`**/*${g}`:`**/${g}/**`);if(c&&!u.some(g=>!g.startsWith("!"))){let g=await O(d,S,d),R=$=>$.endsWith("/")?$+"**":$,p=a.filter($=>$.startsWith("!")).map($=>R($.slice(1))),M=a.filter($=>!$.startsWith("!")).map(R);n=g.filter($=>{let x=$.relativePath.replace(/\\/g,"/"),_=M.length===0||M.some(b=>{try{return new rt(b).match(x)}catch{return!1}}),Z=p.some(b=>{try{return new rt(b).match(x)}catch{return!1}});return _&&!Z})}else{let g=a.some(p=>/[\(\)\|]|\.\*/.test(p)),R=[];if(!g)try{R=await j(a,{cwd:d,ignore:z,dot:!0,onlyFiles:!0,absolute:!1})}catch{R=[]}if(R.length===0&&(g||j.isDynamicPattern(r))){let p=r.match(/^([^\*\?\(\)\|\[\]\s]+)\//),M=p&&!/[\*\?\(\)\|\[\]]/.test(p[1])?v.resolve(d,p[1]):d,$=await O(M,S,d);try{let x=r.replace(/^\.\//,"");x=x.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!x.startsWith("^")&&!x.startsWith(".*")&&(x=`.*${x}`);let _=new RegExp(x.endsWith("$")?x:`${x}$`,"i");n=$.filter(Z=>{let b=Z.relativePath.replace(/\\/g,"/");return _.test(b)})}catch{n=[]}}else n=R.map(p=>({fullPath:v.resolve(d,p),relativePath:p}))}}else{let r=[],a=!1,z=!1;for(let k of u){let g=k.replace(/[\/\\]+$/,""),R=v.resolve(d,g);try{let p=await K.stat(R);if(p.isDirectory()){z=!0;let M=await O(R,S,d);r.push(...M)}else if(p.isFile())a=!0,r.push({fullPath:R,relativePath:v.relative(d,R)});else return`ERROR: Path is neither a file nor a directory: ${k}`}catch{return`ERROR: Path not found: ${k}`}}n=r,a&&!z?i="file":i="dir"}}else n=await O(d,S);let nt=n.map(async o=>{try{let u=await K.readFile(o.fullPath,"utf-8");if(u.includes("\0"))return[];let c=u.split(/\r?\n/),W=[];for(let a=0;a<c.length;a++)(L?c[a].toLowerCase().includes(t.toLowerCase())||at(c[a],t):N?P&&P.test(c[a]):E&&E.test(c[a])||P&&P.test(c[a]))&&W.push({line:a+1,content:c[a].trim()});return W.length===0?null:{path:o.relativePath.replace(/\\/g,"/"),matches:W}}catch{return[]}}),it=await Promise.all(nt),D=[],A=0;for(let o of it){if(!o||!o.matches)continue;if(A>=X)break;let u=X-A,c=o.matches.slice(0,u);D.push({path:o.path,matches:c}),A+=c.length}typeof global.gc=="function"&&global.gc();let G=null;if(D.length===0){let o=i==="file"?` in '${e}'`:i==="dir"||i==="glob"?` in '${e}'`:". Try to specify files",u=i==="dir"?"[DIR]":i==="glob"?"[GLOB]":"";return`${u}${u?" ":""}Found 0 matches of '${t}'${o}${G?` ${G}`:""}`}let T=G?` ${G}`:"",H=`${D.length} file${D.length===1?"":"s"}`,U=`${A} match${A===1?"":"es"}`,I;i==="file"?I=`Found ${U} of '${t}' in '${e}'${T}:`:i==="dir"||i==="glob"?I=`Found ${U} of '${t}' in '${e}' across ${H}${T}:`:I=`Found ${U} of '${t}' across ${H}${T}:`;let V=i==="dir"?"[DIR]":i==="glob"?"[GLOB]":"",C=`${V}${V?" ":""}${I}
|
|
2
|
-
|
|
3
|
-
`,q="";try{let o=await et();o?.systemSettings?.alwaysAskFiles&&(q=o.systemSettings.alwaysAskFiles)}catch{}for(let o of D)if(C+=`${o.path}:
|
|
4
|
-
`,Y(o.path,q)){let c=o.matches.map(W=>`Line ${W.line}`).join(", ");C+=` ${c}. Line snapshot not available due to file restriction policy. ReadFile if needed
|
|
5
|
-
|
|
6
|
-
`}else{for(let c of o.matches)C+=` Line ${c.line}: ${c.content}
|
|
7
|
-
`;C+=`
|
|
8
|
-
`}let ot=w?`
|
|
9
|
-
[Note: '~' resolved to user home directory. To target literal '~' in current directory, escape it as '\\~']`:"";return`${C.trimEnd()}${ot}`}catch(n){return`ERROR: ${n.message}`}};export{$t as search_keyword};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-56EJGQU3.js";import{a}from"./chunk-Y5JU726N.js";var p=async(o,r={})=>{let t=a(o),s=t.id,n=t.message||t.instruction||t.text||t.prompt;if(!s)return'ERROR: Missing "id" argument for Steer.';if(!n)return'ERROR: Missing "message" argument for Steer.';let e=i.find(u=>u.id===s);return e?e.status==="completed"||e.status==="failed"||e.status==="cancelled"?`ERROR: Cannot steer subagent task [${s}] because it has already finished with status [${e.status.toUpperCase()}].`:(typeof e.steer=="function"?e.steer(n):(e.pendingSteerMessages||(e.pendingSteerMessages=[]),e.pendingSteerMessages.push(n)),r.onSubagentUpdate&&r.onSubagentUpdate(),`Steering instruction injected into subagent task [${s}]. It will be processed on the subagent's turn.`):`ERROR: Subagent task with ID [${s}] not found.`};export{p as steerSubagent};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{g as w,h as y,i as P,j as C}from"./chunk-JMMO76HS.js";import{a as M}from"./chunk-2RTYI6K3.js";import{a as E}from"./chunk-Y5JU726N.js";import{o as F}from"./chunk-5MJKHQVE.js";import{b as $}from"./chunk-KQNW7DK5.js";import"./chunk-Y6O7SAPD.js";import"./chunk-ZGORMZE5.js";import{z as R}from"./chunk-NPXJIGAI.js";import p from"fs";import N from"path";var q=async(S,v={})=>{let n=E(S),e=n.path;if(!e)return'ERROR: Missing "path" argument for PatchFile.';let{resolvedPath:O,isTildeResolved:T}=R(e);e=O;let{patchPairs:i,allowMultiple:b,error:d}=w(n);if(d)return`ERROR: ${d}`;if(i.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let k=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":b,s=N.resolve(process.cwd(),e);try{if(!p.existsSync(s))return`ERROR: File [${e}] does not exist. Use WriteFile instead.`;let t=v.forcedContent||p.readFileSync(s,"utf8");t.startsWith("\uFEFF")&&(t=t.slice(1));let o=t.replace(/\r\n/g,`
|
|
2
|
-
`).replace(/\r/g,`
|
|
3
|
-
`),{content:a,results:l}=y(o,i,{allowMultiple:k}),c=l.filter(r=>!r.success),u=l.filter(r=>r.success);if(u.length===0)return`ERROR: Patch Failed to apply to [${e}].
|
|
4
|
-
${c.map(r=>` \u2022 ${r.error}`).join(`
|
|
5
|
-
`)}`;await M.recordFileChange(s,o),p.writeFileSync(s,a,"utf8");let{systemSettings:x}=await $(),f=C(o,a,l,12,x?.compressToolResults),{added:h,removed:m}=P(o,a);(h>0||m>0)&&await F({added:h,removed:m,file:e});let g=T?`
|
|
6
|
-
|
|
7
|
-
[Note: '~' resolved to user home directory. To target literal '~' in current directory, escape it as '\\~']`:"";return c.length>0?`File [${e}] updated with some blocks failed. [${u.length}/${i.length}] blocks applied.
|
|
8
|
-
|
|
9
|
-
Failures:
|
|
10
|
-
${c.map(r=>` \u2022 ${r.error}`).join(`
|
|
11
|
-
`)}
|
|
12
|
-
|
|
13
|
-
${f}${g}`:`File [${e}] updated. [${l.length}/${i.length}] blocks applied.
|
|
14
|
-
|
|
15
|
-
${f}${g}`}catch(t){let o=t instanceof Error?t.message:String(t);return`ERROR: Failed to update file [${e}]: ${o}`}};export{q as update_file};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-4PTLFXTU.js";import"./chunk-Y5JU726N.js";import"./chunk-NPXJIGAI.js";export{a as view_file};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-Y5JU726N.js";var c=async(a,f={})=>{let o=r(a),i=o.seconds??o.sec??o.time??o.timeout??45,t=parseFloat(i);isNaN(t)&&(t=45),t<10?t=10:t>120&&(t=120);let n=(e=>{if(e>=60){let m=Math.floor(e/60),s=e%60;return`${m}m${s>0?` ${s}s`:""}`}return`${e}s`})(t);return await new Promise(e=>setTimeout(e,t*1e3)),`Waited for ${n}${t===120?" (Max: 120s)":""}${t===10?" (Min: 10s)":""}.`},l=c;export{l as default,c as wait};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-2RTYI6K3.js";import{a as s}from"./chunk-Y5JU726N.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.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
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<title>FluxFlow Document</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
${r}
|
|
10
|
-
</body>
|
|
11
|
-
</html>
|
|
12
|
-
`,i=await u(a,null,{title:`FluxFlow_${e}`,creator:"FluxFlow CLI",description:"Generated by Agentic AI System",table:{row:{cantSplit:!0}},footer:!0,pageNumber:!0});return await c.writeFile(o,i),`Word document [${t}] generated successfully.
|
|
13
|
-
- Size: ${(i.length/1024).toFixed(1)} KB`}catch(e){let a=e instanceof Error?e.message:String(e);return`ERROR: Failed to generate DOCX [${t}]: ${a}`}};export{w as write_docx};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-YX4X2ZTX.js";import{a as F}from"./chunk-2RTYI6K3.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.js";import L from"puppeteer";import i from"path";import o from"fs-extra";import{PDFDocument as S}from"pdf-lib";var _=async R=>{let{path:l,content:m,orientation:C="portrait",margin:c="0px"}=y(R);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 L.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
|
-
<style>
|
|
3
|
-
@page {
|
|
4
|
-
margin: ${c};
|
|
5
|
-
}
|
|
6
|
-
body {
|
|
7
|
-
margin: 0;
|
|
8
|
-
padding: 0;
|
|
9
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
10
|
-
}
|
|
11
|
-
* { box-sizing: border-box; }
|
|
12
|
-
.watermark {
|
|
13
|
-
position: fixed;
|
|
14
|
-
top: 50%;
|
|
15
|
-
left: 50%;
|
|
16
|
-
transform: translate(-50%, -50%) rotate(-50deg);
|
|
17
|
-
font-size: 52px;
|
|
18
|
-
font-weight: bold;
|
|
19
|
-
color: rgba(0, 0, 0, 0.005);
|
|
20
|
-
pointer-events: none;
|
|
21
|
-
z-index: -1000;
|
|
22
|
-
text-align: center;
|
|
23
|
-
width: 150%;
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
text-transform: uppercase;
|
|
26
|
-
letter-spacing: 5px;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
<div class="watermark">Generated by FluxFlow CLI (AI)</div>
|
|
30
|
-
${a}
|
|
31
|
-
`;await w.setContent(E,{waitUntil:"networkidle0",timeout:18e4});let D=await w.pdf({format:"A4",landscape:String(C).toLowerCase()==="landscape",margin:{top:c,right:c,bottom:c,left:c},printBackground:!0}),n=await S.load(D),j=i.basename(l);n.setTitle(`FluxFlow_${j}`),n.setAuthor("FluxFlow CLI"),n.setSubject("Generated with Agentic AI System"),n.setKeywords(["FluxFlow","AI","Agentic","Automated"]),n.setCreator("FluxFlow PDF Engine"),n.setProducer("FluxFlow (Generative AI)");let k=await n.save();await o.writeFile(f,k);let I=await o.stat(f);return`PDF generated successfully at [${l}] (${(I.size/1024).toFixed(2)} KB).`}catch(p){let w=p instanceof Error?p.message:String(p);return`ERROR: Failed to generate PDF [${l}]: ${w}`}finally{u&&await u.close()}};export{_ as write_pdf};
|