fluxflow-cli 5.0.1 → 5.2.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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{9router-LRFKCJF4.js → 9router-KRJQK6JP.js} +1 -1
  3. package/dist/chunks/{addMemScore-PBVNSFPN.js → addMemScore-VUSJ2Q64.js} +1 -1
  4. package/dist/chunks/ai-W4ZXBMB4.js +1 -0
  5. package/dist/chunks/{aihubmix-TETL5QYQ.js → aihubmix-KJIG7CZO.js} +1 -1
  6. package/dist/chunks/{apinex-FAYOPQSL.js → apinex-EP3JJPZO.js} +1 -1
  7. package/dist/chunks/app-THKSHPL7.js +331 -0
  8. package/dist/chunks/{auto_completion-UG6IEWD2.js → auto_completion-CJNBFI3A.js} +1 -1
  9. package/dist/chunks/{chat-ISCVWNVN.js → chat-OYRESDTX.js} +1 -1
  10. package/dist/chunks/{chunk-QESQR5GB.js → chunk-3BRTFYTA.js} +1 -1
  11. package/dist/chunks/{chunk-GBH7XI5A.js → chunk-7UF7ZHP7.js} +1 -1
  12. package/dist/chunks/{chunk-52STSLCN.js → chunk-BLAXTPPN.js} +1 -1
  13. package/dist/chunks/{chunk-V36DXF56.js → chunk-DVXSU3Z4.js} +1 -1
  14. package/dist/chunks/{chunk-IHDJDAG3.js → chunk-E5CFO23P.js} +1 -1
  15. package/dist/chunks/{chunk-ZNO55RNG.js → chunk-FOELTIXU.js} +1 -1
  16. package/dist/chunks/chunk-HGDSONY3.js +885 -0
  17. package/dist/chunks/{chunk-LQM3JK7N.js → chunk-I5LTKU2O.js} +1 -1
  18. package/dist/chunks/{chunk-6EYQQ7GQ.js → chunk-KOCMIEPK.js} +1 -1
  19. package/dist/chunks/{chunk-7SGZ66KT.js → chunk-KSP6QOQX.js} +28 -28
  20. package/dist/chunks/{chunk-B4UKMX5E.js → chunk-KZCVQBDK.js} +1 -1
  21. package/dist/chunks/chunk-L22YGL6T.js +15 -0
  22. package/dist/chunks/{chunk-P5HBJA23.js → chunk-NTZSL2UT.js} +1 -1
  23. package/dist/chunks/{chunk-EXT42EJZ.js → chunk-QVRPR3DJ.js} +1 -1
  24. package/dist/chunks/{chunk-J4J3F6BT.js → chunk-WEDUYGPN.js} +1 -1
  25. package/dist/chunks/{chunk-HFTI3R3Q.js → chunk-XPIXBWTZ.js} +1 -1
  26. package/dist/chunks/chunk-YFIWMGCS.js +2 -0
  27. package/dist/chunks/{click-AWHZCV2E.js → click-ES2QYPC4.js} +2 -2
  28. package/dist/chunks/{computer_action-MO2JR2XH.js → computer_action-KUJCPYPN.js} +1 -1
  29. package/dist/chunks/{custom_openai-K554R7Q5.js → custom_openai-ETCGLBV4.js} +1 -1
  30. package/dist/chunks/{deepseek-WNWZJTNE.js → deepseek-I2J4A7WQ.js} +1 -1
  31. package/dist/chunks/{drag-D2GVPIQB.js → drag-U3DNSM33.js} +1 -1
  32. package/dist/chunks/{emergency_rollback-ZHQXCIHW.js → emergency_rollback-LC4ZBOLP.js} +1 -1
  33. package/dist/chunks/{explabs-XHHXTERB.js → explabs-OYP64XS6.js} +1 -1
  34. package/dist/chunks/{export-RU6LCZUB.js → export-I5DB7ESY.js} +1 -1
  35. package/dist/chunks/{file_map-UA4BA5OH.js → file_map-K6JQYV35.js} +1 -1
  36. package/dist/chunks/find_file-5RUNVQJO.js +4 -0
  37. package/dist/chunks/{generate_image-45UQ6P2B.js → generate_image-OOU2MEIQ.js} +1 -1
  38. package/dist/chunks/{inferx-HP5AGET3.js → inferx-B6PKXWLZ.js} +1 -1
  39. package/dist/chunks/{infron-ULXG7VDA.js → infron-4SLX3HMD.js} +1 -1
  40. package/dist/chunks/{invoke-DVZUJJV3.js → invoke-DPVPIREI.js} +2 -2
  41. package/dist/chunks/{invokeSync-NEZGW27B.js → invokeSync-Z2OWSYC7.js} +2 -2
  42. package/dist/chunks/{key_press-AQNKL6UM.js → key_press-5T4RCRQQ.js} +1 -1
  43. package/dist/chunks/{keyboard_typing-QSBPTZJ6.js → keyboard_typing-Y2OBDZDW.js} +1 -1
  44. package/dist/chunks/{memory-7YOYCOXE.js → memory-AT7ARTG3.js} +1 -1
  45. package/dist/chunks/{mistral-ON6RQMK7.js → mistral-QQGMQJ2O.js} +1 -1
  46. package/dist/chunks/{model_config-QRYAVWHF.js → model_config-J4YX2PNQ.js} +1 -1
  47. package/dist/chunks/{nvidia-I6DPWP6U.js → nvidia-6VK5M5FB.js} +1 -1
  48. package/dist/chunks/{ollama-6WSZPCI5.js → ollama-YTQ5HFES.js} +1 -1
  49. package/dist/chunks/{openrouter-6MRG4RT6.js → openrouter-LSG67TST.js} +1 -1
  50. package/dist/chunks/paths-MJECGRI2.js +1 -0
  51. package/dist/chunks/{poolside-ODFAIK4C.js → poolside-KWCBEP3P.js} +1 -1
  52. package/dist/chunks/read_folder-UWFC5DNX.js +17 -0
  53. package/dist/chunks/{recapture_screen-PPXYK2YY.js → recapture_screen-CQ3Z5FOL.js} +1 -1
  54. package/dist/chunks/{saveSummary-W2JMDVZJ.js → saveSummary-ZJDPCZSR.js} +1 -1
  55. package/dist/chunks/{screen_grid-3RU324CV.js → screen_grid-I6BDQFDD.js} +1 -1
  56. package/dist/chunks/{scroll-TSU6MTGU.js → scroll-SFUGXJQR.js} +1 -1
  57. package/dist/chunks/search_keyword-HR6JNLS2.js +9 -0
  58. package/dist/chunks/{secrets-TNMLVMST.js → secrets-DQHR2CI2.js} +1 -1
  59. package/dist/chunks/{secrets_v2-OBRWR3UT.js → secrets_v2-7RG5NKVT.js} +1 -1
  60. package/dist/chunks/{sensenova-3K44URJQ.js → sensenova-MLFZTP7U.js} +1 -1
  61. package/dist/chunks/settings-XJ2SOAWE.js +1 -0
  62. package/dist/chunks/{todo-CJLWLWJB.js → todo-YFLPXYFL.js} +1 -1
  63. package/dist/chunks/{tokenharbor-YV2GV2LM.js → tokenharbor-Y6HSTTHA.js} +1 -1
  64. package/dist/chunks/update_file-BN6X5WNO.js +15 -0
  65. package/dist/chunks/{usage-EBE2OVES.js → usage-BCL4OUAK.js} +1 -1
  66. package/dist/chunks/{usageServer-RTK5N5KE.js → usageServer-FIH6WL3V.js} +1 -1
  67. package/dist/chunks/view_file-OYV2IEYG.js +1 -0
  68. package/dist/chunks/{web_scrape-J3PL2PXT.js → web_scrape-MVSCRDKO.js} +1 -1
  69. package/dist/chunks/{web_search-KBGH67IV.js → web_search-C3WKDOSZ.js} +1 -1
  70. package/dist/chunks/{write_docx-E3MTFXTQ.js → write_docx-QGW25TF7.js} +1 -1
  71. package/dist/chunks/write_file-Q4K4LZFU.js +34 -0
  72. package/dist/chunks/{write_pdf-TPGUF4VT.js → write_pdf-5HOQYVQO.js} +1 -1
  73. package/dist/chunks/{xkiro-B2LYGZTF.js → xkiro-D3DTPVWY.js} +1 -1
  74. package/dist/cli.js +6 -6
  75. package/dist/package.json +2 -2
  76. package/package.json +2 -2
  77. package/dist/chunks/ai-WBRHU7IH.js +0 -1
  78. package/dist/chunks/app-YYK3S5Y5.js +0 -325
  79. package/dist/chunks/chunk-24LJKH4G.js +0 -847
  80. package/dist/chunks/chunk-26BQ45XP.js +0 -2
  81. package/dist/chunks/chunk-4BLSASW6.js +0 -13
  82. package/dist/chunks/find_file-HYHHFHUJ.js +0 -4
  83. package/dist/chunks/paths-RQRI2XRY.js +0 -1
  84. package/dist/chunks/read_folder-EI2CNHNS.js +0 -15
  85. package/dist/chunks/search_keyword-DZY4MWV7.js +0 -8
  86. package/dist/chunks/settings-PUFSRWT3.js +0 -1
  87. package/dist/chunks/update_file-TGEB5UWK.js +0 -13
  88. package/dist/chunks/view_file-I77KYUO5.js +0 -1
  89. package/dist/chunks/write_file-O6OF7Z2W.js +0 -32
@@ -1,2 +0,0 @@
1
- import E from"os";import e from"path";import l from"fs";import d from"crypto";import{minimatch as h}from"minimatch";var u=e.join(E.homedir(),".fluxflow"),x=e.join(u,"settings.json"),_=null;try{if(l.existsSync(x)){let a=l.readFileSync(x,"utf8").trim(),c;if(a.startsWith("{"))c=JSON.parse(a);else{let s=a.split(":");if(s.length===2){let t=Buffer.from(s[0],"hex"),f=s[1],i=null;try{let n=e.join(u,".token");if(l.existsSync(n)){let o=l.readFileSync(n,"utf8").trim();if(o){let m=d.createHash("sha256").update(o).digest(),p=d.createDecipheriv("aes-256-cbc",m,t);i=p.update(f,"hex","utf8")+p.final("utf8")}}}catch{}if(!i)try{let n=d.createHash("sha256").update("fluxflow-cli-sanctuary-key").digest(),o=d.createDecipheriv("aes-256-cbc",n,t);i=o.update(f,"hex","utf8")+o.final("utf8")}catch{}i&&(c=JSON.parse(i))}}if(c){let s=c.systemSettings||{};s.useExternalData&&s.externalDataPath&&(_=e.normalize(s.externalDataPath.trim()))}}}catch{}var g=_||u,L=e.join(g,"logs"),r=e.join(g,"secret"),v=e.join(r,"history.json"),C=e.join(r,"history"),b=e.join(u,"usage.json"),F=e.join(r,"usage.json"),T=e.join(r,"timed_usage"),k=e.join(r,"memories.json"),A=e.join(r,"memory-temp.json"),R=e.join(r,"temp-memory-chat.json"),w=e.join(g,"backups"),O=e.join(r,"ledger.json"),W=e.join(r,"ledgerAdvance.json"),N=e.join(r,"active_tx.json"),P=e.join(r,"path.json"),G=e.join(r,"context.json"),M=e.join(g,"parsers"),B=e.join(u,".cache","CU"),U=e.join(u,"thinking_config.json"),$=[".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"],H=(a=process.cwd())=>{try{let c=e.join(a,".gitignore");if(l.existsSync(c))return l.readFileSync(c,"utf8").split(`
2
- `).map(t=>t.trim()).filter(t=>t&&!t.startsWith("#")&&!t.startsWith("!")).map(t=>t.replace(/^[\/\\]+/,"").replace(/[\/\\]+$/,"").replace(/\/\*+$/,"")).filter(Boolean)}catch{}return[]},z=(a,c)=>{if(!a||!c)return!1;let s=a.replace(/\\/g,"/"),t=e.basename(a),f=c.split(",").map(n=>n.trim()).filter(Boolean),i=null;try{let n=typeof h<"u"?h:null;n&&(i=n)}catch{}for(let n of f){let o=n.replace(/\\/g,"/");if(t.toLowerCase()===o.toLowerCase()||s.toLowerCase()===o.toLowerCase()||s.toLowerCase().endsWith("/"+o.toLowerCase()))return!0;try{if(i&&(i(s,o,{dot:!0,nocase:!0,matchBase:!0})||i(t,o,{dot:!0,nocase:!0})))return!0}catch{}if(o.includes("*")||o.includes("?")){let m="^"+o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,".")+"$";try{let p=new RegExp(m,"i");if(p.test(t)||p.test(s))return!0}catch{}}}return!1};export{u as a,x as b,g as c,L as d,r as e,v as f,C as g,b as h,F as i,T as j,k,A as l,R as m,w as n,O as o,W as p,N as q,P as r,G as s,M as t,B as u,U as v,$ as w,H as x,z as y};
@@ -1,13 +0,0 @@
1
- import{a as T}from"./chunk-Y5JU726N.js";import{a as I}from"./chunk-26BQ45XP.js";import s from"fs";import g from"path";var X=i=>{if(!i)return null;let o=i.match(/^\s*---\r?\n([\s\S]*?)\r?\n---(?:\r?\n)?([\s\S]*)$/);if(!o)return null;let e=o[1];if((o[2]||"").trim().length===0)return null;let r="",a=e.match(/^name:\s*(.+)$/m);return a&&(r=a[1].trim().replace(/^["']|["']$/g,"")),r?{name:r}:null},Y=i=>{let o=[];if(!i||!s.existsSync(i))return o;let e=(u,r=0)=>{if(!(r>5))try{let a=s.readdirSync(u,{withFileTypes:!0});for(let n of a){let c=g.join(u,n.name),f=n.name.toLowerCase();n.isFile()?f==="skill.md"&&o.push(c):n.isDirectory()&&(r===0?(f==="skills"||f===".skills"||f==="skill"||f===".skill")&&e(c,r+1):e(c,r+1))}}catch{}};return e(i,0),o},q=i=>i.replace(/^\s*---\r?\n[\s\S]*?\r?\n---\s*(\r?\n)?/,""),U=(i,o)=>{if(!o)return null;let e=g.join(i,o);if(s.existsSync(e))try{if(s.statSync(e).isFile())return e}catch{}if(!o.toLowerCase().endsWith(".md")){let n=g.join(i,`${o}.md`);if(s.existsSync(n))try{if(s.statSync(n).isFile())return n}catch{}}let u=o.replace(/\\/g,"/").split("/").filter(Boolean),r=i,a=!0;for(let n=0;n<u.length;n++){let c=u[n].toLowerCase(),f=n===u.length-1;try{if(!s.existsSync(r)||!s.statSync(r).isDirectory()){a=!1;break}let F=s.readdirSync(r).find(M=>{let R=M.toLowerCase();return!!(R===c||f&&!c.endsWith(".md")&&R===`${c}.md`)});if(!F){a=!1;break}let $=g.join(r,F);if(f){if(s.statSync($).isFile())return $;a=!1}else r=$}catch{a=!1;break}}if(u.length===1){let n=u[0],c=["references","reference","scripts","script","examples","example","resources","resource"];for(let f of c){let y=g.join(i,f);if(s.existsSync(y)){let F=U(y,n);if(F)return F}}}return null},Q=async(i,o={})=>{let{path:e,StartLine:u,EndLine:r,start_line:a,end_line:n,startLine:c,endLine:f}=T(i),y=parseInt(u||a||c),F=parseInt(r||n||f),$=!isNaN(y),M=!isNaN(F),R=y||1,N=F||(y?y+800:800);if(!e)return'ERROR: Missing "path" argument for ReadFile.';if(e.trim().toLowerCase().startsWith("#skill")){let d=e.trim().replace(/\\/g,"/").replace(/^#skills?\/?/i,"").split("/").filter(Boolean),C=null,p="",m="";if(d[0]?.toLowerCase()==="global"||d[0]?.toLowerCase()==="project"?(C=d[0].toLowerCase(),p=d[1],m=d.slice(2).join("/")):(p=d[0],m=d.slice(1).join("/")),!p)return`ERROR: Missing skill name in path [${e}].`;let k=t=>{let l=Y(t);for(let h of l)try{let x=s.readFileSync(h,"utf8"),L=X(x),D=g.basename(g.dirname(h)).toLowerCase();if(L?.name&&L.name.toLowerCase()===p.toLowerCase()||D===p.toLowerCase()||h.toLowerCase()===g.join(t,"skill.md").toLowerCase()&&p.toLowerCase()==="skill")return h}catch{}return null},w=null,b=!1;if(C){let t=C==="global"?I:process.cwd();w=k(t)}else{let t=k(process.cwd()),l=k(I);t&&l&&(b=!0),w=t||l}if(!w)return`No '${p}' exist in given scope.`;let E=g.dirname(w),j=w,v=!0;if(m){let t=U(E,m);if(!t)return`No such file or reference '${m}' exist for skill '${p}'. It could be standard file path?`;j=t,v=!1}try{let t=s.readFileSync(j,"utf8");t.startsWith("\uFEFF")&&(t=t.slice(1)),t=t.replace(/\r\n/g,`
2
- `).replace(/\r/g,`
3
- `),v&&(t=q(t));let l=t.split(`
4
- `),h=l.length,x=$?Math.max(0,R-1):0,L=M?Math.min(h,N):h,D=l.slice(x,L),P=e.replace(/\\/g,"/").toLowerCase(),W=P.includes("#skill/global/fluxflow")||P.includes("#skills/global/fluxflow"),_=b?` (Found ${e} in both global & project scope. Loaded [project] as default fallback. Use '#skills/global/...' if needed global)`:"",B=`${W?"DOCs":"Skill"}: [${e.replace(/\\/g,"/")}]${_}`,z=D.map(A=>A.trimEnd()).join(`
5
- `);return`${B}
6
-
7
- ${z}`}catch(t){let l=t instanceof Error?t.message:String(t);return`ERROR: Failed to read skill file [${e}]: ${l}`}}try{let S=g.resolve(process.cwd(),e);if(!s.existsSync(S))return`ERROR: File [${e}] does not exist.`;if(s.statSync(S).isDirectory())return`ERROR: Path [${e}] is a directory. Use ReadFolder instead.`;let d=g.extname(e).toLowerCase();if([".mp4",".mkv",".avi",".mov",".webm",".flv",".wmv",".mpeg",".mpg"].includes(d))return`ERROR: Unable to read. Type ${d.slice(1).toUpperCase()} not supported`;let p={".pdf":"application/pdf",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc":"application/msword"};if(p[d]){if(!(o.isMultiModal!==!1))return`ERROR: Multimodality is not supported for the current model. Unable to load [${e}].`;let x=s.readFileSync(S).toString("base64"),L=p[d];return{text:`[BINARY FILE]: ${e} (${L}) - Loaded as multimodal part.`,binaryPart:{inlineData:{data:x,mimeType:L}}}}let m=s.readFileSync(S,"utf8");m.startsWith("\uFEFF")&&(m=m.slice(1)),m=m.replace(/\r\n/g,`
8
- `).replace(/\r/g,`
9
- `);let k=m.split(`
10
- `),w=k.length;!$&&!M&&w>800&&(R=1,N=50);let b=Math.max(0,R-1),E=Math.min(w,N),j=k.slice(b,E),v=`File: [${e}] (Showing lines ${b+1}-${E} of ${w}).`,t=j.map((l,h)=>`${String(b+h+1).padStart(4)}: ${l.trimEnd()}`).join(`
11
- `);return`${v}
12
-
13
- ${t}`}catch(S){let O=S instanceof Error?S.message:String(S);return`ERROR: Failed to read file [${e}]: ${O}`}};export{Q as a};
@@ -1,4 +0,0 @@
1
- import{a as E}from"./chunk-Y5JU726N.js";import{w as F,x as S}from"./chunk-26BQ45XP.js";import W from"fs/promises";import y from"path";function R(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=R(n),t=R(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 x(n,e,o=n,t=1,i=15){if(t>i)return[];let r;try{r=await W.readdir(n,{withFileTypes:!0})}catch{return[]}let l=[];for(let a of r){if(e.has(a.name))continue;let u=y.join(n,a.name);if(a.isDirectory()){let m=await x(u,e,o,t+1,i);l.push(...m)}else{let m=y.relative(o,u).replace(/\\/g,"/");l.push({name:a.name,relPath:`./${m}`})}}return l}var O=async n=>{let e=typeof n=="object"&&n!==null?n:E(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,u=process.cwd(),m=new Set([...F,...S(u)]);try{let f=await x(u,m,u),g=[];for(let s of f){let h=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(h===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(h.includes(r)||d.includes(r))c=.7+r.length/Math.max(h.length,r.length)*.15;else{let C=w(r,h),q=w(r,P),M=w(r,d),L=Math.max(C,q,M);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}"`;g.sort((s,h)=>h.score-s.score||s.relPath.length-h.relPath.length);let $=Array.from(new Set(g.map(s=>s.relPath))),b=$.length;return`${`Found ${b} file${b===1?"":"s"} matching "${t}":
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,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunk-26BQ45XP.js";export{q as ACTIVE_TX_FILE,n as BACKUPS_DIR,s as CONTEXT_FILE,u as CU_CACHE_DIR,c as DATA_DIR,w as DEFAULT_EXCLUDES,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,x as getGitignoreExcludes,y as matchesPathPattern};
@@ -1,15 +0,0 @@
1
- import{a as T}from"./chunk-Y5JU726N.js";import m from"fs";import R from"path";var A=new Set([".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",".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",".skills","skills"]),C=i=>A.has(i)||i.startsWith(".pnpm"),I=i=>{try{let n=String(i.getMonth()+1).padStart(2,"0"),a=String(i.getDate()).padStart(2,"0"),o=String(i.getHours()).padStart(2,"0"),s=String(i.getMinutes()).padStart(2,"0");return`${n}-${a} ${o}:${s}`}catch{return"N/A"}},M=async i=>{let n=T(i),a=n.path||null;if(!a)return"ERROR: No directory path provided.";if(a.trim().toLowerCase().startsWith("#skills"))return"ERROR: '#skill' is reserved VFS namespace, not folder. Use 'ReadFile' to read specific skills.";let o=1;if(n.recurse!==void 0&&n.recurse!==null)if(typeof n.recurse=="number")o=n.recurse;else if(typeof n.recurse=="boolean")o=n.recurse?2:1;else{let s=parseInt(String(n.recurse).trim(),10);o=isNaN(s)?1:s}o=Math.max(1,Math.min(3,o));try{let s=R.resolve(process.cwd(),a);if(!m.existsSync(s))return`ERROR: Path [${a}] does not exist.`;if(!m.statSync(s).isDirectory())return`ERROR: Path [${a}] is a file, not a directory. Use ReadFile instead.`;if(o===1){let p=m.readdirSync(s),l=p.length,u=150,g=p.slice(0,u),d=[];for(let r of g){let $=R.join(s,r),e={name:r,type:"unknown",size:"N/A",mtime:"N/A"};try{let t=m.statSync($);e={name:r,type:t.isDirectory()?"directory":"file",size:(t.size/1024).toFixed(1)+"KB",mtime:I(t.mtime)}}catch{e.type="inaccessible"}d.push(e)}let y=d.map(r=>r.type==="directory"?`${r.name}/`:`${r.name} (${r.size}, ${r.mtime})`).join(`
2
- `),c=`
3
-
4
- (Total items in folder: ${l})`;return l>u&&(c=`
5
-
6
- TRUNCATED: Showing first ${u} of ${l} items.`),p.length=0,g.length=0,d.length=0,`Detailed folder stats for [${a}]:
7
-
8
- ${y}${c}`}let b=0,v=0,f=0,h=500,S=!1,_=(p,l,u=1)=>{if(l>o||S)return[];let g=[];try{g=m.readdirSync(p)}catch{return[`${" ".repeat(u-1)}[Inaccessible Directory]`]}let d=[],y=[];for(let e of g){let t=R.join(p,e),D=!1;try{D=m.statSync(t).isDirectory()}catch{}D?d.push({name:e,fullPath:t}):y.push({name:e,fullPath:t})}d.sort((e,t)=>e.name.localeCompare(t.name)),y.sort((e,t)=>e.name.localeCompare(t.name));let c=[],r=" ".repeat(u-1);for(let e of d){if(f>=h){S=!0,c.push(`${r}[Truncated - Maximum item limit reached (${h})]`);break}if(f++,b++,c.push(`${r}${e.name}/`),l<o&&!C(e.name)){let t=_(e.fullPath,l+1,u+1);c.push(...t)}}let $=[];for(let e of y){if(f>=h){S=!0,c.push(`${r}[Truncated - Maximum item limit reached (${h})]`);break}f++,v++;let t="N/A";try{t=(m.statSync(e.fullPath).size/1024).toFixed(1)+"KB"}catch{}$.push(`${e.name} (${t})`)}return $.length>0&&c.push(`${r}${$.join("; ")}`),c},E=_(s,1,1).join(`
9
- `),x=`
10
-
11
- (Total items scanned: ${f}, Directories: ${b}, Files: ${v})`;return S&&(x=`
12
-
13
- TRUNCATED: Scan capped at ${h} items. (Directories: ${b}, Files: ${v})`),`Detailed directory tree for [${a}] (recursive depth: ${o}):
14
-
15
- ${E}${x}`}catch(s){let k=s instanceof Error?s.message:String(s);return`ERROR: Failed to read folder [${a}]: ${k}`}};export{M as read_folder};
@@ -1,8 +0,0 @@
1
- import{a as Y}from"./chunk-Y5JU726N.js";import{b as Q}from"./chunk-B4UKMX5E.js";import"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import{w as V,x as q,y as J}from"./chunk-26BQ45XP.js";import K from"fs/promises";import E from"path";import j from"fast-glob";import{Minimatch as tt}from"minimatch";async function A(f,o,n=f,p=1){if(p>12)return[];let h=[],s;try{s=await K.readdir(f,{withFileTypes:!0})}catch{return[]}for(let t of s){let a=E.join(f,t.name),y=E.relative(n,a),L=y.split(E.sep).map(w=>w.toLowerCase()),O=t.name.toLowerCase();if(!o.some(w=>{let F=w.toLowerCase();return F.startsWith(".")&&O.endsWith(F)?!0:L.some(M=>M===F||M.startsWith(".pnpm"))}))if(t.isDirectory()){let w=await A(a,o,n,p+1);h=h.concat(w)}else t.isFile()&&h.push({fullPath:a,relativePath:y})}return h}function rt(f,o,n=1/0){if(f===o)return 0;if(f.length===0)return o.length;if(o.length===0)return f.length;if(Math.abs(f.length-o.length)>n)return n+1;let p=Array.from({length:o.length+1},(h,s)=>s);for(let h=1;h<=f.length;h++){let s=[h],t=h;for(let a=1;a<=o.length;a++){let y=f[h-1]===o[a-1]?0:1,L=Math.min(s[a-1]+1,p[a]+1,p[a-1]+y);s.push(L),L<t&&(t=L)}if(p=s,t>n)return n+1}return p[o.length]}function nt(f,o){if(!f||!o)return!1;let n=f.toLowerCase(),p=o.toLowerCase();if(n.includes(p))return!0;let h=n.split(/[^a-z0-9]+/).filter(t=>t.length>0),s=p.split(/[^a-z0-9]+/).filter(t=>t.length>1||p.length===1&&t.length>0);return s.length===0?!1:s.every(t=>{let a=t.length<=2?0:t.length<=5?1:2;for(let y of h)if(y.includes(t)||t.length>=3&&y.length>=3&&Math.abs(y.length-t.length)<=a&&rt(t,y,a)<=a)return!0;return!1})}var gt=async f=>{let{keyword:o,path:n,fuzzy:p,subString:h,regex:s}=Y(f);if(o==null)return'ERROR: Missing "keyword" argument.';let t=String(o);if(n){let e=n.trim().toLowerCase();if(e==="#docs"||e==="#doc"||e==="#documentation"||e.includes("#skill/global/fluxflow")||e.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let a=e=>e===!0||e==="true"||e===1||e==="1"||e==="yes",y=s===!1||s==="false"||s===0||s==="0"||s==="no",L=s===!0||s==="true"||s===1||s==="1"||s==="yes",O=a(p)||a(h),G=null,w=null;if(y)O||(w=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{let e=L?t:t.replace(/\|\|/g,"|");G=new RegExp(e,"i")}catch(e){if(L)return`ERROR: Invalid regex pattern "${t}": ${e.message}`}w=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let F=Array.from(new Set([...V,...q(process.cwd())])),M=150;try{let e=[],P=process.cwd(),u=null;if(n){let i=r=>r.startsWith("!")||!r.startsWith("-")?r:"!"+r.replace(/^-+/,""),g=n.split(";").map(r=>r.trim()).filter(Boolean).map(i).filter(r=>r!=="!"),c=g.some(r=>r.startsWith("!"));if(g.some(r=>j.isDynamicPattern(r)||/[*?{}[\]()|+]/.test(r))){u="glob";let r=n.replace(/\\/g,"/"),l=g.map(m=>m.replace(/\\/g,"/")),z=F.map(m=>m.startsWith(".")?`**/*${m}`:`**/${m}/**`);if(c&&!g.some(m=>!m.startsWith("!"))){let m=await A(P,F,P),R=$=>$.endsWith("/")?$+"**":$,d=l.filter($=>$.startsWith("!")).map($=>R($.slice(1))),v=l.filter($=>!$.startsWith("!")).map(R);e=m.filter($=>{let x=$.relativePath.replace(/\\/g,"/"),_=v.length===0||v.some(b=>{try{return new tt(b).match(x)}catch{return!1}}),Z=d.some(b=>{try{return new tt(b).match(x)}catch{return!1}});return _&&!Z})}else{let m=l.some(d=>/[\(\)\|]|\.\*/.test(d)),R=[];if(!m)try{R=await j(l,{cwd:P,ignore:z,dot:!0,onlyFiles:!0,absolute:!1})}catch{R=[]}if(R.length===0&&(m||j.isDynamicPattern(r))){let d=r.match(/^([^\*\?\(\)\|\[\]\s]+)\//),v=d&&!/[\*\?\(\)\|\[\]]/.test(d[1])?E.resolve(P,d[1]):P,$=await A(v,F,P);try{let x=r.replace(/^\.\//,"");x=x.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!x.startsWith("^")&&!x.startsWith(".*")&&(x=`.*${x}`);let _=new RegExp(x.endsWith("$")?x:`${x}$`,"i");e=$.filter(Z=>{let b=Z.relativePath.replace(/\\/g,"/");return _.test(b)})}catch{e=[]}}else e=R.map(d=>({fullPath:E.resolve(P,d),relativePath:d}))}}else{let r=[],l=!1,z=!1;for(let k of g){let m=k.replace(/[\/\\]+$/,""),R=E.resolve(P,m);try{let d=await K.stat(R);if(d.isDirectory()){z=!0;let v=await A(R,F,P);r.push(...v)}else if(d.isFile())l=!0,r.push({fullPath:R,relativePath:E.relative(P,R)});else return`ERROR: Path is neither a file nor a directory: ${k}`}catch{return`ERROR: Path not found: ${k}`}}e=r,l&&!z?u="file":u="dir"}}else e=await A(P,F);let et=e.map(async i=>{try{let g=await K.readFile(i.fullPath,"utf-8");if(g.includes("\0"))return[];let c=g.split(/\r?\n/),W=[];for(let l=0;l<c.length;l++)(O?c[l].toLowerCase().includes(t.toLowerCase())||nt(c[l],t):y?w&&w.test(c[l]):G&&G.test(c[l])||w&&w.test(c[l]))&&W.push({line:l+1,content:c[l].trim()});return W.length===0?null:{path:i.relativePath.replace(/\\/g,"/"),matches:W}}catch{return[]}}),st=await Promise.all(et),S=[],D=0;for(let i of st){if(!i||!i.matches)continue;if(D>=M)break;let g=M-D,c=i.matches.slice(0,g);S.push({path:i.path,matches:c}),D+=c.length}typeof global.gc=="function"&&global.gc();let I=null;if(S.length===0){let i=u==="file"?` in '${n}'`:u==="dir"||u==="glob"?` in '${n}'`:". Try to specify files",g=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"";return`${g}${g?" ":""}Found 0 matches of '${t}'${i}${I?` ${I}`:""}`}let B=I?` ${I}`:"",T=`${S.length} file${S.length===1?"":"s"}`,U=`${D} match${D===1?"":"es"}`,N;u==="file"?N=`Found ${U} of '${t}' in '${n}'${B}:`:u==="dir"||u==="glob"?N=`Found ${U} of '${t}' in '${n}' across ${T}${B}:`:N=`Found ${U} of '${t}' across ${T}${B}:`;let X=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"",C=`${X}${X?" ":""}${N}
2
-
3
- `,H="";try{let i=await Q();i?.systemSettings?.alwaysAskFiles&&(H=i.systemSettings.alwaysAskFiles)}catch{}for(let i of S)if(C+=`${i.path}:
4
- `,J(i.path,H)){let c=i.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 i.matches)C+=` Line ${c.line}: ${c.content}
7
- `;C+=`
8
- `}return C.trimEnd()}catch(e){return`ERROR: ${e.message}`}};export{gt as search_keyword};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-B4UKMX5E.js";import"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.js";export{a as PROVIDER_BASE_URLS,b as loadSettings,c as saveSettings};
@@ -1,13 +0,0 @@
1
- import{g as $,h as F,i as w,j as C}from"./chunk-7SGZ66KT.js";import{a as E}from"./chunk-6EYQQ7GQ.js";import{a as y}from"./chunk-Y5JU726N.js";import{o as R}from"./chunk-V36DXF56.js";import{b as m}from"./chunk-B4UKMX5E.js";import"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.js";import p from"fs";import k from"path";var D=async(M,P={})=>{let o=y(M),e=o.path;if(!e)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:s,allowMultiple:S,error:u}=$(o);if(u)return`ERROR: ${u}`;if(s.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let O=o.allowMultiple!==void 0?o.allowMultiple===!0||String(o.allowMultiple).toLowerCase()==="true":S,i=k.resolve(process.cwd(),e);try{if(!p.existsSync(i))return`ERROR: File [${e}] does not exist. Use WriteFile instead.`;let t=P.forcedContent||p.readFileSync(i,"utf8");t.startsWith("\uFEFF")&&(t=t.slice(1));let n=t.replace(/\r\n/g,`
2
- `).replace(/\r/g,`
3
- `),{content:l,results:a}=F(n,s,{allowMultiple:O}),c=a.filter(r=>!r.success),f=a.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${e}].
4
- ${c.map(r=>` \u2022 ${r.error}`).join(`
5
- `)}`;await E.recordFileChange(i,n),p.writeFileSync(i,l,"utf8");let{systemSettings:b}=await m(),d=C(n,l,a,12,b?.compressToolResults),{added:g,removed:h}=w(n,l);return(g>0||h>0)&&await R({added:g,removed:h,file:e}),c.length>0?`File [${e}] updated with some blocks failed. [${f.length}/${s.length}] blocks applied.
6
-
7
- Failures:
8
- ${c.map(r=>` \u2022 ${r.error}`).join(`
9
- `)}
10
-
11
- ${d}`:`File [${e}] updated. [${a.length}/${s.length}] blocks applied.
12
-
13
- ${d}`}catch(t){let n=t instanceof Error?t.message:String(t);return`ERROR: Failed to update file [${e}]: ${n}`}};export{D as update_file};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-4BLSASW6.js";import"./chunk-Y5JU726N.js";import"./chunk-26BQ45XP.js";export{a as view_file};
@@ -1,32 +0,0 @@
1
- import{a as x}from"./chunk-6EYQQ7GQ.js";import{a as k}from"./chunk-Y5JU726N.js";import{o as j}from"./chunk-V36DXF56.js";import{b as C}from"./chunk-B4UKMX5E.js";import"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import{c as F}from"./chunk-26BQ45XP.js";import e from"fs";import d from"path";var N=async(L,D={})=>{let{path:i,content:p}=k(L);if(!i)return'ERROR: Missing "path" argument for WriteFile.';if(p===void 0)return'ERROR: Missing "content" argument for WriteFile.';p=p.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
2
- `).replace(/\r/g,`
3
- `);let n=d.resolve(process.cwd(),i),y=d.dirname(n);try{await x.recordFileChange(n);let{systemSettings:o}=await C(),g=o?.overwriteProtection!==!1,a="",S=0;if(e.existsSync(n))try{let r=e.readFileSync(n,"utf8").split(/\r?\n/);if(S=r.length,!g)a="";else if(r.length<=50)a=`Old File contents:
4
- ${r.map((c,f)=>`${f+1} | ${c}`).join(`
5
- `)}
6
-
7
- `;else{let c=d.parse(n),f=d.join(F,"OverwriteBackups");e.existsSync(f)||e.mkdirSync(f,{recursive:!0});let b=`${c.name}-old-${Date.now()}${c.ext}.bak`,w=d.join(f,b);e.copyFileSync(n,w),a=`Old File contents:
8
- - Renamed old file as ${w} and written requested content in ${i}. For reversal use Run
9
-
10
- `}}catch{a=`[Note: Could not read existing file for reversal reference]
11
-
12
- `}e.existsSync(y)||e.mkdirSync(y,{recursive:!0});let h=(t=>t.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
13
- `).replace(/\r/g,`
14
- `))(p),u=h.endsWith(`
15
- `)?h:h+`
16
- `,M=u.split(/\r?\n/).length,O=Buffer.byteLength(u,"utf8");e.writeFileSync(n,u,"utf8");let m=e.readFileSync(n,"utf8"),v=Buffer.byteLength(m,"utf8"),s=m.split(/\r?\n/),l=s.length;if(v===0&&O>0)return m=null,`ERROR: CRITICAL FAILURE: Verification failed. File [${i}] is empty on disk!`;let $="";if(l<=690)$=s.join(`
17
- `);else{let t=s.slice(0,300).join(`
18
- `),r=s.slice(-300).join(`
19
- `);$=`${t}
20
-
21
- ... [${l-100} lines truncated] ...
22
-
23
- ${r}`}m=null,await j({added:l,removed:S,file:i});let R=`File [${i}] saved.
24
- - Stats: [${l} lines, ${(v/1024).toFixed(1)} KB]
25
- ${a}- Content Preview:
26
-
27
- ${$}`;if(o?.compressToolResults&&l>6e3){let t=u.split(/\r?\n/),r=t.slice(0,25).join(`
28
- `)===s.slice(0,25).join(`
29
- `),c=t.slice(-25).join(`
30
- `)===s.slice(-25).join(`
31
- `);r&&c&&(R=`[[SAME]]
32
- ${R}`)}return R}catch(o){let g=o instanceof Error?o.message:String(o);return`ERROR: Failed to write file [${i}]: ${g}`}};export{N as write_file};