fluxflow-cli 4.24.4 → 4.24.6
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-PWP7GFSP.js → addMemScore-BCPTSMKD.js} +1 -1
- package/dist/chunks/{ai-D3LJNK5X.js → ai-3LFDECBF.js} +1 -1
- package/dist/chunks/answerSubagent-BPNNJXPC.js +1 -0
- package/dist/chunks/{app-3VYQVBJA.js → app-Y37LX2LT.js} +38 -38
- package/dist/chunks/awaitSubagent-JKQ2EHVY.js +7 -0
- package/dist/chunks/cancel-F3ZOEBKW.js +1 -0
- package/dist/chunks/{chat-7T6MVHC3.js → chat-MELTWDZ3.js} +1 -1
- package/dist/chunks/chunk-7M3AFLUN.js +1 -0
- package/dist/chunks/{chunk-VCPTQGFQ.js → chunk-DYIWPH2W.js} +10 -10
- package/dist/chunks/{chunk-V4SERXMR.js → chunk-I6ON47PL.js} +14 -21
- package/dist/chunks/{click-5ZKBFZ4N.js → click-2HXMMZIS.js} +1 -1
- package/dist/chunks/{computer_action-7U3W3F6L.js → computer_action-2XHXRO56.js} +1 -1
- package/dist/chunks/{drag-YHHKJGL6.js → drag-UYQLP2NB.js} +1 -1
- package/dist/chunks/{emergency_rollback-DXN5WNPR.js → emergency_rollback-6X27LZE4.js} +1 -1
- package/dist/chunks/{exec_command-CY42M4FP.js → exec_command-THB36X3Y.js} +1 -1
- package/dist/chunks/{generate_image-HVWLRINC.js → generate_image-4LIDEIYO.js} +1 -1
- package/dist/chunks/{invoke-2HHFVQYM.js → invoke-Y4JZMFKA.js} +3 -3
- package/dist/chunks/{invokeSync-IJOL6YKO.js → invokeSync-VWTVLP6T.js} +2 -2
- package/dist/chunks/{key_press-ZZNA3PF3.js → key_press-IN6BOWVJ.js} +1 -1
- package/dist/chunks/{keyboard_typing-QL3DF67Z.js → keyboard_typing-YEMPELE2.js} +1 -1
- package/dist/chunks/memory-M7ASUB6J.js +1 -0
- package/dist/chunks/recapture_screen-PPT2E3CK.js +1 -0
- package/dist/chunks/{saveSummary-VKGBD4CG.js → saveSummary-UGNDVNI5.js} +1 -1
- package/dist/chunks/{scroll-C4Z57VQS.js → scroll-C7SG5G2G.js} +1 -1
- package/dist/chunks/{steerSubagent-L2JVT4QN.js → steerSubagent-UETXH2CB.js} +1 -1
- package/dist/chunks/{todo-VG2CVRUI.js → todo-GFMPH2JV.js} +7 -7
- package/dist/chunks/{update_file-WTXXQ4RB.js → update_file-PXZHSSGS.js} +5 -5
- package/dist/chunks/{write_docx-I7T3575T.js → write_docx-4Y43QJUV.js} +1 -1
- package/dist/chunks/{write_file-V6HKMWFB.js → write_file-7X2GQFWK.js} +5 -5
- package/dist/chunks/{write_pdf-XDDKM7V5.js → write_pdf-N2Q4Z3YP.js} +2 -2
- package/dist/cli.js +4 -4
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/answerSubagent-JUVFNLE5.js +0 -1
- package/dist/chunks/awaitSubagent-JTUSJDKD.js +0 -7
- package/dist/chunks/cancel-7IMADALP.js +0 -1
- package/dist/chunks/chunk-JCT3YL5A.js +0 -1
- package/dist/chunks/memory-SRDCQNML.js +0 -1
- package/dist/chunks/recapture_screen-5FKLOHJL.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as M,d as m}from"./chunk-L3W2X74K.js";import{k as a,l as $}from"./chunk-DSVLWYIT.js";var O=4*(1024*2),v=async(p,E={})=>{let s=t=>{let e=new RegExp(`${t}\\s*[:=]\\s*(["'])(.*?)\\1(?=\\s*[,)]|\\s+\\w+\\s*[:=]|$)`,"s"),n=p.match(e);if(n)return n[2].trim();let o=new RegExp(`${t}\\s*[:=]\\s*([^,\\s)]+)`,"s"),r=p.match(o);return r?r[1].trim():null},R=s("action"),u=s("method"),c=s("content"),w=s("content-new"),S=s("content-old"),y=s("id"),d=s("chat-id")||E.chatId||E.sessionId||"default-session";if(R==="temp"){if(!c)return"ERROR: Missing 'content' for temp memory.";let t=M($,{});t[d]||(t[d]=[]),t[d].push(c),m($,t);let e=t[d].reduce((n,o)=>n+o.length,0);return`Temporary context saved for session [${d}]. (Size: ${e} chars)`}if(R==="user"){let t=M(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),`Memory added with ID [${h.id}] and score [${h.score}]. (Vault Size: ${i+o.length} chars)`}if(u==="update"){let e=y||S,n=w||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),`Memory [${e}] updated.`}if(u==="delete"){let e=y||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),`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{v as memory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=async(e,r={})=>"Screen recapture requested. The latest gridded screenshot is provided for your next decision.";export{t as recapture_screen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as n}from"./chunk-L3W2X74K.js";import{l as s,m as o}from"./chunk-DSVLWYIT.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),`
|
|
1
|
+
import{c as a,d as n}from"./chunk-L3W2X74K.js";import{l as s,m as o}from"./chunk-DSVLWYIT.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),`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 as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-7M3AFLUN.js";import"./chunk-KNCL7AK2.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 +1 @@
|
|
|
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(),`
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import{a as h}from"./chunk-FQBBOFNP.js";import{a as
|
|
1
|
+
import{a as h}from"./chunk-FQBBOFNP.js";import{a as C}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import{c as $}from"./chunk-DSVLWYIT.js";import l from"fs";import R from"path";var E=async(x,S={})=>{let{method:f,tasks:m,markDone:d}=C(x),A=S.chatId||"default";if(!f)return'ERROR: Missing "method" argument for Goal tool (create/append/get).';let u=R.join($,"plan",A),o=R.join(u,"todo.md"),W=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},k=t=>{let s=W(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
|
+
`:""},y=(t,s)=>{if(!s)return{content:t,markedCount:0};let i=W(s),n=(Array.isArray(i)?i:[i]).map(p=>String(p).replace(/^- \[[xX ]\]\s*/i,"").trim()).filter(Boolean),r=t.split(`
|
|
5
5
|
`),c=0,e=!1;for(let p of n){let g=!1;for(let a=0;a<r.length;a++)if(r[a].includes(p)&&/^- \[\s\]/.test(r[a].trim())){r[a]=r[a].replace("- [ ]","- [x]"),g=!0,e=!0,c++;break}if(!g){for(let a=0;a<r.length;a++)if(r[a].toLowerCase().includes(p.toLowerCase())&&/^- \[\s\]/.test(r[a].trim())){r[a]=r[a].replace("- [ ]","- [x]"),g=!0,e=!0,c++;break}}}return{content:e?r.join(`
|
|
6
|
-
`):t,markedCount:c}};try{if(l.existsSync(u)||l.mkdirSync(u,{recursive:!0}),f==="create"){if(!m)return'ERROR: Missing "tasks" for create method.';let t=
|
|
7
|
-
${t}`}return`
|
|
8
|
-
${t}`}if(f==="append"){if(!m)return'ERROR: Missing "tasks" for append method.';let t=
|
|
9
|
-
${s}`}if(f==="get"){if(!l.existsSync(o))return"Goal: No task list found for this session.";let t=l.readFileSync(o,"utf8"),s=0;if(d){let e=
|
|
10
|
-
${t}`}return`ERROR: Unknown method "${f}". Use create, append, or get.`}catch(t){return`ERROR: Goal failure: ${t instanceof Error?t.message:String(t)}`}};export{
|
|
6
|
+
`):t,markedCount:c}};try{if(l.existsSync(u)||l.mkdirSync(u,{recursive:!0}),f==="create"){if(!m)return'ERROR: Missing "tasks" for create method.';let t=k(m),s=0;if(d){let n=y(t,d);t=n.content,s=n.markedCount}await h.recordFileChange(o),l.writeFileSync(o,t,"utf8");let i=t.split(/\r?\n/).map(n=>n.trim()).filter(n=>n.startsWith("- [ ]")||n.startsWith("- [x]")||n.startsWith("- [X]")).length;if(s>0){let n=t.split(/\r?\n/).map(r=>r.trim()).filter(r=>r.startsWith("- [x]")||r.startsWith("- [X]")).length;return`Goal Created (${s} marked done, ${n} completed, ${i-n} left)
|
|
7
|
+
${t}`}return`Goal Created (${i} total)
|
|
8
|
+
${t}`}if(f==="append"){if(!m)return'ERROR: Missing "tasks" for append method.';let t=k(m);await h.recordFileChange(o),l.appendFileSync(o,t,"utf8");let s=l.readFileSync(o,"utf8"),i=s.split(/\r?\n/).map(e=>e.trim()),n=i.filter(e=>e.startsWith("- [ ]")||e.startsWith("- [x]")||e.startsWith("- [X]")).length,r=i.filter(e=>e.startsWith("- [x]")||e.startsWith("- [X]")).length,c=t.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.startsWith("- [ ]")||e.startsWith("- [x]")||e.startsWith("- [X]")).length;return`Goal Appended (${r} completed, ${n-r} left, ${c} added)
|
|
9
|
+
${s}`}if(f==="get"){if(!l.existsSync(o))return"Goal: No task list found for this session.";let t=l.readFileSync(o,"utf8"),s=0;if(d){let e=y(t,d);e.markedCount>0&&(t=e.content,s=e.markedCount,await h.recordFileChange(o),l.writeFileSync(o,t,"utf8"))}let i=t.split(/\r?\n/).map(e=>e.trim()),n=i.filter(e=>e.startsWith("- [ ]")||e.startsWith("- [x]")||e.startsWith("- [X]")).length,r=i.filter(e=>e.startsWith("- [x]")||e.startsWith("- [X]")).length;return`${s>0?`${s} Goal(s) Marked Done`:"Goal"}: ${r} Completed, ${n-r} left
|
|
10
|
+
${t}`}return`ERROR: Unknown method "${f}". Use create, append, or get.`}catch(t){return`ERROR: Goal failure: ${t instanceof Error?t.message:String(t)}`}};export{E as todo};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{g as h,h as m,i as R}from"./chunk-ZRP6USHC.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import c from"fs";import
|
|
1
|
+
import{g as h,h as m,i as R}from"./chunk-ZRP6USHC.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import c from"fs";import P from"path";var j=async(w,y={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:E,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 M=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":E,i=P.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=y.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
|
-
`),{content:u,results:l}=m(s,o,{allowMultiple:
|
|
3
|
+
`),{content:u,results:l}=m(s,o,{allowMultiple:M}),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
4
|
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
5
|
-
`)}`;await F.recordFileChange(i,s),c.writeFileSync(i,u,"utf8");let{systemSettings:
|
|
5
|
+
`)}`;await F.recordFileChange(i,s),c.writeFileSync(i,u,"utf8");let{systemSettings:C}=await g(),d=R(s,u,l,12,C?.compressToolResults);return a.length>0?`File [${t}] updated with some blocks failed. [${f.length}/${o.length}] blocks applied.
|
|
6
6
|
|
|
7
7
|
Failures:
|
|
8
8
|
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
9
9
|
`)}
|
|
10
10
|
|
|
11
|
-
${d}`:`
|
|
11
|
+
${d}`:`File [${t}] updated. [${l.length}/${o.length}] blocks applied.
|
|
12
12
|
|
|
13
|
-
${d}`}catch(e){let s=e instanceof Error?e.message:String(e);return`ERROR: Failed to update file [${t}]: ${s}`}};export{
|
|
13
|
+
${d}`}catch(e){let s=e instanceof Error?e.message:String(e);return`ERROR: Failed to update file [${t}]: ${s}`}};export{j as update_file};
|
|
@@ -9,5 +9,5 @@ import{a as l}from"./chunk-FQBBOFNP.js";import{a as s}from"./chunk-Y5JU726N.js";
|
|
|
9
9
|
${r}
|
|
10
10
|
</body>
|
|
11
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),`
|
|
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
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,6 +1,6 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S}from"./chunk-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import{a as R}from"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import r from"fs";import F from"path";var B=async(v,E={})=>{let{path:s,content:o}=y(v);if(!s)return'ERROR: Missing "path" argument for WriteFile.';if(o===void 0)return'ERROR: Missing "content" argument for WriteFile.';o=o.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
|
-
`);let t=
|
|
3
|
+
`);let t=F.resolve(process.cwd(),s),m=F.dirname(t);try{await S.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(`
|
|
5
5
|
`)}
|
|
6
6
|
|
|
@@ -10,15 +10,15 @@ ${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|
|
|
10
10
|
`).replace(/\r/g,`
|
|
11
11
|
`))(o),l=p.endsWith(`
|
|
12
12
|
`)?p:p+`
|
|
13
|
-
`,L=l.split(/\r?\n/).length,
|
|
13
|
+
`,L=l.split(/\r?\n/).length,C=Buffer.byteLength(l,"utf8");r.writeFileSync(t,l,"utf8");let c=r.readFileSync(t,"utf8"),$=Buffer.byteLength(c,"utf8"),i=c.split(/\r?\n/),a=i.length;if($===0&&C>0)return c=null,`ERROR: CRITICAL FAILURE: Verification failed. File [${s}] is empty on disk!`;let d="";if(a<=100)d=i.join(`
|
|
14
14
|
`);else{let e=i.slice(0,50).join(`
|
|
15
15
|
`),f=i.slice(-50).join(`
|
|
16
16
|
`);d=`${e}
|
|
17
17
|
|
|
18
18
|
... [${a-100} lines truncated] ...
|
|
19
19
|
|
|
20
|
-
${f}`}c=null;let{systemSettings:w}=await
|
|
21
|
-
- Stats: [${a} lines, ${(
|
|
20
|
+
${f}`}c=null;let{systemSettings:w}=await R(),u=`File [${s}] saved.
|
|
21
|
+
- Stats: [${a} lines, ${($/1024).toFixed(1)} KB]
|
|
22
22
|
${n}- Content Preview:
|
|
23
23
|
|
|
24
24
|
${d}`;if(w?.compressToolResults&&a>60){let e=l.split(/\r?\n/),f=e.slice(0,25).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import
|
|
1
|
+
import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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
2
|
<style>
|
|
3
3
|
@page {
|
|
4
4
|
margin: ${c};
|
|
@@ -28,4 +28,4 @@ import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-FQBBOFNP.js";
|
|
|
28
28
|
</style>
|
|
29
29
|
<div class="watermark">Generated by FluxFlow CLI (AI)</div>
|
|
30
30
|
${a}
|
|
31
|
-
`;await w.setContent(E,{waitUntil:"networkidle0",timeout:18e4});let
|
|
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};
|
package/dist/cli.js
CHANGED
|
@@ -66,19 +66,19 @@ Usage: fluxflow --export error`),process.exit(1)}if(Q&&(console.log(`v${n}`),pro
|
|
|
66
66
|
/docs View documentation
|
|
67
67
|
/fluxflow init Create FluxFlow.md template
|
|
68
68
|
/update check Check for new version
|
|
69
|
-
/update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-KKYNW25D.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-
|
|
69
|
+
/update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-KKYNW25D.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-Y37LX2LT.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
|
|
70
70
|
${a}
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-
|
|
73
|
+
Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-THB36X3Y.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
|
|
74
74
|
${n}
|
|
75
75
|
---
|
|
76
76
|
|
|
77
|
-
${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin)e.push(w);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:w}=await import("./chunks/exec_command-
|
|
77
|
+
${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin)e.push(w);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:w}=await import("./chunks/exec_command-THB36X3Y.js");a=w(a).trim(),r?r=`Stdin Context:
|
|
78
78
|
${a}
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-KKYNW25D.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-LPVNWDTB.js"),{getDefaultModel:l}=await import("./chunks/model_config-M24OEKJE.js"),{generateSimpleContent:c}=await import("./chunks/ai-
|
|
81
|
+
${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-KKYNW25D.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-LPVNWDTB.js"),{getDefaultModel:l}=await import("./chunks/model_config-M24OEKJE.js"),{generateSimpleContent:c}=await import("./chunks/ai-3LFDECBF.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-VLICZGBC.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
82
82
|
Use NO markdown, only plain text
|
|
83
83
|
Additional Context:
|
|
84
84
|
- OS: ${W}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-56EJGQU3.js";import{a as i}from"./chunk-Y5JU726N.js";var w=async(g,a={})=>{let t=i(g),e=t.id,r=t.answer||t.response;if(!e)return'ERROR: Missing "id" argument for Answer.';if(!r)return'ERROR: Missing "answer" argument for Answer.';let s=u.find(n=>n.id===e);if(!s)return`ERROR: Subagent task with ID [${e}] not found.`;if(!s.questions||s.questions.length===0)return`INFO: Subagent task [${e}] has no pending questions.`;let o=s.questions.filter(n=>!n.answered);return o.length===0?`INFO: Subagent task [${e}] has no unanswered questions.`:(o.forEach(n=>{n.answered=!0,n.answer=r,n.answeredAt=Date.now(),n._resolve&&n._resolve(r)}),s.status="running",a.onSubagentUpdate&&a.onSubagentUpdate(),`SUCCESS: Answer provided to subagent task [${e}]. Subagent execution resumed.`)};export{w as answerSubagent};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-56EJGQU3.js";import{a as i}from"./chunk-Y5JU726N.js";var d=async(u,c={})=>{let a=i(u),e=a.id,r=parseInt(a.timeout||a.time||"120",10);if((isNaN(r)||r<=0)&&(r=120),r>300&&(r=300),!e)return a.time?(await new Promise(n=>setTimeout(n,r*1e3)),`SUCCESS: Waited for ${r}s.`):'ERROR: Missing "id" argument for Await.';let t=o.find(n=>n.id===e);if(!t)return`ERROR: Subagent task with ID [${e}] not found.`;if(t.status==="completed")return`SUCCESS: Subagent task [${e}] completed.
|
|
2
|
-
Final Answer:
|
|
3
|
-
${t.finalAnswer||"(No output)"}`;if(t.status==="failed")return`ERROR: Subagent task [${e}] failed.
|
|
4
|
-
Error: ${t.error||"Unknown error"}`;if(t.status==="cancelled")return`INFO: Subagent task [${e}] was cancelled.`;let s,l=new Promise(n=>{s=setTimeout(()=>{n({type:"timeout"})},r*1e3)});try{let n=await Promise.race([t.completionPromise.then(()=>({type:"completion"})),l]);return clearTimeout(s),n.type==="timeout"?`TIMEOUT: Subagent task [${e}] is still running (status: ${t.status.toUpperCase()}) after ${r}s. You can continue other work or call Await again.`:t.status==="completed"?`SUCCESS: Subagent task [${e}] completed.
|
|
5
|
-
Final Answer:
|
|
6
|
-
${t.finalAnswer||"(No output)"}`:t.status==="failed"?`ERROR: Subagent task [${e}] failed.
|
|
7
|
-
Error: ${t.error||"Unknown error"}`:t.status==="cancelled"?`INFO: Subagent task [${e}] was cancelled.`:`INFO: Subagent task [${e}] status changed to ${t.status.toUpperCase()}.`}catch(n){return clearTimeout(s),`ERROR: Exception while awaiting subagent [${e}]: ${n.message}`}};export{d as awaitSubagent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-56EJGQU3.js";import{a as s}from"./chunk-Y5JU726N.js";var o=async(r,e={})=>{let t=s(r).id;if(!t)return'ERROR: Missing "id" argument for cancel.';let a=n.find(i=>i.id===t);return a?a.status==="completed"||a.status==="failed"?`INFO: Subagent task with ID [${t}] has already finished with status [${a.status.toUpperCase()}].`:a.status==="cancelled"?`INFO: Subagent task with ID [${t}] is already cancelled.`:(a.status="cancelled",e.onSubagentUpdate&&e.onSubagentUpdate(),`SUCCESS: Subagent task with ID [${t}] has been cancelled.`):`ERROR: Subagent task with ID [${t}] not found.`};export{o as cancel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as f}from"./chunk-KNCL7AK2.js";import{mouse as c,keyboard as i,Button as u,Key as e,Point as l,clipboard as R}from"@nut-tree-fork/nut-js";c.config.autoDelayMs=50;i.config.autoDelayMs=50;async function w(){try{await i.releaseKey(e.LeftControl,e.RightControl,e.LeftAlt,e.RightAlt,e.LeftShift,e.RightShift,e.LeftSuper,e.RightSuper)}catch{}}async function E(n,t,s={}){let r=await f(t);if(!r&&(n==="move"||n==="click"||n==="drag"))return`ERROR: Invalid target location specified: ${JSON.stringify(t)}`;try{switch(n.toLowerCase()){case"move":return await c.setPosition(new l(r.x,r.y)),`SUCCESS: Moved mouse to grid target ${typeof t=="string"?t:`(${r.x}, ${r.y})`}`;case"click":{await c.setPosition(new l(r.x,r.y));let a=s.button==="right"?u.RIGHT:s.button==="middle"?u.MIDDLE:u.LEFT;return s.clickType==="double"?await c.doubleClick(a):await c.click(a),`SUCCESS: ${s.clickType||"Single"} clicked ${s.button||"left"} button at ${typeof t=="string"?t:`(${r.x}, ${r.y})`}`}case"drag":{let a=await f(s.from||t),o=await f(s.to);return!a||!o?'ERROR: Drag requires valid "from" and "to" target coordinates/grid codes.':(await c.setPosition(new l(a.x,a.y)),await c.pressButton(u.LEFT),await c.setPosition(new l(o.x,o.y)),await c.releaseButton(u.LEFT),`SUCCESS: Dragged mouse from (${a.x}, ${a.y}) to (${o.x}, ${o.y})`)}case"scroll":{let a=r||await f({x:640,y:360});a&&(await c.setPosition(new l(a.x,a.y)),await new Promise(d=>setTimeout(d,60)));let o=parseInt(s.amount,10);(isNaN(o)||o<=0)&&(o=5);let y=o>50?Math.min(20,Math.max(1,Math.round(o/100))):Math.min(20,o),S=s.direction==="up";for(let d=0;d<y;d++)S?await c.scrollUp(120):await c.scrollDown(120),await new Promise(C=>setTimeout(C,20));return`SUCCESS: Scrolled ${s.direction||"down"} (${y} notches${r?` at target (${r.x}, ${r.y})`:" at screen center"})`}default:return`ERROR: Unsupported mouse action "${n}"`}}catch(a){return`ERROR: Mouse action failed: ${a.message}`}}var m={enter:e.Enter,return:e.Return,escape:e.Escape,esc:e.Escape,backspace:e.Backspace,tab:e.Tab,space:e.Space,up:e.Up,down:e.Down,left:e.Left,right:e.Right,ctrl:e.LeftControl,control:e.LeftControl,alt:e.LeftAlt,shift:e.LeftShift,cmd:e.LeftCmd,win:e.LeftWin,meta:e.LeftWin,super:e.LeftSuper,a:e.A,b:e.B,c:e.C,d:e.D,e:e.E,f:e.F,g:e.G,h:e.H,i:e.I,j:e.J,k:e.K,l:e.L,m:e.M,n:e.N,o:e.O,p:e.P,q:e.Q,r:e.R,s:e.S,t:e.T,u:e.U,v:e.V,w:e.W,x:e.X,y:e.Y,z:e.Z,0:e.Num0,1:e.Num1,2:e.Num2,3:e.Num3,4:e.Num4,5:e.Num5,6:e.Num6,7:e.Num7,8:e.Num8,9:e.Num9,f1:e.F1,f2:e.F2,f3:e.F3,f4:e.F4,f5:e.F5,f6:e.F6,f7:e.F7,f8:e.F8,f9:e.F9,f10:e.F10,f11:e.F11,f12:e.F12},p=n=>{if(!n)return;let t=String(n).toLowerCase().trim();if(m[t]!==void 0)return m[t];if(e[n]!==void 0)return e[n];if(e[t.toUpperCase()]!==void 0)return e[t.toUpperCase()]};async function $(n,t,s={}){try{switch(n.toLowerCase()){case"type":{if(typeof t!="string")return"ERROR: Type action requires a valid string input";await w(),await R.setContent(t);let a=process.platform==="darwin"?e.LeftSuper:e.LeftControl;return await i.pressKey(a,e.V),await i.releaseKey(a,e.V),await w(),s.autoPressEnter?(await new Promise(o=>setTimeout(o,50)),await i.type(e.Enter),`SUCCESS: Typed text input ("${t.length>20?t.substring(0,20)+"...":t}") and pressed Enter`):`SUCCESS: Typed text input ("${t.length>20?t.substring(0,20)+"...":t}")`}case"key_press":{let r=p(t);return r===void 0?`ERROR: Unknown key name "${t}"`:(await i.type(r),`SUCCESS: Pressed key ${t}`)}case"key_combination":{if(!Array.isArray(t))return'ERROR: key_combination requires an array of keys (e.g. ["ctrl", "c"])';let r=t.map(a=>p(a)).filter(a=>a!==void 0);return r.length===0?"ERROR: Invalid key combination":(await i.pressKey(...r),await i.releaseKey(...r),`SUCCESS: Executed key combination [${t.join(" + ")}]`)}case"clear_input":return await i.pressKey(e.LeftControl,e.A),await i.releaseKey(e.LeftControl,e.A),await i.type(e.Backspace),"SUCCESS: Cleared active text input (Select All + Backspace)";case"browser_back":{let r=process.platform==="darwin";return r?(await i.pressKey(e.LeftSuper,e.Left),await i.releaseKey(e.LeftSuper,e.Left)):(await i.pressKey(e.LeftAlt,e.Left),await i.releaseKey(e.LeftAlt,e.Left)),await w(),`SUCCESS: Browser back navigation (${r?"Cmd+Left":"Alt+Left"})`}default:return`ERROR: Unsupported keyboard action "${n}"`}}catch(r){return`ERROR: Keyboard action failed: ${r.message}`}}export{E as a,$ as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as E,d as m}from"./chunk-L3W2X74K.js";import{k as a,l as S}from"./chunk-DSVLWYIT.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=async(e,r={})=>"SUCCESS: Screen recapture requested. The latest gridded screenshot is provided for your next decision.";export{t as recapture_screen};
|